:root {
  --bg: #e9edf2;
  --surface: #ffffff;
  --surface-soft: #f4f5f7;
  --ink: #111111;
  --muted: #4a5158;
  --line: #b9c0c9;
  --brand: #07a4f3;          /* brand accent (cyan-blue) */
  --brand-2: #0684c9;        /* darker accent for hover/borders */
  --brand-ink: #0670a8;      /* accent used as TEXT (readable on white) */
  --secondary: #0d2233;      /* brand secondary (deep navy) */
  --nav: #0d2233;
  --success: #008d4c;
  --warning: #d68910;
  --danger: #c0392b;
  --info: #0e7490;
  --radius: 3px;
  --shadow: 0 1px 1px rgba(0,0,0,.1);
}
* { box-sizing: border-box; }
html { min-height: 100%; overflow-y: scroll; scrollbar-gutter: stable; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 13px/1.45 "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif; }
/* Classic, highly visible links (like the docs list); hover only darkens. */
a { color: #0000cc; text-decoration: underline; font-weight: 600; }
a:hover { color: #000099; background: none; }
a:visited { color: #0000cc; }
pre a:visited, td a:visited:not(.button):not(.row-title), dd a:visited { color: #0000cc; }
.nav a, .button, button, .tabs a, .segmented a, .docs-list a, .row-title, .badge { text-decoration: none; }
.mono a, td a:not(.button), .definition a { font-weight: 600; }
pre a { color: #0645ad; word-break: break-all; }
button, input, select, textarea { font: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 218px minmax(0, 1fr); transition: grid-template-columns .18s ease; }
.app-shell.sidebar-collapsed { grid-template-columns: 62px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 10px 8px; background: var(--nav); color: #fff; display: flex; flex-direction: column; z-index: 20; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 9px; padding: 0 6px 12px; border-bottom: 1px solid rgba(255,255,255,.1); flex-shrink: 0; flex-wrap: wrap; }
.brand-logo, .brand-logo:hover, .brand-logo:focus { display: block; background: #fff !important; border-radius: 5px; padding: 7px 9px; line-height: 0; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.brand-logo img { display: block; width: 100%; max-width: 150px; height: auto; }
/* Collapsed sidebar: keep a tiny logo, no fallback letter mark. */
.app-shell.sidebar-collapsed .brand-logo { display: block; width: 38px; padding: 4px; }
.app-shell.sidebar-collapsed .brand-logo img { width: 30px; max-width: 30px; }
.app-shell.sidebar-collapsed .sidebar { padding-left: 8px; padding-right: 8px; }
.app-shell.sidebar-collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
.app-shell.sidebar-collapsed .nav-label, .app-shell.sidebar-collapsed .sidebar-footer > div, .app-shell.sidebar-collapsed .sidebar-collapse-label { display: none; }
.nav { display: grid; grid-auto-rows: min-content; align-content: start; gap: 2px; margin-top: 12px; padding-right: 3px; overflow-y: auto; overflow-x: hidden; min-height: 0; flex: 0 1 auto; max-height: calc(100vh - 138px); scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 999px; }
.nav > a { color: #d8e2e8; text-decoration: none; padding: 5px 7px; border-radius: 3px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 32px; border-left: 3px solid transparent; }
.nav > a:visited, .nav-child:visited { color: #d8e2e8; }
.nav > a:hover { background: #16344a; color: #fff; }
.nav > a.active { background: #16344a; color: #fff; border-left-color: var(--brand); }
.nav > a.active .nav-label { color: #4fc3ff; }
.nav-caret { margin-left: 6px; font-size: 10px; opacity: .75; }
.nav-children { display: grid; gap: 2px; margin: 2px 0 6px; padding: 0 0 0 28px; }
.nav-child { display: flex; align-items: center; min-height: 30px; color: #d8e2e8; text-decoration: none; padding: 5px 7px; border-radius: 3px; font-size: 12px; font-weight: 600; border-left: 3px solid transparent; background: transparent; }
.nav-child:before { content: ""; width: 6px; height: 6px; margin-right: 9px; border-radius: 50%; background: rgba(216,226,232,.55); flex: none; }
.nav-child:hover { background: #16344a; color: #fff; }
.nav-child:hover:before { background: #fff; }
.nav-child.active { background: #16344a; color: #fff; border-left-color: var(--brand); }
.nav > a:hover:visited, .nav > a.active:visited, .nav-child:hover:visited, .nav-child.active:visited { color: #fff; }
.nav-child.active:before { background: #4fc3ff; }
.app-shell.sidebar-collapsed .nav-children, .app-shell.sidebar-collapsed .nav-caret { display: none; }
.nav-main { display: inline-flex; align-items: center; min-width: 0; gap: 8px; }
.nav-icon { width: 20px; min-width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 0; background: transparent; color: inherit; opacity: .85; }
.nav > a.active .nav-icon, .nav > a:hover .nav-icon { opacity: 1; }
.nav-icon svg { display: block; }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .nav-count { min-width: 20px; padding: 0 5px; border-radius: 10px; background: rgba(255,255,255,.12); text-align: center; font-size: 11px; }
.app-shell.sidebar-collapsed .nav > a { justify-content: center; padding-left: 6px; padding-right: 6px; min-height: 34px; position: relative; }
.app-shell.sidebar-collapsed .nav-main { justify-content: center; }
.app-shell.sidebar-collapsed .nav .nav-count { position: absolute; transform: translate(14px,-12px); min-width: 18px; padding: 0 5px; }
.sidebar-footer { flex-shrink: 0; margin-top: auto; padding: 10px 6px 0; border-top: 1px solid rgba(255,255,255,.1); color: #aeb7c6; font-size: 11px; }
.sidebar-collapse { width: 100%; min-height: 32px; margin: 0 0 10px; padding: 5px 8px; border: 1px solid rgba(255,255,255,.14); border-radius: 7px; background: rgba(255,255,255,.06); color: #d7deea; box-shadow: none; justify-content: flex-start; }
.sidebar-collapse:hover { background: rgba(255,255,255,.1); color: #fff; box-shadow: none; transform: none; }
.sidebar-collapse-icon { width: 18px; text-align: center; font-weight: 900; }
.app-shell.sidebar-collapsed .sidebar-collapse { justify-content: center; padding-left: 0; padding-right: 0; }
.main-column { min-width: 0; }
.topbar { height: 46px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0,0,0,.04); display: flex; align-items: center; justify-content: space-between; padding: 0 15px; position: sticky; top: 0; z-index: 15; }
.topbar-title { display: flex; align-items: center; min-width: 0; gap: 10px; }
.topbar h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: 0; }
.topbar-meta { color: var(--muted); display: flex; gap: 10px; align-items: center; }
.content { max-width: 1600px; margin: 0 auto; padding: 12px 15px 28px; }
.page-intro { display: flex; justify-content: space-between; gap: 14px; align-items: end; margin-bottom: 10px; }
.page-intro h2 { margin: 0 0 2px; font-size: 18px; font-weight: 600; }
.page-intro p, .help-text { margin: 0; color: #3d444b; font-size: 12px; }
.grid { display: grid; gap: 10px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel { background: var(--surface); border: 1px solid #9aa3ae; border-top: 3px solid var(--brand); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 12px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -10px -12px 10px; padding: 7px 12px; background: linear-gradient(#eef0f2, #dfe3e8); border-bottom: 1px solid #9aa3ae; border-radius: 0; }
.panel-header h2 { color: #16334d; }
.panel.collapsible > .panel-header { cursor: pointer; user-select: none; }
.panel.collapsible > .panel-header:hover { background: linear-gradient(#e7eaee, #d6dbe1); }
.panel.collapsible > .panel-header > :first-child { margin-right: auto; }
.panel.collapsed > .panel-header { margin-bottom: -10px; }
.panel.collapsed > .panel-body { display: none; }
.panel-caret { margin-left: 10px; font-size: 11px; opacity: .7; color: #16334d; align-self: center; }
.panel-toggle { flex: none; min-width: 54px; margin-left: 0; }
.panel-allctl { display: flex; justify-content: flex-end; gap: 8px; margin: 0 0 10px; }
.panel-toolbar { position: sticky; top: 58px; z-index: 8; align-items: center; justify-content: flex-end; flex-wrap: wrap; padding: 7px; border: 1px solid #c6ccd4; background: rgba(239, 242, 245, .96); box-shadow: 0 2px 10px rgba(25, 36, 52, .08); }
.panel-toolbar-label { margin-right: auto; color: #42505f; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.panel-jump { min-height: 30px; width: min(320px, 100%); padding: 4px 8px; border: 1px solid #aeb7c2; background: #fff; color: #17283a; font-size: 12px; }
.panel-header h2, .panel-header h3, .panel > h2:first-child, .panel > h3:first-child { margin: 0; }
.panel h2 { font-size: 15px; font-weight: 600; }
.panel h3 { margin: 16px 0 8px; padding: 3px 0 3px 8px; border-left: 3px solid var(--brand); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: #2c3e50; }
.panel-subtitle { color: #3d444b; margin: 2px 0 0; font-size: 12px; }
.panel-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.segmented a { min-height: 30px; padding: 5px 11px; border-radius: 6px; color: #526075; text-decoration: none; font-weight: 750; }
.segmented a.active { background: #fff; color: var(--brand-ink); box-shadow: 0 1px 3px rgba(31,39,51,.08); }
.stats { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 8px; margin-bottom: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px 8px 13px; min-height: 64px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.stat:before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand); }
.stat.success:before { background: var(--success); }.stat.warning:before { background: var(--warning); }.stat.danger:before { background: var(--danger); }
.stat-value { display: block; font-size: 22px; line-height: 1.15; font-weight: 700; margin: 3px 0 1px; color: #222; }
.stat-label { color: #22282e; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.stat-note { color: #4a5158; font-size: 11px; }
.badge { display: inline-flex; align-items: center; white-space: nowrap; border-radius: 3px; padding: 2px 7px; background: #777; color: #fff; font-size: 11px; font-weight: 700; text-transform: capitalize; }
.badge.success, .badge.auto, .badge.enabled, .badge.active, .badge.valid, .badge.sent, .badge.eligible { background: var(--success); color: #fff; }
.badge.pending, .badge.scheduled, .badge.warning, .badge.dry-run, .badge.waiting-review, .badge.reserved, .badge.needs-edit { background: var(--warning); color: #fff; }
.badge.processing, .badge.info { background: var(--brand); color: #fff; }
.badge.failed, .badge.failed-api, .badge.failed-validation, .badge.disabled, .badge.invalid, .badge.error, .badge.rejected, .badge.not-eligible { background: var(--danger); color: #fff; }
.badge.manual, .badge.skipped, .badge.unsupported, .badge.inactive, .badge.expired { background: #95a5a6; color: #fff; }
.badge.success-with-warning, .badge.redmine-created { background: #f39c12; color: #fff; }
.badge.redmine-created { background: #605ca8; }
.flash, .err { border-radius: var(--radius); padding: 12px 14px 12px 40px; margin-bottom: 12px; white-space: pre-wrap; border: 1px solid #7bb7d6; border-left: 5px solid var(--brand); background: #e6f4fb; color: #0d3f5c; font-weight: 600; box-shadow: 0 2px 6px rgba(0,0,0,.12); position: relative; }
.flash:before { content: "\2714"; position: absolute; left: 14px; top: 12px; color: var(--brand); font-weight: 900; }
.err { border-left-color: var(--danger); border-color: #e0a0a0; background: #fdecec; color: #8a2020; }
.err:before { content: "\26A0"; color: var(--danger); }
.err { border-color: #f2bdc3; background: #fff0f1; color: #982c37; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.actions form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 0; }
.row-actions { min-width: 210px; align-items: center; }
.row-actions .button, .row-actions button { white-space: nowrap; }
.form-actions { margin: 18px 0 24px; }
.campaign-save-actions { margin-top: 22px; margin-bottom: 24px; padding-top: 4px; }
/* Primary buttons: always brand background + white text; hover = darker brand. */
button, .button { min-height: 30px; border: 1px solid var(--brand-2); border-radius: 3px; padding: 4px 10px; background: var(--brand); color: #fff; text-decoration: none; font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button:hover, .button:hover { background: #056aa3; color: #fff; border-color: #056aa3; }
button:visited, .button:visited { color: #fff; }
button:active, .button:active { box-shadow: inset 0 2px 3px rgba(0,0,0,.12); }
button.secondary, .button.secondary { background: #f4f4f4; color: #33465c; border-color: #c3ccd5; }
button.secondary:hover, .button.secondary:hover { background: #e4ebf1; color: #1d2b3a; border-color: #a9b6c2; }
button.ghost, .button.ghost { background: #fff; color: #445; border-color: var(--line); }
button.ghost:hover, .button.ghost:hover { background: #eef1f4; color: #223; }
button.danger, .button.danger { background: var(--danger); color: #fff; border-color: #d73925; }
button.danger:hover, .button.danger:hover { background: #d73925; }
button.small, .button.small { min-height: 24px; padding: 2px 7px; font-size: 12px; }
.icon-button { width: 30px; min-width: 30px; height: 30px; padding: 0; border-color: var(--line); background: #fff; color: var(--ink); display: inline-grid; place-items: center; gap: 0; }
.icon-button span { display: block; width: 16px; height: 2px; margin: 2px 0; border-radius: 2px; background: currentColor; }
.icon-button:hover { background: var(--surface-soft); color: var(--brand-ink); box-shadow: none; }
label { display: block; font-weight: 600; margin: 0 0 3px; }
.field { margin-bottom: 10px; }
.field-help { color: #3d444b; font-size: 11px; margin: 3px 0 0; max-width: 760px; }
input, select, textarea { width: 100%; max-width: 620px; border: 1px solid #ccc; border-radius: 3px; background: #fff; color: var(--ink); padding: 4px 8px; outline: none; }
input, select { min-height: 30px; }
textarea { min-height: 80px; resize: vertical; font: 12px/1.45 Consolas, "Courier New", monospace; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(7,164,243,.22); }
input:hover, select:hover { border-color: #b5bcc4; }
input[type=checkbox], input[type=radio] { width: auto; max-width: none; min-height: 0; padding: 0; margin: 0; box-shadow: none; vertical-align: middle; cursor: pointer; }
.switch-row input[type=checkbox], .switch-row input[type=radio], .mini-card-option input[type=checkbox], .mini-card-option input[type=radio] { width: 16px; height: 16px; accent-color: var(--brand); }
.switch-row input[type=checkbox]:focus, .switch-row input[type=radio]:focus, .mini-card-option input[type=checkbox]:focus, .mini-card-option input[type=radio]:focus { box-shadow: 0 0 0 2px rgba(7,164,243,.3); }
.switch-row { display: flex; align-items: center; gap: 9px; padding: 8px 10px; background: #f4f6f8; border: 1px solid #dde3e9; border-radius: var(--radius); }
.switch-row label { margin: 0; }
.table-tools { display: flex; gap: 8px; justify-content: space-between; margin-bottom: 8px; flex-wrap: wrap; align-items: center; }
.table-search { max-width: 300px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; background: #fff; }
th { position: sticky; top: 0; z-index: 2; background: #e8eaed; color: #111; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; border-bottom: 2px solid #9aa2ac !important; }
th, td { border-bottom: 1px solid #d5dae0; text-align: left; padding: 5px 8px; vertical-align: middle; color: #111; }
tbody tr:nth-child(even) td { background: #f3f5f7; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #e3edf6; }
.row-title { font-weight: 700; color: #0000cc; text-decoration: underline; }
.row-sub { display: block; color: #4a5158; font-size: 11px; margin-top: 1px; }
.empty { padding: 16px; text-align: center; color: var(--muted); }
.sales-bars { display: grid; gap: 12px; }
.sales-bar-row { display: grid; grid-template-columns: minmax(170px, 280px) minmax(180px, 1fr) minmax(120px, auto); gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.sales-bar-label strong, .sales-bar-value strong { display: block; }
.sales-bar-label span, .sales-bar-value span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.sales-bar-track { height: 12px; border-radius: 999px; background: #e8ecf3; overflow: hidden; }
.sales-bar-track span { display: block; height: 100%; border-radius: inherit; }
.sales-bar-value { text-align: right; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.tabs a { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #536074; text-decoration: none; font-weight: 700; }
.tabs a.active, .tabs a:hover { border-color: #7fccf6; background: #e6f6fe; color: var(--brand-ink); }
.callout { border-left: 4px solid var(--brand); border-top: 1px solid #ccd3da; border-right: 1px solid #ccd3da; border-bottom: 1px solid #ccd3da; background: #eef4fa; padding: 7px 10px; border-radius: 0 var(--radius) var(--radius) 0; color: #1d2b3a; font-size: 12px; }
.callout.warning { border-left-color: var(--warning); background: #fdf6e9; }
.callout strong { display: block; margin-bottom: 2px; }
.progress { height: 8px; background: #e7eaf0; border-radius: 5px; overflow: hidden; }
.progress > span { height: 100%; display: block; border-radius: inherit; background: var(--brand-2); transition: width .35s ease; }
.progress.success > span { background: var(--success); }.progress.danger > span { background: var(--danger); }
.progress-meta { display: flex; justify-content: space-between; margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.timeline { position: relative; display: grid; gap: 0; }
.timeline-item { display: grid; grid-template-columns: 18px 140px minmax(0,1fr); gap: 10px; position: relative; padding: 0 0 12px; }
.timeline-item:before { content: ""; position: absolute; left: 8px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.timeline-item:last-child:before { display: none; }
.timeline-dot { width: 18px; height: 18px; border: 4px solid #dce5ff; border-radius: 50%; background: var(--brand-2); z-index: 1; }
.timeline-dot.error { background: var(--danger); border-color: #f8d9dd; }.timeline-dot.warning { background: var(--warning); border-color: #fbe8c7; }.timeline-dot.info { background: var(--success); border-color: #d7f1e7; }
.timeline-time { color: var(--muted); font-size: 12px; padding-top: 1px; }
.timeline-content strong { display: block; }.timeline-content p { margin: 3px 0; color: #515c6d; }
details { border: 1px solid #9aa3ae; border-radius: 3px; background: #fff; }
summary { cursor: pointer; padding: 5px 9px; font-weight: 700; color: #16334d; background: #eef0f2; }
details pre, .doc pre { margin: 0; padding: 10px; overflow: auto; background: #eaeaea; border: 1px solid #cfd6dd; color: #0d2233; border-radius: 3px; white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.pre-wrap { position: relative; }
.pre-copy { position: absolute; top: 6px; right: 6px; z-index: 2; min-height: 22px; padding: 2px 8px; font-size: 11px; background: #fff; color: #0d2233; border: 1px solid #b9c0c9; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.pre-copy:hover { background: #f4f4f4; color: #0d2233; }
.definition-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.definition { background: #fff; padding: 7px 10px; min-width: 0; }
.definition dt { color: #22282e; font-size: 11px; font-weight: 700; text-transform: uppercase; margin-bottom: 3px; }
.definition dd { margin: 0; font-weight: 600; word-break: break-word; color: #111; }
.definition dd.mono { font-size: 12px; }
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.module-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; background: #fff; }
.module-card h3 { margin: 0 0 4px; }.module-card p { color: var(--muted); min-height: 42px; }
.module-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.generator-box { margin: 10px 0 12px; padding: 10px; border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: var(--radius); background: var(--surface-soft); }
.generated-url { color: #2d6a94; background: #f5f9fc; border-color: #dbe7f0; }
.copy-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: start; }
.copy-row textarea { max-width: none; min-height: 74px; }
.link-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.link-card { border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: var(--radius); background: #fff; padding: 9px; min-width: 0; display: grid; gap: 7px; }
.link-card > div > strong { color: #2c3e50; }
.link-card pre { margin: 0; padding: 8px; border-radius: 3px; background: #f5f9fc; border: 1px solid #dbe7f0; color: #2d6a94; overflow: auto; white-space: nowrap; font: 11px/1.45 Consolas, "Courier New", monospace; }
.prompt-block { margin: 18px 0 22px; padding: 0; border: 0; background: transparent; box-shadow: none; }
.prompt-block-header { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 0 0 8px; padding: 0; border: 0; background: transparent; }
.prompt-block-header h2 { margin: 0; color: #16334d; font-size: 15px; font-weight: 700; }
.prompt-block-note { margin: 0 0 10px; color: #303846; font-size: 12px; max-width: 1180px; }
.prompt-block-note.warning { color: #8a5b04; }
.prompt-block-field { margin: 0 0 10px; }
.prompt-block-details { margin: 0 0 10px; border-color: var(--line); }
.prompt-token-field { max-width: 620px; margin: 14px 0 0; }
.prompt-copy-area { max-width: none; min-height: 360px; margin-top: 14px; background: #111827; color: #eef2ff; border-color: #263144; font: 13px/1.55 Consolas, "Courier New", monospace; }
.prompt-copy-area:focus { border-color: #5c72e1; box-shadow: 0 0 0 3px rgba(92,114,225,.22); }
.library-editor { padding: 10px; margin: 0 0 8px; border: 1px solid #9aa3ae; border-left: 3px solid var(--brand); border-radius: var(--radius); background: #eef1f4; }
.library-editor textarea, .library-editor input, .library-editor select { max-width: none; }
.library-item-editor { padding: 0; overflow: hidden; }
.library-item-editor summary { display: grid; grid-template-columns: minmax(180px,1fr) minmax(160px,auto) auto; gap: 8px; align-items: center; padding: 8px 10px; cursor: pointer; background: #fff; }
.library-item-editor[open] summary { border-bottom: 1px solid #c9d1da; background: #f7f9fb; }
.library-item-editor summary strong { color: #16334d; }
.library-item-editor .library-editor-form { padding: 10px; margin: 0; }
.library-item-editor .library-delete-form { padding: 0 10px 12px; margin: 0; }
.library-new { margin-top: 12px; border: 1px solid #9aa3ae; border-left: 3px solid var(--brand); border-radius: var(--radius); background: var(--surface-soft); overflow: hidden; }
.library-new summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 34px; padding: 7px 10px; background: #fff; color: var(--brand-ink); font-weight: 700; cursor: pointer; list-style: none; }
.library-new summary::-webkit-details-marker { display: none; }
.library-new summary:after { content: "+"; width: 22px; height: 22px; display: inline-grid; place-items: center; border: 1px solid #b9c6d1; border-radius: 3px; background: #eef6fb; color: var(--brand-ink); font-weight: 900; }
.library-new[open] summary { border-bottom: 1px solid #c9d1da; background: #f7f9fb; color: #16334d; }
.library-new[open] summary:after { content: "-"; }
.library-new > .library-editor { margin: 0; border: 0; border-radius: 0; background: #eef1f4; }
.mini-card-picker { margin: 12px 0; background: #fff; }
.mini-card-help, .mini-card-preview { margin: 10px 12px 0; padding: 8px 10px; border: 1px solid #c9d1da; background: #f7f9fb; color: #263544; font-size: 12px; }
.mini-card-grid { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 10px 12px; align-items: start; }
.mini-card-option { display: grid; grid-template-columns: 24px minmax(0,1fr) auto; grid-template-areas: "handle title order" "handle meta order"; gap: 3px 10px; margin: 0; padding: 7px 8px; border: 1px solid #9aa3ae; border-radius: 3px; background: #fff; font-weight: 500; min-width: 0; box-shadow: 0 1px 2px rgba(0,0,0,.08); cursor: grab; }
.mini-card-option.dragging { opacity: .55; border-style: dashed; cursor: grabbing; }
.mini-card-option label { grid-area: title; min-width: 0; margin: 0; color: #16334d; }
.drag-handle { grid-area: handle; width: 20px; height: 34px; display: grid; place-items: center; color: #607080; background: #eef1f4; border: 1px solid #c9d1da; border-radius: 3px; font-weight: 900; cursor: grab; }
.mini-card-option .row-sub { grid-area: meta; min-width: 0; overflow-wrap: anywhere; }
.mini-card-option input[type=checkbox] { margin-right: 5px; }
.mini-card-order { grid-area: order; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.mini-card-order input { width: 70px; min-height: 30px; padding: 4px 7px; }
.muted-card { opacity: .72; }
.doc-layout { display: grid; grid-template-columns: minmax(0,1fr) 240px; gap: 20px; }
.doc { min-width: 0; }.doc h1 { font-size: 28px; }.doc h2 { margin-top: 28px; }.doc p { max-width: 900px; }
.docs-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; list-style: none; padding: 0; }
.bento { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 14px; }
.bento-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; background: #fff; border: 1px solid #9aa3ae; border-top: 3px solid var(--brand); border-radius: var(--radius); text-decoration: none; box-shadow: 0 1px 3px rgba(0,0,0,.1); transition: box-shadow .12s, transform .12s; }
.bento-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.16); transform: translateY(-2px); background: #fff; }
.bento-card strong { color: #16334d; font-size: 15px; text-decoration: none; }
.bento-meta { color: var(--brand-ink); font-weight: 700; font-size: 12px; }
.bento-desc { color: #3d444b; font-size: 12px; font-weight: 400; }
.docs-list a { display: block; height: 100%; padding: 8px 10px; border: 1px solid var(--line); border-left: 3px solid transparent; border-radius: var(--radius); text-decoration: none; background: #fff; font-weight: 400; }
.docs-list a:hover { border-left-color: var(--brand-ink); background: #eef4ff; }
.docs-list strong { display: block; color: #0000cc; text-decoration: underline; }.docs-list small { color: #3d444b; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #eceff5; }
.login-card { width: min(440px,100%); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.login-card .brand { color: var(--ink); border-color: var(--line); padding: 0 0 20px; margin-bottom: 22px; justify-content: center; }
.login-logo { background: transparent; box-shadow: none; padding: 0; }
.login-logo img { max-width: 240px; }
.login-card button { width: 100%; margin-top: 8px; }
.muted { color: var(--muted); }.nowrap { white-space: nowrap; }.mono { font-family: Consolas, "Courier New", monospace; font-size: 12px; }
td .mono, td.mono { color: #34495e; }
td strong, .page-intro h2 { color: #2c3e50; }
[data-tooltip] { position: relative; }
[data-tooltip]:hover:after { content: attr(data-tooltip); position: absolute; z-index: 50; left: 0; top: calc(100% + 7px); width: 260px; padding: 8px 10px; border-radius: 6px; background: #171c27; color: #fff; font-size: 12px; font-weight: 500; box-shadow: var(--shadow); }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(3,1fr); }.grid.three { grid-template-columns: 1fr; }.module-grid, .link-grid { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .app-shell, .app-shell.sidebar-collapsed { grid-template-columns: 1fr; }.sidebar { position: relative; width: 100%; height: auto; }.app-shell.sidebar-collapsed .nav a span:first-child { display: block; }.app-shell.sidebar-collapsed .brand { justify-content: flex-start; }.nav, .app-shell.sidebar-collapsed .nav { display: flex; overflow-x: auto; }.nav a, .app-shell.sidebar-collapsed .nav a { white-space: nowrap; justify-content: space-between; }.app-shell.sidebar-collapsed .nav .nav-count { position: static; transform: none; }.sidebar-footer { display: none; }.topbar { position: relative; padding: 0 18px; }.content { padding: 18px; }.stats { grid-template-columns: repeat(2,1fr); }.grid.two, .definition-grid, .doc-layout { grid-template-columns: 1fr; }.page-intro { align-items: flex-start; flex-direction: column; }.panel-header, .prompt-block-header { align-items: flex-start; flex-direction: column; }.panel-actions { justify-content: flex-start; }.sales-bar-row { grid-template-columns: 1fr; gap: 8px; }.sales-bar-value { text-align: left; }.timeline-item { grid-template-columns: 18px minmax(0,1fr); }.timeline-time { grid-column: 2; }.timeline-content { grid-column: 2; } }
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; }.topbar-meta { display: none; }.content { padding: 14px; }.panel { padding: 15px; }.docs-list { grid-template-columns: 1fr; } }

/* Sales overview */
.sales-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin: 4px 0 18px; }
.sales-stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(180deg,#fff, #f7fafc); display: flex; flex-direction: column; gap: 3px; }
.sales-stat.accent { border-color: rgba(7,164,243,.45); background: linear-gradient(180deg,#f0f9ff,#e6f4fe); }
.sales-stat-label { font-size: 12px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .03em; }
.sales-stat-value { font-size: 22px; font-weight: 800; color: var(--secondary); line-height: 1.15; }
.sales-stat.accent .sales-stat-value { color: var(--brand-ink); }
.sales-stat-note { font-size: 11px; color: #94a3b8; }
.sales-chart { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.sales-donut { width: 200px; height: 200px; flex: none; }
.sales-donut circle { transition: stroke-width .15s ease; }
.sales-donut-total { font-size: 21px; font-weight: 800; fill: var(--secondary); }
.sales-donut-sub { font-size: 11px; fill: #94a3b8; }
.sales-legend { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 2px; }
.sales-legend-row { display: grid; grid-template-columns: 14px minmax(90px,1.4fr) 2fr auto 44px; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 6px; }
.sales-legend-row:hover { background: #f5f8fb; }
.sales-dot { width: 12px; height: 12px; border-radius: 4px; }
.sales-legend-name { font-weight: 600; color: var(--secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sales-legend-bar { height: 8px; background: #eef2f6; border-radius: 5px; overflow: hidden; }
.sales-legend-bar span { display: block; height: 100%; border-radius: 5px; }
.sales-legend-val { font-weight: 700; color: var(--secondary); text-align: right; white-space: nowrap; }
.sales-legend-pct { color: #94a3b8; text-align: right; font-size: 13px; }
@media (max-width: 820px) { .sales-stats { grid-template-columns: repeat(2,1fr); }.sales-legend-row { grid-template-columns: 14px 1fr auto; }.sales-legend-bar { display: none; } }

/* File preview modal (Fast add) */
[hidden] { display: none !important; }
.modal-overlay { position: fixed; inset: 0; background: rgba(13,34,51,.55); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 24px; }
.modal-box { background: #fff; border-radius: 8px; max-width: 860px; width: 100%; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 12px 44px rgba(0,0,0,.35); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.modal-head strong { color: var(--secondary); font-size: 14px; word-break: break-all; }
.modal-pre { margin: 0; padding: 16px; overflow: auto; white-space: pre-wrap; word-break: break-word; background: #f7fafc; color: #0d2233; font-size: 13px; line-height: 1.5; flex: 1; }

/* HTML syntax highlighting (self-contained highlighter in admin.js) */
.tok-tag { color: #0550ae; font-weight: 600; }
.tok-attr { color: #953800; }
.tok-str { color: #0a7d33; }
.tok-comment { color: #6e7781; font-style: italic; }
.tok-punct { color: #57606a; }
pre.code-html { color: #24292f; }

/* ============================================================
   Contrast pass v2: strong, clearly separated depth levels.
   Page (cool gray) -> white card -> BLUE header band -> white body
   -> gray sub-panel -> white options. Darker borders throughout.
   ============================================================ */

/* Cooler, slightly darker page so white cards clearly pop. */
body { background: #d7dee6; }

/* Top-level sections: strong border + shadow + air so they never merge. */
.content > .panel { margin-bottom: 20px; border: 1px solid #7c8794; border-top: 3px solid var(--brand); box-shadow: 0 3px 10px rgba(13,34,51,.14); }
/* White header (page is darker, so the white panel already pops); a clear
   bottom border + the brand top-border make it read as a title bar. */
.panel-header { background: #fff; border-bottom: 1px solid #c4ccd5; }
.panel-header h2, .panel-header h3 { color: #0d2233; }
.panel-subtitle { color: #33414f; }
.panel.collapsible > .panel-header:hover { background: #f4f7fa; }

/* Repeating editor cards (Rule Cards, AI Profiles) = clearly distinct blocks. */
.library-item-editor { margin: 0 0 14px; border: 1px solid #8e99a6; border-left: 4px solid var(--brand); background: #fff; box-shadow: 0 2px 6px rgba(13,34,51,.12); }
.library-item-editor > summary { background: #dde7f0; color: #16334d; border-bottom: 1px solid transparent; }
.library-item-editor[open] > summary { background: linear-gradient(#cfe0f0, #bcd3e7); border-bottom: 2px solid #97acc2; }
.library-item-editor:hover { border-left-color: var(--brand-2); box-shadow: 0 3px 10px rgba(13,34,51,.16); }
.library-item-editor summary strong { color: #0d2233; }

/* Card body stays WHITE (max contrast vs the blue header band). */
.library-item-editor .library-editor-form,
.library-item-editor .library-delete-form { background: #fff; }

/* Sub-panels inside the white body drop onto a clear gray so they separate. */
.mini-card-picker { border: 1px solid #9aa5b2; border-radius: var(--radius); background: #eaeef3; box-shadow: 0 1px 2px rgba(13,34,51,.08); padding-bottom: 8px; }
.mini-card-picker > summary { padding: 8px 12px; font-weight: 700; color: #16334d; background: #d7e0ea; border-bottom: 1px solid #9aa5b2; cursor: pointer; }
.mini-card-grid { background: transparent; }
.mini-card-option { border-color: #8e99a6; background: #fff; box-shadow: 0 1px 2px rgba(13,34,51,.10); }
.mini-card-option.muted-card { background: #e3e7ec; opacity: .82; }

/* Switch row: clear gray chip with firmer border on the white body. */
.switch-row { background: #eaeef3; border-color: #9aa5b2; }

/* All callouts share one yellow "note" colour (info and warning alike). */
.callout, .callout.warning { background: #fdf6da; border: 1px solid #ecdb9a; border-left: 5px solid #e8b923; color: #574607; font-size: 13px; padding: 9px 12px; }
.callout strong, .callout.warning strong { color: #7a6206; }

/* Documentation body: larger, more readable text. */
.doc { font-size: 15px; line-height: 1.65; color: #1c2530; }
.doc p, .doc li, .doc td, .doc th { font-size: 15px; }
.doc h2 { font-size: 22px; }
.doc h3 { font-size: 18px; }
.doc pre, .doc code { font-size: 14px; }

/* Darker secondary text for readability. */
.row-sub, .field-help, .panel-subtitle, .mini-card-help, .mini-card-preview { color: #333c46; }

/* Tables: neutral zebra + row separators (no bluish tint that clashes). */
tbody tr:nth-child(even) td { background: #f2f3f5; }
th, td { border-bottom: 1px solid #c9cdd3; }
tbody tr:hover td { background: #e8ebef; }
th { background: #e4e6ea; border-bottom: 2px solid #99a0a9 !important; color: #1c2530; }

/* Nested help/preview blocks inside a card: inset tint, clear border. */
.mini-card-help, .mini-card-preview { background: #f1f4f8; border-color: #b7c1cc; }

/* ============================================================
   Poppins typeface + roomier spacing (~25% more padding).
   ============================================================ */
body { font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif; line-height: 1.5; }
/* Everything uses Montserrat, including code / textarea / mono spans. */
code, pre, .modal-pre, pre.code-html, textarea, .mono, td.mono, td .mono, input, select, .table-search, kbd, samp { font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; }

/* Flash = success (green); errors stay red. */
.flash { background: #e4f6ea; border-color: #8fca9f; border-left-color: var(--success); color: #14532d; }
.flash:before { content: "\2714"; color: var(--success); }

/* Every callout gets bottom spacing so it never sticks to the next block. */
.callout { margin-bottom: 14px; }

/* Roomier padding everywhere (Poppins runs a bit larger). */
.content { padding: 16px 20px 34px; }
.panel { padding: 13px 16px; }
.panel-header { padding: 9px 16px; margin: -13px -16px 13px; }
.panel.collapsed > .panel-header { margin-bottom: -13px; }
th, td { padding: 7px 11px; }
button, .button { min-height: 36px; padding: 6px 14px; }
button.small, .button.small { min-height: 28px; padding: 3px 9px; }
input, select, textarea { padding: 6px 11px; }
input, select { min-height: 36px; }
.field { margin-bottom: 13px; }
.callout { padding: 11px 15px; }
.badge { padding: 3px 9px; }
.switch-row { padding: 10px 13px; }
.library-item-editor > summary { padding: 10px 13px; }
.library-item-editor .library-editor-form { padding: 13px; }
.mini-card-option { padding: 9px 10px; }
.mini-card-picker > summary { padding: 10px 14px; }
.nav > a { min-height: 36px; padding: 7px 9px; }
.nav-child { min-height: 34px; padding: 7px 9px; }
.stat { padding: 11px 13px 11px 16px; }
.module-card, .bento-card { padding: 16px 18px; }

/* ============================================================
   Semantic button colours: every variant is clearly coloured.
   primary = brand blue | secondary = deep navy | ghost = blue outline
   | danger = red.
   ============================================================ */
button.secondary, .button.secondary { background: var(--secondary); color: #fff; border-color: #0a1b29; }
button.secondary:hover, .button.secondary:hover { background: #163a55; color: #fff; border-color: #163a55; }
button.ghost, .button.ghost { background: #fff; color: var(--brand-ink); border: 1.5px solid var(--brand); }
button.ghost:hover, .button.ghost:hover { background: #e8f5fe; color: #045a86; border-color: var(--brand-2); }
/* Keep secondary icons/text readable on the navy fill. */
button.secondary .nav-icon, .button.secondary svg { color: #fff; }

/* Docs list: consistent left accent bar (gray -> brand on hover), not a gap. */
.docs-list a { border-left: 3px solid var(--line); }
.docs-list a:hover { border-left-color: var(--brand); }

/* Generic <details> (definition groups, examples) get proper inner padding.
   Library/mini-card details keep their own dedicated styles. */
details:not(.library-item-editor):not(.library-new):not(.mini-card-picker):not([class*="library"]) > summary { padding: 8px 12px; cursor: pointer; }
details:not(.library-item-editor):not(.library-new):not(.mini-card-picker):not([class*="library"]) > *:not(summary):not(pre) { padding: 0 12px 12px; }
details:not(.library-item-editor):not(.library-new):not(.mini-card-picker):not([class*="library"])[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }

/* Clickable dashboard stat cards. */
a.stat { display: block; text-decoration: none; color: inherit; transition: box-shadow .12s ease, transform .12s ease; }
a.stat:visited { color: inherit; }
a.stat:hover { box-shadow: 0 5px 16px rgba(13,34,51,.18); transform: translateY(-2px); }
a.stat .stat-value { color: #222; }
a.stat:after { content: "\2192"; position: absolute; top: 8px; right: 10px; color: var(--brand); font-weight: 700; opacity: 0; transition: opacity .12s ease; }
a.stat:hover:after { opacity: 1; }

/* Password-style setting fields with a show/hide eye toggle. */
.pw-field { position: relative; display: flex; align-items: center; }
.pw-field input { padding-right: 40px; }
.pw-eye { position: absolute; right: 4px; min-height: 28px; padding: 2px 8px; background: transparent; border: 0; box-shadow: none; color: #5a6470; cursor: pointer; font-size: 15px; opacity: .6; }
.pw-eye:hover { background: transparent; color: var(--brand-ink); box-shadow: none; opacity: 1; }
.pw-eye.on { color: var(--brand); opacity: 1; }

/* library-new create forms (e.g. "Add a new setting") need inner padding. */
.library-new > form { padding: 14px; }

/* Custom autocomplete (nice, scrollable dropdown). */
.ac { position: relative; display: inline-block; width: min(460px, 100%); }
.ac-input { width: 100%; }
.ac-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); max-height: 320px; overflow-y: auto; background: #fff; border: 1px solid #9aa5b2; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(13,34,51,.18); padding: 4px; }
.ac-item { display: block; padding: 8px 12px; border-radius: 4px; color: var(--secondary); text-decoration: none; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-item:hover, .ac-item.hl { background: #e5eef7; color: var(--brand-ink); }
.ac-item.active { background: #eef2f6; }
.ac-item[hidden] { display: none; }
.ac-empty { padding: 8px 12px; color: #6a7480; font-size: 12px; }
.ac-list::-webkit-scrollbar { width: 9px; }
.ac-list::-webkit-scrollbar-thumb { background: #c3cbd4; border-radius: 999px; border: 2px solid #fff; }
