/* =========================================================
   NEST MARKETING — design tokens
   ========================================================= */
:root {
  --bg:        #FFFFFF;
  --paper:     #F6F5F1;
  --paper-2:   #EFEDE6;
  --ink:       #0A0A0A;
  --ink-2:     #1F1F1F;
  --mute:      #5C5C5C;
  --mute-2:    #8A8780;
  --rule:      #E6E4DE;
  --rule-2:    #D6D3CB;
  --hover:     rgba(10, 10, 10, 0.05);
  --accent:    oklch(0.72 0.16 50);   /* warm orange — used sparingly */
  --accent-ink: oklch(0.42 0.12 50);

  --f-display: "Minion Pro", "EB Garamond", Georgia, serif;
  --f-sans:    "Good Sans", "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  /* Text elements in Studio: the same family plus Medium (see fonts.css). */
  --f-sans-studio: "Good Sans Studio", "Good Sans", "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --f-mono:    "Good Sans", "Space Grotesk", "Helvetica Neue", Arial, sans-serif;

  --sidebar-w: 240px;
  --topbar-h:  56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-sans);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--ink); color: #fff; }

/* ====== APP SHELL ====== */


.tb-btn {
  background: transparent;
  border: 1px solid var(--rule);
  padding: 6px 12px;
  font-size: 12px;
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 6px;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.tb-btn:hover { background: var(--hover); }
.tb-btn.is-primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.tb-btn.is-primary:hover { background: var(--ink-2); }
.tb-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--mute);
}
.tb-live .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent), transparent 80%);
}

/* ====== PAGE ====== */
.page { padding: 32px 40px 80px; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  margin-bottom: 32px;
}
.page-head .eyebrow {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 14px;
}
.page-head h1 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 56px;
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0;
}
.page-head h1 em { font-style: italic; }
.page-head .sub {
  color: var(--mute);
  max-width: 56ch;
  margin-top: 14px;
  font-size: 14px;
}
.page-head .head-meta {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--mute);
  text-align: right;
  line-height: 1.6;
}
.page-head .head-meta b { color: var(--ink); font-weight: 500; }

/* ====== UTILITY ====== */
.row { display: flex; }
.col { display: flex; flex-direction: column; }
.gap-8  { gap: 8px;  }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.mono { font-family: var(--f-mono); }
.eyebrow {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
}
.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0 0 16px;
}
.section-title h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.section-title .meta { font-family: var(--f-mono); font-size: 10px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.1em; }
.hr { border: 0; border-top: 1px solid var(--rule); margin: 32px 0; }

/* ====== OVERVIEW ====== */
.overview-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.kpi {
  padding: 16px 18px;
  border-right: 1px solid var(--rule);
}
.kpi:last-child { border-right: 0; }
.kpi .label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
}
.kpi .num {
  font-family: var(--f-display);
  font-size: 40px;
  line-height: 1;
  margin-top: 10px;
  letter-spacing: -0.02em;
}
.kpi .delta {
  font-family: var(--f-mono);
  font-size: 11px;
  margin-top: 8px;
  color: var(--mute);
}
.kpi .delta.up { color: oklch(0.5 0.13 145); }
.kpi .delta.dn { color: oklch(0.5 0.16 25); }

.tile-list { display: flex; flex-direction: column; }
.tile {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.tile:last-child { border-bottom: 0; }
.tile .thumb {
  width: 80px; height: 56px;
  background: var(--paper);
  position: relative;
  overflow: hidden;
}
.tile .title { font-size: 13px; font-weight: 500; }
.tile .meta { font-family: var(--f-mono); font-size: 10px; color: var(--mute); margin-top: 4px; letter-spacing: 0.04em; }
.tile .right { font-family: var(--f-mono); font-size: 11px; color: var(--mute); text-align: right; }

.quickactions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.qa {
  background: var(--bg);
  border: 0;
  padding: 18px 16px;
  text-align: left;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 116px;
  cursor: pointer;
  transition: background-color 140ms ease;
}
.qa:hover { background: var(--hover); }
.qa .ico { width: 18px; height: 18px; }
.qa .ttl { font-size: 13px; font-weight: 500; }
.qa .desc { font-size: 11px; color: var(--mute); font-family: var(--f-mono); line-height: 1.4; }

.activity { display: flex; flex-direction: column; }
.act-row {
  display: grid;
  grid-template-columns: 60px 1fr 80px;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--rule);
  font-size: 12px;
}
.act-row .t { font-family: var(--f-mono); font-size: 10px; color: var(--mute); }
.act-row .who { color: var(--mute); }
.act-row .who b { color: var(--ink); font-weight: 500; }
.act-row .tag {
  justify-self: end;
  font-family: var(--f-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
  border: 1px solid var(--rule); padding: 2px 6px; color: var(--mute);
}

/* ====== BRAND LIBRARY ====== */
.lib-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 32px;
  overflow-x: auto;
}
.lib-tab {
  border: 0; background: transparent;
  padding: 12px 0;
  margin-right: 28px;
  font-size: 13px;
  color: var(--mute);
  position: relative;
  white-space: nowrap;
}
.lib-tab .num { font-family: var(--f-mono); font-size: 10px; margin-left: 6px; color: var(--mute-2); }
.lib-tab.is-active { color: var(--ink); }
.lib-tab.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 1px; background: var(--ink);
}

/* Logos */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.logo-card {
  background: var(--bg);
  display: flex; flex-direction: column;
  min-height: 220px;
}
.logo-card .lc-canvas {
  flex: 1;
  display: grid; place-items: center;
  padding: 24px;
  background:
    linear-gradient(45deg, transparent 49%, var(--paper-2) 49% 51%, transparent 51%) 0 0 / 12px 12px,
    var(--bg);
}
.logo-card.bg-dark  .lc-canvas { background: var(--ink); }
.logo-card.bg-paper .lc-canvas { background: var(--paper); }
.logo-card.bg-light .lc-canvas { background: var(--bg); }
.logo-card .lc-img {
  display: block;
  max-width: 70%;
  max-height: 140px;
  width: auto; height: auto;
}
.logo-card .lc-foot {
  border-top: 1px solid var(--rule);
  padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.logo-card .lc-meta { display: flex; flex-direction: column; min-width: 0; }
.logo-card .lc-name {
  font-family: var(--f-sans); font-size: 12px; font-weight: 500;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.logo-card .lc-sub {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--mute);
}
.logo-card .lc-dl {
  border: 1px solid var(--rule);
  background: var(--bg);
  width: 28px; height: 28px;
  display: grid; place-items: center;
  color: var(--ink);
  text-decoration: none;
  flex: 0 0 auto;
  transition: background-color 140ms ease;
}
.logo-card .lc-dl:hover { background: var(--hover); }
.logo-card .lc-desc {
  padding: 0 14px 12px;
  font-family: var(--f-sans); font-size: 11px;
  color: var(--mute);
  line-height: 1.45;
}
.logo-group + .logo-group { margin-top: 28px; }
.logo-group-h h4 {
  font-family: var(--f-display);
  font-size: 18px; font-weight: 500;
  margin: 0; color: var(--ink);
}
.lc-formats {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 0 14px 12px;
}
.lc-format {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.06em; font-weight: 500;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}
.lc-format:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.brandmark {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 56px;
  letter-spacing: -0.04em;
  line-height: 1;
}
.brandmark.on-dark { color: var(--paper); }

/* Color */
.swatches {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.sw {
  background: var(--bg);
  display: flex; flex-direction: column;
}
.sw .sw-fill { height: 160px; border-bottom: 1px solid var(--rule); }
.sw .sw-meta { padding: 10px 12px; }
.sw .sw-meta .nm { font-size: 12px; font-weight: 500; }
.sw .sw-meta .hex { font-family: var(--f-mono); font-size: 10px; color: var(--mute); margin-top: 3px; letter-spacing: 0.04em; }
.sw .sw-meta .sw-role { color: var(--mute); font-weight: 400; }
.sw .sw-meta .sw-specs {
  margin-top: 6px;
  display: flex; flex-direction: column; gap: 2px;
  font-family: var(--f-sans);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--mute);
}

/* Type */
.type-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
}
.type-row .lbl { font-family: var(--f-mono); font-size: 10px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.12em; }
.type-row .lbl b { display: block; color: var(--ink); font-weight: 500; font-size: 11px; margin-top: 4px; letter-spacing: 0.04em; }
.type-row .lbl .scale { margin-top: 12px; font-family: var(--f-mono); font-size: 10px; line-height: 1.7; color: var(--mute); }
.type-row .specimen-display {
  font-family: var(--f-display);
  font-size: 84px;
  line-height: 0.95;
  letter-spacing: -0.025em;
}
.type-row .specimen-display em { font-style: italic; }
.type-row .specimen-sans {
  font-family: var(--f-sans);
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 400;
}
.type-row .specimen-mono {
  font-family: var(--f-mono);
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: 0;
}

/* Imagery */
.imagery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.img-card {
  background: var(--paper);
  aspect-ratio: 4 / 5;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rule);
}
.img-card.wide { grid-column: span 2; aspect-ratio: 8/5; }
.img-card .ph-stripes {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(135deg,
      var(--paper) 0 8px,
      var(--paper-2) 8px 16px);
}
.img-card .ph-label {
  position: absolute;
  left: 12px; bottom: 12px;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--ink);
  background: var(--bg);
  padding: 4px 6px;
  letter-spacing: 0.04em;
}
.img-card .ph-meta {
  position: absolute;
  right: 12px; top: 12px;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--mute);
}

/* Voice */
.voice-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--rule); border: 1px solid var(--rule);
}
.voice-card { background: var(--bg); padding: 24px; min-height: 240px; display: flex; flex-direction: column; gap: 14px; }
.voice-card .v-h {
  font-family: var(--f-display);
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.voice-card .v-h em { font-style: italic; }
.voice-card .v-do, .voice-card .v-dont {
  font-size: 12px;
  display: flex; gap: 8px;
  padding-top: 10px; border-top: 1px solid var(--rule);
}
.voice-card .v-do .k, .voice-card .v-dont .k {
  font-family: var(--f-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--mute); flex: 0 0 36px;
}

/* ====== STUDIO (CREATE) ====== */
.studio {
  display: grid;
  grid-template-columns: 320px 1fr 300px;
  gap: 0;
  border: 1px solid var(--rule);
  min-height: 640px;
}
.st-col { border-right: 1px solid var(--rule); display: flex; flex-direction: column; }
.st-col:last-child { border-right: 0; }
.st-col-h {
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--mute);
  background: var(--paper);
}
.st-col-h .badge {
  font-family: var(--f-mono); font-size: 10px;
  color: var(--mute); padding: 2px 6px;
  border: 1px solid var(--rule);
}

.st-templates { padding: 14px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.tpl {
  border: 1px solid var(--rule);
  padding: 12px;
  background: var(--bg);
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  cursor: pointer;
  align-items: center;
  transition: background-color 140ms ease;
}
.tpl:hover { background: var(--hover); }
.tpl.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }
.tpl.is-active .tpl-meta { color: rgba(255,255,255,0.6); }
.tpl .tpl-preview {
  width: 56px; height: 56px;
  background: var(--paper-2);
  display: grid; place-items: center;
  font-family: var(--f-display);
  font-style: italic;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.tpl.is-active .tpl-preview { background: #fff; color: var(--ink); }
.tpl .tpl-name { font-size: 13px; font-weight: 500; }
.tpl .tpl-meta { font-family: var(--f-mono); font-size: 10px; color: var(--mute); margin-top: 2px; letter-spacing: 0.04em; }

.st-canvas {
  flex: 1;
  display: flex; flex-direction: column;
  background: var(--paper);
  padding: 28px;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.st-canvas .canvas-meta {
  width: 100%;
  display: flex; justify-content: space-between;
  font-family: var(--f-mono); font-size: 10px; color: var(--mute);
  text-transform: uppercase; letter-spacing: 0.12em;
}
.ad {
  width: 420px; height: 520px;
  background: var(--bg);
  border: 1px solid var(--rule);
  position: relative;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.ad.square { width: 480px; height: 480px; }
.ad.story  { width: 320px; height: 568px; }
.ad.dark { background: var(--ink); color: var(--paper); }
.ad-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
}
.ad.dark .ad-head { color: var(--mute-2); }
.ad-art {
  flex: 1; margin: 0 18px; position: relative;
  background:
    repeating-linear-gradient(135deg,
      var(--paper) 0 10px,
      var(--paper-2) 10px 20px);
  border: 1px solid var(--rule);
}
.ad.dark .ad-art { background: var(--ink-2); border-color: #2a2a2a; }
.ad-art .art-label {
  position: absolute; left: 10px; bottom: 10px;
  font-family: var(--f-mono); font-size: 10px;
  background: var(--bg); padding: 3px 6px;
  color: var(--ink);
}
.ad-copy { padding: 18px; }
.ad-copy .head {
  font-family: var(--f-display);
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.ad-copy .head em { font-style: italic; }
.ad-copy .sub {
  font-size: 12px;
  color: var(--mute);
  margin-top: 10px;
  max-width: 32ch;
}
.ad.dark .ad-copy .sub { color: var(--mute-2); }
.ad-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-top: 1px solid var(--rule);
  font-family: var(--f-mono);
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
}
.ad.dark .ad-foot { border-color: #2a2a2a; }
.ad-foot .cta {
  background: var(--ink); color: #fff; padding: 6px 10px;
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: 0.12em;
}
.ad.dark .ad-foot .cta { background: var(--paper); color: var(--ink); }

.st-controls { padding: 16px 18px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.ctrl-group .lbl {
  font-family: var(--f-mono); font-size: 10px; color: var(--mute);
  text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.ctrl-group input[type=text],
.ctrl-group textarea {
  width: 100%;
  font-family: var(--f-sans);
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
  border-radius: 0;
  resize: vertical;
}
.ctrl-group input:focus,
.ctrl-group textarea:focus {
  outline: 0; border-color: var(--ink);
}
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  border: 1px solid var(--rule);
}
.seg button {
  border: 0; background: transparent;
  padding: 7px 4px;
  font-size: 11px;
  border-right: 1px solid var(--rule);
  color: var(--mute);
}
.seg button:last-child { border-right: 0; }
.seg button.is-on { background: var(--ink); color: #fff; }

.gen-button {
  margin-top: 8px;
  width: 100%;
  padding: 12px;
  background: var(--ink);
  color: #fff;
  border: 0;
  font-size: 13px;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.gen-button:hover { background: var(--ink-2); }
.gen-button:disabled { opacity: 0.55; cursor: not-allowed; }

.copyvariants { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 0; }
.cv {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.cv:last-child { border-bottom: 0; }
.cv .cv-h { display: flex; justify-content: space-between; align-items: center; }
.cv .cv-k { font-family: var(--f-mono); font-size: 10px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.12em; }
.cv .cv-actions { display: flex; gap: 6px; }
.cv .cv-actions button {
  border: 0; background: transparent; padding: 0;
  font-family: var(--f-mono); font-size: 10px; color: var(--mute);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.cv .cv-actions button:hover { color: var(--ink); }
.cv .cv-text {
  font-size: 13px; margin-top: 6px; line-height: 1.4;
}

/* ====== CONTENT PLAN ====== */
.plan-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 0;
}
.plan-toolbar .left { display: flex; align-items: center; gap: 16px; }
.plan-toolbar .month {
  font-family: var(--f-display);
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.plan-toolbar .month em { font-style: italic; }
.plan-toolbar .nav-btn {
  width: 28px; height: 28px; border: 1px solid var(--rule);
  background: transparent; display: grid; place-items: center;
}
.plan-toolbar .filter-pills {
  display: flex; gap: 6px;
}
.pill {
  border: 1px solid var(--rule);
  padding: 4px 10px;
  font-size: 11px;
  color: var(--mute);
  background: transparent;
}
.pill.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }

.cal {
  display: grid;
  /* minmax(0, …): en lång rubrik i en cell får aldrig bredda kolumnen — det
     var det som gjorde att dagar med inlägg blev fyra gånger så breda. */
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-left: 1px solid var(--rule);
  border-top: 1px solid var(--rule);
}
.cal-dh {
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 8px 12px;
  font-family: var(--f-mono);
  font-size: 10px; letter-spacing: 0.12em;
  color: var(--mute); text-transform: uppercase;
  background: var(--paper);
}
.cal-cell {
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  min-height: 124px;
  padding: 8px;
  display: flex; flex-direction: column; gap: 4px;
  position: relative;
  min-width: 0; overflow: hidden;
}
.cal-cell.is-otherm { background: var(--paper); }
.cal-cell.is-today .daynum {
  background: var(--ink); color: #fff;
  width: 22px; height: 22px; display: inline-grid; place-items: center;
  border-radius: 50%;
}
.cal-cell .daynum {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink);
}
.cal-cell.is-otherm .daynum { color: var(--mute-2); }
.cal-event {
  font-family: var(--f-sans);
  font-size: 11px;
  padding: 4px 6px;
  border: 1px solid var(--rule);
  background: var(--bg);
  display: flex; align-items: center; gap: 6px;
  cursor: pointer;
  transition: background-color 140ms ease;
}
.cal-event:hover { background: var(--hover); }
.cal-event .ch-dot {
  width: 6px; height: 6px; flex: 0 0 6px;
  background: var(--ink);
  border-radius: 50%;
}
.cal-event.ch-paid .ch-dot      { background: var(--accent); }
.cal-event.ch-social .ch-dot    { background: var(--ink); }
.cal-event.ch-email .ch-dot     { background: var(--mute); }
.cal-event.ch-blog .ch-dot      { background: transparent; border: 1px solid var(--ink); border-radius: 50%; box-sizing: border-box; }
.cal-event { min-width: 0; padding: 4px; border-radius: 6px; }
.cal-event .ev-thumb { width: 30px; height: 30px; flex: 0 0 30px; object-fit: cover; border-radius: 4px; background: var(--paper-2); }
.cal-event .ev-thumb-empty { display: inline-block; background: repeating-linear-gradient(135deg, var(--paper-2) 0 4px, var(--paper) 4px 8px); }
.cal-event .ev-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.cal-event .ev-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; line-height: 1.25; }
.cal-event .ev-meta { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cal-event .ev-meta .ch-chip { height: 14px; min-width: 18px; padding: 0 4px; font-size: 8.5px; }
.cal-event .ev-time { font-family: var(--f-mono); font-size: 9px; color: var(--mute); margin-left: auto; }
.cal-more { align-self: flex-start; border: 0; background: transparent; padding: 2px 4px; font-family: var(--f-mono); font-size: 10px; color: var(--mute); cursor: pointer; }
.cal-more:hover { color: var(--ink); text-decoration: underline; }
/* Förhandsvisning vid hover — fast i fönstret, tar aldrig musen. */
.cal-pop { position: fixed; z-index: 300; pointer-events: none; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0,0,0,.18); overflow: hidden; max-height: calc(100vh - 16px); }
.cal-pop-img { display: block; width: 100%; height: 190px; object-fit: cover; }
.cal-pop-body { padding: 10px 12px 12px; font-family: var(--f-sans); }
.cal-pop-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-family: var(--f-mono); font-size: 10px; color: var(--mute); margin-bottom: 6px; }
.cal-pop-t { font-size: 12.5px; line-height: 1.45; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.cal-pop-hist { margin-top: 6px; font-size: 10.5px; color: var(--mute); }
.cal-event.is-draft { border-style: dashed; color: var(--mute); }

.plan-queue {
  margin-top: 36px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
}
.queue-table {
  width: 100%;
  border-top: 1px solid var(--rule);
}
.queue-table .qrow {
  display: grid;
  grid-template-columns: 64px 1.6fr 1fr 0.8fr 0.8fr 80px;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 12px;
}
.queue-table .qrow.qhead {
  font-family: var(--f-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--mute);
  padding: 10px 0;
}
.queue-table .qrow .qthumb {
  width: 56px; height: 40px;
  background:
    repeating-linear-gradient(135deg,
      var(--paper) 0 6px, var(--paper-2) 6px 12px);
  border: 1px solid var(--rule);
}
.queue-table .qrow .qtitle { font-weight: 500; }
.queue-table .qrow .qmeta { font-family: var(--f-mono); font-size: 10px; color: var(--mute); margin-top: 2px; letter-spacing: 0.04em; }
.qstatus {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--mute);
}
.qstatus .d { width: 6px; height: 6px; border-radius: 50%; background: var(--mute); }
.qstatus.is-scheduled .d { background: var(--ink); }
.qstatus.is-draft     .d { background: transparent; border: 1px solid var(--mute); }
.qstatus.is-review    .d { background: var(--accent); }
.qstatus.is-live      .d { background: oklch(0.55 0.15 145); }

.legend { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border: 1px solid var(--rule); background: var(--paper); }
.legend h4 { margin: 0 0 4px; font-size: 11px; font-family: var(--f-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--mute); font-weight: 500; }
.legend .li { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.legend .li .d { width: 8px; height: 8px; border-radius: 50%; }
.legend .li .d.paid { background: var(--accent); }
.legend .li .d.social { background: var(--ink); }
.legend .li .d.email { background: var(--mute); }
.legend .li .d.blog { border: 1px solid var(--ink); }

/* ====== INSIGHTS ====== */
.chart {
  border: 1px solid var(--rule);
  padding: 24px;
  background: var(--bg);
}
.chart svg { display: block; width: 100%; height: auto; }
.bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 56px;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--rule);
}
.bar-row:last-child { border-bottom: 0; }
.bar-row .nm { font-size: 12px; }
.bar-row .vol { font-family: var(--f-mono); font-size: 11px; color: var(--mute); text-align: right; }
.bar-track { height: 6px; background: var(--paper); position: relative; }
.bar-fill { height: 100%; background: var(--ink); }

/* ====== TWEAK-DRIVEN VISIBILITY ====== */
body[data-tw-hero="off"]     .page-head h1,
body[data-tw-subtitle="off"] .page-head .sub,
body[data-tw-headmeta="off"] .page-head .head-meta,
body[data-tw-eyebrows="off"] .page-head .eyebrow {
  display: none;
}
/* When the hero is off and there is no subtitle either, collapse the head spacing */
body[data-tw-hero="off"][data-tw-subtitle="off"][data-tw-headmeta="off"] .page-head {
  padding-bottom: 12px;
  margin-bottom: 20px;
}
body[data-tw-hero="off"][data-tw-subtitle="off"][data-tw-eyebrows="off"][data-tw-headmeta="off"] .page-head {
  display: none;
}

/* scrollbars */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--rule-2); }
*::-webkit-scrollbar-track { background: transparent; }

/* People page */
.people-section { margin-top: 28px; }
.people-filter { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.invite-form {
  display: grid; gap: 10px;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  align-items: center;
}
.invite-form .text-input { font-size: 12px; }
.invite-form button { white-space: nowrap; }
.role-warning {
  font-family: var(--f-sans); font-size: 12px;
  color: var(--mute);
  background: var(--paper);
  border: 1px dashed var(--rule-2);
  padding: 10px 14px;
  margin: 8px 0 16px;
}
.role-warning em { font-style: italic; color: var(--ink); }
.people-table { border-top: 1px solid var(--rule); margin-top: 4px; }
.ppl-row, .ppl-head {
  display: grid;
  grid-template-columns: 1.6fr 1.4fr 1fr 1.2fr 100px;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--f-sans); font-size: 12px;
}
.ppl-head {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mute); background: var(--paper);
}
.ppl-person { display: inline-flex; align-items: center; gap: 10px; }
.ppl-name { font-weight: 500; color: var(--ink); }
.ppl-em, .ppl-org { color: var(--mute); }
.ppl-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px;
}
.ppl-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--st-green); }
.ppl-status.is-invited::before { background: var(--st-amber); }
.ppl-status.is-invited { color: var(--mute); }

/* Settings tabs */
.settings-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 24px;
}
.settings-pane { padding: 0; }
.settings-pane.two-col {
  display: grid; grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: start;
}

/* Roles list (also reused for Flows list) */
.roles-list {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--rule);
}
.role-row {
  display: flex; flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 0; background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms ease;
}
.role-row:hover { background: var(--hover); }
.role-row.is-active { background: var(--bg); }
.role-row-name { font-family: var(--f-sans); font-size: 13px; font-weight: 500; color: var(--ink); }
.role-row-meta {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.08em; color: var(--mute);
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 8px;
}
.role-tag {
  font-size: 9px; letter-spacing: 0.06em;
  padding: 1px 6px;
  background: var(--ink); color: #fff;
  border-radius: 8px;
}
.role-add { margin-top: 8px; justify-content: center; }

/* Roles detail (permission grid) */
.roles-detail .section-title:not(:first-child) { margin-top: 16px; }
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.perm-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px;
  border: 1px solid var(--rule);
  cursor: pointer;
  background: var(--bg);
  transition: background-color 140ms ease, border-color 140ms ease;
}
.perm-row:hover { background: var(--hover); }
.perm-row.is-on { border-color: var(--ink); background: var(--paper); }
.perm-row input { margin-top: 2px; }
.perm-meta { display: flex; flex-direction: column; gap: 2px; }
.perm-label { font-family: var(--f-sans); font-size: 12px; font-weight: 500; color: var(--ink); }
.perm-desc  { font-family: var(--f-sans); font-size: 11px; color: var(--mute); line-height: 1.4; }

/* Flow stage editor */
.flow-stages { display: flex; flex-direction: column; gap: 8px; }
.flow-stage {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px; align-items: center;
  padding: 10px;
  border: 1px solid var(--rule);
  background: var(--bg);
}
.flow-stage-idx {
  width: 28px; height: 28px;
  background: var(--ink); color: #fff;
  font-family: var(--f-sans); font-size: 12px; font-weight: 500;
  border-radius: 50%;
  display: grid; place-items: center;
}
.flow-stage-body { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.flow-stage-ops { display: inline-flex; gap: 4px; }

/* Approval pipeline (drawer + reusable) */
.pipeline-label {
  display: flex; align-items: center; justify-content: space-between;
}
.pl-progress {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--mute);
}
.pipeline {
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 14px 16px;
}
.pl-stage {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  padding: 6px 0;
}
.pl-rail { display: flex; flex-direction: column; align-items: center; padding-top: 2px; }
.pl-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--rule-2);
  display: grid; place-items: center;
  flex: 0 0 20px;
}
.pl-stage.is-done .pl-dot { background: var(--st-green); border-color: var(--st-green); }
.pl-stage.is-current .pl-dot { border-color: var(--ink); background: var(--bg); }
.pl-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink);
  animation: pl-pulse 1.6s ease-in-out infinite;
}
@keyframes pl-pulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50%     { transform: scale(0.6); opacity: 0.4; }
}
.pl-line {
  width: 1.5px; flex: 1; min-height: 18px;
  background: var(--rule-2);
  margin-top: 2px;
}
.pl-stage.is-done .pl-line { background: var(--st-green); }
.pl-body { display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px; }
.pl-label { font-family: var(--f-sans); font-size: 13px; font-weight: 500; color: var(--ink); }
.pl-meta { font-family: var(--f-sans); font-size: 11px; color: var(--mute); }
.pl-meta b { font-weight: 500; color: var(--ink); }
.pl-action { display: inline-flex; gap: 8px; align-items: center; margin-top: 4px; }
.pl-need {
  font-family: var(--f-sans); font-size: 11px;
  color: var(--mute); font-style: italic;
}

/* Platform settings */
.role-tag.is-on  { background: var(--st-green); }
.role-tag.is-off { background: var(--rule-2); color: var(--mute); }
.toggle-row {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-sans); font-size: 13px;
  color: var(--ink); cursor: pointer;
}
.field-help {
  font-family: var(--f-sans); font-size: 11px;
  color: var(--mute); line-height: 1.5;
}
.format-list { display: flex; flex-direction: column; gap: 10px; }
.format-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px; align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  background: var(--bg);
}
.format-row.is-off { opacity: 0.5; }
.format-aspect {
  width: 56px; max-height: 56px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
}
.format-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.format-dims {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-sans); font-size: 11px; color: var(--mute);
}
.text-input.mini { width: 64px; padding: 4px 6px; font-size: 12px; }
.format-dims .ratio {
  padding: 2px 6px;
  background: var(--paper);
  border-radius: 8px;
  font-size: 10px; letter-spacing: 0.04em;
}
.format-dims select.text-input { width: auto; padding: 4px 6px; }
.format-ops { display: inline-flex; gap: 4px; }

/* ===== Studio v2 ===== */
.studio-step {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}
.studio-step:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.studio-step-h {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 14px;
}
.studio-step-h h3 {
  font-family: var(--f-display);
  font-size: 22px; font-weight: 500;
  letter-spacing: -0.01em; margin: 0;
  color: var(--ink);
}
.studio-step-h .step-i {
  width: 28px; height: 28px;
  background: var(--ink); color: #fff;
  font-family: var(--f-sans); font-size: 12px; font-weight: 500;
  border-radius: 50%;
  display: grid; place-items: center;
}
.studio-step-h .meta {
  font-family: var(--f-sans); font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.06em;
}
.studio-brief {
  display: grid; grid-template-columns: 1fr 280px; gap: 24px;
}
.brief-area { min-height: 140px; }
.brief-side { display: flex; flex-direction: column; gap: 12px; }
.brief-pills { display: flex; flex-wrap: wrap; gap: 6px; }

/* Copy variants per channel */
.copy-by-channel { display: flex; flex-direction: column; gap: 16px; }
.cbc {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
}
.cbc-h { display: flex; align-items: center; gap: 8px; }
.cbc-name { font-family: var(--f-sans); font-size: 13px; font-weight: 500; }
.cbc-count {
  margin-left: auto; margin-right: 6px;
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.08em; color: var(--mute);
  text-transform: uppercase;
}
.cbc-variants { display: flex; gap: 6px; flex-wrap: wrap; }

/* Copy-generation loader. Shows shimmery placeholder rows where the textarea
   normally sits, so the user has a clear "Claude is writing" affordance for
   the few seconds the API call takes. */
.cbc.is-loading { opacity: 0.95; }
.cbc-shimmer {
  display: flex; flex-direction: column; gap: 8px;
  padding: 4px 0 6px;
  min-height: 80px;
}
.shimmer-line {
  display: block; height: 10px;
  background: linear-gradient(
    90deg,
    rgba(10,10,10,0.06) 0%,
    rgba(10,10,10,0.12) 40%,
    rgba(10,10,10,0.06) 80%
  );
  background-size: 240% 100%;
  animation: shimmer-slide 1.4s ease-in-out infinite;
  border-radius: 2px;
}
.shimmer-line.w-45 { width: 45%; }
.shimmer-line.w-60 { width: 60%; }
.shimmer-line.w-80 { width: 80%; }
.shimmer-line.w-90 { width: 90%; }
.shimmer-line.w-95 { width: 95%; }
@keyframes shimmer-slide {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Inline "Claude skriver…" indicator next to the section title */
.copy-loader-title {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--f-sans); font-size: 11px;
  color: var(--mute);
}
.copy-loader-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--mute);
  display: inline-block;
  animation: copy-loader-pulse 1.2s ease-in-out infinite;
}
.copy-loader-dot:nth-child(2) { animation-delay: 0.2s; }
.copy-loader-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes copy-loader-pulse {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30%           { opacity: 1;   transform: translateY(-2px); }
}

/* Spinner inside the primary Generera button */
.gen-button .gen-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gen-spin 0.9s linear infinite;
  margin-right: 2px;
}
@keyframes gen-spin { to { transform: rotate(360deg); } }
.gen-button.is-loading { cursor: progress; }
.variant-pill {
  border: 1px solid var(--rule);
  background: var(--bg);
  padding: 3px 10px;
  font-family: var(--f-sans); font-size: 11px;
  color: var(--mute);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}
.variant-pill:hover { background: var(--hover); color: var(--ink); }
.variant-pill.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Media step — uploaders, channel rows, draggable crop */
.studio-media { display: flex; flex-direction: column; gap: 22px; }

.media-uploader {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 16px;
  border: 1px dashed var(--rule-2);
  background: var(--paper);
}
.media-uploader.is-compact {
  flex-direction: row; align-items: center; gap: 10px;
  padding: 6px 10px;
  background: transparent;
  border: 0;
  margin-left: auto;
}
.media-uploader-head { display: flex; align-items: center; gap: 8px; }
.media-uploader-label {
  font-family: var(--f-sans); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mute);
}
.media-kind-tag {
  font-family: var(--f-sans); font-size: 10px;
  padding: 1px 7px;
  border-radius: 8px;
  background: var(--ink); color: #fff;
  letter-spacing: 0.04em;
}
.media-uploader-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.media-filename {
  font-family: var(--f-sans); font-size: 11px;
  color: var(--mute);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 280px;
}

.channel-row {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--rule);
}
.channel-row-h {
  display: flex; align-items: center; gap: 10px;
}
.channel-row-name {
  font-family: var(--f-display); font-size: 18px;
  font-weight: 500; color: var(--ink);
}
.channel-row-count {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mute);
}
.channel-row-cards {
  display: flex; gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.fp {
  flex: 0 0 auto;
  display: flex; flex-direction: column; gap: 8px;
  width: 240px;
}
.fp-h {
  display: flex; align-items: center; gap: 8px;
  min-height: 18px;
}
.fp-name { font-family: var(--f-sans); font-size: 12px; font-weight: 500; color: var(--ink); }
.fp-dims {
  margin-left: auto;
  font-family: var(--f-sans); font-size: 10px;
  color: var(--mute);
  letter-spacing: 0.04em;
}
.fp-reset {
  border: 1px solid var(--rule);
  background: var(--bg);
  width: 22px; height: 22px;
  padding: 0;
  font-size: 12px;
  color: var(--mute);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}
.fp-reset:hover { background: var(--hover); color: var(--ink); }
.fp-export { display: inline-grid; place-items: center; margin-left: 6px; }
.fp-export:disabled { opacity: 0.5; cursor: progress; }
.fp-frame {
  position: relative; width: 100%;
  background: var(--paper-2);
  overflow: hidden;
  max-height: 420px;
  border: 1px solid var(--rule);
}
.fp-frame.has-media { cursor: grab; }
.fp-frame.is-dragging { cursor: grabbing; }
.fp-frame img,
.fp-frame video {
  display: block; width: 100%; height: 100%;
  object-fit: cover;
  user-select: none; -webkit-user-drag: none;
  pointer-events: none;
}
.fp-empty {
  display: grid; place-items: center; height: 100%;
  color: var(--mute-2); font-family: var(--f-sans); font-size: 11px;
}
.fp-mark {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: grab;
  user-select: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.fp-mark:active { cursor: grabbing; }
.fp-mark svg { pointer-events: none; }
.fp-mark img { pointer-events: none; }

/* The underlying media is rendered as a positioned layer so the z-index
   stack can mix it with the marks. The old img/video rule above the mark
   styles still applies (object-fit: cover etc.). */
.fp-layer-image {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  user-select: none; -webkit-user-drag: none;
}
.fp-frame.is-resizing { cursor: nwse-resize; }

/* Photoshop-style selection ring on the active mark. The corner handles are
   small white rectangles outlined in the ink colour so they read on any
   background — same idiom as Word and Figma. */
.fp-mark.is-selected {
  outline: 1px solid rgba(255,255,255,0.95);
  box-shadow: 0 0 0 1px rgba(10,10,10,0.95);
}
.fp-resize {
  position: absolute;
  width: 9px; height: 9px;
  background: #fff;
  border: 1px solid var(--ink);
  z-index: 5;
}
.fp-resize-nw { top: -5px; left: -5px;  cursor: nwse-resize; }
.fp-resize-ne { top: -5px; right: -5px; cursor: nesw-resize; }
.fp-resize-sw { bottom: -5px; left: -5px;  cursor: nesw-resize; }
.fp-resize-se { bottom: -5px; right: -5px; cursor: nwse-resize; }

/* When the image layer is selected, frame the whole frame instead — the
   image fills its parent, so the bounding box is the frame edges. */
.fp-image-selection {
  position: absolute; inset: 0;
  pointer-events: none;
  outline: 1px solid rgba(255,255,255,0.95);
  box-shadow: inset 0 0 0 1px rgba(10,10,10,0.95);
  z-index: 4;
}

/* Floating toolbar above each preview card while something is selected.
   Keeps the layer-order controls within easy reach without taking up space
   when nothing is selected. */
.fp-select-toolbar {
  display: flex; align-items: center; gap: 4px;
  margin: 4px 0 6px;
  padding: 4px 6px;
  border: 1px solid var(--rule);
  background: var(--bg);
  font-family: var(--f-sans);
}
.fp-select-toolbar .fp-select-label {
  font-size: 10px; letter-spacing: 0.08em; color: var(--mute);
  text-transform: uppercase;
  margin-right: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1;
}
.fp-select-toolbar .nav-btn {
  width: 22px; height: 22px; padding: 0;
  font-size: 13px; line-height: 1;
}
.fp-select-toolbar .fp-select-close { margin-left: 2px; font-size: 14px; }
.fp-select-toolbar .fp-select-hint {
  margin-left: 8px;
  font-size: 10px; letter-spacing: 0.06em;
  color: var(--mute-2);
  text-transform: none;
}

/* Native-feeling context menu — fixed-position, opens at the cursor. Items
   match the small-text idiom used elsewhere in the app. Can grow with more
   commands (duplicate / lock / hide …) without redesigning anything. */
.fp-context-menu {
  position: fixed; z-index: 200;
  min-width: 170px;
  background: #fff;
  border: 1px solid var(--rule);
  box-shadow: 0 14px 36px rgba(10,10,10,0.18);
  padding: 4px;
  display: flex; flex-direction: column;
}
.fp-context-item {
  text-align: left;
  padding: 6px 10px;
  font-family: var(--f-sans); font-size: 12px;
  background: transparent; border: 0; cursor: pointer;
  color: var(--ink);
  transition: background-color 100ms ease;
}
.fp-context-item:hover { background: var(--hover); }
.fp-context-item:disabled { color: var(--mute-2); cursor: not-allowed; }
.fp-context-divider { height: 1px; background: var(--rule); margin: 4px 0; }

/* Reusable action dropdown (currently used by the Studio selection toolbar
   and the channel-graphic-templates picker). */
.action-menu { position: relative; display: inline-flex; }
.action-menu-trigger { width: auto; min-width: 22px; padding: 0 6px; font-size: 14px; line-height: 1; }
.action-menu-list {
  position: absolute; top: calc(100% + 4px); z-index: 60;
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--rule);
  box-shadow: 0 10px 28px rgba(10,10,10,0.10);
  padding: 4px;
  display: flex; flex-direction: column;
}
.action-menu.is-right .action-menu-list { right: 0; }
.action-menu.is-left  .action-menu-list { left: 0; }
.action-menu-item {
  text-align: left;
  padding: 6px 10px;
  font-family: var(--f-sans); font-size: 12px;
  background: transparent; border: 0; cursor: pointer;
  color: var(--ink);
  transition: background-color 100ms ease;
}
.action-menu-item:hover { background: var(--hover); }
.action-menu-item:disabled { color: var(--mute-2); cursor: not-allowed; background: transparent; }
.action-menu-item.is-destructive { color: #c44a3c; }
.action-menu-item.is-destructive:hover { background: rgba(196,74,60,0.08); }
.action-menu-divider {
  height: 1px; background: var(--rule); margin: 4px 0;
}

/* ─────────────────────────────────────────────────────────────
   Platform chrome — wraps .fp-frame with platform-specific UI
   so the preview reads as how it'll actually appear in-feed.
   ───────────────────────────────────────────────────────────── */
.fp-kind-ig-feed,
.fp-kind-li-feed,
.fp-kind-fb-feed,
.fp-kind-yt-video { width: 280px; }

.chrome {
  background: #fff;
  border: 1px solid var(--rule);
  display: flex; flex-direction: column;
  font-family: var(--f-sans);
  color: #262626;
  font-size: 12px;
  overflow: hidden;
}
.chrome .fp-frame { border: 0; max-height: 460px; }

.chrome-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
}
.chrome-meta { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.chrome-meta.col { flex-direction: column; align-items: flex-start; gap: 0; }
.chrome-name { font-weight: 600; font-size: 12px; color: #262626; }
.chrome-name.light { color: #fff; }
.chrome-sub { font-size: 11px; color: var(--mute); display: inline-flex; align-items: center; gap: 4px; }
.chrome-sub.xs { font-size: 10px; }
.chrome-sub.light { color: rgba(255,255,255,0.85); }
.chrome-avatar {
  display: inline-grid; place-items: center; border-radius: 50%;
  background: var(--ink); color: #fff;
  font-weight: 600; font-size: 10px;
  overflow: hidden;
}
.chrome-avatar.is-light { background: rgba(255,255,255,0.18); color: #fff; backdrop-filter: blur(8px); }
.chrome-avatar.has-logo { background: #fff; border: 1px solid var(--rule); }
.chrome-avatar.has-logo img { width: 70%; height: 70%; object-fit: contain; }
.chrome-mute { color: var(--mute-2); font-style: italic; }
.chrome-pf {
  display: inline-flex; align-items: center;
  color: var(--mute);
  margin-left: auto;
}
.chrome-pf + svg { margin-left: 8px; }
.chrome-pf.light { color: rgba(255,255,255,0.85); margin-left: auto; }

.chrome-actions {
  display: flex; align-items: center; gap: 14px;
  padding: 8px 10px;
  color: #262626;
}
.chrome-actions svg { display: block; }
.chrome-spacer { flex: 1; }
.chrome-caption {
  padding: 4px 10px 10px;
  line-height: 1.35;
  font-size: 12px;
  color: #262626;
}
.chrome-caption strong { font-weight: 600; margin-right: 6px; }
.chrome-caption.light { color: #fff; }

/* Instagram feed specifics */
.chrome-ig-feed .chrome-actions { padding-top: 6px; padding-bottom: 4px; }

/* Full-bleed: story / reel / tiktok / shorts — overlays on top of frame */
.chrome-full {
  position: relative;
  background: #000;
  border: 0;
}
.chrome-full .fp-frame {
  background: #111;
}
.chrome-top-overlay {
  position: absolute; left: 0; right: 0; top: 0;
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent);
  pointer-events: none;
}
.chrome-overlay-row { display: flex; align-items: center; gap: 8px; }
.chrome-progress {
  display: flex; gap: 4px; height: 2px; width: 100%;
}
.chrome-progress span { flex: 1; background: rgba(255,255,255,0.95); }
.chrome-progress span.dim { background: rgba(255,255,255,0.35); }
.chrome-bottom-overlay {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 10px 10px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.55), transparent);
  pointer-events: none;
  color: #fff;
}
.chrome-bottom-overlay .chrome-caption { padding: 0; color: #fff; }
.chrome-story-cta {
  margin-top: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 18px;
  font-size: 11px; color: #fff;
  display: inline-block;
}
.chrome-rail {
  position: absolute; right: 8px; bottom: 90px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: #fff;
  pointer-events: none;
}
.chrome-rail svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }
.chrome-rail-n { font-size: 10px; font-weight: 600; margin-bottom: 4px; }

/* LinkedIn */
.chrome-li-feed .chrome-bar { padding: 10px 12px; align-items: flex-start; }
.chrome-caption.li { padding: 0 12px 8px; font-size: 12px; }
.chrome-promoted {
  margin-top: 6px;
  font-size: 10px; color: var(--mute);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.chrome-actions.li, .chrome-actions.fb {
  border-top: 1px solid var(--rule);
  padding: 6px 8px;
  gap: 4px;
  justify-content: space-around;
}
.chrome-react {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--mute);
  padding: 4px 6px;
}

/* Facebook */
.chrome-fb-feed .chrome-bar { padding: 10px 12px; align-items: flex-start; }
.chrome-caption.fb { padding: 0 12px 8px; }

/* YouTube video */
.chrome-yt-frame { position: relative; }
.chrome-yt-play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: #fff;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  opacity: 0.85;
}
.chrome-yt-time {
  position: absolute; right: 6px; bottom: 6px;
  background: rgba(0,0,0,0.75); color: #fff;
  font-size: 10px; padding: 1px 4px;
  border-radius: 2px;
}
.chrome-yt-row {
  display: flex; gap: 10px; padding: 10px 4px;
}
.chrome-yt-title { font-weight: 600; font-size: 12px; color: #262626; line-height: 1.3; }

/* Newsletter */
.chrome-nl-head {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  font-size: 11px; color: var(--mute);
  border-bottom: 1px solid var(--rule);
}
.chrome-nl-from { color: #262626; font-weight: 500; }
.chrome-nl-date { margin-left: auto; }
.chrome-nl-subject {
  padding: 10px 10px 8px;
  font-family: var(--f-display); font-size: 16px;
  color: #262626;
}

/* Web hero */
.chrome-web-bar {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 8px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.chrome-web-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rule-2); }
.chrome-web-url {
  margin-left: 8px;
  font-family: var(--f-sans); font-size: 10px;
  color: var(--mute);
  background: #fff; padding: 2px 8px; border: 1px solid var(--rule);
  border-radius: 10px; flex: 1; text-align: center;
}

/* Active marks toolbar */
.staged-marks {
  margin-top: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.staged-marks-h {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mute); margin-bottom: 2px;
}
.staged-mark {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 14px;
  padding: 8px 12px;
  background: var(--paper);
  border: 1px solid var(--rule);
}
.staged-mark-name { flex: 1; }
.staged-mark-pos  { margin-left: auto; }
.staged-mark-thumb {
  width: 36px; height: 24px;
  background: var(--bg);
  border: 1px solid var(--rule);
  display: grid; place-items: center;
}
.staged-mark-thumb svg { max-width: 80%; max-height: 80%; }
.staged-mark-name { font-family: var(--f-sans); font-size: 12px; color: var(--ink); font-weight: 500; }
.staged-mark-scale {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-sans); font-size: 11px;
  color: var(--mute);
}
.staged-mark-scale input[type="range"] { width: 140px; accent-color: var(--ink); }
.staged-mark-scale .scale-val {
  font-family: var(--f-sans); font-size: 11px; font-weight: 500;
  color: var(--ink);
  min-width: 38px; text-align: right;
}
.staged-mark-pos {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.06em; color: var(--mute);
  min-width: 64px;
}

/* Brand marks palette */
.brand-mark-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.brand-mark-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px;
  border: 1px solid var(--rule);
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.brand-mark-card:hover { background: var(--hover); }
.brand-mark-card.is-on { border-color: var(--ink); background: var(--paper); }
.brand-mark-card svg,
.brand-mark-card img { display: block; width: 100%; height: 44px; object-fit: contain; }
.brand-mark-name { font-family: var(--f-sans); font-size: 12px; font-weight: 500; color: var(--ink); }
.brand-mark-state {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.08em; color: var(--mute);
  text-transform: uppercase;
}
.brand-mark-card.is-on .brand-mark-state { color: var(--st-green); }

/* Studio templates */
.studio-templates {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px;
  border: 1px dashed var(--rule);
  background: var(--paper);
  margin-bottom: 14px;
}
.studio-templates-h {
  display: flex; align-items: center; gap: 10px;
}
.studio-templates-label {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mute); font-weight: 500;
}
.studio-templates-h .meta { font-family: var(--f-sans); font-size: 11px; color: var(--mute-2); }
.studio-templates-h .tb-btn { margin-left: auto; }
.studio-templates-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.studio-template-card {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.studio-template-card:hover { background: var(--hover); border-color: var(--rule-2); }
.studio-template-thumb {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  width: 40px; height: 40px; flex: 0 0 40px;
  background: var(--paper-2);
  padding: 4px;
}
.studio-template-thumb svg,
.studio-template-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.studio-template-thumb-cell { display: grid; place-items: center; overflow: hidden; }
.studio-template-empty { grid-column: 1 / -1; display: grid; place-items: center; color: var(--mute-2); }
.studio-template-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.studio-template-name {
  font-family: var(--f-sans); font-size: 12px; font-weight: 500;
  color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.studio-template-sub {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.06em; color: var(--mute);
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 4px;
}
.studio-template-scope {
  display: inline-flex; align-items: center;
  padding: 1px 6px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-size: 9px; letter-spacing: 0.06em;
  background: var(--bg);
  color: var(--ink);
}
.studio-template-scope.is-all { color: var(--mute); }
.studio-template-x {
  position: absolute; top: 4px; right: 6px;
  font-size: 14px; line-height: 1; color: var(--mute);
  cursor: pointer; padding: 2px 4px;
  opacity: 0;
  transition: opacity 140ms ease, color 140ms ease;
}
.studio-template-card:hover .studio-template-x { opacity: 1; }
.studio-template-x:hover { color: var(--ink); }

/* Brand assets (Grafik tab) */
.brand-assets-toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.brand-assets-toolbar .field-help { margin: 0; }
.brand-assets-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.brand-asset-card {
  position: relative;
  display: flex; flex-direction: column;
  border: 1px solid var(--rule);
  background: var(--bg);
}
.brand-asset-thumb {
  aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  background: var(--paper-2);
  /* Subtle checkerboard so transparent SVG/PNG read as transparent */
  background-image:
    linear-gradient(45deg, rgba(0,0,0,0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0,0,0,0.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(0,0,0,0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(0,0,0,0.04) 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
  padding: 16px;
}
.brand-asset-thumb img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  user-select: none; -webkit-user-drag: none;
}
.brand-asset-meta {
  display: flex; flex-direction: column;
  padding: 8px 10px;
  border-top: 1px solid var(--rule);
  background: var(--bg);
}
.brand-asset-name {
  font-family: var(--f-sans); font-size: 12px; font-weight: 500;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-asset-sub {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.06em; color: var(--mute);
  text-transform: uppercase;
}
.brand-asset-ops {
  position: absolute; top: 6px; right: 6px;
  display: flex; gap: 4px;
  opacity: 0;
  transition: opacity 140ms ease;
}
.brand-asset-card:hover .brand-asset-ops { opacity: 1; }
.brand-asset-ops .nav-btn { width: 22px; height: 22px; padding: 0; background: rgba(255,255,255,0.95); }

/* Settings · AI */
.ai-status {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--f-sans); font-size: 13px; color: var(--ink);
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--rule);
}
.ai-status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--mute-2);
  flex: 0 0 8px;
}
.ai-status .dot.is-on { background: var(--st-green, #6ea36e); box-shadow: 0 0 0 2px rgba(110,163,110,0.18); }
.ai-status code { font-family: var(--f-mono, ui-monospace, monospace); font-size: 12px; }
.ai-actions { display: flex; gap: 8px; margin-top: 18px; }

/* Maturity badges (Beta / Under utveckling / Manuell) */
.beta-badge, .dev-badge, .manual-badge {
  display: inline-flex; align-items: center;
  padding: 1px 7px;
  border-radius: 9px;
  font-family: var(--f-sans); font-size: 9px;
  letter-spacing: 0.08em; text-transform: uppercase;
  vertical-align: middle;
}
.beta-badge   { background: #f4e9c8; color: #8a6d1f; border: 1px solid #e3d3a0; }
.dev-badge    { background: var(--paper-2); color: var(--mute); border: 1px solid var(--rule); }
.manual-badge { background: transparent; color: var(--mute); border: 1px dashed var(--rule-2); }

/* Settings → Anslutningar */
.conn-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.conn-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  background: var(--bg);
}
.conn-card.stage-dev, .conn-card.stage-manual { opacity: 0.75; }
.conn-head { display: flex; align-items: center; gap: 8px; }
.conn-name { font-family: var(--f-sans); font-size: 14px; font-weight: 500; color: var(--ink); flex: 1; }
.conn-body { min-height: 30px; }
.conn-status {
  font-family: var(--f-sans); font-size: 12px; color: var(--ink);
  line-height: 1.45;
}
.conn-status.muted { color: var(--mute); }
.conn-status.ok::before   { content: "● "; color: var(--st-green, #6ea36e); }
.conn-status.warn { color: #8a6d1f; }
.conn-actions { display: flex; gap: 6px; }
.conn-redirects { margin-top: 10px; }
.conn-redirects summary {
  font-family: var(--f-sans); font-size: 11px; color: var(--mute);
  cursor: pointer; user-select: none;
}
.conn-redirects summary:hover { color: var(--ink); }
.conn-redirect {
  display: block; margin-top: 6px;
  font-family: var(--f-mono, ui-monospace, monospace); font-size: 11px;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); padding: 4px 8px;
  word-break: break-all;
}

/* Drawer: autopublicering */
.autopub-list { display: flex; flex-direction: column; gap: 6px; }
.autopub-row { display: flex; align-items: center; gap: 8px; }
.ap-chip {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink); background: var(--bg);
}
.ap-chip.ok    { border-color: #b9d2b9; background: #eef5ee; color: #3d5a40; }
.ap-chip.warn  { border-color: #e3d3a0; background: #f9f3df; color: #8a6d1f; }
.ap-chip.err   { border-color: #e0b7b1; background: #f9ecea; color: #a23d31; }
.ap-chip.muted { color: var(--mute); }
.autopub-renders { font-family: var(--f-sans); font-size: 10px; color: var(--mute); }

/* Boost (drawer) */
.boost-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.boost-row { display: flex; align-items: center; gap: 8px; }
.boost-meta { font-family: var(--f-sans); font-size: 11px; color: var(--mute); }
.boost-form { display: flex; flex-direction: column; gap: 8px; }
.boost-form-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.boost-form .text-input.mini { width: 70px; }
.boost-form .text-input.mini-wide { width: 130px; }
.boost-unit { font-family: var(--f-sans); font-size: 11px; color: var(--mute); }

/* Insights (real data) */
.ins-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px; background: var(--rule); border: 1px solid var(--rule);
  margin-bottom: 28px;
}
.ins-kpi {
  background: var(--bg);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.ins-kpi-v { font-family: var(--f-display); font-size: 26px; color: var(--ink); }
.ins-kpi-l {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute);
}
.ins-kpi-hint { font-style: normal; letter-spacing: 0; text-transform: none; opacity: 0.7; }
.ins-note {
  margin: 10px 0 4px; padding: 10px 14px; font-size: 12px; line-height: 1.5;
  color: var(--mute); background: var(--paper-2); border-left: 2px solid var(--rule);
  border-radius: 4px;
}
.ins-note code { font-family: var(--f-mono); font-size: 11px; }
/* Historik — imported posts folded into the content calendar. De-emphasised
   and clearly tagged so they read as past/published, not as planned work. */
.hist-tag {
  font-family: var(--f-sans); font-size: 9px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--mute); border: 1px solid var(--rule);
  padding: 2px 6px; border-radius: 2px; white-space: nowrap;
}
.post-card.is-history { opacity: 0.72; cursor: pointer; }
.post-card.is-history:hover { opacity: 1; }
.post-card.is-history .post-thumb { filter: grayscale(0.4); }
.cal-event.is-history { opacity: 0.66; border-left: 2px solid var(--rule); }
.cal-event.is-history:hover { opacity: 1; }
.post-list-row.is-history { opacity: 0.7; }
.post-list-row.is-history:hover { opacity: 1; }
.drawer-hist {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; margin-bottom: 18px;
  background: var(--paper-2); border: 1px solid var(--rule);
  font-family: var(--f-sans); font-size: 12px; color: var(--ink-2); line-height: 1.4;
}
.drawer-hist-link { color: var(--ink); white-space: nowrap; text-decoration: underline; }

.ins-post-row {
  display: flex; flex-direction: column; gap: 3px;
  width: 100%; text-align: left;
  padding: 10px 12px;
  border: 0; border-bottom: 1px solid var(--rule);
  background: transparent; cursor: pointer;
  transition: background-color 120ms ease;
}
.ins-post-row:hover { background: var(--hover); }
.ins-post-topic { font-family: var(--f-sans); font-size: 13px; font-weight: 500; color: var(--ink); }
.ins-post-meta {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-sans); font-size: 11px; color: var(--mute);
}

/* Insights — filter bar */
.ins-filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 18px 24px;
  padding: 14px 0 20px; margin-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.ins-fgroup { display: flex; flex-direction: column; gap: 6px; }
.ins-fgroup.grow { flex: 1; min-width: 180px; }
.ins-flabel {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute);
}
.ins-seg { display: inline-flex; border: 1px solid var(--rule); }
.ins-seg-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-sans); font-size: 12px; color: var(--ink-2);
  padding: 7px 12px; background: var(--bg); border: 0;
  border-right: 1px solid var(--rule); cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.ins-seg-btn:last-child { border-right: 0; }
.ins-seg-btn:hover { background: var(--hover); }
.ins-seg-btn.is-on { background: var(--ink); color: #fff; }
.ins-sort { padding: 7px 10px; font-size: 12px; min-width: 130px; }

/* Insights — post cards */
.ins-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 1px; background: var(--rule); border: 1px solid var(--rule);
}
.ins-card {
  display: flex; flex-direction: column; gap: 12px;
  text-align: left; background: var(--bg);
  padding: 16px 18px; border: 0; cursor: pointer;
  transition: background-color 120ms ease;
}
.ins-card:hover { background: var(--hover); }
.ins-card-thumb {
  margin: -16px -18px 4px; aspect-ratio: 4 / 3; overflow: hidden;
  background: var(--paper-2); border-bottom: 1px solid var(--rule);
}
.ins-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ins-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ins-card-chips { display: inline-flex; gap: 4px; }
.ins-card-date {
  font-family: var(--f-mono); font-size: 10px; color: var(--mute);
  letter-spacing: 0.02em; white-space: nowrap;
}
.ins-card-topic {
  font-family: var(--f-sans); font-size: 13px; font-weight: 500; line-height: 1.35;
  color: var(--ink); min-height: 2.7em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ins-card-metrics {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px;
  padding-top: 12px; border-top: 1px solid var(--rule);
}
.ins-m { display: flex; flex-direction: column; gap: 2px; }
.ins-m-v { font-family: var(--f-display); font-size: 18px; color: var(--ink); line-height: 1; }
.ins-m-l {
  font-family: var(--f-sans); font-size: 9px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute);
}
.ins-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-family: var(--f-sans); font-size: 11px; color: var(--mute);
}
.ins-card-spend { font-family: var(--f-mono); font-size: 10px; }
.ins-card-open { margin-left: auto; color: var(--ink-2); }
.ins-card:hover .ins-card-open { color: var(--ink); }

/* Publish row */
.studio-publish { padding-top: 24px; }
.publish-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
}
.publish-summary { flex: 1; font-family: var(--f-sans); font-size: 12px; color: var(--ink); }
.copy-empty.inline { display: inline; padding: 0; background: none; border: 0; color: var(--mute); }

/* ===== Imagery picker (Studio modal) ===== */
.picker-modal {
  width: 880px; max-width: calc(100vw - 32px);
  height: 600px; max-height: calc(100vh - 64px);
  padding: 0;
  display: flex; flex-direction: column;
}
.picker-h {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--rule);
}
.picker-h .modal-title { margin-bottom: 4px; }
.picker-sub {
  font-family: var(--f-sans); font-size: 12px;
  color: var(--mute); margin: 0;
}
.picker-body {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 220px 1fr;
}
.picker-folders {
  border-right: 1px solid var(--rule);
  border-bottom: 0; background: var(--paper);
  overflow-y: auto;
  border: 0;
  padding: 10px;
}
.picker-grid-wrap {
  position: relative;
  padding: 16px;
  overflow-y: auto;
  background: var(--bg);
}
.picker-grid-wrap.is-over { background: rgba(10,10,10,0.04); }
.picker-grid-wrap.is-over::after {
  content: "";
  position: absolute; inset: 8px;
  border: 2px dashed var(--ink);
  pointer-events: none;
}
.picker-drop {
  position: absolute; inset: 24px;
  display: grid; place-items: center;
  background: rgba(246, 245, 241, 0.95);
  border: 2px dashed var(--ink);
  font-family: var(--f-display); font-size: 18px;
  color: var(--ink);
  z-index: 2;
  pointer-events: none;
}
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.picker-card {
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 0; cursor: pointer;
  overflow: hidden;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.picker-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(10,10,10,0.08);
  border-color: var(--ink);
}
.picker-card img {
  display: block; width: 100%; height: 110px;
  object-fit: cover;
  background: var(--paper-2);
}
.picker-card-name {
  display: block;
  padding: 6px 8px;
  font-family: var(--f-sans); font-size: 10px;
  color: var(--mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-top: 1px solid var(--rule);
}

/* ===== Imagery library: folder browser + photo grid ===== */
.imagery-browser {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
  margin-top: 12px;
}
.imagery-folders {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 10px;
}
.imagery-folders-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 6px 8px;
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mute);
}
.imagery-folder-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.img-folder {
  position: relative;
  display: flex; align-items: center; gap: 4px;
}
.img-folder-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
  border: 0; background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: var(--f-sans); font-size: 13px;
  color: var(--ink);
  transition: background-color 140ms ease;
}
.img-folder-btn:hover { background: var(--hover); }
.img-folder.is-active .img-folder-btn { background: var(--bg); font-weight: 500; }
.img-folder-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.img-folder-count {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.06em; color: var(--mute);
  padding: 1px 7px;
  background: var(--paper-2);
  border-radius: 9px;
}
.img-folder-ops {
  display: inline-flex; gap: 2px;
  position: absolute; right: 4px; top: 50%;
  transform: translateY(-50%);
}
.img-folder-ops .nav-btn { width: 22px; height: 22px; font-size: 11px; }
.mini-rename {
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
}

.imagery-pane {
  display: flex; flex-direction: column; gap: 14px;
  min-width: 0;
}
.imagery-pane-h {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
.imagery-pane-title {
  font-family: var(--f-display); font-size: 22px;
  font-weight: 500; letter-spacing: -0.01em;
  margin: 0; color: var(--ink);
}
.imagery-pane-meta {
  font-family: var(--f-sans); font-size: 11px;
  letter-spacing: 0.08em; color: var(--mute);
}
.imagery-actions { display: inline-flex; gap: 8px; }

/* Override the placeholder-era imagery cards */
.imagery-browser .imagery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 0;
}
.imagery-browser .img-card {
  position: relative;
  aspect-ratio: auto;
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 0; margin: 0;
  overflow: hidden;
  display: flex; flex-direction: column;
  cursor: pointer;
  user-select: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.imagery-browser .img-card:hover { border-color: var(--rule-2); }
.imagery-browser .img-card.is-selected {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--ink) inset;
}
.imagery-browser .img-check {
  position: absolute; top: 8px; left: 8px;
  width: 22px; height: 22px;
  background: var(--ink); color: #fff;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--f-sans); font-size: 12px; font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.imagery-browser .img-card img {
  display: block;
  width: 100%; height: 200px;
  object-fit: cover;
  background: var(--paper-2);
}
.imagery-browser .img-card figcaption {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  font-family: var(--f-sans); font-size: 11px;
  color: var(--mute);
  border-top: 1px solid var(--rule);
}
.imagery-browser .img-card .img-name {
  flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.img-remove {
  border: 0; background: transparent;
  width: 22px; height: 22px;
  font-size: 14px; line-height: 1;
  color: var(--mute);
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 140ms ease, color 140ms ease;
}
.img-remove:hover { background: var(--hover); color: var(--ink); }
.img-arch {
  border: 0; background: transparent; width: 22px; height: 22px;
  font-size: 13px; line-height: 1; color: var(--mute); cursor: pointer; border-radius: 4px;
  transition: background-color 140ms ease, color 140ms ease;
}
.img-arch:hover { background: var(--hover); color: var(--ink); }
.imagery-browser .img-card video { display: block; width: 100%; height: 200px; object-fit: cover; background: #000; }
.imagery-browser .img-card.is-archived { opacity: 0.7; }
.img-vidtag {
  position: absolute; top: 8px; left: 8px; z-index: 1;
  background: rgba(0,0,0,0.6); color: #fff; font-family: var(--f-sans); font-size: 10px;
  padding: 2px 7px; border-radius: 10px;
}
.imagery-arch-toggle { margin-right: 4px; }
/* Studio picker: video thumbs + the little play marker */
.studio-imgthumb-use video { width: 100%; height: 100%; object-fit: cover; display: block; }
.studio-imgthumb-vid {
  position: absolute; left: 3px; bottom: 3px; z-index: 1;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 9px; padding: 1px 5px; border-radius: 8px;
}

/* Destructive secondary button (Ta bort N) */
.tb-btn.is-destructive {
  border-color: #c44a3c;
  color: #c44a3c;
}
.tb-btn.is-destructive:hover { background: #c44a3c; color: #fff; border-color: #c44a3c; }

/* Move dialog target list */
.move-targets {
  display: flex; flex-direction: column; gap: 4px;
  margin-bottom: 16px;
  max-height: 280px; overflow-y: auto;
}
.move-target {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  background: var(--bg);
  cursor: pointer;
  font-family: var(--f-sans); font-size: 13px;
  text-align: left;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.move-target:hover { background: var(--hover); border-color: var(--ink); }
.move-target-name { color: var(--ink); font-weight: 500; }
.move-target-count {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.06em; color: var(--mute);
  padding: 1px 7px;
  background: var(--paper-2);
  border-radius: 9px;
}

/* Approval indicator on post card */
.approval-indicator {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 4px;
  font-family: var(--f-sans); font-size: 10px;
  color: var(--mute);
  letter-spacing: 0.06em;
}
.ai-pip {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--rule-2);
}
.ai-pip.is-done { background: var(--st-green); }
.ai-text { margin-left: 4px; }

/* ===== Dashboard todo ===== */
.todo-section { margin-top: 20px; }
.todo-buckets { display: flex; flex-direction: column; gap: 22px; margin-top: 6px; }
.todo-bucket {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 16px 18px;
}
.todo-bucket-h {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.todo-bucket-title {
  font-family: var(--f-display); font-size: 18px; font-weight: 500;
  letter-spacing: -0.005em;
}
.todo-bucket-count {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mute);
}
.todo-bucket-hint {
  margin: 0 0 12px;
  font-family: var(--f-sans); font-size: 12px; color: var(--mute);
}
.todo-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.todo-item {
  display: grid; align-items: center;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  transition: background-color 140ms ease;
}
.todo-item:hover { background: var(--hover); }
.todo-main {
  display: flex; align-items: baseline; gap: 12px;
  border: 0; background: transparent;
  padding: 0; cursor: pointer;
  font-family: var(--f-sans); font-size: 13px;
  text-align: left;
  min-width: 0;
}
.todo-when {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--mute);
  flex: 0 0 90px;
}
.todo-topic {
  font-weight: 500; color: var(--ink);
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.todo-stage {
  font-family: var(--f-sans); font-size: 11px;
  color: var(--mute);
  padding: 1px 8px;
  background: var(--paper);
  border-radius: 9px;
}
.todo-channels { display: inline-flex; gap: 4px; }
.todo-action { white-space: nowrap; }
.todo-more {
  background: var(--paper);
  padding: 8px 12px;
  font-family: var(--f-sans); font-size: 11px;
  color: var(--mute); cursor: pointer;
  border-top: 1px solid var(--rule);
}
.todo-more:hover { color: var(--ink); }

/* ===== Admin (super-admin only) ===== */
.admin-create { margin-bottom: 24px; }
.admin-create-form { margin-top: 8px; }
.admin-group + .admin-group { margin-top: 24px; }
.admin-table { border-top: 1px solid var(--rule); margin-top: 4px; }
.adm-row, .adm-head {
  display: grid;
  grid-template-columns: 1.6fr 1.4fr 110px 110px 130px 110px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--f-sans); font-size: 12px;
}
.adm-head {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mute); font-weight: 500;
  background: var(--paper);
}
.adm-name  { font-weight: 500; color: var(--ink); }
.adm-slug, .adm-date { color: var(--mute); }
.adm-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.adm-demo { font-size: 11px; white-space: nowrap; color: var(--ink-2); }
.adm-active-pill {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 9px;
  background: var(--ink); color: #fff;
  border-radius: 9px;
}

/* ===== Schedule-post picker ===== */
.new-post-picker { width: 560px; }
.new-post-options {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px 0 12px;
}
.new-post-option {
  display: flex; flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.new-post-option:hover:not(:disabled) {
  background: var(--paper);
  border-color: var(--ink);
  transform: translateY(-1px);
}
.new-post-option:disabled { opacity: 0.5; cursor: progress; }
.new-post-h {
  font-family: var(--f-display); font-size: 18px;
  font-weight: 500; letter-spacing: -0.005em;
  color: var(--ink);
}
.new-post-d {
  font-family: var(--f-sans); font-size: 12px;
  color: var(--mute); line-height: 1.45;
}
.new-post-cta {
  font-family: var(--f-sans); font-size: 11px;
  letter-spacing: 0.06em; color: var(--ink);
  margin-top: 4px;
}

/* ===== Agents (Settings) ===== */
.agent-default-prompt {
  margin: 0;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px dashed var(--rule-2);
  font-family: var(--f-mono);
  font-size: 11px; line-height: 1.5;
  color: var(--ink-2);
  white-space: pre-wrap;
  max-height: 180px; overflow-y: auto;
}
.tool-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.tool-chip {
  font-family: var(--f-mono); font-size: 10px;
  padding: 3px 8px;
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--ink);
  letter-spacing: 0.04em;
}
.agent-save-row {
  display: flex; gap: 8px; justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
  margin-top: 4px;
}
.agent-play {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.agent-play-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.agent-result {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
}
.agent-result-h {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mute); margin-bottom: 8px;
}
.agent-result-h .meta { color: var(--mute-2); margin-left: 4px; }
.agent-tag {
  display: inline-block;
  font-family: var(--f-mono); font-size: 10px;
  padding: 1px 6px;
  background: var(--ink); color: #fff;
  margin-right: 6px;
  letter-spacing: 0.04em;
}
.agent-issue.is-block .agent-tag { background: #c44a3c; }
.agent-issue.is-warn  .agent-tag { background: #d9712f; }
.agent-issue.is-info  .agent-tag { background: var(--mute); }
.agent-issue.is-ok    .agent-tag { background: #2e8e58; }
.agent-copy, .agent-issues, .agent-ideas { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-family: var(--f-sans); font-size: 13px; }
.agent-note { color: var(--mute); font-style: italic; }
.agent-ideas .agent-idea-h { display: block; font-weight: 500; }
.agent-ideas .agent-idea-t { display: block; color: var(--mute); font-size: 12px; margin-top: 2px; }
.agent-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.agent-picks figure { margin: 0; border: 1px solid var(--rule); background: var(--bg); }
.agent-picks img { display: block; width: 100%; height: 110px; object-fit: cover; }
.agent-picks figcaption { padding: 6px 8px; font-family: var(--f-sans); font-size: 11px; color: var(--mute); }
.agent-raw {
  margin: 0; padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--rule);
  font-family: var(--f-mono); font-size: 11px; white-space: pre-wrap;
}

/* ===== Brand on a page ===== */
.brand-on-page {
  display: grid; gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.bop-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  background: var(--bg);
  padding: 14px 18px;
}
.bop-k {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--mute);
}
.bop-v {
  font-family: var(--f-display); font-size: 16px;
  line-height: 1.4; color: var(--ink);
}
.bop-link { color: var(--ink); text-decoration: underline; }

.word-pill {
  display: inline-flex; align-items: center;
  border: 1px solid var(--rule);
  padding: 3px 9px;
  font-family: var(--f-sans); font-size: 12px;
  background: var(--bg);
}
.word-pill.word-avoid { color: var(--mute); }
.word-pill.word-never { color: #8b2c25; border-color: #d9928b; background: #fbecea; }

/* ============================================================
   CONTENT PLAN — week view, post cards, drawer, taggable people
   ============================================================ */

:root {
  --ch-instagram:  #E1306C;
  --ch-linkedin:   #0A66C2;
  --ch-facebook:   #1877F2;
  --ch-newsletter: #5C5C5C;
  --ch-web:        #0A0A0A;
  --ch-tiktok:     #111111;
  --ch-youtube:    #FF0000;
  --st-muted:      #B0AEA8;
  --st-amber:      #D9712F;
  --st-blue:       #2E66C2;
  --st-violet:     #6B4FB3;
  --st-ink:        var(--ink);
  --st-green:      #2E8E58;
}

/* Toolbar override — 3-segment layout */
.plan-toolbar {
  flex-wrap: wrap;
  gap: 12px 20px;
  padding-bottom: 16px;
}
.plan-toolbar .month { font-size: 22px; }
.plan-toolbar .filter-pills { flex-wrap: wrap; }
.plan-toolbar .view-switch { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.plan-toolbar .tb-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-sans); font-size: 11px;
  color: var(--mute);
  padding: 4px 10px 4px 8px;
  border: 1px solid var(--rule);
  background: var(--bg);
  cursor: pointer;
  margin-right: 6px;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}
.plan-toolbar .tb-toggle:hover { background: var(--hover); color: var(--ink); }
.plan-toolbar .tb-toggle input { accent-color: var(--ink); cursor: pointer; }

/* Channel filter pills — color-tinted dot + low opacity when off */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, opacity 140ms ease;
}
.pill .ch-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mute); }
.pill.ch-instagram .ch-dot  { background: var(--ch-instagram); }
.pill.ch-linkedin .ch-dot   { background: var(--ch-linkedin); }
.pill.ch-facebook .ch-dot   { background: var(--ch-facebook); }
.pill.ch-newsletter .ch-dot { background: var(--ch-newsletter); }
.pill.ch-web .ch-dot        { background: var(--ch-web); }
.pill.ch-tiktok .ch-dot     { background: var(--ch-tiktok); }
.pill.ch-youtube .ch-dot    { background: var(--ch-youtube); }
.pill:not(.is-on) { opacity: 0.45; }
.pill:not(.is-on):hover { opacity: 0.85; background: var(--hover); }
.pill.is-on { background: var(--bg); color: var(--ink); border-color: var(--rule-2); }

/* Ansvarig-filter (Paket 3): a divider off the channel pills, "Mina inlägg"
   as one more pill, a checkbox dropdown for anyone else, and a status readout
   only shown once a filter is actually narrowing the view. */
.filter-sep { width: 1px; align-self: stretch; background: var(--rule); margin: 0 2px; }
.owner-filter-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 4px 10px; }
.owner-filter-btn.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.dd-caret { font-size: 9px; opacity: .7; }
.owner-filter-menu { padding: 6px; min-width: 220px; }
/* Flip to grow leftward from the trigger's right edge instead of its left —
   the default left:0 anchor is exactly where this dropdown has the least
   room, since it sits last in the toolbar before the view-switch. */
.owner-filter-menu.is-flipped { left: auto; right: 0; }
.owner-filter-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; cursor: pointer; }
.owner-filter-item input { accent-color: var(--ink); cursor: pointer; }
.owner-filter-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-sans); font-size: 11px; color: var(--mute);
  padding: 0 2px;
}
.owner-filter-clear {
  border: 0; background: none; color: var(--ink); text-decoration: underline;
  font-size: 11px; cursor: pointer; padding: 0;
}

/* Channel chip — compact short code */
.ch-chip {
  display: inline-flex; align-items: center; justify-content: center;
  height: 18px; min-width: 24px; padding: 0 6px;
  border-radius: 9px;
  font-family: var(--f-sans); font-size: 10px; font-weight: 500;
  letter-spacing: 0.04em;
  color: #fff;
  white-space: nowrap;
}
.ch-chip.ch-instagram  { background: var(--ch-instagram); }
.ch-chip.ch-linkedin   { background: var(--ch-linkedin); }
.ch-chip.ch-facebook   { background: var(--ch-facebook); }
.ch-chip.ch-newsletter { background: var(--ch-newsletter); }
.ch-chip.ch-web        { background: var(--ch-web); }
.ch-chip.ch-tiktok     { background: var(--ch-tiktok); }
.ch-chip.ch-youtube    { background: var(--ch-youtube); }

/* Status pill */
.st-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-sans); font-size: 11px; font-weight: 500;
  padding: 3px 10px; border-radius: 12px;
  border: 1px solid var(--rule);
  background: #fff;
  white-space: nowrap;
  color: var(--ink);
}
.st-pill .d { width: 6px; height: 6px; border-radius: 50%; background: var(--mute); }
.st-pill.st-muted  .d { background: var(--st-muted); }
.st-pill.st-amber  .d { background: var(--st-amber); }
.st-pill.st-blue   .d { background: var(--st-blue); }
.st-pill.st-violet .d { background: var(--st-violet); }
.st-pill.st-ink    .d { background: var(--st-ink); }
.st-pill.st-green  .d { background: var(--st-green); }

/* Week grid */
.week {
  /* Columns share the full row width, however many of them are rendered.
     Five visible weekdays get wider cards; full week shrinks them back. */
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  margin-top: 20px;
}
.week-col {
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  min-height: 420px;
  background: var(--bg);
  display: flex; flex-direction: column;
  min-width: 0;
}
.week-dh {
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  display: flex; flex-direction: column;
  transition: background-color 140ms ease, color 140ms ease;
}
.week-col.is-today .week-dh { background: var(--ink); color: #fff; }
.week-col.is-today .week-dh .dh-day { color: rgba(255,255,255,0.7); }
.week-col.is-today .week-dh .dh-num { color: #fff; }
.week-dh .dh-day {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mute);
}
.week-dh .dh-num {
  font-family: var(--f-display); font-size: 24px;
  font-weight: 500; line-height: 1.05;
  margin-top: 4px; color: var(--ink);
}
.week-cards { padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.week-empty { font-family: var(--f-sans); color: var(--mute-2); font-size: 12px; padding: 4px 2px; text-align: center; }

/* Paket 5 — quiet "create" link. Days with posts: always present, dim until
   hover/focus so it never competes with the cards above it. Empty days
   (.is-empty-day): invisible at rest, revealed by hovering/focusing anywhere
   in the day's column/cell — the "—" placeholder stays the resting state. */
.week-quickadd {
  border: 0; background: none; text-align: left; cursor: pointer;
  font-family: var(--f-sans); font-size: 11px; color: var(--mute-2);
  padding: 3px 4px; margin-top: -2px; opacity: .55;
  transition: opacity 120ms ease, color 120ms ease;
}
.week-quickadd:hover, .week-quickadd:focus-visible { opacity: 1; color: var(--ink); }
/* Empty days: invisible at rest (but still in flow — no absolute-position
   fight with the flex column above it), revealed by hovering/focusing
   anywhere in the day's cell. pointer-events keeps it from stealing a click
   meant for the "—" placeholder while it's invisible. */
.week-quickadd.is-empty-day { opacity: 0; pointer-events: none; }
.week-col:hover .week-quickadd.is-empty-day,
.week-col:focus-within .week-quickadd.is-empty-day { opacity: .55; pointer-events: auto; }
.cal-quickadd { margin-top: auto; }
.cal-quickadd.is-empty-day { opacity: 0; pointer-events: none; }
.cal-cell:hover .cal-quickadd.is-empty-day,
.cal-cell:focus-within .cal-quickadd.is-empty-day { opacity: .55; pointer-events: auto; }

/* Post card */
.post-card {
  display: flex; flex-direction: column; gap: 0;
  width: 100%;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--mute-2);
  text-align: left;
  cursor: grab;
  user-select: none;
  overflow: hidden;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}
.post-card:hover { background: #fff; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(10,10,10,0.06); }
.post-card:active { cursor: grabbing; }
.post-card.is-dragging { opacity: 0.4; transform: none; box-shadow: none; }
.post-card-body { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px 10px; }

/* Thumbnail at the top of each post card */
.post-thumb {
  width: 100%; aspect-ratio: 1 / 1;
  display: block; overflow: hidden;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-2);
}
.post-thumb svg,
.post-thumb img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Drop target feedback */
.week-col.is-drop-target { background: rgba(10, 10, 10, 0.04); box-shadow: inset 0 0 0 2px var(--ink); }
.cal-cell.is-drop-target { background: rgba(10, 10, 10, 0.04); box-shadow: inset 0 0 0 2px var(--ink); }
.cal-event { cursor: grab; user-select: none; }
.cal-event:active { cursor: grabbing; }
.cal-event.is-dragging { opacity: 0.4; }
.post-card.st-muted  { border-left-color: var(--st-muted); }
.post-card.st-amber  { border-left-color: var(--st-amber); }
.post-card.st-blue   { border-left-color: var(--st-blue); }
.post-card.st-violet { border-left-color: var(--st-violet); }
.post-card.st-ink    { border-left-color: var(--st-ink); }
.post-card.st-green  { border-left-color: var(--st-green); }
.post-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.post-card-top .post-time {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.06em; color: var(--mute);
}
.post-topic {
  font-family: var(--f-sans); font-size: 12px; font-weight: 500;
  line-height: 1.3; color: var(--ink);
}
.post-card-bot { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.post-channels { display: inline-flex; gap: 4px; flex-wrap: wrap; }

/* Owner avatars stack */
.owner-row { display: inline-flex; }
.owner-avatar {
  width: 22px; height: 22px;
  font-family: var(--f-sans); font-size: 9px; font-weight: 500;
  background: var(--ink); color: #fff;
  border: 2px solid var(--bg);
  border-radius: 50%;
  display: inline-grid; place-items: center;
  margin-left: -6px;
}
.owner-avatar:first-child { margin-left: 0; }
.owner-avatar.is-more { background: var(--paper); color: var(--mute); border-color: var(--rule); }

/* Override cal-event for the rewritten month view */
.cal-event {
  border-left: 3px solid var(--mute-2);
}
.cal-event.st-muted  { border-left-color: var(--st-muted); }
.cal-event.st-amber  { border-left-color: var(--st-amber); }
.cal-event.st-blue   { border-left-color: var(--st-blue); }
.cal-event.st-violet { border-left-color: var(--st-violet); }
.cal-event.st-ink    { border-left-color: var(--st-ink); }
.cal-event.st-green  { border-left-color: var(--st-green); }

/* Generic dropdowns */
.dd { position: relative; display: inline-flex; min-width: 0; }
.dd-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  background: var(--bg);
  cursor: pointer;
  font-family: var(--f-sans);
  font-size: 12px;
  color: var(--ink);
  width: 100%;
  min-width: 0;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.dd-trigger:hover { background: var(--hover); border-color: var(--rule-2); }
.dd-trigger.is-multi { padding: 4px 10px; min-height: 34px; }
.dd-trigger.is-plain { justify-content: space-between; }
.dd-trigger .chev { color: var(--mute); margin-left: auto; flex: 0 0 auto; }
.dd-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; flex: 1; min-width: 0; align-items: center; }
.dd-placeholder { color: var(--mute-2); }
.dd-menu {
  position: absolute; top: calc(100% + 4px); left: 0;
  min-width: 100%;
  max-width: 360px;
  z-index: 100;
  background: #fff;
  border: 1px solid var(--rule);
  box-shadow: 0 10px 28px rgba(10,10,10,0.10);
  padding: 4px;
  max-height: 320px; overflow-y: auto;
}
.dd-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 0; background: transparent;
  text-align: left;
  font-family: var(--f-sans);
  font-size: 12px;
  cursor: pointer;
  transition: background-color 100ms ease;
}
.dd-item:hover { background: var(--hover); }
.dd-item.is-active { background: rgba(10,10,10,0.04); }
.dd-item .dd-check { width: 14px; color: var(--ink); font-size: 11px; }
.dd-item .dd-label { color: var(--ink); }

/* People picker */
.dd-people { width: 100%; flex-direction: column; }
.people-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--rule);
  background: var(--bg);
  min-height: 40px;
  align-items: center;
  width: 100%;
}
.person-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px 2px 2px;
  background: var(--paper);
  border-radius: 14px;
  font-family: var(--f-sans); font-size: 11px;
}
.person-chip .person-name { color: var(--ink); }
.person-chip .person-x {
  border: 0; background: transparent; cursor: pointer;
  color: var(--mute); font-size: 14px; line-height: 1; padding: 0 2px;
}
.person-chip .person-x:hover { color: var(--ink); }
.person-add {
  border: 0; background: transparent;
  color: var(--mute);
  font-family: var(--f-sans); font-size: 11px;
  padding: 2px 6px;
  cursor: pointer;
  transition: color 140ms ease;
}
.person-add:hover { color: var(--ink); }
.person-avatar {
  width: 22px; height: 22px;
  font-family: var(--f-sans); font-size: 9px; font-weight: 500;
  background: var(--ink); color: #fff;
  border-radius: 50%;
  display: inline-grid; place-items: center;
  flex: 0 0 22px;
}
.person-chip .person-avatar { width: 20px; height: 20px; flex: 0 0 20px; }
.people-menu { padding: 8px; min-width: 280px; }
.people-search {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-family: var(--f-sans);
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--ink);
}
.people-search:focus { outline: 0; border-color: var(--ink); }
.people-list { display: flex; flex-direction: column; max-height: 220px; overflow-y: auto; }
.people-empty { font-family: var(--f-sans); font-size: 11px; color: var(--mute); padding: 12px 8px; text-align: center; }

/* Combobox (searchable single-select) */
.combobox-menu { padding: 8px; min-width: 260px; max-height: 320px; display: flex; flex-direction: column; }
.combobox-list { display: flex; flex-direction: column; max-height: 240px; overflow-y: auto; }
.combobox-list .dd-item.is-highlighted { background: var(--hover); }
.combobox-list .dd-item.is-active { font-weight: 500; }

/* Form fields (drawer) */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field > label {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mute); font-weight: 500;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.text-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  background: var(--bg);
  font-family: var(--f-sans);
  font-size: 12px;
  color: var(--ink);
  resize: vertical;
  transition: border-color 140ms ease, background-color 140ms ease;
}
.text-input:focus { outline: 0; border-color: var(--ink); }

/* Copy blocks per channel */
.copy-tabs { display: flex; flex-direction: column; gap: 12px; }
.copy-empty {
  font-family: var(--f-sans); font-size: 11px; color: var(--mute);
  padding: 14px 16px;
  background: var(--paper);
  border: 1px dashed var(--rule-2);
}
.copy-block { display: flex; flex-direction: column; gap: 6px; }
.copy-head { display: flex; align-items: center; gap: 8px; }
.copy-name { font-family: var(--f-sans); font-size: 12px; color: var(--ink); }
.copy-count {
  margin-left: auto;
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--mute);
}
/* Over a platform's caption ceiling — warn, never block. */
.copy-count.is-over { color: var(--danger, #c0392b); font-weight: 600; }
.copy-area.is-over, .studio-caption-edit.is-over {
  border-color: var(--danger, #c0392b);
  box-shadow: 0 0 0 1px var(--danger, #c0392b) inset;
}
.studio-caption-count {
  margin-top: 4px; text-align: right;
  font-family: var(--f-sans); font-size: 10.5px; letter-spacing: 0.04em;
  color: var(--mute);
}
.studio-caption-count.is-over { color: var(--danger, #c0392b); font-weight: 600; }
.copy-area { min-height: 80px; }

/* Drawer */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 10, 10, 0.24);
  z-index: 200;
  animation: backdrop-in 220ms ease;
}
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 560px; max-width: 100vw;
  background: var(--bg);
  z-index: 201;
  display: flex; flex-direction: column;
  box-shadow: -20px 0 60px rgba(10, 10, 10, 0.12);
  animation: drawer-in 360ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-head {
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.drawer-eyebrow {
  font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 6px;
}
.drawer-title {
  font-family: var(--f-display); font-size: 24px;
  font-weight: 500; letter-spacing: -0.01em; line-height: 1.15;
  margin: 0; color: var(--ink);
}
.drawer-when {
  margin-top: 6px;
  font-family: var(--f-sans); font-size: 12px;
  color: var(--mute);
}
.drawer-close {
  border: 0; background: transparent;
  font-size: 22px; line-height: 1;
  color: var(--mute);
  width: 32px; height: 32px;
  cursor: pointer;
  display: grid; place-items: center;
  border-radius: 4px;
  transition: background-color 140ms ease, color 140ms ease;
}
.drawer-close:hover { background: var(--hover); color: var(--ink); }
.drawer-body {
  padding: 22px 28px 60px;
  overflow-y: auto;
  flex: 1;
}

/* Move-confirm dialog */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 10, 10, 0.28);
  z-index: 210;
  animation: backdrop-in 200ms ease;
}
.modal {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 420px; max-width: calc(100vw - 32px);
  background: var(--bg);
  border: 1px solid var(--rule);
  padding: 24px 26px 20px;
  z-index: 211;
  box-shadow: 0 20px 60px rgba(10,10,10,0.14);
  animation: modal-in 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modal-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}
.modal-title {
  font-family: var(--f-display);
  font-size: 22px; font-weight: 500; letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--ink);
}
.modal-body {
  font-family: var(--f-sans);
  font-size: 13px; line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 20px;
}
.modal-body strong { font-weight: 500; color: var(--ink); }
.modal-date {
  display: inline-block;
  padding: 1px 7px;
  background: var(--paper);
  border-radius: 10px;
  font-size: 12px;
  color: var(--ink);
}
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
}

/* List view — nyast först, månadsrubriker som fastnar, miniatyr per rad. */
.post-list { margin-top: 16px; }
.post-list-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 0 12px; margin-bottom: 6px; border-bottom: 1px solid var(--rule); }
.post-list-filters .text-input { padding: 6px 9px; font-size: 12px; width: auto; }
.post-list-search { min-width: 220px; flex: 1 1 220px; }
.post-list-total { margin-left: auto; font-family: var(--f-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.post-list-group { margin-bottom: 18px; }
.post-list-month {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 10px 14px 8px; margin-bottom: 4px;
  background: var(--bg); border-bottom: 1px solid var(--rule);
  font-family: var(--f-serif); font-size: 15px; color: var(--ink);
}
.post-list-count { font-family: var(--f-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.post-list-row {
  display: grid;
  grid-template-columns: 64px 48px minmax(0, 1fr) 150px 110px;
  align-items: center; gap: 14px;
  width: 100%; padding: 8px 14px;
  border: 0; border-bottom: 1px solid var(--rule); background: var(--bg);
  text-align: left; cursor: pointer; font-family: var(--f-sans); font-size: 12.5px;
  transition: background-color 140ms ease;
}
.post-list-row:hover { background: var(--hover); }
.post-list-row .row-date { display: flex; flex-direction: column; line-height: 1.15; }
.post-list-row .row-day { font-family: var(--f-serif); font-size: 20px; color: var(--ink); }
.post-list-row .row-wd { font-family: var(--f-mono); font-size: 10px; color: var(--mute); letter-spacing: .04em; }
.post-list-row .row-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--paper-2); display: block; }
.post-list-row .row-thumb-empty { background: repeating-linear-gradient(135deg, var(--paper-2) 0 5px, var(--paper) 5px 10px); }
.post-list-row .row-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.post-list-row .row-topic { font-weight: 500; color: var(--ink); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-list-row .row-sub { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--mute); }
.post-list-row .row-channels { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.post-list-row .row-owner { display: flex; justify-content: flex-end; }
.post-list-row.is-history .row-thumb { filter: grayscale(.3); }
@media (max-width: 900px) {
  .post-list-row { grid-template-columns: 52px 40px minmax(0, 1fr) 90px; }
  .post-list-row .row-owner { display: none; }
}

.studio-bar {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 0 16px; border-bottom: 1px solid var(--rule); margin-bottom: 16px;
}
.studio-channels { display: flex; flex-wrap: wrap; gap: 4px; }
.studio-chtab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border: 0; background: transparent; cursor: pointer;
  font-family: var(--f-sans); font-size: 13px; color: var(--mute);
  border-bottom: 2px solid transparent;
}
.studio-chtab:hover { color: var(--ink-2); }
.studio-chtab.is-on { color: var(--ink); font-weight: 500; border-bottom-color: var(--accent); }
.studio-formats { display: flex; flex-wrap: wrap; gap: 6px; }
.studio-fchip {
  height: 30px; padding: 0 13px; border-radius: 16px;
  border: 1px solid var(--rule); background: transparent; cursor: pointer;
  font-family: var(--f-sans); font-size: 11.5px; color: var(--mute);
}
.studio-fchip:hover { border-color: var(--rule-2); color: var(--ink-2); }
.studio-fchip.is-on { background: var(--bg); border-color: var(--ink); color: var(--ink); }

/* Carousel slide strip — one artboard per slide, switch/add/remove. */
.studio-slides { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.studio-slides-lbl { font-family: var(--f-sans); font-size: 11px; color: var(--mute); margin-right: 2px; }
.studio-slide { display: inline-flex; align-items: center; }
.studio-slide-btn {
  height: 26px; min-width: 26px; padding: 0 8px; border-radius: 8px 0 0 8px;
  border: 1px solid var(--rule); border-right: none; background: transparent; cursor: pointer;
  font-family: var(--f-sans); font-size: 11.5px; color: var(--mute);
}
.studio-slide:only-child .studio-slide-btn,
.studio-slide-btn:last-child { border-radius: 8px; border-right: 1px solid var(--rule); }
.studio-slide.is-on .studio-slide-btn { background: var(--bg); border-color: var(--ink); color: var(--ink); }
.studio-slide-x {
  height: 26px; width: 20px; border-radius: 0 8px 8px 0;
  border: 1px solid var(--rule); background: transparent; cursor: pointer;
  font-size: 13px; line-height: 1; color: var(--mute);
}
.studio-slide.is-on .studio-slide-x { border-color: var(--ink); color: var(--ink); }
.studio-slide-x:hover { color: var(--danger, #c0392b); }
.studio-slide-add {
  height: 26px; padding: 0 10px; border-radius: 8px;
  border: 1px dashed var(--rule-2); background: transparent; cursor: pointer;
  font-family: var(--f-sans); font-size: 11.5px; color: var(--ink-2);
}
.studio-slide-add:hover { border-color: var(--ink); color: var(--ink); }

/* Carousel preview affordances on the post mockup — slide counter, side
   arrows (overlaid on the canvas) and the dot row below the image. */
.studio-carousel-count {
  position: absolute; top: 10px; right: 10px; z-index: 6;
  padding: 3px 9px; border-radius: 11px;
  background: rgba(0,0,0,.62); color: #fff;
  font-family: var(--f-sans); font-size: 11px; font-weight: 600; letter-spacing: .02em;
  pointer-events: none;
}
.studio-carousel-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 6;
  width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.85); color: #1c1c1c;
  font-size: 17px; line-height: 1; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 5px rgba(0,0,0,.28);
}
.studio-carousel-nav.is-prev { left: 8px; }
.studio-carousel-nav.is-next { right: 8px; }
.studio-carousel-nav:hover { background: #fff; }
.studio-carousel-dots { display: flex; justify-content: center; gap: 5px; padding: 8px 0 2px; }
.studio-cdot { width: 6px; height: 6px; border-radius: 50%; background: var(--rule-2); cursor: pointer; transition: background .15s; }
.studio-cdot.is-on { background: var(--accent, #3a6ff7); }

/* Zoom bar under the workspace preview. */
.studio-zoombar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 12px;
}
.studio-zoombtn {
  width: 24px; height: 24px; border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.06);
  color: #E7E3DA; font-size: 15px; line-height: 1;
}
.studio-zoombtn:hover { background: rgba(255,255,255,.14); }
.studio-zoomrange { width: 150px; accent-color: var(--accent, #3a6ff7); cursor: pointer; }
.studio-zoomval { min-width: 38px; text-align: center; font-family: var(--f-sans); font-size: 11.5px; color: #E7E3DA; }
.studio-zoomreset {
  height: 24px; padding: 0 10px; border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.22); background: transparent;
  color: #A5A19A; font-family: var(--f-sans); font-size: 11px;
}
.studio-zoomreset:hover { color: #E7E3DA; }
.studio-zoomreset.is-on { background: rgba(255,255,255,.14); color: #fff; border-color: transparent; }

.studio-shell {
  /* The canvas column has a real minimum (the 420px artboard + padding) — a
     narrower track let the artboard paint OVER the neighbouring columns.
     Below the minimum the shell scrolls horizontally instead of overlapping
     (and the app shell auto-collapses chat/menu when Studio opens tight). */
  display: grid; grid-template-columns: auto minmax(480px, 1fr) 240px; gap: 22px;
  align-items: start;
  overflow-x: auto;
}
.studio-left { display: grid; grid-template-columns: 64px 1fr; border: 1px solid var(--rule); }
.studio-rail { display: flex; flex-direction: column; padding: 8px; gap: 4px; border-right: 1px solid var(--rule); }
.studio-railbtn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--mute);
}
.studio-railbtn:hover { background: var(--hover); }
.studio-railbtn.is-on { background: var(--ink); color: #fff; }
.studio-railglyph { font-size: 16px; line-height: 1; }
.studio-raillabel { font-family: var(--f-sans); font-size: 8px; letter-spacing: 0.06em; text-transform: uppercase; }
.studio-panel { padding: 18px 16px; min-height: 360px; display: flex; flex-direction: column; gap: 16px; }
.studio-panel-hint { font-family: var(--f-sans); font-size: 11px; line-height: 1.4; color: var(--mute); }
.studio-subh { font-family: var(--f-sans); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); margin-top: 2px; }

.studio-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.studio-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  height: 84px; border: 1px solid var(--rule); background: var(--bg); border-radius: 8px; cursor: pointer;
}
.studio-card:hover { border-color: var(--ink); }
.studio-card-sample { color: var(--ink); line-height: 1; }
.studio-card-shape { height: 30px; display: flex; align-items: center; justify-content: center; }
.studio-card-shape > span { display: block; }
.studio-card-label { font-family: var(--f-sans); font-size: 11px; color: var(--mute); }
.studio-snippet {
  display: block; width: 100%; text-align: left;
  padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--bg);
  font-family: var(--f-sans); font-size: 12px; line-height: 1.4; color: var(--ink-2); cursor: pointer;
}
.studio-snippet:hover { border-color: var(--ink); }
.studio-swatches { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.studio-swatch { border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--bg); cursor: pointer; padding: 0; }
.studio-swatch-chip { display: block; width: 100%; height: 46px; }
.studio-swatch-name { display: block; font-family: var(--f-sans); font-size: 10px; color: var(--mute); padding: 5px; }
.studio-upload {
  display: block; text-align: center; padding: 14px; border: 1px dashed var(--rule-2); border-radius: 8px;
  font-family: var(--f-sans); font-size: 12px; color: var(--ink-2); cursor: pointer;
}
.studio-upload:hover { border-color: var(--ink); }
.studio-upload-2 { margin-top: 6px; padding: 10px; border-style: solid; border-color: var(--rule); }
.studio-imggrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
/* "+ lager" affordance on a library thumbnail */
.studio-imgthumb-layer { position: absolute; left: 3px; bottom: 3px; border: 0; border-radius: 4px;
  background: rgba(0,0,0,0.6); color: #fff; font-family: var(--f-sans); font-size: 10px; padding: 2px 6px; cursor: pointer;
  opacity: 0; transition: opacity .12s; }
.studio-imgthumb:hover .studio-imgthumb-layer, .studio-imgthumb-layer:focus-visible { opacity: 1; }
/* Shape picker cards */
.studio-card-shape { display: flex; align-items: center; justify-content: center; height: 30px; }
.studio-shape-rect { width: 34px; height: 22px; border-radius: 2px; }
.studio-shape-circ { width: 26px; height: 26px; border-radius: 50%; }
.studio-imgthumb { position: relative; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; height: 72px; background: var(--paper-2); }
.studio-imgthumb-use { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.studio-imgthumb-use img { width: 100%; height: 100%; object-fit: cover; display: block; }
.studio-imgthumb-zoom { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border: 0; border-radius: 4px;
  background: rgba(0,0,0,0.55); color: #fff; font-size: 11px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .12s;
  display: flex; align-items: center; justify-content: center; }
.studio-imgthumb:hover .studio-imgthumb-zoom, .studio-imgthumb-zoom:focus-visible { opacity: 1; }
.studio-icongrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.studio-iconbtn { height: 52px; border: 1px solid var(--rule); border-radius: 8px; background: var(--bg); cursor: pointer; font-size: 20px; color: var(--ink); }
.studio-iconbtn:hover { border-color: var(--ink); }

/* canvas */
.studio-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.studio-canvas-wrap { display: flex; align-items: center; justify-content: center; min-height: 540px; width: 100%; }
.studio-canvas { position: relative; overflow: hidden; box-shadow: 0 2px 20px rgba(0,0,0,0.08); background: #fff; }
.studio-bg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(135deg, #EFEDE5 0 14px, #E9E6DD 14px 28px); }
.studio-bg-ph { font-family: var(--f-sans); font-size: 12px; color: var(--mute); }
.studio-bgimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.studio-el { outline-offset: 2px; }
.studio-el.is-sel { outline: 1.5px solid var(--accent); }
.studio-el:focus { outline: 1.5px solid var(--accent); }
.studio-handle {
  position: absolute; right: -5px; bottom: -5px; width: 11px; height: 11px;
  background: #fff; border: 1.5px solid var(--accent); border-radius: 2px; cursor: nwse-resize;
}
.studio-dims { font-family: var(--f-mono); font-size: 11px; color: var(--mute); }

/* inspector */
.studio-inspector { border: 1px solid var(--rule); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-height: 360px; }
.studio-insp-h { display: flex; align-items: center; font-family: var(--f-sans); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); }
.studio-insp-x { margin-left: auto; border: 0; background: transparent; cursor: pointer; font-size: 18px; color: var(--mute); line-height: 1; }
.studio-field-l { font-family: var(--f-sans); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.studio-genbtn { width: 100%; }
.studio-note { font-family: var(--f-sans); font-size: 11px; color: var(--mute); }
.studio-caption-row { display: flex; gap: 6px; align-items: stretch; }
.studio-caption { flex: 1; text-align: left; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--bg); font-family: var(--f-sans); font-size: 12px; line-height: 1.4; color: var(--ink-2); cursor: pointer; }
.studio-caption.is-on { border-color: var(--accent); background: color-mix(in oklch, var(--accent), transparent 92%); }
.studio-caption-add { flex: 0 0 34px; border: 1px solid var(--rule); border-radius: 8px; background: var(--bg); cursor: pointer; font-size: 16px; color: var(--ink-2); }
.studio-seg { display: flex; gap: 6px; }
.studio-segbtn { flex: 1; height: 34px; border: 1px solid var(--rule); border-radius: 7px; background: var(--bg); color: var(--ink-2); font-family: var(--f-sans); font-size: 12px; cursor: pointer; }
.studio-segbtn.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.studio-segbtn.studio-del:hover { border-color: #b3261e; color: #b3261e; }
.studio-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.studio-insp-swatches { display: flex; gap: 8px; }
.studio-insp-sw { width: 34px; height: 34px; border-radius: 7px; cursor: pointer; }
.studio-tplgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.studio-tplcard { display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--bg); cursor: pointer; text-align: left; padding: 0; }
.studio-tplcard:hover { border-color: var(--ink); }
.studio-tplthumb { display: flex; align-items: center; justify-content: center; height: 110px; border-bottom: 1px solid var(--rule); }
.studio-tplname { font-family: var(--f-sans); font-size: 12px; font-weight: 500; color: var(--ink); padding: 9px 11px 2px; }
.studio-tplmeta { font-family: var(--f-sans); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); padding: 0 11px 10px; }
.studio-savenote { margin-top: 14px; }

@media (max-width: 1180px) {
  .studio-shell { grid-template-columns: 1fr; }
  .studio-inspector { order: 3; }
}

/* Studio — image elements (logos + graphics from the Brand Library) */
.studio-card-img { height: 34px; display: flex; align-items: center; justify-content: center; padding: 2px 6px; border-radius: 4px; }
.studio-card-img img { max-width: 100%; max-height: 34px; object-fit: contain; display: block; }
.studio-elimg { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; user-select: none; }
.studio-elimg.is-cover { object-fit: cover; }
.studio-graphic { background: repeating-conic-gradient(#F1EFE9 0% 25%, #fff 0% 50%) 0 0 / 14px 14px; }
.studio-graphic .studio-imgthumb-use { display: flex; align-items: center; justify-content: center; padding: 6px; }
.studio-graphic .studio-imgthumb-use img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }

/* Background zoom slider */
.studio-zoom { margin: 8px 0 4px; }
.studio-zoom-row { display: flex; align-items: center; gap: 8px; }
.studio-zoom-row input[type="range"] { flex: 1; }
.studio-zoom-v { font-family: var(--f-mono); font-size: 11px; color: var(--mute); min-width: 34px; text-align: right; }
.studio-zoom-reset { border: 1px solid var(--rule); background: var(--bg); border-radius: 4px; cursor: pointer;
  width: 22px; height: 22px; font-size: 12px; color: var(--mute); }
.studio-zoom-reset:hover { border-color: var(--ink); color: var(--ink); }

/* Full-size archive preview */
.studio-lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(20,18,15,0.82);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 32px; cursor: zoom-out; }
.studio-lightbox-img { max-width: 92vw; max-height: 84vh; object-fit: contain; border-radius: 6px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.4); cursor: default; background: var(--paper-2); }
.studio-lightbox-cap { color: #F1EFE9; font-size: 13px; }
.studio-lightbox-x { position: absolute; top: 18px; right: 22px; width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,0.12); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.studio-lightbox-x:hover { background: rgba(255,255,255,0.24); }

/* Library export button */
.lib-export-btn { margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; }

/* PostDrawer delete / danger zone */
.drawer-danger { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--rule); }
.drawer-del-btn { color: #9A2A2A; border-color: #E3C7C2; }
.drawer-del-btn:hover { background: #FBEFEC; border-color: #9A2A2A; }

/* Settings → Publiceringsflöden: master on/off */
.flow-master { padding: 14px 16px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper-2); margin-bottom: 18px; }
.flow-master-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-family: var(--f-sans); font-size: 14px; color: var(--ink); }
.flow-master-toggle input { width: 16px; height: 16px; accent-color: var(--ink); }
.flow-master .field-help { margin: 6px 0 0 26px; }
.settings-pane.is-disabled { opacity: 0.55; pointer-events: none; }

/* Flow transition actions (submit to review / return for edits) */
.flow-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 4px; }
.flow-return { color: #9a6a00; border-color: color-mix(in oklch, #9a6a00, transparent 60%); }
.flow-return:hover { background: color-mix(in oklch, #9a6a00, transparent 92%); border-color: #9a6a00; }

/* Post history timeline */
.post-timeline { list-style: none; margin: 0; padding: 0; }
.ptl-item { display: flex; gap: 10px; padding: 0 0 12px; position: relative; }
.ptl-item:not(:last-child)::before {
  content: ""; position: absolute; left: 4px; top: 12px; bottom: -2px; width: 1px; background: var(--rule);
}
.ptl-dot { flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; margin-top: 3px;
  background: var(--mute); border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--rule); z-index: 1; }
.ptl-stage_approved .ptl-dot, .ptl-published .ptl-dot { background: #2c7a3f; }
.ptl-returned_for_edits .ptl-dot, .ptl-stage_revoked .ptl-dot { background: #9a6a00; }
.ptl-submitted_for_review .ptl-dot { background: var(--accent); }
.ptl-body { min-width: 0; }
.ptl-line { font-family: var(--f-sans); font-size: 13px; color: var(--ink); line-height: 1.35; }
.ptl-meta { font-family: var(--f-sans); font-size: 11px; color: var(--mute); margin-top: 1px; }

/* Proofing comments thread */
.cmt-legacy { font-size: 12px; color: var(--mute); background: var(--paper-2); border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; }
.cmt-thread { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.cmt-item { border: 1px solid var(--rule); border-radius: 8px; padding: 9px 11px; background: var(--bg); }
.cmt-item.is-resolved { opacity: 0.6; }
.cmt-item.is-resolved .cmt-body { text-decoration: line-through; }
.cmt-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.cmt-author { font-family: var(--f-sans); font-size: 12px; font-weight: 600; color: var(--ink); }
.cmt-chan { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--mute); }
.cmt-when { margin-left: auto; font-size: 11px; color: var(--mute); }
.cmt-body { font-family: var(--f-sans); font-size: 13px; color: var(--ink-2); line-height: 1.4; white-space: pre-wrap; }
.cmt-resolve { margin-top: 5px; background: none; border: 0; padding: 0; cursor: pointer; font-family: var(--f-sans); font-size: 11px; color: var(--accent); }
.cmt-resolve:hover { text-decoration: underline; }
.cmt-add { display: flex; flex-direction: column; gap: 6px; }
.cmt-chan-sel { max-width: 200px; }

/* Per-channel copy: edit/preview toggle + platform-styled preview cards */
.copy-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.copy-mode { display: inline-flex; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.copy-mode-btn { border: 0; background: var(--bg); cursor: pointer; font-family: var(--f-sans); font-size: 11px; padding: 4px 10px; color: var(--mute); }
.copy-mode-btn.is-on { background: var(--ink); color: var(--bg); }
.chprev { border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; background: var(--bg); margin-bottom: 12px; }
.chprev-head { display: flex; align-items: center; gap: 8px; padding: 9px 11px; }
.chprev-handle { font-family: var(--f-sans); font-size: 13px; font-weight: 600; color: var(--ink); }
.chprev-plat { margin-left: auto; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.chprev-img { display: block; width: 100%; max-height: 360px; object-fit: cover; background: var(--paper-2); }
.chprev-cap { padding: 10px 12px 12px; font-family: var(--f-sans); font-size: 13px; line-height: 1.45; color: var(--ink-2); white-space: pre-wrap; }
.chprev-empty { color: var(--mute); font-style: italic; }
/* LinkedIn reads a touch more buttoned-up; Instagram square-ish imagery */
.chprev-linkedin .chprev-cap { font-size: 12.5px; }
.chprev-instagram .chprev-img { max-height: 420px; }

/* Studio — platform post preview (caption below the media, feed-styled) */
.studio-stage { min-height: 560px; }
.studio-post-wrap { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.studio-post {
  border: 1px solid var(--rule); background: #fff; border-radius: 10px; overflow: hidden;
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}
.studio-post .studio-canvas { box-shadow: none; width: 100% !important; border-radius: 0; }
.studio-post-head { display: flex; align-items: center; gap: 9px; padding: 10px 12px; }
.studio-post-ava {
  width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex: 0 0 30px;
  background: var(--paper-2); display: flex; align-items: center; justify-content: center;
  font-family: var(--f-display); font-size: 14px; color: var(--ink);
}
.studio-post-ava img { width: 100%; height: 100%; object-fit: cover; }
.studio-post-handle { font-family: var(--f-sans); font-size: 13px; font-weight: 600; color: var(--ink); }
.studio-post-more { margin-left: auto; color: var(--mute); font-size: 16px; line-height: 1; }
.studio-post-actions { display: flex; gap: 16px; padding: 10px 12px 4px; font-size: 18px; }
.studio-post-bm { margin-left: auto; }
.studio-post-caption, .studio-post-body {
  padding: 4px 12px 14px; font-family: var(--f-sans); font-size: 13px; line-height: 1.5; color: var(--ink-2);
}
.studio-post-body { padding: 4px 12px 10px; }
.studio-post-cap-handle { font-weight: 600; color: var(--ink); margin-right: 6px; }
.studio-post-cap-text { white-space: pre-wrap; }
.studio-post-cap-ph { color: var(--mute); font-style: italic; }

/* Studio — background crop (hand tool) + drop target */
.studio-bgimg { cursor: grab; }
.studio-canvas:active .studio-bgimg { cursor: grabbing; }
.studio-canvas.is-dropping { outline: 2px dashed var(--accent); outline-offset: -2px; }
.studio-canvas.is-dropping::after {
  content: "Släpp bilden här"; position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in oklch, var(--accent), transparent 86%);
  font-family: var(--f-sans); font-size: 13px; color: var(--ink); pointer-events: none;
}
@keyframes studioStepIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.studio-brief-step { display: flex; flex-direction: column; gap: 12px; }
.studio-brief-row { display: flex; gap: 24px; align-items: flex-start; }
.studio-brief-field { display: flex; flex-direction: column; gap: 6px; }
.studio-brief-main { flex: 1 1 60%; min-width: 280px; }
.studio-brief-main textarea { min-height: 96px; }
.studio-brief-side { flex: 1 1 40%; min-width: 220px; }
.studio-brief-step .studio-genbtn { align-self: flex-start; margin-top: 4px; }
.studio-caption-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
@media (max-width: 720px) { .studio-brief-row { flex-direction: column; } }
.studio-caption-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.studio-insp-empty { font-family: var(--f-sans); font-size: 12px; line-height: 1.5; color: var(--mute); }
.studio-insp-empty .studio-insp-h { margin-bottom: 10px; }
.studio-publish-step { max-width: 620px; }
.studio-publish-summary { font-family: var(--f-sans); font-size: 14px; line-height: 1.5; color: var(--ink-2); margin-bottom: 18px; }
.studio-publish-summary b { color: var(--ink); font-weight: 600; }
.studio-publish-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Studio — layers panel (right column) */
.studio-layers { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.studio-layers-count { margin-left: auto; font-family: var(--f-mono); font-size: 11px; color: var(--mute); }
.studio-layer { border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--bg); }
.studio-layer.is-sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
/* The background pseudo-layer: distinct, non-selectable, and the dashed marker
   on element rows that have been pushed behind it. */
.studio-layer-bg { background: var(--paper-2); border-style: dashed; }
.studio-layer-bgmain { cursor: default; }
.studio-layer.is-behind { opacity: 0.7; }
.studio-layer.is-behind .studio-layer-name { font-style: italic; }
.studio-layer.is-hidden .studio-layer-name { opacity: 0.5; text-decoration: line-through; }
.studio-layer-main { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: transparent; cursor: pointer; }
.studio-layer-kind { font-family: var(--f-sans); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.studio-layer-name { font-family: var(--f-sans); font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio-layer-ops { display: flex; border-top: 1px solid var(--rule); }
.studio-layer-op { flex: 1; height: 28px; border: 0; border-right: 1px solid var(--rule); background: transparent; cursor: pointer; font-size: 12px; line-height: 1; color: var(--ink-2); }
.studio-layer-op:last-child { border-right: 0; }
.studio-layer-op:hover:not(:disabled) { background: var(--hover); }
.studio-layer-op:disabled { opacity: 0.3; cursor: default; }
.studio-layer-del:hover { color: #b3261e; }

/* ============================================================
   ADS — campaign table + optimisation log
   ============================================================ */
.ad-table { border: 1px solid var(--rule); margin-bottom: 28px; }
.ad-row {
  display: grid; grid-template-columns: 2.4fr 1fr 1fr 1fr 1fr 0.8fr 0.7fr 0.9fr;
  gap: 10px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--rule);
  font-family: var(--f-sans); font-size: 12px; color: var(--ink-2);
}
.ad-row:last-child { border-bottom: 0; }
.ad-row.ad-head {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute);
  background: var(--paper-2);
}
.ad-row .mono { font-family: var(--f-mono); }
.ad-name { font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-status {
  display: inline-flex; align-items: center; font-family: var(--f-sans); font-size: 10px;
  letter-spacing: 0.04em; text-transform: capitalize; padding: 3px 8px; border-radius: 12px;
  border: 1px solid var(--rule); color: var(--mute); white-space: nowrap;
}
.ad-status.ad-ok   { color: #2c7a3f; border-color: color-mix(in oklch, #2c7a3f, transparent 70%); background: color-mix(in oklch, #2c7a3f, transparent 92%); }
.ad-status.ad-warn { color: #9a6a00; border-color: color-mix(in oklch, #9a6a00, transparent 70%); background: color-mix(in oklch, #9a6a00, transparent 92%); }

.ad-note-add { display: flex; gap: 10px; margin-bottom: 18px; }
.ad-note-add .text-input { flex: 1; }
.ad-log { border-left: 1px solid var(--rule); margin-left: 6px; }
.ad-log-item { position: relative; display: flex; gap: 14px; padding: 9px 0 9px 20px; }
.ad-log-dot {
  position: absolute; left: -4px; top: 13px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--mute); border: 2px solid var(--bg);
}
.ad-log-note .ad-log-dot { background: var(--accent); }
.ad-log-time { flex: 0 0 96px; font-size: 11px; color: var(--mute); padding-top: 1px; }
.ad-log-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ad-log-label { font-family: var(--f-sans); font-size: 13px; color: var(--ink); }
.ad-log-meta { font-family: var(--f-sans); font-size: 11px; color: var(--mute); }
@media (max-width: 900px) {
  .ad-row { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
  .ad-row > span:nth-child(n+5) { display: none; }
  .ad-camprow { grid-template-columns: 44px 1.6fr 1fr 1fr; }
  .ad-camprow > *:nth-child(n+5) { display: none; }
  .ad-cards { grid-template-columns: 1fr; }
}

.ad-account-select { min-width: 180px; max-width: 240px; }
.ad-netfilter { display: inline-flex; gap: 4px; }
.ad-netbtn { padding: 6px 12px; }
.ad-net-tag { display: inline-block; font-family: var(--f-sans); font-size: 9px; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 2px 6px; border-radius: 10px; margin-right: 7px; vertical-align: middle;
  border: 1px solid var(--rule); color: var(--mute); }
.ad-net-meta { color: #0866FF; border-color: color-mix(in oklch, #0866FF, transparent 70%); background: color-mix(in oklch, #0866FF, transparent 93%); }
.ad-net-linkedin { color: #0A66C2; border-color: color-mix(in oklch, #0A66C2, transparent 70%); background: color-mix(in oklch, #0A66C2, transparent 93%); }

/* Network-level accordion — open Meta or LinkedIn, then a campaign inside it. */
.ad-nettable { margin-bottom: 28px; }
.ad-netgroup { border: 1px solid var(--rule); margin-bottom: 14px; }
.ad-netgroup.is-open { box-shadow: 0 1px 0 var(--rule); }
.ad-netgroup .ad-table { border: 0; margin: 0; }
.ad-netgroup-head {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 16px;
  border: 0; background: var(--paper-2); text-align: left; font: inherit; color: var(--ink-2); cursor: pointer;
}
.ad-netgroup.is-open .ad-netgroup-head { border-bottom: 1px solid var(--rule); }
.ad-netgroup-head:hover { background: color-mix(in oklch, var(--paper-2), var(--ink-2) 5%); }
.ad-netgroup-head .ad-chev { flex: 0 0 14px; }
.ad-netgroup-head .ad-net-tag { margin-right: 0; }
.ad-netgroup-count { font-size: 12px; color: var(--mute); letter-spacing: 0.01em; }
.ad-netgroup-sum { margin-left: auto; display: flex; gap: 16px; font-size: 11.5px; color: var(--mute); }
.ad-netgroup-sum b { color: var(--ink-2); font-weight: 600; }
@media (max-width: 720px) { .ad-netgroup-sum { display: none; } }

/* Campaign accordion — a leading chevron column reveals the ads beneath. */
.ad-camprow { grid-template-columns: 52px 2.4fr 1fr 1fr 1fr 1fr 0.8fr 0.7fr 0.9fr; }
.ad-camphead {
  width: 100%; border: 0; border-bottom: 1px solid var(--rule); background: var(--bg);
  text-align: left; font: inherit; color: var(--ink-2); cursor: pointer;
}
.ad-camphead.is-empty { cursor: default; }
.ad-table > .ad-camp:last-child .ad-camphead { border-bottom: 0; }
.ad-table > .ad-camp:last-child .ad-camphead.is-open { border-bottom: 1px solid var(--rule); }
.ad-chev { font-size: 10px; color: var(--mute); text-align: center; }
.ad-camphead.is-open { background: var(--paper-2); }
.ad-name .ad-count {
  display: block; font-weight: 400; font-size: 10.5px; color: var(--mute);
  letter-spacing: 0.02em; text-transform: none; margin-top: 1px;
}

/* Ads inside an expanded campaign */
.ad-sublist { background: var(--paper-2); border-bottom: 1px solid var(--rule); }
.ad-sublist-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 14px; border-bottom: 1px solid var(--rule);
}
.ad-sublist-count { font-family: var(--f-sans); font-size: 11px; color: var(--mute); letter-spacing: 0.02em; }
.ad-viewtoggle { display: inline-flex; border: 1px solid var(--rule); border-radius: 7px; overflow: hidden; background: var(--bg); }
.ad-vbtn {
  border: 0; background: none; padding: 4px 11px; cursor: pointer;
  font-family: var(--f-sans); font-size: 11px; color: var(--mute); border-left: 1px solid var(--rule);
}
.ad-vbtn:first-child { border-left: 0; }
.ad-vbtn.is-on { background: var(--accent); color: #fff; }
.ad-vbtn:not(.is-on):hover { background: var(--paper-2); color: var(--ink-2); }

/* Rows view (default) — one ad per line. .ad-adrow reuses .ad-camprow's grid
   (9 columns) so every metric lines up under the campaign header above it. */
.ad-adrow { cursor: pointer; align-items: start; }
.ad-rows > .ad-adrow:last-child { border-bottom: 0; }
.ad-adrow:hover { background: var(--bg); }
.ad-adrow .mono { font-size: 11.5px; }
.ad-adrow-dim { color: var(--mute); }
.ad-adrow-thumb {
  width: 52px; align-self: stretch; min-height: 52px; border-radius: 6px; overflow: hidden;
  background: repeating-conic-gradient(#F1EFE9 0% 25%, #fff 0% 50%) 0 0 / 8px 8px;
  display: flex; align-items: center; justify-content: center;
}
.ad-adrow-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-adrow-noimg { font-family: var(--f-sans); font-size: 12px; color: var(--mute); }
.ad-adrow-name { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ad-adrow-title { font-family: var(--f-sans); font-size: 12.5px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-adrow-go { color: var(--accent); margin-left: 6px; font-size: 11px; opacity: 0; transition: opacity .12s; }
.ad-adrow:hover .ad-adrow-go { opacity: 1; }
.ad-adrow-body { font-family: var(--f-sans); font-size: 12px; color: var(--mute); line-height: 1.45; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Cards view (opt-in) — the richer thumbnail+body layout. */
.ad-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px;
  padding: 12px 14px;
}
.ad-card {
  display: flex; gap: 12px; padding: 10px; background: var(--bg);
  border: 1px solid var(--rule); border-radius: 8px;
}
.ad-card-thumb {
  flex: 0 0 76px; width: 76px; height: 76px; border-radius: 6px; overflow: hidden;
  background: repeating-conic-gradient(#F1EFE9 0% 25%, #fff 0% 50%) 0 0 / 12px 12px;
  display: flex; align-items: center; justify-content: center;
}
.ad-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-card-noimg { font-family: var(--f-sans); font-size: 10px; color: var(--mute); text-align: center; }
.ad-card-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.ad-card-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.ad-card-name { font-family: var(--f-sans); font-size: 12.5px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-card-body { font-family: var(--f-sans); font-size: 11px; color: var(--mute); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ad-card-metrics { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: auto; font-family: var(--f-sans); font-size: 11px; color: var(--mute); }
.ad-card-metrics b { font-family: var(--f-mono); font-weight: 500; color: var(--ink-2); }
.ad-sublist-loading { padding: 14px; background: var(--paper-2); border-bottom: 1px solid var(--rule);
  font-family: var(--f-sans); font-size: 12px; color: var(--mute); }
.ad-card-preview { margin-top: 6px; align-self: flex-start; background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--f-sans); font-size: 11px; color: var(--accent); }
.ad-card-preview:hover { text-decoration: underline; }

/* Ad preview modal — the real Meta-rendered ad (incl. CTA) in an iframe */
.admodal-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(20,18,15,0.82);
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.admodal { background: var(--bg); border-radius: 12px; width: min(460px, 96vw); max-height: 92vh; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 16px 60px rgba(0,0,0,0.4); }
.admodal-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--rule); }
.admodal-title { font-family: var(--f-sans); font-size: 13px; font-weight: 600; color: var(--ink); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admodal-x { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--mute); }
.admodal-formats { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--rule); }
.admodal-fbtn { border: 1px solid var(--rule); background: var(--bg); border-radius: 6px; cursor: pointer;
  font-family: var(--f-sans); font-size: 11px; padding: 4px 9px; color: var(--mute); }
.admodal-fbtn.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.admodal-body { padding: 14px; overflow: auto; display: flex; justify-content: center; }
.admodal-frame iframe { border: 0; max-width: 100%; }

/* Settings — agency ad account checklist */
.adacct-panel { margin-top: 8px; }
.adacct-list { display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; max-height: 320px; overflow-y: auto; }
.adacct-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--rule); cursor: pointer; font-family: var(--f-sans); font-size: 13px; }
.adacct-item:last-child { border-bottom: 0; }
.adacct-item:hover { background: var(--hover); }
.adacct-item input { width: 16px; height: 16px; accent-color: var(--ink); }
.adacct-name { color: var(--ink); }
.adacct-id { margin-left: auto; font-size: 11px; color: var(--mute); white-space: nowrap; }
.adacct-manual { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.adacct-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }

/* Admin — ad account assignment per org */
.adacct-admin { margin-top: 28px; }
.adacct-admin .adm-row { grid-template-columns: 1.4fr 2fr auto; align-items: start; }
.adacct-admin .adm-head { align-items: center; }
.adacct-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.adacct-chip { font-family: var(--f-sans); font-size: 11px; padding: 3px 9px; border-radius: 12px; background: var(--paper-2); border: 1px solid var(--rule); color: var(--ink-2); }
.adacct-chip-linkedin { border-color: color-mix(in oklch, #0A66C2, transparent 60%); }
.adacct-item .ad-net-tag { flex: 0 0 auto; }
.adacct-edit { display: flex; flex-direction: column; gap: 10px; }
.adacct-orgrow .adm-actions { display: flex; gap: 8px; }

/* Trend cards — KPI + sparkline (Insights + Annonser) */
.trend-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin-bottom: 28px; }
/* min-width: 0 — annars blir canvasens ritade bredd cellens minsta bredd, och
   raden kan växa med fönstret men aldrig krympa igen. */
.trend-card { background: var(--bg); padding: 16px 18px 10px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.trend-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.trend-card-l { font-family: var(--f-sans); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); }
.trend-card-sub { font-family: var(--f-sans); font-size: 10px; color: var(--mute); white-space: nowrap; }
.trend-card-v { font-family: var(--f-display); font-size: 28px; line-height: 1; color: var(--ink); }
.trend-card.is-clickable { cursor: pointer; transition: background .12s, box-shadow .12s, transform .12s; }
.trend-card.is-clickable:hover { background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--rule); transform: translateY(-1px); }
.trend-card-expand { font-size: 12px; color: var(--mute); margin-left: 6px; opacity: 0; transition: opacity .12s; }
.trend-card.is-clickable:hover .trend-card-expand { opacity: 1; }
.mini-trend { display: block; width: 100%; margin-top: 4px; }

/* KPI detail modal — a near-fullscreen view for one metric. */
/* KPI detail — an in-place view that replaces the Ads list (not an overlay). */
.kpi-detail { display: flex; flex-direction: column; }
.kpi-detail-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.kpi-back { flex: 0 0 auto; }
.kpi-detail-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.kpi-detail-title h1 { font-family: var(--f-display); font-size: 26px; margin: 0; color: var(--ink); }
.kpi-detail-days { margin-left: auto; display: inline-flex; gap: 4px; }
.kpimodal-dot { width: 10px; height: 10px; border-radius: 50%; align-self: center; }
.kpimodal-headline { font-family: var(--f-mono); font-size: 18px; color: var(--ink-2); margin-left: 4px; }
.kpimodal-sub { font-family: var(--f-sans); font-size: 12px; color: var(--mute); }
.kpimodal-tools { display: flex; align-items: center; gap: 18px; padding: 12px 0 14px; border-bottom: 1px solid var(--rule); }
.kpimodal-seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 7px; overflow: hidden; background: var(--bg); }
.kpimodal-segbtn { border: 0; border-left: 1px solid var(--rule); background: none; padding: 5px 13px; cursor: pointer; font-family: var(--f-sans); font-size: 12px; color: var(--mute); }
.kpimodal-segbtn:first-child { border-left: 0; }
.kpimodal-segbtn.is-on { background: var(--accent); color: #fff; }
.detchart { position: relative; padding: 16px 0 4px; }
.detchart-svg { display: block; width: 100%; }
.detchart-ylab { font-family: var(--f-mono); font-size: 10.5px; fill: var(--mute); }
.detchart-xlab { font-family: var(--f-sans); font-size: 10.5px; fill: var(--mute); }
.detchart-tip {
  position: absolute; transform: translateX(-50%); pointer-events: none; background: var(--bg);
  border: 1px solid var(--rule); border-radius: 7px; padding: 5px 9px; box-shadow: 0 6px 18px rgba(0,0,0,.14);
  display: flex; flex-direction: column; gap: 1px; white-space: nowrap;
}
.detchart-tip-d { font-family: var(--f-mono); font-size: 10px; color: var(--mute); }
.detchart-tip-v { font-family: var(--f-mono); font-size: 13px; font-weight: 600; }
.kpimodal-tabs { display: flex; align-items: center; gap: 4px; padding: 14px 0 0; border-bottom: 1px solid var(--rule); }
.kpi-detail-filters { margin-left: auto; display: inline-flex; gap: 16px; padding-bottom: 4px; }
.kpimodal-tab { border: 0; background: none; padding: 8px 12px; cursor: pointer; font-family: var(--f-sans); font-size: 12.5px; color: var(--mute); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.kpimodal-tab.is-on { color: var(--ink); border-bottom-color: var(--accent); }
.kpimodal-tablewrap { padding: 0 0 18px; }
.kpimodal-table { width: 100%; border-collapse: collapse; font-family: var(--f-sans); font-size: 12.5px; }
.kpimodal-table thead th { text-align: left; padding: 12px 10px 10px; border-bottom: 1px solid var(--rule); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.kpimodal-table th.num, .kpimodal-table td.num { text-align: right; font-family: var(--f-mono); }
.kpimodal-table td { padding: 9px 10px; border-bottom: 1px solid color-mix(in oklch, var(--rule), transparent 45%); color: var(--ink-2); }
.kpimodal-table td.hi { font-weight: 600; }
.kpimodal-cname { color: var(--ink); max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpimodal-cname .ad-net-tag { margin-right: 6px; }
.kpimodal-empty { text-align: center; color: var(--mute); padding: 24px 0; }
@media (max-width: 720px) {
  .kpimodal-tools { flex-wrap: wrap; gap: 10px; }
  .kpimodal-table td:nth-child(n+4), .kpimodal-table th:nth-child(n+4) { display: none; }
}
.mini-trend-empty { display: flex; align-items: flex-end; color: var(--mute); font-family: var(--f-mono); font-size: 11px; }
.ins-kpis-slim { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
/* Annonser KPI row: 5 across on desktop, a clean 3+2 when it gets tight, 2-up on phones. */
.trend-row.trend-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .trend-row.trend-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px)  { .trend-row.trend-5 { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================
   Polish — consistent hover feedback on rows & cards
   ============================================================ */
/* Informational/clickable table rows get a soft highlight on hover */
.ad-row:not(.ad-head),
.adm-row:not(.adm-head),
.bar-row,
.act-row,
.adacct-item { transition: background-color 130ms ease; }
.ad-row:not(.ad-head):hover,
.adm-row:not(.adm-head):hover,
.bar-row:hover,
.act-row:hover { background: var(--hover); }
.adacct-item:hover { background: var(--hover); }

/* Cards: subtle background lift + crisper border on hover */
.trend-card,
.ins-kpi,
.conn-card { transition: background-color 130ms ease, border-color 130ms ease, box-shadow 130ms ease; }
/* Cards sit on a --rule grid, so a translucent tint would let the darker grid
   show through and look dirty — use a solid, light hover instead. */
.trend-card:hover,
.ins-kpi:hover { background: var(--paper-2); }
.conn-card:hover { border-color: var(--rule-2); box-shadow: 0 2px 14px rgba(0,0,0,0.05); }

/* Optimisation-log entries highlight as a unit */
.ad-log-item { border-radius: 6px; padding-right: 8px; transition: background-color 130ms ease; }
.ad-log-item:hover { background: var(--hover); }

/* Buttons & toggles: gentle, consistent motion */
.tb-btn { transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease; }
.tb-toggle { transition: color 120ms ease; }
.tb-toggle:hover { color: var(--ink); }

/* Keyboard focus is visible without being loud */
.tb-btn:focus-visible,
.ad-row:focus-visible,
.ins-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Marketing team ─────────────────────────────────────────────────────── */
.mkt-flt { border: 0; background: none; cursor: pointer; font-family: var(--f-sans); font-size: 11px; color: var(--mute); padding: 2px 6px; border-radius: 5px; }
.mkt-flt.is-on { background: var(--accent); color: #fff; }
.mkt-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-bottom: 28px; }
.mkt-card { border: 1px solid var(--rule); border-radius: 10px; padding: 14px; background: var(--bg); display: flex; flex-direction: column; gap: 8px; }
.mkt-card.mkt-status-dismissed { opacity: 0.5; }
.mkt-card.mkt-status-accepted { border-color: color-mix(in oklch, #2C7A3F, transparent 55%); }
.mkt-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mkt-type { font-family: var(--f-sans); font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 7px; border: 1px solid; border-radius: 10px; }
.mkt-impact { font-family: var(--f-sans); font-size: 10px; color: var(--mute); }
.mkt-impact-high { color: #B23B3B; font-weight: 600; }
.mkt-conf { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-mono); font-size: 11px; color: var(--ink-2); }
.mkt-conf-bar { width: 52px; height: 5px; border-radius: 3px; background: var(--paper-2); overflow: hidden; display: inline-block; }
.mkt-conf-bar span { display: block; height: 100%; }
.mkt-card-title { font-family: var(--f-sans); font-size: 14px; font-weight: 600; color: var(--ink); }
.mkt-card-sum { font-family: var(--f-sans); font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.mkt-card-rec { font-family: var(--f-sans); font-size: 12px; color: var(--ink-2); background: var(--paper-2); border-radius: 6px; padding: 7px 9px; }
.mkt-card-ev { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; }
.mkt-card-ev a { color: var(--accent); }
.mkt-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.mkt-card-meta { font-family: var(--f-sans); font-size: 10.5px; color: var(--mute); }
.mkt-card-acts button { border: 1px solid var(--rule); background: var(--bg); width: 26px; height: 24px; border-radius: 5px; cursor: pointer; margin-left: 4px; font-size: 12px; color: var(--ink-2); }
.mkt-card-acts button:hover { border-color: var(--ink); }

.mkt-team { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.mkt-agent { display: flex; gap: 16px; justify-content: space-between; border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px; background: var(--bg); }
.mkt-agent.is-off { opacity: 0.55; }
.mkt-agent-name { font-family: var(--f-sans); font-size: 14px; font-weight: 600; color: var(--ink); }
.mkt-agent-desc { font-family: var(--f-sans); font-size: 12px; color: var(--ink-2); margin-top: 2px; max-width: 520px; }
.mkt-agent-tools { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.mkt-tool { font-family: var(--f-mono); font-size: 9.5px; color: var(--mute); background: var(--paper-2); border-radius: 4px; padding: 1px 5px; }
.mkt-agent-meta { font-family: var(--f-sans); font-size: 10.5px; color: var(--mute); margin-top: 6px; }
.mkt-agent-ctl { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; flex: 0 0 auto; }
.mkt-agent-ctl label { font-family: var(--f-sans); font-size: 10px; color: var(--mute); display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.mkt-agent-ctl select { font-family: var(--f-sans); font-size: 12px; padding: 4px 6px; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg); }

.mkt-config { max-width: 720px; margin-bottom: 28px; }
.mkt-comp-list { display: flex; flex-direction: column; gap: 6px; }
.mkt-comp { display: flex; align-items: center; gap: 10px; border: 1px solid var(--rule); border-radius: 7px; padding: 7px 10px; }
.mkt-comp-name { font-family: var(--f-sans); font-size: 13px; font-weight: 500; color: var(--ink); }
.mkt-comp-url { font-family: var(--f-sans); font-size: 11px; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mkt-comp-x { margin-left: auto; border: 0; background: none; cursor: pointer; color: var(--mute); font-size: 15px; }
.mkt-comp-add { display: flex; gap: 8px; margin-top: 8px; }
.mkt-comp-add .text-input:first-child { max-width: 200px; }
.mkt-note { margin-left: 12px; font-family: var(--f-sans); font-size: 12px; color: var(--mute); }
.mkt-run { margin-top: 2px; }
.mkt-runnote { border: 1px solid var(--rule); background: var(--paper-2); border-radius: 8px; padding: 10px 12px; font-family: var(--f-sans); font-size: 12.5px; color: var(--ink-2); }

/* ── Marketing team: development / learning view ────────────────────────── */
.mkt-agent-dir { font-family: var(--f-sans); font-size: 11.5px; color: var(--accent); margin-top: 6px; font-style: italic; }
.mkt-dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; margin-bottom: 26px; }
.mkt-dev-card { border: 1px solid var(--rule); border-radius: 10px; padding: 14px; background: var(--bg); }
.mkt-dev-name { font-family: var(--f-sans); font-size: 13.5px; font-weight: 600; color: var(--ink); }
.mkt-dev-dir { font-family: var(--f-sans); font-size: 11.5px; color: var(--accent); font-style: italic; margin: 4px 0 10px; }
.mkt-dev-empty { font-family: var(--f-sans); font-size: 11.5px; color: var(--mute); }
.mkt-lesson { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; border-top: 1px solid color-mix(in oklch, var(--rule), transparent 45%); }
.mkt-lesson-kind { flex: 0 0 auto; font-family: var(--f-sans); font-size: 8.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 1px 6px; border-radius: 8px; border: 1px solid var(--rule); color: var(--mute); }
.mkt-lk-principle { color: #2C7A3F; border-color: color-mix(in oklch, #2C7A3F, transparent 60%); }
.mkt-lk-caution { color: #B23B3B; border-color: color-mix(in oklch, #B23B3B, transparent 60%); }
.mkt-lesson-text { font-family: var(--f-sans); font-size: 12px; color: var(--ink-2); line-height: 1.4; flex: 1; min-width: 0; }
.mkt-lesson-str { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; }
.mkt-lesson-rein { font-family: var(--f-mono); font-size: 9.5px; color: var(--mute); }
.mkt-devlog { border-left: 1px solid var(--rule); margin-left: 6px; margin-bottom: 28px; }
.mkt-devlog-item { display: flex; align-items: baseline; gap: 10px; padding: 7px 0 7px 16px; }
.mkt-devlog-time { flex: 0 0 108px; font-size: 10.5px; color: var(--mute); }
.mkt-devlog-act { flex: 0 0 auto; font-family: var(--f-sans); font-size: 9px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 1px 7px; border-radius: 8px; border: 1px solid var(--rule); color: var(--mute); }
.mkt-act-learned { color: #2C7A3F; border-color: color-mix(in oklch, #2C7A3F, transparent 60%); }
.mkt-act-reinforced { color: #0A66C2; border-color: color-mix(in oklch, #0A66C2, transparent 60%); }
.mkt-act-archived, .mkt-act-pruned { color: #B23B3B; border-color: color-mix(in oklch, #B23B3B, transparent 60%); }
.mkt-act-direction { color: var(--accent); border-color: color-mix(in oklch, var(--accent), transparent 60%); }
.mkt-devlog-agent { flex: 0 0 auto; font-family: var(--f-sans); font-size: 11px; font-weight: 600; color: var(--ink); }
.mkt-devlog-note { font-family: var(--f-sans); font-size: 11.5px; color: var(--ink-2); min-width: 0; }
.mkt-comp-in-name { flex: 0 0 200px; }
.mkt-comp-in-url { flex: 1; min-width: 0; }
.mkt-comp .text-input { padding: 6px 8px; font-size: 12.5px; }

/* ── Marketing board: view toggle, filters, list, SWOT, matrix ──────────── */
.mkt-boardbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.mkt-viewseg { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--bg); }
.mkt-viewbtn { border: 0; border-left: 1px solid var(--rule); background: none; padding: 6px 12px; cursor: pointer; font-family: var(--f-sans); font-size: 12px; color: var(--mute); }
.mkt-viewbtn:first-child { border-left: 0; }
.mkt-viewbtn.is-on { background: var(--accent); color: #fff; }
.mkt-typefilter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mkt-typechip { border: 1px solid; background: var(--bg); border-radius: 12px; padding: 3px 10px; cursor: pointer; font-family: var(--f-sans); font-size: 11px; font-weight: 600; }
.mkt-typeclear { color: var(--mute) !important; border-color: var(--rule) !important; font-weight: 400; }

/* list */
.mkt-list { width: 100%; border-collapse: collapse; font-family: var(--f-sans); font-size: 12.5px; margin-bottom: 28px; }
.mkt-list thead th { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.mkt-list th.num { text-align: right; }
.mkt-list td { padding: 9px 10px; border-bottom: 1px solid color-mix(in oklch, var(--rule), transparent 45%); color: var(--ink-2); vertical-align: top; }
.mkt-list td.num { text-align: right; font-family: var(--f-mono); }
.mkt-list-title b { color: var(--ink); }
.mkt-list-sum { color: var(--mute); }
.mkt-list-status { text-transform: capitalize; color: var(--mute); }
.mkt-lvl { font-family: var(--f-sans); font-size: 11px; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--rule); color: var(--mute); }
.mkt-lvl-high { color: #B23B3B; border-color: color-mix(in oklch, #B23B3B, transparent 55%); }
.mkt-lvl-medium { color: #9a6a00; border-color: color-mix(in oklch, #9a6a00, transparent 55%); }
.mkt-lvl-low { color: #2C7A3F; border-color: color-mix(in oklch, #2C7A3F, transparent 55%); }
.mkt-list-acts .mkt-card-acts { display: inline-flex; }

/* shared chip (swot + matrix) */
.mkt-chip { border: 1px solid var(--rule); border-left: 3px solid; border-radius: 6px; background: var(--bg); padding: 5px 8px; margin-bottom: 5px; }
.mkt-chip-title { display: block; font-family: var(--f-sans); font-size: 11.5px; color: var(--ink); line-height: 1.3; }
.mkt-chip-meta { font-family: var(--f-sans); font-size: 9.5px; color: var(--mute); }

/* SWOT */
.mkt-swot { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 28px; }
.mkt-swot-q { border: 1px solid var(--rule); border-radius: 10px; padding: 12px; min-height: 120px; }
.mkt-swot-strengths { background: color-mix(in oklch, #2C7A3F, transparent 94%); }
.mkt-swot-weaknesses { background: color-mix(in oklch, #B23B3B, transparent 94%); }
.mkt-swot-opportunities { background: color-mix(in oklch, #0A66C2, transparent 94%); }
.mkt-swot-threats { background: color-mix(in oklch, #C2722C, transparent 94%); }
.mkt-swot-h { font-family: var(--f-sans); font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.mkt-swot-h span { font-weight: 400; font-size: 10.5px; color: var(--mute); }
.mkt-swot-empty { color: var(--mute); font-size: 12px; }
@media (max-width: 640px) { .mkt-swot { grid-template-columns: 1fr; } }

/* Impact × Effort matrix */
.mkt-matrix-wrap { position: relative; padding-left: 22px; margin-bottom: 28px; }
.mkt-matrix-yaxis { position: absolute; left: -18px; top: 45%; transform: rotate(-90deg); transform-origin: left; font-family: var(--f-sans); font-size: 11px; font-weight: 600; color: var(--mute); white-space: nowrap; }
.mkt-matrix { display: grid; grid-template-columns: 64px 1fr 1fr 1fr; gap: 6px; }
.mkt-matrix-ylabel { display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; font-family: var(--f-sans); font-size: 11px; color: var(--mute); }
.mkt-matrix-cell { border: 1px solid var(--rule); border-radius: 8px; background: var(--paper-2); min-height: 96px; padding: 7px; }
.mkt-matrix-cell.is-win { background: color-mix(in oklch, #2C7A3F, transparent 90%); border-color: color-mix(in oklch, #2C7A3F, transparent 55%); }
.mkt-matrix-corner {}
.mkt-matrix-xlabel { text-align: center; font-family: var(--f-sans); font-size: 11px; color: var(--mute); padding-top: 4px; }
.mkt-matrix-xaxis { text-align: center; font-family: var(--f-sans); font-size: 11px; font-weight: 600; color: var(--mute); margin-top: 4px; padding-left: 64px; }
.mkt-team-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; background: var(--paper-2); margin-bottom: 10px; }
.mkt-team-hint { font-family: var(--f-sans); font-size: 12px; color: var(--ink-2); }

/* ── Competitor watch — the SoMe scout's observation log ────────────────── */
.cw-wrap { display: flex; flex-direction: column; gap: 6px; }
.cw-empty { border: 1px dashed var(--rule); border-radius: 10px; padding: 26px 20px; text-align: center; font-family: var(--f-sans); font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cw-group { margin-top: 10px; }
.cw-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.cw-obs { border: 1px solid var(--rule); border-radius: 10px; background: var(--paper-2); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.cw-obs-meta { display: flex; align-items: center; gap: 8px; font-family: var(--f-sans); font-size: 11px; color: var(--mute); }
.cw-chip { border: 1px solid var(--rule); border-radius: 999px; padding: 1px 9px; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; background: var(--bg); }
.cw-kind { font-weight: 600; }
.cw-date { margin-left: auto; }
.cw-obs-body b { font-family: var(--f-sans); font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.cw-obs-body a { color: inherit; }
.cw-obs-body p { font-family: var(--f-sans); font-size: 12.5px; color: var(--ink-2); line-height: 1.45; margin-top: 5px; }
.cw-obs-body .cw-tone { font-style: italic; color: var(--mute); }
.cw-foot { border: 1px solid var(--rule); border-radius: 10px; background: var(--paper-2); padding: 12px 14px; font-family: var(--f-sans); font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* ── Kom igång — typeform-lik onboarding i eget fönster ─────────────────── */
.obw { display: flex; flex-direction: column; height: 100%; min-height: 520px; padding: 26px 34px; overflow: hidden; }
.obw-dots { display: flex; gap: 7px; justify-content: center; margin-bottom: 8px; }
.obw-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--rule); transition: background .25s, transform .25s; }
.obw-dot.is-on { background: var(--ink); transform: scale(1.25); }
.obw-dot.is-done { background: var(--mute); }
.obw-step { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
.obw-fwd  { animation: obw-in-fwd .38s cubic-bezier(.22,.8,.3,1) both; }
.obw-back { animation: obw-in-back .38s cubic-bezier(.22,.8,.3,1) both; }
@keyframes obw-in-fwd  { from { opacity: 0; transform: translateX(46px); } to { opacity: 1; transform: none; } }
@keyframes obw-in-back { from { opacity: 0; transform: translateX(-46px); } to { opacity: 1; transform: none; } }
.obw-q { max-width: 620px; width: 100%; margin: auto; padding: 16px 0; }
.obw-q h1 { font-size: 27px; line-height: 1.2; margin-bottom: 10px; }
.obw-q h2 { font-size: 20px; }
.obw-sub { font-family: var(--f-sans); font-size: 13.5px; color: var(--ink-2); line-height: 1.5; margin-bottom: 18px; }
.obw-center { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.obw-label { display: block; font-family: var(--f-sans); font-size: 11.5px; font-weight: 600; color: var(--mute); margin: 14px 0 5px; letter-spacing: .03em; text-transform: uppercase; }
.obw-urlrow { display: flex; gap: 10px; }
.obw-url { flex: 1; font-size: 17px; padding: 12px 14px; }
.obw-big { padding: 11px 20px; font-size: 14px; }
.obw-err { margin-top: 14px; }
.obw-skip { background: none; border: none; margin-top: 18px; font-family: var(--f-sans); font-size: 12px; color: var(--mute); text-decoration: underline; cursor: pointer; }
.obw-skip:hover { color: var(--ink-2); }
.obw-spin { width: 42px; height: 42px; border-radius: 999px; border: 3px solid var(--rule); border-top-color: var(--ink); animation: obw-rot .9s linear infinite; margin-bottom: 18px; }
@keyframes obw-rot { to { transform: rotate(360deg); } }
.obw-loadmsg { animation: obw-in-fwd .4s both; }
.obw-natl { display: flex; align-items: center; gap: 9px; font-family: var(--f-sans); font-size: 13.5px; margin-bottom: 14px; cursor: pointer; }
.obw-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.obw-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule); border-radius: 999px; padding: 5px 7px 5px 13px; font-family: var(--f-sans); font-size: 13px; background: var(--paper-2); }
.obw-chip button { border: none; background: var(--rule); color: var(--ink-2); border-radius: 999px; width: 18px; height: 18px; line-height: 1; cursor: pointer; font-size: 12px; }
.obw-chip button:hover { background: var(--ink); color: var(--bg); }
.obw-chips-empty { font-family: var(--f-sans); font-size: 12.5px; color: var(--mute); }
.obw-addrow { display: flex; gap: 8px; }
.obw-addrow .text-input { flex: 1; }
.obw-complist { display: flex; flex-direction: column; gap: 8px; }
.obw-comp { display: flex; gap: 11px; align-items: flex-start; border: 1px solid var(--rule); border-radius: 10px; padding: 11px 13px; background: var(--paper-2); cursor: pointer; opacity: .62; transition: opacity .2s, border-color .2s; }
.obw-comp.is-on { opacity: 1; border-color: color-mix(in oklch, var(--ink), transparent 55%); }
.obw-comp input { margin-top: 3px; }
.obw-comp-main { display: flex; flex-direction: column; gap: 3px; font-family: var(--f-sans); font-size: 13px; min-width: 0; }
.obw-comp-main em { font-style: normal; color: var(--mute); font-size: 12px; }
.obw-comp-note { color: var(--ink-2); font-size: 12.5px; line-height: 1.4; }
.obw-comp-main a { color: var(--mute); font-size: 12px; overflow-wrap: anywhere; }
.obw-sum li { margin-bottom: 6px; }
.obw-donerow { display: flex; gap: 10px; margin-top: 10px; }
.obw-foot { display: flex; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--rule); }

/* ── Marketing team chat ────────────────────────────────────────────────── */
.mkt-chat { display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: 12px; background: var(--bg); height: min(64vh, 640px); margin-bottom: 28px; }
.mkt-chat-scroll { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.mkt-chat-empty { max-width: 560px; margin: auto; text-align: center; font-family: var(--f-sans); font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.mkt-chat-empty p { margin-bottom: 14px; }
.mkt-msg { display: flex; flex-direction: column; max-width: 78%; }
.mkt-msg-user { align-self: flex-end; align-items: flex-end; }
.mkt-msg-assistant { align-self: flex-start; align-items: flex-start; }
.mkt-msg-bubble { font-family: var(--f-sans); font-size: 13px; line-height: 1.5; padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; }
.mkt-msg-user .mkt-msg-bubble { background: var(--ink); color: var(--bg); border-bottom-right-radius: 4px; }
.mkt-msg-assistant .mkt-msg-bubble { background: var(--paper-2); color: var(--ink); border: 1px solid var(--rule); border-bottom-left-radius: 4px; }
/* Modellsvar som lätt markdown: stycken, listor, fetstil — inte pre-wrap. */
.mkt-msg-bubble.md { white-space: normal; }
.md p { margin: 0 0 8px; }
.md p:last-child, .md ol:last-child, .md ul:last-child { margin-bottom: 0; }
.md h4 { margin: 10px 0 6px; font-size: 13px; font-weight: 700; }
.md ol, .md ul { margin: 4px 0 10px; padding-left: 22px; }
.md li { margin: 0 0 6px; }
.md li:last-child { margin-bottom: 0; }
.md li > ol, .md li > ul { margin: 4px 0 0; }
.md strong { font-weight: 700; }
.md code { font-family: var(--f-mono); font-size: 12px; background: rgba(0,0,0,.06); padding: 1px 4px; border-radius: 3px; }
.md a { color: inherit; text-decoration: underline; }
.mkt-msg-thinking { color: var(--mute); font-style: italic; }
.mkt-msg-author { font-family: var(--f-sans); font-size: 10px; color: var(--mute); margin-bottom: 2px; padding: 0 4px; }
.mkt-msg-effects { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mkt-effect { font-family: var(--f-sans); font-size: 10.5px; padding: 2px 9px; border-radius: 10px; border: 1px solid var(--rule); color: var(--ink-2); background: var(--bg); }
.mkt-eff-accepted { color: #2C7A3F; border-color: color-mix(in oklch, #2C7A3F, transparent 55%); }
.mkt-eff-dismissed { color: #B23B3B; border-color: color-mix(in oklch, #B23B3B, transparent 55%); }
.mkt-eff-actioned { color: #0A66C2; border-color: color-mix(in oklch, #0A66C2, transparent 55%); }
.mkt-eff-learn { color: var(--accent); border-color: color-mix(in oklch, var(--accent), transparent 55%); }
.mkt-eff-live { color: #0E7C7B; border-color: color-mix(in oklch, #0E7C7B, transparent 55%); }
.mkt-eff-edit { color: #6B4FA0; border-color: color-mix(in oklch, #6B4FA0, transparent 55%); }
.mkt-eff-run  { color: #0A66C2; border-color: color-mix(in oklch, #0A66C2, transparent 55%); }
.mkt-chat-options { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 18px 0; }
.mkt-chat-opt { border: 1px solid var(--accent); color: var(--accent); background: var(--bg); border-radius: 16px; padding: 6px 14px; cursor: pointer; font-family: var(--f-sans); font-size: 12px; }
.mkt-chat-opt:hover { background: var(--accent); color: #fff; }
.mkt-chat-inputrow { display: flex; gap: 10px; padding: 12px 18px 16px; align-items: flex-end; }
.mkt-chat-input { flex: 1; resize: none; }

/* ── Marketing board v2: graphic SWOT square + scatter matrix ───────────── */
.mkt-dotwrap { position: relative; display: inline-flex; align-items: center; justify-content: center; padding: 3px; cursor: pointer; outline: none; }
.mkt-dot { display: block; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg), 0 1px 3px rgba(0,0,0,.25); transition: transform .12s; }
.mkt-dotwrap:hover .mkt-dot, .mkt-dotwrap:focus .mkt-dot { transform: scale(1.35); }
.mkt-dottip {
  position: absolute; z-index: 30; display: none; flex-direction: column; gap: 5px;
  width: 260px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--rule);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); text-align: left;
}
.mkt-dotwrap:hover .mkt-dottip, .mkt-dotwrap:focus .mkt-dottip { display: flex; }
.mkt-dotwrap.tipv-t .mkt-dottip { bottom: calc(100% + 6px); }
.mkt-dotwrap.tipv-b .mkt-dottip { top: calc(100% + 6px); }
.mkt-dotwrap.tiph-c .mkt-dottip { left: 50%; transform: translateX(-50%); }
.mkt-dotwrap.tiph-l .mkt-dottip { left: -6px; }
.mkt-dotwrap.tiph-r .mkt-dottip { right: -6px; }
.mkt-dottip-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mkt-dottip-conf { font-family: var(--f-mono); font-size: 10px; color: var(--mute); }
.mkt-dottip-title { font-family: var(--f-sans); font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.mkt-dottip-sum { font-family: var(--f-sans); font-size: 11.5px; color: var(--ink-2); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.mkt-dottip-foot { font-family: var(--f-sans); font-size: 10px; color: var(--mute); }
.mkt-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; margin-bottom: 28px; }
.mkt-legend-item { display: inline-flex; align-items: center; gap: 5px; font-family: var(--f-sans); font-size: 11px; color: var(--ink-2); }
.mkt-legend-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--bg), 0 0 0 2px var(--rule); }
.mkt-legend-note { font-family: var(--f-sans); font-size: 10.5px; color: var(--mute); font-style: italic; }

/* SWOT square */
.mkt-swotwrap { max-width: 880px; }
.mkt-swot2-cols { display: grid; grid-template-columns: 1fr 1fr; margin-left: 26px; margin-bottom: 6px; }
.mkt-swot2-cols span { text-align: center; font-family: var(--f-sans); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.mkt-swot2-row { display: flex; }
.mkt-swot2-rows { width: 26px; display: flex; flex-direction: column; }
.mkt-swot2-rows span { flex: 1; display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--f-sans); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.mkt-swot2 { position: relative; flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  border: 2px solid var(--ink); border-radius: 14px; overflow: hidden; aspect-ratio: 1.7; min-height: 380px; }
.mkt-swot2-q { position: relative; padding: 12px 14px; display: flex; flex-direction: column; }
.mkt-swot2-strengths     { background: color-mix(in oklch, #2C7A3F, transparent 88%); }
.mkt-swot2-weaknesses    { background: color-mix(in oklch, #B23B3B, transparent 90%); }
.mkt-swot2-opportunities { background: color-mix(in oklch, #0A66C2, transparent 90%); }
.mkt-swot2-threats       { background: color-mix(in oklch, #C2722C, transparent 88%); }
.mkt-swot2-h { display: flex; align-items: baseline; gap: 8px; }
.mkt-swot2-h b { font-family: var(--f-display); font-size: 17px; color: var(--ink); }
.mkt-swot2-h span { font-family: var(--f-mono); font-size: 11px; color: var(--mute); }
.mkt-swot2-dots { flex: 1; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 6px; padding: 10px 6px; }
.mkt-swot2-none { color: var(--mute); font-size: 13px; }
.mkt-swot2-cross { position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(var(--ink), var(--ink)) center/2px 100% no-repeat,
    linear-gradient(var(--ink), var(--ink)) center/100% 2px no-repeat; opacity: .75; }

/* Impact × Effort scatter */
.mkt-mx-wrap { max-width: 880px; }
.mkt-mx-row { display: flex; gap: 8px; }
.mkt-mx-yaxis { display: flex; gap: 4px; }
.mkt-mx-yword { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center;
  font-family: var(--f-sans); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.mkt-mx-ylabels { display: flex; flex-direction: column; }
.mkt-mx-ylabels span { flex: 1; display: flex; align-items: center; font-family: var(--f-sans); font-size: 10.5px; color: var(--mute); }
.mkt-mx { position: relative; flex: 1; border: 2px solid var(--ink); border-radius: 14px; overflow: hidden; aspect-ratio: 1.7; min-height: 380px; background: var(--bg); }
.mkt-mx-zone { position: absolute; width: 50%; height: 50%; }
.mkt-mx-zone span { position: absolute; font-family: var(--f-sans); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; opacity: .55; }
.mkt-mx-zone.z-tl { left: 0; top: 0; background: color-mix(in oklch, #2C7A3F, transparent 86%); }
.mkt-mx-zone.z-tl span { left: 10px; top: 8px; color: #2C7A3F; }
.mkt-mx-zone.z-tr { right: 0; top: 0; background: color-mix(in oklch, #0A66C2, transparent 90%); }
.mkt-mx-zone.z-tr span { right: 10px; top: 8px; color: #0A66C2; }
.mkt-mx-zone.z-bl { left: 0; bottom: 0; background: color-mix(in oklch, #9a6a00, transparent 92%); }
.mkt-mx-zone.z-bl span { left: 10px; bottom: 8px; color: #9a6a00; }
.mkt-mx-zone.z-br { right: 0; bottom: 0; background: color-mix(in oklch, #B23B3B, transparent 91%); }
.mkt-mx-zone.z-br span { right: 10px; bottom: 8px; color: #B23B3B; }
.mkt-mx-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.mkt-mx-cell { display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 5px; padding: 8px; }
.mkt-mx-xrow { margin-left: 34px; }
.mkt-mx-xlabels { display: grid; grid-template-columns: repeat(3, 1fr); }
.mkt-mx-xlabels span { text-align: center; font-family: var(--f-sans); font-size: 10.5px; color: var(--mute); padding-top: 4px; }
.mkt-mx-xword { text-align: center; font-family: var(--f-sans); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin-top: 2px; }

/* ── Marketing chat dock ── */

.mkt-dock {
  width: var(--chatdock-w, 380px);
  border-left: 1px solid var(--rule);
  background: var(--paper);
  position: sticky; top: 0;
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  min-width: 0;
  overflow: hidden;
  transition: width .28s ease;
}
.mkt-dock.is-closed {
  width: 0; visibility: hidden; border-left: none;
  transition: width .28s ease, visibility 0s linear .28s;
}
/* full-width children while sliding — clip, don't squish */
.mkt-dock > * { min-width: var(--chatdock-w, 380px); }
.mkt-dock-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--rule);
}
.mkt-dock-title { font-family: var(--f-sans); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); }
.mkt-dock-close { border: none; background: none; color: var(--mute); cursor: pointer; font-size: 14px; padding: 2px 6px; }
.mkt-dock-close:hover { color: var(--ink); }
/* the chat fills the dock — no card frame, no fixed height */
.mkt-chat--dock { flex: 1; min-height: 0; border: none; border-radius: 0; margin-bottom: 0; height: auto; background: var(--paper); }
.mkt-chat--dock .mkt-msg { max-width: 92%; }
.mkt-chat--dock .mkt-chat-scroll { padding: 14px; }
.mkt-chat--dock .mkt-chat-inputrow { padding: 10px 14px 14px; }
.mkt-chat--dock .mkt-chat-options { padding: 8px 14px 0; }

/* Narrow screens: the dock overlays instead of squeezing the content —
   fixed to the right edge and sliding in/out via transform. */
@media (max-width: 1100px) {
  .mkt-dock {
    position: fixed; right: 0; top: 0; width: min(380px, 92vw); z-index: 60;
    box-shadow: -12px 0 32px rgba(0,0,0,.18);
    transform: translateX(0);
    transition: transform .28s ease;
  }
  .mkt-dock.is-closed {
    width: min(380px, 92vw); border-left: 1px solid var(--rule);
    transform: translateX(102%);
    transition: transform .28s ease, visibility 0s linear .28s;
  }
  .mkt-dock > * { min-width: 0; }
}

/* ── Dashboard: marketing team pulse ────────────────────────────────────── */
.mkt-pulse-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.mkt-pulse-card { border: 1px solid var(--rule); border-radius: 12px; background: var(--paper); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.mkt-pulse-h { font-family: var(--f-sans); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.mkt-pulse-empty { font-family: var(--f-sans); font-size: 12px; color: var(--mute); line-height: 1.45; }
.mkt-pulse-insight { display: flex; align-items: center; gap: 8px; border: none; background: none; cursor: pointer; text-align: left; padding: 4px 0; }
.mkt-pulse-insight:hover .mkt-pulse-ititle { text-decoration: underline; }
.mkt-pulse-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 1.5px var(--bg), 0 0 0 2px var(--rule); }
.mkt-pulse-ititle { font-family: var(--f-sans); font-size: 12.5px; color: var(--ink); line-height: 1.35; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mkt-pulse-imeta { font-family: var(--f-mono); font-size: 10px; color: var(--mute); }
.mkt-pulse-lesson, .mkt-pulse-msg { font-family: var(--f-sans); font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.mkt-pulse-link { margin-top: auto; align-self: flex-start; border: none; background: none; cursor: pointer;
  font-family: var(--f-sans); font-size: 11.5px; color: var(--accent); padding: 4px 0 0; }
.mkt-pulse-link:hover { text-decoration: underline; }

/* ── Page transition: gentle fade + rise on every view change ───────────── */
@keyframes viewEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ── Chat cards: rich insight/post previews inside the dock ─────────────── */
.mkt-chatcard {
  display: flex; gap: 0; margin-top: 6px; max-width: 100%; text-align: left;
  background: var(--bg); border: 1px solid var(--rule); border-radius: 10px;
  overflow: hidden; font-family: var(--f-sans);
}
button.mkt-chatcard { cursor: pointer; padding: 0; }
.mkt-chatcard-insight { border-left: 3px solid var(--rule); }
.mkt-chatcard-insight:hover { border-color: var(--ink-2); }
.mkt-chatcard-img { width: 86px; height: 86px; object-fit: cover; flex: 0 0 auto; background: var(--paper-2); }
.mkt-chatcard-body { padding: 8px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mkt-chatcard-title { font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.mkt-chatcard-meta { font-size: 10.5px; color: var(--mute); }
.mkt-chatcard-meta b { color: var(--ink); }
.mkt-chatcard-sum { font-size: 11.5px; color: var(--ink-2); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mkt-chatcard-rec { font-size: 11px; color: var(--ink-2); font-style: italic; }
.mkt-chatcard-stats { display: flex; flex-wrap: wrap; gap: 8px; font-size: 10.5px; color: var(--ink-2); font-family: var(--f-mono); }
.mkt-chatcard-link { font-size: 11px; color: var(--accent); text-decoration: none; }
.mkt-chatcard-link:hover { text-decoration: underline; }

/* board: human-friendly insight number */
.mkt-seq { font-family: var(--f-mono); font-size: 10.5px; color: var(--mute); }

/* typing indicator: three dots bouncing one at a time */
.mkt-typing { display: inline-flex; align-items: center; gap: 4px; padding: 12px 16px; }
.mkt-typing-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--mute);
  animation: typingBounce 1.2s infinite ease-in-out;
}
.mkt-typing-dot:nth-child(2) { animation-delay: .18s; }
.mkt-typing-dot:nth-child(3) { animation-delay: .36s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30%           { transform: translateY(-4px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .mkt-typing-dot { animation: none; opacity: .7; } }

/* Inspector sliders (mask radius / crop zoom / focal point) */
.studio-slider { width: 100%; accent-color: var(--ink); margin: 2px 0 6px; }

/* ── Studio: Adobe-like chrome ──────────────────────────────────────────── */
/* Menubar — Arkiv/Objekt/Bild, familiar to Adobe hands */
.studio-menubar {
  display: flex; align-items: center; gap: 2px;
  background: #2E2C29; border-radius: 8px 8px 0 0;
  padding: 2px 8px; position: relative; z-index: 20;
}
.studio-menu { position: relative; }
.studio-menu-btn {
  border: 0; background: transparent; cursor: pointer;
  font-family: var(--f-sans); font-size: 12px; color: #D9D5CC;
  padding: 6px 10px; border-radius: 5px;
}
.studio-menu-btn:hover, .studio-menu-btn.is-open { background: rgba(255,255,255,.12); color: #fff; }
.studio-menu-drop {
  position: absolute; top: 100%; left: 0; min-width: 210px; z-index: 40;
  background: #34322E; border: 1px solid #47443F; border-radius: 0 8px 8px 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,.35); padding: 5px;
  display: flex; flex-direction: column;
}
.studio-menu-item {
  border: 0; background: transparent; cursor: pointer; text-align: left;
  font-family: var(--f-sans); font-size: 12.5px; color: #E7E3DA;
  padding: 7px 12px; border-radius: 5px; white-space: nowrap;
}
.studio-menu-item:hover:not(:disabled) { background: var(--accent); color: #fff; }
.studio-menu-item:disabled { color: #7C7870; cursor: default; }
.studio-menu-sep { height: 1px; background: #47443F; margin: 4px 8px; }
.studio-menubar-doc { margin-left: auto; font-family: var(--f-sans); font-size: 11px; color: #8F8B83; padding-right: 6px; }

/* Channel tabs + format chips as document tabs on the dark chrome */
.studio-bar { background: #3B3936; padding: 6px 10px 0; border-radius: 0; margin: 0; display: flex; align-items: flex-end; gap: 18px; }
.studio-chtab { color: #A5A19A; border-bottom-color: transparent; }
.studio-chtab:hover { color: #E7E3DA; }
.studio-chtab.is-on { color: #fff; border-bottom-color: var(--accent); }
.studio-fchip { background: transparent; border: 1px solid transparent; border-bottom: none; color: #A5A19A; border-radius: 7px 7px 0 0; padding: 6px 14px; }
.studio-fchip:hover { color: #E7E3DA; border-color: transparent; }
.studio-fchip.is-on { background: #55524D; color: #fff; border-color: #55524D; }
.studio-slides { padding: 0 10px 8px; }
.studio-slides-lbl { color: #8F8B83; }
.studio-slide-btn, .studio-slide-x { border-color: #55524D; color: #A5A19A; }
.studio-slide.is-on .studio-slide-btn, .studio-slide.is-on .studio-slide-x { background: #55524D; border-color: #55524D; color: #fff; }
.studio-slide-add { border-color: #55524D; color: #A5A19A; }
.studio-slide-add:hover { border-color: #E7E3DA; color: #E7E3DA; }

/* Pasteboard: the canvas floats on a neutral dark work area */
.studio-shell { background: #55524D; border-radius: 0 0 10px 10px; padding: 16px; gap: 16px; }
.studio-stage { background: transparent; min-height: 560px; justify-content: center; }
.studio-post-wrap { filter: drop-shadow(0 10px 34px rgba(0,0,0,.4)); }
.studio-dims { color: #C9C5BC; }

/* Left tool rail + collapsible panel — panels get light "app panel" surface */
.studio-left { background: var(--paper); border: none; border-radius: 10px; overflow: visible; align-self: start;
  grid-template-columns: 64px 306px; width: 370px; }
.studio-left.is-collapsed { grid-template-columns: 64px; width: 64px; }
.studio-rail { border-right: 1px solid var(--rule); }
.studio-left.is-collapsed .studio-rail { border-right: none; }

/* Right: Egenskaper over a docked Lager panel */
.studio-inspector { background: var(--paper); border: none; border-radius: 10px; padding: 0; gap: 0; align-self: stretch; overflow: hidden; }
.studio-props { order: 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; overflow-y: auto; }
.studio-layerspanel { order: 1; border-top: 1px solid var(--rule); background: var(--bg); max-height: 300px; overflow-y: auto; flex: 0 0 auto; }
.studio-layerspanel .studio-layers { padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 6px; }

/* ── Studio v3: floating tool windows + docked layers palette ───────────── */
/* Shell: rail · layers palette · pasteboard · properties */
.studio-shell { grid-template-columns: 48px 236px minmax(420px, 1fr) 240px; position: relative; }
.studio-left { grid-template-columns: 48px; width: 48px; background: transparent; overflow: visible; }
.studio-rail { background: var(--paper); border: none; border-radius: 9px; padding: 6px 4px; gap: 2px; }
.studio-railbtn { padding: 9px 2px; border-radius: 7px; }
.studio-railglyph { font-size: 17px; }
.studio-raillabel { display: none; }   /* icon-only, like the apps */

/* Floating tool window — dragged by its title bar, above the pasteboard */
.studio-toolwin {
  position: absolute; z-index: 60; width: 340px;
  background: var(--paper); border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.15);
  display: flex; flex-direction: column; overflow: hidden;
}
.studio-toolwin-title {
  display: flex; align-items: center; justify-content: space-between;
  background: #34322E; color: #E7E3DA; cursor: grab; user-select: none;
  font-family: var(--f-sans); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
  padding: 8px 12px;
}
.studio-toolwin-title:active { cursor: grabbing; }
.studio-toolwin-x { border: 0; background: transparent; color: #A5A19A; cursor: pointer; font-size: 16px; line-height: 1; }
.studio-toolwin-x:hover { color: #fff; }
.studio-toolwin .studio-panel { min-height: 0; max-height: min(560px, 62vh); overflow-y: auto; padding: 14px 16px; }

/* Layers palette (left, always visible): thumb · name · stack position */
.studio-layersdock {
  background: var(--paper); border-radius: 10px; align-self: stretch;
  display: flex; flex-direction: column; min-height: 0; max-height: 640px;
}
.studio-layersdock-h {
  font-family: var(--f-sans); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--mute); padding: 12px 14px 8px; border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; gap: 6px;
}
.studio-layersdock-list { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 3px; }
.studio-lrow {
  display: flex; align-items: center; gap: 9px; padding: 5px 7px;
  border-radius: 7px; cursor: pointer; border: 1px solid transparent;
}
.studio-lrow:hover { background: var(--hover); }
.studio-lrow.is-sel { background: color-mix(in oklch, var(--accent), transparent 88%); border-color: color-mix(in oklch, var(--accent), transparent 55%); }
.studio-lrow.is-hidden .studio-lmeta { opacity: .45; }
.studio-lthumb {
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: 5px; overflow: hidden;
  background: repeating-conic-gradient(#EFEDE5 0% 25%, #fff 0% 50%) 0 0 / 10px 10px;
  display: grid; place-items: center; border: 1px solid var(--rule);
}
.studio-lthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.studio-lthumb-fill { display: block; width: 22px; height: 22px; }
.studio-lthumb-t { font-size: 17px; font-weight: 600; color: var(--ink); }
.studio-lmeta { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.studio-lname { font-family: var(--f-sans); font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio-lpos { font-family: var(--f-mono); font-size: 9.5px; color: var(--mute); }
.studio-lops { display: none; align-items: center; gap: 1px; }
.studio-lrow:hover .studio-lops, .studio-lrow.is-sel .studio-lops { display: inline-flex; }
.studio-lops button {
  border: 0; background: transparent; cursor: pointer; color: var(--mute);
  font-size: 11px; padding: 3px 4px; border-radius: 4px; line-height: 1;
}
.studio-lops button:hover:not(:disabled) { background: var(--rule); color: var(--ink); }
.studio-lops button:disabled { opacity: .3; cursor: default; }
.studio-ldel:hover { color: #B23B3B !important; }

/* ── Studio v3.1: layers palette docked bottom-right under Egenskaper ───── */
.studio-shell { grid-template-columns: 48px minmax(420px, 1fr) 260px; }
.studio-inspector { display: flex; flex-direction: column; max-height: 700px; }
.studio-layersdock {
  border-radius: 0; background: var(--bg); align-self: stretch;
  border-top: 1px solid var(--rule); flex: 0 0 auto; max-height: 320px;
}
.studio-layersdock-h { border-bottom: none; padding-bottom: 4px; }
.studio-lrename {
  font-family: var(--f-sans); font-size: 12px; color: var(--ink);
  border: 1px solid var(--accent); border-radius: 4px; padding: 1px 5px;
  background: var(--paper); width: 100%; outline: none;
}

/* ══ Nest Marketing desktop — the platform as an operating system ══════════════ */
.os { position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  background:
    radial-gradient(1100px 700px at 78% 110%, rgba(107,79,160,.14), transparent 60%),
    radial-gradient(900px 600px at 12% -10%, rgba(194,114,44,.10), transparent 55%),
    linear-gradient(160deg, #2E2C29, #3B3936 55%, #34322E);
}

/* Menubar */
.os-menubar {
  display: flex; align-items: center; gap: 14px; flex: 0 0 40px;
  padding: 0 16px; background: rgba(20,19,17,.55); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.07);
  font-family: var(--f-sans); color: #D9D5CC; z-index: 500;
}
.os-brand { font-weight: 700; letter-spacing: .02em; font-size: 13px; color: #fff; }
.os-brand em { font-style: normal; font-weight: 400; color: #A5A19A; }
.os-appname { font-size: 12.5px; font-weight: 600; }
.os-menubar-spacer { flex: 1; }
.os-clock { font-size: 12px; color: #A5A19A; font-variant-numeric: tabular-nums; }
.os-user {
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
}
.os-logout { border: 0; background: transparent; color: #A5A19A; cursor: pointer; font-size: 14px; padding: 4px; }
.os-logout:hover { color: #fff; }

/* Language switcher (SV/EN) in the menubar */
.os-lang { display: inline-flex; border: 1px solid color-mix(in srgb, #fff, transparent 82%); border-radius: 999px; overflow: hidden; }
.os-lang-b { border: 0; background: transparent; color: #A5A19A; cursor: pointer; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; padding: 3px 8px; font-family: var(--f-sans); }
.os-lang-b.is-on { background: color-mix(in srgb, #fff, transparent 86%); color: #fff; }
.os-lang-b:hover:not(.is-on) { color: #D9D5CC; }

/* Workspace chip — which org this session acts in (menubar, always visible) */
.os-wschip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid color-mix(in srgb, #fff, transparent 78%); border-radius: 999px; padding: 3px 11px; font-size: 11.5px; color: #D9D5CC; white-space: nowrap; }
.os-wschip b { font-weight: 600; color: #fff; }
.os-wschip-dot { width: 6px; height: 6px; border-radius: 50%; background: #30D158; flex: 0 0 auto; }
.os-wschip.is-guest { border-color: color-mix(in srgb, #FF9F0A, transparent 30%); background: color-mix(in srgb, #FF9F0A, transparent 84%); color: #FFD9A0; }
.os-wschip.is-guest b { color: #FFE3B8; }
.os-wschip.is-guest .os-wschip-dot { background: #FF9F0A; animation: ws-pulse 1.6s ease-in-out infinite; }
@keyframes ws-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.os-wschip-pre { opacity: .85; }
.os-wschip-leave { border: 1px solid color-mix(in srgb, #FF9F0A, transparent 40%); background: transparent; color: #FFD9A0; border-radius: 999px; padding: 1px 9px; font-size: 11px; cursor: pointer; font-family: var(--f-sans); }
.os-wschip-leave:hover { background: color-mix(in srgb, #FF9F0A, transparent 70%); }

/* Workspace-växlaren: samma chip, men klickbar och med en meny för alla som
   tillhör fler än en workspace. Menyn ärver menybarens mörka idiom. */
.os-wsswitch { position: relative; display: inline-flex; }
.os-wschip.is-btn {
  cursor: pointer; font-family: var(--f-sans); background: transparent;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.os-wschip.is-btn:hover { background: rgba(255,255,255,.10); border-color: color-mix(in srgb, #fff, transparent 62%); }
.os-wschip.is-btn.is-open { background: rgba(255,255,255,.14); }
.os-wschip.is-guest.is-btn:hover,
.os-wschip.is-guest.is-btn.is-open { background: color-mix(in srgb, #FF9F0A, transparent 72%); }
.os-wschip-caret { font-size: 9px; opacity: .7; margin-left: 1px; }

.os-wsmenu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  min-width: 250px; max-height: 62vh; overflow-y: auto;
  background: #34322E; border: 1px solid #47443F; border-radius: 10px;
  box-shadow: 0 16px 38px rgba(0,0,0,.42);
  padding: 5px; display: flex; flex-direction: column;
}
.os-wsmenu-head {
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .1em;
  text-transform: uppercase; color: #8F8B83; padding: 6px 10px 5px;
}
.os-wsmenu-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  border: 0; background: transparent; cursor: pointer; text-align: left;
  font-family: var(--f-sans); padding: 7px 10px; border-radius: 6px; color: #E7E3DA;
  transition: background-color 100ms ease;
}
.os-wsmenu-item:hover:not(:disabled) { background: rgba(255,255,255,.10); }
.os-wsmenu-item:disabled { opacity: .5; cursor: default; }
.os-wsmenu-item.is-active { background: rgba(255,255,255,.06); }
.os-wsmenu-mark { flex: 0 0 12px; font-size: 11px; color: #30D158; text-align: center; }
.os-wsmenu-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.os-wsmenu-name { font-size: 12.5px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-wsmenu-role { font-size: 10.5px; color: #9A958C; }
.os-wsmenu-sep { height: 1px; background: #47443F; margin: 4px 8px; }
.os-wsmenu-item.is-leave .os-wsmenu-mark { color: #FFD9A0; }
.os-wsmenu-item.is-leave .os-wsmenu-name { color: #FFD9A0; font-weight: 500; }

/* Desktop */
.os-desktop { position: relative; flex: 1; overflow: hidden; }
.os-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px;
  font-family: var(--f-sans); font-size: 14px; color: rgba(255,255,255,.55); }
.os-empty-mark { font-size: 40px; color: rgba(255,255,255,.25); }

/* App window */
.oswin {
  position: absolute; display: flex; flex-direction: column;
  background: var(--bg); border-radius: 12px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,.5), 0 0 0 1px rgba(0,0,0,.28);
  animation: oswinIn .18s ease-out both;
}
@keyframes oswinIn { from { opacity: 0; transform: scale(.97) translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .oswin { animation: none; } }
.oswin.is-min { display: none; }
.oswin.is-max { inset: 0 !important; width: auto !important; height: auto !important; border-radius: 0; }
.oswin:not(.is-focused) { box-shadow: 0 12px 34px rgba(0,0,0,.35), 0 0 0 1px rgba(0,0,0,.22); }
.oswin:not(.is-focused) .oswin-title { color: var(--mute); }

.oswin-title {
  display: flex; align-items: center; gap: 10px; flex: 0 0 38px;
  padding: 0 12px; background: var(--paper); border-bottom: 1px solid var(--rule);
  font-family: var(--f-sans); font-size: 12px; font-weight: 600; color: var(--ink);
  cursor: grab; user-select: none; touch-action: none;
}
.oswin-title:active { cursor: grabbing; }
.oswin-name { flex: 1; text-align: center; padding-right: 54px; /* optically centre vs lights */ }
.oswin-lights { display: inline-flex; gap: 7px; }
.oswin-light { width: 12px; height: 12px; border-radius: 50%; border: 0; cursor: pointer; padding: 0; }
.oswin-close { background: #E0574F; }
.oswin-minb  { background: #E0A03A; }
.oswin-maxb  { background: #55B458; }
.oswin-light:hover { filter: brightness(1.15); }

.oswin-body { flex: 1; min-height: 0; overflow: auto; background: var(--bg); }
.oswin-body .page { padding: 26px 30px 44px; }
.oswin-resize {
  position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, var(--rule) 50%);
  border-bottom-right-radius: 12px; touch-action: none;
}

/* Team chat inside a window: fill it, drop the docked-sidebar chrome */
.oswin .mkt-dock--win {
  position: static; width: 100%; height: 100%; border-left: none;
  transition: none; visibility: visible;
}
.oswin .mkt-dock--win > * { min-width: 0; }
.oswin .mkt-dock--win .mkt-dock-head { display: none; }  /* window title bar does this job */

/* Dock */
.os-dock {
  position: relative; flex: 0 0 auto; align-self: center; margin: 0 0 10px;
  display: flex; gap: 4px; padding: 7px 10px; z-index: 500; max-width: 96vw; overflow-x: auto;
  background: rgba(20,19,17,.55); backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.09); border-radius: 16px;
}
.os-dockbtn {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 0; background: transparent; cursor: pointer; padding: 6px 9px 8px; border-radius: 11px;
  color: #D9D5CC;
}
.os-dockbtn:hover { background: rgba(255,255,255,.10); color: #fff; transform: translateY(-2px); transition: transform .12s; }
.os-dockbtn.is-active { background: rgba(255,255,255,.08); }
.os-dockicon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(150deg, #514E49, #3B3936); border: 1px solid rgba(255,255,255,.10); }
.os-dockicon .ico { width: 15px; height: 15px; }
.os-docklabel { font-family: var(--f-sans); font-size: 9px; letter-spacing: .02em; max-width: 74px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-dockdot { width: 4px; height: 4px; border-radius: 50%; background: transparent; }
.os-dockdot.is-on { background: #E7E3DA; }

@media (max-width: 900px) {
  .os-docklabel { display: none; }
  .oswin { inset: 0 !important; width: auto !important; height: auto !important; border-radius: 0; }
  .oswin-resize { display: none; }
}

/* ── OS v2: edge snap, Mission Control, dock badges ─────────────────────── */
.os-snaphint {
  position: absolute; z-index: 900; pointer-events: none;
  background: color-mix(in oklch, var(--accent), transparent 78%);
  border: 2px dashed color-mix(in oklch, var(--accent), transparent 30%);
  border-radius: 12px;
  animation: snapIn .12s ease-out both;
}
@keyframes snapIn { from { opacity: 0; } to { opacity: 1; } }
.os-snap-left  { left: 8px; top: 8px; bottom: 8px; width: calc(50% - 12px); }
.os-snap-right { right: 8px; top: 8px; bottom: 8px; width: calc(50% - 12px); }
.os-snap-max   { inset: 8px; }

.os-missionbtn {
  border: 0; background: transparent; color: #A5A19A; cursor: pointer;
  font-size: 13px; padding: 4px 6px; border-radius: 5px; line-height: 1;
}
.os-missionbtn:hover, .os-missionbtn.is-on { background: rgba(255,255,255,.12); color: #fff; }

.os-mission {
  position: absolute; inset: 0; z-index: 950;
  background: rgba(20,19,17,.62); backdrop-filter: blur(10px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  animation: snapIn .14s ease-out both;
}
.os-mission-h { font-family: var(--f-sans); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.os-mission-grid { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; max-width: 760px; }
.os-mission-empty { font-family: var(--f-sans); font-size: 13px; color: rgba(255,255,255,.55); }
.os-mission-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px;
  width: 150px; padding: 20px 12px 14px; cursor: pointer;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 14px;
  color: #E7E3DA;
}
.os-mission-card:hover { background: rgba(255,255,255,.14); transform: translateY(-2px); transition: transform .12s; }
.os-mission-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(150deg, #514E49, #3B3936); border: 1px solid rgba(255,255,255,.12); }
.os-mission-icon .ico { width: 20px; height: 20px; }
.os-mission-name { font-family: var(--f-sans); font-size: 12.5px; font-weight: 600; }
.os-mission-state { font-family: var(--f-mono); font-size: 9.5px; color: rgba(255,255,255,.45); }
.os-mission-x {
  position: absolute; top: 6px; right: 9px; font-size: 14px; line-height: 1;
  color: rgba(255,255,255,.4); cursor: pointer; padding: 2px 4px;
}
.os-mission-x:hover { color: #E0574F; }

.os-dockicon { position: relative; }
.os-dockbadge {
  position: absolute; top: -5px; right: -7px; min-width: 15px; height: 15px;
  padding: 0 4px; border-radius: 8px; background: #E0574F; color: #fff;
  font-family: var(--f-sans); font-size: 9px; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
  box-shadow: 0 0 0 2px rgba(20,19,17,.7);
}

/* ── OS v2.1: floating auto-hide dock ───────────────────────────────────── */
.os-dock {
  position: absolute; left: 50%; bottom: 10px; align-self: unset; margin: 0;
  transform: translateX(-50%);
  transition: transform .28s ease, opacity .22s ease;
  z-index: 800;
}
.os-dock.is-hidden { transform: translateX(-50%) translateY(calc(100% + 16px)); opacity: 0; pointer-events: none; }
@media (max-width: 900px) {
  .os-dock, .os-dock.is-hidden { transform: translateX(-50%); opacity: 1; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) { .os-dock { transition: none; } }

/* ── Inställningar, macOS System Settings-style ─────────────────────────── */
.set-shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100%; height: 100%; }
.set-side {
  background: var(--paper); border-right: 1px solid var(--rule);
  padding: 12px 10px 18px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.set-user { display: flex; align-items: center; gap: 10px; padding: 8px 8px 12px; }
.set-user-ava {
  width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-family: var(--f-sans); font-size: 13px; font-weight: 700; flex: 0 0 auto;
}
.set-user-meta { display: flex; flex-direction: column; min-width: 0; }
.set-user-meta b { font-family: var(--f-sans); font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-user-meta span { font-family: var(--f-sans); font-size: 11px; color: var(--mute); }
.set-search {
  margin: 0 6px 10px; padding: 6px 10px; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--bg); font-family: var(--f-sans); font-size: 12px; color: var(--ink); outline: none;
}
.set-search:focus { border-color: var(--accent); }
.set-group { display: flex; flex-direction: column; gap: 1px; margin-bottom: 10px; }
.set-group-l { font-family: var(--f-sans); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); padding: 6px 10px 4px; }
.set-item {
  display: flex; align-items: center; gap: 9px; padding: 5px 8px;
  border: 0; background: transparent; border-radius: 8px; cursor: pointer; text-align: left;
  font-family: var(--f-sans); font-size: 12.5px; color: var(--ink);
}
.set-item:hover { background: var(--hover); }
.set-item.is-on { background: var(--accent); color: #fff; }
.set-item.is-on .set-icon { filter: brightness(1.06); }
.set-icon {
  width: 22px; height: 22px; border-radius: 6px; flex: 0 0 auto;
  display: grid; place-items: center; color: #fff; font-size: 12px; line-height: 1;
  box-shadow: inset 0 -4px 8px rgba(0,0,0,.14);
}
.set-item-l { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-pane { display: flex; flex-direction: column; min-width: 0; overflow-y: auto; }
.set-pane-h {
  position: sticky; top: 0; z-index: 5;
  font-family: var(--f-sans); font-size: 14px; font-weight: 700; color: var(--ink);
  padding: 14px 26px 12px; background: color-mix(in srgb, var(--bg), transparent 8%);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule);
}
.oswin-body .set-pane-body.page { padding: 20px 26px 44px; }
.set-embed .people-section, .set-embed .admin-create { margin-top: 0; }

/* ── Desktop widgets — glass cards on the desktop ───────────────────────── */
.os-widgets { position: absolute; top: 22px; display: flex; flex-direction: column; gap: 14px; width: 300px; z-index: 0; }
.os-widgets-l { left: 22px; }
.os-widgets-r { right: 22px; width: 320px; }

.os-widget {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  backdrop-filter: blur(18px) saturate(1.15);
  box-shadow: 0 10px 34px rgba(0,0,0,.28);
  padding: 6px;
  color: #E7E3DA;
  font-family: var(--f-sans);
}
.os-widget-h {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.55);
}
.os-widget-n { font-family: var(--f-mono); font-size: 10px; color: rgba(255,255,255,.5); }
.os-widget-act { border: 0; background: transparent; color: rgba(255,255,255,.55); cursor: pointer; padding: 2px 4px; border-radius: 5px; font-size: 13px; line-height: 1; }
.os-widget-act:hover { color: #fff; background: rgba(255,255,255,.12); }
.os-widget-act .ico { width: 13px; height: 13px; }
.os-widget-link { border: 0; background: transparent; color: rgba(255,255,255,.6); cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; font-family: var(--f-sans); font-size: 10px;
  letter-spacing: .06em; text-transform: uppercase; }
.os-widget-link:hover { color: #fff; }
.os-widget-link .ico { width: 11px; height: 11px; }
.os-widget-empty { padding: 10px 12px 12px; font-size: 12px; color: rgba(255,255,255,.5); }

.os-kpirow, .os-insrow, .os-todorow {
  display: flex; align-items: center; gap: 9px; width: 100%;
  border: 0; background: transparent; cursor: pointer; text-align: left;
  padding: 8px 10px; border-radius: 10px; color: #E7E3DA;
}
.os-kpirow:hover, .os-insrow:hover, .os-todorow:hover { background: rgba(255,255,255,.09); }
.os-kpirow .ico { width: 15px; height: 15px; color: rgba(255,255,255,.6); flex: 0 0 auto; }
.os-kpirow b { font-size: 16px; font-weight: 700; min-width: 26px; font-variant-numeric: tabular-nums; }
.os-kpirow span { font-size: 12px; color: rgba(255,255,255,.72); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-kpirow .os-kpinets { flex: 0 1 auto; max-width: 52%; font-size: 10px; color: rgba(255,255,255,.5);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.os-kpirow.is-hot b { color: #FFB05C; }
.os-rowgo { opacity: 0; width: 12px !important; height: 12px !important; transition: opacity .12s; }
.os-kpirow:hover .os-rowgo { opacity: .7; }

.os-insdot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 2px rgba(0,0,0,.25); }
.os-institle { flex: 1; font-size: 12px; line-height: 1.35; color: #E7E3DA;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.os-insconf { font-family: var(--f-mono); font-size: 10px; color: rgba(255,255,255,.5); }
.os-widget-cta {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: calc(100% - 12px);
  margin: 4px 6px 6px; padding: 8px; border: 0; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.12); color: #fff; font-family: var(--f-sans); font-size: 12px; font-weight: 600;
}
.os-widget-cta:hover { background: var(--accent); }
.os-widget-cta .ico { width: 12px; height: 12px; }

.os-todorow .ico { width: 13px; height: 13px; color: rgba(255,255,255,.45); flex: 0 0 auto; }
.os-todolabel { flex: 1; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-todometa { font-family: var(--f-mono); font-size: 9.5px; color: rgba(255,255,255,.5); white-space: nowrap; }

.os-logpanel {
  position: absolute; left: 336px; top: 22px; width: 380px; z-index: 1;
  max-height: 70vh; display: flex; flex-direction: column;
}
.os-logrows { overflow-y: auto; display: flex; flex-direction: column; }
.os-logrow { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; border-radius: 8px; }
.os-logrow:hover { background: rgba(255,255,255,.07); }
.os-logwho { font-size: 11px; font-weight: 700; color: rgba(255,255,255,.8); white-space: nowrap; }
.os-lognote { flex: 1; font-size: 11.5px; color: rgba(255,255,255,.65); line-height: 1.4; }
.os-logtime { font-family: var(--f-mono); font-size: 9px; color: rgba(255,255,255,.4); white-space: nowrap; }

@media (max-width: 1100px) { .os-widgets { display: none; } .os-logpanel { display: none; } }

/* ── Studio as a real app: menubar on top, start dialog à la Adobe ──────── */
.studio-app { display: flex; flex-direction: column; min-height: 100%; height: 100%; }
.studio-app .studio-menubar { border-radius: 0; flex: 0 0 auto; }
.studio-app .studio-bar { flex: 0 0 auto; }
.studio-app .studio-shell { flex: 1; min-height: 0; overflow: auto; border-radius: 0; }
.studio-menubar-docname {
  margin-left: auto; border: 0; background: transparent; text-align: right;
  font-family: var(--f-sans); font-size: 11.5px; color: #A5A19A; outline: none;
  padding: 4px 6px; border-radius: 5px; min-width: 180px;
}
.studio-menubar-docname:hover, .studio-menubar-docname:focus { background: rgba(255,255,255,.10); color: #fff; }
.studio-savenote { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 70;
  background: #34322E; color: #E7E3DA; border-radius: 10px; padding: 8px 16px; font-size: 12px; }

/* Start dialog — dark side rail + light content, like the Adobe start screen */
.studio-dlg-backdrop {
  position: absolute; inset: 0; z-index: 120;
  background: rgba(20,19,17,.55); backdrop-filter: blur(6px);
  display: grid; place-items: center;
  animation: snapIn .14s ease-out both;
}
.studio-dlg {
  display: grid; grid-template-columns: 210px 1fr; width: min(880px, 92%);
  max-height: min(640px, 88%); border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.studio-dlg-pub { grid-template-columns: 1fr; width: min(560px, 92%); }
.studio-dlg-side { background: #2E2C29; padding: 18px 10px; display: flex; flex-direction: column; gap: 3px; }
.studio-dlg-brand { font-family: var(--f-display); font-style: italic; font-size: 19px; color: #E7E3DA; padding: 0 10px 14px; }
.studio-dlg-tab {
  text-align: left; border: 0; background: transparent; cursor: pointer;
  font-family: var(--f-sans); font-size: 12.5px; color: #A5A19A;
  padding: 8px 12px; border-radius: 8px;
}
.studio-dlg-tab:hover { color: #fff; background: rgba(255,255,255,.08); }
.studio-dlg-tab.is-on { color: #fff; background: var(--accent); }
.studio-dlg-main {
  position: relative; background: var(--bg); padding: 20px 24px 18px;
  overflow-y: auto; display: flex; flex-direction: column; gap: 12px;
}
.studio-dlg-h { font-family: var(--f-display); font-size: 21px; color: var(--ink); }
.studio-dlg-x { position: absolute; top: 10px; right: 14px; border: 0; background: transparent; cursor: pointer; font-size: 20px; color: var(--mute); }
.studio-dlg-x:hover { color: var(--ink); }
.studio-dlg-name { max-width: 340px; }
.studio-dlg-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--rule); }

/* ══ macOS app chrome inside every window ═══════════════════════════════ */
/* The window's title bar already names the app — inside, headers become a
   slim toolbar row instead of a website hero. */
.oswin-body .page { padding-top: 16px; }
.oswin-body .page-head {
  align-items: center;
  padding-bottom: 12px; margin-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}
.oswin-body .page-head .eyebrow,
.oswin-body .page-head .sub { display: none; }
.oswin-body .page-head h1 {
  font-family: var(--f-sans); font-size: 14px; font-weight: 700;
  letter-spacing: .01em; margin: 0; line-height: 1.2;
}
.oswin-body .page-head h1 em { font-style: normal; }
.oswin-body .page-head h1 br { display: none; }

/* Unified toolbar (Content Plan, Marketing team): sticky, blurred, bordered */
.oswin-body .plan-toolbar {
  position: sticky; top: 0; z-index: 6;
  background: color-mix(in srgb, var(--bg), transparent 6%);
  backdrop-filter: blur(8px);
  padding: 8px 0; margin-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}
/* The source sidebar (Konton) is sticky too — it must pin BELOW the sticky
   toolbar, not at the same top, or the account list slides in under the
   filter row when the window scrolls. 56px ≈ toolbar height (8+8 padding +
   ~30px controls + border + margin). */
.oswin-body .src-side { top: 56px; max-height: calc(100vh - 180px); }
/* Button groups in the toolbar become a segmented control */
.oswin-body .plan-toolbar .left {
  display: inline-flex; align-items: stretch; gap: 0;
  border: 1px solid var(--rule); border-radius: 8px; overflow: hidden;
  background: var(--paper);
}
.oswin-body .plan-toolbar .left > * {
  border: 0 !important; border-right: 1px solid var(--rule) !important;
  border-radius: 0 !important; margin: 0 !important;
  background: transparent;
}
.oswin-body .plan-toolbar .left > :last-child { border-right: 0 !important; }
.oswin-body .plan-toolbar .left .tb-btn.is-primary { background: var(--ink); color: #fff; }
.oswin-body .plan-toolbar .left .nav-btn { padding: 6px 10px; }
.oswin-body .plan-toolbar .left .month {
  display: flex; align-items: center; padding: 0 14px;
  font-family: var(--f-sans); font-size: 12.5px; font-weight: 600; background: var(--bg);
}

/* Library tabs → segmented control */
.oswin-body .lib-tabs {
  display: inline-flex; gap: 0; margin-bottom: 20px;
  border: 1px solid var(--rule); border-radius: 8px; overflow: hidden;
  background: var(--paper);
}
.oswin-body .lib-tabs .lib-tab {
  border: 0; border-right: 1px solid var(--rule); border-radius: 0; margin: 0;
  padding: 7px 14px; background: transparent;
}
.oswin-body .lib-tabs .lib-tab:last-child { border-right: 0; }
.oswin-body .lib-tabs .lib-tab.is-active { background: var(--ink); color: #fff; }

/* ── OS menubar app menus + compact studio chrome ───────────────────────── */
.os-appmenus { display: flex; align-items: center; gap: 1px; margin-left: 2px; }
.os-appmenus .studio-menu-btn { font-size: 12px; padding: 5px 9px; }
/* the old in-window menubar is gone — the bar row is now the top chrome */
.studio-app .studio-bar { border-radius: 0; padding: 3px 10px; align-items: center; gap: 12px;
  flex-direction: row; margin: 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.studio-docname-bar { margin: 0; text-align: left; min-width: 120px; max-width: 220px; flex: 0 1 auto; }
.studio-chtab { padding: 5px 9px; font-size: 12px; border-bottom-width: 2px; }
.studio-fchip { padding: 4px 11px; font-size: 11.5px; }
.studio-channels { gap: 2px; display: flex; align-items: center; }
.studio-formats { display: flex; align-items: center; gap: 2px; margin-left: 4px; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.12); }

/* channel picker in the Nytt inlägg dialog */
.studio-dlg-chs { display: flex; flex-wrap: wrap; gap: 8px; }
.studio-dlg-ch {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--rule); border-radius: 9px; background: var(--paper);
  padding: 7px 12px; cursor: pointer; font-family: var(--f-sans); font-size: 12.5px;
  color: var(--mute); opacity: .55;
}
.studio-dlg-ch.is-on { color: var(--ink); border-color: var(--ink); opacity: 1; }
.studio-dlg-ch:hover { opacity: 1; }

/* ── Source list (Finder-style) for Insights & Annonser ─────────────────── */
.src-shell { display: grid; grid-template-columns: 208px 1fr; gap: 0; min-height: 60vh;
  margin: 0 -30px -44px; /* bleed to the window edges */ }
.src-side {
  background: var(--paper); border-right: 1px solid var(--rule);
  padding: 12px 8px 18px; display: flex; flex-direction: column; gap: 1px;
  position: sticky; top: 0; align-self: start; max-height: calc(100vh - 120px); overflow-y: auto;
}
.src-group-l { font-family: var(--f-sans); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); padding: 8px 10px 4px; }
.src-item {
  display: flex; align-items: center; gap: 9px; padding: 6px 10px;
  border: 0; background: transparent; border-radius: 7px; cursor: pointer; text-align: left;
  font-family: var(--f-sans); font-size: 12.5px; color: var(--ink);
}
.src-item:hover { background: var(--hover); }
.src-item.is-on { background: var(--accent); color: #fff; }
.src-item.is-on .src-ico { color: #fff; }
.src-ico { display: inline-flex; color: var(--mute); }
.src-ico .ico { width: 13px; height: 13px; }
.net-badge { align-items: center; justify-content: center; min-width: 20px; height: 16px; padding: 0 4px;
  border-radius: 4px; background: var(--line, #e5e2dc); color: var(--ink, #1a1813);
  font-size: 9px; font-weight: 700; letter-spacing: .02em; }
.src-l { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-main { min-width: 0; padding: 18px 30px 44px; }
.src-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.src-toolbar .ins-sort { max-width: 170px; }
.src-search { flex: 1; max-width: 320px; border-radius: 8px; }

/* Brand Library toolbar with inline search */
.lib-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.oswin-body .lib-toolbar .lib-tabs { margin-bottom: 0; }
.lib-search { max-width: 260px; margin-left: auto; }

/* ══ Utseende: dark mode, UI scale, desktop wallpaper ═══════════════════ */
html[data-theme="dark"] {
  --bg:        #1E1D1B;
  --paper:     #262522;
  --paper-2:   #2E2C29;
  --ink:       #ECEAE4;
  --ink-2:     #D9D6CE;
  --mute:      #9B978E;
  --mute-2:    #7C7870;
  --rule:      #3A3835;
  --rule-2:    #4A4743;
  --hover:     rgba(255, 255, 255, 0.07);
}
html[data-theme="dark"] .oswin { box-shadow: 0 24px 70px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.08); }
html[data-theme="dark"] .studio-canvas { background: #2E2C29; }
html[data-theme="dark"] img.studio-elimg, html[data-theme="dark"] .lib-logo img { filter: none; }

/* UI scale (font/UI size) + wallpaper come in as CSS vars set from settings */
.os { zoom: var(--ui-zoom, 1); }
.os { background: var(--os-wallpaper,
    radial-gradient(1100px 700px at 78% 110%, rgba(107,79,160,.14), transparent 60%),
    radial-gradient(900px 600px at 12% -10%, rgba(194,114,44,.10), transparent 55%),
    linear-gradient(160deg, #2E2C29, #3B3936 55%, #34322E)); }

/* Utseende section UI */
.app-appearance { display: flex; flex-direction: column; gap: 22px; max-width: 720px; }
.app-appearance h4 { font-family: var(--f-sans); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin: 0 0 8px; }
.appear-modes { display: flex; gap: 12px; }
.appear-mode {
  border: 2px solid var(--rule); border-radius: 12px; background: var(--paper); cursor: pointer;
  padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 7px;
  font-family: var(--f-sans); font-size: 12px; color: var(--ink);
}
.appear-mode.is-on { border-color: var(--accent); }
.appear-swatch { width: 120px; height: 72px; border-radius: 8px; border: 1px solid var(--rule); overflow: hidden; position: relative; }
.appear-swatch-light { background: linear-gradient(180deg, #fff 30%, #F6F5F1); }
.appear-swatch-dark  { background: linear-gradient(180deg, #262522 30%, #1E1D1B); }
.appear-swatch::after { content: ""; position: absolute; left: 10px; top: 10px; width: 60%; height: 8px; border-radius: 4px; background: rgba(128,128,128,.4); }
.appear-scale { display: flex; gap: 8px; }
.appear-scale button {
  border: 1px solid var(--rule); border-radius: 9px; background: var(--paper); cursor: pointer;
  padding: 8px 16px; font-family: var(--f-sans); color: var(--ink);
}
.appear-scale button.is-on { border-color: var(--accent); background: var(--accent); color: #fff; }
.appear-walls { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.appear-wall {
  aspect-ratio: 16/10; border-radius: 10px; border: 2px solid var(--rule); cursor: pointer;
  background-size: cover; background-position: center; position: relative; overflow: hidden;
}
.appear-wall.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in oklch, var(--accent), transparent 55%); }
.appear-wall span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px;
  font-family: var(--f-sans); font-size: 10px; color: #fff; background: rgba(0,0,0,.42);
}
.appear-upload { display: flex; align-items: center; gap: 10px; }

/* ── Glass v2: real glassmorphism + glow on the desktop widgets ─────────── */
.os-widget {
  position: relative;
  background: linear-gradient(165deg, rgba(255,255,255,.14), rgba(255,255,255,.055) 42%, rgba(255,255,255,.025));
  border: 1px solid rgba(255,255,255,.17);
  backdrop-filter: blur(28px) saturate(1.5) brightness(1.07);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.30),           /* specular top edge */
    inset 0 -1px 0 rgba(0,0,0,.20),
    0 18px 48px rgba(0,0,0,.34),                    /* lift */
    0 0 44px rgba(160,128,235,.12);                 /* ambient glow */
  transition: box-shadow .3s ease, border-color .3s ease, transform .3s ease;
}
.os-widget::before {
  /* soft sheen sweeping in from the top-left, like light on glass */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(130% 80% at 18% -12%, rgba(255,255,255,.15), transparent 55%);
}
.os-widget:hover {
  border-color: rgba(255,255,255,.26);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.34),
    inset 0 -1px 0 rgba(0,0,0,.20),
    0 24px 60px rgba(0,0,0,.42),
    0 0 64px rgba(170,138,245,.22);                 /* glow breathes up */
  transform: translateY(-1px);
}
@media (prefers-reduced-motion: reduce) { .os-widget, .os-widget:hover { transform: none; } }

/* rows read through the glass a touch better */
.os-kpirow:hover, .os-insrow:hover, .os-todorow:hover { background: rgba(255,255,255,.12); }

/* dock + log panel share the same glass identity */
.os-dock {
  background: linear-gradient(170deg, rgba(40,38,35,.62), rgba(20,19,17,.55));
  backdrop-filter: blur(26px) saturate(1.5);
  border: 1px solid rgba(255,255,255,.15);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    0 16px 44px rgba(0,0,0,.45),
    0 0 40px rgba(160,128,235,.10);
}
.os-logpanel { z-index: 2; }

/* ── Lock screen (login) — macOS-style ──────────────────────────────────── */
.lock {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  padding: 7vh 24px 4vh; color: #fff; overflow: hidden;
  background: var(--os-wallpaper,
    radial-gradient(1100px 700px at 78% 110%, rgba(107,79,160,.14), transparent 60%),
    radial-gradient(900px 600px at 12% -10%, rgba(194,114,44,.10), transparent 55%),
    linear-gradient(160deg, #2E2C29, #3B3936 55%, #34322E));
  background-size: cover; background-position: center;
}
.lock::after {  /* gentle vignette so type reads on any wallpaper */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0,0,0,.34));
}
.lock > * { position: relative; z-index: 1; }
.lock-clock { text-align: center; text-shadow: 0 2px 24px rgba(0,0,0,.35); }
.lock-date { font-family: var(--f-sans); font-size: 17px; font-weight: 600; color: rgba(255,255,255,.85); text-transform: capitalize; }
.lock-time { font-family: var(--f-sans); font-size: 92px; font-weight: 200; line-height: 1.02; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.lock-user { display: flex; flex-direction: column; align-items: center; gap: 13px; }
.lock-avatar {
  width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--f-sans); font-size: 34px; font-weight: 600; color: #fff;
  background: linear-gradient(160deg, rgba(255,255,255,.30), rgba(255,255,255,.10));
  border: 1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 10px 34px rgba(0,0,0,.35);
}
.lock-hint { font-family: var(--f-sans); font-size: 12.5px; color: rgba(255,255,255,.72); text-shadow: 0 1px 12px rgba(0,0,0,.4); }
.lock-field {
  display: flex; align-items: center; width: 300px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px; backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 8px 26px rgba(0,0,0,.28);
  padding: 3px 3px 3px 16px; transition: border-color .2s, box-shadow .2s;
}
.lock-field:focus-within { border-color: rgba(255,255,255,.55); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 0 0 4px rgba(255,255,255,.10), 0 8px 26px rgba(0,0,0,.28); }
.lock-field input {
  flex: 1; border: 0; background: transparent; outline: none;
  font-family: var(--f-sans); font-size: 13.5px; color: #fff; min-width: 0;
}
.lock-field input::placeholder { color: rgba(255,255,255,.45); }
.lock-field button {
  width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.28); color: #fff; font-size: 15px; line-height: 1;
  display: grid; place-items: center; flex: 0 0 auto;
}
.lock-field button:hover:not(:disabled) { background: var(--accent); }
.lock-field button:disabled { opacity: .4; cursor: default; }
.lock-error { font-family: var(--f-sans); font-size: 12px; color: #FFB4AC; text-shadow: 0 1px 10px rgba(0,0,0,.5); }

.lock-sent { text-align: center; font-family: var(--f-sans); }
.lock-sent-h { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.lock-sent p { font-size: 12.5px; color: rgba(255,255,255,.75); line-height: 1.5; margin: 0 0 12px; }
.lock-again {
  border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.12);
  color: #fff; border-radius: 999px; padding: 7px 16px; cursor: pointer;
  font-family: var(--f-sans); font-size: 12px; backdrop-filter: blur(12px);
}
.lock-again:hover { background: rgba(255,255,255,.22); }

.lock-foot { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lock-logo { height: 16px; filter: brightness(0) invert(1); opacity: .75; }
.lock-legal { font-family: var(--f-sans); font-size: 10.5px; color: rgba(255,255,255,.45); }
.lock-legal a { color: rgba(255,255,255,.6); text-decoration: none; }
.lock-legal a:hover { color: #fff; }

/* ══ iOS mobile shell ═══════════════════════════════════════════════════ */
.ios {
  position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  background: var(--os-wallpaper,
    radial-gradient(1100px 700px at 78% 110%, rgba(107,79,160,.14), transparent 60%),
    radial-gradient(900px 600px at 12% -10%, rgba(194,114,44,.10), transparent 55%),
    linear-gradient(160deg, #2E2C29, #3B3936 55%, #34322E));
  background-size: cover; background-position: center;
}
.ios-status {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px 4px; color: #fff; font-family: var(--f-sans);
}
.ios-status-time { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ios-status-user {
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
}

/* Springboard */
.ios-home { flex: 1; overflow-y: auto; padding: 12px 18px 32px; display: flex; flex-direction: column; gap: 20px; }
.ios-widget { padding: 12px 16px; border-radius: 18px; }
.ios-widget-row { display: flex; gap: 18px; font-family: var(--f-sans); font-size: 13px; color: rgba(255,255,255,.8); }
.ios-widget-row b { font-size: 17px; color: #fff; margin-right: 4px; }
.ios-widget-row .is-hot b { color: #FFB05C; }
.ios-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px 8px; }
.ios-appbtn { border: 0; background: transparent; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; }
.ios-appbtn:active .ios-appicon { transform: scale(.92); }
.ios-appicon {
  position: relative; width: 58px; height: 58px; border-radius: 14px;
  display: grid; place-items: center; color: #ECEAE4;
  background: linear-gradient(160deg, rgba(255,255,255,.20), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.30), 0 8px 22px rgba(0,0,0,.30);
  transition: transform .12s;
}
.ios-appicon .ico { width: 24px; height: 24px; }
.ios-appicon-out { font-size: 20px; color: rgba(255,255,255,.75); }
.ios-applabel {
  font-family: var(--f-sans); font-size: 11px; color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,.5); max-width: 76px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Fullscreen app */
.ios-app {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  background: var(--bg); z-index: 5;
  animation: iosAppIn .26s ease-out both;
}
@keyframes iosAppIn { from { opacity: 0; transform: translateY(26px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ios-app { animation: none; } }
.ios-appbar {
  flex: 0 0 46px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 8px; background: var(--paper); border-bottom: 1px solid var(--rule);
}
.ios-back {
  justify-self: start; border: 0; background: transparent; cursor: pointer;
  font-family: var(--f-sans); font-size: 14px; color: var(--accent); padding: 8px 10px;
}
.ios-apptitle { font-family: var(--f-sans); font-size: 13.5px; font-weight: 700; color: var(--ink); }
.ios-appbody { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; }
.ios-appbody .page { padding: 16px 16px 60px; }
.ios-appbody .page-head { align-items: center; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--rule); }
.ios-appbody .page-head .eyebrow, .ios-appbody .page-head .sub { display: none; }
.ios-appbody .page-head h1 { font-family: var(--f-sans); font-size: 14px; font-weight: 700; margin: 0; }
.ios-appbody .page-head h1 em { font-style: normal; }
.ios-appbody .mkt-dock--win { position: static; width: 100%; height: 100%; border: 0; visibility: visible; transition: none; }
.ios-appbody .mkt-dock--win > * { min-width: 0; }
.ios-appbody .mkt-dock--win .mkt-dock-head { display: none; }
.ios-homebar {
  position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%);
  width: 120px; height: 5px; border-radius: 3px; border: 0; cursor: pointer;
  background: color-mix(in srgb, var(--ink), transparent 55%); z-index: 10;
}

/* Mobile responsiveness for reused views */
@media (max-width: 740px) {
  .set-shell { grid-template-columns: 1fr; height: auto; }
  .set-side { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--rule); padding: 8px; gap: 6px; align-items: center; }
  .set-user, .set-search, .set-group-l { display: none; }
  .set-group { flex-direction: row; margin: 0; gap: 4px; }
  .set-item { white-space: nowrap; }
  .src-shell { grid-template-columns: 1fr; margin: 0 -16px -60px; }
  .src-side { flex-direction: row; overflow-x: auto; max-height: none; position: static; border-right: 0; border-bottom: 1px solid var(--rule); padding: 8px; gap: 4px; align-items: center; }
  .src-group-l { display: none; }
  .src-item { white-space: nowrap; }
  .src-main { padding: 14px 16px 60px; }
  .studio-shell { grid-template-columns: 48px minmax(420px, 1fr); }
  .studio-inspector, .studio-layersdock { display: none; }  /* editing panels need desktop */
  .plan-toolbar { flex-wrap: wrap; gap: 8px; }
  .mkt-pulse-grid, .trend-row { grid-template-columns: 1fr; }
}

/* ══ macOS buttons — bezels, depth, press states ═══════════════════════── */
.tb-btn, .nav-btn {
  border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--ink), transparent 84%);
  background: linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--bg), var(--rule) 55%));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 1px 2px rgba(0,0,0,.08);
  color: var(--ink);
  transition: filter .1s ease, box-shadow .1s ease;
}
.tb-btn:hover:not(:disabled), .nav-btn:hover:not(:disabled) { filter: brightness(1.03); }
.tb-btn:active:not(:disabled), .nav-btn:active:not(:disabled) {
  filter: brightness(.96);
  box-shadow: inset 0 1.5px 3px rgba(0,0,0,.14);
}
.tb-btn:disabled { opacity: .45; }
.tb-btn:focus-visible, .nav-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 60%),
              inset 0 1px 0 rgba(255,255,255,.55);
}
.tb-btn.is-primary {
  border-color: color-mix(in srgb, var(--ink), transparent 15%);
  background: linear-gradient(180deg, #4A4742, #23211E);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 1px 3px rgba(0,0,0,.22);
}
.tb-btn.is-primary:hover:not(:disabled) { filter: brightness(1.14); }
.tb-btn.is-primary:active:not(:disabled) { box-shadow: inset 0 2px 4px rgba(0,0,0,.38); }
html[data-theme="dark"] .tb-btn, html[data-theme="dark"] .nav-btn {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 1px 2px rgba(0,0,0,.35);
  border-color: color-mix(in srgb, #fff, transparent 84%);
}
html[data-theme="dark"] .tb-btn.is-primary {
  background: linear-gradient(180deg, #57534C, #2E2C29);
}

/* Segmented controls: recessed track, the active segment floats as a card */
.oswin-body .plan-toolbar .left, .oswin-body .lib-tabs, .studio-seg {
  background: color-mix(in srgb, var(--paper-2), transparent 15%);
  border: 1px solid var(--rule);
  border-radius: 8px; padding: 2px; gap: 2px; overflow: visible;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.06);
}
.oswin-body .plan-toolbar .left > *,
.oswin-body .lib-tabs .lib-tab,
.studio-seg .studio-segbtn {
  border: 0 !important; border-radius: 6px !important; margin: 0 !important;
  background: transparent; box-shadow: none; color: var(--mute);
}
.oswin-body .plan-toolbar .left > *:hover,
.oswin-body .lib-tabs .lib-tab:hover,
.studio-seg .studio-segbtn:hover:not(:disabled) { color: var(--ink); filter: none; }
.oswin-body .plan-toolbar .left .tb-btn.is-primary,
.oswin-body .lib-tabs .lib-tab.is-active,
.studio-seg .studio-segbtn.is-on {
  background: var(--bg); color: var(--ink); font-weight: 600;
  box-shadow: 0 1px 2.5px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.6);
}
html[data-theme="dark"] .oswin-body .plan-toolbar .left .tb-btn.is-primary,
html[data-theme="dark"] .oswin-body .lib-tabs .lib-tab.is-active,
html[data-theme="dark"] .studio-seg .studio-segbtn.is-on {
  background: var(--paper-2);
  box-shadow: 0 1px 2.5px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.08);
}
.oswin-body .plan-toolbar .left .month { background: transparent; }

/* small round/utility buttons pick up the bezel too */
.studio-lops button, .os-widget-act { border-radius: 6px; }
.mkt-chat-opt {
  background: linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--bg), var(--rule) 45%));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 1px 2px rgba(0,0,0,.07);
}
.mkt-chat-opt:hover { filter: none; }

/* ══ macOS form controls — switches, checkboxes, popup buttons ═══════════── */

/* Checkboxes: bezelled square, accent fill + white check when on. */
input[type="checkbox"] {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; margin: 0; flex: 0 0 auto;
  border-radius: 4.5px;
  border: 1px solid color-mix(in srgb, var(--ink), transparent 72%);
  background: linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--bg), var(--rule) 45%));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 1px 1.5px rgba(0,0,0,.08);
  display: inline-grid; place-content: center;
  cursor: pointer;
  transition: background-color .12s ease, border-color .12s ease;
}
input[type="checkbox"]::after {
  content: "";
  width: 9px; height: 9px;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  background: #fff;
  transform: scale(0);
  transition: transform .12s ease;
}
input[type="checkbox"]:checked {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent), white 14%), var(--accent));
  border-color: color-mix(in srgb, var(--accent), black 18%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 1px 1.5px rgba(0,0,0,.1);
}
input[type="checkbox"]:checked::after { transform: scale(1); }
input[type="checkbox"]:disabled { opacity: .45; cursor: default; }
input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 60%);
}

/* Toggle-semantic checkboxes become macOS switches: recessed track, knob
   slides right and the track fills with accent. */
.tb-toggle input[type="checkbox"],
.toggle-row input[type="checkbox"],
.flow-master-toggle input[type="checkbox"],
.perm-row > input[type="checkbox"] {
  width: 26px; height: 15px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--ink), transparent 80%);
  background: color-mix(in srgb, var(--ink), transparent 84%);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
  position: relative; place-content: unset;
  transition: background-color .18s ease, border-color .18s ease;
}
.tb-toggle input[type="checkbox"]::after,
.toggle-row input[type="checkbox"]::after,
.flow-master-toggle input[type="checkbox"]::after,
.perm-row > input[type="checkbox"]::after {
  position: absolute; top: 1px; left: 1px;
  width: 11px; height: 11px; border-radius: 50%;
  clip-path: none;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 0 0 .5px rgba(0,0,0,.06);
  transform: none;
  transition: transform .18s ease;
}
.tb-toggle input[type="checkbox"]:checked,
.toggle-row input[type="checkbox"]:checked,
.flow-master-toggle input[type="checkbox"]:checked,
.perm-row > input[type="checkbox"]:checked {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent), white 10%), var(--accent));
  border-color: color-mix(in srgb, var(--accent), black 15%);
}
.tb-toggle input[type="checkbox"]:checked::after,
.toggle-row input[type="checkbox"]:checked::after,
.flow-master-toggle input[type="checkbox"]:checked::after,
.perm-row > input[type="checkbox"]:checked::after { transform: translateX(11px); }
.perm-row > input[type="checkbox"] { margin-top: 2px; }

/* Selects as macOS popup buttons: button bezel + accent chevron capsule. */
select, select.text-input, .mkt-agent-ctl select {
  -webkit-appearance: none; appearance: none;
  font-family: var(--f-sans); font-size: 12px; color: var(--ink);
  border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--ink), transparent 84%);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect width='16' height='16' rx='4.5' fill='%23DE8238'/%3E%3Cpath d='M5 6.4l3-3 3 3M5 9.6l3 3 3-3' fill='none' stroke='%23fff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      no-repeat right 4px center / 16px 16px,
    linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--bg), var(--rule) 55%));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 1px 2px rgba(0,0,0,.08);
  cursor: pointer;
  transition: filter .1s ease, box-shadow .1s ease;
}
select, .mkt-agent-ctl select { padding: 4px 26px 4px 9px; }
select.text-input, .format-dims select.text-input { padding: 6px 26px 6px 10px; }
select:hover:not(:disabled) { filter: brightness(1.02); }
select:active:not(:disabled) { filter: brightness(.97); }
select:disabled { opacity: .55; cursor: default; filter: grayscale(.4); }
select:focus-visible, select.text-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--ink), transparent 70%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 60%),
              inset 0 1px 0 rgba(255,255,255,.55);
}

/* Dark theme: softer highlights, deeper shadows, lighter off-tracks. */
html[data-theme="dark"] input[type="checkbox"] {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 1px 1.5px rgba(0,0,0,.3);
}
html[data-theme="dark"] .tb-toggle input[type="checkbox"]:not(:checked),
html[data-theme="dark"] .toggle-row input[type="checkbox"]:not(:checked),
html[data-theme="dark"] .flow-master-toggle input[type="checkbox"]:not(:checked),
html[data-theme="dark"] .perm-row > input[type="checkbox"]:not(:checked) {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.1);
}
html[data-theme="dark"] select,
html[data-theme="dark"] select.text-input,
html[data-theme="dark"] .mkt-agent-ctl select {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 1px 2px rgba(0,0,0,.35);
}

/* ══ Wallpaper tone — glass surfaces adapt to light wallpapers ═══════════── */
/* Everything that floats directly on the wallpaper (desktop widgets, log
   panel, lock screen, iOS springboard) is authored for dark wallpapers.
   html[data-wall-tone="light"] flips those surfaces to milky glass with
   dark ink so contrast holds on Sand and light custom uploads. */

html[data-wall-tone="light"] .os-widget {
  background: linear-gradient(165deg, rgba(255,255,255,.66), rgba(255,255,255,.45) 42%, rgba(255,255,255,.34));
  border-color: rgba(255,255,255,.65);
  color: #33302B;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.85),
    inset 0 -1px 0 rgba(0,0,0,.05),
    0 18px 48px rgba(70,58,40,.20),
    0 0 44px rgba(160,128,235,.10);
}
html[data-wall-tone="light"] .os-widget:hover {
  border-color: rgba(255,255,255,.8);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    inset 0 -1px 0 rgba(0,0,0,.05),
    0 24px 60px rgba(70,58,40,.26),
    0 0 64px rgba(160,128,235,.16);
}
html[data-wall-tone="light"] .os-widget-h  { color: rgba(43,38,31,.6); }
html[data-wall-tone="light"] .os-widget-n  { color: rgba(43,38,31,.5); }
html[data-wall-tone="light"] .os-widget-act { color: rgba(43,38,31,.6); }
html[data-wall-tone="light"] .os-widget-act:hover { color: #1F1D1A; background: rgba(0,0,0,.08); }
html[data-wall-tone="light"] .os-widget-link { color: rgba(43,38,31,.6); }
html[data-wall-tone="light"] .os-widget-link:hover { color: #1F1D1A; }
html[data-wall-tone="light"] .os-widget-empty { color: rgba(43,38,31,.55); }
html[data-wall-tone="light"] .os-kpirow,
html[data-wall-tone="light"] .os-insrow,
html[data-wall-tone="light"] .os-todorow { color: #33302B; }
html[data-wall-tone="light"] .os-kpirow:hover,
html[data-wall-tone="light"] .os-insrow:hover,
html[data-wall-tone="light"] .os-todorow:hover { background: rgba(0,0,0,.06); }
html[data-wall-tone="light"] .os-kpirow .ico { color: rgba(43,38,31,.55); }
html[data-wall-tone="light"] .os-kpirow span { color: rgba(43,38,31,.72); }
html[data-wall-tone="light"] .os-kpirow.is-hot b { color: #A3540E; }
html[data-wall-tone="light"] .os-institle { color: #33302B; }
html[data-wall-tone="light"] .os-insconf { color: rgba(43,38,31,.5); }
html[data-wall-tone="light"] .os-insdot { box-shadow: 0 0 0 2px rgba(255,255,255,.55); }
html[data-wall-tone="light"] .os-widget-cta { background: rgba(0,0,0,.08); color: #33302B; }
html[data-wall-tone="light"] .os-widget-cta:hover { background: var(--accent); color: #fff; }
html[data-wall-tone="light"] .os-todorow .ico { color: rgba(43,38,31,.45); }
html[data-wall-tone="light"] .os-todometa { color: rgba(43,38,31,.5); }
html[data-wall-tone="light"] .os-logrow:hover { background: rgba(0,0,0,.05); }
html[data-wall-tone="light"] .os-logwho  { color: rgba(31,29,26,.85); }
html[data-wall-tone="light"] .os-lognote { color: rgba(43,38,31,.66); }
html[data-wall-tone="light"] .os-logtime { color: rgba(43,38,31,.42); }
html[data-wall-tone="light"] .os-empty { color: rgba(43,38,31,.5); }
html[data-wall-tone="light"] .os-empty-mark { color: rgba(43,38,31,.28); }

/* Lock screen on a light wallpaper: dark ink, milky field, soft light halo
   instead of the dark vignette. */
html[data-wall-tone="light"] .lock { color: #2B2620; }
html[data-wall-tone="light"] .lock::after {
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(255,255,255,.30));
}
html[data-wall-tone="light"] .lock-clock { text-shadow: 0 2px 24px rgba(255,255,255,.5); }
html[data-wall-tone="light"] .lock-date { color: rgba(43,38,31,.8); }
html[data-wall-tone="light"] .lock-hint { color: rgba(43,38,31,.7); text-shadow: 0 1px 12px rgba(255,255,255,.55); }
html[data-wall-tone="light"] .lock-avatar {
  color: #33302B;
  background: linear-gradient(160deg, rgba(255,255,255,.65), rgba(255,255,255,.4));
  border-color: rgba(0,0,0,.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 10px 34px rgba(70,58,40,.25);
}
html[data-wall-tone="light"] .lock-field {
  background: rgba(255,255,255,.5);
  border-color: rgba(0,0,0,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 8px 26px rgba(70,58,40,.18);
}
html[data-wall-tone="light"] .lock-field:focus-within {
  border-color: rgba(0,0,0,.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 0 0 4px rgba(0,0,0,.06), 0 8px 26px rgba(70,58,40,.18);
}
html[data-wall-tone="light"] .lock-field input { color: #2B2620; }
html[data-wall-tone="light"] .lock-field input::placeholder { color: rgba(43,38,31,.42); }
html[data-wall-tone="light"] .lock-field button { background: rgba(43,38,31,.6); }
html[data-wall-tone="light"] .lock-error { color: #8C2B1F; text-shadow: 0 1px 10px rgba(255,255,255,.6); }
html[data-wall-tone="light"] .lock-sent p { color: rgba(43,38,31,.75); }
html[data-wall-tone="light"] .lock-again {
  border-color: rgba(0,0,0,.18); background: rgba(255,255,255,.45); color: #2B2620;
}
html[data-wall-tone="light"] .lock-again:hover { background: rgba(255,255,255,.7); }
html[data-wall-tone="light"] .lock-logo { filter: brightness(0); opacity: .7; }
html[data-wall-tone="light"] .lock-legal { color: rgba(43,38,31,.5); }
html[data-wall-tone="light"] .lock-legal a { color: rgba(43,38,31,.66); }
html[data-wall-tone="light"] .lock-legal a:hover { color: #1F1D1A; }

/* iOS springboard on a light wallpaper */
html[data-wall-tone="light"] .ios-status { color: #2B2620; }
html[data-wall-tone="light"] .ios-widget-row { color: rgba(43,38,31,.8); }
html[data-wall-tone="light"] .ios-widget-row b { color: #1F1D1A; }
html[data-wall-tone="light"] .ios-widget-row .is-hot b { color: #A3540E; }
html[data-wall-tone="light"] .ios-appicon {
  color: #33302B;
  background: linear-gradient(160deg, rgba(255,255,255,.6), rgba(255,255,255,.32));
  border-color: rgba(255,255,255,.7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 8px 22px rgba(70,58,40,.22);
}
html[data-wall-tone="light"] .ios-appicon-out { color: rgba(43,38,31,.6); }
html[data-wall-tone="light"] .ios-applabel { color: #2B2620; text-shadow: 0 1px 8px rgba(255,255,255,.6); }

/* ══ Photo wallpapers — stronger glass material ══════════════════════════── */
/* The authored gradient wallpapers are calm enough for near-transparent
   glass; a photo is not — busy detail and shifting brightness bleed through.
   data-wall-kind="image" swaps widgets to a smoked (or, on light photos,
   milkier) material with more opacity and blur so type reads anywhere. */

html[data-wall-kind="image"] .os-widget {
  background: linear-gradient(165deg, rgba(46,43,39,.60), rgba(34,32,29,.50) 55%, rgba(30,28,25,.46));
  border-color: rgba(255,255,255,.16);
  backdrop-filter: blur(32px) saturate(1.25);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.16),
    inset 0 -1px 0 rgba(0,0,0,.25),
    0 18px 48px rgba(0,0,0,.38),
    0 0 44px rgba(160,128,235,.10);
}
html[data-wall-kind="image"] .os-widget:hover {
  border-color: rgba(255,255,255,.22);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.2),
    inset 0 -1px 0 rgba(0,0,0,.25),
    0 24px 60px rgba(0,0,0,.44),
    0 0 64px rgba(170,138,245,.18);
}
html[data-wall-kind="image"][data-wall-tone="light"] .os-widget {
  background: linear-gradient(165deg, rgba(255,255,255,.80), rgba(255,255,255,.66) 55%, rgba(255,255,255,.58));
  border-color: rgba(255,255,255,.75);
  backdrop-filter: blur(32px) saturate(1.25);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    inset 0 -1px 0 rgba(0,0,0,.05),
    0 18px 48px rgba(70,58,40,.22),
    0 0 44px rgba(160,128,235,.10);
}
html[data-wall-kind="image"][data-wall-tone="light"] .os-widget:hover {
  border-color: rgba(255,255,255,.9);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    inset 0 -1px 0 rgba(0,0,0,.05),
    0 24px 60px rgba(70,58,40,.28),
    0 0 64px rgba(160,128,235,.16);
}
/* springboard icons get the same treatment on photos */
html[data-wall-kind="image"] .ios-appicon {
  background: linear-gradient(160deg, rgba(46,43,39,.62), rgba(30,28,25,.5));
  border-color: rgba(255,255,255,.18);
}
html[data-wall-kind="image"][data-wall-tone="light"] .ios-appicon {
  background: linear-gradient(160deg, rgba(255,255,255,.72), rgba(255,255,255,.5));
  border-color: rgba(255,255,255,.8);
}
/* lock-screen field/avatar follow suit so the login reads on any photo */
html[data-wall-kind="image"] .lock-field { background: rgba(30,28,25,.44); border-color: rgba(255,255,255,.24); }
html[data-wall-kind="image"] .lock-avatar { background: linear-gradient(160deg, rgba(46,43,39,.6), rgba(30,28,25,.45)); }
html[data-wall-kind="image"][data-wall-tone="light"] .lock-field { background: rgba(255,255,255,.62); border-color: rgba(0,0,0,.12); }
html[data-wall-kind="image"][data-wall-tone="light"] .lock-avatar { background: linear-gradient(160deg, rgba(255,255,255,.75), rgba(255,255,255,.5)); }
.plan-toolbar .plan-new-btn { margin-left: 10px; }

/* Insights drill-down: clickable rows + channel bars */
.kpimodal-rowlink { cursor: pointer; }
.kpimodal-rowlink:hover td { background: var(--hover); }
.bar-row-link { cursor: pointer; border-radius: 8px; transition: background-color 120ms ease; }
.bar-row-link:hover { background: var(--hover); }

/* Egna färger — swatch remove + editor */
.sw { position: relative; }
.sw-remove {
  position: absolute; top: 6px; right: 6px; width: 20px; height: 20px;
  border: 0; border-radius: 50%; cursor: pointer; line-height: 1;
  background: rgba(20,19,17,.55); color: #fff; font-size: 13px;
  opacity: 0; transition: opacity .12s ease;
}
.sw:hover .sw-remove { opacity: 1; }
.lib-custom-empty { font-family: var(--f-sans); font-size: 12.5px; color: var(--mute); margin: 4px 0 0; }
.sw-editor {
  margin-top: 12px; padding: 14px; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--paper); display: flex; flex-direction: column; gap: 10px; max-width: 560px;
}
.sw-editor-row { display: flex; align-items: center; gap: 10px; }
.sw-editor-row .text-input { width: auto; flex: 1; }
.sw-f-hex { max-width: 110px; font-family: var(--f-mono); }
.sw-picker { position: relative; width: 40px; height: 34px; flex: 0 0 auto; cursor: pointer; }
.sw-picker input[type="color"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sw-picker-fill {
  display: block; width: 100%; height: 100%; border-radius: 7px; pointer-events: none;
  border: 1px solid color-mix(in srgb, var(--ink), transparent 72%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 1px 2px rgba(0,0,0,.1);
}
.sw-editor-hint, .sw-editor-err { font-family: var(--f-sans); font-size: 11.5px; color: var(--mute); }
.sw-editor-err { color: #8C2B1F; }

/* ══ Onboarding wizard (Settings → Kom igång) ════════════════════════════── */
.wiz { display: grid; grid-template-columns: 200px 1fr; gap: 26px; min-height: 480px; }
.wiz-rail { display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--rule); padding-right: 16px; }
.wiz-step {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 0; background: transparent; border-radius: 8px; cursor: pointer; text-align: left;
  font-family: var(--f-sans); font-size: 12.5px; color: var(--mute);
}
.wiz-step.is-on { background: var(--hover); color: var(--ink); font-weight: 600; }
.wiz-step.is-done { color: var(--ink); }
.wiz-step-n {
  width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 10.5px; font-weight: 700;
  background: var(--paper-2); border: 1px solid var(--rule); color: var(--mute);
}
.wiz-step.is-on .wiz-step-n { background: var(--accent); border-color: var(--accent); color: #fff; }
.wiz-step.is-done .wiz-step-n { background: var(--st-green, #DDEBD9); color: var(--ink); }
.wiz-pane { display: flex; flex-direction: column; min-width: 0; }
.wiz-body { flex: 1; }
.wiz-body h2 { font-size: 22px; margin: 0 0 8px; }
.wiz-body > p { font-family: var(--f-sans); font-size: 13px; color: var(--mute); line-height: 1.55; max-width: 620px; }
.wiz-body h4 { font-family: var(--f-sans); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--mute); margin: 18px 0 8px; }
.wiz-list { font-family: var(--f-sans); font-size: 13px; line-height: 1.7; color: var(--ink); padding-left: 18px; max-width: 620px; }
.wiz-rows { display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.wiz-goalrow { display: grid; grid-template-columns: 1fr 160px 140px 34px; gap: 8px; }
.wiz-audrow  { display: grid; grid-template-columns: 240px 1fr 34px; gap: 8px; }
.wiz-row-del { padding: 4px 0; font-size: 14px; line-height: 1; }
.wiz-statrow { display: flex; gap: 14px; margin-top: 14px; }
.wiz-stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 18px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper);
  font-family: var(--f-sans);
}
.wiz-stat b { font-size: 20px; }
.wiz-stat span { font-size: 11px; color: var(--mute); }
.wiz-actions { display: flex; align-items: center; gap: 10px; }
.wiz-saved { font-family: var(--f-sans); font-size: 12px; color: var(--st-green-ink, #2E5B2E); }
.wiz-foot { display: flex; align-items: center; gap: 10px; padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--rule); }
.wiz-foot-gap { flex: 1; }
.app-goals h4 { font-family: var(--f-sans); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--mute); margin: 0 0 8px; }
@media (max-width: 900px) {
  .wiz { grid-template-columns: 1fr; }
  .wiz-rail { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--rule); padding: 0 0 10px; }
  .wiz-goalrow, .wiz-audrow { grid-template-columns: 1fr; }
}

/* ── Desktop greeting — the old dashboard welcome, on the wallpaper ─────── */
.os-greet {
  position: absolute; top: 28px; left: 30px; z-index: 0;
  pointer-events: none; user-select: none;
  color: #F2EFE8; text-shadow: 0 2px 20px rgba(0,0,0,.38);
}
.os-greet h1 {
  font-family: var(--f-display); font-size: 36px; font-weight: 400;
  letter-spacing: -.01em; margin: 0; line-height: 1.1;
}
.os-greet p {
  font-family: var(--f-display); font-style: italic;
  font-size: 18px; margin: 3px 0 0; opacity: .72;
}
html[data-wall-tone="light"] .os-greet { color: #33302B; text-shadow: 0 1px 16px rgba(255,255,255,.55); }
/* widgets + log panel start below the greeting */
.os-widgets, .os-logpanel { top: 118px; }

/* Per-platform breakdown on the campaigns KPI row */
.os-kpirow .os-kpinets {
  flex: 0 0 auto; font-family: var(--f-mono); font-size: 9.5px;
  color: rgba(255,255,255,.45); white-space: nowrap;
}
html[data-wall-tone="light"] .os-kpirow .os-kpinets { color: rgba(43,38,31,.5); }

/* ══ Nytt inlägg-dialogen: fixed height, scrollable body, pinned footer ══── */
.studio-dlg { height: min(720px, 90%); max-height: none; }
.studio-dlg-pub { height: auto; max-height: min(640px, 88%); }
.studio-dlg-main { overflow: hidden; }
.studio-dlg-scroll {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
  margin: 0 -24px; padding: 2px 24px 10px;   /* scrollbar at the dialog edge */
}
.studio-dlg-foot { margin-top: 0; flex: 0 0 auto; }

/* Channel picker: a round green check marks selected channels; clicking
   toggles the check on/off instead of only shifting the border. */
.studio-dlg-chk {
  width: 17px; height: 17px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700; line-height: 1;
  border: 1.5px solid color-mix(in srgb, var(--ink), transparent 70%);
  color: transparent; background: transparent;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.studio-dlg-ch.is-on .studio-dlg-chk {
  background: #2FA34F; border-color: #2FA34F; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.studio-dlg-ch { opacity: .75; }
.studio-dlg-ch.is-on { border-color: var(--rule); }
html[data-theme="dark"] .studio-dlg-ch.is-on .studio-dlg-chk { background: #34B45A; border-color: #34B45A; }
/* Never compress the form fields — overflow into scroll instead. */
.studio-dlg-scroll > * { flex-shrink: 0; }

/* ── Crash screen (error boundary) — never a blank white page ───────────── */
.crash {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: linear-gradient(160deg, #2E2C29, #3B3936 55%, #34322E);
  padding: 24px;
}
.crash-card {
  max-width: 560px; background: var(--bg); border-radius: 14px;
  padding: 28px 30px; box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.crash-card h1 { font-family: var(--f-display); font-size: 26px; margin: 0 0 10px; }
.crash-card p { font-family: var(--f-sans); font-size: 13px; color: var(--mute); line-height: 1.55; margin: 0 0 16px; }
.crash-actions { display: flex; gap: 10px; margin-bottom: 16px; }
.crash-detail {
  font-family: var(--f-mono); font-size: 10.5px; line-height: 1.5; color: var(--mute);
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 8px;
  padding: 10px 12px; max-height: 180px; overflow: auto; white-space: pre-wrap; margin: 0;
}

/* ── Dock placement: right (default) / bottom / left ────────────────────── */
html[data-dock-pos="right"] .os-dock,
html[data-dock-pos="left"] .os-dock {
  left: auto; right: 10px; bottom: auto; top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
  max-width: none; max-height: 92vh; overflow-y: auto; overflow-x: hidden;
  padding: 10px 7px;
}
html[data-dock-pos="left"] .os-dock { right: auto; left: 10px; }
html[data-dock-pos="right"] .os-dock.is-hidden { transform: translateY(-50%) translateX(calc(100% + 16px)); }
html[data-dock-pos="left"] .os-dock.is-hidden  { transform: translateY(-50%) translateX(calc(-100% - 16px)); }
html[data-dock-pos="right"] .os-dockbtn:hover { transform: translateX(-2px); }
html[data-dock-pos="left"] .os-dockbtn:hover  { transform: translateX(2px); }
@media (max-width: 900px) {
  html[data-dock-pos="right"] .os-dock, html[data-dock-pos="right"] .os-dock.is-hidden,
  html[data-dock-pos="left"] .os-dock,  html[data-dock-pos="left"] .os-dock.is-hidden {
    transform: translateY(-50%); opacity: 1; pointer-events: auto;
  }
}

/* ── Studio: sparade inlägg — mappar, kort, dialoger ─────────────────────── */
.studio-open-head { display: flex; align-items: center; justify-content: space-between; }
.studio-folders { display: flex; flex-wrap: wrap; gap: 6px; }
.studio-folder {
  display: inline-flex; align-items: center; gap: 2px;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--paper);
  font-family: var(--f-sans); font-size: 12px; color: var(--mute);
  padding: 0 4px 0 0; overflow: hidden;
}
.studio-folder.is-on { border-color: var(--ink); color: var(--ink); background: var(--bg); }
.studio-folder.is-system { border-style: dashed; }
button.studio-folder { padding: 5px 12px; cursor: pointer; }
.studio-folder-btn { border: 0; background: transparent; cursor: pointer; font: inherit; color: inherit; padding: 5px 4px 5px 12px; }
.studio-folder-del {
  border: 0; background: transparent; cursor: pointer; color: var(--mute);
  font-size: 13px; line-height: 1; padding: 4px 6px; border-radius: 50%;
}
.studio-folder-del:hover { color: #8C2B1F; }
.studio-folder-new { color: var(--accent); border-style: dashed; }
.studio-docgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.studio-doccard {
  display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--paper); overflow: hidden;
}
.studio-doccard-open {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left;
  border: 0; background: transparent; cursor: pointer; padding: 12px 12px 8px;
}
.studio-doccard-open:hover { background: var(--hover); }
.studio-docname { font-family: var(--f-sans); font-size: 13px; font-weight: 600; color: var(--ink); }
.studio-docmeta { font-family: var(--f-sans); font-size: 10.5px; color: var(--mute); }
.studio-doccard-foot {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px;
  border-top: 1px solid var(--rule);
}
.studio-docmove { flex: 1; font-size: 11px !important; padding: 3px 22px 3px 7px !important; }
.studio-docdel {
  border: 0; background: transparent; cursor: pointer; color: var(--mute);
  font-size: 15px; line-height: 1; padding: 2px 6px; border-radius: 6px;
}
.studio-docdel:hover { color: #8C2B1F; background: var(--hover); }
.studio-dlg-confirm { width: min(480px, 92%); }
.studio-confirm-p { font-family: var(--f-sans); font-size: 13px; color: var(--mute); line-height: 1.55; margin: 0; }
.studio-confirm-discard { color: #8C2B1F; }

/* Inläggstext-verktyget + rymligare textfält i inspektören */
.studio-insp-text { min-height: 84px; font-size: 13px !important; line-height: 1.45; }
.studio-caption-edit { min-height: 140px; font-size: 13px !important; line-height: 1.5; }
.studio-caption-list { display: flex; flex-direction: column; gap: 6px; }
button.studio-post-cap-ph {
  display: block; width: 100%; text-align: left; border: 1px dashed var(--rule);
  background: transparent; cursor: pointer; border-radius: 8px; padding: 8px 10px;
  font-family: var(--f-sans); font-size: 12px; color: var(--mute); line-height: 1.5;
}
button.studio-post-cap-ph:hover { border-color: var(--accent); color: var(--ink); }
.studio-post-cap-text[role="button"] { cursor: pointer; }
.studio-post-cap-text[role="button"]:hover { text-decoration: underline dotted; text-underline-offset: 3px; }

/* ══ Agenter — personalvyn med cirkelreglage ═════════════════════════════── */
.agroster-lede { font-family: var(--f-sans); font-size: 13px; color: var(--mute); max-width: 560px; margin: 0 0 16px; line-height: 1.55; }
.agcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.agcard {
  display: flex; flex-direction: column; gap: 10px;
  border: 1px solid var(--rule); border-radius: 14px; background: var(--paper);
  padding: 16px; transition: box-shadow .15s ease, opacity .15s ease;
}
.agcard:hover { box-shadow: 0 6px 22px rgba(0,0,0,.07); }
.agcard.is-off { opacity: .6; }
.agcard-top { display: flex; align-items: flex-start; gap: 12px; }
.agcard-ava {
  position: relative; width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; color: #fff;
  font-family: var(--f-sans); font-size: 15px; font-weight: 700;
  box-shadow: inset 0 -6px 12px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.12);
}
.agcard-status {
  position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px;
  border-radius: 50%; background: #B8B4AC; border: 2px solid var(--paper);
}
.agcard-status.is-on { background: #2FA34F; }
.agcard-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; overflow: hidden; }
/* Långa rollnamn ("Marknads-/trendresearcher") får radbrytas — utan detta
   ritas glyferna utanför boxen och hamnar under on/off-toggeln. */
.agcard-meta b { font-family: var(--f-sans); font-size: 14px; color: var(--ink);
  overflow-wrap: anywhere; line-height: 1.25; }
.agcard-role { font-family: var(--f-sans); font-size: 11px; color: var(--mute); overflow-wrap: anywhere; }
.agcard-onoff { flex: 0 0 auto; margin-top: 3px; }
.agcard-desc { font-family: var(--f-sans); font-size: 11.5px; color: var(--mute); line-height: 1.45; margin: 0; }
.agcard-dials { display: flex; justify-content: space-between; gap: 4px; padding: 4px 2px 2px; }
.agdial { display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: ns-resize; user-select: none; touch-action: none; }
.agdial.is-disabled { cursor: default; opacity: .6; }
.agdial-svg { width: 58px; height: 58px; }
.agdial-v { font-family: var(--f-sans); font-size: 14px; font-weight: 700; fill: var(--ink); }
.agdial-l { font-family: var(--f-sans); font-size: 9px; letter-spacing: .02em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }
.agdial:focus-visible { outline: none; border-radius: 10px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 60%); }
.agcard-ctl { display: flex; gap: 10px; }
.agcard-ctl label { display: flex; flex-direction: column; gap: 3px; flex: 1; font-family: var(--f-sans); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--mute); }
.agcard-instrbtn {
  border: 1px dashed var(--rule); border-radius: 8px; background: transparent;
  cursor: pointer; padding: 7px 10px; text-align: left;
  font-family: var(--f-sans); font-size: 11.5px; color: var(--mute);
}
.agcard-instrbtn:hover { color: var(--ink); border-color: var(--accent); }
.agcard-instr { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.agcard-last { font-family: var(--f-mono); font-size: 9.5px; color: var(--mute); }
.agcard-tools { display: flex; flex-wrap: wrap; gap: 4px; }
.agcard-dir { font-family: var(--f-sans); font-size: 11px; color: var(--ink-2); line-height: 1.4; font-style: italic; }
.agcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.agcard-run { margin-left: auto; }

/* ✦ Designförslag i Studion */
.studio-designlist { display: flex; flex-direction: column; gap: 12px; }
.studio-designcard {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  border: 1px solid var(--rule); border-radius: 10px; background: var(--paper);
  padding: 10px; cursor: pointer; transition: border-color .12s ease, box-shadow .12s ease;
}
.studio-designcard:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.studio-designthumb { position: relative; display: block; border-radius: 6px; overflow: hidden; border: 1px solid var(--rule); }
.studio-designname { font-family: var(--f-sans); font-size: 11.5px; font-weight: 600; color: var(--ink); }
.studio-eltext { display: block; white-space: inherit; outline: none; min-height: 1em; }

/* In-window menu flap (Arkiv/Objekt/Bild inside the Studio chrome) */
.studio-inmenus { display: flex; align-items: center; gap: 2px; margin-right: 8px; }
.studio-inmenu-btn { font-size: 11px !important; padding: 3px 8px !important; }

/* Emoji row in the caption tool */
.studio-emojirow { display: flex; flex-wrap: wrap; gap: 2px; }
.studio-emojibtn {
  border: 0; background: transparent; cursor: pointer; font-size: 17px;
  padding: 3px 5px; border-radius: 6px; line-height: 1;
}
.studio-emojibtn:hover { background: var(--hover); transform: scale(1.15); }

/* Story/Reel safe zones + 4:5 share guide */
.studio-safe { position: absolute; inset: 0; pointer-events: none; z-index: 40; }
.studio-safe-zone {
  position: absolute; left: 0; right: 0;
  background: repeating-linear-gradient(45deg, rgba(20,19,17,.14) 0 8px, rgba(20,19,17,.05) 8px 16px);
  display: flex; align-items: center; justify-content: center;
}
.studio-safe-zone span {
  font-family: var(--f-sans); font-size: 9px; letter-spacing: .06em; text-transform: uppercase;
  color: rgba(255,255,255,.85); background: rgba(20,19,17,.55); padding: 2px 8px; border-radius: 999px;
}
/* Left/right margins (Paket 1 — the old heuristic only ever had top/bottom).
   Overrides the top/bottom bar's left:0;right:0 with a vertical strip instead. */
.studio-safe-side { left: auto; right: auto; top: 0; bottom: 0; }
/* Bilaga A5: an overlay built on a guess has to read as a guess. Anything
   not confidence:'published' gets a visibly different, thinner-contrast
   treatment than a platform-documented margin. */
.studio-safe.is-unverified .studio-safe-zone {
  background: repeating-linear-gradient(45deg, rgba(255,159,10,.16) 0 8px, rgba(255,159,10,.05) 8px 16px);
}
.studio-safe.is-unverified .studio-safe-zone span { background: rgba(154,92,0,.75); }
.studio-safe-45 {
  position: absolute; left: 0; right: 0;
  border-top: 1.5px dashed rgba(94,92,230,.85); border-bottom: 1.5px dashed rgba(94,92,230,.85);
}
.studio-safe-45 span {
  position: absolute; top: 4px; right: 6px;
  font-family: var(--f-sans); font-size: 9px; letter-spacing: .05em; text-transform: uppercase;
  color: #fff; background: rgba(94,92,230,.85); padding: 2px 7px; border-radius: 999px;
}
.studio-dims { display: flex; align-items: center; gap: 8px; }
.studio-safe-toggle {
  border: 1px solid var(--rule); border-radius: 999px; background: transparent;
  cursor: pointer; padding: 1px 9px; font-family: var(--f-sans); font-size: 10px; color: var(--mute);
}
.studio-safe-toggle.is-on { border-color: #5E5CE6; color: #5E5CE6; }

/* ── Dock grip — always visible when the dock is hidden ─────────────────── */
.os-dock-grip {
  position: absolute; z-index: 790; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 3px;
  background: rgba(20,19,17,.42); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.12);
  transition: background-color .15s ease, transform .15s ease;
}
.os-dock-grip span { display: block; width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.7); }
.os-dock-grip:hover { background: rgba(20,19,17,.6); }
html[data-wall-tone="light"] .os-dock-grip { background: rgba(255,255,255,.5); border-color: rgba(0,0,0,.1); }
html[data-wall-tone="light"] .os-dock-grip span { background: rgba(43,38,31,.65); }
html[data-wall-tone="light"] .os-dock-grip:hover { background: rgba(255,255,255,.75); }

html[data-dock-pos="right"] .os-dock-grip {
  right: 0; top: 50%; transform: translateY(-50%);
  width: 16px; height: 72px; flex-direction: column;
  border-radius: 10px 0 0 10px; border-right: 0;
}
html[data-dock-pos="right"] .os-dock-grip:hover { transform: translateY(-50%) translateX(-1px); }
html[data-dock-pos="left"] .os-dock-grip {
  left: 0; top: 50%; transform: translateY(-50%);
  width: 16px; height: 72px; flex-direction: column;
  border-radius: 0 10px 10px 0; border-left: 0;
}
html[data-dock-pos="left"] .os-dock-grip:hover { transform: translateY(-50%) translateX(1px); }
html[data-dock-pos="bottom"] .os-dock-grip {
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 72px; height: 16px; flex-direction: row;
  border-radius: 10px 10px 0 0; border-bottom: 0;
}
html[data-dock-pos="bottom"] .os-dock-grip:hover { transform: translateX(-50%) translateY(-1px); }

/* ── Nest Marketing "apple" — mark + app menu top-left ────────────────────────── */
.os-brandwrap { position: relative; display: flex; align-items: center; }
.os-brandbtn {
  border: 0; background: transparent; cursor: pointer;
  padding: 4px 8px; border-radius: 6px; display: grid; place-items: center;
}
.os-brandbtn:hover, .os-brandbtn.is-open { background: rgba(255,255,255,.12); }
.os-mark {
  position: relative; display: block; width: 15px; height: 15px;
}
.os-mark::before {
  content: ""; position: absolute; left: 0; top: 0;
  width: 10px; height: 10px; background: #F6F5F1; border-radius: 1.5px;
}
.os-mark::after {
  content: ""; position: absolute; right: 0; bottom: 0;
  width: 6px; height: 6px; background: var(--accent); border-radius: 1px;
}
.os-brandmenu {
  position: absolute; top: calc(100% + 4px); left: 0; min-width: 220px; z-index: 900;
}
.os-brandmenu-item { display: flex; align-items: center; gap: 9px; }
.os-brandmenu-item .ico { width: 14px; height: 14px; opacity: .75; flex: 0 0 auto; }
.os-brandmenu-badge {
  margin-left: auto; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: #C94F3D; color: #fff; font-size: 9.5px; font-weight: 700;
  display: inline-grid; place-items: center;
}

/* Bridge the 4px visual gap between the brand button and its dropdown so
   the pointer never counts as "outside" while crossing it (mouseleave fix). */
.os-brandmenu::before {
  content: ""; position: absolute; top: -6px; left: 0; right: 0; height: 6px;
}

/* macOS: a full-screen window can't be minimized — the yellow light shows as
   inert (like the disabled minimize button on a native fullscreen window). */
.oswin-light:disabled { cursor: default; opacity: .45; }
.oswin-light:disabled:hover { filter: none; }

/* ── Beställning — order/estimate request app ──────────────────────────── */
.orders-app { max-width: 560px; margin: 0 auto; padding: 26px 26px 40px; }
.orders-h { font-size: 21px; margin: 0 0 6px; }
.orders-sub { font-family: var(--f-sans); font-size: 13px; color: var(--mute); line-height: 1.55; margin: 0 0 16px; }
.orders-brief { width: 100%; font-size: 13.5px; line-height: 1.5; }
.orders-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.orders-actions-final { flex-direction: column; align-items: stretch; gap: 8px; margin-top: 18px; }
.orders-primary {
  height: 38px; padding: 0 22px; border-radius: 10px; border: 0; cursor: pointer;
  background: var(--ink); color: var(--paper);
  font-family: var(--f-sans); font-size: 13.5px; font-weight: 500;
}
.orders-primary:hover:not(:disabled) { opacity: .88; }
.orders-primary:disabled { opacity: .45; cursor: default; }
/* The green order CTA and the discreet estimate alternative. */
.orders-order {
  height: 44px; border-radius: 11px; border: 0; cursor: pointer;
  background: #1E8A4C; color: #fff;
  font-family: var(--f-sans); font-size: 14px; font-weight: 600;
}
.orders-order:hover:not(:disabled) { background: #22994F; }
.orders-order:disabled { opacity: .55; cursor: default; }
.orders-estimate {
  height: 36px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--rule); background: transparent; color: var(--mute);
  font-family: var(--f-sans); font-size: 12.5px;
}
.orders-estimate:hover:not(:disabled) { border-color: var(--rule-2); color: var(--ink-2); }
.orders-error { margin-top: 10px; font-family: var(--f-sans); font-size: 12px; color: var(--danger, #c0392b); }
.orders-briefbox {
  position: relative; margin: 0 0 18px; padding: 12px 14px; border-radius: 10px;
  background: var(--paper-2, rgba(0,0,0,.04)); border: 1px solid var(--rule);
  font-size: 13px; line-height: 1.5; white-space: pre-wrap;
}
.orders-brieflabel { display: block; font-family: var(--f-sans); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin-bottom: 4px; }
.orders-editbrief {
  position: absolute; top: 10px; right: 10px;
  border: 0; background: transparent; cursor: pointer;
  font-family: var(--f-sans); font-size: 11.5px; color: var(--accent); text-decoration: underline;
}
.orders-q { margin-bottom: 14px; }
.orders-qlabel { display: block; font-family: var(--f-sans); font-size: 13px; font-weight: 500; margin-bottom: 6px; line-height: 1.45; }
.orders-qanswer { width: 100%; font-size: 13px; }
.orders-note { font-family: var(--f-sans); font-size: 11.5px; color: var(--mute); margin-top: 4px; }
.orders-done { text-align: center; padding: 48px 0; }
.orders-donemark {
  width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 50%;
  background: #1E8A4C; color: #fff; font-size: 26px;
  display: flex; align-items: center; justify-content: center;
}
.orders-hist-h { font-family: var(--f-sans); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin: 28px 0 8px; }
.orders-histrow {
  display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid var(--rule); font-family: var(--f-sans); font-size: 12.5px;
}
.orders-histbrief { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orders-histstatus { padding: 2px 8px; border-radius: 9px; font-size: 10.5px; background: var(--paper-2, rgba(0,0,0,.05)); color: var(--ink-2); white-space: nowrap; }
.orders-histstatus.is-new { background: #E8F1FB; color: #2563AC; }
.orders-histstatus.is-planned, .orders-histstatus.is-done { background: #E5F3EA; color: #1E8A4C; }
.orders-histmeta { color: var(--mute); font-size: 11px; white-space: nowrap; }

/* Desktop widget — "Behöver du hjälp av Brightnest?" */
.os-orderbrief {
  width: 100%; resize: none; margin: 2px 0 8px;
  padding: 8px 10px; border-radius: 9px;
  border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.07);
  color: inherit; font-family: var(--f-sans); font-size: 12px; line-height: 1.45;
}
.os-orderbrief::placeholder { color: rgba(255,255,255,.4); }
.os-orderbrief:focus { outline: none; border-color: rgba(255,255,255,.34); }
.os-orderwidget .os-orderbrief { width: calc(100% - 12px); margin: 2px 6px 8px; }
html[data-wall-tone="light"] .os-orderbrief {
  border-color: rgba(43,38,31,.18); background: rgba(43,38,31,.05); color: #2B261F;
}
html[data-wall-tone="light"] .os-orderbrief::placeholder { color: rgba(43,38,31,.45); }

/* ── Hjälp — the platform manual app ───────────────────────────────────── */
/* Fills the window body edge-to-edge — .oswin-body has no padding of its
   own (padding normally comes from .page, which Help doesn't use), so no
   negative bleed margins here: they'd clip the sidebar outside the window. */
.help-app { display: grid; grid-template-columns: 230px 1fr; gap: 0; height: 100%; overflow: hidden; }
/* Two independent panes (like macOS Help): the sidebar is always fully
   visible and scrolls on its own; the article column scrolls on its own. */
.help-side {
  background: var(--paper); border-right: 1px solid var(--rule);
  padding: 14px 10px 20px; display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto; min-height: 0;
}
.help-search { margin: 0 4px 10px; font-size: 12.5px; }
.help-cat { display: flex; flex-direction: column; gap: 1px; margin-bottom: 10px; }
.help-cat-l { font-family: var(--f-sans); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); padding: 6px 10px 4px; }
.help-navitem {
  text-align: left; border: 0; background: transparent; cursor: pointer;
  padding: 6px 10px; border-radius: 7px;
  font-family: var(--f-sans); font-size: 12.5px; color: var(--ink-2); line-height: 1.35;
}
.help-navitem:hover { background: var(--hover); color: var(--ink); }
.help-navitem.is-on { background: var(--bg); color: var(--ink); font-weight: 500; }
.help-main { padding: 26px 34px 48px; overflow-y: auto; min-height: 0; }
.help-main > * { max-width: 640px; }
.help-crumb { font-family: var(--f-sans); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin-bottom: 6px; }
.help-h { font-size: 24px; margin: 0 0 8px; }
.help-lead { font-family: var(--f-sans); font-size: 14px; color: var(--ink-2); line-height: 1.6; margin: 0 0 18px; }
.help-sec { margin-bottom: 16px; }
.help-sec h3 { font-family: var(--f-sans); font-size: 13.5px; font-weight: 600; margin: 0 0 4px; }
.help-sec p { font-family: var(--f-sans); font-size: 13px; color: var(--ink-2); line-height: 1.65; margin: 0; }
.help-related { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.help-related .help-cat-l { padding: 0; width: 100%; }
.help-relbtn {
  border: 1px solid var(--rule); border-radius: 16px; background: transparent; cursor: pointer;
  padding: 6px 13px; font-family: var(--f-sans); font-size: 12px; color: var(--ink-2);
}
.help-relbtn:hover { border-color: var(--ink); color: var(--ink); }
.help-hits { display: flex; flex-direction: column; gap: 8px; }
.help-hit {
  text-align: left; border: 1px solid var(--rule); border-radius: 10px; background: transparent;
  cursor: pointer; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px;
}
.help-hit:hover { border-color: var(--ink); }
.help-hit b { font-family: var(--f-sans); font-size: 13.5px; }
.help-hit span { font-family: var(--f-sans); font-size: 12px; color: var(--mute); line-height: 1.5; }

/* HelpDot — the discreet "?" that explains a feature in place. */
.helpdot-wrap { position: relative; display: inline-flex; vertical-align: middle; margin-left: 4px; }
.helpdot {
  width: 15px; height: 15px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 1px solid var(--rule-2); background: transparent; color: var(--mute);
  font-family: var(--f-sans); font-size: 9.5px; font-weight: 600; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: .6; transition: opacity .12s, border-color .12s, color .12s;
}
.helpdot:hover, .helpdot:focus-visible { opacity: 1; border-color: var(--ink); color: var(--ink); outline: none; }
.helpdot-pop {
  position: absolute; top: calc(100% + 7px); left: 50%; transform: translateX(-50%);
  z-index: 90; width: 250px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 11px 12px;
  display: flex; flex-direction: column; gap: 8px;
  font-family: var(--f-sans); text-transform: none; letter-spacing: 0;
}
.helpdot-txt { font-size: 12px; color: var(--ink-2); line-height: 1.55; font-weight: 400; white-space: normal; text-align: left; }
.helpdot-more {
  align-self: flex-start; border: 0; background: transparent; cursor: pointer; padding: 0;
  font-family: var(--f-sans); font-size: 11.5px; color: var(--accent); font-weight: 500;
}
.helpdot-more:hover { text-decoration: underline; }
/* Dots inside glass widgets need lighter chrome. */
.os-widget .helpdot { border-color: rgba(255,255,255,.3); color: rgba(255,255,255,.6); }
.os-widget .helpdot:hover { border-color: #fff; color: #fff; }
html[data-wall-tone="light"] .os-widget .helpdot { border-color: rgba(43,38,31,.3); color: rgba(43,38,31,.55); }
html[data-wall-tone="light"] .os-widget .helpdot:hover { border-color: #2B261F; color: #2B261F; }
.os-widget .helpdot-pop { color: var(--ink-2); }

@media (max-width: 740px) {
  .help-app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .help-side { border-right: 0; border-bottom: 1px solid var(--rule); overflow-y: visible; max-height: 40vh; overflow-y: auto; }
  .help-main { padding: 20px 18px 40px; }
}

/* ── Rapporter ─────────────────────────────────────────────────────────── */
.rep-app { padding: 22px 26px 30px; overflow-y: auto; height: 100%; }
.rep-head { display: flex; align-items: center; gap: 16px; }
.rep-h { margin: 0; font-size: 20px; }
.rep-newbtn { padding: 8px 18px; }
.rep-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 4px; }
.rep-search { flex: 1 1 240px; max-width: 380px; }
.rep-typefilter { display: flex; gap: 6px; }
.rep-sub { margin: 20px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #7a8194); }
.rep-chip { border: 1px solid var(--border, #d8dce6); background: var(--card, #fff); border-radius: 999px;
  padding: 4px 12px; font-size: 12.5px; cursor: pointer; color: inherit; }
.rep-chip.is-on { background: var(--accent, #4f6bff); border-color: var(--accent, #4f6bff); color: #fff; }
.rep-templates { display: flex; flex-direction: column; gap: 8px; }
.rep-template { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  border: 1px solid var(--border, #d8dce6); border-radius: 12px; padding: 10px 14px; background: var(--card, #fff); }
.rep-template.is-paused { opacity: .55; }
.rep-t-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.rep-t-title { font-weight: 600; }
.rep-t-meta { font-size: 12px; color: var(--muted, #7a8194); }
.rep-t-actions { display: flex; gap: 6px; }
.rep-mini { border: 1px solid var(--border, #d8dce6); background: transparent; border-radius: 8px;
  padding: 4px 10px; font-size: 12px; cursor: pointer; color: inherit; }
.rep-mini:hover { border-color: var(--accent, #4f6bff); }
.rep-mini.is-danger:hover { border-color: #d0454c; color: #d0454c; }
.rep-badge { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  border-radius: 6px; padding: 2px 7px; }
.rep-badge.is-recurring { background: rgba(79,107,255,.12); color: var(--accent, #4f6bff); }
.rep-badge.is-once { background: rgba(122,129,148,.14); color: var(--muted, #6a7186); }
.rep-runs { display: flex; flex-direction: column; gap: 8px; }
.rep-run { text-align: left; border: 1px solid var(--border, #d8dce6); border-radius: 12px; background: var(--card, #fff);
  padding: 12px 14px; cursor: pointer; color: inherit; font: inherit; }
.rep-run.is-done:hover { border-color: var(--accent, #4f6bff); }
.rep-run.is-running, .rep-run.is-failed { cursor: default; }
.rep-r-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rep-r-title { font-weight: 600; }
.rep-status { font-size: 12px; font-weight: 600; }
.rep-status.is-running { color: var(--accent, #4f6bff); animation: rep-pulse 1.6s ease-in-out infinite; }
.rep-status.is-failed { color: #d0454c; }
.rep-status.is-done { color: #2c9a5b; }
@keyframes rep-pulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
.rep-r-meta { font-size: 12px; color: var(--muted, #7a8194); margin-top: 3px; }
.rep-r-headline { font-size: 13px; margin-top: 6px; }
.rep-r-deck { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; margin-left: 8px;
  font: inherit; font-size: 11px; font-weight: 650; color: var(--accent, #4f6bff); background: rgba(79,107,255,.10);
  border: 1px solid rgba(79,107,255,.22); white-space: nowrap; cursor: pointer; vertical-align: 1px; }
.rep-r-deck:hover { background: rgba(79,107,255,.18); }
.rep-overlay { position: absolute; inset: 0; background: rgba(15,18,28,.35); display: flex;
  align-items: flex-start; justify-content: center; padding: 30px 20px; z-index: 30; overflow-y: auto; }
.rep-detail, .rep-builder { position: relative; background: var(--card, #fff); border-radius: 16px;
  padding: 26px 30px; max-width: 680px; width: 100%; box-shadow: 0 24px 70px -20px rgba(15,20,45,.4); }
.rep-close { position: absolute; top: 14px; right: 14px; border: none; background: transparent;
  font-size: 15px; cursor: pointer; color: var(--muted, #7a8194); }
.rep-loading { padding: 30px 0; color: var(--muted, #7a8194); }
.rep-d-title { margin: 0; font-size: 26px; letter-spacing: -0.01em; line-height: 1.18; }
.rep-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 24px 0 20px; }
.rep-kpi { background: var(--bg-soft, #f5f6fa); border: 0; border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px; }
.rep-kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted, #7a8194); }
.rep-kpi-value { font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rep-delta { font-size: 12px; font-weight: 600; }
.rep-delta.is-up { color: #2c9a5b; } .rep-delta.is-down { color: #d0454c; } .rep-delta.is-flat { color: var(--muted, #7a8194); }
.rep-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rep-table th, .rep-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--border, #e3e6ee); }
.rep-table .num { text-align: right; }
.rep-f-label { display: block; font-size: 12px; font-weight: 600; margin: 14px 0 4px; }
.rep-f-hint { font-weight: 400; color: var(--muted, #7a8194); font-size: 11.5px; }
.rep-f-row { display: flex; gap: 12px; }
.rep-f-row > div { flex: 1; }
.rep-f-check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 14px 0 6px; cursor: pointer; }
.rep-chiprow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ── Mål & budget + annonsåtgärder ─────────────────────────────────────── */
.adt-modal { max-width: 760px; }
.adt-account { border-top: 1px solid var(--border, #e3e6ee); padding: 14px 0 10px; margin-top: 10px; }
.adt-acc-name { font-weight: 650; margin-bottom: 8px; }
.adt-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.adt-field { flex: 0 1 130px; min-width: 110px; }
.adt-notes { flex: 1 1 100%; }
.adt-toggle { margin-top: 8px; }
.adt-camp { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 0 12px; padding-left: 10px; border-left: 2px solid var(--border, #e3e6ee); }
.adt-camp-name { font-size: 12.5px; font-weight: 600; }
.mkt-adactions { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.mkt-adaction { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline;
  border: 1px solid color-mix(in srgb, #B0532A, transparent 70%); background: color-mix(in srgb, #B0532A, transparent 94%);
  border-radius: 10px; padding: 6px 10px; font-size: 12.5px; }
.mkt-adaction-type { font-weight: 700; color: #B0532A; white-space: nowrap; }
.mkt-adaction-target { font-weight: 600; }
.mkt-adaction-amount { font-variant-numeric: tabular-nums; }
.mkt-adaction-reason { flex: 1 1 100%; color: var(--muted, #7a8194); font-size: 12px; }

/* ── Rapportanalys + format ────────────────────────────────────────────── */
.rep-tpl-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 650; color: #5a4a9f; background: #efeafd; border: 1px solid #ded4f7;
  white-space: nowrap; margin-left: 6px; vertical-align: 2px; }

/* ── Meddelanden (Slack/Teams) ─────────────────────────────────────────── */
.conn-slack-btn { display: inline-flex; margin-top: 8px; }
.conn-teams-form { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.conn-teams-form .text-input { flex: 1 1 260px; }
.conn-status.is-on { font-size: 13px; color: #157a3f; margin: 8px 0 4px; }
.conn-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.tb-btn.is-danger { color: #b3261e; border-color: color-mix(in srgb, #b3261e, transparent 60%); }

/* Chat: mine-only filter toggle */
.mkt-dock-filter { margin-left: auto; margin-right: 8px; font-size: 11.5px; padding: 4px 10px;
  border-radius: 999px; border: 1px solid var(--border, #d8dce6); background: transparent;
  color: var(--muted, #7a8194); cursor: pointer; white-space: nowrap; }
.mkt-dock-filter.is-on { border-color: var(--accent, #4f6bff); color: var(--accent, #4f6bff);
  background: color-mix(in srgb, var(--accent, #4f6bff), transparent 92%); }

/* ── Setup-widget: konfigurationsgrad ──────────────────────────────────── */
.os-setupwidget { cursor: pointer; }
.os-setupwidget:hover { box-shadow: 0 10px 34px -18px rgba(20,30,70,.4); }
.setup-ring-row { display: flex; align-items: center; gap: 12px; padding: 4px 2px 2px; }
.setup-ring { width: 64px; height: 64px; flex: none; }
.setup-ring-pct { font-size: 14px; font-weight: 750; fill: currentColor; }
.setup-ring-copy { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.setup-ring-copy b { font-size: 13.5px; }
.setup-ring-copy span { color: var(--muted, #7a8194); }
.setup-modal { max-width: 680px; }
.setup-group { margin-top: 16px; }
.setup-group-h { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted, #7a8194); margin: 0 0 6px; }
.setup-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 10px; }
.setup-item + .setup-item { margin-top: 2px; }
.setup-item.is-done { opacity: .6; }
.setup-item:not(.is-done) { background: var(--bg-soft, #f5f6fa); }
.setup-check { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--rule, #cdd2de);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; margin-top: 1px; }
.setup-item.is-done .setup-check { background: #2C7A3F; border-color: #2C7A3F; color: #fff; }
.setup-item-main { flex: 1 1 auto; min-width: 0; }
.setup-item-label { font-size: 13.5px; font-weight: 600; }
.setup-item-hint { font-size: 12px; color: var(--muted, #7a8194); margin-top: 1px; }
.setup-quick { display: flex; gap: 8px; margin-top: 8px; align-items: flex-end; }
.setup-quick .text-input { flex: 1; }
.setup-go { flex: none; white-space: nowrap; margin-top: 2px; }
.setup-overlay { position: fixed; inset: 0; z-index: 1200; }
.setup-modal { max-height: 82vh; overflow-y: auto; }

/* ── Dock-grupper + ⌘K-palett ─────────────────────────────────────────── */
.os-docksep { width: 1px; align-self: stretch; margin: 10px 4px; border-radius: 1px;
  background: color-mix(in srgb, #fff, transparent 75%); }
.os-palettebtn { border: 1px solid color-mix(in srgb, #fff, transparent 72%); background: transparent;
  color: inherit; border-radius: 7px; font-size: 11px; font-weight: 650; padding: 2px 7px;
  cursor: pointer; margin-right: 6px; opacity: .85; }
.os-palettebtn:hover { opacity: 1; background: color-mix(in srgb, #fff, transparent 88%); }
.os-palette-overlay { position: fixed; inset: 0; z-index: 1400; background: rgba(15,18,28,.32);
  display: flex; justify-content: center; align-items: flex-start; padding-top: 14vh; }
.os-palette { width: min(560px, 92vw); background: var(--card, #fff); border-radius: 14px;
  box-shadow: 0 30px 90px -20px rgba(10,14,30,.5); overflow: hidden; }
.os-palette-input { width: 100%; border: 0; outline: none; font-size: 16px; padding: 15px 18px;
  border-bottom: 1px solid var(--border, #e3e6ee); background: transparent; }
.os-palette-list { max-height: 46vh; overflow-y: auto; padding: 6px; }
.os-palette-item { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; border: 0; background: transparent; border-radius: 9px;
  padding: 9px 12px; cursor: pointer; font-size: 14px; }
.os-palette-item.is-sel { background: color-mix(in srgb, var(--accent, #4f6bff), transparent 90%); }
.os-palette-label { font-weight: 600; }
.os-palette-sub { font-size: 11.5px; color: var(--muted, #7a8194); white-space: nowrap; }
.os-palette-empty { padding: 18px; color: var(--muted, #7a8194); font-size: 13.5px; }
.os-palette-foot { padding: 8px 14px; border-top: 1px solid var(--border, #e3e6ee);
  font-size: 11px; color: var(--muted, #9aa1b0); }

/* ── Insights: Webbplats (GA4) ─────────────────────────────────────────── */
.ga-chart { display: flex; align-items: flex-end; gap: 2px; height: 64px; margin: 10px 0 4px;
  padding: 4px 2px; border-bottom: 1px solid var(--border, #e3e6ee); }
.ga-bar { flex: 1 1 auto; min-width: 2px; background: var(--accent, #4f6bff); opacity: .55; border-radius: 2px 2px 0 0; }
.ga-bar:hover { opacity: 1; }
.ga-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 26px; margin-top: 16px; }
@media (max-width: 900px) { .ga-cols { grid-template-columns: 1fr; } }
.ga-pagetitle { font-weight: 600; font-size: 12.5px; }
.ga-pagepath { font-size: 11px; color: var(--muted, #9aa1b0); max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ga-channel { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 12.5px; }
.ga-channel-l { flex: 0 0 110px; font-weight: 600; }
.ga-channel-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--bg-soft, #f0f2f6); overflow: hidden; }
.ga-channel-bar span { display: block; height: 100%; background: var(--accent, #4f6bff); border-radius: 999px; }
.ga-channel-v { flex: none; font-variant-numeric: tabular-nums; color: var(--muted, #7a8194); }

/* ── GA-panelens flikar + donuts ───────────────────────────────────────── */
.ga-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.ga-kpi-click { cursor: pointer; transition: box-shadow .15s ease; }
.ga-kpi-click:hover { box-shadow: 0 6px 20px -10px rgba(20,30,70,.35); }
.ga-channel-click { border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer; }
.ga-channel-click:hover .ga-channel-l { color: var(--accent, #4f6bff); }
.ga-donutwrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ga-donut-center { font-size: 15px; font-weight: 750; fill: currentColor; }
.ga-legend { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; min-width: 150px; }
.ga-legend-row { display: flex; align-items: center; gap: 7px; }
.ga-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ga-legend-l { flex: 1; }
.ga-legend-v { color: var(--muted, #7a8194); font-variant-numeric: tabular-nums; }
.mono-sm { font-family: ui-monospace, monospace; font-size: 11.5px; }
.ga-bar-alt { background: #8b5cf6; }
.ga-hbar-l { flex: 0 0 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ga-hbar { min-width: 0; }
.src-main .section-title { flex-wrap: wrap; gap: 2px 10px; }

/* Chart.js-boxar */
.chartbox { position: relative; width: 100%; min-width: 0; margin: 8px 0 4px; }
.chartbox-mini { margin: 4px 0 0; }
.ga-mainchart { margin-top: 14px; }

/* Lazy fönster-platshållare */
.oswin-lazy { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; height: 100%; color: var(--muted, #9aa1b0); font-size: 13px; }
.oswin-lazy-ico .ico { width: 30px; height: 30px; opacity: .5; }

/* ── Settings → Aktivitetslogg ── */
.audit-filters { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.audit-filters .text-input { max-width: 15rem; }
.audit-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.audit-table th {
  text-align: left; font-weight: 500; opacity: .55; padding: .4rem .6rem;
  border-bottom: 1px solid var(--line, rgba(0,0,0,.1)); white-space: nowrap;
}
.audit-table td { padding: .4rem .6rem; border-bottom: 1px solid var(--line, rgba(0,0,0,.06)); vertical-align: top; }
.audit-table tr.is-failed td { color: #ff6b5e; }
.audit-when { white-space: nowrap; opacity: .7; font-variant-numeric: tabular-nums; }
.audit-entity { opacity: .6; font-family: var(--mono, monospace); font-size: .78rem; }
.audit-more { padding: 0 .45rem; line-height: 1.4; }
.audit-detail td { background: rgba(127,127,127,.06); }
.audit-meta { display: flex; gap: 1.2rem; flex-wrap: wrap; opacity: .7; font-size: .78rem; margin-bottom: .4rem; }
.audit-json {
  margin: 0; max-height: 16rem; overflow: auto; font-size: .74rem; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word; opacity: .85;
}

/* ── Studio → Öppna: Finder-lik bläddring med riktiga miniatyrer ── */
.studio-open-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.studio-open-actions { display: flex; gap: .5rem; }
.studio-crumb {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--ember, #C2722C);
}
.studio-crumb-here { margin-left: .5rem; opacity: .75; }

/* Folders share the item grid's column sizing so the two rows line up. */
.studio-foldergrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 1rem; margin: .5rem 0 1.6rem;
}
.studio-folderitem { position: relative; }
.studio-folderopen {
  width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: .3rem;
  padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
}
.studio-foldertile {
  display: flex; align-items: center; justify-content: center;
  width: 100%; max-width: 168px; aspect-ratio: 1 / 1;
  border-radius: 10px; border: 1px solid var(--line, rgba(0,0,0,.10));
  background: var(--paper);
}
.studio-folderopen:hover .studio-foldertile { border-color: var(--ember, #C2722C); }
.studio-foldericon { width: 58%; height: auto; color: #E0B25C; display: block; }
.studio-folderitem.is-system .studio-foldericon { color: #A9B3C0; }
.studio-foldername { font-size: .84rem; font-weight: 500; word-break: break-word; }
.studio-foldermeta { font-size: .72rem; opacity: .6; }
.studio-folderitem .studio-folder-del {
  position: absolute; top: 4px; right: 4px; opacity: 0;
  border: 0; background: rgba(127,127,127,.18); border-radius: 50%;
  width: 20px; height: 20px; line-height: 1; cursor: pointer;
}
.studio-folderitem:hover .studio-folder-del { opacity: 1; }

.studio-itemgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 1rem; margin-top: .5rem;
}
.studio-item { display: flex; flex-direction: column; }
.studio-item-open {
  display: flex; flex-direction: column; align-items: flex-start; gap: .3rem;
  padding: 0; border: 0; background: none; cursor: pointer; text-align: left; width: 100%;
}
/* The tile is always 1:1 so the grid lines up; the artboard sits centred
   inside it, keeping its own proportions. */
.studio-thumb {
  display: flex; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 1 / 1; overflow: hidden;
  border-radius: 10px; border: 1px solid var(--line, rgba(0,0,0,.10));
  background: var(--paper);
}
.studio-thumb-stage {
  position: relative; overflow: hidden; border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,.16);
}
.studio-item-open:hover .studio-thumb { border-color: var(--ember, #C2722C); }
.studio-thumb-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.studio-item-name { font-size: .84rem; font-weight: 500; line-height: 1.25; word-break: break-word; }
.studio-item-meta { font-size: .72rem; opacity: .6; }
.studio-item.is-template .studio-thumb { border-style: dashed; }
.studio-item-foot { display: flex; align-items: center; gap: .35rem; margin-top: .35rem; }
.studio-item-foot .studio-docmove { flex: 1; min-width: 0; font-size: .72rem; }

/* Filing by drag: the drop target lights up, and the whole card is the handle. */
.studio-item[draggable="true"] { cursor: grab; }
.studio-item[draggable="true"]:active { cursor: grabbing; }
.studio-folderitem.is-dropping .studio-foldertile {
  background: rgba(194,114,44,.14);
  border-color: var(--ember, #C2722C);
  box-shadow: inset 0 0 0 1px var(--ember, #C2722C);
}
.studio-crumb.is-dropping {
  background: rgba(194,114,44,.14); border-radius: 6px;
  box-shadow: 0 0 0 2px var(--ember, #C2722C);
}

/* The card must not paint a box of its own — anything opaque here becomes a
   white slab behind the cursor while dragging. */
.studio-item, .studio-item-open, .studio-item-foot { background: transparent; }

/* Papperskorg i Öppna-dialogen — tyst tills något dras, sedan tydlig. */
.studio-trash {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .7rem; border-radius: 8px;
  border: 1px dashed rgb(var(--bone-rgb) / .28);
  color: var(--mute, #8a8177); font-size: .76rem;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.studio-trash.is-dropping {
  color: #C7452F; border-color: #C7452F; border-style: solid;
  background: rgba(199,69,47,.12);
}
.studio-trash-l { white-space: nowrap; }

.studio-itemmenu { min-width: 176px; }
.fp-context-item.is-danger { color: #C7452F; }
.fp-context-item.is-danger:hover { background: rgba(199,69,47,.10); }

/* Folder submenu. Anchored to its own row rather than to the viewport: the
   parent menu is already placed correctly, so the child rides along with it. */
.fp-context-sub { position: relative; display: flex; flex-direction: column; }
.fp-context-parent { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.fp-context-sub:hover > .fp-context-parent { background: var(--hover); }
.fp-context-caret { color: var(--mute); font-size: 13px; line-height: 1; }
.fp-context-submenu {
  position: absolute; left: 100%; top: -5px;
  margin-left: 6px;
  max-height: 300px; overflow-y: auto;
  min-width: 168px;
}
.fp-context-sub.is-flipped > .fp-context-submenu { left: auto; right: 100%; margin: 0 6px 0 0; }

/* ── Document windows ───────────────────────────────────────────────────────
   The window body is a desk-toned scroll area; a document inside may cover
   it with its own sheet (the report does, see .rp-doc below). */
.docwin-body { background: color-mix(in srgb, var(--paper-2), var(--ink) 7%); padding: 0 0 40px;
  container-type: inline-size; }
/* Phone shell has no desktop to put a window on — the sheet stays in the app. */
.docwin-sheet { background: #fff; width: 100%; max-width: 680px; padding: 26px 24px 34px;
  border-radius: 14px; box-shadow: 0 24px 70px -20px rgba(15,20,45,.4); }

/* ── Rapportfönstret (ny design, docs/mockups/rapport-ny-design.html) ──────
   The report is a light sheet regardless of the wall tone: its tokens live
   on .rp-doc (not :root) with fixed values, so nothing else in the app moves.
   Every rule below is scoped under .rp-doc. Layout follows the window width
   through the rp-doc container, not the browser viewport. */
.docwin-body:has(> .rp-doc) { background: #fbfaf8; padding: 0; }
.docwin-sheet:has(> .rp-doc) { background: #fbfaf8; padding: 0; overflow: hidden; }
/* Shared with the insight board (.ib-doc, below): tokens, type and paper only. */
.rp-doc, .ib-doc {
  --rp-ink: #1f2228; --rp-ink-2: #3d414a; --rp-muted: #6e727b; --rp-faint: #9a9ea6;
  --rp-line: #e7e5e0; --rp-line-2: #f0eeea; --rp-surface: #ffffff; --rp-paper: #fbfaf8;
  --rp-accent: #3e5c76; --rp-accent-soft: #e9eef2;
  --rp-pos: #3f7558; --rp-pos-bg: #ebf3ee; --rp-neg: #a2493f; --rp-neg-bg: #f7ebe8;
  --rp-neu: #5f636b; --rp-neu-bg: #f0efec;
  --rp-warn: #7d5f22; --rp-warn-bg: #f8f3e7; --rp-warn-line: #e6d6b0;
  --rp-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --rp-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rp-radius: 10px; --rp-radius-sm: 6px; --rp-row: 48px; --rp-lh: 1.6;
  background: var(--rp-paper); color: var(--rp-ink);
  font-family: var(--rp-sans);
  font-feature-settings: "cv11", "ss01";
}
.rp-doc {
  container: rp-doc / inline-size;
  min-height: 100%; color-scheme: light; text-align: left;
  font-size: 15px; line-height: var(--rp-lh);
}
.rp-doc *, .rp-doc *::before, .rp-doc *::after { box-sizing: border-box; }
.rp-doc p { margin: 0; }
.rp-doc td, .rp-doc .rp-kpi-val, .rp-doc .rp-chip, .rp-doc .rp-meta, .rp-doc .rp-axis,
.rp-doc .rp-spark-lbl, .rp-doc .rp-spark-avg, .rp-doc .rp-bar-period, .rp-doc .rp-wsnums {
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum", "cv11";
}

/* Toolbar */
.rp-doc .rp-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 14px;
  padding: 10px 18px 10px 20px; background: var(--rp-surface); border-bottom: 1px solid var(--rp-line); }
.rp-doc .rp-bar-title { font-weight: 600; font-size: 14px; white-space: nowrap; }
.rp-doc .rp-bar-period { flex: 1; min-width: 0; font-size: 13px; color: var(--rp-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-doc .rp-btn { flex: none; font: inherit; font-size: 13px; font-weight: 500; line-height: 1.2;
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--rp-line); background: var(--rp-surface); color: var(--rp-ink); }
.rp-doc .rp-btn.is-primary { background: var(--rp-ink); border-color: var(--rp-ink); color: #fff; }
.rp-doc .rp-btn.is-primary:hover { background: var(--rp-ink-2); }
.rp-doc .rp-btn:focus-visible { outline: 2px solid var(--rp-accent); outline-offset: 2px; }
.rp-doc .rp-btn svg { width: 15px; height: 15px; flex: none; }
.rp-doc .rp-btn:disabled { opacity: .6; cursor: progress; }

/* Sheet and head */
.rp-doc .rp-scr { max-width: 1200px; margin: 0 auto; padding: 48px 64px 40px; }
.rp-doc .rp-state { padding: 30px 0; color: var(--rp-muted); }
.rp-doc .rp-state.is-error { color: var(--rp-neg); }
.rp-doc .rp-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--rp-muted); font-weight: 500; }
.rp-doc .rp-tag { padding: 3px 9px; border-radius: 999px; background: var(--rp-neu-bg); color: var(--rp-ink-2); letter-spacing: .1em; }
.rp-doc .rp-tag.is-lvl { background: var(--rp-accent-soft); color: var(--rp-accent); }
.rp-doc .rp-brand { margin-left: auto; color: var(--rp-faint); }
.rp-doc .rp-title { font-family: var(--rp-serif); font-weight: 500; font-size: 40px; letter-spacing: -.015em;
  line-height: 1.12; margin: 0 0 12px; color: var(--rp-ink); }
.rp-doc .rp-meta { display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 14px; color: var(--rp-muted); margin-bottom: 36px; }
.rp-doc .rp-meta span + span::before { content: "·"; margin: 0 10px; color: var(--rp-faint); }
.rp-doc .rp-lede { border-left: 2px solid var(--rp-accent); padding: 4px 0 4px 22px; margin-bottom: 40px; max-width: 880px; }
.rp-doc .rp-h-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--rp-muted);
  font-weight: 600; margin: 0 0 6px; }
.rp-doc .rp-headline { font-family: var(--rp-serif); font-weight: 400; font-size: 21px; line-height: 1.5;
  letter-spacing: -.005em; color: var(--rp-ink); }

/* KPI cards */
.rp-doc .rp-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 56px; }
.rp-doc .rp-kpi { display: flex; flex-direction: column; gap: 12px; min-height: 150px; padding: 22px 24px 20px;
  background: var(--rp-surface); border: 1px solid var(--rp-line); border-radius: var(--rp-radius); }
.rp-doc .rp-kpi-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--rp-muted); font-weight: 500; }
.rp-doc .rp-kpi-val { font-size: 34px; font-weight: 500; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; color: var(--rp-ink); }
.rp-doc .rp-kpi-val small { font-size: .5em; font-weight: 500; color: var(--rp-muted); letter-spacing: 0; margin-left: 3px; }
.rp-doc .rp-kpi-sub { font-size: 12.5px; color: var(--rp-muted); line-height: 1.45; margin-top: auto; }
.rp-doc .rp-kpi-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.rp-doc .rp-kpi-foot .rp-kpi-sub { margin-top: 0; }
.rp-doc .rp-mix { display: flex; height: 4px; margin-top: 2px; border-radius: 2px; overflow: hidden; background: var(--rp-line-2); gap: 2px; }
.rp-doc .rp-mix i { display: block; height: 100%; }

/* Delta chips: text first, desaturated, coloured by good/bad for the KPI */
.rp-doc .rp-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 500;
  line-height: 1; padding: 4px 7px; border-radius: 999px; white-space: nowrap; }
.rp-doc .rp-chip.is-pos { color: var(--rp-pos); background: var(--rp-pos-bg); }
.rp-doc .rp-chip.is-neg { color: var(--rp-neg); background: var(--rp-neg-bg); }
.rp-doc .rp-chip.is-neu { color: var(--rp-neu); background: var(--rp-neu-bg); }
.rp-doc .rp-chip.is-nil { color: var(--rp-faint); background: transparent; padding-left: 0; padding-right: 0; }
.rp-doc .rp-chip-ar { font-size: 8px; transform: translateY(-.5px); }

/* Sections */
.rp-doc .rp-block { margin-bottom: 52px; }
.rp-doc .rp-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--rp-line); padding-bottom: 12px; margin-bottom: 4px; }
.rp-doc .rp-sec { font-family: var(--rp-serif); font-weight: 500; font-size: 22px; letter-spacing: -.01em;
  line-height: 1.25; margin: 0; color: var(--rp-ink); }
.rp-doc .rp-aside { font-size: 12.5px; color: var(--rp-muted); text-align: right; }
.rp-doc .rp-prose { color: var(--rp-ink-2); font-size: 16px; line-height: 1.65; max-width: 680px; }
.rp-doc .rp-prose p + p { margin-top: .9em; }
.rp-doc .rp-prose.is-top { margin-top: 18px; }
.rp-doc .rp-subs.is-after { margin-top: 40px; }
.rp-doc .rp-sub-sec + .rp-sub-sec { margin-top: 32px; }
.rp-doc .rp-sub-sec h3 { font-family: var(--rp-serif); font-weight: 500; font-size: 18px; line-height: 1.35;
  margin: 0 0 8px; color: var(--rp-ink); }
.rp-doc .rp-wsnums { margin-top: 8px; font-size: 13px; color: var(--rp-muted); }
.rp-doc .rp-two { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; align-items: start; }
.rp-doc .rp-note { margin-top: 12px; font-size: 12.5px; color: var(--rp-muted); line-height: 1.5; }
.rp-doc .rp-ai-note { margin: -20px 0 28px; font-size: 12.5px; color: var(--rp-muted); }

/* Tables */
.rp-doc .rp-tablewrap { overflow-x: auto; }
.rp-doc .rp-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.rp-doc .rp-table th { padding: 14px 16px 10px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--rp-muted); font-weight: 500; text-align: left; border-bottom: 1px solid var(--rp-line); white-space: nowrap; background: none; }
.rp-doc .rp-table td { height: var(--rp-row); padding: 0 16px; border-bottom: 1px solid var(--rp-line-2);
  color: var(--rp-ink); vertical-align: middle; text-align: left; background: none; }
.rp-doc .rp-table th:first-child, .rp-doc .rp-table td:first-child { padding-left: 0; }
.rp-doc .rp-table th:last-child, .rp-doc .rp-table td:last-child { padding-right: 0; }
.rp-doc .rp-table th.num, .rp-doc .rp-table td.num { text-align: right; white-space: nowrap; }
.rp-doc .rp-table tr.is-total td { border-bottom: none; border-top: 1px solid var(--rp-line); color: var(--rp-ink-2); font-weight: 500; }
.rp-doc .rp-table.is-loose td { height: auto; padding-top: 12px; padding-bottom: 12px; vertical-align: top; }
.rp-doc .rp-ch { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; white-space: nowrap; }
.rp-doc .rp-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.rp-doc .rp-cell { display: inline-flex; align-items: center; justify-content: flex-end; gap: 10px; }
.rp-doc .rp-none { color: var(--rp-faint); }
.rp-doc .rp-camp-name { font-weight: 500; }
.rp-doc .rp-table td.rp-camp-name { padding-top: 8px; padding-bottom: 8px; }
.rp-doc .rp-sub { display: block; font-weight: 400; font-size: 12px; color: var(--rp-muted); }

/* Sparkline */
.rp-doc .rp-spark { position: relative; margin-top: 22px; }
.rp-doc .rp-spark svg { display: block; width: 100%; height: auto; overflow: visible; }
.rp-doc .rp-spark-lbl { position: absolute; transform: translate(-50%, -150%); font-size: 11.5px; color: var(--rp-ink-2);
  background: var(--rp-surface); padding: 1px 6px; border-radius: 4px; white-space: nowrap; border: 1px solid var(--rp-line); line-height: 1.5; }
.rp-doc .rp-spark-lbl.is-min { transform: translate(-50%, 45%); }
.rp-doc .rp-spark-avg { position: absolute; right: 0; transform: translateY(25%); font-size: 11px; color: var(--rp-muted);
  background: var(--rp-paper); padding: 0 1px 0 6px; line-height: 1.5; white-space: nowrap; }
.rp-doc .rp-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--rp-faint); margin-top: 8px; }

/* Highlights */
.rp-doc .rp-hl { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 10px; }
.rp-doc .rp-hl li { padding: 12px 14px; font-size: 14px; line-height: 1.5; color: var(--rp-ink);
  border: 1px solid var(--rp-line); border-radius: var(--rp-radius-sm); background: var(--rp-surface); }
.rp-doc .rp-hl-k { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--rp-muted); font-weight: 500; margin-bottom: 2px; }

/* Ratings (levels 1, 2 and 5) */
.rp-doc .rp-ratings td:first-child { width: 32%; }
.rp-doc .rp-stars { letter-spacing: 1px; font-size: 13px; line-height: 1; white-space: nowrap; }
.rp-doc .rp-stars-on { color: var(--rp-accent); }
.rp-doc .rp-stars-off { color: var(--rp-line); }
.rp-doc .rp-verdict { display: inline-block; font-size: 10.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; white-space: nowrap; color: var(--rp-neu); background: var(--rp-neu-bg); }
.rp-doc .rp-verdict.is-go { color: var(--rp-pos); background: var(--rp-pos-bg); }
.rp-doc .rp-verdict.is-cut { color: var(--rp-neg); background: var(--rp-neg-bg); }
.rp-doc .rp-why { color: var(--rp-ink-2); font-size: 14px; line-height: 1.55; }

/* Analysis */
.rp-doc .rp-an-grid { display: grid; gap: 40px; margin-top: 22px; }
.rp-doc .rp-an-grid.is-3 { grid-template-columns: 1fr 1.25fr 1fr; }
.rp-doc .rp-an-grid.is-2 { grid-template-columns: 1fr 1fr; }
.rp-doc .rp-an h3 { font-family: var(--rp-sans); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--rp-muted); font-weight: 600; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--rp-line); }
.rp-doc .rp-an ol { margin: 0; padding: 0; list-style: none; counter-reset: rp-n; }
.rp-doc .rp-an ol li { counter-increment: rp-n; position: relative; padding-left: 30px; font-size: 14.5px; line-height: 1.6; color: var(--rp-ink-2); }
.rp-doc .rp-an ol li::before { content: counter(rp-n, decimal-leading-zero); position: absolute; left: 0; top: 3px;
  font-size: 11.5px; color: var(--rp-faint); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.rp-doc .rp-an li + li { margin-top: 16px; }
.rp-doc .rp-eff, .rp-doc .rp-reason { display: block; font-size: 13px; margin-top: 4px; color: var(--rp-muted); }
.rp-doc .rp-eff b { font-weight: 500; color: var(--rp-pos); }
.rp-doc .rp-ideas { margin: 0; padding: 0; list-style: none; }
.rp-doc .rp-ideas li { position: relative; padding-left: 20px; font-size: 14.5px; line-height: 1.6; color: var(--rp-ink-2); }
.rp-doc .rp-ideas li::before { content: ""; position: absolute; left: 0; top: 9px; width: 6px; height: 6px;
  border: 1.5px solid var(--rp-accent); border-radius: 50%; }

/* Risks: a quiet amber list */
.rp-doc .rp-risks { list-style: none; margin: 18px 0 0; padding: 0; max-width: 880px; }
.rp-doc .rp-risks li { font-size: 14.5px; line-height: 1.55; color: var(--rp-ink-2); padding: 10px 14px 10px 16px;
  background: var(--rp-warn-bg); border-left: 2px solid var(--rp-warn-line); border-radius: 0 var(--rp-radius-sm) var(--rp-radius-sm) 0; }
.rp-doc .rp-risks li + li { margin-top: 8px; }

.rp-doc .rp-foot { display: flex; justify-content: space-between; gap: 12px; padding-top: 18px; margin-top: 8px;
  border-top: 1px solid var(--rp-line); font-size: 12px; color: var(--rp-faint); }

/* Narrower windows */
@container rp-doc (max-width: 1240px) {
  .rp-doc .rp-scr { padding: 40px 44px 36px; }
  .rp-doc .rp-two { grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; }
  .rp-doc .rp-an-grid { gap: 28px; }
}
@container rp-doc (max-width: 1160px) {
  /* Stack the delta chip under the value instead of letting it wrap. */
  .rp-doc .rp-cell { flex-direction: column; align-items: flex-end; gap: 4px; }
  .rp-doc .rp-table tr:has(.rp-cell) td { height: 60px; }
}
@container rp-doc (max-width: 900px) {
  .rp-doc .rp-two { grid-template-columns: 1fr; gap: 36px; }
  .rp-doc .rp-hl { grid-template-columns: 1fr 1fr; }
  .rp-doc .rp-an-grid.is-3, .rp-doc .rp-an-grid.is-2 { grid-template-columns: 1fr; gap: 32px; }
  .rp-doc .rp-title { font-size: 34px; }
}
@container rp-doc (max-width: 680px) {
  .rp-doc .rp-scr { padding: 28px 20px 28px; }
  .rp-doc .rp-kpis { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 40px; }
  .rp-doc .rp-kpi { min-height: 0; padding: 16px 16px 14px; }
  .rp-doc .rp-kpi-val { font-size: 26px; }
  .rp-doc .rp-title { font-size: 28px; }
  .rp-doc .rp-headline { font-size: 18px; }
  .rp-doc .rp-hl { grid-template-columns: 1fr; }
  .rp-doc .rp-bar-title { display: none; }
  .rp-doc .rp-ratings td:first-child { width: auto; }
}

/* ── Insiktstavlan (ny design, docs/mockups/insiktstavla-ny-design.html) ────
   Shares the report's tokens and type (.rp-doc, .ib-doc above). The board is a
   light sheet inside the AI Marketing Team window; the detail panel is its own
   .ib-doc in a DocWindow. Every rule is scoped under .ib-doc and narrow
   windows follow the ib-doc container, not the viewport. Type markers are
   small dots only, never filled labels. */
.docwin-body:has(> .ib-doc) { background: #fbfaf8; padding: 0; }
.docwin-sheet:has(> .ib-doc) { background: #fbfaf8; padding: 0; overflow: hidden; }
.ib-doc {
  --ib-t-opportunity: #3e5c76; --ib-t-ad_action: #b0823c; --ib-t-risk: #a2493f;
  --ib-t-performance: #3f7558; --ib-t-brand: #7d6690; --ib-t-trend: #8aa3b8;
  --ib-t-competitor: #9c6a52; --ib-t-goal_review: #8a8455;
  --ib-focus: 0 0 0 2px var(--rp-surface), 0 0 0 4px var(--rp-accent);
  --ib-ease: cubic-bezier(.2, .7, .2, 1);
  container: ib-doc / inline-size;
  position: relative; color-scheme: light; text-align: left;
  font-size: 14.5px; line-height: 1.55;
  border: 1px solid var(--rp-line); border-radius: 14px;
  /* A container query cannot restyle its own container, so the side padding
     follows the page width directly. */
  padding: 36px clamp(18px, 4%, 48px) 28px;
}
.ib-doc *, .ib-doc *::before, .ib-doc *::after { box-sizing: border-box; }
.ib-doc p { margin: 0; }
.ib-doc button { font: inherit; color: inherit; }
.ib-doc :focus { outline: none; }
.ib-doc :focus-visible { box-shadow: var(--ib-focus); border-radius: 6px; }
.ib-doc .ib-tnum, .ib-doc .ib-big { font-variant-numeric: tabular-nums; font-feature-settings: "tnum", "cv11"; }
.ib-doc .ib-nowrap { white-space: nowrap; }

/* Buttons and the view switch */
.ib-doc .ib-btn { font-size: 13px; font-weight: 500; line-height: 1.2; display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 8px; border: 1px solid var(--rp-line); background: var(--rp-surface);
  color: var(--rp-ink); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.ib-doc .ib-btn:hover { border-color: #d6d3cc; background: #fdfcfb; }
.ib-doc .ib-btn.is-primary { background: var(--rp-ink); border-color: var(--rp-ink); color: #fff; }
.ib-doc .ib-btn.is-primary:hover { background: #33363d; }
.ib-doc .ib-btn.is-ghost { border-color: transparent; background: transparent; color: var(--rp-muted); padding-left: 9px; padding-right: 9px; }
.ib-doc .ib-btn.is-ghost:hover { color: var(--rp-ink); background: var(--rp-line-2); }
.ib-doc .ib-btn.is-sm { font-size: 12.5px; padding: 5px 10px; }
.ib-doc .ib-btn:disabled { opacity: .55; cursor: default; }
.ib-doc .ib-link { all: unset; cursor: pointer; color: var(--rp-accent); font-weight: 500; }
.ib-doc .ib-link:hover { text-decoration: underline; }
.ib-doc .ib-seg { display: inline-flex; padding: 3px; background: var(--rp-line-2); border-radius: 9px; gap: 2px; }
.ib-doc .ib-seg button { border: 0; background: transparent; padding: 5px 13px; border-radius: 7px; font-size: 13px; color: var(--rp-muted); cursor: pointer; }
.ib-doc .ib-seg button[aria-selected="true"] { background: var(--rp-surface); color: var(--rp-ink); box-shadow: 0 1px 2px rgba(20,22,28,.08); font-weight: 500; }

/* Head */
.ib-doc .ib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 20px; flex-wrap: wrap; margin-bottom: 26px; }
.ib-doc .ib-head-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ib-doc .ib-title { font-family: var(--rp-serif); font-weight: 500; font-size: 32px; letter-spacing: -.015em; line-height: 1.15; margin: 0 0 6px; color: var(--rp-ink); }
.ib-doc .ib-meta { color: var(--rp-muted); font-size: 13.5px; display: flex; flex-wrap: wrap; }
.ib-doc .ib-meta span + span::before { content: "·"; margin: 0 9px; color: var(--rp-faint); }
.ib-doc .ib-calm { margin: -12px 0 22px; font-size: 13px; color: var(--rp-muted); }

.ib-doc .ib-banner { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  border-left: 2px solid var(--rp-warn); padding: 4px 0 4px 16px; margin: 0 0 30px; color: var(--rp-ink-2); font-size: 14px; }
.ib-doc .ib-banner-txt { flex: 1; min-width: 260px; }
.ib-doc .ib-banner b { font-weight: 600; color: var(--rp-ink); }
.ib-doc .ib-banner-sub { color: var(--rp-muted); font-size: 13px; }

.ib-doc .ib-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--rp-line); margin-bottom: 4px; }
.ib-doc .ib-sec { font-family: var(--rp-serif); font-weight: 500; font-size: 21px; letter-spacing: -.01em; margin: 0; color: var(--rp-ink); }
.ib-doc .ib-aside { font-size: 12.5px; color: var(--rp-muted); text-align: right; font-family: var(--rp-sans); font-weight: 400; }
.ib-doc .ib-block { margin-bottom: 40px; }

/* Type dots, age tag, avatars */
.ib-doc .ib-tdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--rp-faint); }
.ib-doc .ib-tdot.is-opportunity { background: var(--ib-t-opportunity); }
.ib-doc .ib-tdot.is-ad_action { background: var(--ib-t-ad_action); }
.ib-doc .ib-tdot.is-risk { background: var(--ib-t-risk); }
.ib-doc .ib-tdot.is-performance { background: var(--ib-t-performance); }
.ib-doc .ib-tdot.is-brand { background: var(--ib-t-brand); }
.ib-doc .ib-tdot.is-trend { background: var(--ib-t-trend); }
.ib-doc .ib-tdot.is-competitor { background: var(--ib-t-competitor); }
.ib-doc .ib-tdot.is-goal_review { background: var(--ib-t-goal_review); }
.ib-doc .ib-old { font-size: 11.5px; color: var(--rp-warn); font-weight: 500; white-space: nowrap; }
.ib-doc .ib-old::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--rp-warn);
  margin-right: 6px; transform: translateY(-1px); }
.ib-doc .ib-avs { display: inline-flex; }
.ib-doc .ib-av { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 9px; font-weight: 600;
  letter-spacing: 0; color: var(--rp-ink-2); border: 2px solid var(--rp-paper); background: var(--rp-neu-bg); vertical-align: middle; flex: none; }
.ib-doc .ib-av + .ib-av { margin-left: -6px; }
.ib-doc .ib-av.r-mkt_content { background: #e4ebf1; color: #34506a; }
.ib-doc .ib-av.r-mkt_channel { background: #f2e9da; color: #7a5a24; }
.ib-doc .ib-av.r-mkt_brand_guard { background: #ece6f0; color: #5f4a70; }
.ib-doc .ib-av.r-mkt_strategist { background: #e3eee7; color: #335f47; }
.ib-doc .ib-av.r-mkt_market { background: #eeeae4; color: #5a5348; }
.ib-doc .ib-av.r-mkt_competitor { background: #f3e6df; color: #7a4a36; }
.ib-doc .ib-av.r-mkt_some_scout { background: #f0e4ea; color: #6e3b52; }
.ib-doc .ib-av.r-mkt_campaign { background: #e1edec; color: #2f5d5a; }

/* Today: three ranked next steps */
.ib-doc .ib-today { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ib-doc .ib-step { padding: 22px 26px 22px 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ib-doc .ib-step + .ib-step { padding-left: 26px; border-left: 1px solid var(--rp-line); }
.ib-doc .ib-rank { font-size: 12px; color: var(--rp-faint); letter-spacing: .06em; display: flex; align-items: center; gap: 8px; }
.ib-doc .ib-rank .ib-tdot { margin-left: 2px; }
.ib-doc .ib-step-h { margin: 0; font-family: var(--rp-serif); font-weight: 500; font-size: 20px; line-height: 1.3; letter-spacing: -.008em; color: var(--rp-ink); }
.ib-doc .ib-step-h button { all: unset; cursor: pointer; }
.ib-doc .ib-step-h button:hover { text-decoration: underline; text-decoration-color: var(--rp-line); text-underline-offset: 4px; }
.ib-doc .ib-step-h button:focus-visible { box-shadow: var(--ib-focus); border-radius: 4px; }
.ib-doc .ib-why { color: var(--rp-ink-2); font-size: 14px; line-height: 1.55; }
.ib-doc .ib-facts { display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 12.5px; color: var(--rp-muted); }
.ib-doc .ib-facts span + span::before { content: "·"; margin: 0 8px; color: var(--rp-faint); }
.ib-doc .ib-facts b { font-weight: 500; color: var(--rp-ink-2); }
.ib-doc .ib-facts .ib-nosep { margin-left: 12px; }
.ib-doc .ib-facts .ib-nosep::before, .ib-doc .ib-facts .ib-nosep span::before { content: none; }
.ib-doc .ib-facts .ib-nosep .ib-old::before { content: ""; }
.ib-doc .ib-step-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.ib-doc .ib-reasons { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--rp-muted); }

/* Overview: four filter tiles */
.ib-doc .ib-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 40px; }
.ib-doc .ib-tile { text-align: left; border: 1px solid var(--rp-line); background: var(--rp-surface); border-radius: var(--rp-radius);
  padding: 14px 16px 13px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.ib-doc .ib-tile:hover { border-color: #d6d3cc; }
.ib-doc .ib-tile[aria-pressed="true"] { border-color: var(--rp-ink); box-shadow: inset 0 0 0 1px var(--rp-ink); }
.ib-doc .ib-tile:focus-visible { box-shadow: var(--ib-focus); border-radius: var(--rp-radius); }
.ib-doc .ib-k { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--rp-muted); font-weight: 500; display: flex; align-items: center; gap: 7px; }
.ib-doc .ib-big { font-size: 28px; font-weight: 500; letter-spacing: -.02em; line-height: 1.15; color: var(--rp-ink); white-space: nowrap; }
.ib-doc .ib-big small { font-size: 13px; color: var(--rp-muted); font-weight: 500; letter-spacing: 0; margin-left: 4px; }
.ib-doc .ib-s { font-size: 12.5px; color: var(--rp-muted); line-height: 1.4; }
.ib-doc .ib-tile.is-money .ib-pair { display: flex; gap: 4px 18px; align-items: baseline; flex-wrap: wrap; }
.ib-doc .ib-tile.is-money .ib-big { font-size: 22px; }
.ib-doc .ib-lbl { display: block; font-size: 12px; color: var(--rp-muted); margin-top: 1px; }
.ib-doc .ib-up { color: var(--rp-ink-2); }
.ib-doc .ib-filternote { display: flex; align-items: center; gap: 10px; margin: -24px 0 22px; font-size: 13px; color: var(--rp-muted); }

/* Theme rows */
.ib-doc .ib-group { margin-top: 28px; }
.ib-doc .ib-group:first-of-type { margin-top: 18px; }
.ib-doc .ib-group-h { display: flex; align-items: baseline; gap: 10px; margin: 0 0 4px; }
.ib-doc .ib-group-h h4 { margin: 0; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--rp-ink-2); font-weight: 600; }
.ib-doc .ib-group-n { font-size: 12px; color: var(--rp-faint); }
.ib-doc .ib-group-d { font-size: 12.5px; color: var(--rp-muted); margin-left: auto; }
.ib-doc .ib-rows { list-style: none; margin: 0; padding: 0; }
.ib-doc .ib-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) 118px 150px 92px 16px; gap: 0 20px; align-items: center;
  padding: 14px 10px 14px 8px; margin: 0 -10px 0 -8px; border-bottom: 1px solid var(--rp-line-2); cursor: pointer;
  border-radius: 8px; transition: background .15s; }
.ib-doc .ib-row:hover { background: var(--rp-surface); }
.ib-doc .ib-row:focus-visible { box-shadow: var(--ib-focus); }
.ib-doc .ib-row-main { min-width: 0; }
.ib-doc .ib-row-sub { display: contents; }
.ib-doc .ib-row-t { font-weight: 500; color: var(--rp-ink); display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; }
.ib-doc .ib-row-nx { color: var(--rp-ink-2); font-size: 13.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-doc .ib-row-nxl { color: var(--rp-muted); }
.ib-doc .ib-row-ie { font-size: 12.5px; color: var(--rp-muted); line-height: 1.5; display: flex; flex-direction: column; }
.ib-doc .ib-row-ie b { font-weight: 500; color: var(--rp-ink-2); }
.ib-doc .ib-row-who { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--rp-muted); }
.ib-doc .ib-row-when { font-size: 12.5px; color: var(--rp-muted); text-align: right; white-space: nowrap; }
.ib-doc .ib-row-chev { color: var(--rp-faint); font-size: 14px; }
.ib-doc .ib-empty-list { color: var(--rp-muted); font-size: 14px; padding: 18px 0 4px; }
.ib-doc .ib-empty { color: var(--rp-ink-2); font-size: 14.5px; padding: 8px 0 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.ib-doc .ib-empty b { font-weight: 600; color: var(--rp-ink); }

/* Maybe stale */
.ib-doc .ib-fold { border-top: 1px solid var(--rp-line); margin-top: 36px; }
.ib-doc .ib-fold-sum { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: flex; align-items: baseline; gap: 10px;
  padding: 16px 0 12px; font-family: var(--rp-serif); font-size: 18px; font-weight: 500; color: var(--rp-ink); }
.ib-doc .ib-fold-sum:focus-visible { box-shadow: var(--ib-focus); border-radius: 6px; }
.ib-doc .ib-fold-sum .ib-aside { margin-left: auto; }
.ib-doc .ib-fold-car { display: inline-block; width: 14px; color: var(--rp-muted); font-family: var(--rp-sans); transition: transform .2s; }
.ib-doc .ib-fold-sum[aria-expanded="true"] .ib-fold-car { transform: rotate(90deg); }
.ib-doc .ib-fold-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; font-size: 13px; color: var(--rp-muted); margin-bottom: 4px; }

/* Matrix */
.ib-doc .ib-matrix { display: grid; grid-template-columns: 26px 1fr 1fr; grid-template-rows: auto auto 26px; margin-top: 18px; }
.ib-doc .ib-ylab { grid-column: 1; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--rp-muted); display: flex; align-items: center; justify-content: center; }
.ib-doc .ib-xlab { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--rp-muted); text-align: center; padding-top: 8px; }
.ib-doc .ib-quad { border: 1px solid var(--rp-line); background: var(--rp-paper); padding: 16px 18px 20px; min-height: 210px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ib-doc .ib-quad.q1 { border-radius: var(--rp-radius) 0 0 0; border-right: 0; border-bottom: 0; background: var(--rp-surface); }
.ib-doc .ib-quad.q2 { border-radius: 0 var(--rp-radius) 0 0; border-bottom: 0; }
.ib-doc .ib-quad.q3 { border-radius: 0 0 0 var(--rp-radius); border-right: 0; }
.ib-doc .ib-quad.q4 { border-radius: 0 0 var(--rp-radius) 0; }
.ib-doc .ib-quad h4 { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--rp-ink-2); display: flex; justify-content: space-between; gap: 10px; }
.ib-doc .ib-quad h4 span { font-weight: 400; color: var(--rp-muted); white-space: nowrap; }
.ib-doc .ib-bubbles { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.ib-doc .ib-bub { all: unset; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; color: var(--rp-ink);
  padding: 3px 6px 3px 3px; border-radius: 999px; max-width: 100%; transition: opacity .15s; }
.ib-doc .ib-bub:hover { background: var(--rp-line-2); }
.ib-doc .ib-bub:focus-visible { box-shadow: var(--ib-focus); }
.ib-doc .ib-bub-c { border-radius: 50%; flex: none; background: var(--rp-accent); display: inline-grid; place-items: center; color: #fff; font-size: 10.5px; font-weight: 600; }
.ib-doc .ib-bub-lb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-doc .ib-bub.is-dim { opacity: .28; }
.ib-doc .ib-none { color: var(--rp-faint); font-size: 13px; }
.ib-doc .ib-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; font-size: 12.5px; color: var(--rp-muted); margin-top: 14px; }
.ib-doc .ib-legend span { display: inline-flex; align-items: center; gap: 7px; }
.ib-doc .ib-legend i { display: inline-block; border-radius: 50%; background: var(--rp-accent); }

/* All insights */
.ib-doc .ib-tablewrap { overflow-x: auto; }
.ib-doc .ib-all { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 760px; margin-top: 6px; }
.ib-doc .ib-all th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--rp-muted); font-weight: 500; text-align: left;
  border-bottom: 1px solid var(--rp-line); padding: 0; white-space: nowrap; }
.ib-doc .ib-all th button { all: unset; cursor: pointer; padding: 10px 8px 8px; display: inline-flex; gap: 5px; align-items: center; }
.ib-doc .ib-all th button:focus-visible { box-shadow: var(--ib-focus); border-radius: 4px; }
.ib-doc .ib-ar { font-size: 9px; color: var(--rp-faint); width: 8px; }
.ib-doc .ib-all th[aria-sort] .ib-ar { color: var(--rp-ink); }
.ib-doc .ib-all td { border-bottom: 1px solid var(--rp-line-2); padding: 9px 8px; vertical-align: middle; color: var(--rp-ink-2); }
.ib-doc .ib-all td.num, .ib-doc .ib-all th.num { text-align: right; }
.ib-doc .ib-all th.num button { justify-content: flex-end; }
.ib-doc .ib-all tbody tr { cursor: pointer; }
.ib-doc .ib-all tbody tr:hover td { background: var(--rp-surface); }
.ib-doc .ib-all tbody tr:focus-visible { outline: 2px solid var(--rp-accent); outline-offset: -2px; }
.ib-doc .ib-all td.ib-ty { white-space: nowrap; }
.ib-doc .ib-all td.ib-tm { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-doc .ib-ttl { color: var(--rp-ink); max-width: 250px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-doc .ib-st { font-size: 12px; color: var(--rp-muted); white-space: nowrap; }
.ib-doc .ib-all tr.is-handled td { color: var(--rp-faint); }
.ib-doc .ib-all tr.is-handled .ib-ttl { color: var(--rp-muted); }
.ib-doc .ib-all tr.is-dim { opacity: .35; }

/* Toast: sticks to the bottom of the window's scroll area */
.ib-doc .ib-toastdock { position: sticky; bottom: 18px; height: 0; z-index: 5; display: flex; justify-content: center; pointer-events: none; }
.ib-doc .ib-toast { position: absolute; bottom: 0; pointer-events: auto; overflow: hidden;
  background: var(--rp-ink); color: #fff; border-radius: 10px; padding: 10px 10px 10px 16px; font-size: 13.5px;
  display: flex; align-items: center; gap: 14px; max-width: min(620px, calc(100% - 32px));
  box-shadow: 0 10px 30px rgba(20,22,28,.25); animation: ib-toast-in .25s var(--ib-ease); }
.ib-doc .ib-toast-msg { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-doc .ib-toast button { flex: none; border: 0; background: rgba(255,255,255,.12); color: #fff; border-radius: 7px; padding: 5px 11px;
  cursor: pointer; font-weight: 500; font-size: 13px; }
.ib-doc .ib-toast button:hover { background: rgba(255,255,255,.2); }
.ib-doc .ib-toast-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: rgba(255,255,255,.45);
  transform-origin: left; animation: ib-shrink 5s linear forwards; }
@keyframes ib-toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes ib-shrink { to { transform: scaleX(0); } }

/* Detail panel (its own .ib-doc inside a DocWindow) */
.ib-doc.ib-panel { border: 0; border-radius: 0; padding: 0; min-height: 100%; display: flex; flex-direction: column; }
.ib-doc .ib-dr-head { padding: 18px 26px 16px; border-bottom: 1px solid var(--rp-line); background: var(--rp-surface); }
.ib-doc .ib-dr-top { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--rp-muted); }
.ib-doc .ib-dr-title { font-family: var(--rp-serif); font-weight: 500; font-size: 23px; line-height: 1.25; letter-spacing: -.01em; margin: 8px 0 6px; color: var(--rp-ink); }
.ib-doc .ib-dr-head .ib-facts { font-size: 13px; }
.ib-doc .ib-dr-body { flex: 1; padding: 22px 26px 30px; }
.ib-doc .ib-dr-body h3 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--rp-muted); font-weight: 600; margin: 26px 0 8px; }
.ib-doc .ib-dr-body h3:first-child { margin-top: 0; }
.ib-doc .ib-from { font-size: 12px; color: var(--rp-faint); font-weight: 400; letter-spacing: 0; text-transform: none; margin-left: 6px; }
.ib-doc .ib-lead { font-size: 15px; color: var(--rp-ink-2); line-height: 1.6; }
.ib-doc .ib-rec { border-left: 2px solid var(--rp-accent); padding: 2px 0 2px 14px; color: var(--rp-ink); font-size: 14.5px; line-height: 1.6; }
.ib-doc .ib-det { color: var(--rp-ink-2); font-size: 14px; line-height: 1.6; }
.ib-doc .ib-props { width: 100%; border-collapse: collapse; font-size: 13px; }
.ib-doc .ib-props th { text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--rp-muted); font-weight: 500;
  padding: 0 8px 6px 0; border-bottom: 1px solid var(--rp-line); white-space: nowrap; }
.ib-doc .ib-props td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--rp-line-2); vertical-align: top; color: var(--rp-ink-2); }
.ib-doc .ib-props td.ib-amt { white-space: nowrap; color: var(--rp-ink); }
.ib-doc .ib-cn { color: var(--rp-ink); font-weight: 500; }
.ib-doc .ib-sub { display: block; font-size: 12px; color: var(--rp-muted); margin-top: 2px; line-height: 1.45; }
.ib-doc .ib-props-note { font-size: 12px; color: var(--rp-muted); margin-top: 8px; }
.ib-doc .ib-ev { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.ib-doc .ib-ev li { padding: 5px 0; display: flex; gap: 10px; align-items: baseline; }
.ib-doc .ib-ev li::before { content: "↗"; color: var(--rp-faint); font-size: 11px; flex: none; width: 12px; }
.ib-doc .ib-ev li.is-int::before { content: "·"; font-size: 15px; }
.ib-doc .ib-ev a { color: var(--rp-accent); text-decoration: none; overflow-wrap: anywhere; }
.ib-doc .ib-ev a:hover { text-decoration: underline; }
.ib-doc .ib-src { font-size: 11.5px; color: var(--rp-faint); margin-left: auto; white-space: nowrap; padding-left: 10px; }
.ib-doc .ib-members { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rp-line-2); }
.ib-doc .ib-members li { border-bottom: 1px solid var(--rp-line-2); }
.ib-doc .ib-mh { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 44px 1fr auto; gap: 4px 10px;
  padding: 11px 4px; cursor: pointer; align-items: baseline; }
.ib-doc .ib-mh:focus-visible { box-shadow: var(--ib-focus); border-radius: 6px; }
.ib-doc .ib-mh:hover { background: var(--rp-surface); }
.ib-doc .ib-mh-no { font-size: 12.5px; color: var(--rp-muted); }
.ib-doc .ib-mh-t { font-size: 13.5px; color: var(--rp-ink); line-height: 1.45; }
.ib-doc .ib-mh-tg { font-size: 12px; color: var(--rp-faint); }
.ib-doc .ib-mh-m { grid-column: 2 / 4; font-size: 12px; color: var(--rp-muted); display: flex; flex-wrap: wrap; align-items: center; }
.ib-doc .ib-mh-m > span + span::before { content: "·"; margin: 0 7px; color: var(--rp-faint); }
.ib-doc .ib-mh-m .ib-tdot { width: 7px; height: 7px; margin-right: 2px; }
.ib-doc .ib-mb { padding: 0 4px 14px 58px; font-size: 13.5px; color: var(--rp-ink-2); line-height: 1.6; display: grid; gap: 8px; }
.ib-doc .ib-mb b { font-weight: 600; color: var(--rp-ink); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; display: block; margin-bottom: 1px; }
.ib-doc .ib-dr-foot { position: sticky; bottom: 0; border-top: 1px solid var(--rp-line); background: var(--rp-surface);
  padding: 14px 26px 16px; display: flex; flex-direction: column; gap: 10px; }
.ib-doc .ib-r1 { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ib-doc .ib-sp { flex: 1; }
.ib-doc .ib-grp { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--rp-muted); }
.ib-doc .ib-handled { color: var(--rp-muted); font-size: 13px; }

/* Narrow windows: the board's own width, not the viewport */
@container ib-doc (max-width: 1130px) {
  .ib-doc .ib-row { grid-template-columns: 14px minmax(0, 1fr) 110px 140px 80px 16px; gap: 0 14px; }
}
@container ib-doc (max-width: 990px) {
  .ib-doc .ib-today { grid-template-columns: 1fr; }
  .ib-doc .ib-step { padding: 18px 0; }
  .ib-doc .ib-step + .ib-step { padding-left: 0; border-left: 0; border-top: 1px solid var(--rp-line); }
  .ib-doc .ib-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ib-doc .ib-row { grid-template-columns: 14px minmax(0, 1fr) auto 16px; grid-template-areas: "dot main when chev" ". sub sub ."; gap: 4px 12px; }
  .ib-doc .ib-row > .ib-tdot { grid-area: dot; align-self: start; margin-top: 7px; }
  .ib-doc .ib-row-main { grid-area: main; }
  .ib-doc .ib-row-when { grid-area: when; align-self: start; }
  .ib-doc .ib-row-chev { grid-area: chev; align-self: start; }
  .ib-doc .ib-row-sub { grid-area: sub; display: flex; gap: 6px 18px; align-items: center; flex-wrap: wrap; }
  .ib-doc .ib-row-ie { flex-direction: row; gap: 0; }
  .ib-doc .ib-row-ie span + span::before { content: "·"; margin: 0 7px; color: var(--rp-faint); }
}
@container ib-doc (max-width: 640px) {
  .ib-doc .ib-title { font-size: 28px; }
  .ib-doc .ib-sec-head { flex-wrap: wrap; }
  .ib-doc .ib-sec-head .ib-aside { text-align: left; }
  .ib-doc .ib-group-d { display: none; }
  .ib-doc .ib-matrix { grid-template-columns: 22px minmax(0, 1fr); grid-template-rows: none; }
  .ib-doc .ib-matrix .ib-ylab { grid-row: auto !important; }
  .ib-doc .ib-quad { border-radius: 0 !important; border: 1px solid var(--rp-line) !important; grid-column: 2; }
  .ib-doc .ib-quad + .ib-quad { border-top: 0 !important; }
  .ib-doc .ib-xlab, .ib-doc .ib-xpad { display: none; }
  .ib-doc .ib-dr-head, .ib-doc .ib-dr-body, .ib-doc .ib-dr-foot { padding-left: 18px; padding-right: 18px; }
  .ib-doc .ib-mb { padding-left: 4px; }
}
@container ib-doc (max-width: 460px) {
  .ib-doc .ib-overview { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .ib-doc *, .ib-doc *::before, .ib-doc *::after { transition: none !important; animation: none !important; }
}

/* ── Project: Gantt-planering ──────────────────────────────────────────────
   Vänsterspalt med projekten, resten är schemat. dhtmlxGantt äger DOM:en
   inuti .proj-gantt; här skruvas bara dess färger in i Nest Marketings palett. */
.proj-app { display: flex; height: 100%; min-height: 0; }
.proj-rail {
  flex: 0 0 260px; display: flex; flex-direction: column; gap: .6rem;
  padding: 20px 16px; border-right: 1px solid var(--rule); background: var(--paper);
  overflow-y: auto;
}
.proj-rail-head { display: flex; flex-direction: column; gap: .6rem; }
.proj-h { font-size: 15px; margin: 0; display: flex; align-items: center; gap: 6px; }
.proj-new { align-self: flex-start; }
.proj-empty { font-size: 12px; }
.proj-list { display: flex; flex-direction: column; gap: 2px; margin-top: .4rem; }
.proj-item { display: flex; align-items: stretch; border-radius: 8px; }
.proj-item.is-open { background: var(--hover); }
.proj-item-open {
  flex: 1; min-width: 0; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; color: var(--ink);
}
.proj-item-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-item-meta { font-size: 11px; color: var(--mute); }
.proj-item-del {
  flex: none; width: 26px; border: 0; background: none; cursor: pointer;
  color: var(--mute-2); font-size: 14px; opacity: 0; transition: opacity .12s;
}
.proj-item:hover .proj-item-del { opacity: 1; }
.proj-item-del:hover { color: #C7452F; }
.proj-newform { display: flex; flex-direction: column; gap: 6px; padding: 4px 0 8px; }
.proj-newform-row { display: flex; gap: 6px; }

.proj-main { flex: 1; min-width: 0; display: flex; }
.proj-board { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.proj-toolbar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--rule);
}
.proj-title { margin: 0; font-size: 14px; font-weight: 650; }
.proj-tb-spacer { flex: 1; }
.proj-zoom { display: flex; gap: 4px; }
.proj-stage { flex: 1; min-height: 0; display: flex; }
.proj-gantt { flex: 1; min-width: 0; height: 100%; }
.proj-loading { padding: 20px 16px; }

/* Uppgiftspanelen till höger om schemat */
.proj-panel {
  flex: 0 0 300px; overflow-y: auto; padding: 14px 16px 26px;
  border-left: 1px solid var(--rule); background: var(--paper);
  display: flex; flex-direction: column; gap: 2px;
}
.proj-panel-head { display: flex; align-items: center; justify-content: space-between; }
.proj-panel-head-actions { display: flex; align-items: center; gap: 10px; }
.proj-panel-del { border: 0; background: none; cursor: pointer; font-size: 13px;
  color: var(--mute-2); line-height: 1; padding: 0; }
.proj-panel-del:hover { color: #C7452F; }
/* The grid's own trash icon — hidden until the row is hovered, like the rest
   of the app's per-item delete affordances. */
.gantt_cell[data-column-name="del"] { cursor: pointer; display: flex; align-items: center; justify-content: center; }
.proj-row-del { opacity: 0; font-size: 13px; transition: opacity .12s; pointer-events: none; }
.gantt_row:hover .proj-row-del, .gantt_row.odd:hover .proj-row-del { opacity: .7; }
.gantt_cell[data-column-name="del"]:hover .proj-row-del { opacity: 1 !important; }
.proj-panel-kind { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.proj-panel-x { position: static; }
.proj-f-label { display: block; font-size: 11px; font-weight: 600; margin: 14px 0 4px; color: var(--mute); }
.proj-f-row { display: flex; gap: 10px; }
.proj-f-row > div { flex: 1; min-width: 0; }
.proj-desc { resize: vertical; line-height: 1.5; }
.proj-range { width: 100%; }
.proj-hint { font-size: 11px; color: var(--mute-2); line-height: 1.5; margin-top: 18px; }

/* dhtmlxGantt i Nest Marketings färger */
.proj-gantt .gantt_task_line { background: var(--accent); border-color: transparent; border-radius: 4px; }
.proj-gantt .gantt_task_line .gantt_task_progress { background: rgba(0,0,0,.22); }
.proj-gantt .gantt_task_line.proj-bar-done { background: #2C9A5B; }
.proj-gantt .gantt_task_line.proj-bar-unassigned { background: var(--mute-2); }
.proj-gantt .gantt_task_line.gantt_project { background: var(--ink); }
.proj-gantt .gantt_milestone { background: var(--ink); }
.proj-gantt .gantt_grid_head_cell,
.proj-gantt .gantt_scale_cell { font-family: var(--f-sans); font-size: 11px; color: var(--mute); }
.proj-gantt .gantt_grid_data .gantt_cell { font-family: var(--f-sans); font-size: 12px; color: var(--ink); }
.proj-gantt .gantt_row.proj-row-top .gantt_cell:first-child { font-weight: 650; }
.proj-gantt .gantt_task_link .gantt_line_wrapper div { background: var(--mute); }
.proj-gantt .gantt_link_arrow_right { border-left-color: var(--mute); }
.proj-bar-pct { font-size: 10px; }

/* dhtmlx's horizontal scrollbar (.gantt_hor_scroll) is a plain overflow:scroll
   div with no scrollbar styling of its own — it inherits the app-wide 8px
   pale thumb on a transparent track, which reads as "nothing here" rather
   than "drag this". A wide Gantt is unusable without an obviously grabbable
   way to pan sideways, so this component gets its own thicker, higher-
   contrast scrollbar instead of the app's quiet default. */
.proj-gantt ::-webkit-scrollbar { width: 12px; height: 12px; }
.proj-gantt ::-webkit-scrollbar-track { background: var(--paper-2); }
.proj-gantt ::-webkit-scrollbar-thumb { background: var(--mute-2); border-radius: 7px; border: 2px solid var(--paper-2); }
.proj-gantt ::-webkit-scrollbar-thumb:hover { background: var(--mute); }
.proj-gantt { scrollbar-color: var(--mute-2) var(--paper-2); }

/* ── Typsnitt: källa, saknad fil och uppladdade filer ─────────────────────── */
.type-src { display: inline-block; margin-top: 8px; padding: 2px 8px; border-radius: 999px;
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; }
.type-src.is-bundled  { background: rgba(44,122,63,.12); color: #2C7A3F; }
.type-src.is-uploaded { background: var(--paper-2); color: var(--mute); }

.type-missing { display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 18px 20px; border: 1px dashed var(--rule); border-radius: 10px; background: var(--paper); }
.type-missing b { font-size: 13.5px; }
.type-missing p { margin: 0; font-size: 12.5px; color: var(--mute); line-height: 1.5; max-width: 62ch; }
.type-missing-hint { font-family: var(--f-mono); font-size: 10.5px; color: var(--mute-2); }
.type-missing-err  { font-size: 12px; color: #C7452F; }

.type-files { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.type-file { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 9px;
  border: 1px solid var(--rule); border-radius: 999px; font-family: var(--f-mono); font-size: 10.5px; color: var(--ink); }
.type-file i { color: var(--mute); font-style: normal; }
.type-file button { border: 0; background: transparent; cursor: pointer; color: var(--mute-2);
  font-size: 13px; line-height: 1; padding: 0 4px; }
.type-file button:hover:not(:disabled) { color: #C7452F; }

/* ── Kundstart — intern nykund-checklista ─────────────────────────────────── */
.kundstart-detail { flex: 1; min-width: 0; overflow-y: auto; padding: 20px 24px 40px; }
.kundstart-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.kundstart-clientname { flex: 1; font-size: 16px; font-weight: 600; border: 0; background: transparent; padding: 4px 2px; }
.kundstart-clientname:focus { outline: none; border-bottom: 1px solid var(--ink); }
.kundstart-progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.kundstart-progress-track { flex: 1; height: 5px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.kundstart-progress-fill { height: 100%; background: var(--st-green); border-radius: 999px; transition: width 200ms ease; }
.kundstart-progress-label { font-family: var(--f-mono); font-size: 11px; color: var(--mute); white-space: nowrap; }

.kundstart-stage { margin-bottom: 18px; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.kundstart-stage-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid var(--rule); background: var(--paper); }
.kundstart-stage-head h4 { margin: 0; font-size: 13.5px; }
.kundstart-stage-tag { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }
.kundstart-items { display: flex; flex-direction: column; }
.kundstart-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; cursor: pointer; }
.kundstart-item:hover { background: var(--hover); }
.kundstart-item:not(:last-child) { border-bottom: 1px solid var(--rule); }
.kundstart-box { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 5px;
  border: 1.5px solid var(--mute-2); display: grid; place-items: center; color: transparent; transition: all 120ms ease; }
.kundstart-item.is-done .kundstart-box { background: var(--st-green); border-color: var(--st-green); color: #fff; }
.kundstart-item-text { flex: 1; min-width: 0; }
.kundstart-item-label { font-size: 13px; font-weight: 500; line-height: 1.4; }
.kundstart-item.is-done .kundstart-item-label { color: var(--mute); text-decoration: line-through; }
.kundstart-item-note { display: block; font-size: 11.5px; color: var(--mute); margin-top: 2px; line-height: 1.4; }
.kundstart-badge { flex: none; font-family: var(--f-mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; margin-top: 2px; }
.kundstart-badge.is-req { background: rgba(199,69,47,.12); color: #C7452F; }
.kundstart-badge.is-opt { background: var(--paper-2); color: var(--mute); }

/* ── Kampanj-rad i PostDrawer (Paket 4) ───────────────────────────────────── */
.post-campaign-row { display: flex; flex-direction: column; gap: 4px; }
.post-campaign-chip { font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.post-campaign-goals { color: var(--mute); }

/* ── "Bidrar till"-kampanjer på bolagsmål (Paket 4, Settings → Mål) ──────── */
.goal-contributors { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.goal-contributors-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.goal-contributors-label { color: var(--mute); }
.goal-contributor-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px;
  border-radius: 999px; background: var(--hover); font-size: 11.5px; }

/* ── @-taggning (Paket 2) — MentionTextarea ──────────────────────────────── */
.mention-wrap { position: relative; }
.mention-menu { min-width: 100%; max-width: none; padding: 6px; max-height: 300px; overflow-y: auto; }
.mention-uses { margin-left: auto; padding-left: 12px; font-size: 11px; color: var(--mute); white-space: nowrap; }
.mention-hint { font-size: 10.5px; color: var(--mute); padding: 4px 8px 6px; }
.mention-newrow { border-top: 1px solid var(--rule); margin-top: 4px; padding-top: 8px; color: var(--mute); }
.mention-create { display: flex; flex-direction: column; gap: 8px; padding: 6px; }

/* ── Kampanjer (Paket 4) — återanvänder .proj-* skalet för lista+detalj ──── */
.camp-rail-actions { display: flex; gap: 8px; }
.camp-compare-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.camp-detail { flex: 1; min-width: 0; overflow-y: auto; padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 26px; }
.camp-fields { display: flex; flex-direction: column; gap: 14px; }
.camp-save-row { display: flex; align-items: center; gap: 10px; }
.camp-saved-tick { font-size: 12px; color: #2C9A5B; }

.camp-goals-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.camp-goals h4, .camp-posts h4, .camp-compare h4 { font-size: 14px; margin: 0 0 8px; }
.camp-goal-list { display: flex; flex-direction: column; gap: 10px; }
.camp-goal-row { padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); }
.camp-goal-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.camp-goal-label { font-size: 13px; font-weight: 600; }
.camp-goal-sub { font-size: 11.5px; color: var(--mute); margin-top: 4px; }
.camp-goal-actions { display: flex; gap: 8px; margin-top: 8px; }
.camp-goalform, .camp-progressform { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; }
.camp-progressform { flex-direction: row; align-items: center; }
.camp-progressform .text-input { width: 120px; }

.camp-post-list { display: flex; flex-direction: column; gap: 2px; }
.camp-post-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: 8px; }
.camp-post-row:hover { background: var(--hover); }
.camp-post-topic { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camp-post-meta { font-size: 11px; color: var(--mute); flex: none; display: flex; align-items: center; gap: 4px; }

.camp-compare { flex: 1; min-width: 0; overflow: auto; padding: 20px 24px 40px; }
.camp-compare-table-wrap { overflow-x: auto; }
.camp-compare-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.camp-compare-table th, .camp-compare-table td { padding: 8px 12px; border-bottom: 1px solid var(--rule); text-align: left; white-space: nowrap; }
.camp-compare-table th { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); font-weight: 600; }

/* ── Formatkatalog (Paket 1) ────────────────────────────────────────────── */
.fmt-note { padding: 8px 12px; margin: 8px 0 4px; background: rgb(48 209 88 / .1); border: 1px solid rgb(48 209 88 / .3);
  border-radius: 8px; font-size: 12px; }
.fmt-subtabs { display: flex; gap: 6px; margin: 12px 0 16px; }
.fmt-count { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px;
  margin-left: 6px; padding: 0 4px; border-radius: 999px; background: #C7452F; color: #fff; font-size: 10px; font-weight: 700; }
.fmt-conflict-note { padding: 8px 12px; margin-bottom: 12px; background: rgb(199 69 47 / .08);
  border: 1px solid rgb(199 69 47 / .25); border-radius: 8px; font-size: 12px; color: #C7452F; }
.fmt-review, .fmt-sources { display: flex; flex-direction: column; gap: 10px; }
.fmt-card, .fmt-activate-card, .fmt-source-card {
  border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px;
  background: var(--bg); display: flex; flex-direction: column; gap: 8px;
}
.fmt-card.is-conflict { border-color: rgb(199 69 47 / .4); background: rgb(199 69 47 / .04); }
.fmt-activate-card.is-active { border-color: var(--ink); }
.fmt-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fmt-platform { font-family: var(--f-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--mute); background: var(--paper); padding: 2px 6px; border-radius: 4px; }
.fmt-label { font-weight: 600; font-size: 13px; flex: 1; }
.fmt-badge { font-size: 10px; font-weight: 650; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.fmt-badge.is-good { background: rgb(48 209 88 / .14); color: #1f7a3d; }
.fmt-badge.is-warn { background: rgb(255 159 10 / .16); color: #9a5c00; }
.fmt-badge.is-info { background: rgb(94 92 230 / .12); color: #4b3fb0; }
.fmt-badge.is-bad  { background: rgb(199 69 47 / .14); color: #C7452F; }
.fmt-card-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11.5px; color: var(--mute); }
.fmt-source { font-family: var(--f-mono); }
.fmt-sourcelink { color: var(--accent); }
.fmt-conflict-pair { font-size: 12px; color: #C7452F; background: rgb(199 69 47 / .06); padding: 6px 10px; border-radius: 6px; }
.fmt-card-actions { display: flex; gap: 8px; }
.fmt-platform-block { margin-bottom: 20px; }
.fmt-platform-block h4 { margin: 0 0 8px; font-size: 13px; }
.fmt-activate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.fmt-source-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 24px; }
.fmt-links-h { margin: 4px 0 4px; font-size: 13px; }
.fmt-hint { font-size: 12px; color: var(--mute); margin: 0 0 12px; max-width: 640px; }
.fmt-links-list { display: flex; flex-direction: column; gap: 4px; }
.fmt-link-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--rule);
  border-radius: 8px; font-size: 12px; }
.fmt-link-row a { flex: 1; color: var(--ink); text-decoration: underline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmt-link-status { color: var(--mute); white-space: nowrap; }

/* ── Paket 6: Nytt inlägg-modalen ──────────────────────────────────────── */
/* Större, ovanpå allt (portalad till body) och dragbar i storlek i nedre
   högra hörnet. Mitten hålls av transformen, så rutan växer åt båda håll. */
.np-modal {
  width: min(960px, calc(100vw - 48px)); max-width: calc(100vw - 32px);
  height: min(88vh, 940px); max-height: calc(100vh - 40px);
  min-width: 560px; min-height: 480px;
  display: flex; flex-direction: column;
  padding: 0; overflow: hidden; resize: both;
  border-radius: 14px;
}
.np-backdrop { z-index: 210; }
.np-uploads { display: flex; flex-wrap: wrap; gap: 10px; }
.np-upl { position: relative; width: 104px; height: 104px; border-radius: 10px; overflow: hidden; border: 1px solid var(--rule); background: var(--paper-2); }
.np-upl img, .np-upl video { width: 100%; height: 100%; object-fit: cover; display: block; }
.np-upl-badge { position: absolute; left: 6px; bottom: 6px; font-size: 10px; font-weight: 700; letter-spacing: .06em; padding: 2px 6px; border-radius: 6px; background: rgba(0,0,0,.65); color: #fff; }
.np-upl-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 15px; line-height: 22px; cursor: pointer; padding: 0; }
.np-upl-add { width: 104px; height: 104px; border: 1px dashed var(--rule); border-radius: 10px; background: transparent; font: inherit; font-size: 12.5px; color: var(--mute); cursor: pointer; }
.np-upl-add:hover { color: var(--ink); border-color: var(--ink); }
.np-media-hint { margin-top: 8px; font-size: 11.5px; color: var(--mute); line-height: 1.45; }
.np-media-hint.is-warn { color: #9a5c00; }
.np-tab-n { font-size: 10.5px; font-weight: 700; min-width: 16px; height: 16px; line-height: 16px; text-align: center; border-radius: 8px; background: var(--ink); color: var(--bg); padding: 0 4px; }
.np-upl .np-upl-badge { max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 14px; border-bottom: 1px solid var(--rule); flex: 0 0 auto;
}
.np-head .modal-title { margin: 0; }
.np-body { padding: 18px 24px; overflow-y: auto; flex: 1; min-height: 0; }
.np-error { margin-bottom: 14px; }
.np-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 24px; border-top: 1px solid var(--rule); flex: 0 0 auto;
}
.np-foot-spacer { flex: 1; }
.np-sameforall { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--mute); cursor: pointer; }
.np-sameforall input { accent-color: var(--ink); cursor: pointer; }
.np-tabs { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.np-tab {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--rule); border-radius: 999px; background: transparent;
  padding: 3px 10px 3px 6px; cursor: pointer; opacity: .55;
}
.np-tab.is-on { opacity: 1; border-color: var(--ink); }
.np-tab-dot { width: 5px; height: 5px; border-radius: 50%; background: #FF9F0A; }
.np-media-actions { display: flex; gap: 8px; }
.np-studiopicked {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 8px 12px; border: 1px solid var(--rule); border-radius: 8px; font-size: 12.5px;
}
.np-gapwarn {
  margin-top: 8px; padding: 8px 12px; border-radius: 8px; font-size: 12px;
  background: rgb(255 159 10 / .1); border: 1px solid rgb(255 159 10 / .3); color: #9a5c00;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.np-gapwarn-link { border: 0; background: none; color: #9a5c00; text-decoration: underline; cursor: pointer; font-size: 12px; padding: 0; }
.np-advtoggle {
  border: 0; background: none; cursor: pointer; padding: 6px 0; margin: 4px 0 2px;
  font-family: var(--f-sans); font-size: 12px; color: var(--mute); text-align: left;
}
.np-advtoggle:hover { color: var(--ink); }
.np-advanced { display: flex; flex-direction: column; gap: 4px; padding-top: 6px; border-top: 1px dashed var(--rule); margin-top: 4px; }

/* Studio-hämtningens egen lilla dialog, ovanpå huvudmodalen */
.np-studiopicker { width: 460px; max-height: 70vh; display: flex; flex-direction: column; }
.np-studiolist { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; margin-bottom: 14px; }
.np-studioitem {
  display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid transparent;
  border-radius: 8px; background: none; cursor: pointer; text-align: left;
}
.np-studioitem:hover { background: var(--hover); border-color: var(--rule); }
.np-studioitem-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.np-studioitem-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-studioitem-sub { font-size: 11px; color: var(--mute); }

/* ── GA4-property: sökbar väljare ────────────────────────────────────────── */
/* Färgerna MÅSTE komma ur appens egna tokens. Första versionen hittade på
   --surface/--line/--accent-soft, som inte finns — så fallbacken slog till och
   gav en mörk panel med mörk text i ljust tema. Oläsligt. Här används bara
   variabler som är definierade i :root ovan. */
.ga-pick {
  /* Identisk med .text-input så knappen och sökfältet ligger på samma pixel —
     annars hoppar kolumnen när listan öppnas. */
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 12px;
  text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ga-pick:hover { border-color: var(--rule-2); }
.ga-pick-open { position: relative; }
.ga-pick-list {
  position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 320px; overflow-y: auto;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--rule-2);
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(10, 10, 10, 0.18);
  padding: 4px;
}
.ga-pick-row {
  display: flex; justify-content: space-between; gap: 14px; align-items: baseline;
  width: 100%; text-align: left; padding: 7px 10px;
  border: 0; background: none;
  color: var(--ink);
  font-family: var(--f-sans); font-size: 12px;
  border-radius: 7px; cursor: pointer;
}
.ga-pick-row:hover { background: var(--hover); }
.ga-pick-row.is-on { background: var(--paper-2); font-weight: 500; }
.ga-pick-row .muted { color: var(--mute); font-size: 11px; flex: none; }

/* ── Admin → Kund ────────────────────────────────────────────────────────── */
.cust-head { display: flex; align-items: baseline; gap: 12px; margin: 18px 0 4px; }
.cust-head h4 { margin: 0; font-family: var(--f-display); font-size: 20px; }
.cust-head .muted { color: var(--mute); font-size: 12px; }
.cust-pages { margin-top: 8px; padding: 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); }

/* ── Jobb & köer ─────────────────────────────────────────────────────────── */
/* Egna klasser i stället för .adm-row: den är ett sexkolumnsrutnät för
   org-tabellerna, och att låna den till tabeller med fyra eller sju kolumner
   ger kolumner som inte står under sina rubriker. Varje tabell här får sitt
   eget rutnät. */
.jobs-pane { padding: 4px 2px 32px; }
.jobs-sect { margin-top: 34px; }

/* Överblicken först: fyra tal man kan läsa på en sekund, innan tabellerna. */
.jobs-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--rule); border: 1px solid var(--rule);
  margin: 18px 0 6px;
}
.jobs-stat { background: var(--bg); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.jobs-stat-n { font-family: var(--f-display); font-size: 24px; line-height: 1; color: var(--ink); }
.jobs-stat-l {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--mute);
}
.jobs-stat.is-bad .jobs-stat-n { color: #a8412f; }

.jobs-tbl { border-top: 1px solid var(--rule); margin-top: 10px; }
.jobs-row {
  display: grid; align-items: center; gap: 12px;
  padding: 9px 12px; border-bottom: 1px solid var(--rule);
  font-family: var(--f-sans); font-size: 12px;
}
.jobs-row:not(.jobs-head):hover { background: var(--hover); }
.jobs-head {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--mute); background: var(--paper);
}
/* Ett rutnät per tabell — rubrik och cell måste dela definition. */
.jobs-slots     .jobs-row { grid-template-columns: 1fr 90px 1fr; }
.jobs-backfills .jobs-row { grid-template-columns: 1.5fr 1fr 1.6fr 80px 70px 90px 150px; }
.jobs-cov       .jobs-row { grid-template-columns: 1.3fr 1.4fr 80px 1.4fr 1.2fr; }
.jobs-conns     .jobs-row { grid-template-columns: 1.4fr 1fr 1.4fr 1.2fr; }
.jobs-inactive  .jobs-row { grid-template-columns: 1.3fr 1.3fr 2fr 1fr 120px; }

.jobs-num  { text-align: right; font-variant-numeric: tabular-nums; }
.jobs-mono { font-family: var(--f-mono); font-size: 11px; }
.jobs-dim  { color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jobs-err  { color: #8a6d1f; font-size: 11px; margin-top: 2px; }
.jobs-act  { display: flex; justify-content: flex-end; gap: 6px; }

/* Statusen ska gå att skumma. Färg räcker inte som ensam bärare — pricken har
   också olika form i text för den som inte skiljer nyanserna åt. */
.jobs-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--ink); white-space: nowrap;
}
.jobs-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--mute); }
.jobs-pill.is-ok::before    { background: #6ea36e; }
.jobs-pill.is-warn::before  { background: #c98a1e; }
.jobs-pill.is-bad::before   { background: #a8412f; }
.jobs-pill.is-muted         { color: var(--mute); }

.jobs-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 4px; }
/* Framsteg per inläsning. Andelen är dygn avklarade av dygn totalt — ett
   riktigt mått — så stapeln är rak; den obestämda (inläggsjobb) rör sig. */
.jobs-prog { grid-column: 1 / -1; padding: 0 0 6px; }
/* Etiketten ligger ovanför spåret; klippningen sitter på spåret, inte på
   omslaget — annars klipps etiketten bort med de sex pixlarna. */
.jobs-bar { position: relative; margin-top: 16px; }
.jobs-bar-track { height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.jobs-bar-fill { height: 100%; background: var(--ink); border-radius: 3px; transition: width .4s ease; }
.jobs-bar-l { position: absolute; right: 0; top: -14px; font-size: 10.5px; color: var(--mute); font-variant-numeric: tabular-nums; }
.jobs-bar.is-indet .jobs-bar-fill {
  width: 30%; opacity: .45;
  animation: jobs-indet 1.6s ease-in-out infinite;
}
@keyframes jobs-indet { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
.jobs-stat .jobs-bar { margin-top: 14px; }
.jobs-form .text-input { width: auto; min-width: 190px; }

@media (max-width: 1100px) {
  .jobs-stats { grid-template-columns: repeat(2, 1fr); }
  .jobs-backfills .jobs-row { grid-template-columns: 1.2fr 1fr 1.4fr 70px 130px; }
  .jobs-backfills .jobs-row > :nth-child(5),
  .jobs-backfills .jobs-row > :nth-child(6) { display: none; }
}

/* ── Maximerade fönster får inte hamna under docken ──────────────────────── */
/* .oswin.is-max satte inset: 0, så ett maximerat fönster sträckte sig under
   docken (z-index 500) och de sista ~120 px blev oklickbara. Det drabbade
   varje högerställd åtgärdskolumn: "Gå in" i Admin, pausa/återuppta i Jobb &
   köer. Mätt med elementFromPoint — knapparna fanns, men docken låg över.
   :has() gör att en dold dock inte reserverar yta i onödan. */
:root { --dock-reserve: 128px; --dock-reserve-bottom: 96px; }

html[data-dock-pos="right"]:has(.os-dock:not(.is-hidden)) .oswin.is-max {
  inset: 0 var(--dock-reserve) 0 0 !important;
}
html[data-dock-pos="left"]:has(.os-dock:not(.is-hidden)) .oswin.is-max {
  inset: 0 0 0 var(--dock-reserve) !important;
}
html[data-dock-pos="bottom"]:has(.os-dock:not(.is-hidden)) .oswin.is-max {
  inset: 0 0 var(--dock-reserve-bottom) 0 !important;
}
/* Smala skärmar: där ligger fönstret ändå fullskärm och docken flyter över —
   att krympa fönstret ytterligare gör mer skada än den överlappning som blir. */
@media (max-width: 900px) {
  html:has(.os-dock) .oswin.is-max { inset: 0 !important; }
}

/* Tjänstekontots nyckel: en JSON-klump, inte en rad. */
.admin-group textarea.text-input { font-family: var(--f-mono); font-size: 11px; line-height: 1.5; resize: vertical; }
.row-actions { display: flex; gap: 8px; margin-top: 10px; }

/* Vyn monteras om vid arbetsytesbyte — omslaget får inte påverka layouten. */
.oswin-scope { display: contents; }

/* GA-admin: extra properties under primären. */
.ga-extras { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.ga-extras .ga-pick { max-width: 220px; }
.ga-extra-x { border: 0; background: transparent; cursor: pointer; margin-left: 4px; font-size: 10px; color: var(--mute); }
.ga-extra-x:hover { color: var(--ink); }

/* Annonser: periodbyte pågår. Raden är det enda som säger att något händer;
   siffrorna under är förra periodens och tonas ner tills de bytts ut. */
.ads-loading-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  margin: -6px 0 14px; padding: 9px 12px;
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 8px;
  font-family: var(--f-sans); font-size: 12.5px; color: var(--ink-2);
}
.ads-loading-spin {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--rule); border-top-color: var(--ink);
  animation: ads-spin .8s linear infinite;
}
@keyframes ads-spin { to { transform: rotate(360deg); } }
.src-main.is-loading > :not(.ads-loading-bar) { opacity: .45; pointer-events: none; transition: opacity .15s; }

/* Google-annonser: annonsgruppen står under rubriken, före annonstexten. */
.ad-adrow-group { display: block; font-size: 11px; color: var(--mute); letter-spacing: .02em; text-transform: uppercase; }

/* (i) — en upplysning, inte en fråga: samma prick, lugnare glyf. */
.helpdot.is-info { font-style: italic; font-family: Georgia, serif; }
.src-item:disabled { opacity: .5; cursor: progress; }

/* Studio: uppspelning av rörelse */
.studio-play { margin-left: 8px; }
.studio-play.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.studio-playtime { font-family: var(--f-mono); font-size: 11px; color: var(--mute); margin-left: 6px; min-width: 64px; display: inline-block; }

/* Studio: flerval, grupper, högerklicksmeny */
.studio-el.is-multi { outline-style: dashed; }
.studio-lgroup { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 3px; background: var(--accent); color: #fff; font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.studio-ctx { position: fixed; z-index: 1000; min-width: 210px; padding: 6px; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.14); font-family: var(--f-sans); font-size: 12.5px; }
.studio-ctx-h { padding: 4px 8px 6px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.studio-ctx button { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; padding: 6px 8px; border: 0; background: transparent; border-radius: 5px; text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.studio-ctx button:hover { background: var(--paper-2); }
.studio-ctx button:disabled { opacity: .4; cursor: default; background: transparent; }
.studio-ctx button.is-danger { color: #B3261E; }
.studio-ctx kbd { font-family: var(--f-mono); font-size: 10px; color: var(--mute); }
.studio-ctx-sep { height: 1px; margin: 4px 2px; background: var(--rule); }

/* Studio: ytan, lagerlistan och knappraderna är inte text att markera.
   Redigeringsläget sätter user-select: text inline och vinner ändå. */
.studio-stage, .studio-layersdock-list, .studio-seg, .studio-zoombar, .studio-dims, .studio-post-head, .studio-post-actions { user-select: none; -webkit-user-select: none; }
.studio-lrename { user-select: text; -webkit-user-select: text; }

/* Studio: tidslinjen under inlägget */
.studio-tl { align-self: stretch; width: 100%; box-sizing: border-box; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); font-family: var(--f-sans); font-size: 12px; overflow: hidden; margin-top: 4px; user-select: none; -webkit-user-select: none; }
.studio-tl-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.studio-tl-title { font-weight: 600; letter-spacing: .04em; margin-right: 4px; }
.studio-tl-len { display: inline-flex; align-items: center; gap: 6px; color: var(--mute); font-size: 11px; }
.studio-tl-len .text-input { width: 64px; padding: 3px 6px; font-size: 12px; }
.studio-tl-len select.text-input { width: auto; }
.studio-tl-auto { font-size: 11px; color: var(--mute); }
.studio-tl-head .studio-insp-x { margin-left: auto; }
.studio-tl-body { display: grid; grid-template-columns: minmax(150px, 210px) 1fr; }
.studio-tl-names { border-right: 1px solid var(--rule); }
.studio-tl-ruler-l, .studio-tl-ruler { height: 22px; }
.studio-tl-ruler { position: relative; border-bottom: 1px solid var(--rule); cursor: ew-resize; background: var(--paper-2); }
.studio-tl-tick { position: absolute; top: 3px; transform: translateX(-50%); font-size: 10px; color: var(--mute); font-family: var(--f-mono); white-space: nowrap; }
.studio-tl-tick::before { content: ""; position: absolute; left: 50%; top: 14px; height: 6px; border-left: 1px solid var(--rule); }
.studio-tl-name, .studio-tl-track { height: 30px; box-sizing: border-box; border-bottom: 1px solid var(--rule); }
.studio-tl-name { display: flex; align-items: center; gap: 6px; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.studio-tl-name.is-sel { background: var(--paper-2); font-weight: 600; }
.studio-tl-kind { width: 14px; text-align: center; color: var(--mute); font-size: 11px; }
.studio-tl-scroll { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; }
.studio-tl-tracks { position: relative; min-width: 100%; }
.studio-tl-zoom { display: inline-flex; align-items: center; gap: 4px; }
.studio-tl-zoom .studio-segbtn { padding: 3px 8px; }
.studio-railbtn-motion:disabled { opacity: .35; cursor: not-allowed; }
.studio-tl-track { position: relative; }
.studio-tl-track.is-sel { background: var(--paper-2); }
.studio-tl-bar { position: absolute; top: 5px; height: 20px; border-radius: 5px; background: var(--ink); color: var(--paper); overflow: hidden; cursor: grab; display: flex; align-items: center; box-sizing: border-box; }
.studio-tl-bar.is-static { background: transparent; border: 1px dashed var(--rule); color: var(--mute); }
.studio-tl-track.is-sel .studio-tl-bar:not(.is-static) { background: var(--accent); }
.studio-tl-in, .studio-tl-out { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(255,255,255,.35) 0 4px, transparent 4px 8px); pointer-events: none; }
.studio-tl-in { left: 0; } .studio-tl-out { right: 0; }
.studio-tl-barl { position: relative; padding: 0 8px; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.studio-tl-h { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.studio-tl-h.is-l { left: 0; } .studio-tl-h.is-r { right: 0; }
.studio-tl-h:hover { background: rgba(255,255,255,.25); }
.studio-tl-playhead { position: absolute; top: 0; bottom: 0; left: 0; width: 0; border-left: 2px solid #C2722C; pointer-events: none; z-index: 2; }
.studio-tl-playhead::before { content: attr(data-t) " s"; position: absolute; top: 2px; left: 4px; font-size: 9px; font-family: var(--f-mono); color: #C2722C; background: var(--paper); padding: 0 3px; border-radius: 3px; }
.studio-tl-empty, .studio-tl-hint { padding: 8px 10px; color: var(--mute); font-size: 11px; }
.studio-tl-props { padding: 14px 16px 16px; border-top: 1px solid var(--rule); }
.studio-tl-propl { font-weight: 600; font-size: 12.5px; margin-bottom: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio-tl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 18px; }
.studio-tl-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); min-width: 0; }
.studio-tl-grid .text-input { padding: 7px 9px; font-size: 13px; width: 100%; box-sizing: border-box; }
.studio-tl-actions { margin-top: 14px; }

/* Rapporter: arkiv */
.rep-run { position: relative; cursor: pointer; }
.rep-run.is-archived { opacity: .7; }
.rep-run-arch { position: absolute; top: 10px; right: 12px; font-size: 11px; padding: 3px 8px; opacity: 0; transition: opacity .12s; }
.rep-run:hover .rep-run-arch, .rep-run:focus-within .rep-run-arch { opacity: 1; }

/* Insights: engagemangets delar under kortets mätvärden */
.ins-card-parts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 2px 0 6px; font-family: var(--f-mono); font-size: 11px; color: var(--mute); }

/* ── Marketing: teamet som nav ─────────────────────────────────────────── */
.mkt-hubview .mkt-team-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mkt-team-toggle { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mkt-hub { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; background: var(--paper); margin-top: 12px; }
/* Höjden följer fönstret i stället för ett bildförhållande: aspect-ratio
   tillsammans med min-height gjorde kartan bredare än sin kolumn och den
   lade sig under panelen. Noderna står i procent av rutan i båda led. */
.mkt-map { position: relative; width: 100%; min-width: 0; height: clamp(540px, 44vw, 780px); overflow: hidden; background: radial-gradient(ellipse at 50% 50%, rgba(255,255,255,.55), transparent 62%), var(--paper-2); }
.mkt-node-ava { overflow: hidden; }
.mkt-map-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.mkt-edge { fill: none; stroke-width: 1.6; stroke-linecap: round; opacity: .45; vector-effect: non-scaling-stroke; stroke-dasharray: 6 7; animation: mkt-flow 14s linear infinite; }
.mkt-edge.is-hub { stroke: #2F6B5A; }
.mkt-edge.is-direct { stroke: #A8742B; }
.mkt-edge.is-fresh { opacity: .85; stroke-width: 2.2; animation-duration: 9s; }
.mkt-edge.is-lit { opacity: 1; stroke-width: 2.4; }
/* Diskret, långsam rörelse längs linjerna — det utbyts information. */
@keyframes mkt-flow { to { stroke-dashoffset: -52; } }
@media (prefers-reduced-motion: reduce) { .mkt-edge { animation: none; } }
.mkt-node { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 10px; padding: 11px 14px 11px 11px;
  width: clamp(150px, 23%, 230px); box-sizing: border-box;
  background: #fff; border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.06); cursor: pointer; font-family: var(--f-sans); transition: box-shadow .15s, transform .15s; }
.mkt-node:hover { box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.mkt-node.is-sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.mkt-node.is-off { opacity: .5; }
.mkt-node.is-hub { background: #12352C; color: #fff; border-color: #12352C; width: clamp(240px, 36%, 330px); padding: 16px 18px 16px 16px; box-shadow: 0 10px 30px rgba(18,53,44,.35); }
.mkt-node.is-hub .mkt-node-name { color: #fff; font-size: 17px; }
.mkt-node.is-running { animation: mkt-pulse 2.4s ease-in-out infinite; }
@keyframes mkt-pulse { 0%, 100% { box-shadow: 0 4px 16px rgba(0,0,0,.06); } 50% { box-shadow: 0 0 0 6px rgba(47,107,90,.18), 0 4px 16px rgba(0,0,0,.06); } }
.mkt-node-ava { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.mkt-node-ava.is-s { flex-basis: 22px; width: 22px; height: 22px; font-size: 9px; }
.mkt-node-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
/* Namnet får bryta rad inne i rutan (vid bindestreck eller var som helst),
   men aldrig gå utanför den — max två rader. */
.mkt-node-name { font-weight: 600; font-size: 13px; color: var(--ink); line-height: 1.2; white-space: normal; overflow-wrap: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mkt-node-blurb { font-size: 12px; color: rgba(255,255,255,.72); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mkt-node-state { font-family: var(--f-mono); font-size: 10px; color: var(--mute); }
.mkt-node.is-hub .mkt-node-state { color: rgba(255,255,255,.7); }
.mkt-node-badge { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.mkt-map-legend { position: absolute; left: 16px; bottom: 12px; display: flex; gap: 18px; font-family: var(--f-sans); font-size: 11.5px; color: var(--mute); }
.mkt-lg { display: inline-block; width: 22px; border-top: 2px dashed #2F6B5A; vertical-align: middle; margin-right: 4px; }
.mkt-lg.is-direct { border-top-color: #A8742B; }
/* sidopanelen — blocklayout med luft. Den var en flex-kolumn med maxhöjd, och
   när innehållet blev högre pressades knapparna ihop till en tunn rand. */
.mkt-agentpanel { border-left: 1px solid var(--rule); padding: 28px 26px 32px; font-family: var(--f-sans); background: var(--paper); overflow-y: auto; max-height: 720px; }
.mkt-agentpanel > * { flex-shrink: 0; }
.mkt-agentpanel.is-empty { display: flex; justify-content: center; align-items: center; text-align: center; color: var(--mute); min-height: 320px; }
.mkt-agentpanel.is-empty .mkt-ap-hint { flex-shrink: 1; max-width: 260px; }
.mkt-ap-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 8px; }
.mkt-ap-head .mkt-node-ava { flex: 0 0 44px; width: 44px; height: 44px; font-size: 14px; }
.mkt-ap-title { min-width: 0; flex: 1; }
.mkt-ap-name { font-weight: 700; font-size: 16px; line-height: 1.25; }
.mkt-ap-role { margin-top: 3px; font-size: 12px; color: var(--mute); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mkt-ap-switch { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: var(--mute); padding-top: 2px; }
.mkt-ap-l { margin: 28px 0 12px; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); font-weight: 600; }
.mkt-ap-seg { display: flex; align-items: stretch; height: 44px; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; background: var(--bg); }
.mkt-ap-segbtn { flex: 1 1 0; min-width: 0; height: 100%; padding: 0 6px; border: 0; background: transparent; font: inherit; font-size: 13px; line-height: 1; cursor: pointer; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt-ap-segbtn + .mkt-ap-segbtn { border-left: 1px solid var(--rule); }
.mkt-ap-segbtn.is-on { background: var(--ink); color: var(--bg); }
.mkt-ap-segbtn:disabled { cursor: default; }
.mkt-ap-custom { align-self: center; padding: 0 10px; font-size: 11px; color: var(--mute); white-space: nowrap; }
.mkt-ap-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 28px; }
.mkt-ap-row2 .mkt-ap-l { margin-top: 0; }
.mkt-ap-row2 .text-input { width: 100%; min-width: 0; height: 42px; padding: 0 30px 0 12px; font-size: 13px; box-sizing: border-box; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt-ap-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.mkt-ap-chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 9px; border: 1px solid var(--rule); border-radius: 999px; background: var(--bg); font: inherit; font-size: 12px; line-height: 1; cursor: pointer; color: var(--mute); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt-ap-chip i { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; opacity: .5; }
.mkt-ap-chip.is-on { color: var(--ink); border-color: var(--ink); background: #fff; }
.mkt-ap-chip.is-on i { opacity: 1; }
.mkt-ap-chip:disabled { cursor: default; }
.mkt-ap-ins { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.mkt-ap-ins:last-of-type { border-bottom: 0; }
.mkt-ap-ins.is-unread .mkt-ap-ins-t::before { content: "•"; color: var(--accent); margin-right: 5px; }
.mkt-ap-ins-t { font-size: 12.5px; line-height: 1.4; }
.mkt-ap-ins-m { font-family: var(--f-mono); font-size: 10px; color: var(--mute); }
.mkt-ap-hint { font-size: 12px; color: var(--mute); line-height: 1.5; }
.mkt-ap-instr { display: block; width: 100%; min-height: 130px; padding: 12px 14px; box-sizing: border-box; font-size: 13px; line-height: 1.5; resize: vertical; }
.mkt-ap-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--rule); }
.mkt-ap-foot .tb-btn { height: 42px; padding: 0 22px; }
.mkt-ap-last { font-family: var(--f-mono); font-size: 10.5px; color: var(--mute); }
/* strömmen */
.mkt-stream { margin-top: 12px; border: 1px solid var(--rule); border-radius: 12px; background: var(--paper); padding: 10px 14px 14px; }
.mkt-stream-bar { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.mkt-stream-bar .text-input { width: auto; padding: 6px 9px; font-size: 12px; }
.mkt-stream-count { margin-left: auto; font-family: var(--f-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.mkt-msg-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-family: var(--f-sans); }
.mkt-msg-row.is-unread .mkt-msg-t { font-weight: 600; }
.mkt-msg-who { display: flex; align-items: center; gap: 4px; }
.mkt-msg-arrow { color: var(--mute); font-size: 12px; }
.mkt-msg-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mkt-msg-t { font-size: 13px; line-height: 1.35; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.mkt-msg-kind { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); border: 1px solid var(--rule); padding: 1px 5px; border-radius: 3px; }
.mkt-msg-link { border: 0; background: transparent; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; text-align: left; }
.mkt-msg-s { font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.mkt-msg-m { font-family: var(--f-mono); font-size: 10px; color: var(--mute); }
@media (max-width: 1100px) { .mkt-hub { grid-template-columns: 1fr; } .mkt-agentpanel { border-left: 0; border-top: 1px solid var(--rule); max-height: none; } }
.mkt-hub { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; overflow: hidden; }
.mkt-hub > * { min-width: 0; }
@media (max-width: 1280px) { .mkt-hub { grid-template-columns: minmax(0, 1fr) 340px; } .mkt-node { width: clamp(176px, 26%, 216px); gap: 8px; padding: 9px 10px 9px 9px; } .mkt-node-name { font-size: 12px; } .mkt-node.is-hub { width: clamp(240px, 38%, 300px); } .mkt-node.is-hub .mkt-node-name { font-size: 15px; } }
/* Under 1200 px får kartan hela bredden och panelen läggs under — den
   tidigare 1100-regeln längre upp skrevs över av kolumnregeln ovan. */
@media (max-width: 1200px) { .mkt-hub { grid-template-columns: 1fr; } .mkt-map { height: clamp(520px, 62vw, 700px); } .mkt-agentpanel { border-left: 0; border-top: 1px solid var(--rule); max-height: none; } }

.mkt-fold { display: flex; justify-content: center; padding: 12px 0 4px; }

/* Branschsnitt (riktmärken) i Annonser + Admin */
.ad-bench { display: inline-flex; align-items: center; gap: 4px; font-family: var(--f-sans); font-size: 10.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; padding: 1px 7px; border-radius: 999px; }
.ad-bench.is-up { color: #1f6b3a; background: rgb(46 160 94 / .12); }
.ad-bench.is-down { color: #9a3c1f; background: rgb(214 92 52 / .12); }
.ad-netgroup-sum .ad-bench { margin-left: 4px; }
.trend-card-sub .ad-bench { font-size: 10px; }
.bench-table { display: flex; flex-direction: column; gap: 6px; }
.bench-row { display: grid; grid-template-columns: 110px 130px 130px minmax(0, 1.4fr) minmax(0, 1.2fr) 96px; gap: 10px; align-items: center; }
.bench-row .text-input { width: 100%; min-width: 0; height: 34px; padding: 0 10px; font-size: 12.5px; box-sizing: border-box; }
.bench-head { font-family: var(--f-sans); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); padding-bottom: 4px; border-bottom: 1px solid var(--rule); }
.bench-net { font-weight: 600; }
.bench-val { display: flex; align-items: center; gap: 6px; }
.bench-val .text-input { width: 80px; }
.bench-unit { font-size: 12px; color: var(--mute); }
.bench-actions { display: flex; gap: 6px; justify-content: flex-end; }
.bench-add { margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--rule); }
@media (max-width: 1100px) { .bench-row { grid-template-columns: 1fr 1fr 1fr; } .bench-head { display: none; } }

/* Studio: släpp filer från skrivbordet */
.studio-app { position: relative; }
.studio-filedrop { position: absolute; inset: 0; z-index: 400; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; gap: 18px; padding: 8% 10% 5%; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(3px); }
.studio-filedrop-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 24px; border: 2px dashed var(--ink); border-radius: 18px; background: var(--bg); transition: background .12s, transform .12s; }
.studio-filedrop-zone:hover, .studio-filedrop-zone:focus-within { background: var(--paper-2); }
.studio-filedrop-zone b { font-family: var(--f-display); font-size: 26px; font-weight: 500; }
.studio-filedrop-zone span { font-size: 13px; color: var(--mute); max-width: 30ch; line-height: 1.4; }
.studio-filedrop-foot { grid-column: 1 / -1; text-align: center; font-size: 12px; color: var(--mute); }
.studio-uploading { position: absolute; right: 18px; bottom: 16px; z-index: 390; padding: 7px 14px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }

/* Inne i Microsoft Teams: fliken är fönstret — inget skrivbord bakom, inga
   fönsterknappar som flyttar appen ur bild. */
/* Bara APPfönstren plattas ut. Dokumentfönster (en rapport ovanpå Rapporter)
   flyter fortfarande och behöver sin skugga, sina hörn och sitt grepp —
   utan dem såg de ut som en bit av sidan som hamnat fel. */
body.in-teams .oswin:not(.docwin) { border-radius: 0; box-shadow: none; }
body.in-teams .oswin:not(.docwin) .oswin-lights .oswin-minb, body.in-teams .oswin:not(.docwin) .oswin-lights .oswin-maxb { display: none; }
body.in-teams .oswin:not(.docwin) > .oswin-resize { display: none; }
body.in-teams .oswin.docwin { box-shadow: 0 24px 70px rgba(0,0,0,.38), 0 0 0 1px rgba(0,0,0,.22); }
/* Appfönstrens titellist är överflödig i Teams: allt är helskärm och appens
   namn står redan i menyraden. Man byter app via märket uppe till vänster,
   dockan eller ⌘K. Dokumentfönster (rapporter m.m.) behåller sin list — det
   är där deras stängknapp sitter. */
body.in-teams .oswin:not(.docwin) > .oswin-title { display: none; }

/* Inloggning: Microsoft-knappen under e-postfältet */
.lock-ms { display: inline-flex; align-items: center; gap: 9px; margin-top: 16px; padding: 9px 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.08); color: #fff; font-size: 13px; text-decoration: none; backdrop-filter: blur(6px); transition: background .15s; }
.lock-ms:hover { background: rgba(255,255,255,.16); }

/* Content Plan: snabbtitt på materialet */
.post-thumb { position: relative; }
.ql-badge { position: absolute; right: 8px; bottom: 8px; min-width: 30px; height: 26px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: rgba(0,0,0,.62); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .02em; backdrop-filter: blur(4px); cursor: zoom-in; transition: background .12s, transform .12s; }
.ql-badge:hover, .ql-badge:focus-visible { background: rgba(0,0,0,.85); transform: scale(1.06); outline: none; }
.ev-thumb.is-ql, .row-thumb.is-ql { cursor: zoom-in; }
.ev-thumb.is-ql:hover, .row-thumb.is-ql:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.row-media { font-size: 11px; color: var(--mute); margin-left: -4px; white-space: nowrap; }
.ql-backdrop { position: fixed; inset: 0; z-index: 240; background: rgba(12,11,9,.72); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 28px; animation: backdrop-in 160ms ease; }
.ql { display: grid; grid-template-columns: minmax(0, 1fr) 340px; width: min(1280px, 100%); height: min(860px, 100%); background: var(--bg); border-radius: 16px; overflow: hidden; box-shadow: 0 30px 90px rgba(0,0,0,.5); }
.ql-stage { position: relative; background: #121110; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; }
.ql-media { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.ql-empty { color: rgba(255,255,255,.6); font-size: 13px; padding: 24px; text-align: center; }
.ql-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; backdrop-filter: blur(6px); }
.ql-nav:hover { background: rgba(255,255,255,.28); }
.ql-prev { left: 14px; } .ql-next { right: 14px; }
.ql-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.ql-dot { width: 7px; height: 7px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.35); cursor: pointer; }
.ql-dot.is-on { background: #fff; }
.ql-count, .ql-format { position: absolute; top: 14px; padding: 3px 10px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: 11.5px; }
.ql-count { right: 14px; } .ql-format { left: 14px; text-transform: capitalize; }
.ql-side { position: relative; padding: 26px 24px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; border-left: 1px solid var(--rule); }
.ql-close { position: absolute; top: 12px; right: 12px; }
.ql-when { font-family: var(--f-sans); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.ql-title { font-family: var(--f-display); font-size: 22px; font-weight: 500; line-height: 1.2; margin: 0; padding-right: 28px; }
.ql-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ql-tab { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule); border-radius: 999px; background: transparent; padding: 4px 11px 4px 6px; font: inherit; font-size: 12.5px; cursor: pointer; opacity: .6; }
.ql-tab.is-on { opacity: 1; border-color: var(--ink); }
.ql-tab-n { font-size: 11px; color: var(--mute); }
.ql-l { margin-top: 10px; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); font-weight: 600; }
.ql-copy { white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.ql-mute { color: var(--mute); }
.ql-warn { padding: 8px 12px; border-radius: 8px; font-size: 12px; background: rgb(255 159 10 / .1); border: 1px solid rgb(255 159 10 / .3); color: #9a5c00; }
.ql-actions { margin-top: auto; padding-top: 14px; }
.ql-hint { font-size: 11px; color: var(--mute); }
@media (max-width: 900px) { .ql { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; } .ql-side { border-left: 0; border-top: 1px solid var(--rule); max-height: 42%; } }
.post-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }

/* ── Project: modern Gantt ───────────────────────────────────────────────── */
/* The ring is a real border (inside the box), not a box-shadow: dhtmlx wraps
   cell content in an overflow-hidden element that sliced a shadow ring off on
   the left and right. */
.proj-av { --s: 24px; --h: 210; width: var(--s); height: var(--s); flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; vertical-align: middle; overflow: hidden; box-sizing: border-box;
  border: 2px solid hsl(var(--h) 55% 52%); padding: 1.5px; background: hsl(var(--h) 45% 92%); background-clip: content-box; color: hsl(var(--h) 45% 28%); font-family: var(--f-sans); font-size: calc(var(--s) * .36); font-weight: 650; letter-spacing: .02em; line-height: 1; }
.proj-av > span { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: 50%; }
.proj-av img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.proj-av.is-empty { background: transparent; color: var(--mute-2); border-color: var(--rule); }
.os-user { border: 0; cursor: pointer; padding: 0; overflow: hidden; font: inherit; }
.os-user.has-photo { background: transparent; }
.os-user img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }

.proj-gantt .gantt_container { border: 0; font-family: var(--f-sans); background: var(--bg); }
.proj-gantt .gantt_grid, .proj-gantt .gantt_task { background: var(--bg); }
.proj-gantt .gantt_grid_scale, .proj-gantt .gantt_task_scale { background: var(--bg); border-bottom: 1px solid var(--rule); box-shadow: none; }
.proj-gantt .gantt_grid_head_cell { border: 0 !important; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); font-weight: 600; }
.proj-gantt .gantt_scale_line { border-top: 0; }
.proj-gantt .gantt_scale_line:first-child .gantt_scale_cell { font-family: var(--f-display); font-size: 14px; color: var(--ink); text-transform: none; letter-spacing: 0; border-right-color: transparent; justify-content: flex-start; padding-left: 10px; }
.proj-gantt .gantt_scale_cell { border-right: 1px solid color-mix(in srgb, var(--rule) 55%, transparent); font-size: 10.5px; color: var(--mute); }
.proj-gantt .gantt_row, .proj-gantt .gantt_task_row { border-bottom: 1px solid color-mix(in srgb, var(--rule) 45%, transparent); background: transparent; }
.proj-gantt .gantt_row.odd, .proj-gantt .gantt_task_row.odd { background: transparent; }
.proj-gantt .gantt_row:hover, .proj-gantt .gantt_row.odd:hover { background: var(--paper-2); }
.proj-gantt .gantt_row.gantt_selected, .proj-gantt .gantt_task_row.gantt_selected { background: color-mix(in srgb, var(--accent) 9%, var(--bg)); }
.proj-gantt .gantt_task_row.gantt_selected .gantt_task_cell { border-right-color: color-mix(in srgb, var(--rule) 40%, transparent); }
.proj-gantt .gantt_task_cell { border-right: 1px solid color-mix(in srgb, var(--rule) 40%, transparent); }
.proj-gantt .gantt_task_cell.proj-weekend, .proj-gantt .gantt_scale_cell.proj-weekend { background: color-mix(in srgb, var(--paper-2) 70%, transparent); }
.proj-gantt .gantt_cell { border-right: 0; padding-left: 8px; }
.proj-gantt .gantt_grid_data .gantt_cell { font-size: 12.5px; }
.proj-gantt .gantt_row.proj-row-top .gantt_cell { font-weight: 650; font-size: 12.5px; }
.proj-gantt .gantt_row.proj-row-top, .proj-gantt .gantt_task_row.proj-row-top { background: color-mix(in srgb, var(--paper-2) 55%, transparent); }
.proj-gantt .gantt_cell[data-column-name="assignee"] { display: flex; align-items: center; justify-content: center; overflow: visible; padding: 0; }
.proj-gantt .gantt_cell[data-column-name="assignee"] .gantt_tree_content { overflow: visible; display: flex; align-items: center; justify-content: center; width: 100%; }
.proj-gantt .proj-date { color: var(--mute); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.proj-gantt .gantt_tree_icon.gantt_folder_open, .proj-gantt .gantt_tree_icon.gantt_folder_closed, .proj-gantt .gantt_tree_icon.gantt_file { display: none; }
.proj-gantt .gantt_layout_cell_border_right, .proj-gantt .gantt_grid { border-right: 1px solid var(--rule) !important; }

.proj-gantt .gantt_task_line { border: 0; border-radius: 999px; background: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,.10); transition: filter .12s, box-shadow .12s; }
.proj-gantt .gantt_task_line:hover { filter: brightness(1.06); box-shadow: 0 3px 10px rgba(0,0,0,.16); }
.proj-gantt .gantt_task_line.gantt_selected { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px color-mix(in srgb, var(--accent) 60%, transparent); }
.proj-gantt .gantt_task_line .gantt_task_content { font-size: 11.5px; font-weight: 600; color: #fff; padding: 0 12px; text-align: left; letter-spacing: .01em; }
.proj-gantt .gantt_task_line .gantt_task_progress { background: rgba(0,0,0,.18); border-radius: 999px 0 0 999px; }
.proj-gantt .gantt_task_line .gantt_task_progress_wrapper { border-radius: 999px; }
.proj-gantt .gantt_task_line.proj-bar-done { background: #2C9A5B; }
.proj-gantt .gantt_task_line.proj-bar-unassigned { background: color-mix(in srgb, var(--ink) 38%, var(--bg)); }
/* A phase is a bracket over its steps, not another bar */
.proj-gantt .gantt_task_line.gantt_project { background: transparent; box-shadow: none; border-radius: 0; height: 9px !important; margin-top: 7px; border-top: 3px solid var(--ink); border-left: 3px solid var(--ink); border-right: 3px solid var(--ink); border-radius: 3px 3px 0 0; }
.proj-gantt .gantt_task_line.gantt_project .gantt_task_content, .proj-gantt .gantt_task_line.gantt_project .gantt_task_progress_wrapper { display: none; }
/* dhtmlx draws the diamond in the CONTENT element (the line itself is hidden). */
.proj-gantt .gantt_task_line.gantt_milestone { box-shadow: none; }
.proj-gantt .gantt_task_line.gantt_milestone .gantt_task_content { background: var(--ink); border-radius: 4px; box-shadow: 0 0 0 3px var(--bg); padding: 0; font-size: 0; }
.proj-gantt .gantt_side_content.gantt_right { display: inline-flex; align-items: center; gap: 8px; padding-left: 12px; overflow: visible; bottom: auto; top: 50%; transform: translateY(-50%); }
.proj-gantt .proj-ms-label { font-size: 11.5px; color: var(--ink); white-space: nowrap; }
.proj-gantt .gantt_task_link .gantt_line_wrapper div { background: color-mix(in srgb, var(--ink) 35%, transparent); }
.proj-gantt .gantt_task_link .gantt_link_arrow { border-color: color-mix(in srgb, var(--ink) 35%, transparent); }
.gantt_tooltip { border: 0 !important; border-radius: 12px !important; padding: 0 !important; background: var(--ink) !important; color: var(--bg) !important; box-shadow: 0 14px 40px rgba(0,0,0,.28) !important; font-family: var(--f-sans) !important; z-index: 300; }
.proj-tip { display: flex; flex-direction: column; gap: 4px; padding: 11px 14px; max-width: 300px; font-size: 12px; line-height: 1.4; }
.proj-tip b { font-size: 13px; font-weight: 600; }
.proj-tip span { opacity: .85; }
.proj-tip-who { display: inline-flex; align-items: center; gap: 8px; opacity: 1 !important; margin-top: 2px; }
.proj-tip-who .proj-av { border-color: hsl(var(--h) 60% 62%); }
.proj-tip-mute { opacity: .55 !important; }
.proj-tip-desc { margin-top: 4px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.16); white-space: pre-wrap; }
.proj-gantt .gantt_task_cell.proj-todaycol { background: color-mix(in srgb, #E8623A 9%, transparent); border-left: 1px solid color-mix(in srgb, #E8623A 55%, transparent); border-right-color: color-mix(in srgb, #E8623A 55%, transparent); }
.proj-gantt .gantt_scale_cell.proj-todaycol { color: #C24A26; font-weight: 700; background: color-mix(in srgb, #E8623A 12%, transparent); }

/* Content Plan, månadsvy: projektets faser som tunna band överst i cellerna */
.cal-phases { display: flex; flex-direction: column; gap: 2px; margin: -8px -8px 2px; pointer-events: none; }
.cal-phase { display: block; height: 4px; background: transparent; position: relative; font-style: normal; }
.cal-phase.is-on { background: color-mix(in srgb, var(--c) 55%, transparent); pointer-events: auto; }
.cal-phase.is-start { border-radius: 3px 0 0 3px; margin-left: 6px; }
.cal-phase.is-end { border-radius: 0 3px 3px 0; margin-right: 6px; }
.cal-phase b { position: absolute; left: 8px; top: 5px; z-index: 2; font-family: var(--f-sans); font-size: 9.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: color-mix(in srgb, var(--c) 80%, var(--ink)); white-space: nowrap; pointer-events: none; }
.cal-cell:has(.cal-phase b) .daynum { margin-top: 12px; }
.cal-phase-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 10px; font-size: 11.5px; color: var(--mute); }
.cal-phase-legend-l { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.cal-phase-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.cal-phase-chip i { width: 14px; height: 4px; border-radius: 2px; background: var(--c); display: inline-block; }
.proj-cal-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--mute); cursor: pointer; margin-right: 6px; }
.proj-cal-toggle input { accent-color: var(--ink); cursor: pointer; }

/* Content Plan, veckovy: fasen som en tunn linje över de dagar den täcker */
.week-phases { display: flex; flex-direction: column; gap: 6px; margin: 0 0 8px; }
.week-phase { display: flex; flex-direction: column; gap: 4px; }
.week-phase-line { display: block; height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--c) 55%, transparent); }
.week-phase-l { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ink); }
.week-phase-l i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); display: inline-block; }
.week-phase-l em { font-style: normal; color: var(--mute); margin-left: 4px; }

/* ── Inläggsrutan: centrerad popup i stället för sidopanel ───────────────── */
.pc-backdrop { z-index: 212; }
.pc { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 213; display: flex; flex-direction: column;
  width: min(880px, calc(100vw - 40px)); height: min(86vh, 900px); min-width: 520px; min-height: 420px; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px);
  background: var(--bg); border-radius: 16px; box-shadow: 0 30px 90px rgba(0,0,0,.35), 0 0 0 1px rgba(0,0,0,.08); overflow: hidden; resize: both; animation: modal-in 220ms cubic-bezier(0.16, 1, 0.3, 1); }
.pc.is-max { width: calc(100vw - 24px); height: calc(100vh - 24px); resize: none; }
.pc-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px 26px; }
.pc-title { flex: 1; min-width: 0; border: 0; background: transparent; font-family: var(--f-display); font-size: 24px; font-weight: 500; color: var(--ink); padding: 4px 0; outline: none; border-bottom: 1px solid transparent; }
.pc-title:hover, .pc-title:focus { border-bottom-color: var(--rule); }
.pc-title::placeholder { color: var(--mute-2); }
.pc-head-meta { flex: none; }
.pc-icon { flex: none; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
.pc-icon:hover { background: var(--paper-2); }
.pc-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 26px 22px; display: flex; flex-direction: column; gap: 14px; }
.pc-body > * { flex-shrink: 0; }
.pc-empty { margin-top: 4px; }

.pc-process { border: 1px solid var(--rule); border-radius: 12px; padding: 12px 16px; background: var(--paper); display: flex; flex-direction: column; gap: 10px; }
.pc-steps { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 0; }
.pc-step { display: flex; align-items: center; gap: 8px; flex: 1 1 0; min-width: 0; font-size: 12px; color: var(--mute); position: relative; }
.pc-step:not(:last-child)::after { content: ""; flex: 1; height: 1px; background: var(--rule); margin: 0 10px; min-width: 12px; }
.pc-step.is-done:not(:last-child)::after { background: #2C9A5B; }
.pc-step-dot { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 650; border: 1.5px solid var(--rule); background: var(--bg); color: var(--mute); }
.pc-step-l { white-space: normal; line-height: 1.2; font-size: 11.5px; overflow-wrap: anywhere; }
.pc-step:not(:last-child)::after { min-width: 8px; margin: 0 8px; }
.pc-step.is-done .pc-step-dot { background: #2C9A5B; border-color: #2C9A5B; color: #fff; }
.pc-step.is-done { color: var(--ink); }
.pc-step.is-current .pc-step-dot { background: var(--ink); border-color: var(--ink); color: var(--bg); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 12%, transparent); }
.pc-step.is-current { color: var(--ink); font-weight: 650; }
.pc-step.is-next .pc-step-dot { border-color: var(--ink); color: var(--ink); border-style: dashed; }
.pc-now { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; font-size: 13px; color: var(--ink); }
.pc-who { display: inline-flex; align-items: center; gap: 4px; }
.pc-who em { font-style: normal; color: var(--mute); margin-left: 5px; font-size: 12.5px; }
.pc-who em.is-warn { color: #9A3C1F; }
.pc-approve { margin-left: auto; }
.pc-signed { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--mute); }

.pc-editor { display: flex; flex-direction: column; }
.pc-tabs { display: flex; align-items: flex-end; gap: 2px; padding: 0 6px; margin-bottom: -1px; flex-wrap: wrap; }
.pc-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px 9px; border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; background: transparent; font: inherit; font-size: 12.5px; color: var(--mute); cursor: pointer; }
.pc-tab:hover { color: var(--ink); }
.pc-tab.is-on { background: var(--bg); border-color: var(--rule); color: var(--ink); font-weight: 600; position: relative; z-index: 1; }
.pc-tab-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.pc-tab-dot.is-empty, .pc-tab-dot.is-nomedia { background: #FF9F0A; }
.pc-tab-dot.is-over { background: #D8492F; }
.pc-tabs-spacer { flex: 1; }
.pc-tab-tool { border: 0; background: transparent; font: inherit; font-size: 12px; color: var(--mute); cursor: pointer; padding: 8px 6px; }
.pc-tab-tool:hover, .pc-tab-tool.is-on { color: var(--ink); text-decoration: underline; }
.pc-box { border: 1px solid var(--rule); border-radius: 12px; background: var(--bg); display: flex; flex-direction: column; }
.pc-box.is-over { border-color: #D8492F; }
.pc-box textarea, .pc-box .text-input.copy-area { border: 0 !important; background: transparent; box-shadow: none !important; outline: none; resize: vertical; min-height: 150px; padding: 16px 18px 8px; font-size: 14.5px; line-height: 1.55; width: 100%; box-sizing: border-box; border-radius: 12px; }
.pc-box.chprev { padding: 14px 18px; }
.pc-box-bar { display: flex; align-items: center; gap: 12px; padding: 8px 14px 10px 14px; }
.pc-bar-btn { border: 0; background: transparent; font: inherit; font-size: 12px; color: var(--mute); cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.pc-bar-btn:hover:not(:disabled) { color: var(--ink); background: var(--paper-2); }
.pc-bar-btn:disabled { opacity: .4; cursor: default; }
.pc-bar-hint { font-size: 11.5px; color: var(--mute-2); }
.pc-bar-spacer { flex: 1; }
.pc-media { margin-top: 12px; }

.pc-panelbar { display: flex; gap: 4px; margin-top: 4px; }
.pc-panelbtn { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 0; border-radius: 10px 10px 0 0; background: transparent; color: var(--mute); font: inherit; font-size: 12.5px; cursor: pointer; }
.pc-panelbtn:hover { color: var(--ink); }
.pc-panelbtn.is-on { background: var(--paper-2); color: var(--ink); font-weight: 600; }
.pc-badge { font-style: normal; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #E8623A; color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.pc-panel { margin-top: -14px; background: var(--paper-2); border-radius: 0 12px 12px 12px; padding: 18px 18px 8px; display: flex; flex-direction: column; gap: 4px; }
.pc-panel .field { margin-bottom: 14px; }

.pc-foot { flex: none; display: flex; align-items: center; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--rule); background: var(--bg); }
.pc-saved { font-size: 11.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-foot-spacer { flex: 1; }
.pc-ghost { border-color: transparent; background: transparent; }
.pc-foot .tb-btn { border-radius: 999px; padding-left: 18px; padding-right: 18px; height: 38px; }
@media (max-width: 720px) { .pc { min-width: 0; width: calc(100vw - 12px); height: calc(100vh - 12px); resize: none; border-radius: 12px; } .pc-step-l { display: none; } .pc-step.is-current .pc-step-l { display: inline; } .pc-panelbtn span { display: none; } .pc-saved { display: none; } }

/* Plattformsikoner: runda märken (Simple Icons, CC0) */
.ch-ico { --s: 18px; width: var(--s); height: var(--s); flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; vertical-align: middle; box-sizing: border-box; }
.ch-ico svg { width: 56%; height: 56%; display: block; }
.ch-ico.is-full { background: #fff; }
.ch-ico.is-full svg { width: 100%; height: 100%; }
.ch-ico.is-ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.post-channels .ch-ico + .ch-ico, .ev-meta .ch-ico + .ch-ico { margin-left: 3px; }

/* Inläggsrutan, minimalistisk: en rad för processen, detaljer vid hovring/klick */
.pc-process { border: 0; background: transparent; padding: 0 2px; flex-direction: row; align-items: center; gap: 12px; min-height: 28px; }
.pc-dots { display: inline-flex; align-items: center; gap: 5px; }
.pc-dotstep { width: 8px; height: 8px; border-radius: 50%; background: var(--rule); display: inline-block; cursor: help; transition: transform .12s; }
.pc-dotstep:hover { transform: scale(1.5); }
.pc-dotstep.is-done { background: #2C9A5B; }
.pc-dotstep.is-current { background: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 14%, transparent); }
.pc-dotstep.is-next { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); }
.pc-now { font-size: 13px; color: var(--mute); gap: 6px; flex-wrap: nowrap; }
.pc-now b { color: var(--ink); font-weight: 600; }
.pc-who .proj-av + .proj-av { margin-left: -6px; }
.pc-who em { margin-left: 6px; }
.pc-approve { margin-left: auto; height: 32px; border-radius: 999px; padding: 0 16px; }
.pc-tab { padding: 7px 10px 8px; }
.pc-tab.is-on { padding-right: 14px; }
.pc-box-bar { opacity: 0; transition: opacity .15s; }
.pc-box:hover .pc-box-bar, .pc-box:focus-within .pc-box-bar, .pc-box.is-over .pc-box-bar { opacity: 1; }
.pc-tab-tool { opacity: 0; transition: opacity .15s; }
.pc-editor:hover .pc-tab-tool, .pc-tab-tool.is-on { opacity: 1; }
.pc-media .np-media-hint:not(.is-warn) { display: none; }
.pc-media .np-upl-badge { opacity: 0; transition: opacity .12s; }
.pc-media .np-upl:hover .np-upl-badge { opacity: 1; }
.pc-panelbar { gap: 2px; margin-top: 0; }
.pc-panelbtn { padding: 9px 11px; border-radius: 10px; }
.pc-panelbtn.is-on { border-radius: 10px 10px 0 0; padding-right: 14px; }
.pc-saved { font-size: 12px; }

.np-upl.is-cover { outline: 2px solid var(--ink); outline-offset: -2px; }
.np-upl-badge.is-cover { opacity: 1 !important; background: var(--ink); }
.np-upl-add.is-cover { border-style: solid; }
.pc-check { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; line-height: 1.45; text-transform: none; letter-spacing: 0; color: var(--ink); cursor: pointer; font-weight: 400; }
.pc-check input { margin-top: 3px; accent-color: var(--ink); }

/* Inläggsrutan: följer innehållet i höjd, större bilder ovanför texten */
.pc { height: auto; min-height: 0; max-height: min(90vh, 940px); }
.pc.is-max { height: calc(100vh - 24px); max-height: none; }
.pc-box .pc-media { margin: 0; padding: 14px 14px 0; }
.pc-box .pc-media .np-uploads { gap: 10px; }
.pc-box .pc-media .np-upl, .pc-box .pc-media .np-upl-add { width: 132px; height: 132px; border-radius: 12px; }
.pc-box .pc-media .np-upl-add { font-size: 12.5px; }
.pc-box textarea, .pc-box .text-input.copy-area { min-height: 110px; }
.pc-box .pc-media .np-media-hint.is-warn { margin: 8px 2px 0; }
.pc-box .pc-media .np-uploads { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.pc-box .pc-media .np-upl, .pc-box .pc-media .np-upl-add { flex: none; }

/* Månadsvyn fyller höjden; ett ensamt inlägg på dagen blir ett riktigt kort */
.cal { grid-template-rows: auto; grid-auto-rows: minmax(124px, 1fr); }
.ev-thumbwrap { position: relative; display: inline-flex; flex: none; cursor: zoom-in; }
.cal-event:not(.is-solo) .ql-badge { display: none; }
.cal-event.is-solo { flex: 1 1 auto; min-height: 0; flex-direction: column; align-items: stretch; gap: 6px; padding: 5px; border-radius: 10px; }
.cal-event.is-solo .ev-thumbwrap { flex: 1 1 0; min-height: 54px; width: 100%; border-radius: 7px; overflow: hidden; background: var(--paper-2); }
.cal-event.is-solo .ev-thumb { width: 100%; height: 100%; flex: none; border-radius: 0; object-fit: cover; position: absolute; inset: 0; }
.cal-event.is-solo .ev-thumb-empty { display: none; }
.cal-event.is-solo .ev-body { flex: none; padding: 0 2px 2px; }
.cal-event.is-solo .ev-t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 12px; font-weight: 600; }
.cal-event.is-solo .ql-badge { right: 6px; bottom: 6px; height: 22px; min-width: 26px; font-size: 11px; padding: 0 8px; }
.cal-event.is-solo .ev-meta .ch-ico { --s: 16px; }
/* "+ Skapa nytt" tar ingen plats i en dag som redan har ett inlägg — den kommer fram vid hovring. */
.cal-cell:has(.cal-event) .cal-quickadd { position: absolute; top: 5px; right: 6px; opacity: 0; pointer-events: none; margin: 0; padding: 1px 6px; border-radius: 999px; background: var(--bg); }
.cal-cell:has(.cal-event):hover .cal-quickadd { opacity: 1; pointer-events: auto; }
.pc-checkrow { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 6px; }

/* In-app dialogs (osConfirm/osAlert/osPrompt) — above every window, popup and the composer. */
.os-dialog-backdrop { z-index: 990; }
.os-dialog { z-index: 991; }
.os-dialog-msg { white-space: pre-line; }
.os-dialog .text-input { width: 100%; margin: 4px 0 14px; }
.tb-btn.is-primary.is-danger { background: #b3402a; border-color: #b3402a; color: #fff; }
/* Composer footer: discreet delete for drafts */
.pc-foot-del { opacity: .55; }
.pc-foot-del:hover { opacity: 1; color: #b3402a; }

/* ── Content Plan: ad-campaign bands ("Annonser"-toggle) ──────────────────
   Same mechanism as the project phase bands, one step quieter: a dashed /
   hatched hairline in the network's colour so an ad band is never mistaken
   for a project phase. Muted on purpose — the grid belongs to the posts. */
:root {
  --adnet-meta: #5B8FD6;
  --adnet-linkedin: #4E86B8;
  --adnet-googleads: #5FA678;
  --adnet-tiktok: #7E7E96;
  --adnet-snapchat: #C0A94A;
  --adnet-bidtheatre: #9B7BA8;
  --adnet-other: #8A8A8A;
}
html[data-theme="dark"] {
  --adnet-meta: #6FA2E4;
  --adnet-linkedin: #5E9AD0;
  --adnet-googleads: #6FBB8A;
  --adnet-tiktok: #9A9AB2;
  --adnet-snapchat: #D2BC5C;
  --adnet-bidtheatre: #B08DBD;
  --adnet-other: #9B9B9B;
}

/* Month grid — no bands for ads: long campaigns turned the month into a
   barcode. Only start/end markers under the day number, plus one muted
   count per week row in its first cell. Neither offsets .daynum. */
.cal-ad-marks { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-ad-mark {
  display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%;
  align-self: flex-start;
  font-family: var(--f-sans); font-size: 10px; line-height: 14px; color: var(--mute);
  padding: 0 6px 0 4px; border-radius: 999px;
  border: 1px dashed color-mix(in srgb, var(--c, var(--mute)) 55%, transparent);
  background: color-mix(in srgb, var(--c, var(--mute)) 8%, transparent);
  white-space: nowrap;
}
.cal-ad-mark .cal-ad-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); display: inline-block; flex: 0 0 auto; }
.cal-ad-mark i { font-style: normal; font-size: 8px; color: color-mix(in srgb, var(--c) 80%, var(--ink)); flex: 0 0 auto; }
.cal-ad-mark-t { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cal-ad-mark.is-end { opacity: .8; }
.cal-ad-mark.is-more { border-color: var(--line, rgba(0,0,0,.18)); background: transparent; padding: 0 6px; }
.cal-ad-weekpill {
  align-self: flex-start; max-width: 100%;
  font-family: var(--f-sans); font-size: 9.5px; line-height: 14px; letter-spacing: .02em;
  color: var(--mute); background: var(--paper); border: 1px solid var(--rule);
  border-radius: 999px; padding: 0 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: default;
}

/* Month legend row for the campaigns. */
.cal-ad-legend { margin-top: -4px; }
.cal-ad-chip .cal-ad-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); display: inline-block; flex: 0 0 auto; }
.cal-ad-chip { gap: 6px; color: var(--mute); }
.cal-ad-chip.is-active { color: var(--ink); }
.cal-ad-more { font-size: 11px; color: var(--mute); border: 1px dashed var(--line, rgba(0,0,0,.18)); border-radius: 999px; padding: 1px 7px; }

/* Week view — its own row group under .week-phases. */
.week-adphases { margin-top: -2px; }
.week-adphases-l { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--mute); }
.week-adphase .week-phase-line {
  background: repeating-linear-gradient(
    90deg,
    color-mix(in srgb, var(--c) 60%, transparent) 0 5px,
    transparent 5px 9px);
  border-radius: 0;
}
.week-adphase .week-phase-l { color: var(--mute); }
.week-adphase.is-active .week-phase-l { color: var(--ink); }

/* ── Projekt: det automatiska "Annonser" ──────────────────────────────────
   Raden i listan är inte ett projekt någon skapat, och ska inte se ut som
   ett: streckad ram + tagg. Staplarna färgas av nätverket, så en tidslinje
   med tre kanaler går att läsa utan att gå in i varje rad. */
.proj-item.is-auto { border: 1px dashed var(--line); }
.proj-item.is-auto.is-open { border-style: solid; }
.proj-auto-tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--mute);
  font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  vertical-align: middle;
}
.proj-net-tag { font-size: 10.5px; font-weight: 600; color: var(--mute); }
.proj-gantt .proj-ad-sub { font-size: 10.5px; color: var(--mute); white-space: nowrap; }
/* Kampanjen ritas som en hel stapel, inte som projektvyns tomma konsol:
   den bär namnet och hur stor del av perioden som gått. */
.proj-gantt .gantt_task_line.proj-bar-camp {
  height: auto !important; margin-top: 0; border: 0; border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0,0,0,.10);
}
.proj-gantt .gantt_task_line.proj-bar-camp .gantt_task_content,
.proj-gantt .gantt_task_line.proj-bar-camp .gantt_task_progress_wrapper { display: block; }
.proj-gantt .gantt_task_line.proj-bar-ad { opacity: .72; height: 16px !important; margin-top: 4px; }
.proj-gantt .gantt_task_line.proj-bar-net-meta,
.proj-gantt .gantt_task_line.proj-bar-net-facebook,
.proj-gantt .gantt_task_line.proj-bar-net-instagram { background: #1877F2; }
.proj-gantt .gantt_task_line.proj-bar-net-linkedin { background: #0A66C2; }
.proj-gantt .gantt_task_line.proj-bar-net-googleads { background: #C8500F; }
.proj-gantt .gantt_task_line.proj-bar-net-tiktok_ads { background: #3B3B44; }
.proj-gantt .gantt_task_line.proj-bar-net-snapchat_ads { background: #B99400; }
.proj-gantt .gantt_task_line.proj-bar-net-bidtheatre { background: #6B4FB8; }
.proj-gantt .gantt_task_line.proj-bar-net-other { background: var(--mute); }
.proj-net-tag.proj-bar-net-meta { color: #1877F2; }
.proj-net-tag.proj-bar-net-linkedin { color: #0A66C2; }
.proj-net-tag.proj-bar-net-googleads { color: #C8500F; }

/* ── KPI-detaljvyn: klistrad rubrikrad + "Per annons" ───────────────────────
   Rubriken (← Tillbaka, titel, period, nätverksfilter) ska följa med när man
   rullar i listan. Rullningen sker i .oswin-body (overflow:auto) — och inget
   led däremellan (.page, .kpi-detail) har overflow, vilket är villkoret för
   att sticky ska fästa mot den. Lägg aldrig overflow på .kpi-detail. */
.kpi-detail-head {
  position: sticky; top: 0; z-index: 6;
  background: var(--bg); padding: 10px 0 9px; margin-bottom: 0;
  border-bottom: 1px solid var(--rule);
}
.kpi-detail-nets { margin-left: 0; }
/* Meta = Facebook + Instagram. Ett Facebook-chip ensamt är fel på ett konto
   som levererar till båda. */
.ad-meta-chip { background: #0081FB; color: #fff; }
.ad-net-meta { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ad-net-meta b { font-family: var(--f-sans); font-size: 12px; font-weight: 600; color: var(--ink); }
.ad-net-meta.is-tag b { font-size: 11px; }
.ad-net-meta-sub { font-family: var(--f-sans); font-size: 10.5px; color: var(--mute); }
.kpimodal-cname .ad-net-meta { margin-right: 6px; }

.kpi-th-sort { cursor: pointer; user-select: none; }
.kpi-th-sort:hover { color: var(--ink); }
.kpi-adtable td.kpi-adthumb { width: 46px; padding-right: 0; }
.kpi-adthumb img { width: 38px; height: 38px; object-fit: cover; border-radius: 5px; display: block; background: var(--rule); }
.kpi-adnoimg { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 5px; background: color-mix(in oklch, var(--rule), transparent 40%); color: var(--mute); font-family: var(--f-mono); font-size: 12px; }
.kpi-adtable .kpimodal-cname { white-space: normal; }
.kpi-adname { display: block; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px; }
.kpi-adcamp { display: block; font-size: 11px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px; }
@media (max-width: 720px) {
  /* Tabellen har en extra kolumn (miniatyren) — behåll namn + nyckeltal. */
  .kpi-adtable td:nth-child(n+4), .kpi-adtable th:nth-child(n+4) { display: table-cell; }
  .kpi-adtable td:nth-child(n+5), .kpi-adtable th:nth-child(n+5) { display: none; }
}

/* ── Kampanjer: kopplade annonskampanjer + budgetstapel ─────────────────── */
.camp-adlinks { margin-top: 18px; }
.camp-item-spend { display: block; font-family: var(--f-sans); font-size: 10.5px; color: var(--mute); margin-top: 2px; }
.camp-budget { margin: 6px 0 12px; }
.camp-budget-bar { height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.camp-budget-fill { display: block; height: 100%; background: var(--accent, #3b82f6); transition: width .2s ease; }
.camp-budget-fill.is-over { background: #d9534f; }
.camp-budget-text { font-family: var(--f-sans); font-size: 11px; color: var(--mute); margin-top: 4px; }
.camp-adlink-list { display: flex; flex-direction: column; gap: 6px; }
.camp-adlink-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); }
.camp-adlink-name { flex: 1 1 auto; font-family: var(--f-sans); font-size: 12.5px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camp-adlink-status { font-family: var(--f-sans); font-size: 10px; letter-spacing: .04em; color: var(--mute); }
.camp-adlink-sum { font-family: var(--f-sans); font-size: 11.5px; color: var(--mute); padding: 4px 2px; }
.camp-adlink-span { opacity: .7; }
.camp-adpicker { border: 1px solid var(--rule); border-radius: 8px; padding: 10px; margin-bottom: 10px;
  background: var(--paper); }
.camp-adpicker-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.camp-adpicker-head .text-input { flex: 1 1 auto; }
.camp-adpicker-list { display: flex; flex-direction: column; gap: 2px; max-height: 280px; overflow: auto; }
.camp-adpicker-row { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 7px 8px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; }
.camp-adpicker-row:hover:not(:disabled) { background: var(--hover); }
.camp-adpicker-row:disabled { opacity: .5; cursor: default; }
.camp-adpicker-name { flex: 1 1 auto; font-family: var(--f-sans); font-size: 12.5px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camp-adpicker-meta { flex: 0 0 auto; font-family: var(--f-sans); font-size: 10.5px; color: var(--mute); }

/* Placering per annons: var den levererade (Facebook/Instagram/…) med andel
   av visningarna. Migration 095 + PlatformSplit i views-ads.jsx. */
.ad-plat-split { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ad-plat-one { display: inline-flex; align-items: center; gap: 3px; }
.ad-plat-pct { font-size: 11px; color: var(--muted, #777); font-variant-numeric: tabular-nums; }
.ad-plat-txt { font-size: 10px; letter-spacing: .04em; text-transform: uppercase;
               color: var(--muted, #777); border: 1px solid currentColor; border-radius: 4px; padding: 0 3px; }
.ad-adrow-name .ad-plat-split { margin-top: 2px; }
.ad-card-main .ad-plat-split { margin: 2px 0 4px; }
.kpi-adplat .ad-plat-split { gap: 6px; }

/* ── Kombinerad vy: flera arbetsytor i samma läsvy ────────────────────────
   Chippet i menybaren, kryssrutorna i dess meny, och remsan under menybaren
   som gör det omöjligt att ta skärmen för en enskild arbetsyta. Remsan är
   absolut placerad inuti .os (som bär UI-zoomen) och skrivbordet skjuts ned
   lika mycket via menybarens margin-bottom — inget fönster hamnar under. */
.os-wschip-plus { font-size: 11px; font-weight: 700; color: #8FD3FF; }
.os-wschip-combo {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
  color: #041726; background: #57B6F0; border-radius: 999px; padding: 1px 6px;
}
.os-wscombo { padding: 2px 4px 6px; display: flex; flex-direction: column; gap: 2px; }
.os-wscombo-row {
  display: flex; align-items: center; gap: 9px; padding: 5px 8px; border-radius: 6px;
  font-family: var(--f-sans); font-size: 12px; color: #E7E3DA; cursor: pointer;
}
.os-wscombo-row:hover { background: rgba(255,255,255,.08); }
.os-wscombo-row.is-self { cursor: default; }
.os-wscombo-row input { accent-color: #57B6F0; margin: 0; }
.os-wscombo-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-wscombo-self { margin-left: auto; font-size: 10px; color: #8F8B83; }
.os-wscombo-note { margin: 5px 8px 7px; font-family: var(--f-sans); font-size: 10.5px; line-height: 1.45; color: #9A958C; }
.os-wscombo-go { width: calc(100% - 16px); margin: 0 8px; justify-content: center; }

.os-combo-banner {
  position: absolute; top: 40px; left: 0; right: 0; height: 30px; z-index: 400;
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
  font-family: var(--f-sans); font-size: 11.5px; color: #DCF1FF;
  background: linear-gradient(90deg, rgba(31,94,140,.96), rgba(23,71,109,.96));
  border-bottom: 1px solid rgba(143,211,255,.45);
  box-shadow: 0 2px 10px rgba(0,0,0,.28);
}
.os-combo-banner b { color: #fff; font-weight: 600; }
.os-combo-dot { width: 7px; height: 7px; border-radius: 50%; background: #8FD3FF; flex: 0 0 auto; }
.os-combo-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-combo-end {
  margin-left: auto; flex: 0 0 auto; cursor: pointer; font-family: var(--f-sans); font-size: 11px;
  border: 1px solid rgba(143,211,255,.55); background: transparent; color: #DCF1FF;
  border-radius: 999px; padding: 2px 11px;
}
.os-combo-end:hover { background: rgba(143,211,255,.20); color: #fff; }
body.has-combo-banner .os-menubar { margin-bottom: 30px; }

/* Combined projects: the workspace a row belongs to, and what may be edited. */
.proj-rail-group {
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted, #8F8B83); padding: 12px 10px 4px; border-top: 1px solid var(--rule, #E6E1D8);
  margin-top: 6px;
}
.proj-rail-group:first-child { border-top: 0; margin-top: 0; }
.proj-ro-tag {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted, #8F8B83); border: 1px solid currentColor; border-radius: 4px;
  padding: 0 4px; margin-left: 6px; vertical-align: 1px;
}
.proj-orgpick {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px;
  padding: 8px 14px; border-bottom: 1px solid var(--rule, #E6E1D8);
  font-family: var(--f-sans); font-size: 11.5px; color: var(--ink, #2E2C29);
}
.proj-orgpick-lab { font-weight: 600; color: var(--muted, #6E6A63); }
.proj-orgpick label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.proj-orgpick input { margin: 0; }

/* ── Rapporter: detaljnivåer, betyg och arbetsytetaggar ───────────────────── */
.rep-levels { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 2px; }
.rep-level {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-family: var(--f-sans); font-size: 11.5px; color: var(--ink, #2E2C29);
  background: var(--paper, #FBF9F5); border: 1px solid var(--rule, #E6E1D8);
  border-radius: 999px; padding: 4px 11px 4px 5px;
}
.rep-level:hover { border-color: var(--ink, #2E2C29); }
.rep-level.is-on { background: var(--ink, #2E2C29); border-color: var(--ink, #2E2C29); color: #fff; }
.rep-level-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; font-size: 10px; font-weight: 700;
  background: var(--rule, #E6E1D8); color: var(--ink, #2E2C29);
}
.rep-level.is-on .rep-level-n { background: rgba(255,255,255,.28); color: #fff; }
.rep-chip.is-locked { opacity: .85; cursor: default; }


.rep-ws-tag {
  font-family: var(--f-sans); font-size: 9.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted, #6E6A63);
  border: 1px solid var(--rule, #E6E1D8); border-radius: 4px; padding: 1px 6px;
}
.rep-combo-badge {
  font-family: var(--f-sans); font-size: 9.5px; font-weight: 800; letter-spacing: .06em;
  color: #fff; background: var(--ink, #2E2C29); border-radius: 4px; padding: 1px 6px;
}

/* Annons — paid ad posts (composer form, tabs, calendar pill) */
.pc-adpill {
  font-family: var(--f-sans); font-size: 9px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
  color: var(--ink, #2E2C29); background: var(--accent-soft, #F4E7C8);
  border: 1px solid var(--rule); border-radius: 2px; padding: 2px 6px;
}
.ad-form .text-input.ad-url { flex: 1 1 200px; min-width: 150px; }
.ad-form .text-input.ad-cta { width: 140px; }
.ad-form .text-input.ad-headline { flex: 1 1 200px; min-width: 150px; }
.ad-form .text-input.ad-date { width: 150px; }
.ad-seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 3px; overflow: hidden; }
.ad-seg-btn {
  font-family: var(--f-sans); font-size: 11px; padding: 4px 10px;
  background: transparent; color: var(--mute); border: 0; cursor: pointer;
}
.ad-seg-btn + .ad-seg-btn { border-left: 1px solid var(--rule); }
.ad-seg-btn.is-on { background: var(--ink, #2E2C29); color: #fff; }
.ad-warn { font-family: var(--f-sans); font-size: 11px; color: var(--danger, #B4462F); }
.pc-tab-adna {
  font-family: var(--f-sans); font-size: 9.5px; font-style: normal;
  color: var(--mute); opacity: .75; margin-left: 5px; white-space: nowrap;
}
.autopub-adlink { font-family: var(--f-sans); font-size: 11px; color: var(--mute); text-decoration: underline; }

/* ── Composer: "Alla kanaler" (master) + tile ordering ─────────────────── */
.pc-tab-master svg { flex: none; }
.pc-tab-custom { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: transparent; border: 1.5px solid var(--mute); box-sizing: border-box; }
.pc-master-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; padding: 7px 10px; border-radius: 8px; background: var(--paper-2); border: 1px solid var(--rule); font-size: 12.5px; color: var(--mute); }
.pc-master-note span { flex: 1 1 200px; min-width: 0; }
.pc-master-note .pc-bar-btn { flex: none; }
.np-upl.is-movable { cursor: grab; }
.np-upl.is-dragging { opacity: .4; }
.np-upl.is-dropover { outline: 2px dashed var(--ink); outline-offset: -2px; }
.np-upl-move { position: absolute; right: 4px; bottom: 4px; display: flex; gap: 3px; opacity: 0; transition: opacity .12s; }
.np-upl:hover .np-upl-move, .np-upl:focus-within .np-upl-move { opacity: 1; }
.np-upl-move button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 15px; line-height: 20px; padding: 0; cursor: pointer; }
.np-upl-move button:disabled { opacity: .35; cursor: default; }
@media (hover: none) { .np-upl-move { opacity: 1; } }

/* ============================================================
   Bästa tid — hint under datum/tid + veckodagstoning i kalendern
   (views-besttime.jsx). Tonerna är transparenta så de fungerar i
   både ljust och mörkt tema.
   ============================================================ */
.besttime-hint {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 6px; font-size: 12px; color: var(--ink-2, inherit);
}
.besttime-hint.is-loading { opacity: .6; }
.besttime-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.besttime-sep { opacity: .5; }
.besttime-basis { opacity: .75; }
.besttime-use { padding: 2px 10px; font-size: 12px; margin-left: 4px; }
.besttime-weak { color: var(--st-amber); }

.cal-dow.is-best-good,  .week-head.is-best-good  { background: color-mix(in srgb, var(--st-green) 12%, transparent); }
.cal-dow.is-best-ok,    .week-head.is-best-ok    { background: color-mix(in srgb, var(--st-amber) 10%, transparent); }
.cal-dow.is-best-weak,  .week-head.is-best-weak  { background: color-mix(in srgb, #C8453B 10%, transparent); }

/* ══════════════════════════════════════════════════════════════════════════
   CLASSIC SHELL ("Klassisk") — shell-classic.jsx
   Sidebar + topbar + one content area; the alternative to the desktop shell.
   Built on the theme tokens only, so light and dark both work. Everything is
   scoped under .cls / body.shell-classic — the desktop shell is untouched.
   ══════════════════════════════════════════════════════════════════════════ */
.cls {
  position: fixed; inset: 0; display: flex; overflow: hidden;
  background: var(--bg); color: var(--ink); font-family: var(--f-sans);
  zoom: var(--ui-zoom, 1);
}

/* Sidebar */
.cls-side {
  flex: 0 0 232px; width: 232px; min-height: 0;
  display: flex; flex-direction: column;
  background: var(--paper); border-right: 1px solid var(--rule);
  transition: flex-basis .16s ease, width .16s ease;
}
.cls.is-rail .cls-side { flex-basis: 64px; width: 64px; }
.cls-side-head { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; flex: 0 0 auto; }
.cls.is-rail .cls-side-head { justify-content: center; padding: 0; }
.cls-mark {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 8px;
  background: #2E2C29; display: grid; place-items: center;
}
.cls-side-brand { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.cls-side-brand b { font-size: 14px; font-weight: 700; letter-spacing: .01em; }
.cls-side-brand span { font-size: 12px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cls-side-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.cls.is-rail .cls-side-list { padding: 4px 10px 12px; }
.cls-navgroup {
  padding: 14px 10px 4px; font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--mute-2);
}
.cls-navsep { height: 1px; background: var(--rule); margin: 8px 6px; flex: 0 0 auto; }
.cls-navitem {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%;
  height: 36px; flex: 0 0 36px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-2); font-size: 13.5px; text-align: left;
}
.cls-navitem:hover { background: var(--hover); color: var(--ink); }
.cls-navitem:focus-visible, .cls-iconbtn:focus-visible, .cls-side-toggle:focus-visible,
.cls-avatar:focus-visible, .cls-profmenu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cls-navitem .ico { width: 18px; height: 18px; flex: 0 0 18px; color: var(--mute); }
.cls-navitem.is-active { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--rule); }
.cls-navitem.is-active .ico { color: var(--accent); }
.cls-navlabel { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cls-navbadge {
  flex: 0 0 auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: grid; place-items: center; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.cls.is-rail .cls-navitem { justify-content: center; padding: 0; }
.cls.is-rail .cls-navlabel { display: none; }
.cls.is-rail .cls-navbadge { position: absolute; top: 1px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 9.5px; }
.cls-side-toggle {
  display: flex; align-items: center; gap: 10px; flex: 0 0 34px; height: 34px;
  margin: 6px 12px 12px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--mute); font-size: 12.5px;
}
.cls-side-toggle:hover { background: var(--hover); color: var(--ink); }
.cls-side-toggle .ico { width: 16px; height: 16px; flex: 0 0 16px; }
.cls-side-toggle .ico.is-flipped { transform: scaleX(-1); }
.cls.is-rail .cls-side-toggle { justify-content: center; padding: 0; margin: 6px 10px 12px; }

/* Main column + topbar */
.cls-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.cls-topbar {
  position: relative; z-index: 50; flex: 0 0 56px;
  display: flex; align-items: center; gap: 10px; padding: 0 16px 0 24px;
  background: var(--bg); border-bottom: 1px solid var(--rule);
}
.cls-title {
  margin: 0; min-width: 0; font-family: var(--f-sans); font-size: 17px; font-weight: 600;
  letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cls-topbar-spacer { flex: 1; }
.cls-appmenus { display: flex; align-items: center; gap: 2px; margin-left: 6px; padding-left: 10px; border-left: 1px solid var(--rule); }
.cls-appmenus .studio-menu-btn { color: var(--ink-2); font-size: 12.5px; padding: 6px 10px; border-radius: 6px; }
.cls-appmenus .studio-menu-btn:hover, .cls-appmenus .studio-menu-btn.is-open { background: var(--hover); color: var(--ink); }
.cls-appmenus .studio-menu-drop { top: calc(100% + 6px); border-radius: 8px; z-index: 600; }

/* Menubar controls re-skinned for a light (token-coloured) topbar */
.cls-topbar .os-lang { border-color: var(--rule); }
.cls-topbar .os-lang-b { color: var(--mute); }
.cls-topbar .os-lang-b.is-on { background: var(--paper-2); color: var(--ink); }
.cls-topbar .os-lang-b:hover:not(.is-on) { color: var(--ink); }
.cls-topbar .os-wschip:not(.is-guest) { border-color: var(--rule); color: var(--mute); }
.cls-topbar .os-wschip:not(.is-guest) b { color: var(--ink); }
.cls-topbar .os-wschip b { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.cls-topbar .os-wschip.is-btn:not(.is-guest):hover,
.cls-topbar .os-wschip.is-btn:not(.is-guest).is-open { background: var(--hover); border-color: var(--rule-2); }
html:not([data-theme="dark"]) .cls-topbar .os-wschip.is-guest { color: #8A4B00; background: color-mix(in srgb, #FF9F0A, transparent 86%); }
html:not([data-theme="dark"]) .cls-topbar .os-wschip.is-guest b,
html:not([data-theme="dark"]) .cls-topbar .os-wschip-leave { color: #6E3C00; }
.cls-topbar .os-wsmenu { left: auto; right: 0; z-index: 600; }

.cls-iconbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; min-width: 34px; padding: 0 8px;
  border: 1px solid transparent; border-radius: 8px; background: transparent;
  color: var(--mute); font-size: 18px; line-height: 1;
}
.cls-iconbtn:hover { background: var(--hover); color: var(--ink); }
.cls-iconbtn.is-on { background: var(--paper-2); border-color: var(--rule); color: var(--ink); }
.cls-iconbtn .ico { width: 16px; height: 16px; }
.cls-searchbtn { border-color: var(--rule); padding: 0 10px 0 9px; }
.cls-kbd { font-size: 11px; font-weight: 600; color: var(--mute-2); }

.cls-profile { position: relative; margin-left: 2px; }
.cls-avatar {
  width: 32px; height: 32px; border: 0; padding: 0; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700;
}
.cls-avatar.has-photo { background: transparent; }
.cls-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cls-profmenu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 600; min-width: 240px;
  display: flex; flex-direction: column; padding: 6px;
  background: var(--bg); border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,.14);
}
html[data-theme="dark"] .cls-profmenu { box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.cls-profmenu-who { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 6px; }
.cls-profmenu-who b { font-size: 13.5px; }
.cls-profmenu-who span { font-size: 12px; color: var(--mute); }
.cls-profmenu-sep { height: 1px; background: var(--rule); margin: 5px 4px; }
.cls-profmenu-item {
  border: 0; background: transparent; text-align: left; color: var(--ink);
  padding: 8px 10px; border-radius: 6px; font-size: 13px;
}
.cls-profmenu-item:hover { background: var(--hover); }

/* Combined-view banner slot (WorkspaceChip portals into it) */
.cls-bannerslot:empty { display: none; }
.cls-bannerslot .os-combo-banner { position: static; height: 32px; box-shadow: none; }

/* First-run hint (classic: in flow; desktop: floating under the menubar) */
.cls-hint {
  display: flex; align-items: center; gap: 12px; margin: 12px 24px 0; padding: 9px 8px 9px 14px;
  background: var(--paper); color: var(--ink-2); font-family: var(--f-sans); font-size: 13px; line-height: 1.4;
  border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: 8px;
}
.cls-hint-text { flex: 1; min-width: 0; }
.cls-hint-x { border: 0; background: transparent; color: var(--mute); font-size: 18px; line-height: 1; padding: 3px 7px; border-radius: 6px; }
.cls-hint-x:hover { background: var(--hover); color: var(--ink); }
.cls-hint.is-floating {
  position: fixed; top: 52px; left: 50%; transform: translateX(-50%); z-index: 450; margin: 0;
  width: max-content; max-width: min(640px, calc(100vw - 32px));
  box-shadow: 0 12px 34px rgba(0,0,0,.28);
}

/* Content area */
.cls-content { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.cls-content > .oswin-body { flex: 1; min-height: 0; height: 100%; }

/* Start page: greeting + the desktop widgets as a plain dashboard */
.cls-start { flex: 1; min-height: 0; overflow-y: auto; padding: 28px 32px 48px; }
.cls-start-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px; align-items: start; max-width: 1280px;
}
body.shell-classic .cls-start .os-greet {
  position: static; margin: 0 0 22px; color: var(--ink); text-shadow: none;
  pointer-events: auto; user-select: text;
}
body.shell-classic .cls-start .os-greet h1 { font-size: 30px; }
body.shell-classic .cls-start .os-greet p { opacity: 1; color: var(--mute); font-size: 16px; }
body.shell-classic .cls-start .os-widgets {
  position: static; top: auto; left: auto; right: auto; width: auto;
  display: flex; flex-direction: column; gap: 16px; min-width: 0;
}
body.shell-classic .cls-start .os-logpanel {
  position: static; top: auto; left: auto; width: auto; max-height: 460px;
  display: flex; grid-column: 1 / -1;
}
body.shell-classic .cls-start .os-widget {
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 8px;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: none; transform: none; padding: 6px;
}
body.shell-classic .cls-start .os-widget::before { display: none; }
body.shell-classic .cls-start .os-widget:hover { border-color: var(--rule-2); box-shadow: none; transform: none; }
body.shell-classic .cls-start .os-widget-h,
body.shell-classic .cls-start .os-widget-n,
body.shell-classic .cls-start .os-widget-act,
body.shell-classic .cls-start .os-widget-link,
body.shell-classic .cls-start .os-widget-empty { color: var(--mute); }
body.shell-classic .cls-start .os-widget-act:hover,
body.shell-classic .cls-start .os-widget-link:hover { color: var(--ink); background: var(--hover); }
body.shell-classic .cls-start .os-kpirow,
body.shell-classic .cls-start .os-insrow,
body.shell-classic .cls-start .os-todorow { color: var(--ink); border-radius: 6px; }
body.shell-classic .cls-start .os-kpirow:hover,
body.shell-classic .cls-start .os-insrow:hover,
body.shell-classic .cls-start .os-todorow:hover { background: var(--hover); }
body.shell-classic .cls-start .os-kpirow .ico { color: var(--mute); }
body.shell-classic .cls-start .os-kpirow span { color: var(--ink-2); }
body.shell-classic .cls-start .os-kpirow .os-kpinets { color: var(--mute-2); }
body.shell-classic .cls-start .os-kpirow.is-hot b { color: var(--accent); }
body.shell-classic .cls-start .os-insdot { box-shadow: none; }
body.shell-classic .cls-start .os-institle { color: var(--ink); }
body.shell-classic .cls-start .os-insconf,
body.shell-classic .cls-start .os-todometa { color: var(--mute); }
body.shell-classic .cls-start .os-todorow .ico { color: var(--mute-2); }
body.shell-classic .cls-start .os-widget-cta { background: var(--paper-2); color: var(--ink); border-radius: 6px; }
body.shell-classic .cls-start .os-widget-cta:hover { background: var(--accent); color: #fff; }
body.shell-classic .cls-start .os-orderbrief { border-color: var(--rule); background: var(--paper); color: var(--ink); border-radius: 6px; }
body.shell-classic .cls-start .os-orderbrief::placeholder { color: var(--mute-2); }
body.shell-classic .cls-start .os-orderbrief:focus { border-color: var(--rule-2); }
body.shell-classic .cls-start .os-logrow:hover { background: var(--hover); }
body.shell-classic .cls-start .os-logwho { color: var(--ink); }
body.shell-classic .cls-start .os-lognote { color: var(--ink-2); }
body.shell-classic .cls-start .os-logtime { color: var(--mute-2); }
body.shell-classic .cls-start .setup-ring-copy span { color: var(--mute); }

/* Chat slide-over (right) */
.cls-chat {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 40; width: min(420px, 100%);
  display: flex; flex-direction: column;
  background: var(--paper); border-left: 1px solid var(--rule);
  box-shadow: -12px 0 32px rgba(0,0,0,.10);
  animation: clsSlideIn .18s ease-out both;
}
@keyframes clsSlideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.cls-chat-h {
  flex: 0 0 48px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 0 16px; border-bottom: 1px solid var(--rule); font-size: 14px; font-weight: 600;
}
.cls-chat-body { flex: 1; min-height: 0; display: flex; }
.cls-chat .mkt-dock--win { position: static; width: 100%; height: 100%; border: 0; visibility: visible; transition: none; }
.cls-chat .mkt-dock--win > * { min-width: 0; }
.cls-chat .mkt-dock--win .mkt-dock-head { display: none; }

/* A document (report) fills the content area as a panel */
.cls-docpanel { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; background: var(--bg); }
.cls-docpanel-h {
  flex: 0 0 48px; display: flex; align-items: center; gap: 12px; padding: 0 8px 0 24px;
  background: var(--bg); border-bottom: 1px solid var(--rule);
}
.cls-docpanel-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cls-docpanel-body { flex: 1; min-height: 0; overflow: auto; }

@media (max-width: 960px) {
  .cls-kbd { display: none; }
  .cls-topbar { padding-left: 16px; gap: 8px; }
  .cls-topbar .os-wschip b { max-width: 120px; }
  .cls-start { padding: 22px 20px 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .cls-side { transition: none; }
  .cls-chat { animation: none; }
}
/* Studio's own in-canvas menu row repeats the topbar menus right below them
   in the classic layout — the topbar row is the one that stays. */
body.shell-classic .studio-inmenus { display: none; }

/* ═══ end CLASSIC SHELL ═════════════════════════════════════════════════ */

/* ── Projekt: synlighet och deadline-markörer ─────────────────────────── */
.proj-priv-tag {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase;
  color: #C24A26; border: 1px solid currentColor; border-radius: 4px;
  padding: 1px 5px; margin-left: 6px; vertical-align: middle; white-space: nowrap;
}
.proj-vis { position: relative; margin-right: 8px; }
.proj-vis-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; width: 300px;
  background: var(--panel, #fff); border: 1px solid var(--line, #e3e0d8); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 12px 12px 10px;
}
.proj-vis-title { font-size: 12px; font-weight: 600; color: var(--mute); margin: 0 0 8px; }
.proj-vis-opt { display: flex; gap: 10px; align-items: flex-start; padding: 7px 6px; border-radius: 8px; cursor: pointer; }
.proj-vis-opt:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.proj-vis-opt input { margin-top: 3px; }
.proj-vis-opt b { display: block; font-size: 13px; font-weight: 600; }
.proj-vis-opt small { display: block; font-size: 11.5px; color: var(--mute); line-height: 1.35; margin-top: 2px; }
.proj-vis-people { margin-top: 8px; border-top: 1px solid var(--line, #e3e0d8); padding-top: 8px; max-height: 260px; overflow: auto; }
.proj-vis-person { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.proj-vis-person:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.proj-vis-person.is-on { font-weight: 600; }
.proj-vis-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-vis-empty { font-size: 12px; color: var(--mute); margin: 4px 6px; }

/* Egna markörer (dhtmlx marker-tillägg saknas i byggnaden): idag + varje
   milstolpe som streckad linje genom hela schemat och en flagga i skalan. */
.proj-gantt .gantt_task_data, .proj-gantt .gantt_task_scale { position: relative; }
.proj-gantt .proj-marker { position: absolute; top: 0; bottom: 0; width: 0; pointer-events: none; z-index: 2; }
.proj-gantt .proj-marker.proj-today { border-left: 2px solid #E8623A; opacity: .9; }
.proj-gantt .proj-marker.proj-ms-marker { border-left: 1px dashed #7C5CBF; opacity: .55; }
.proj-gantt .proj-marker-flag {
  position: absolute; bottom: 0; transform: translateX(-1px); z-index: 3; pointer-events: none;
  color: #fff; font-size: 10px; font-weight: 600; letter-spacing: .02em; line-height: 1;
  padding: 3px 7px; border-radius: 0 6px 6px 0; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}
.proj-gantt .proj-marker-flag.proj-today { background: #E8623A; letter-spacing: .06em; text-transform: uppercase; }
.proj-gantt .proj-marker-flag.proj-ms-marker { background: #7C5CBF; }
.proj-gantt .proj-ms-label b { color: #7C5CBF; font-weight: 700; }

/* ── Projekt: anteckningar och dokument ──────────────────────────────────────
   Listan i uppgiftspanelen / projektpanelen (.proj-docs-*), editorn som lägger
   sig över schemat inne i .proj-stage (.proj-doc-*) och tabellen (.proj-sheet-*),
   som scrollar i sidled i sin egen behållare — aldrig sidan. */
.proj-stage { position: relative; }
.proj-docs { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 8px; }
.proj-docs-panel .proj-docs { margin-top: 6px; padding-top: 0; border-top: 0; }
.proj-docs-head { display: flex; align-items: center; justify-content: space-between; }
.proj-docs-title { font-size: 11px; font-weight: 600; color: var(--mute); }
.proj-docs-empty { font-size: 12px; color: var(--mute-2); }
.proj-docs-files, .proj-docs-comments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.proj-doc-row {
  width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer;
  border: 1px solid var(--rule); background: var(--paper); border-radius: 7px; padding: 7px 9px;
  font: inherit; font-size: 12.5px; color: var(--ink);
}
.proj-doc-row:hover { border-color: var(--mute-2); }
.proj-doc-ico { flex: none; width: 18px; text-align: center; font-size: 13px; }
.proj-doc-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-doc-meta { flex: none; font-size: 10.5px; color: var(--mute); white-space: nowrap; }
.proj-doc-comment { border-left: 2px solid var(--rule); padding: 2px 0 4px 9px; }
.proj-doc-comment-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 11.5px; }
.proj-doc-comment-acts { margin-left: auto; display: flex; gap: 8px; }
.proj-doc-comment-acts button { border: 0; background: none; padding: 0; cursor: pointer; font-size: 10.5px; color: var(--mute); }
.proj-doc-comment-acts button:hover { color: var(--ink); text-decoration: underline; }
.proj-doc-comment-body { font-size: 12.5px; line-height: 1.5; margin-top: 3px; overflow-wrap: anywhere; }
.proj-docs-compose { display: flex; flex-direction: column; gap: 6px; }
.proj-docs-compose textarea { resize: vertical; line-height: 1.5; }
.proj-docs-compose-row { display: flex; gap: 6px; }
.proj-docs-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.proj-docs-menu {
  margin-top: 6px; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px;
  padding: 4px; display: flex; flex-direction: column;
}
.proj-docs-menu button { border: 0; background: none; text-align: left; padding: 7px 10px; border-radius: 5px; cursor: pointer; font: inherit; font-size: 12.5px; color: var(--ink); }
.proj-docs-menu button:hover { background: var(--paper-2); }
.proj-docs-count {
  display: inline-block; min-width: 16px; margin-left: 5px; padding: 0 4px; border-radius: 8px;
  background: var(--ink); color: var(--paper); font-size: 10px; line-height: 16px; text-align: center;
}
.proj-gantt .proj-doc-clip { font-size: 10.5px; color: var(--mute); margin-right: 6px; white-space: nowrap; }

/* Editorn: ett lager över schemat. */
.proj-doc-overlay {
  position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column;
  background: var(--paper-2); min-width: 0;
}
.proj-doc-bar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid var(--rule); background: var(--paper);
}
.proj-doc-title {
  flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 15px; font-weight: 650;
  color: var(--ink); padding: 4px 0; outline: none;
}
.proj-doc-title:focus { border-bottom: 1px solid var(--rule); }
.proj-doc-status { flex: none; font-size: 11px; color: var(--mute); }
.proj-doc-status.is-err { color: #C7452F; }
.proj-doc-scroll { flex: 1; min-height: 0; overflow: auto; padding: 22px 16px 40px; }
/* A4-känsla: en sida med A4:s proportioner i bredd, som växer nedåt. */
.proj-doc-page {
  box-sizing: border-box; width: 100%; max-width: 794px; min-height: 100%; margin: 0 auto;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 3px;
  box-shadow: 0 2px 14px rgba(0,0,0,.08); padding: 56px 64px; display: flex; flex-direction: column;
}
.proj-doc-text {
  flex: 1; min-height: 480px; width: 100%; border: 0; outline: none; resize: none; background: none;
  font-family: var(--f-mono); font-size: 13px; line-height: 1.65; color: var(--ink);
}
.proj-doc-md { font-size: 14px; line-height: 1.65; }
.proj-doc-md h4 { font-size: 16px; margin: 18px 0 8px; }
@media (max-width: 700px) { .proj-doc-page { padding: 24px 18px; } }

/* Tabellen */
.proj-sheet { display: flex; flex-direction: column; gap: 10px; max-width: 100%; }
.proj-sheet-wrap {
  max-width: 100%; overflow-x: auto; background: var(--paper);
  border: 1px solid var(--rule); border-radius: 6px;
}
.proj-sheet-table { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
.proj-sheet-th, .proj-sheet-td { border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); padding: 0; text-align: left; }
.proj-sheet-th { background: var(--paper-2); font-weight: 600; font-size: 11.5px; color: var(--mute); white-space: nowrap; }
.proj-sheet-th-in { display: flex; align-items: center; gap: 4px; padding: 6px 8px; min-width: 110px; }
.proj-sheet-th.is-check .proj-sheet-th-in, .proj-sheet-th.is-act .proj-sheet-th-in { min-width: 0; }
.proj-sheet-th.is-act, .proj-sheet-td.is-act { width: 28px; border-right: 0; text-align: center; }
.proj-sheet-colname { flex: 1; min-width: 0; border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
span.proj-sheet-colname { cursor: default; }
.proj-sheet-colname:hover { color: var(--ink); }
.proj-sheet-x { border: 0; background: none; padding: 0 4px; cursor: pointer; color: var(--mute-2); font-size: 14px; line-height: 1; }
.proj-sheet-x:hover { color: #C7452F; }
.proj-sheet-input {
  box-sizing: border-box; width: 100%; min-width: 110px; border: 0; background: none; outline: none;
  font: inherit; color: var(--ink); padding: 7px 8px;
}
.proj-sheet-input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.proj-sheet-input.is-num { text-align: right; }
.proj-sheet-td.is-check { text-align: center; width: 54px; }
.proj-sheet-td.is-number { text-align: right; }
.proj-sheet-none { padding: 10px 8px; color: var(--mute-2); }
.proj-sheet-sum .proj-sheet-td { padding: 7px 8px; font-weight: 700; background: var(--paper-2); border-bottom: 0; }
.proj-sheet-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.proj-sheet-newcol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.proj-sheet-newcol .text-input { width: auto; min-width: 120px; }
.proj-sheet-sumopt { display: flex; align-items: center; gap: 4px; font-size: 12px; }

/* ── Annonser: statusfilter, egna datum, täckningsnotis ─────────────────── */
.ad-statusseg { margin-right: 4px; }
.ad-statusseg .kpimodal-segbtn { font-size: 11px; padding: 4px 9px; }
.ad-daterange { position: relative; display: inline-flex; align-items: center; margin-left: 6px; }
.ad-daterange-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; display: flex; align-items: center; gap: 6px;
  padding: 8px; background: var(--bg); border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14); white-space: nowrap;
}
.ad-daterange-pop .text-input { width: 150px; font-family: var(--f-sans); font-size: 12px; }
.ad-daterange-sep { color: var(--mute); }
.ads-partial-note {
  margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; font-family: var(--f-sans); font-size: 12px;
  background: color-mix(in oklch, #9a6a00, transparent 90%); color: #6b4a00;
  border: 1px solid color-mix(in oklch, #9a6a00, transparent 75%);
}
.ad-status.ad-muted { color: var(--mute); }

/* Förhandsvisning av annons — eget material i stället för Metas iframe */
.admodal.admodal-creative { width: min(900px, 96vw); }
.admodal-creative-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr); gap: 18px; align-items: start; justify-content: stretch; }
@media (max-width: 720px) { .admodal-creative-body { grid-template-columns: 1fr; } }
.adcre-media {
  position: relative; border-radius: 8px; overflow: hidden; min-height: 240px;
  background: repeating-conic-gradient(#F1EFE9 0% 25%, #fff 0% 50%) 0 0 / 14px 14px;
  display: flex; align-items: center; justify-content: center;
}
.adcre-media img, .adcre-media video { max-width: 100%; max-height: 70vh; display: block; object-fit: contain; }
.adcre-noimg { font-family: var(--f-sans); font-size: 12px; color: var(--mute); padding: 40px; }
.adcre-dots {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 14px; background: rgba(20,18,15,.62);
}
.adcre-dot { width: 8px; height: 8px; border-radius: 50%; border: 0; background: rgba(255,255,255,.5); cursor: pointer; padding: 0; }
.adcre-dot.is-on { background: #fff; }
.adcre-arrow { border: 0; background: none; color: #fff; font-size: 16px; line-height: 1; cursor: pointer; padding: 0 4px; }
.adcre-copy { display: flex; flex-direction: column; gap: 12px; font-family: var(--f-sans); min-width: 0; }
.adcre-body { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink); white-space: pre-wrap; max-height: 220px; overflow: auto; }
.adcre-linkcard { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper-2); }
.adcre-host { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.adcre-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.adcre-desc { font-size: 12px; color: var(--ink-2); }
.adcre-cta { align-self: flex-start; margin-top: 6px; padding: 5px 12px; border-radius: 6px; background: var(--ink); color: var(--bg); font-size: 11.5px; font-weight: 600; text-decoration: none; }
.adcre-facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: 12px; }
.adcre-facts dt { color: var(--mute); }
.adcre-facts dd { margin: 0; color: var(--ink-2); }
.adcre-metrics { margin-top: 0; }
.adcre-links { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; }
.adcre-links a { color: var(--accent); text-decoration: none; }
.adcre-links a:hover { text-decoration: underline; }
.adcre-loading { font-size: 11.5px; color: var(--mute); }

/* ══ Buggar och önskemål (public/app/feedback.jsx) ══════════════════════ */
.fb-capturing {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 2000;
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 16px;
  background: rgba(20,18,15,.86); color: #fff; font-family: var(--f-sans); font-size: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); pointer-events: none;
}
.fb-spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: fb-spin .8s linear infinite; }
@keyframes fb-spin { to { transform: rotate(360deg); } }
.fb-backdrop { position: fixed; inset: 0; z-index: 960; background: rgba(10,10,10,.32); animation: backdrop-in 200ms ease; }
.fb-dialog {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 961;
  width: min(780px, calc(100vw - 32px)); max-height: calc(100vh - 48px); min-height: min(460px, calc(100vh - 48px));
  display: flex; flex-direction: column; background: var(--bg); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 24px 70px rgba(10,10,10,.22);
  font-family: var(--f-sans);
}
html[data-theme="dark"] .fb-dialog { box-shadow: 0 24px 70px rgba(0,0,0,.6); }
.fb-head { display: flex; align-items: center; gap: 14px; padding: 14px 16px 0 20px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.fb-title { margin: 0 6px 10px 0; font-family: var(--f-display); font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.fb-tabs { display: flex; gap: 2px; align-self: flex-end; }
.fb-tab {
  border: 0; background: transparent; color: var(--mute); font-size: 13px; padding: 8px 12px 10px;
  border-bottom: 2px solid transparent; display: inline-flex; align-items: center; gap: 6px;
}
.fb-tab.is-on { color: var(--ink); border-bottom-color: var(--accent); }
.fb-count { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #C94F3D; color: #fff; font-size: 9.5px; font-weight: 700; display: inline-grid; place-items: center; }
.fb-x { margin-left: auto; align-self: flex-start; border: 0; background: transparent; color: var(--mute); font-size: 22px; line-height: 1; padding: 2px 6px; }
.fb-x:hover { color: var(--ink); }
.fb-body { overflow: auto; padding: 16px 20px 18px; min-height: 0; flex: 1 1 auto; }
.fb-body[hidden] { display: none; }
.fb-form { display: flex; flex-direction: column; gap: 12px; }
.fb-kindpick { width: 220px; }
.fb-kindpick button, .fb-toolseg button { font-size: 12px; }
.fb-field { display: flex; flex-direction: column; gap: 5px; }
.fb-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); display: flex; gap: 8px; align-items: baseline; }
.fb-count-muted { margin-left: auto; letter-spacing: 0; text-transform: none; color: var(--mute-2); font-size: 10.5px; }
.fb-field textarea { resize: vertical; min-height: 70px; font-size: 13px; }
.fb-field input.text-input { font-size: 13px; }
.fb-shot-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-toolseg { width: 170px; }
.fb-spacer { flex: 1 1 auto; }
.fb-shot-wrap {
  border: 1px solid var(--rule); border-radius: 6px; padding: 6px; background: var(--paper);
  display: flex; justify-content: center;
}
.fb-shot-canvas { display: block; max-width: 100%; max-height: 46vh; width: auto; height: auto; touch-action: none; cursor: crosshair; border-radius: 3px; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.fb-hint { font-size: 11.5px; color: var(--mute); line-height: 1.45; }
.fb-note { font-size: 12px; color: var(--ink-2); padding: 9px 12px; background: var(--paper); border: 1px dashed var(--rule-2); border-radius: 6px; }
.fb-linkbtn { border: 0; background: none; padding: 0; color: var(--accent-ink); text-decoration: underline; font-size: inherit; }
html[data-theme="dark"] .fb-linkbtn { color: var(--accent); }
.fb-disclose { align-self: flex-start; border: 0; background: none; padding: 2px 0; color: var(--ink-2); font-size: 12.5px; display: inline-flex; gap: 6px; align-items: center; }
.fb-caret { display: inline-block; transition: transform .15s; color: var(--mute); }
.fb-caret.is-open { transform: rotate(90deg); }
.fb-ctx-box { padding: 10px 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); }
.fb-ctx-dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 12px; }
.fb-ctx-dl dt { color: var(--mute); }
.fb-ctx-dl dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.fb-ctx-errs { margin: 8px 0 0; padding: 0 0 0 18px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--ink-2); max-height: 180px; overflow: auto; }
.fb-ctx-errs li { margin: 2px 0; overflow-wrap: anywhere; }
.fb-error { font-size: 12.5px; color: #b3261e; padding: 8px 12px; border: 1px solid color-mix(in srgb, #b3261e, transparent 70%); border-radius: 6px; background: color-mix(in srgb, #b3261e, transparent 93%); }
.fb-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.fb-thanks { font-size: 13px; padding: 10px 12px; border-radius: 6px; margin-bottom: 12px; background: color-mix(in srgb, #30D158, transparent 86%); border: 1px solid color-mix(in srgb, #30D158, transparent 60%); }
.fb-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.fb-list li { border-bottom: 1px solid var(--rule); }
.fb-row, .fb-arow {
  width: 100%; border: 0; background: transparent; text-align: left; color: var(--ink);
  display: flex; align-items: center; gap: 10px; padding: 10px 6px; font-size: 13px;
}
.fb-row:hover, .fb-arow:hover { background: var(--hover); }
.fb-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; background: transparent; }
.fb-row.is-unread .fb-dot { background: #C94F3D; }
.fb-row.is-unread .fb-row-title { font-weight: 700; }
.fb-row-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-row-n { font-size: 11px; color: var(--mute); flex: 0 0 auto; }
.fb-row-date { font-size: 11px; color: var(--mute); flex: 0 0 auto; white-space: nowrap; }
.fb-kind { flex: 0 0 auto; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--rule-2); color: var(--ink-2); }
.fb-kind-bug { border-color: color-mix(in srgb, #C94F3D, transparent 50%); color: #B03E2E; }
.fb-kind-wish { border-color: color-mix(in srgb, #5E5CE6, transparent 50%); color: #4B49C8; }
html[data-theme="dark"] .fb-kind-bug { color: #FF8A7A; }
html[data-theme="dark"] .fb-kind-wish { color: #A9A8FF; }
.fb-pill { flex: 0 0 auto; font-size: 11px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; background: var(--paper-2); color: var(--ink-2); }
.fb-st-new { background: color-mix(in srgb, #0A84FF, transparent 84%); color: #0759B0; }
.fb-st-in_progress { background: color-mix(in srgb, #FF9F0A, transparent 80%); color: #8A5300; }
.fb-st-done { background: color-mix(in srgb, #30D158, transparent 80%); color: #1D6E33; }
.fb-st-rejected { background: var(--paper-2); color: var(--mute); }
html[data-theme="dark"] .fb-st-new { color: #7DBBFF; }
html[data-theme="dark"] .fb-st-in_progress { color: #FFC56B; }
html[data-theme="dark"] .fb-st-done { color: #7FE39A; }
.fb-back { border: 0; background: none; padding: 0 0 10px; color: var(--accent-ink); font-size: 13px; }
html[data-theme="dark"] .fb-back { color: var(--accent); }
.fb-detail-head { display: flex; align-items: center; gap: 8px; }
.fb-detail-title { margin: 8px 0 6px; font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.fb-detail-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.55; margin-top: 10px; }
.fb-thumb-lg { display: block; margin-top: 10px; border: 1px solid var(--rule); border-radius: 6px; padding: 0; background: var(--paper); cursor: zoom-in; max-width: 100%; overflow: hidden; }
.fb-thumb-lg img { display: block; max-width: 100%; max-height: 300px; }
.fb-thumb-lg.is-admin img { max-height: 520px; }
.fb-thread { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fb-thread-empty { font-size: 12px; color: var(--mute); margin-top: 6px; }
.fb-c { padding: 8px 12px; border-radius: 8px; background: var(--paper); border: 1px solid var(--rule); font-size: 13px; }
.fb-c.is-agency { border-left: 3px solid var(--accent); }
.fb-c.is-internal { background: color-mix(in srgb, #FF9F0A, transparent 90%); border-style: dashed; }
.fb-c.is-system { background: none; border: 0; padding: 2px 4px; font-size: 12px; color: var(--mute); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.fb-c.is-system b { color: var(--ink-2); }
.fb-c-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; font-size: 12px; }
.fb-c-meta { font-size: 11px; color: var(--mute); margin-left: auto; }
.fb-c.is-system .fb-c-meta { margin-left: 4px; }
.fb-c-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.fb-tag { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--ink); color: var(--bg); letter-spacing: .03em; }
.fb-tag.is-internal { background: #B86E00; color: #fff; }
.fb-comment { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.fb-comment textarea { font-size: 13px; }
.fb-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.fb-lightbox { position: fixed; inset: 0; z-index: 975; background: rgba(20,18,15,.86); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.fb-lightbox img { max-width: 100%; max-height: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.5); background: #fff; }
.fb-lightbox-x { position: absolute; top: 12px; right: 16px; border: 0; background: none; color: #fff; font-size: 30px; line-height: 1; }
/* Agency view */
.fb-admin-filters { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 14px; }
.fb-statusfilter { flex-wrap: wrap; }
.fb-statusfilter button { display: inline-flex; gap: 6px; align-items: center; }
.fb-fcount { font-size: 10.5px; opacity: .7; }
.fb-admin-row { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-select { width: auto; min-width: 140px; font-size: 12.5px; padding: 6px 8px; }
.fb-search { flex: 1 1 220px; width: auto; font-size: 12.5px; padding: 6px 9px; }
.fb-mini { flex: 0 0 64px; width: 64px; height: 40px; border-radius: 4px; overflow: hidden; background: var(--paper-2); border: 1px solid var(--rule); }
.fb-mini img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; }
.fb-arow-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fb-arow-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fb-arow-sub { font-size: 11.5px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-detail > .fb-arow-sub { white-space: normal; }
.fb-prio { flex: 0 0 52px; font-size: 11px; color: var(--mute); }
.fb-prio-high { color: #B3261E; font-weight: 700; }
.fb-admin-ctl { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 12px 0 4px; }
.fb-admin-ctl label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--mute); text-transform: uppercase; letter-spacing: .08em; }
.fb-admin-ctl select { text-transform: none; letter-spacing: 0; }
.cls-profmenu-item.fb-menuitem { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.cls-profmenu-item.fb-menuitem .os-brandmenu-badge { margin-left: auto; }
/* iOS entry points */
.ios-appbar-act { justify-self: end; border: 0; background: transparent; color: var(--accent); padding: 8px 10px; display: grid; place-items: center; }
.ios-appbar-act .ico { width: 18px; height: 18px; }
@media (max-width: 740px) {
  .fb-dialog { left: 0; top: 0; right: 0; bottom: 0; transform: none; width: auto; max-height: none; min-height: 0; border-radius: 0; border: 0; animation: none; }
  .fb-head { padding: calc(10px + env(safe-area-inset-top, 0px)) 10px 0 14px; }
  .fb-title { font-size: 17px; margin-bottom: 4px; width: calc(100% - 40px); }
  .fb-x { position: absolute; right: 8px; top: calc(8px + env(safe-area-inset-top, 0px)); }
  .fb-body { padding: 12px 14px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .fb-shot-canvas { max-height: 40vh; }
  .fb-row { flex-wrap: wrap; }
  .fb-row-title { flex-basis: calc(100% - 120px); }
  .fb-arow { flex-wrap: wrap; }
  .fb-prio { flex-basis: auto; }
}
