/* LinkedIn Agent cloud dashboard - mobile first, same palette as the local dashboard. */
:root {
  --bg: #f6f3ef; --panel: #ffffff; --ink: #1f1a16; --muted: #6f655c; --line: #e4ddd4;
  --accent: #8a5a2b; --accent-soft: #f1e6da; --ok: #2f6b3a; --ok-soft: #e3f0e5;
  --warn: #8a6200; --warn-soft: #fbf1d9; --bad: #9b2c2c; --bad-soft: #f8e3e1; --radius: 12px;
  --side: #241d18; --tap: 44px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
a { color: var(--accent); }
[hidden] { display: none !important; }

/* ---------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--side); }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border-radius: 16px; padding: 22px; box-shadow: 0 12px 40px #0006; }
.login-card .brand { padding: 0 0 14px; border: 0; color: var(--ink); }
.login-card .brand span { color: var(--muted); }
button.wide { width: 100%; margin-top: 12px; min-height: var(--tap); }
button.link { background: none; border: 0; color: var(--accent); padding: 8px 0; text-decoration: underline; }
.side-foot button.link { color: #e9e1d8; }

/* ---------- shell */
.side { position: fixed; inset: 0 auto 0 0; width: 270px; max-width: 85vw; background: var(--side); color: #e9e1d8; display: flex; flex-direction: column;
  transform: translateX(-102%); transition: transform .2s ease; z-index: 30; padding-top: env(safe-area-inset-top); }
body.nav-open .side { transform: none; }
.scrim { display: none; position: fixed; inset: 0; background: #0007; z-index: 20; }
body.nav-open .scrim { display: block; }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px; border-bottom: 1px solid #3a3029; }
.brand .mark { width: 36px; height: 36px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; }
.brand span { display: block; font-size: 12px; color: #b9ab9c; }
nav { flex: 1; overflow-y: auto; padding: 8px; -webkit-overflow-scrolling: touch; }
nav a { display: flex; justify-content: space-between; align-items: center; min-height: var(--tap); padding: 0 12px; border-radius: 9px; color: #d9cfc4; text-decoration: none; font-size: 15px; }
nav a.active { background: var(--accent); color: #fff; }
nav a .badge { background: #ffffff22; border-radius: 10px; padding: 0 8px; font-size: 12px; }
nav a .badge.alert { background: var(--bad); color: #fff; }
nav .group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8f8174; padding: 12px 12px 4px; }
.side-foot { font-size: 12px; color: #a89a8c; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #3a3029; }
main { min-width: 0; padding: 0 14px 80px; }
.top { position: sticky; top: 0; z-index: 10; display: flex; gap: 10px; align-items: center; background: var(--bg); padding: 10px 0; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.top h1 { font-size: 19px; margin: 0; flex: 1; }
.menu { position: relative; min-width: var(--tap); min-height: var(--tap); font-size: 20px; padding: 0; }
.tab-badge:not(:empty) { position: absolute; top: 3px; right: 3px; background: var(--bad); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 5px; line-height: 17px; }

/* ---------- content */
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pre { white-space: pre-wrap; }
.grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
a.card { color: inherit; text-decoration: none; display: block; }
.stat .n { font-size: 26px; font-weight: 700; }
.stat .n.small-n { font-size: 15px; }
.stat .l { color: var(--muted); font-size: 12.5px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); min-height: var(--tap); }
textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
textarea.post { min-height: 320px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input:disabled { background: #f3efea; color: var(--muted); }
button { font: inherit; border: 1px solid var(--line); background: #fff; padding: 9px 14px; border-radius: 9px; cursor: pointer; color: var(--ink); min-height: var(--tap); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.ok { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 600; }
button.danger { color: var(--bad); }
button:disabled { opacity: .45; cursor: not-allowed; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }
.row.actions { margin-top: 10px; }
.row.actions > button { flex: 1 1 auto; }
.spacer { height: 12px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; background: #eee; color: #444; white-space: nowrap; }
.s-draft, .s-todo { background: #eef0f3; color: #3c4653; }
.s-approved, .s-engaged, .s-used, .v-ok { background: var(--ok-soft); color: var(--ok); }
.s-queued, .s-scheduled { background: #e5edf8; color: #24508a; }
.s-published { background: #e8e1f5; color: #4f3592; }
.s-rejected, .s-failed, .s-skip, .s-discarded { background: var(--bad-soft); color: var(--bad); }
.v-PASS { background: var(--ok-soft); color: var(--ok); }
.v-BLOCKED { background: var(--bad-soft); color: var(--bad); }
.k-carousel { background: var(--accent-soft); color: var(--accent); }
.qc { border-radius: 9px; padding: 10px 12px; font-size: 13px; margin-top: 10px; }
.qc ul { margin: 4px 0 0; padding-left: 18px; }
.qc.blocked { background: var(--bad-soft); }
.qc.passed { background: var(--ok-soft); }
.qc .warn { color: var(--warn); }
.checks { display: grid; grid-template-columns: 100px 1fr 40px; gap: 3px 8px; align-items: center; font-size: 12px; margin-top: 6px; }
.bar { height: 7px; background: #eee6dd; border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.post-card { border-left: 5px solid var(--line); }
.post-card.passed { border-left-color: var(--ok); }
.post-card.blocked { border-left-color: var(--bad); }
details { margin-top: 8px; }
details summary { cursor: pointer; color: var(--accent); padding: 6px 0; }
details.notes .pre { background: #faf8f5; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; word-break: break-word; }
pre.text { white-space: pre-wrap; word-break: break-word; font: 14.5px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; background: #faf8f5; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin: 8px 0; max-height: 60vh; overflow: auto; }
pre.md { font: 12.5px/1.5 ui-monospace, Consolas, monospace; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font-size: 12px; color: var(--muted); font-weight: 600; padding: 0 4px; }
.cal .day { background: #fff; border: 1px solid var(--line); border-radius: 8px; min-height: 92px; padding: 6px; font-size: 12px; }
.cal .day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cal .day .d { color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.cal .item { border-radius: 5px; padding: 2px 5px; margin-bottom: 3px; background: var(--accent-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-row { margin-bottom: 8px; }
.desktop-only { display: none; }
.notice { background: var(--warn-soft); border: 1px solid #ecd9a6; border-radius: 9px; padding: 10px 12px; margin-bottom: 12px; font-size: 13.5px; }
.notice.info { background: #eef3fa; border-color: #cfdcef; }
.notice.bad { background: var(--bad-soft); border-color: #eec3bf; }
.notice ul { margin: 4px 0; padding-left: 18px; }
.toast { position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); background: var(--side); color: #fff; padding: 12px 14px; border-radius: 10px; z-index: 50; box-shadow: 0 6px 24px #0004; }
.toast.err { background: var(--bad); }
.hook-box { background: #faf8f5; border: 1px solid var(--line); border-radius: 9px; padding: 10px; font-size: 13px; }
.slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 8px; }
.slide-mini { aspect-ratio: 4/5; background: #fbf8f4; border: 1px solid var(--line); border-left: 6px solid var(--accent); border-radius: 6px; padding: 8px; font-size: 11px; overflow: hidden; }
.slide-mini.cover { background: var(--accent); color: #fff; }
.slide-mini b { display: block; font-size: 13px; margin: 2px 0 4px; }
.hbars .hb { display: grid; grid-template-columns: 1fr; gap: 4px; margin: 10px 0; font-size: 13px; }
.hbars .track { background: #eee6dd; border-radius: 4px; height: 12px; overflow: hidden; }
.hbars .track i { display: block; height: 100%; background: var(--accent); }
.empty { color: var(--muted); padding: 18px; text-align: center; }
.score-big { font-size: 40px; font-weight: 700; }
.metrics-in { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0 8px; }
.settings .setting { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hc { padding: 8px 0; border-bottom: 1px solid var(--line); }
.hc .muted { flex-basis: 100%; padding-left: 20px; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: #d39b00; } .dot.bad { background: var(--bad); }
.alert-row { border-left: 4px solid var(--line); padding: 8px 10px; margin-bottom: 8px; background: #faf8f5; border-radius: 6px; }
.alert-row.error { border-left-color: var(--bad); } .alert-row.warning { border-left-color: #d39b00; } .alert-row.info { border-left-color: #5b7fb6; }

/* ---------- tablet / desktop */
@media (min-width: 900px) {
  body { display: block; }
  #app:not([hidden]) { display: flex; }
  .side { position: sticky; top: 0; height: 100vh; transform: none; width: 240px; flex: none; }
  .scrim, .menu { display: none !important; }
  main { flex: 1; padding: 0 28px 60px; }
  .top { padding: 18px 0 12px; }
  .top h1 { font-size: 22px; }
  .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .desktop-only { display: grid; }
  .mobile-only { display: none; }
  .row.actions > button { flex: 0 0 auto; }
  .toast { left: auto; right: 22px; max-width: 460px; }
  .hbars .hb { grid-template-columns: 200px 1fr 120px; align-items: center; }
  .settings .setting { grid-template-columns: 260px 1fr; align-items: center; }
  textarea.post { min-height: 260px; }
  .hc .muted { flex-basis: auto; padding-left: 0; }
}
