/* =========================================================
   BRAND OS — 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;
  --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;
  grid-template-columns: repeat(7, 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;
}
.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 .ev-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.cal-event .ev-time { font-family: var(--f-mono); font-size: 9px; 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 */
.post-list {
  border-top: 1px solid var(--rule);
  margin-top: 20px;
}
.post-list-head, .post-list-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 2fr) 180px 100px 170px 110px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--f-sans);
  font-size: 12px;
  text-align: left;
}
.post-list-head {
  font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mute); font-weight: 500;
  background: var(--paper);
}
.post-list-row {
  background: var(--bg); border: 0; border-bottom: 1px solid var(--rule);
  width: 100%; cursor: pointer;
  transition: background-color 140ms ease;
}
.post-list-row:hover { background: var(--hover); }
.post-list-row .row-topic { font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-list-row .row-channels { display: inline-flex; gap: 4px; flex-wrap: wrap; }

.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; }
.trend-card { background: var(--bg); padding: 16px 18px 10px; display: flex; flex-direction: column; gap: 6px; }
.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, 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; }
.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;
}

/* ══ Prism 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); }

/* ── Prism "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-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-head { display: flex; flex-direction: column; gap: 7px; align-items: stretch;
  border-bottom: 2px solid var(--ink, #14171f); padding-bottom: 14px; }
.rep-d-eyebrow { display: flex; align-items: center; gap: 6px; }
.rep-d-brand { margin-left: auto; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted, #9aa1b0); font-weight: 600; }
.rep-d-titlerow { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.rep-d-title { margin: 0; font-size: 26px; letter-spacing: -0.01em; line-height: 1.18; }
.rep-export { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border-radius: 999px; border: 1.5px solid var(--ink, #14171f); background: transparent;
  font-size: 12.5px; font-weight: 650; cursor: pointer; transition: background .15s ease, color .15s ease; }
.rep-export:hover { background: var(--ink, #14171f); color: #fff; }
.rep-d-meta { font-size: 12.5px; color: var(--muted, #7a8194); }
.rep-d-headline { font-size: 15.5px; font-weight: 600; line-height: 1.55; margin: 26px 0 6px;
  padding-left: 14px; border-left: 3.5px solid var(--accent, #4f6bff); }
.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-sparkwrap { margin: 6px 0 10px; }
.rep-spark { width: 100%; height: 64px; display: block; }
.rep-sparkdates { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted, #9aa1b0); margin-top: 2px; }
/* Document typography: air instead of rules. Sections are separated by the
   space around them — a heading with room above it reads as a new section
   without a line drawn across the page. */
.rep-d-para { font-size: 13.5px; line-height: 1.72; margin: 0 0 13px; }
.rep-d-section { margin-top: 34px; }
.rep-d-section h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em;
  margin: 0 0 12px; color: var(--mute, #5C5C5C); }
.rep-d-list { margin: 4px 0 0 18px; font-size: 13.5px; line-height: 1.72; }
.rep-d-list li { margin-bottom: 7px; }
.rep-d-note { margin-top: 26px; font-size: 12px; color: var(--mute-2, #8A8780); }
.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; }
.rep-d-analysis { margin-top: 38px; padding: 20px 22px 22px; border-radius: 14px;
  background: color-mix(in srgb, #5a4a9f, transparent 95%);
  border: 1px solid color-mix(in srgb, #5a4a9f, transparent 82%); }
.rep-d-analysis h3 { margin: 0 0 6px; }
.rep-d-analysis h4 { margin: 22px 0 8px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: #5a4a9f; }
.rep-rec-effect { color: var(--muted, #7a8194); }

/* ── 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%; 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: a report on a desk ──────────────────────────────────
   The window body is the desk the paper lies on; the paper is a real A4 sheet
   (210×297 mm), so what you scroll through on screen is the same object the
   PDF export prints. */
.docwin-body { background: color-mix(in srgb, var(--paper-2), var(--ink) 7%); padding: 0 0 40px;
  container-type: inline-size; }
/* The bar sticks to the very top of the desk — the paper's own top margin is
   the bar's margin-bottom, so nothing can scroll into a gap above it. */
.repdoc-bar {
  position: sticky; top: 0; z-index: 2;
  margin: 0 0 22px; padding: 9px 16px;
  display: flex; align-items: center; gap: 12px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.repdoc-bar-name { font-size: 12px; color: var(--mute); flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repdoc-page {
  width: 210mm; min-height: 297mm; margin: 0 auto;
  background: #fff; color: var(--ink);
  padding: 18mm 20mm 22mm;
  box-shadow: 0 2px 6px rgba(10,10,10,.10), 0 18px 50px -18px rgba(10,10,10,.30);
}
/* If the desk ever gets narrower than the paper — a small screen, where the
   window's own minimum has to give way — the sheet fits itself to the desk
   instead of being cropped. Keyed to the window, not the browser viewport. */
@container (max-width: 828px) {
  .repdoc-page { width: calc(100% - 24px); padding: 14mm 14mm 18mm; }
}
.repdoc-foot {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 40px; padding-top: 10px; border-top: 1px solid var(--rule);
  font-size: 10.5px; color: var(--mute-2);
}
/* 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); }

/* ── 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 Prisms 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 Prisms 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; }
.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 ──────────────────────────────────────── */
.np-modal {
  width: 640px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  display: flex; flex-direction: column;
  padding: 0;
}
.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); }
