/* Client blog portal, Digital Gym Growth chrome. Roslindale Display carries the
   wordmark only (self-hosted, preloaded, font-display: block — no flash); the UI
   is system type. --accent is the client's signature colour, set per client in
   the service unit; the Edge default is its cyan. */
/* Type: Roslindale Display for headings and the wordmark, Red Hat Text for
   everything else (both self-hosted latin woff2, preloaded, font-display: block:
   nothing flashes). This is the house look for every DGG client portal. */
@font-face {
  font-family: "Red Hat Text";
  font-style: normal; font-weight: 300 700; font-display: block;
  src: url("/admin/static/fonts/red-hat-text-latin-var.woff2") format("woff2");
}
@font-face {
  font-family: "Red Hat Text";
  font-style: italic; font-weight: 300 700; font-display: block;
  src: url("/admin/static/fonts/red-hat-text-latin-italic-var.woff2") format("woff2");
}
@font-face {
  font-family: "Roslindale Display";
  font-style: normal; font-weight: 600; font-display: block;
  src: url("/admin/static/fonts/RoslindaleDisplay-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "Roslindale Display";
  font-style: italic; font-weight: 600; font-display: block;
  src: url("/admin/static/fonts/RoslindaleDisplay-SemiBoldItalic.woff2") format("woff2");
}
:root {
  --accent: #00c8fb;
  --cyan: #00c8fb; --cyan-deep: #00a8d6; --ink: #06283d; --ink-2: #041b2b;
  /* Per-client, set inline by views.mjs theme(); these are the fallbacks. */
  --accent-ink: #041b2b; --accent-deep: #00a8d6; --accent-tint: #e3f8ff; --accent-text: #006c8c; --bar: #041b2b; --bar-ink: #cfe3ee; --bar-ink-dim: #9fb8c6;
  --paper: #f4f8fb; --muted: #5b7285; --line: #d6e2ea; --white: #fff; --red: #c62828;
}
* { box-sizing: border-box; }
html { font: 16px/1.5 "Red Hat Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--paper); }
h1, h2, h3, .brand { font-family: "Roslindale Display", Georgia, "Times New Roman", serif; font-weight: 600; }
body { margin: 0; min-height: 100vh; }
a { color: var(--accent-deep); }
main { max-width: 760px; margin: 0 auto; padding: 24px 20px 60px; }
body.wide main { max-width: 1200px; }

/* App shell: sidebar + main. The login page keeps a plain top bar. */
body.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--bar); color: var(--white); display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { display: block; padding: 4px 8px 18px; font-size: 21px; white-space: nowrap; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot .client { color: var(--bar-ink-dim); margin: 0 0 10px; }
.sidebar-foot form { margin: 0; }
.top { background: var(--bar); color: var(--white); display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; }
/* Same recipe as the DGG CRM's .brand: Roslindale 600, -0.01em, last word italic in the accent. */
.brand { font-size: 22px; letter-spacing: -0.01em; color: var(--white); text-decoration: none; line-height: 1; }
.brand span { font-style: italic; color: var(--accent); }
.client { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.top nav { display: flex; gap: 18px; align-items: center; font-size: 14px; }
.top nav a { color: var(--bar-ink); text-decoration: none; }
.top nav a:hover { color: var(--white); }
.who { color: #9fb8c6; }
.top form { margin: 0; }
button.link { background: none; border: 0; color: var(--bar-ink); cursor: pointer; font: inherit; padding: 0; }
button.link:hover { color: var(--white); }

h1 { font-size: 30px; margin: 0 0 16px; letter-spacing: -0.01em; line-height: 1.1; }
.card { background: var(--white); border-radius: 10px; padding: 24px; box-shadow: 0 10px 32px -18px rgba(6,40,61,.25); }
.narrow { max-width: 440px; margin: 40px auto; }
.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
label.inline { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
label small { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input:not([type]), select, textarea {
  font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); color: var(--ink); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
textarea { resize: vertical; }
.button, button.primary, button.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: 6px; border: 1px solid var(--line); background: var(--white); color: var(--ink); text-decoration: none; cursor: pointer; }
.button.primary, button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button.primary:hover, button.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.button.small { padding: 6px 12px; font-size: 13px; }
.button[disabled], button[disabled] { opacity: .6; cursor: wait; }
.error { background: #fdecec; color: var(--red); padding: 10px 12px; border-radius: 6px; font-size: 14px; }
.flash { background: var(--accent-tint); color: var(--ink); padding: 10px 12px; border-radius: 6px; font-size: 14px; }
.flash.bad { background: #fdecec; color: var(--red); border-left: 4px solid var(--red); }
.muted { color: var(--muted); font-size: 13px; }

/* Month's writing assistance. A percentage and nothing else — the client bought
   an amount of help, not an amount of tokens. */
.meter { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; margin: 4px 0 10px; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.meter.near > span { background: #e8912d; }

/* The upper tier's pitch on a locked page and the plan card. */
.pitch { font-size: 16px; line-height: 1.55; margin: 14px 0; }

.button.locked { opacity: .6; }
/* A nav item the client is not on. Visible on purpose — it is the upsell. */
.main-nav a.locked { opacity: .55; }
.main-nav a.locked span { margin-left: 6px; font-size: 11px; }
.hint { margin-top: 20px; }

.bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.bar h1 { margin: 0; }
.bar-actions { display: flex; align-items: center; gap: 10px; }
.back { text-decoration: none; font-weight: 600; }

table.posts { width: 100%; border-collapse: collapse; background: var(--white); border-radius: 10px; overflow: hidden; box-shadow: 0 10px 32px -18px rgba(6,40,61,.25); }
table.posts th, table.posts td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.posts th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
table.posts tr:last-child td { border-bottom: 0; }
table.posts a.title { font-weight: 600; text-decoration: none; color: var(--ink); }
table.posts a.title:hover { color: var(--accent-deep); }
.badge { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; }
.badge.published { background: var(--accent-tint); color: var(--accent-text); }
.badge.scheduled { background: #fff2d6; color: #8a5a00; }
.badge.draft { background: #e9eef2; color: var(--muted); }
td.actions { white-space: nowrap; }

.editor .cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.editor .main, .editor .side { display: flex; flex-direction: column; gap: 16px; }
.editor .side { background: var(--white); padding: 18px; border-radius: 10px; box-shadow: 0 10px 32px -18px rgba(6,40,61,.25); }
.editing-bar { margin: 0 0 4px; }
label.big input { font-size: 20px; font-weight: 600; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; margin: 0; }
legend { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 0 6px; }
.cover { position: relative; aspect-ratio: 4 / 3; background: var(--paper); border-radius: 6px; overflow: hidden; display: grid; place-items: center; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover.empty img { display: none; }
.cover:not(.empty) span { display: none; }
.row { display: flex; gap: 8px; }
.danger { border-top: 1px solid var(--line); padding-top: 14px; }
.danger .button { color: var(--red); }

/* The 409 "this would replace another post" choice (2026-09-26). */
dialog.replace-dialog { max-width: 420px; border: 1px solid var(--line); border-radius: 10px; padding: 20px; box-shadow: 0 20px 60px -20px rgba(6,40,61,.35); }
dialog.replace-dialog::backdrop { background: rgba(6,40,61,.45); }
dialog.replace-dialog p { margin: 0 0 16px; line-height: 1.5; }
dialog.replace-dialog .row { justify-content: flex-end; }

/* EasyMDE tweaks: brand the toolbar, keep the type readable */
.EasyMDEContainer .CodeMirror { border-color: var(--line); border-radius: 0 0 6px 6px; font: 16px/1.6 "Red Hat Text", sans-serif; min-height: 420px; color: var(--ink); }
.editor-toolbar { border-color: var(--line); border-radius: 6px 6px 0 0; background: var(--white); }
.editor-toolbar button.active, .editor-toolbar button:hover { background: var(--accent-tint); border-color: var(--accent); }
.editor-preview, .editor-preview-side { background: var(--white); }
.editor-preview img, .editor-preview-side img { max-width: 100%; border-radius: 6px; }
.editor-preview .callout, .editor-preview-side .callout { background: var(--accent-tint); border-left: 4px solid var(--accent); padding: 12px 14px; border-radius: 6px; }
.cm-s-easymde .cm-header-1, .cm-s-easymde .cm-header-2 { font-size: 1.3em; }

@media (max-width: 900px) {
  .editor .cols { grid-template-columns: 1fr; }
  .top { flex-wrap: wrap; gap: 8px; }
}

/* ---- navigation, panels, new screens (spec build 2026-09-04) ---- */
.main-nav { display: flex; flex-direction: column; gap: 3px; }
.main-nav a { color: var(--bar-ink); text-decoration: none; font-size: 15px; font-weight: 600; padding: 9px 12px; border-radius: 6px; }
.main-nav a:hover { color: var(--white); background: rgba(255,255,255,.06); }
.main-nav a.on { color: var(--white); background: rgba(255,255,255,.1); }
h2 { font-size: 20px; letter-spacing: -0.01em; margin: 0 0 10px; }
.card h2 + p, .card h2 + ul { margin-top: 0; }
.row.wrap { flex-wrap: wrap; align-items: center; }
.card.row { gap: 10px; margin-bottom: 18px; }
.card.row input, .card.row select { width: auto; flex: 1; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
ul.plain { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }

.assistant { background: #f2fbff; border-color: #bfeeff; }
.button.ai { border-color: var(--accent); color: var(--ink); background: var(--accent-tint); }
.button.ai:hover { background: var(--accent); }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.panel-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.panel ol, .panel ul { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.panel li .badge { margin-right: 6px; }
#check-score.ok { color: #1b7f3b; font-weight: 700; }
#check-score.warn { color: #8a5a00; font-weight: 700; }
#check-score.bad { color: var(--red); font-weight: 700; }

/* schedule */
.cal { margin-bottom: 18px; }
.cal table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 4px; text-align: left; }
.cal td { vertical-align: top; height: 76px; border: 1px solid var(--line); padding: 4px; font-size: 12px; }
.cal td.pad { background: var(--paper); border-color: transparent; }
.cal td.today { background: #f2fbff; }
.cal .d { display: block; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.cal .dot { display: block; padding: 2px 6px; border-radius: 4px; margin-top: 3px; text-decoration: none; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .dot.published { background: var(--accent-tint); color: var(--accent-text); }
.cal .dot.scheduled { background: #fff2d6; color: #8a5a00; }
.cal .dot.draft { background: #e9eef2; color: var(--muted); }

/* tasks */
ul.tasks { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-direction: column; gap: 10px; }
ul.tasks li { background: var(--white); border-radius: 10px; padding: 14px 16px; box-shadow: 0 10px 32px -18px rgba(6,40,61,.25); }
ul.tasks li.done strong { text-decoration: line-through; color: var(--muted); }
ul.tasks .why { margin: 6px 0 2px; }
ul.tasks .how { margin: 0 0 6px; font-size: 14px; }
ul.tasks button.link { color: var(--muted); font-size: 12px; }
ul.tasks label.inline { font-size: 15px; }

#restored button.link { color: var(--accent-deep); text-decoration: underline; }
@media (max-width: 900px) {
  .two { grid-template-columns: 1fr; }
  body.app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; }
  .sidebar .brand { padding: 4px 8px; }
  .main-nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; border: 0; display: flex; gap: 12px; align-items: center; }
  .sidebar-foot .client { margin: 0; }
}

/* blog subtabs + nested sidebar entry */
.main-nav a.sub { font-size: 14px; font-weight: 500; padding: 5px 12px 5px 28px; color: var(--bar-ink-dim); }
.main-nav a.sub.on { color: var(--white); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 18px; }
.tabs a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; padding: 8px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.one { margin-bottom: 18px; }
\n.status-line { display: flex; flex-direction: column; gap: 6px; margin: 0; }\n.status-line .badge { align-self: flex-start; }\n.danger.row { gap: 8px; }\n
/* Google posts. Each queue item is a card edited in place: the fields look
   like text until they are touched, and Save / Cancel appear only when
   something changed. */
.badge.held { background: #fff2d6; color: #8a5a00; }
.badge.queued { background: var(--accent-tint); color: var(--accent-text); }
.badge.sending { background: #e9eef2; color: var(--muted); }
.badge.sent { background: #e4f7e8; color: #1d6b32; }
.badge.failed { background: #fdecec; color: var(--red); }
.gbp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.gbp-body { display: flex; gap: 14px; align-items: flex-start; }
.gbp-photo { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; flex: none; }
.gbp-text { white-space: pre-wrap; margin: 0; font-size: 15px; line-height: 1.5; }
textarea.gbp-text { flex: 1; width: 100%; min-height: 0; padding: 6px 8px; margin: -6px -8px; border: 1px solid transparent; border-radius: 6px; background: transparent; font: inherit; font-size: 15px; line-height: 1.5; color: var(--ink); resize: none; overflow: hidden; }
textarea.gbp-text:hover { border-color: var(--line); }
textarea.gbp-text:focus { border-color: var(--accent); outline: none; background: var(--white); }
/* input[type=…] rules above set width: 100% and a border; these have to win. */
input.inline-field { width: auto; font: inherit; font-weight: 600; padding: 2px 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink); }
input.inline-field:hover { border-color: var(--line); }
input.inline-field:focus { border-color: var(--accent); outline: none; background: var(--white); }
input.inline-field.url { flex: 1; min-width: 200px; font-weight: 400; font-size: 13px; }
.gbp-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.gbp-foot select { width: auto; padding: 2px 26px 2px 6px; font-size: 13px; border-color: transparent; background-color: transparent; }
.gbp-foot select:hover, .gbp-foot select:focus { border-color: var(--line); }
.gbp-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.gbp-actions .link { color: var(--muted); font-size: 13px; }
.gbp-save { margin-top: 12px; display: flex; gap: 8px; align-items: center; }
.gbp-save[hidden] { display: none; }
li.gbp.dirty { box-shadow: 0 0 0 2px var(--accent), 0 10px 32px -18px rgba(6,40,61,.25); }
ul.gbp-list li.sent { opacity: .85; }
#gbp-page .two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; align-items: start; }

/* The month's assistance, pinned where the eye lands before pressing an AI
   button. Fixed, not sticky: it never scrolls. */
.ai-meter { position: fixed; right: 18px; bottom: 18px; z-index: 40; width: 230px; background: var(--white); border-radius: 10px; padding: 10px 14px 9px; box-shadow: 0 10px 32px -12px rgba(6,40,61,.35); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.ai-meter .ai-meter-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ai-meter .meter { margin: 2px 0 2px; height: 8px; }
.ai-meter.near { box-shadow: 0 0 0 2px #e8912d, 0 10px 32px -12px rgba(6,40,61,.35); }
.ai-meter .muted { font-size: 12px; }
@media (max-width: 900px) { .ai-meter { right: 10px; bottom: 10px; width: auto; max-width: 60vw; } }

/* Dashboard tab (task D, 2026-09-29). Mobile-first: cards already stack in a
   single column (main's max-width), so there is nothing extra to collapse at
   a breakpoint. */
.dash { display: flex; flex-direction: column; gap: 18px; margin-top: 4px; }
.dash-card h2 { margin: 0 0 12px; }
.dash-sample-banner { font-weight: 600; }
.dash-foot { margin-top: 8px; }
.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 14px 16px; margin: 0; padding: 0; }
.dash-stats dt { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 3px; }
.dash-stats dd { margin: 0; font-size: 22px; font-weight: 700; color: var(--ink); }
.dash-chip { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 4px 10px; border-radius: 999px; margin: 0 0 14px; }
.dash-chip-good { background: #e4f7e8; color: #1d6b32; }
.dash-chip-bad { background: #fdecec; color: var(--red); }
.dash-chip-neutral { background: #e9eef2; color: var(--muted); }
/* Recoverable and at-risk are shown as two separate stat blocks on purpose —
   never a table row or a "+" between them, which would read as a total. */
.dash-leak-stat { padding: 10px 0; border-top: 1px solid var(--line); }
.dash-leak-stat:first-of-type { border-top: 0; padding-top: 0; }
.dash-leak-label { margin: 0 0 2px; font-size: 13px; font-weight: 600; color: var(--muted); }
.dash-leak-amount { margin: 0; font-size: 26px; font-weight: 700; }
.dash-findings { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 10px; }
.dash-findings li { border-top: 1px solid var(--line); padding-top: 10px; }
.dash-findings li:first-child { border-top: 0; padding-top: 0; }
.dash-badge { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; margin-right: 4px; }
.dash-basis-measured { background: var(--accent-tint); color: var(--accent-text); }
.dash-basis-estimated { background: #fff2d6; color: #8a5a00; }
.dash-skipped { margin: 12px 0 0; }
.dash-skipped ul { margin: 4px 0 0; padding-left: 18px; }
.dash-caveats { padding-left: 18px; margin: 12px 0 0; }
.dash-table { width: 100%; border-collapse: collapse; margin: 14px 0 0; font-size: 14px; }
.dash-table th, .dash-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.dash-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.dash-spark { width: 100%; height: 44px; display: block; margin-top: 10px; }
.dash-spark rect { fill: var(--accent); }
.dash-sub { font-size: 14px; margin: 14px 0 4px; }
.dash-movers { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.dash-notes { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }

/* Writer (task F, 2026-09-29): dashboard-only clients' AI writing tab. Ideas
   reuse the blog Ideas tab's own card/table classes, so the .card.row and
   .row.wrap rules above already make the "add an idea" form wrap on a small
   screen the same way that page does. The side rail runs Assistant -> Summary
   -> Save -> Copy -> Drafts, in the order a client actually uses them.
   Mobile-first: the two-column layout is the same .editor .cols grid the blog
   editor uses, which already collapses to one column under 900px (see above). */
.writer-intro { margin: 0 0 18px; }
.writer-editor-heading { margin-top: 22px; }
#writer-drafts li { display: flex; align-items: baseline; gap: 8px; }
#writer-drafts li a { flex: 1; font-weight: 600; text-decoration: none; color: var(--ink); }
#writer-drafts li a:hover { color: var(--accent-deep); }
