/* DMVerse shared styles: tokens, buttons, forms, and the signed-in app shell. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f5fa;
  --line: #e4e6f0;
  --ink: #0f1020;
  --muted: #5d6078;
  --accent: #7c5cff;        /* default accent; each feature section sets its own --c */
  --accent-hi: #6a48f2;
  --on-accent: #ffffff;
  --tile: #ffffff;
  --pink: #f23c7c; --orange: #ff8a3d; --yellow: #ffc233; --green: #2fc98e; --blue: #3b82ff; --violet: #7c5cff;
  --ok: #138a5b;
  --warn: #946200;
  --err: #c0352b;
  --display: "Archivo", "Arial Black", system-ui, sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  /* theme-aware roles: solid = dark buttons/tooltips in light mode, light ones in dark mode */
  --solid: #0f1020; --solid-hover: #2b2d4a; --on-solid: #ffffff;
  --panel: #0f1020; --on-panel: #ffffff;          /* brand panels that stay dark in both themes */
  --placeholder: #9a9cb0;
  --accent-soft: #f5f2ff; --accent-soft-hover: #ece6ff; --accent-soft-line: #ddd5ff; --accent-ring: #e4ddff;
  --err-soft: #fff5f4;
  --bar-recv: #cfc6ff;
  --thumb: linear-gradient(135deg, #ede9ff, #ffe4ee);
  --nav-bg: rgba(255, 255, 255, .9);
  --dash: #c9ccdc;
  --shadow: rgba(15, 16, 32, .35);
}
/* Dark theme: follows the system setting unless the visitor picked Light; or forced with data-theme="dark". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0e18; --surface: #151726; --surface-2: #1e2034; --line: #2b2e47; --tile: #151726;
    --ink: #ecedf7; --muted: #a3a6c2; --accent: #9b84ff; --accent-hi: #b3a1ff;
    --ok: #3fd99a; --warn: #f2b84b; --err: #ff7a6e;
    --solid: #ecedf7; --solid-hover: #ffffff; --on-solid: #0d0e18;
    --panel: #1b1d33; --placeholder: #6f7290;
    --accent-soft: rgba(155, 132, 255, .14); --accent-soft-hover: rgba(155, 132, 255, .24);
    --accent-soft-line: rgba(155, 132, 255, .38); --accent-ring: rgba(155, 132, 255, .35);
    --err-soft: rgba(255, 122, 110, .12); --bar-recv: #5d52a8;
    --thumb: linear-gradient(135deg, #24203f, #3a2235); --nav-bg: rgba(13, 14, 24, .88); --dash: #3a3d5c;
    --shadow: rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0e18; --surface: #151726; --surface-2: #1e2034; --line: #2b2e47; --tile: #151726;
  --ink: #ecedf7; --muted: #a3a6c2; --accent: #9b84ff; --accent-hi: #b3a1ff;
  --ok: #3fd99a; --warn: #f2b84b; --err: #ff7a6e;
  --solid: #ecedf7; --solid-hover: #ffffff; --on-solid: #0d0e18;
  --panel: #1b1d33; --placeholder: #6f7290;
  --accent-soft: rgba(155, 132, 255, .14); --accent-soft-hover: rgba(155, 132, 255, .24);
  --accent-soft-line: rgba(155, 132, 255, .38); --accent-ring: rgba(155, 132, 255, .35);
  --err-soft: rgba(255, 122, 110, .12); --bar-recv: #5d52a8;
  --thumb: linear-gradient(135deg, #24203f, #3a2235); --nav-bg: rgba(13, 14, 24, .88); --dash: #3a3d5c;
  --shadow: rgba(0, 0, 0, .6);
}
.c-violet { --c: #7c5cff; --on-c: #fff; }
.c-pink   { --c: #f23c7c; --on-c: #fff; }
.c-orange { --c: #ff8a3d; --on-c: #241000; }
.c-green  { --c: #2fc98e; --on-c: #04170f; }
.c-blue   { --c: #3b82ff; --on-c: #fff; }
.c-yellow { --c: #ffc233; --on-c: #241a00; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* components that set display must still hide */
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition: none !important; } }

h1, h2, h3 { font-family: var(--display); font-stretch: 100%; font-weight: 700; letter-spacing: -.03em; line-height: 1.06; margin: 0; text-wrap: balance; }

/* ---- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--solid); color: var(--on-solid); border: 0; border-radius: 999px; padding: 10px 18px; font: 600 15px/1.2 var(--body); cursor: pointer; text-decoration: none; transition: background .15s; }
.btn:hover { background: var(--solid-hover); }
.btn.lg { padding: 14px 26px; font-size: 16px; }
.btn.outline { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.outline:hover { border-color: var(--muted); background: var(--surface); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); font-weight: 500; padding: 6px 12px; font-size: 13px; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--err); }
.btn.block { width: 100%; }

/* ---- wordmark (text only, no logo image) */
.wordmark { font: 800 22px/1 var(--display); font-stretch: 100%; letter-spacing: -.035em; text-decoration: none; color: var(--ink); }

/* ---- forms */
label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=datetime-local], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit;
}
input::placeholder, textarea::placeholder { color: var(--placeholder); }
/* Our own arrow, inset like the text, instead of the browser's one pressed against the right edge */
select:not(.chip-select):not([multiple]) {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8fa8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea { min-height: 90px; resize: vertical; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }

/* ---- signed-in app shell */
.wrap { max-width: 900px; margin: 0 auto; padding: 20px 16px 72px; }
.app-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 28px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.app-header nav { display: flex; align-items: center; gap: 16px; font-size: 14px; color: var(--muted); }
.app-header nav a { text-decoration: none; }
.app-header nav a:hover { color: var(--ink); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.linkish:hover { color: var(--ink); }
.who { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
h1 { font-size: 30px; margin-bottom: 8px; }
.wrap h2 { font-size: 19px; font-stretch: 100%; font-weight: 700; letter-spacing: -.01em; margin: 0 0 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin-bottom: 16px; }
.muted { color: var(--muted); font-size: 14px; }
.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid var(--line); background: var(--surface); font-size: 15px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; transition: opacity .4s, transform .4s; }
.flash.fading { opacity: 0; transform: translateY(-6px); }
.flash-close { flex: none; background: none; border: 0; font-size: 20px; line-height: 1; color: inherit; opacity: .7; cursor: pointer; padding: 0 2px; }
.flash-close:hover { opacity: 1; }
.flash.ok { border-color: var(--ok); color: var(--ok); }
.flash.warn { border-color: var(--warn); color: var(--warn); }
.flash.error { border-color: var(--err); color: var(--err); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); }
.pill.on { color: var(--ok); border-color: var(--ok); }
.pill.off { color: var(--muted); }
.pill.failed { color: var(--err); border-color: var(--err); }
form.inline { display: inline; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }
.scroll { overflow-x: auto; }
.steps { margin: 0 0 18px; padding-left: 20px; color: var(--muted); }
.steps li { margin: 4px 0; }
details > summary { cursor: pointer; }

/* ---- dashboard frame: a sidebar on the left (sections, plan, account menu), the chosen section on the right */
body.has-sidebar .wrap { max-width: none; padding: 0; }
.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 20px 12px 14px; background: var(--surface); border-right: 1px solid var(--line); }
.sidebar > .wordmark { padding: 2px 10px 18px; font-size: 21px; }
.side-nav { display: grid; gap: 2px; }
.side-group { margin: 14px 10px 4px; font: 700 11px/1 var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.side-nav button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: 600 15px/1.2 var(--body); text-align: left; cursor: pointer; }
.side-nav button:hover { background: var(--surface-2); color: var(--ink); }
.side-nav button[aria-selected=true] { background: var(--accent-soft); color: var(--accent-hi); }
.side-nav .count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 12px; text-align: center; }
.side-nav button[aria-selected=true] .count { background: var(--surface); }
.ico { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-foot { margin-top: auto; padding-top: 16px; display: grid; gap: 8px; }
.side-plan { display: grid; gap: 6px; width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); font: 500 13px/1.2 var(--body); text-align: left; cursor: pointer; }
.side-plan:hover { border-color: var(--accent-soft-line); }
.side-plan-row { display: flex; justify-content: space-between; gap: 8px; }
.side-plan .meter { height: 6px; }
.upgrade-link { color: var(--accent-hi); font-weight: 700; }
.acct-menu { position: relative; }
.acct-menu summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); cursor: pointer; }
.acct-menu summary::-webkit-details-marker { display: none; }
.acct-menu summary:hover, .acct-menu[open] summary { border-color: var(--accent-soft-line); }
.acct-menu summary .acct-pic { width: 34px; height: 34px; }
.acct-who { display: grid; gap: 1px; min-width: 0; flex: 1; }
.acct-who strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-who small { color: var(--muted); font-size: 12px; }
.acct-menu .menu { position: absolute; left: 0; right: -24px; bottom: calc(100% + 8px); z-index: 20; display: grid; gap: 2px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px -16px var(--shadow); max-height: 70vh; overflow-y: auto; }
.acct-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; width: auto; }
.acct-menu form { margin: 0; }
.acct .ico { color: var(--ok); width: 17px; height: 17px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: 500 14px/1.3 var(--body); text-align: left; text-decoration: none; cursor: pointer; }
.menu-item:hover { background: var(--surface-2); }
.menu-item .ico { width: 18px; height: 18px; color: var(--muted); }
.menu-item .pro-tag { margin-left: auto; }
.theme-row .theme-btn { width: 28px; height: 28px; margin: -4px 0 -4px -5px; }
.main-col { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 40px; max-width: 1120px; width: 100%; box-sizing: border-box; }
.main-col .site-foot { margin-top: 40px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: clamp(26px, 3.2vw, 32px); margin: 0 0 6px; }
.page-head .muted { margin: 0; font-size: 15px; }
.home-who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.home-who h1.greeting { font-size: clamp(22px, 2.4vw, 26px); margin-bottom: 2px; overflow-wrap: anywhere; }
.acct-pic.home-pic { width: 52px; height: 52px; font-size: 18px; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--pink); margin: 4px; }
.page-head .btn .ico { width: 17px; height: 17px; margin: -3px 4px -3px 0; vertical-align: middle; }
.account-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
/* The underline is an inset shadow, so the tabs never stick out and the bar doesn't scroll up and down. */
.settings-nav { display: flex; gap: 4px; box-shadow: inset 0 -1px var(--line); margin: -4px 0 20px; overflow-x: auto; scrollbar-width: none; }
.settings-nav button { padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: 600 15px/1.2 var(--body); white-space: nowrap; cursor: pointer; }
.settings-nav button:hover { color: var(--ink); }
.settings-nav button[aria-current=page] { color: var(--ink); border-bottom-color: var(--accent); }
.settings-nav button:focus-visible { outline-offset: -3px; }
.acct-pic.big { width: 44px; height: 44px; font-size: 16px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0 0 16px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; word-break: break-word; }
.mobile-bar { display: none; }
.nav-backdrop[hidden] { display: none; }
@media (max-width: 860px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: min(280px, 86vw); height: auto; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 0 0 40px -10px var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  .nav-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(10, 10, 20, .45); }
  .mobile-bar { display: flex; align-items: center; gap: 12px; margin: -12px 0 18px; }
  .mobile-bar .wordmark { font-size: 19px; flex: 1; }
  .mobile-bar .nav-toggle { width: 38px; height: 38px; border-radius: 10px; }
  .mobile-bar .acct-pic { width: 32px; height: 32px; }
  .main-col { padding-top: 22px; }
  .acct-menu .menu { right: 0; }
}
@media (max-width: 520px) { .account-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px; } .account-tiles .tile { padding: 12px; } }
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* Automations: New / Your automations, as tabs above the content (the same style as Account settings) */
.subtabs { display: flex; gap: 4px; box-shadow: inset 0 -1px var(--line); margin: -4px 0 18px; overflow-x: auto; scrollbar-width: none; }
.subtabs button { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: 600 15px/1.2 var(--body); white-space: nowrap; cursor: pointer; }
.subtabs button:hover { color: var(--ink); }
.subtabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--accent); }
.subtabs button[aria-selected=true] .ico { color: var(--accent-hi); }
.subtabs button:focus-visible { outline-offset: -3px; }
.subtabs .ico { width: 17px; height: 17px; }
.subtabs .count { min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 12px; text-align: center; }
.subpanels { min-width: 0; container-type: inline-size; }
/* On narrower screens the builder adapts: a slimmer phone preview and stacked trigger fields, then the preview below. */
@container (max-width: 860px) {
  .subpanels .builder { grid-template-columns: minmax(0, 1fr) 250px; gap: 20px; }
  .subpanels .builder .row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .subpanels .phone { width: 250px; }
}
@container (max-width: 640px) {
  .subpanels .builder { grid-template-columns: minmax(0, 1fr); }
  .subpanels .preview { position: static; }
}
.subpanels .card.empty .btn .ico { width: 17px; height: 17px; margin: -3px 4px -3px 0; vertical-align: middle; }

.load-more { display: grid; justify-items: center; gap: 4px; margin: 20px 0 4px; text-align: center; }
.load-more .linkish { color: var(--accent-hi); text-decoration: underline; }

/* story replies: the follower's reply in the phone preview, story cards and the story picker */
.pv-story .bubble.out { justify-self: end; background: var(--accent); color: #fff; border-radius: 16px 16px 4px 16px; }
.pv-story .pv-note { text-align: right; }
.story-card .post-thumb { aspect-ratio: 9 / 16; max-height: 300px; }
#story-picker .post-opt.all .ico { width: 24px; height: 24px; color: var(--muted); }
[hidden]#post-picker, [hidden]#story-picker { display: none; }

/* ---- dashboard */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hint { margin: 6px 0 0; font-size: 13px; }
.section-title { font-size: 15px !important; color: var(--muted); text-transform: uppercase; letter-spacing: .06em !important; margin: 26px 0 12px !important; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { margin: 0 !important; }
.card.empty { text-align: center; color: var(--muted); padding: 32px 22px; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-hi); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checklist li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.checklist .tick { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; border: 1.5px solid var(--line); color: var(--muted); flex: none; }
.checklist li.done { color: var(--muted); text-decoration: line-through; }
.checklist li.done .tick { background: var(--green); border-color: var(--green); color: #04170f; text-decoration: none; }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (min-width: 980px) { .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 520px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--surface); position: relative;
        /* label, number, caption and change share rows across a line of tiles, so a two-line label doesn't push its number down */
        display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
.tile-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.tile-value { font: 800 30px/1.1 var(--display); letter-spacing: -.03em; margin: 6px 0 4px; }
.tile-hint { font-size: 12px; color: var(--muted); line-height: 1.35; }
.tile-change { font-size: 12px; color: var(--muted); margin-top: 6px; }
.tile-label { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.info { flex: none; width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); font: italic 600 11px/15px Georgia, serif; text-align: center; cursor: help; }
.info:hover::after, .info:focus::after { content: attr(data-help); position: absolute; left: 8px; right: 8px; top: 40px; z-index: 6; background: var(--solid); color: var(--on-solid); font: 400 12px/1.45 var(--body); padding: 9px 11px; border-radius: 10px; text-align: left; box-shadow: 0 10px 24px -10px rgba(0,0,0,.5); }
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 12px; }
.results-head .chip { text-decoration: none; }
.tile-change.up { color: var(--ok); }
.tile-change.down { color: var(--err); }

.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.sent, .bar.sent { background: var(--accent); }
.sw.recv, .bar.recv, .bar.received { background: var(--bar-recv); }
.sw.click, .bar.clicks { background: var(--orange); }
.chart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; height: 200px; align-items: end; }
.chart.days-30 { gap: 2px; }
.bar-col { display: flex; flex-direction: column; height: 100%; position: relative; border-radius: 8px; outline-offset: 2px; }
.bar-col:hover, .bar-col:focus-visible { background: var(--surface-2); }
.bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.bar { flex: 1; max-width: 14px; min-height: 2px; border-radius: 4px 4px 0 0; position: relative; }
.bar-value { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: var(--muted); padding-bottom: 2px; }
.tip { display: none; position: absolute; bottom: calc(100% - 20px); left: 50%; transform: translateX(-50%); z-index: 5; background: var(--solid); color: var(--on-solid); border-radius: 10px; padding: 10px 12px; font-size: 12px; line-height: 1.5; white-space: nowrap; box-shadow: 0 10px 24px -10px rgba(0,0,0,.5); pointer-events: none; }
.tip strong { display: block; margin-bottom: 4px; }
.tip span { display: flex; align-items: center; gap: 6px; }
.bar-col:hover .tip, .bar-col:focus-visible .tip { display: block; }
.bar-col:first-child .tip, .bar-col:nth-child(2) .tip { left: 0; transform: none; }
.bar-col:last-child .tip, .bar-col:nth-last-child(2) .tip { left: auto; right: 0; transform: none; }
.chart-summary { margin: -4px 0 18px; color: var(--muted); font-size: 14px; }
.chart-summary strong { color: var(--ink); }
.bar-label { text-align: center; font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.2; }
.bar-label span { display: block; }

.templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.tpl { text-align: left; display: grid; gap: 3px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; color: var(--ink); transition: border-color .15s, transform .15s, box-shadow .15s; position: relative; overflow: hidden; }
.tpl::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c); }
.tpl:hover { border-color: var(--c); transform: translateY(-1px); box-shadow: 0 6px 18px -10px var(--c); }
.tpl.locked { cursor: default; }
.tpl.locked .tpl-icon, .tpl.locked > span:last-child { opacity: .5; }
.tpl.locked strong { color: var(--muted); }
.tpl.locked::before { background: var(--line); }
.tpl.locked:hover { border-color: var(--line); transform: none; box-shadow: none; }
.tpl { align-content: start; }   /* tiles in a row share its height: keep their contents at the top */
.tpl .pro-tag { position: absolute; top: 12px; right: 12px; }   /* in the corner, so titles don't wrap around it */
.tpl-icon { font-size: 20px; }
.tpl strong { font-size: 15px; }
.tpl span:last-child { color: var(--muted); font-size: 13px; }

.inline-tools { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 14px; }
.label-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 14px 0 6px; }
.label-row label { margin: 0; }
.chip-btn, select.chip-select { display: inline-flex; align-items: center; gap: 6px; flex: none; width: auto; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--accent-soft-line); background: var(--accent-soft); color: var(--accent-hi); font: 600 13px/1.2 var(--body); cursor: pointer; transition: background .15s, border-color .15s; }
.chip-btn:hover, select.chip-select:hover { background: var(--accent-soft-hover); border-color: var(--accent); }
select.chip-select { padding-right: 28px; }
.link-box { margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.link-box > label:first-child { margin-top: 0; }
.link-box input[type=text] { background: var(--bg); }
.link-row { display: flex; gap: 8px; align-items: center; }
.link-row input { flex: 1; min-width: 0; }
.link-row select.chip-select { max-width: 200px; text-overflow: ellipsis; }
.linked-file { margin: 8px 0 0; }
.file-chip { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.file-chip[hidden], .link-row[hidden] { display: none; }
.file-thumb { width: 48px; height: 48px; flex: none; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-size: 22px; overflow: hidden; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-chip-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.file-chip-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip-text small { font-size: 12.5px; }
.file-chip a.chip-btn { text-decoration: none; }
@media (max-width: 520px) { .file-chip { flex-wrap: wrap; } .file-chip-text { flex-basis: calc(100% - 60px); } }
.draft-note { margin: 0 0 12px; padding: 9px 12px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--accent-soft-line); font-size: 14px; }
.draft-note .linkish { color: var(--accent-hi); text-decoration: underline; margin-left: 4px; }
.segmented { display: inline-flex; margin-top: 10px; padding: 3px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.segmented label { margin: 0; font-weight: 500; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 6px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); transition: background .15s, color .15s; }
.segmented input:checked + span { background: var(--solid); color: var(--on-solid); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
#button-label-box label { margin-top: 12px; }
.button-labels { margin-top: 6px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.row3 label { font-size: 13px; }
@media (max-width: 640px) { .row3 { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .link-row { flex-wrap: wrap; } }
select.compact { width: auto; padding: 6px 10px; font-size: 14px; }
#reply-count { font-weight: 400; }
#reply-count.over { color: var(--err); }
label.check { display: flex; gap: 8px; align-items: center; margin-top: 16px; font-weight: 500; }
#follow-options { margin-top: 8px; }

.rule-list { display: grid; gap: 12px; }
.rule { margin: 0; }
.rule.paused { opacity: .7; }
.rule-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.rule-top > div:first-child { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.rule .type { font-weight: 700; font-size: 14px; margin-right: 4px; }
.kw { background: var(--surface-2); border-radius: 6px; padding: 2px 8px; font-weight: 600; font-size: 14px; }
.rule-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.rule .reply { margin: 12px 0 0; white-space: pre-wrap; word-break: break-word; }
.rule-stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.rule-stats strong { color: var(--ink); }
.rule-stats .bad strong { color: var(--err); }
.rewind { display: flex; justify-content: space-between; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.rewind > div { flex: 1 1 320px; display: grid; gap: 2px; }
.rewind-status { font-size: 13px; margin-top: 4px; }
.rewind-status.done { color: var(--ok); }
.rewind-status.failed { color: var(--err); }
.rewind-status.running { color: var(--warn); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.upload { display: grid; gap: 12px; justify-items: start; }
.upload-fields { border: 0; margin: 0; padding: 0; min-width: 0; width: 100%; display: grid; gap: 12px; justify-items: start; }
.upload-fields:disabled { opacity: .5; }
.upload-fields:disabled .drop { cursor: not-allowed; }
.storage { margin: 4px 0 16px; }
.storage .hint .linkish, .flash .linkish { color: var(--accent-hi); text-decoration: underline; }
#upload-name.over { color: var(--err); }
.drop { width: 100%; margin: 0; display: grid; justify-items: center; gap: 4px; padding: 28px 16px; border: 2px dashed var(--line); border-radius: 14px; text-align: center; cursor: pointer; font-weight: 400; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-icon { font-size: 22px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
code.link { font-size: 12px; background: var(--surface-2); padding: 3px 6px; border-radius: 6px; word-break: break-all; }

.chips, .filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 12px; font: 500 14px/1.2 var(--body); color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--solid); color: var(--on-solid); border-color: var(--solid); }
.chat-card { display: flex; flex-direction: column; }
.chat-log { min-height: 320px; max-height: 58vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 2px 12px; }
.chat-empty { margin: auto; text-align: center; max-width: 520px; display: grid; gap: 12px; justify-items: center; color: var(--muted); }
.chat-empty .chips { justify-content: center; }
.msg { max-width: 85%; display: grid; gap: 6px; }
.msg-body { padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.msg.user { align-self: flex-end; }
.msg.user .msg-body { background: var(--solid); color: var(--on-solid); border-bottom-right-radius: 4px; }
.msg.assistant .msg-body { background: var(--surface-2); border-bottom-left-radius: 4px; }
.msg.thinking .msg-body { color: var(--muted); font-style: italic; background: var(--surface-2); }
.msg.error .msg-body { color: var(--err); border: 1px solid var(--err); background: var(--err-soft); }
.msg-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.chat-form { display: flex; gap: 10px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 14px; }
.chat-form textarea { min-height: 48px; }

/* profile header */
.synced { font-size: 13px; color: var(--muted); }
.tips { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 4px; }

/* automation builder: steps on the left, live phone preview on the right */
.ai-setup { border: 1px solid var(--accent-soft-line); background: var(--accent-soft); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.ai-setup > label { display: block; margin: 0 0 8px; font-weight: 600; }
.ai-setup-row { display: flex; gap: 10px; align-items: stretch; }
.ai-setup-row textarea { flex: 1; min-height: 52px; resize: vertical; margin: 0; background: var(--surface); }
.ai-setup-row .btn { flex: none; align-self: flex-end; }
.ai-setup-examples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; font-size: 13px; }
.ai-setup-examples .chip-btn { background: var(--surface); }
.ai-setup-result { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.ai-setup-result.error { color: var(--err); }
.ai-setup-result ul { margin: 6px 0 0; padding-left: 18px; }
.ai-setup-result li { color: var(--warn); }
.ai-filled { animation: ai-glow 4s ease-out; }
@keyframes ai-glow { 0%, 40% { box-shadow: 0 0 0 3px var(--accent-soft-line); border-color: var(--accent); } 100% { box-shadow: none; } }
@media (max-width: 600px) { .ai-setup-row { flex-direction: column; } .ai-setup-row .btn { align-self: stretch; } }
@media (prefers-reduced-motion: reduce) { .ai-filled { animation: none; } }
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; margin-top: 18px; }
.step { border: 0; border-top: 1px solid var(--line); margin: 0 0 6px; padding: 16px 0 6px; min-width: 0; }
.step legend { display: flex; align-items: center; gap: 10px; font: 700 16px/1 var(--display); letter-spacing: -.01em; padding: 0 10px 0 0; }
.step-n { width: 24px; height: 24px; border-radius: 50%; background: var(--solid); color: var(--on-solid); display: grid; place-items: center; font: 700 13px/1 var(--body); }
.label-like { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 8px; }
.post-choice { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.post-opt { margin: 0; flex: none; cursor: pointer; font-weight: 400; position: relative; }
.post-opt input { position: absolute; opacity: 0; pointer-events: none; }
.post-opt span { width: 92px; height: 112px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface-2) center/cover; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; position: relative; }
.post-opt img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.post-opt small { position: relative; display: block; font-size: 11px; line-height: 1.25; padding: 4px 6px; background: rgba(15,16,32,.72); color: #fff; }
.post-opt.all span { justify-content: center; align-items: center; text-align: center; gap: 2px; font-size: 22px; padding: 6px; }
.post-opt.all strong { font-size: 12px; line-height: 1.2; }
.post-opt.all small { background: none; color: var(--muted); padding: 0; }
.post-opt input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.post-opt input:checked + span::after { content: "✓"; position: absolute; top: 6px; right: 6px; z-index: 2; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font: 700 13px/22px var(--body); text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.post-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.preview { position: sticky; top: 16px; }
.phone { width: 280px; margin: 0 auto; border: 10px solid #15162a; border-radius: 38px; background: var(--bg); overflow: hidden; box-shadow: 0 24px 50px -28px rgba(15,16,32,.55); display: flex; flex-direction: column; height: 560px; position: relative; }
.phone-notch { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 86px; height: 20px; border-radius: 12px; background: #15162a; }
.phone-head { display: flex; align-items: center; gap: 8px; padding: 36px 14px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--pink), var(--orange)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; position: relative; overflow: hidden; flex: none; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }   /* the letter shows if the picture fails */
.phone-screen { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; font-size: 13px; }
.pv-comment { border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: grid; gap: 4px; }
.pv-post { height: 92px; border-radius: 8px; background: var(--thumb) center/cover; display: flex; align-items: flex-end; overflow: hidden; }
.pv-post span { font-size: 11px; background: rgba(15,16,32,.7); color: #fff; padding: 3px 7px; border-radius: 0 6px 0 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-c { margin: 0; line-height: 1.35; word-break: break-word; }
.pv-c.reply { padding-left: 14px; color: var(--muted); }
.pv-dm { display: grid; gap: 6px; }
.bubble { justify-self: start; max-width: 92%; background: var(--surface-2); border-radius: 16px 16px 16px 4px; padding: 9px 12px; white-space: pre-wrap; word-break: break-word; line-height: 1.4; display: grid; gap: 8px; }
.pv-placeholder { color: var(--placeholder); font-style: italic; }
.pv-btn { display: block; text-align: center; background: var(--surface); border-radius: 10px; padding: 7px 10px; font-weight: 600; color: var(--blue); }
.pv-link { color: var(--blue); text-decoration: underline; word-break: break-all; margin-top: -4px; }
.pv-sample { opacity: .55; font-style: italic; }   /* a stand-in until the creator pastes a real link */
.pv-note { margin: 0; text-align: center; color: var(--muted); font-size: 11px; }
.phone-input { margin: 8px 10px 12px; border-radius: 999px; background: var(--surface-2); padding: 8px 14px; color: var(--placeholder); font-size: 13px; }

.rule-scope { margin: 10px 0 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.rule-scope img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }
.rule-button { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.rule-button span { display: inline-block; border: 1px solid var(--line); border-radius: 8px; padding: 2px 10px; font-weight: 600; color: var(--blue); }

/* product carousel: editor, phone preview and automations list */
.msg-type { margin: 0 0 4px; }
.carousel-box { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.pc-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.pc-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 12px; }
.pc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.pc-tools { display: flex; gap: 4px; }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 600 14px/1 var(--body); cursor: pointer; display: grid; place-items: center; padding: 0; }
.icon-btn:hover:not(:disabled) { border-color: var(--accent); }
.icon-btn.danger:hover:not(:disabled) { border-color: var(--err); color: var(--err); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.pc-body { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; }
.pc-thumb { width: 96px; aspect-ratio: 1; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line); overflow: hidden; display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; }
.pc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-fields { display: grid; gap: 2px; min-width: 0; }
.pc-label { display: grid; gap: 6px; margin: 8px 0 0; font-size: 14px; font-weight: 600; }
.pc-label:first-child { margin-top: 0; }
.pc-label input { font-weight: 400; }
.pc-buttons .label-like { margin: 12px 0 6px; }
.pc-button-list { display: grid; gap: 6px; margin-bottom: 8px; }
.pc-btn-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) 30px; gap: 6px; align-items: center; }
.pc-buttons .chip-btn[hidden] { display: none; }
.pc-add-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
@media (max-width: 560px) {
  .pc-body { grid-template-columns: 1fr; }
  .pc-thumb { width: 120px; }
  .pc-label .link-row input { flex-basis: 100%; }
  .pc-btn-row { grid-template-columns: 1fr 30px; }
  .pc-btn-row [data-b=url] { grid-column: 1; }
  .pc-btn-row [data-remove-button] { grid-row: 1 / span 2; grid-column: 2; }
}

.pv-carousel { flex: none; display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -12px; padding: 0 12px 4px; scrollbar-width: none; }
.pv-carousel[hidden] { display: none; }
.pv-pc { flex: 0 0 78%; scroll-snap-align: start; border-radius: 14px; background: var(--surface-2); overflow: hidden; display: flex; flex-direction: column; }
.pv-pc-img { aspect-ratio: 1; background: var(--thumb) center/cover; }
.pv-pc-body { padding: 8px 10px 10px; display: grid; gap: 6px; }
.pv-pc-body strong { font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.pv-pc-body small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: -4px; }
.pv-pc-btn { display: block; text-align: center; background: var(--surface); border-radius: 10px; padding: 6px 8px; font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rule-cards { display: flex; align-items: flex-start; gap: 10px; overflow-x: auto; margin-top: 12px; padding-bottom: 4px; }
.rule-card { flex: 0 0 150px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: grid; gap: 4px; font-size: 13px; align-content: start; }
.rule-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.rule-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule-card span { font-size: 12px; }

/* moderation (/admin) */
.btn.danger-solid { background: var(--err); color: #fff; border-color: var(--err); }
.admin-action { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.admin-action input[type=text] { flex: 1; min-width: 160px; width: auto; padding: 7px 10px; }
.admin-rules { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }
.admin-rules li { word-break: break-word; }
.card h3 { margin: 20px 0 8px; font-size: 16px; }

/* content insights */
.insights-refresh .btn:disabled { opacity: .7; cursor: default; }
.insight-summary { border-color: var(--accent-soft-line); background: var(--accent-soft); }
.insight-summary p { margin: 0; font-size: 16px; line-height: 1.5; }
.insight-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.insight-cols > .card { margin-bottom: 16px; }
@media (max-width: 760px) { .insight-cols { grid-template-columns: 1fr; gap: 0; } }
.insight-list ul { margin: 0; padding-left: 18px; display: grid; gap: 10px; }
.insight-list.good { border-top: 3px solid var(--ok); }
.insight-list.bad { border-top: 3px solid var(--warn); }
.evidence { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }
.insight-posts { display: grid; gap: 10px; }
.insight-post { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; color: inherit; text-decoration: none; }
.insight-post > span:last-child { display: grid; gap: 2px; min-width: 0; font-size: 13px; }
.insight-post .post-thumb.sm { width: 56px; height: 56px; border-radius: 8px; }
.insight-post .strip-caption { padding: 0; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.times { font-weight: 700; font-size: 13px; }
.times.up { color: var(--ok); }
.times.down { color: var(--warn); }
.audience-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.audience-list .muted { display: block; font-size: 13px; }
.word-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.idea { display: grid; gap: 8px; align-content: start; margin: 0; }
.idea h3 { margin: 0; font-size: 16px; }
.idea p { margin: 0; }
.idea-hook { font-style: italic; }
.idea .pill { justify-self: start; }
.idea .chip-btn { justify-self: start; }

/* cross-posting (Post tab) */
.post-upsell { position: relative; }
.post-upsell .pro-tag { position: absolute; top: 16px; right: 16px; }
.ticks-list { margin: 0 0 16px; padding-left: 18px; display: grid; gap: 4px; }
.connections { display: grid; gap: 10px; }
.connection { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.connection > span:nth-child(2) { display: grid; gap: 2px; flex: 1; min-width: 0; }
.connection small { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connection.soon { opacity: .6; }
.connection .avatar { width: 34px; height: 34px; font-size: 14px; }
.avatar.yt { background: #ff0033; }
.avatar.fb { background: #1877f2; font-family: Georgia, serif; font-size: 18px; }
.post-fields { border: 0; margin: 0; padding: 0; min-width: 0; }
.post-fields:disabled .step { opacity: .55; }
.video-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.video-picked { display: grid; gap: 2px; min-width: 0; }
.video-picked strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
#video-warn { color: var(--warn); }
.target-choice { display: flex; gap: 10px; flex-wrap: wrap; }
.target { margin: 0; cursor: pointer; }
.target input { position: absolute; opacity: 0; pointer-events: none; }
.target span { display: grid; gap: 2px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; font-weight: 600; min-width: 170px; }
.target small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.target input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.target input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.target input:disabled + span { opacity: .5; cursor: not-allowed; }
.platform-fields { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.platform-fields[hidden] { display: none; }
.platform-fields h3 { margin: 0 0 4px; font-size: 15px; }
.platform-fields > label:first-of-type { margin-top: 6px; }   /* only the section's first field, not labels inside rows */
[data-count].over { color: var(--warn); }
.post-ai { margin-bottom: 4px; }
#schedule-box { margin-top: 10px; max-width: 320px; }
.post-list { display: grid; gap: 12px; }
.post-item { margin: 0; }
.post-item-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.post-item-head strong { word-break: break-word; }
.post-targets { display: grid; gap: 8px; margin-top: 12px; }
.post-target { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.pt-name { font-weight: 600; min-width: 110px; }
.pt-status { padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line); font-size: 12.5px; }
.post-target[data-status=published] .pt-status { color: var(--ok); border-color: var(--ok); }
.post-target[data-status=failed] .pt-status { color: var(--err); border-color: var(--err); }
.post-target[data-status=uploading] .pt-status, .post-target[data-status=processing] .pt-status { color: var(--accent-hi); border-color: var(--accent); }
.pt-link { margin-left: auto; font-weight: 600; }
.pt-error { flex-basis: 100%; margin: 0; color: var(--err); font-size: 13px; }

/* posts & reels */
.posts-head { align-items: center; margin-bottom: 16px; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.post-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.post-thumb { aspect-ratio: 4 / 5; background: var(--thumb); position: relative; overflow: hidden; display: block; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-type { position: absolute; top: 8px; left: 8px; background: rgba(15,16,32,.72); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.post-body { padding: 12px 14px 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; flex: 1; }
.post-stats { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.post-caption { margin: 0; font-weight: 600; font-size: 14px; line-height: 1.35; }
.post-meta { margin: 0; font-size: 12px; }
.post-caption { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-foot { margin-top: auto; padding-top: 8px; width: 100%; display: grid; gap: 10px; }
.post-status { display: flex; flex-wrap: wrap; gap: 4px; }
.post-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.post-actions .btn { white-space: nowrap; }
.post-actions .btn:not(.ghost) { padding: 7px 14px; font-size: 13px; }
.count-badge { display: inline-block; background: var(--pink); color: #fff; font: 700 13px/1 var(--body); padding: 4px 8px; border-radius: 8px; vertical-align: middle; margin-left: 4px; }
.post-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.strip-item { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 0; overflow: hidden; text-align: left; cursor: pointer; font: inherit; color: var(--ink); display: grid; transition: border-color .15s; }
.strip-item:hover { border-color: var(--accent); }
.post-thumb.sm { aspect-ratio: 1; }
.strip-caption { font-size: 13px; font-weight: 600; padding: 8px 10px 0; line-height: 1.3; }
.strip-cta { font-size: 13px; color: var(--accent-hi); font-weight: 600; padding: 4px 10px 10px; }
@media (max-width: 860px) {
  .builder { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; }
}

@media (max-width: 640px) {
  .chart { gap: 3px; height: 140px; }
  .msg { max-width: 100%; }
  .rule-actions { width: 100%; }
}

/* ---- sign up / sign in */
.google { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none; transition: background .15s, border-color .15s; }
.google:hover { background: var(--surface-2); border-color: var(--muted); }
.google .g { width: 20px; height: 20px; flex: none; }   /* Google's own coloured G */
.or { display: flex; align-items: center; gap: 14px; margin: 20px 0 4px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-main { display: flex; flex-direction: column; padding: 28px clamp(20px, 6vw, 72px) 40px; }
.auth-form { margin: auto 0; width: 100%; max-width: 400px; padding: 40px 0; }
.auth-form h1 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -.04em; margin-bottom: 10px; }
.auth-form .sub { color: var(--muted); margin: 0 0 22px; }
.auth-form .error { border: 1px solid var(--err); color: var(--err); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 14px; }
.auth-form .switch { margin-top: 20px; color: var(--muted); font-size: 15px; }
.auth-form .switch a { color: var(--ink); font-weight: 600; }
.auth-form .fine { color: var(--muted); font-size: 13px; margin-top: 14px; }
.auth-side { background: var(--panel); color: var(--on-panel); padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: flex-end; gap: 28px; }
.auth-side h2 { font-size: clamp(30px, 4vw, 52px); letter-spacing: -.04em; }
.auth-side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-weight: 600; font-size: 17px; }
.auth-side li::before { content: "\2713"; font-weight: 800; margin-right: 10px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* six-colour bar used as a brand accent */
.stripe { display: flex; height: 8px; }
.stripe i { flex: 1; }
.stripe i:nth-child(1) { background: var(--violet); } .stripe i:nth-child(2) { background: var(--pink); }
.stripe i:nth-child(3) { background: var(--orange); } .stripe i:nth-child(4) { background: var(--yellow); }
.stripe i:nth-child(5) { background: var(--green); } .stripe i:nth-child(6) { background: var(--blue); }
.auth-side .stripe { height: 10px; border-radius: 99px; overflow: hidden; width: 120px; }

/* ---- light/dark button: one icon (moon in light mode, sun in dark mode) */
.theme-btn { flex: none; width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.theme-btn:hover { background: var(--surface-2); border-color: var(--muted); }
.theme-btn:active { transform: scale(.92); }
.theme-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; grid-area: 1 / 1; }
.theme-btn .icon-sun, .is-dark .theme-btn .icon-moon { display: none; }
.is-dark .theme-btn .icon-sun { display: block; color: var(--yellow); }
.auth-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ---- billing */
.usage-alert { align-items: center; }
.usage-alert .btn { flex: none; }
.meter-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.meter { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.meter.warn span { background: var(--warn); }
.meter.full span { background: var(--err); }
.plans-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.plan-card { margin: 0; display: flex; flex-direction: column; }
.plan-card.current { border-color: var(--accent); }
.plan-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.plan-top h3 { font-size: 20px; }
.plan-price, .checkout-price { font: 800 34px/1.1 var(--display); letter-spacing: -.03em; margin: 10px 0 6px; }
.plan-price small, .checkout-price small { font: 500 14px var(--body); color: var(--muted); letter-spacing: 0; }
.plan-yearly { margin: -2px 0 4px; font-size: 13px; color: var(--ok); font-weight: 600; }
.upgrade-form { display: grid; gap: 10px; }
.upgrade-form .segmented { margin-top: 0; justify-self: start; }
.plan-features { list-style: none; margin: 8px 0 16px; padding: 0; display: grid; align-content: start; gap: 7px; font-size: 14px; flex: 1; }
.plan-features li::before { content: "✓"; color: var(--ok); font-weight: 800; margin-right: 8px; }
.plan-features li.no { color: var(--muted); }
.plan-features li.no::before { content: "–"; color: var(--muted); }
.test-banner { border: 1px dashed var(--warn); color: var(--warn); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.checkout { max-width: 560px; margin: 0 auto 16px; }
.checkout-actions { display: grid; gap: 10px; margin-top: 12px; }
.portal-actions { display: grid; gap: 12px; }
.portal-actions div { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.portal-actions .muted { font-size: 13px; }
@media (max-width: 640px) { .plans-grid { grid-template-columns: 1fr; } }

.pro-tag { display: inline-block; vertical-align: middle; border: 1px solid var(--accent-soft-line); background: var(--accent-soft); color: var(--accent-hi); border-radius: 999px; padding: 0 8px; font: 700 11px/18px var(--body); letter-spacing: .02em; cursor: pointer; text-decoration: none; }
.plans-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 22px 0 12px; }
.plans-head .chip-btn { text-decoration: none; }
.pv-brand { display: block; font-size: 11px; color: var(--muted); padding-top: 6px; border-top: 1px solid var(--line); }

/* ---- plan comparison page */
.compare-intro { text-align: center; margin: 8px auto 20px; max-width: 560px; }
.compare-intro h1 { font-size: clamp(28px, 5vw, 40px); }
.compare-card { padding: 0; overflow-x: auto; }
.compare { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; }
.compare th, .compare td { border-bottom: 1px solid var(--line); padding: 12px 16px; vertical-align: middle; }
.compare thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; border-bottom: 2px solid var(--line); vertical-align: top; }
.compare .feature-col { width: 46%; }
.compare .plan-col, .compare td { text-align: center; width: 27%; }
.compare .featured { background: var(--accent-soft); }
.compare thead th.featured { background: var(--surface); box-shadow: inset 0 3px 0 var(--accent); }
.compare-plan { display: grid; justify-items: center; gap: 4px; padding: 6px 0; }
.compare-name { font: 700 18px/1.2 var(--display); color: var(--ink); text-transform: none; }
.compare-price { font: 800 30px/1.1 var(--display); color: var(--ink); letter-spacing: -.03em; }
.compare-price small { font: 500 13px var(--body); color: var(--muted); letter-spacing: 0; }
.compare-yearly { font-size: 12px; font-weight: 600; color: var(--ok); min-height: 16px; }
.compare-cta { margin-top: 8px; width: 100%; max-width: 200px; padding: 9px 14px; font-size: 14px; }
.compare tbody th[scope="row"] { text-align: left; font-weight: 500; color: var(--ink); }
.compare .group-row th { text-align: left; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 9px 16px; }
.compare .yes { color: var(--ok); font-weight: 800; font-size: 17px; }
.compare .no { color: var(--muted); font-size: 17px; }
.compare .val { font-weight: 600; font-size: 14px; }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
  .compare th, .compare td { padding: 10px 8px; font-size: 13px; }
  .compare-price { font-size: 22px; }
  .compare .feature-col { width: 40%; }
}

/* ---- Instagram account switcher */
.follow-fields { border: 0; margin: 0; padding: 0; min-width: 0; }
.follow-fields[disabled] { opacity: .55; }
.follow-fields[disabled] input, .follow-fields[disabled] textarea { cursor: not-allowed; }
.menu-label { margin: 4px 8px 6px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.acct { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: 500 14px var(--body); text-align: left; cursor: pointer; }
.acct:hover:not([disabled]) { background: var(--surface-2); }
.acct.current { cursor: default; }
.acct-pic { width: 28px; height: 28px; flex: none; border-radius: 50%; position: relative; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; font: 700 12px var(--display); color: var(--muted); }
.acct-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.acct-name { flex: 1; }

/* Terms, Privacy and Refunds pages, and the small footer on app pages */
.legal-page { max-width: 760px; margin: 0 auto 16px; padding: 28px; line-height: 1.6; }
.legal-page h2 { margin: 28px 0 8px !important; }
.legal-page h3 { font-size: 16px; margin: 18px 0 6px; }
.legal-page ul { padding-left: 20px; }
.legal-page li { margin: 4px 0; }
.legal-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.legal-nav a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--muted); }
.legal-nav a[aria-current="page"] { color: var(--ink); border-color: var(--accent); }
.legal-updated { margin-top: 28px; font-size: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.legal-draft { max-width: 760px; margin: 0 auto; }
.site-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-top: 40px; font-size: 13px; color: var(--muted); }
.site-foot a { color: var(--muted); }
@media (max-width: 560px) { .legal-page { padding: 20px 16px; } }

/* Login and security: password and delete forms */
.stack-form { display: grid; gap: 12px; max-width: 420px; }
.stack-form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.stack-form .hint { margin: -4px 0 0; }
.stack-form .btn { justify-self: start; }
.danger-zone { border-color: color-mix(in srgb, var(--err) 45%, var(--line)); }
.danger-zone details summary { list-style: none; cursor: pointer; display: inline-flex; }
.danger-zone details summary::-webkit-details-marker { display: none; }
.danger-zone details[open] summary { margin-bottom: 14px; }
.login-security { margin-top: 18px; }
.login-security > summary { cursor: pointer; color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.danger-zone .linkish { color: var(--accent-hi); text-decoration: underline; padding: 0; font: inherit; }
.danger-zone > .hint { margin: 0 0 14px; }

/* Compare all features, as a popup inside the dashboard */
.compare-dialog { border: 1px solid var(--line); border-radius: 18px; background: var(--bg); color: var(--ink); padding: 0; width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; }
.compare-dialog::backdrop { background: rgba(10, 10, 20, .55); }
.compare-dialog-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: var(--bg); border-bottom: 1px solid var(--line); }
.compare-dialog-head h2 { margin: 0; font-size: 20px; }
.compare-dialog .compare-card { margin: 16px 20px; }
.compare-dialog .compare thead th { position: static; }
.compare-dialog > .hint { margin: 0 20px 18px; text-align: center; }
.portal-dialog { width: min(640px, calc(100vw - 32px)); }
.portal-body { padding: 18px 20px 22px; }
.connect-done { max-width: 460px; margin: 60px auto; text-align: center; }

/* Connections: the platforms' own icons, and the Instagram-coloured button to add another account */
.brand-pic { width: 34px; height: 34px; flex: none; display: grid; place-items: center; }
.brand-pic .brand-ico { width: 30px; height: 30px; }
.btn.ig-btn { margin-top: 14px; gap: 8px; color: #fff; border: 0; background: linear-gradient(45deg, #f58529, #dd2a7b 45%, #8134af 75%, #515bd4); }
.btn.ig-btn:hover { filter: brightness(1.08); color: #fff; }
.btn.ig-btn .brand-ico { width: 18px; height: 18px; }

/* Insights: patterns that might be explained by something else, folded away under the two main lists */
.card.unclear { margin-bottom: 16px; }
.card.unclear summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.card.unclear summary .muted { font-size: 14px; }
.card.unclear ul { margin: 14px 0 0; padding-left: 18px; display: grid; gap: 8px; color: var(--muted); font-size: 14px; }
/* YouTube "Who can see it" and "Made for kids?" side by side: the switch sits level with the dropdown, same height */
.platform-fields .row .label-like { margin-bottom: 6px; }
.platform-fields .row > div:last-child { display: flex; flex-direction: column; }
.platform-fields .row .segmented { margin-top: 0; flex: 1; align-self: flex-start; align-items: stretch; }
.platform-fields .row .segmented label, .platform-fields .row .segmented span { display: flex; align-items: center; }

/* Publish: the video's upload progress, and the platform logos in the form */
.upload-bar { height: 6px; margin-top: 12px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.upload-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .2s; }
#upload-status.error { color: var(--err); }
.target .brand-ico, .platform-fields h3 .brand-ico, .pt-name .brand-ico { width: 18px; height: 18px; vertical-align: -3px; }
.brand-pic .acct-pic { width: 30px; height: 30px; }

/* Home: a tab for each connected platform (Instagram, YouTube, Facebook) */
.platform-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.platform-tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--muted); font: 600 14px/1.2 var(--body); cursor: pointer; }
.platform-tabs button:hover { color: var(--ink); border-color: var(--muted); }
.platform-tabs button[aria-selected=true] { background: var(--solid); color: var(--on-solid); border-color: var(--solid); }
.platform-tabs .brand-ico { width: 16px; height: 16px; }
.acct-pic.home-pic.ring-youtube { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #ff0000; }
.acct-pic.home-pic.ring-facebook { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #1877f2; }

/* Automations: Instagram or the Facebook Page */
.platform-pill .brand-ico { width: 14px; height: 14px; }
.platform-pill { display: inline-flex; align-items: center; gap: 4px; }

/* The live preview as Messenger, for Facebook automations */
.phone.messenger .messenger-head { gap: 10px; }
.phone.messenger .messenger-head .brand-ico { width: 18px; height: 18px; margin-left: auto; }
.messenger-who { display: grid; line-height: 1.15; }
.messenger-who small { color: var(--muted); font-size: 11px; }
.avatar.fb-avatar { background: #1877f2; }
.phone.messenger .bubble { background: #e9eaee; color: #050505; border-radius: 18px 18px 18px 6px; }
.phone.messenger .pv-btn { background: #fff; color: #0866ff; }
.phone.messenger .pv-link { color: #0866ff; }
.phone.messenger .phone-input { color: #65676b; background: #f0f2f5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .phone.messenger .bubble { background: #303030; color: #e4e6eb; } :root:not([data-theme=light]) .phone.messenger .pv-btn { background: #3a3b3c; color: #4599ff; } :root:not([data-theme=light]) .phone.messenger .phone-input { background: #3a3b3c; color: #b0b3b8; } }
:root[data-theme=dark] .phone.messenger .bubble { background: #303030; color: #e4e6eb; }
:root[data-theme=dark] .phone.messenger .pv-btn { background: #3a3b3c; color: #4599ff; }
:root[data-theme=dark] .phone.messenger .phone-input { background: #3a3b3c; color: #b0b3b8; }

/* Home: a card per connected account */
.account-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 18px; }
.account-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.account-card-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.account-card-who h3 { margin: 0 0 3px; font-size: 17px; overflow-wrap: anywhere; }
.account-card-platform { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.account-card-platform .brand-ico { width: 14px; height: 14px; }
.account-card-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.account-card-stats dt { font-size: 12px; color: var(--muted); }
.account-card-stats dd { margin: 2px 0 0; font: 700 20px/1.2 var(--display); }
.account-card-stats .tile-change { display: block; margin-top: 2px; font-size: 11px; }
.account-card-link { margin-top: auto; font-size: 14px; font-weight: 600; text-decoration: none; }
.account-card.add { align-items: center; justify-content: center; text-align: center; gap: 6px; border-style: dashed; background: none; color: var(--ink); font: inherit; cursor: pointer; min-height: 170px; }
.account-card.add:hover { border-color: var(--muted); background: var(--surface-2); }
.account-card.add .ico { width: 26px; height: 26px; color: var(--muted); }
.account-card.add .brand-ico { width: 30px; height: 30px; }
a.account-card.add { text-decoration: none; }
.acct-pic.home-pic.ring-instagram { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--pink); }

/* Analytics */
.analytics-head { align-items: center; }
.scope-switch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.scope-switch a { text-decoration: none; color: var(--muted); border-radius: 999px; }
.scope-all { padding: 7px 14px; border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.scope-all span { font-weight: 400; }
.scope-all[aria-current] { background: var(--solid); color: var(--on-solid) !important; border-color: var(--solid); }
.scope-pic { position: relative; display: block; padding: 2px; border: 2px solid transparent; border-radius: 999px; background: none; font: inherit; color: inherit; cursor: pointer; }
.scope-pic-img { position: relative; display: block; }
.scope-pic .acct-pic { width: 36px; height: 36px; }
.scope-pic[aria-current], .scope-pic[aria-pressed=true] { border-color: var(--ink); }
.scope-pic:not([aria-current]):not([aria-pressed=true]) .acct-pic { opacity: .75; }
.scope-pic:hover .acct-pic { opacity: 1 !important; }
button.scope-all { background: none; font: 600 14px/1.2 var(--body); color: var(--muted); cursor: pointer; border-radius: 999px; }
.scope-all[aria-pressed=true] { background: var(--solid); color: var(--on-solid) !important; border-color: var(--solid); }
.card-head .scope-switch { margin-left: auto; }
.type-cell { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.type-cell .brand-ico { width: 14px; height: 14px; }
.scope-badge { position: absolute; right: -5px; bottom: -5px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; }
.scope-badge .brand-ico { width: 13px; height: 13px; }
.period-chips { margin: -4px 0 16px; }
.profile-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.profile-card-who { flex: 1; min-width: 160px; }
.profile-card-who h2 { margin: 0 0 4px; overflow-wrap: anywhere; }
.profile-card-stats { display: flex; gap: 28px; margin: 0; }
.profile-card-stats div { display: flex; flex-direction: column-reverse; }
.profile-card-stats dd { margin: 0; font: 700 22px/1.2 var(--display); }
.profile-card-stats dt { font-size: 12px; color: var(--muted); }
.analytics-tiles { grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)) !important; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-grid > .card { margin: 0 0 16px; min-width: 0; }
@media (max-width: 860px) { .chart-grid { grid-template-columns: minmax(0, 1fr); } }
.chart-note { margin: -6px 0 16px; }
.svg-chart { position: relative; height: 170px; padding-top: 10px; }
.svg-chart svg { width: 100%; height: 160px; display: block; overflow: visible; }
.svg-chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; fill: none; }
.svg-chart-max { position: absolute; top: -8px; left: 0; font-size: 11px; color: var(--muted); }
.svg-dot { position: absolute; width: 10px; height: 10px; margin: 5px 0 0 -5px; border-radius: 50%; background: var(--surface); border: 2px solid var(--c); opacity: 0; }
.svg-chart:hover .svg-dot, .svg-dot:focus-visible { opacity: 1; }
.svg-bar-hit { position: absolute; top: 10px; height: 160px; }
.svg-bar-hit:hover, .svg-bar-hit:focus-visible { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.svg-dot:hover .tip, .svg-dot:focus-visible .tip, .svg-bar-hit:hover .tip, .svg-bar-hit:focus-visible .tip { display: block; bottom: calc(100% + 6px); }
.svg-dot .tip strong, .svg-bar-hit .tip strong { display: block; }
.chart-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.chart-empty { padding: 50px 0; text-align: center; }
.top-posts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.top-posts li { display: flex; align-items: center; gap: 12px; min-width: 0; }   /* min-width: a long caption can't push the number out */
.top-posts .post-thumb.sm, .post-cell .post-thumb.sm { width: 44px; height: 44px; border-radius: 8px; flex: none; }
.top-post-text { flex: 1; min-width: 0; font-size: 14px; }
.top-post-text > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-post-text small, .post-cell small, .acct-cell small { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.top-post-text .brand-ico, .post-cell .brand-ico, .acct-cell .brand-ico { width: 12px; height: 12px; }
.top-post-num { flex: none; text-align: right; display: flex; flex-direction: column; min-width: 72px; }
.top-post-num small { color: var(--muted); font-size: 11px; }
.heatmap { display: grid; grid-template-columns: 34px repeat(8, minmax(0, 1fr)); gap: 4px; font-size: 11px; color: var(--muted); }
.heat-col { text-align: center; }
.heat-row { align-self: center; }
.heat-cell { display: block; aspect-ratio: 1.6; border-radius: 4px; background: var(--surface-2); }
.heat-cell.l1 { background: color-mix(in srgb, var(--violet) 25%, var(--surface-2)); }
.heat-cell.l2 { background: color-mix(in srgb, var(--violet) 50%, var(--surface-2)); }
.heat-cell.l3 { background: color-mix(in srgb, var(--violet) 75%, var(--surface-2)); }
.heat-cell.l4 { background: var(--violet); }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 10px; font-size: 11px; color: var(--muted); }
.heat-legend i { width: 16px; aspect-ratio: 1; }
.split-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 2px; margin: 4px 0 14px; }
.split-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; }
.split-legend li { display: flex; align-items: center; gap: 8px; }
.split-legend i { width: 10px; height: 10px; border-radius: 3px; }
.post-cell, .acct-cell { display: flex; align-items: center; gap: 10px; min-width: 220px; text-decoration: none; color: inherit; }
.post-cell > span:last-child, .acct-cell > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.acct-cell .acct-pic.sm { width: 32px; height: 32px; }
.post-table td, .accounts-table td { vertical-align: middle; }
.post-table .ico { width: 16px; height: 16px; }
.period-chips .chip, .scope-switch a, .account-card-link { text-decoration: none; }

/* Automations: which account the builder and the list are for */
.account-switch input { position: absolute; opacity: 0; pointer-events: none; }
.account-switch .scope-pic { cursor: pointer; margin: 0; }
.account-switch .scope-pic:has(input:checked) { border-color: var(--ink); }
.account-switch .scope-pic:has(input:checked) .acct-pic { opacity: 1; }
.account-switch .scope-pic:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.account-switch .scope-pic:has(input:disabled) { cursor: default; }
.account-switch .scope-pic:has(input:disabled:not(:checked)) { opacity: .4; }

/* Media library and the Create post composer */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 0; margin: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; min-width: 0; }
.media-tile input { position: absolute; opacity: 0; pointer-events: none; }
.media-tile video { width: 100%; aspect-ratio: 9 / 12; object-fit: cover; border-radius: 12px; background: var(--thumb, var(--surface-2)); border: 2px solid transparent; display: block; }
.media-tile:hover video { border-color: var(--line); }
.media-tile:has(input:checked) video, .media-tile:focus-visible video { border-color: var(--ink); }
.media-tile:has(input:focus-visible) video { outline: 2px solid var(--blue); outline-offset: 2px; }
.media-dur { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; }
.media-dur:empty { display: none; }
.media-check { position: absolute; right: 8px; top: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--bg); display: none; place-items: center; }
.media-check .ico { width: 14px; height: 14px; }
.media-tile:has(input:checked) .media-check { display: grid; }
.media-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.media-meta .brand-ico { width: 12px; height: 12px; }
.media-actions { position: sticky; bottom: 12px; display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 12px 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px -18px rgba(0,0,0,.4); }
.media-actions #library-selected { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-drop { border-radius: 16px; outline: 2px dashed transparent; outline-offset: 6px; }
.library-drop.dragging, .composer-step.dragging { outline: 2px dashed var(--blue); outline-offset: 4px; }
.library-drop > .meter { margin: -6px 0 16px; max-width: 320px; }
.library-drop .filters { margin-bottom: 14px; }
.library-empty { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 48px 20px; border-style: dashed; cursor: pointer; font: inherit; color: var(--ink); }
.library-empty .ico { width: 28px; height: 28px; color: var(--muted); }
.library-dialog { width: min(760px, calc(100vw - 32px)); }
.library-dialog .media-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); max-height: 60vh; overflow: auto; padding: 4px; }

.composer-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .composer-grid { grid-template-columns: minmax(0, 1fr); } }
.composer-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.composer-step { margin: 0 !important; }
.composer-step > h2 { margin: 0 0 14px; display: flex; align-items: center; gap: 10px; font-size: 17px; }
.media-sources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.media-source { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 12px; border: 1.5px dashed var(--line); border-radius: 14px; background: none; font: inherit; color: var(--ink); cursor: pointer; text-align: center; }
.media-source:hover:not(:disabled) { border-color: var(--muted); background: var(--surface-2); }
.media-source:disabled { opacity: .5; cursor: default; }
.media-source .ico { width: 24px; height: 24px; color: var(--muted); }
.media-source small { color: var(--muted); font-size: 12px; }
.media-chosen { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; }
.media-chosen video { width: 64px; height: 84px; object-fit: cover; border-radius: 10px; background: var(--surface-2); flex: none; }
.media-chosen-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.media-chosen-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 12px 0 0; cursor: pointer; }
.check-line input { width: auto; margin: 0; }
.target-rows { display: grid; gap: 8px; }
.target-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; margin: 0; cursor: pointer; }
.target-row:has(input:checked) { border-color: var(--ink); }
.target-row:has(input:disabled) { cursor: default; opacity: .7; }
.target-row input { width: 18px; height: 18px; margin: 0; flex: none; }
.target-row .acct-pic { width: 34px; height: 34px; }
.target-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.target-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.target-who small { color: var(--muted); font-size: 12.5px; }
.format-chip { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.composer-captions .check-line { margin: 0 0 6px; }
.composer-bar { position: sticky; bottom: 12px; z-index: 3; display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px -18px rgba(0,0,0,.4); }
.composer-summary { margin-left: auto; font-size: 14px; }
#draft-status { font-size: 13px; }
@media (max-width: 520px) { .composer-summary { display: none; } .composer-bar .btn.lg { margin-left: auto; } }

/* Analytics tiles: a colour per metric, tinted from the theme's own surface so they work light and dark */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-tile { --c: #3b82ff; --c-text: color-mix(in srgb, var(--c) 78%, #000); background: color-mix(in srgb, var(--c) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 24%, var(--line)); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.stat-tile.tone-blue { --c: #2f6fec; } .stat-tile.tone-red { --c: #e0464e; } .stat-tile.tone-green { --c: #16a36a; }
.stat-tile.tone-purple { --c: #8b5cf6; } .stat-tile.tone-orange { --c: #ea7a1a; } .stat-tile.tone-teal { --c: #0d9f99; }
.stat-tile.tone-violet { --c: #6d5cf6; }
.stat-label { display: flex; align-items: center; gap: 6px; color: var(--c-text); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.stat-label .ico { width: 16px; height: 16px; }
.stat-label .info { margin-left: auto; }
.stat-value { color: var(--c-text); font: 800 28px/1.15 var(--display); margin-top: 8px; overflow-wrap: anywhere; }
.stat-hint { color: color-mix(in srgb, var(--c-text) 70%, var(--muted)); font-size: 12.5px; margin-top: 2px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .stat-tile { --c-text: color-mix(in srgb, var(--c) 62%, #fff); background: color-mix(in srgb, var(--c) 13%, var(--surface)); border-color: color-mix(in srgb, var(--c) 32%, var(--line)); } }
:root[data-theme=dark] .stat-tile { --c-text: color-mix(in srgb, var(--c) 62%, #fff); background: color-mix(in srgb, var(--c) 13%, var(--surface)); border-color: color-mix(in srgb, var(--c) 32%, var(--line)); }

/* Post performance: numbers well above or below the account's usual */
.num { display: inline-block; padding: 2px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.num.grade-hi { --g: #16a36a; background: color-mix(in srgb, var(--g) 14%, transparent); color: color-mix(in srgb, var(--g) 80%, var(--ink)); font-weight: 700; }
.num.grade-lo { --g: #e0464e; background: color-mix(in srgb, var(--g) 11%, transparent); color: color-mix(in srgb, var(--g) 75%, var(--ink)); }
.grade-legend { display: flex; align-items: center; gap: 6px; font-size: 13px; flex-wrap: wrap; }
.grade-legend .num { font-size: 12px; }

/* Files: folders on the left, a slim toolbar and file cards */
.files-head-actions { display: flex; align-items: center; gap: 16px; }
.storage-mini { display: grid; gap: 4px; font-size: 12.5px; min-width: 150px; text-align: right; }
.storage-mini .meter { height: 6px; }
.btn.disabled { opacity: .5; pointer-events: none; }
.upload-hint { margin: -8px 0 14px; }
.upload-hint.over { color: var(--err); }
#tab-files { border-radius: 16px; outline: 2px dashed transparent; outline-offset: 4px; }
#tab-files.dragging { outline-color: var(--blue); }
.files-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 760px) { .files-layout { grid-template-columns: minmax(0, 1fr); } .folder-list { flex-direction: row; flex-wrap: wrap; } .folder-list .folder { width: auto; } }
.folder-list { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; }
.folder { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: 600 14px/1.3 var(--body); text-align: left; cursor: pointer; list-style: none; }
.folder::-webkit-details-marker { display: none; }
.folder span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder:hover { background: var(--surface-2); color: var(--ink); }
.folder.active { background: var(--surface-2); color: var(--ink); }
.folder .ico { width: 18px; height: 18px; flex: none; }
.folder .count { min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; text-align: center; }
.new-folder form, .folder-tools form { display: flex; gap: 6px; padding: 6px 4px; }
.new-folder input, .folder-tools input { min-width: 0; flex: 1; }
.folder-tools { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 6px; }
.files-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.files-toolbar input[type=search] { flex: 1; min-width: 180px; max-width: 320px; }
.tag-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font: 600 12px/1.6 var(--body); }
button.tag { cursor: pointer; }
.tag[aria-pressed=true] { background: var(--solid); color: var(--on-solid); border-color: var(--solid); }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.file-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.file-cover { position: relative; display: grid; place-items: center; height: 120px; border-radius: 13px 13px 0 0; overflow: hidden; background: var(--surface-2); text-decoration: none; }
.file-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.file-cover.pdf { background: color-mix(in srgb, #e0464e 10%, var(--surface-2)); }
.file-cover.text { background: color-mix(in srgb, #2f6fec 10%, var(--surface-2)); }
.file-kind { position: relative; font: 800 13px var(--display); letter-spacing: .06em; padding: 4px 10px; border-radius: 8px; background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.file-cover.image .file-kind { position: absolute; left: 8px; top: 8px; font-size: 10px; padding: 2px 6px; }
.file-body { display: grid; gap: 3px; padding: 12px 14px 4px; min-width: 0; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.file-actions { display: flex; align-items: center; gap: 4px; padding: 6px 8px 10px; margin-top: auto; flex-wrap: wrap; }
.file-actions .btn { padding: 6px 10px; font-size: 13px; }
.file-actions .ico { width: 14px; height: 14px; }
.file-more { position: relative; margin-left: auto; }
.file-more summary { list-style: none; cursor: pointer; }
.file-more summary::-webkit-details-marker { display: none; }
.file-more .menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 10; display: grid; gap: 2px; min-width: 190px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -16px var(--shadow); }
.menu-item.danger { color: var(--err); }
.files-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 48px 20px; border-style: dashed; cursor: pointer; text-align: center; }
.files-empty .ico { width: 28px; height: 28px; color: var(--muted); }
.file-dialog { width: min(460px, calc(100vw - 32px)); }
.sort-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
.sort-btn:hover { color: var(--ink); }
.sort-arrow::after { content: "↕"; opacity: .35; font-size: 11px; }
th[aria-sort=descending] .sort-arrow::after { content: "↓"; opacity: 1; }
th[aria-sort=ascending] .sort-arrow::after { content: "↑"; opacity: 1; }
th[aria-sort=descending], th[aria-sort=ascending] { color: var(--ink); }

/* Your automations: one row each */
.rule-table-card { padding: 6px 8px; }
.rule-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rule-table th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; padding: 10px 10px; white-space: nowrap; }
.rule-table td { padding: 12px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.rule-table tbody tr { cursor: pointer; }
.rule-table tbody tr:hover td { background: var(--surface-2); }
.rule-table tr.paused td:not(:last-child) { opacity: .6; }
.rule-table .acct-pic { width: 30px; height: 30px; }
.rule-kws { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 3px; }
.rule-table td small { display: block; font-size: 12px; }
.rule-table .pill { margin-top: 4px; }
.rule-where { color: var(--muted); max-width: 220px; }
.rule-dm { max-width: 280px; }
.rule-dm-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.k-btn { display: inline-block; margin-top: 4px; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--blue); }
.num-cell { font-variant-numeric: tabular-nums; font-weight: 600; }
.num-cell.bad { color: var(--err); }
.nowrap { white-space: nowrap; }
.rule-table .rewind-status { margin-top: 4px; font-size: 12px; }
.rule-more .menu-item small { display: block; width: 100%; font-size: 11.5px; font-weight: 400; }
.rule-more .menu-item { flex-wrap: wrap; }
.rule-more .menu-item:disabled { opacity: .5; cursor: default; }
@media (min-width: 1000px) { .rule-table-card .scroll { overflow: visible; } }   /* room for the ⋯ menu */

/* Files as a list: folders and files in one table */
.files-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 15px; min-width: 0; }
.crumb { padding: 0; border: 0; background: none; font: inherit; color: var(--muted); cursor: pointer; }
.crumb:hover { color: var(--ink); }
.crumb-sep { color: var(--muted); }
.files-bar input[type=search] { margin-left: auto; width: 240px; max-width: 100%; }
.new-folder { position: relative; }
.new-folder summary { list-style: none; cursor: pointer; }
.new-folder summary::-webkit-details-marker { display: none; }
.new-folder .ico { width: 16px; height: 16px; }
.new-folder-form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; display: flex; gap: 6px; padding: 8px; width: 280px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -16px var(--shadow); }
.new-folder-form input { flex: 1; min-width: 0; }
.file-table-card { padding: 4px 8px; }
@media (min-width: 1000px) { .file-table-card .scroll { overflow: visible; } }   /* room for the ⋯ menu */
.file-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.file-table th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; padding: 10px; white-space: nowrap; }
.file-table td { padding: 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.file-table tbody tr:hover td { background: var(--surface-2); }
.file-cell { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; }
button.file-cell { cursor: pointer; }
.folder-open .ico { width: 22px; height: 22px; color: var(--violet); flex: none; }
.folder-open small { margin-left: 4px; }
.file-icon { position: relative; flex: none; width: 34px; height: 34px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; font: 800 9.5px var(--display); letter-spacing: .04em; background: var(--surface-2); color: var(--muted); }
.file-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.file-icon.pdf { background: color-mix(in srgb, #e0464e 14%, var(--surface-2)); color: color-mix(in srgb, #e0464e 80%, var(--ink)); }
.file-icon.text { background: color-mix(in srgb, #2f6fec 14%, var(--surface-2)); color: color-mix(in srgb, #2f6fec 80%, var(--ink)); }
.file-cell-text { display: flex; flex-direction: column; min-width: 0; }
.file-cell-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.file-tags { min-width: 140px; }
.file-tags .tag { margin: 2px 3px 2px 0; background: color-mix(in srgb, var(--blue) 12%, var(--surface)); color: color-mix(in srgb, var(--blue) 80%, var(--ink)); border-color: transparent; }
.no-tags { font-size: 12.5px; color: var(--muted); }
.folder-back td { padding: 8px 10px; text-align: left !important; }
.file-table .icon-btn .ico { width: 16px; height: 16px; }
.file-table td:last-child { text-align: right; }
.file-table .file-more { display: inline-block; margin-left: 0; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }

/* Files list: edit in place, plain row buttons */
.files-bar input[type=search] { height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: 14px var(--body); outline: none; }
.files-bar input[type=search]:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
.editable { padding: 2px 6px; margin: -2px -6px; border: 1px solid transparent; border-radius: 6px; background: none; font: 600 14px/1.4 var(--body); color: var(--ink); text-align: left; cursor: text; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editable:hover { border-color: var(--line); background: var(--surface); }
.folder-name { cursor: pointer; }
.folder-open { padding: 0; border: 0; background: none; cursor: pointer; display: grid; }
.inline-edit { height: 32px; padding: 0 10px; border: 1px solid var(--blue); border-radius: 8px; background: var(--surface); color: var(--ink); font: 14px var(--body); width: 100%; max-width: 340px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); outline: none; }
.tags-cell { min-width: 170px; cursor: text; }
.tags-cell:hover .no-tags { color: var(--ink); text-decoration: underline; }
.tags-cell .tag { margin: 2px 4px 2px 0; background: color-mix(in srgb, var(--blue) 12%, var(--surface)); color: color-mix(in srgb, var(--blue) 80%, var(--ink)); border-color: transparent; cursor: pointer; }
.no-tags { font-size: 13px; color: var(--muted); }
.row-actions .icon-btn { width: 32px; height: 32px; }
.row-actions .icon-btn.danger { color: var(--err); }
.row-actions .use-btn { padding: 5px 10px; font-size: 12.5px; white-space: nowrap; }
.row-actions form.inline { display: inline-flex; margin: 0; }
.dialog-body { padding: 18px 20px 20px; max-width: none; }
.file-dialog select { width: 100%; }
/* Labels that show when you point at an icon button (data-tip), also on keyboard focus */
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); padding: 4px 8px; border-radius: 6px; background: var(--solid); color: var(--on-solid); font: 600 12px/1.3 var(--body); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 30; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; }
.scope-sep { width: 1px; height: 26px; background: var(--line); margin: 0 2px; }

/* The login at the bottom of the sidebar, and every connected account in its menu */
.acct-pic.user-pic { background: var(--solid); color: var(--on-solid); }
a.acct { text-decoration: none; }
.acct:hover:not(:disabled) { background: var(--surface-2); }
.acct-name { display: flex; flex-direction: column; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-name small { color: var(--muted); font-size: 12px; font-weight: 400; }
.acct .scope-badge { width: 15px; height: 15px; right: -4px; bottom: -4px; }
.acct .scope-badge .brand-ico { width: 11px; height: 11px; }
.acct-menu .menu .menu-label:not(:first-child) { margin-top: 10px; }

/* Account settings > Connections: every Instagram account with its channel and Page, and how it works */
.conn-map { display: grid; gap: 8px; margin-bottom: 14px; }
.conn-map-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr) auto; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.conn-map-row.current { border-color: var(--ink); }
.conn-map-ig { display: flex; align-items: center; gap: 10px; min-width: 0; }
.conn-map-ig .acct-pic { width: 34px; height: 34px; }
.conn-map-links { display: flex; flex-wrap: wrap; gap: 8px; }
.conn-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; }
.conn-chip .acct-pic { width: 24px; height: 24px; }
.conn-chip .scope-badge { width: 13px; height: 13px; right: -3px; bottom: -3px; }
.conn-chip .scope-badge .brand-ico { width: 9px; height: 9px; }
.conn-chip.empty { padding: 5px 12px; font-weight: 400; color: var(--muted); background: none; border: 1px dashed var(--line); }
@media (max-width: 720px) { .conn-map-row { grid-template-columns: minmax(0, 1fr) auto; } .conn-map-links { grid-column: 1 / -1; grid-row: 2; } }
.conn-for { font-size: 15px; font-weight: 500; }
.how-conn summary { display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; }
.how-conn summary::-webkit-details-marker { display: none; }
.how-conn summary h2 { margin: 0; }
.how-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 12px 18px; margin: 16px 0 0; }
.how-list dt { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.how-list dt .brand-ico { width: 18px; height: 18px; }
.how-list dd { margin: 0; color: var(--muted); line-height: 1.55; }
@media (max-width: 600px) { .how-list { grid-template-columns: minmax(0, 1fr); gap: 4px; } .how-list dd { margin-bottom: 10px; } }

/* Account settings > Connections: the login, then a list per platform */
.conn-login { display: flex; align-items: center; gap: 14px; }
.conn-login > div { display: flex; flex-direction: column; }
.acct-pic.user-pic.big { width: 44px; height: 44px; font-size: 18px; }
.conn-list-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.conn-list-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.conn-list-head h2 .brand-ico { width: 20px; height: 20px; }
.conn-list-head > .muted { font-size: 13px; }
.conn-list-head .btn, .conn-list-head .pro-tag { margin-left: auto; }
.conn-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.conn-row .acct-pic { width: 36px; height: 36px; }
.conn-row-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conn-row-who strong, .conn-row-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-empty { padding: 12px 0; border-top: 1px solid var(--line); margin: 0; }
.conn-list .hint { margin-top: 8px; }

/* Create post: now or scheduled */
.when-switch { margin-top: 0; }
.schedule-pick { margin: 0; }
.schedule-pick input { padding: 8px 10px; width: auto; }
@media (max-width: 720px) { .composer-bar { flex-wrap: wrap; } .schedule-pick { flex: 1 1 100%; order: 5; } .schedule-pick input { width: 100%; } }

/* Content calendar */
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav .btn { padding: 6px 14px; font-size: 14px; }
.cal-title { margin: 0 0 0 6px; font-size: 20px; }
.cal-views { margin-top: 0; }
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; margin-bottom: 10px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.s-scheduled { --c: #7c5cff; } .s-posting { --c: #ea7a1a; } .s-done { --c: #16a36a; } .s-failed { --c: #e0464e; }
.cal { padding: 0; overflow: hidden; }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-weekdays span { padding: 8px 10px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.cal-day { min-height: 118px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; transition: background .12s; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.other { background: var(--surface-2); }
.cal-day.other .cal-num { opacity: .5; }
.cal-day.past:not(.today) .cal-num { color: var(--muted); }
.cal-day.drop-ok { background: var(--accent-soft); outline: 2px dashed var(--accent); outline-offset: -3px; }
.cal-day-head { display: flex; align-items: center; justify-content: space-between; min-height: 24px; }
.cal-num { font-size: 13px; font-weight: 600; padding: 2px 6px; border-radius: 999px; }
.cal-day.today .cal-num { background: var(--solid); color: var(--on-solid); }
.cal-add { width: 24px; height: 24px; border-radius: 7px; border: 1px solid transparent; background: none; color: var(--muted); font: 600 16px/1 var(--body); cursor: pointer; opacity: 0; transition: opacity .12s; }
.cal-day:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-add:hover { border-color: var(--line); color: var(--ink); background: var(--bg); }
@media (hover: none) { .cal-add { opacity: 1; } }
.cal-chips { display: grid; gap: 4px; }
.cal-chip { display: grid; gap: 2px; width: 100%; text-align: left; padding: 5px 7px; border: 0; border-left: 3px solid var(--c); border-radius: 7px; background: color-mix(in srgb, var(--c) 10%, var(--surface)); color: var(--ink); font: 12.5px/1.3 var(--body); cursor: pointer; min-width: 0; }
.cal-chip:hover { background: color-mix(in srgb, var(--c) 18%, var(--surface)); }
.cal-chip.movable { cursor: grab; }
.cal-chip.dragging { opacity: .45; }
.cal-chip-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cal-time { font-weight: 700; color: color-mix(in srgb, var(--c) 75%, var(--ink)); white-space: nowrap; }
.cal-icons { display: inline-flex; gap: 2px; }
.cal-icons .brand-ico { width: 13px; height: 13px; }
.cal-file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.cal-week .cal-day { min-height: 340px; }
.cal-week .cal-chip { padding: 8px 9px; gap: 4px; }
.cal-who { display: flex; align-items: center; gap: 6px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-who img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.cal-caption { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); }
.cal-dialog { width: min(560px, calc(100vw - 32px)); }
.cal-d-sub { margin: 14px 20px 0; }
.cal-d-targets { display: grid; gap: 8px; margin: 12px 20px 0; }
.cal-d-form { padding: 0 20px 20px; }
.cal-d-form input[type=datetime-local] { width: auto; }
.cal-d-form input[readonly], .cal-d-form textarea[readonly] { background: var(--surface-2); }
.cal-d-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.cal-d-actions #cal-d-cancel { margin-right: auto; }
@media (max-width: 720px) {
  .cal-month .cal-day { min-height: 76px; padding: 3px; }
  .cal-month .cal-chip { padding: 3px 4px; }
  .cal-month .cal-file, .cal-month .cal-icons { display: none; }
  .cal-month .cal-time { font-size: 11px; }
  .cal-week .cal-grid { grid-template-columns: 1fr; }
  .cal-week .cal-day { min-height: 0; border-right: 0; }
}

/* "Connect Instagram", on the pages that need it when the login has no Instagram account */
.connect-ig h2 { display: flex; align-items: center; gap: 10px; }
.connect-ig h2 .brand-ico { width: 26px; height: 26px; flex: none; }
.connect-ig .steps { margin: 4px 0 16px; }

/* Refresh: the icon turns while the latest numbers are fetched (the page doesn't reload) */
.spinning { pointer-events: none; }
.spinning .ico { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinning .ico { animation-duration: 2.5s; } }

/* Notices: the message after an action slides in at the top right and goes away on its own (site.js) */
.notice-stack { position: fixed; top: 16px; right: 16px; z-index: 60; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.notice { --c: var(--accent); pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 12px 10px 12px 12px; border-radius: 12px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--c); box-shadow: 0 14px 34px -14px rgba(0,0,0,.4); font-size: 14.5px; line-height: 1.4; opacity: 0; transform: translateX(calc(100% + 32px)); transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .35s; }
.notice.in { opacity: 1; transform: none; }
.notice.out { opacity: 0; transform: translateX(calc(100% + 32px)); }
.notice-ok { --c: var(--ok); } .notice-warn { --c: var(--warn); } .notice-error { --c: var(--err); }
.notice-icon { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font: 800 13px/1 var(--body); margin-top: 1px; }
.notice-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.notice-close { flex: none; background: none; border: 0; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; }
.notice-close:hover { color: var(--ink); }
@media (max-width: 520px) { .notice-stack { left: 12px; right: 12px; top: 12px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .notice, .notice.out { transform: none; } }

/* Create post, "Different times": a date and time on each ticked account */
.target-row { flex-wrap: wrap; }
.target-row .target-time { width: auto; height: auto; flex: 0 0 auto; margin: 0 0 0 30px; padding: 6px 8px; font-size: 14px; border-radius: 8px; cursor: text; }
.target-row .target-time[hidden] { display: none; }
.target-row:has(.target-time:not([hidden]))::after { content: ""; order: 1; flex-basis: 100%; }   /* the time on its own line */
.target-row .target-time { order: 2; }

/* Publish on Free: how many of the free posts are left, and the upgrade card once they're used */
.free-posts-note { margin: -6px 0 14px; font-size: 14px; }
.post-upsell .free-used { margin: 8px 0 0; font-weight: 600; color: var(--warn); }
