:root {
  color-scheme: light;
  --bg: oklch(0.965 0.018 86);
  --surface: oklch(0.995 0.006 95);
  --surface-2: oklch(0.94 0.02 88);
  --ink: oklch(0.18 0.025 70);
  --muted: oklch(0.48 0.025 72);
  --line: oklch(0.82 0.025 82);
  --line-strong: oklch(0.31 0.03 70);
  --accent: oklch(0.62 0.16 42);
  --accent-dark: oklch(0.48 0.16 42);
  --accent-soft: oklch(0.91 0.075 55);
  --good: oklch(0.43 0.13 150);
  --bad: oklch(0.48 0.17 25);
  --shadow: 0 18px 50px rgba(65, 48, 26, 0.11);
  --shadow-soft: 0 8px 26px rgba(65, 48, 26, 0.08);
  --radius: 8px;
  --mono: "SFMono-Regular", "Courier New", "Microsoft YaHei", monospace;
  --serif: "Songti SC", "SimSun", Georgia, "Times New Roman", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  --chat-width: 400px;
  --side-width: 112px;
  --gap: 12px;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 0%, rgba(189, 118, 42, 0.11), transparent 34rem),
    linear-gradient(180deg, oklch(0.985 0.012 93), var(--bg) 34rem);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.58;
  letter-spacing: 0;
}
button, textarea, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
p { margin: 0; text-wrap: pretty; }
h1, h2 { margin: 0; line-height: 1.12; text-wrap: balance; letter-spacing: 0; }
.hidden { display: none !important; }

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}
.brand small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
}
.lockup { font-size: 26px; }

.bevel, .god-mode, .task-actions button, .quick-actions button {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: linear-gradient(180deg, #fffdf7, #e6dfcf);
  box-shadow: 0 2px 0 rgba(31, 25, 16, 0.22);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
  padding: 9px 13px;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.bevel:hover, .task-actions button:hover, .quick-actions button:hover {
  background: linear-gradient(180deg, #fff, #f0e7d5);
  box-shadow: 0 3px 0 rgba(31, 25, 16, 0.22);
}
.bevel:active, .god-mode:active, .task-actions button:active, .quick-actions button:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 rgba(31, 25, 16, 0);
}
.bevel:disabled, .god-mode:disabled, .task-actions button:disabled, .quick-actions button:disabled {
  cursor: default;
  opacity: 0.55;
}
.god-mode {
  color: white;
  border-color: var(--accent-dark);
  background: linear-gradient(180deg, oklch(0.68 0.18 46), var(--accent-dark));
  box-shadow: 0 3px 0 oklch(0.35 0.13 42);
}
.god-mode:hover { background: linear-gradient(180deg, oklch(0.72 0.18 46), oklch(0.52 0.16 42)); }
.text-button {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  padding: 0;
}

.login-view {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(54, 38, 18, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(54, 38, 18, 0.04) 1px, transparent 1px),
    var(--bg);
  background-size: 42px 42px;
}
.login-nav, .topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(55, 40, 24, 0.16);
  background: rgba(255, 253, 247, 0.9);
  backdrop-filter: blur(18px);
}
.login-nav {
  min-height: 64px;
  padding: 12px 24px;
}
.login-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 420px);
  gap: 34px;
  align-items: center;
  width: min(1080px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 42px 0;
}
.login-copy { max-width: 660px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.login-copy h1 {
  max-width: 700px;
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: 46px;
  font-weight: 900;
  line-height: 1.08;
}
.login-copy p:not(.eyebrow) {
  max-width: 580px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}
.login-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 660px;
  margin-top: 28px;
}
.proof-row {
  min-height: 116px;
  border: 1px solid rgba(55, 40, 24, 0.18);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.76);
  box-shadow: 0 12px 30px rgba(55, 40, 24, 0.08);
  padding: 16px;
}
.proof-row span,
.proof-row small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.proof-row strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1;
}
.login-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.92);
  box-shadow: var(--shadow);
  padding: 22px;
}
.login-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.login-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.1;
}
.auth-tabs {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(233, 225, 211, 0.55);
  padding: 3px;
}
.auth-tabs button {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 0 12px;
}
.auth-tabs button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(55, 40, 24, 0.12);
}
.login-card[data-auth-mode="login"] .register-only {
  display: none;
}
.login-card label {
  display: block;
  margin: 14px 0 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.login-card input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  font-size: 14px;
  padding: 9px 12px;
}
.login-card .god-mode { width: 100%; min-height: 42px; margin-top: 18px; }
.login-card .meta:empty { display: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 64px;
  padding: 10px 18px;
}
.top-actions { display: flex; gap: 8px; align-items: center; }
.top-actions > .bevel { flex: 0 0 auto; white-space: nowrap; }
.menu-popover {
  position: absolute;
  top: calc(100% - 6px);
  right: 20px;
  z-index: 60;
  display: none;
  width: 260px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.menu-popover.open { display: block; }
.menu-popover button {
  display: block;
  width: 100%;
  min-height: 42px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  padding: 10px 14px;
  text-align: left;
}
.menu-popover button:hover { background: var(--surface-2); }
.menu-popover hr { margin: 0; border: 0; border-top: 1px solid var(--line); }

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: var(--side-width) minmax(0, 1fr);
  min-height: calc(100vh - 64px);
  padding-right: var(--chat-width);
  transition: padding-right 180ms ease;
}
.app-shell:not(.chat-open) { padding-right: 0; }
.side-nav {
  position: sticky;
  top: 64px;
  align-self: start;
  min-height: calc(100vh - 64px);
  border-right: 1px solid rgba(55, 40, 24, 0.13);
  background: rgba(255, 253, 247, 0.58);
  padding: 12px 8px;
}
.side-nav button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 6px;
  padding: 9px 10px;
  text-align: left;
}
.side-nav button:hover, .side-nav button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: var(--gap);
  align-items: start;
  align-content: start;
  padding: 14px;
}
[data-view-panel][hidden] { display: none !important; }
.dashboard[data-view="agents"],
.dashboard[data-view="records"],
.dashboard[data-view="settings"],
.dashboard[data-view="channels"] {
  grid-template-columns: minmax(0, 1fr);
}
.dashboard[data-view="tasks"] {
  grid-template-columns: minmax(360px, 1.2fr) minmax(300px, 0.8fr);
}
.dashboard[data-view="agents"] .panel,
.dashboard[data-view="records"] .panel,
.dashboard[data-view="settings"] .panel,
.dashboard[data-view="channels"] .panel {
  grid-column: 1 / -1;
}
.hero-panel, .panel, .metric-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.hero-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 247, 230, 0.92)),
    var(--surface);
}
.hero-panel h1 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 900;
}
.hero-panel p:not(.eyebrow) {
  color: var(--muted);
  font-size: 16px;
}
.needs-company .hero-panel {
  border-color: rgba(159, 96, 23, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 251, 241, 0.95), rgba(255, 239, 215, 0.88)),
    var(--surface);
}
.needs-company .side-nav button:not([data-view="today"]) {
  opacity: 0.48;
}
.setup-card {
  border-style: dashed;
  background: rgba(255, 251, 242, 0.74);
}
.metric-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.metric-card {
  position: relative;
  overflow: hidden;
  padding: 13px 14px 12px;
  min-height: 112px;
  border-color: rgba(55, 40, 24, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.94), rgba(246, 240, 227, 0.72)),
    var(--surface);
}
.metric-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: var(--accent);
  opacity: 0.8;
}
.metric-card[data-tone="opportunity"]::before { background: oklch(0.55 0.11 152); }
.metric-card[data-tone="judgement"]::before { background: oklch(0.52 0.12 45); }
.metric-card[data-tone="asset"]::before { background: oklch(0.47 0.08 240); }
.metric-card[data-tone="money"]::before { background: oklch(0.48 0.1 100); }
.metric-card .metric-label {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  background: rgba(55, 40, 24, 0.08);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 5px 8px;
}
.metric-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.metric-card strong {
  display: block;
  margin: 12px 0 8px;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.28;
  letter-spacing: 0;
}
.panel { padding: 14px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 11px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
h2 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 900;
}
.meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}
.focus-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}
.focus-list li { padding-left: 4px; }
.focus-list strong, .focus-list span { display: block; }
.focus-list strong { font-size: 16px; }
.focus-list span { color: var(--muted); font-size: 13px; }
.agent-list, .task-list, .doc-list, .channel-list, .activity-list { display: grid; gap: 11px; }
.deliverable-panel {
  grid-column: 1 / -1;
}
.deliverable-panel .doc-list {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.deliverable-panel .doc-button {
  grid-template-columns: 42px minmax(0, 1fr);
  align-content: start;
  min-height: 116px;
  gap: 10px 12px;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(246, 240, 227, 0.72)),
    var(--surface-2);
}
.deliverable-panel .doc-button .doc-icon {
  width: 38px;
  height: 38px;
}
.deliverable-panel .doc-button > span:nth-child(2) {
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.35;
}
.deliverable-panel .doc-button .meta {
  grid-column: 2;
  align-self: end;
}
.agent-card, .task-card, .channel-card, .soft-card, .activity-item {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  padding: 12px;
}
.agent-card > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.agent-card strong, .channel-card strong, .task-card strong {
  font-size: 16px;
  line-height: 1.25;
}
.agent-card span, .channel-card span {
  color: var(--muted);
  font-size: 13px;
}
.agent-card p, .task-card p, .soft-card p, .activity-item p {
  margin: 6px 0;
  color: var(--muted);
}
.progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(93, 70, 35, 0.13);
}
.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), oklch(0.74 0.13 80));
}
.task-card { cursor: pointer; }
.task-card:hover, .doc-button:hover, .channel-card:hover { border-color: oklch(0.68 0.08 60); }
.task-top, .task-meta, .task-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.task-top { justify-content: space-between; }
.task-meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}
.task-actions { margin-top: 12px; }
.task-actions button {
  min-height: 34px;
  font-size: 13px;
  padding: 8px 11px;
}
.task-actions button:first-child {
  color: white;
  border-color: var(--ink);
  background: var(--ink);
}
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
}
.tag.urgent {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.doc-button {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  cursor: pointer;
  padding: 9px 10px;
  text-align: left;
}
.doc-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--ink);
  color: white;
  font-size: 12px;
  font-weight: 800;
}
.channel-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  align-items: center;
}
.channel-card span { grid-column: 1; }
.channel-card .bevel { grid-column: 2; grid-row: 1 / span 2; min-height: 40px; }
.soft-card.compact { margin-top: 12px; }
.activity-item {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 11px;
  align-items: start;
}
.activity-item span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}
.activity-item p { margin: 0; }

.chat-panel {
  position: fixed;
  top: 64px;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: var(--chat-width);
  height: calc(100dvh - 64px);
  min-height: 0;
  border-left: 1px solid rgba(55, 40, 24, 0.16);
  background: rgba(255, 253, 247, 0.96);
  box-shadow: -20px 0 48px rgba(65, 48, 26, 0.08);
  overflow: hidden;
  transform: translateX(0);
  transition: transform 180ms ease;
}
.app-shell:not(.chat-open) .chat-panel { transform: translateX(100%); }
.surprise-chip {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
}
.close-chat {
  position: static;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 18px;
  line-height: 1;
}
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 10px 48px 0 10px;
}
.quick-actions button {
  overflow: hidden;
  min-height: 32px;
  font-size: 13px;
  padding: 7px 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.agent-console {
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: auto;
  min-height: 0;
  max-height: 100%;
  margin: 10px 10px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.agent-console.is-busy {
  box-shadow: inset 0 0 0 1px rgba(222, 92, 38, 0.12), 0 10px 28px rgba(65, 48, 26, 0.06);
}
.agent-console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.86);
  padding: 10px 12px;
}
.agent-console-head strong,
.agent-console-head span {
  display: block;
}
.agent-console-head strong {
  font-size: 15px;
  line-height: 1.2;
}
.agent-status, #agentStatus {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.agent-status.ready, #agentStatus.ready { color: var(--good); }
.agent-status.busy, #agentStatus.busy { color: var(--accent-dark); }
.agent-status.error, #agentStatus.error { color: var(--bad); }
#agentStatus.busy::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-dark);
  box-shadow: 0 0 0 0 rgba(222, 92, 38, 0.38);
  animation: status-breathe 1100ms ease-in-out infinite;
}
.message-list {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
}
.message {
  flex: 0 0 auto;
  width: min(100%, 420px);
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  padding: 10px 11px;
  overflow: hidden;
}
.message.user {
  align-self: flex-end;
  border-color: var(--line-strong);
  background: var(--ink);
  color: white;
}
.message.agent {
  align-self: flex-start;
  width: min(100%, 520px);
  background: var(--surface-2);
}
.message.pending {
  position: relative;
  border-style: dashed;
}
.message.pending::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 10px;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(222, 92, 38, 0.22);
  border-top-color: var(--accent-dark);
  border-radius: 50%;
  animation: status-spin 900ms linear infinite;
}
.message.error {
  border-color: var(--bad);
}
.message-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  color: inherit;
  opacity: 0.7;
  font-family: var(--mono);
  font-size: 11px;
}
.message-body {
  white-space: pre-wrap;
  color: inherit;
  font-size: 14px;
  line-height: 1.58;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.message-body * {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.message-body p,
.message-body ul,
.message-body ol,
.message-body blockquote,
.message-body pre {
  margin: 0;
}
.message-body > * + * {
  margin-top: 7px;
}
.message-section {
  border-left: 3px solid rgba(222, 92, 38, 0.58);
  padding-left: 10px;
}
.message.agent .message-section {
  border-radius: 7px;
  background: rgba(255, 253, 247, 0.45);
  padding: 8px 10px 8px 12px;
}
.message-section + .message-section {
  margin-top: 10px;
  padding-top: 2px;
}
.message-body .message-heading {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  margin-bottom: 7px;
}
.message.user .message-body .message-heading {
  color: white;
}
.message.user .message-section {
  border-left-color: rgba(255, 247, 232, 0.42);
}
.message-body ul,
.message-body ol {
  padding-left: 20px;
}
.message-body li + li {
  margin-top: 7px;
}
.message-body code,
.message-body pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.message-body li strong {
  font-weight: 900;
}
.message-body strong {
  font-weight: 900;
}
.message-body blockquote {
  border-left: 3px solid var(--accent);
  color: var(--muted);
  padding-left: 10px;
}
.message-body code {
  border-radius: 4px;
  background: rgba(31, 25, 16, 0.08);
  font-family: var(--mono);
  font-size: 13px;
  padding: 1px 4px;
}
.message-body pre {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 253, 247, 0.68);
  padding: 9px;
}
.message-body pre code {
  display: block;
  background: transparent;
  padding: 0;
}
.chat-spacer { display: none; }
.composer {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 9px;
  align-items: center;
  margin: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-soft);
  padding: 7px;
}
.chat-panel.is-busy .composer {
  border-color: rgba(222, 92, 38, 0.34);
}
.attach {
  display: grid;
  place-items: center;
  min-height: 32px;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 22px;
}
textarea {
  width: 100%;
  min-height: 36px;
  max-height: 96px;
  resize: none;
  border: 0;
  outline: none;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}
textarea::placeholder { color: oklch(0.58 0.02 72); }
.open-inbox {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 19;
  display: none;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
}
.open-inbox::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 22px;
  width: 20px;
  height: 13px;
  border-radius: 50%;
  background: white;
  transform: rotate(-8deg);
}
.app-shell:not(.chat-open) .open-inbox { display: block; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(34, 25, 12, 0.28);
  padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  position: relative;
  width: min(540px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 20px;
}
.modal-close {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.modal h2 { margin: 0 42px 12px 0; }
.modal p { margin-bottom: 8px; color: var(--muted); }
.modal strong { color: var(--ink); }
.modal-form {
  display: grid;
  gap: 11px;
  margin-top: 12px;
}
.modal-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}
.modal-form input,
.modal-form textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
  background: white;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  padding: 9px 11px;
}
.modal-form textarea {
  min-height: 82px;
  resize: vertical;
}
.modal-list {
  display: grid;
  gap: 8px;
  max-height: min(56vh, 520px);
  overflow: auto;
  margin-top: 14px;
  padding-right: 4px;
}
.modal-item {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  padding: 11px;
}
.modal-item strong { display: block; margin-bottom: 5px; }
.company-switch-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.company-switch-item.active-company {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.company-switch-item .bevel,
.company-switch-item .god-mode {
  min-height: 36px;
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.modal-actions .god-mode,
.modal-actions .bevel {
  min-height: 38px;
}
.copy-panel {
  max-height: min(40vh, 360px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffaf0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.62;
  white-space: pre-wrap;
  padding: 11px;
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  justify-content: flex-end;
  background: rgba(34, 25, 12, 0.26);
}
.drawer-backdrop[hidden] { display: none; }
.document-drawer {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(680px, calc(100vw - 28px));
  height: 100dvh;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -28px 0 70px rgba(65, 48, 26, 0.18);
}
.drawer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.drawer-head {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 6% 0%, rgba(222, 92, 38, 0.12), transparent 22rem),
    rgba(255, 250, 240, 0.92);
  padding: 22px 60px 18px 22px;
}
.drawer-head span {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  padding: 3px 9px;
}
.drawer-head h2 {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.18;
}
.drawer-head p {
  margin-top: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}
.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 20px 22px 28px;
}
.drawer-report {
  max-width: 62ch;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.72;
}
.drawer-report .message-heading {
  margin: 18px 0 7px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 900;
}
.drawer-report .message-section {
  border-left: 3px solid rgba(222, 92, 38, 0.5);
  padding-left: 14px;
}
.drawer-report p,
.drawer-report li {
  margin: 0;
}
.drawer-report ul,
.drawer-report ol {
  padding-left: 22px;
}
.drawer-report > * + *,
.drawer-report .message-section + .message-section {
  margin-top: 13px;
}
.drawer-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.96);
  padding: 12px 14px;
}
.drawer-actions .god-mode,
.drawer-actions .bevel {
  min-height: 38px;
}
.drawer-loading {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 260px;
  color: var(--muted);
  text-align: center;
}
.drawer-loading span {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(222, 92, 38, 0.2);
  border-top-color: var(--accent-dark);
  border-radius: 50%;
  animation: status-spin 900ms linear infinite;
}
.creation-inline-panel {
  grid-column: 1 / -1;
  padding: 13px;
  border-color: rgba(222, 92, 38, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 251, 241, 0.96), rgba(246, 240, 227, 0.82)),
    var(--surface);
}
.creation-inline-panel[hidden] {
  display: none !important;
}
.creation-inline-panel .creation-process {
  margin-top: 0;
}
.creation-inline-panel .creation-live {
  background:
    radial-gradient(circle at 43px 42px, rgba(222, 92, 38, 0.2), transparent 35px),
    linear-gradient(135deg, rgba(222, 92, 38, 0.1), transparent 60%),
    rgba(255, 253, 247, 0.86);
}
.modal-backdrop[data-current="creation"] .modal {
  width: min(760px, 100%);
}
.creation-process {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}
.creation-live {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(55, 40, 24, 0.14);
  border-radius: 10px;
  background:
    radial-gradient(circle at 43px 42px, rgba(222, 92, 38, 0.22), transparent 35px),
    linear-gradient(135deg, rgba(222, 92, 38, 0.12), transparent 60%),
    var(--surface-2);
  padding: 14px;
}
.creation-core {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 1px solid rgba(55, 40, 24, 0.14);
  background: rgba(255, 253, 247, 0.78);
  overflow: hidden;
}
.creation-core span,
.creation-core i,
.creation-core b {
  position: absolute;
  border-radius: 999px;
}
.creation-core span {
  inset: 13px;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  animation: creation-pulse 1200ms ease-in-out infinite;
}
.creation-core i {
  inset: 5px;
  border: 1px solid rgba(222, 92, 38, 0.36);
  animation: creation-orbit 2200ms linear infinite;
}
.creation-core i::after {
  content: "";
  position: absolute;
  right: 5px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-dark);
}
.creation-core b {
  left: 18px;
  right: 18px;
  top: 33px;
  height: 2px;
  background: rgba(255, 253, 247, 0.92);
  animation: creation-scan-dot 900ms ease-in-out infinite;
}
.creation-copy {
  display: grid;
  gap: 4px;
}
.creation-copy span,
.creation-meter span,
.creation-stream-head span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}
.creation-copy strong {
  font-size: 22px;
  line-height: 1.2;
}
.creation-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.creation-meter {
  display: grid;
  justify-items: end;
  gap: 3px;
}
.creation-meter b {
  font-family: var(--serif);
  font-size: 34px;
  line-height: 0.9;
}
.creation-scan {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(55, 40, 24, 0.12);
}
.creation-scan::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 34%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.52), transparent);
  animation: creation-sweep 1500ms linear infinite;
}
.creation-scan span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  transition: width 360ms ease;
}
.creation-lanes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
.creation-lane {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 253, 247, 0.76);
  padding: 10px;
  min-height: 108px;
}
.creation-lane b {
  width: max-content;
  border-radius: 999px;
  background: rgba(55, 40, 24, 0.1);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 7px;
}
.creation-lane strong {
  display: block;
  min-height: 0;
  font-size: 14px;
  line-height: 1.25;
}
.creation-lane span {
  color: var(--muted);
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 12px;
  line-height: 1.45;
}
.creation-lane.active {
  border-color: rgba(222, 92, 38, 0.45);
  background: rgba(255, 246, 232, 0.94);
  transform: translateY(-1px);
  animation: creation-lane-pop 1200ms ease-in-out infinite;
}
.creation-lane.active b {
  color: white;
  background: var(--accent-dark);
  box-shadow: 0 0 0 5px rgba(222, 92, 38, 0.14);
}
.creation-lane.done b {
  color: white;
  background: oklch(0.52 0.11 145);
}
.creation-stream {
  border: 1px solid rgba(55, 40, 24, 0.14);
  border-radius: 10px;
  background: rgba(24, 18, 10, 0.92);
  color: #fff7e8;
  overflow: hidden;
}
.creation-stream-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 247, 232, 0.13);
  padding: 10px 12px;
}
.creation-stream-head strong {
  color: #fff7e8;
}
.creation-log-list {
  display: grid;
  gap: 0;
  max-height: 184px;
  overflow: hidden;
  padding: 4px 0;
}
.creation-log-list p {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  border-bottom: 1px solid rgba(255, 247, 232, 0.08);
  color: rgba(255, 247, 232, 0.88);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  padding: 8px 12px;
  animation: creation-row-in 260ms ease both;
}
.creation-log-list p:last-child {
  border-bottom: 0;
}
.creation-log-list time {
  color: rgba(255, 198, 143, 0.86);
}
.creation-log-list span {
  color: rgba(255, 247, 232, 0.92);
}
.creation-error {
  border: 1px solid oklch(0.72 0.14 28);
  border-radius: 7px;
  background: oklch(0.96 0.03 35);
  color: oklch(0.42 0.14 28) !important;
  padding: 10px;
}
@keyframes status-breathe {
  0%, 100% { transform: scale(0.82); opacity: 0.62; box-shadow: 0 0 0 0 rgba(222, 92, 38, 0.28); }
  50% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 7px rgba(222, 92, 38, 0); }
}
@keyframes status-spin {
  to { transform: rotate(360deg); }
}
@keyframes creation-pulse {
  0%, 100% { transform: scale(0.92); opacity: 0.76; }
  50% { transform: scale(1.08); opacity: 1; }
}
@keyframes creation-orbit {
  to { transform: rotate(360deg); }
}
@keyframes creation-scan-dot {
  0%, 100% { transform: translateY(-8px); opacity: 0.5; }
  50% { transform: translateY(8px); opacity: 1; }
}
@keyframes creation-sweep {
  from { transform: translateX(-110%); }
  to { transform: translateX(330%); }
}
@keyframes creation-lane-pop {
  0%, 100% { box-shadow: 0 0 0 rgba(222, 92, 38, 0); }
  50% { box-shadow: 0 10px 28px rgba(222, 92, 38, 0.16); }
}
@keyframes creation-row-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.toast-region {
  position: fixed;
  right: 18px;
  bottom: 92px;
  z-index: 110;
  display: grid;
  gap: 8px;
}
.toast {
  width: min(340px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  font-size: 14px;
  padding: 10px 12px;
}

@media (max-width: 1320px) {
  .dashboard { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  :root { --chat-width: 100vw; --side-width: 100%; }
  .login-main { grid-template-columns: 1fr; padding: 42px 0; }
  .login-copy h1 { font-size: 38px; }
  .login-proof { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .topbar { flex-wrap: wrap; gap: 12px; }
  .top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 10px;
  }
  .top-actions > .bevel { width: 100%; }
  .menu-popover { top: calc(100% - 6px); left: 16px; right: 16px; width: auto; }
  .app-shell { display: block; padding-right: 0; }
  .side-nav {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    min-height: 0;
    gap: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(55, 40, 24, 0.13);
    padding: 10px 12px;
  }
  .side-nav button {
    flex: 0 0 auto;
    width: auto;
    margin-bottom: 0;
    white-space: nowrap;
  }
  .dashboard { grid-template-columns: 1fr; padding: 14px; }
  .dashboard[data-view] { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .hero-panel { grid-template-columns: 1fr; padding: 22px; }
  .hero-panel h1 { font-size: 40px; }
  .hero-panel .god-mode { width: 100%; }
  .creation-live {
    grid-template-columns: 58px minmax(0, 1fr);
  }
  .creation-core {
    width: 52px;
    height: 52px;
  }
  .creation-core span { inset: 10px; }
  .creation-meter {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
  }
  .creation-lanes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .creation-log-list p {
    grid-template-columns: 68px minmax(0, 1fr);
  }
  .chat-panel {
    top: auto;
    bottom: 0;
    height: min(72vh, 560px);
    z-index: 80;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .agent-console { flex: 1 1 auto; height: auto; }
  .app-shell:not(.chat-open) .chat-panel { transform: translateY(100%); }
  .message-list { min-height: 0; }
  .document-drawer {
    width: 100vw;
  }
  .drawer-head {
    padding: 18px 56px 15px 18px;
  }
  .drawer-body {
    padding: 16px 18px 24px;
  }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .login-nav { padding: 14px 16px; }
  .login-main { width: calc(100vw - 28px); }
  .login-copy h1 { font-size: 31px; }
  .login-copy p:not(.eyebrow) { font-size: 15px; }
  .login-proof { grid-template-columns: 1fr; margin-top: 18px; }
  .proof-row { min-height: 92px; padding: 14px; }
  .login-card-head { display: grid; }
  .auth-tabs { width: 100%; }
  .dashboard { padding: 12px; }
  .metric-grid { grid-template-columns: 1fr; }
  .hero-panel, .panel, .metric-card { padding: 15px; }
  h2 { font-size: 23px; }
  .doc-button { grid-template-columns: 38px 1fr; }
  .doc-button .meta { grid-column: 2; }
  .channel-card { grid-template-columns: 1fr; }
  .channel-card .bevel { grid-column: auto; grid-row: auto; }
  .activity-item { grid-template-columns: 1fr; }
  .composer { grid-template-columns: 28px 1fr 68px; }
  .creation-lanes { grid-template-columns: 1fr; }
  .drawer-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .creation-core span,
  .creation-core i,
  .creation-core b,
  .creation-scan::after,
  .creation-lane.active,
  .creation-log-list p,
  #agentStatus.busy::before,
  .message.pending::after,
  .drawer-loading span {
    animation: none;
  }
}

/* Modern product workspace refresh */
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --ink: #171b24;
  --muted: #687385;
  --line: #dce3ec;
  --line-strong: #a8b3c2;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eaf1ff;
  --good: #14804a;
  --bad: #b42318;
  --shadow: 0 20px 56px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.07);
  --radius: 8px;
  --mono: "SFMono-Regular", "Menlo", "Consolas", "Microsoft YaHei", monospace;
  --serif: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  --chat-width: 430px;
  --side-width: 124px;
  --gap: 14px;
}

html,
body {
  background: var(--bg);
}

body {
  color: var(--ink);
  background:
    linear-gradient(180deg, #f8fafc 0, #f4f6fa 320px, #eef2f7 100%);
  font-size: 14px;
  line-height: 1.58;
}

h1,
h2,
.brand,
.login-copy h1,
.login-card h2,
.hero-panel h1,
.drawer-head h2,
.drawer-report .message-heading {
  font-family: var(--sans);
  letter-spacing: 0;
}

.brand {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: inherit;
  font-size: 18px;
  font-weight: 850;
}

.brand::before {
  content: "";
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.32), transparent 48%),
    #111827;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 10px 22px rgba(17, 24, 39, 0.18);
}

.brand::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 12px;
  width: 14px;
  height: 10px;
  border: 2px solid #ffffff;
  border-top: 0;
  border-radius: 0 0 5px 5px;
}

.brand span,
.brand small {
  min-width: 0;
}

.brand small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.login-nav,
.topbar {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.topbar {
  min-height: 62px;
  padding: 10px 20px;
}

.top-actions {
  gap: 10px;
}

.bevel,
.god-mode,
.task-actions button,
.quick-actions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  padding: 8px 13px;
}

.bevel:hover,
.task-actions button:hover,
.quick-actions button:hover {
  border-color: #bfcbdb;
  background: #f8fafc;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.god-mode,
.task-actions button:first-child {
  border-color: transparent;
  background: #111827;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.18);
}

.god-mode:hover,
.task-actions button:first-child:hover {
  background: #0f172a;
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.22);
}

.text-button {
  color: var(--accent-dark);
  font-size: 13px;
}

.menu-popover {
  top: calc(100% + 8px);
  width: 236px;
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}

.menu-popover button {
  min-height: 40px;
  font-size: 14px;
  padding: 10px 14px;
}

.menu-popover button:hover {
  background: #f3f6fb;
}

.app-shell {
  min-height: calc(100vh - 62px);
}

.side-nav {
  top: 62px;
  min-height: calc(100vh - 62px);
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.86);
  padding: 14px 10px;
}

.side-nav button {
  min-height: 38px;
  border-radius: 8px;
  color: #5c6678;
  font-size: 13px;
  font-weight: 760;
  margin-bottom: 7px;
  padding: 9px 12px;
}

.side-nav button:hover,
.side-nav button.active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.side-nav button.active {
  box-shadow: inset 3px 0 0 var(--accent), 0 8px 20px rgba(15, 23, 42, 0.08);
}

.dashboard {
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 14px;
  padding: 18px;
}

.hero-panel,
.panel,
.metric-card {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.hero-panel {
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 42%),
    linear-gradient(180deg, #ffffff, #f8fafc);
}

.hero-panel h1 {
  margin-bottom: 8px;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 850;
}

.hero-panel p:not(.eyebrow) {
  max-width: 720px;
  color: #526073;
  font-size: 14px;
}

.eyebrow {
  color: var(--accent-dark);
  font-size: 11px;
  letter-spacing: 0;
}

.needs-company .hero-panel,
.setup-card {
  border-color: rgba(37, 99, 235, 0.22);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 48%),
    #ffffff;
}

.panel {
  padding: 16px;
}

.section-head {
  align-items: center;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding-bottom: 12px;
}

h2 {
  color: #121826;
  font-size: 18px;
  font-weight: 850;
}

.meta,
.task-meta,
.activity-item span {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
}

.agent-list,
.task-list,
.doc-list,
.channel-list,
.activity-list {
  gap: 12px;
}

.deliverable-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
}

.deliverable-panel .section-head {
  margin-bottom: 16px;
}

.deliverable-panel .doc-list {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.doc-button,
.deliverable-panel .doc-button {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 154px;
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff, #f9fbff);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  overflow: hidden;
  padding: 16px;
  text-align: left;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.doc-button::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--accent);
}

.doc-button[data-tone="leads"]::before {
  background: #0f9f6e;
}

.doc-button[data-tone="proposal"]::before {
  background: #c2410c;
}

.doc-button[data-tone="plan"]::before {
  background: #7c3aed;
}

.doc-button:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.32);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.12);
}

.doc-icon,
.deliverable-panel .doc-button .doc-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.doc-button[data-tone="report"] .doc-icon {
  background: #1d4ed8;
}

.doc-button[data-tone="leads"] .doc-icon {
  background: #047857;
}

.doc-button[data-tone="proposal"] .doc-icon {
  background: #b45309;
}

.doc-button[data-tone="plan"] .doc-icon {
  background: #6d28d9;
}

.doc-content {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.doc-type {
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  background: #eef3fb;
  color: #536176;
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
  padding: 5px 8px;
}

.doc-content strong,
.deliverable-panel .doc-button > span:nth-child(2) {
  color: #111827;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.35;
}

.doc-content small {
  display: -webkit-box;
  overflow: hidden;
  color: #5f6b7c;
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.doc-meta {
  position: absolute;
  right: 16px;
  bottom: 14px;
  color: #7a8494;
  font-size: 12px;
}

.doc-button::after {
  content: "打开";
  position: absolute;
  left: 74px;
  bottom: 14px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 760;
}

.agent-card,
.task-card,
.channel-card,
.soft-card,
.activity-item,
.modal-item {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: #ffffff;
}

.agent-card strong,
.channel-card strong,
.task-card strong {
  color: #111827;
  font-size: 15px;
}

.agent-card p,
.task-card p,
.soft-card p,
.activity-item p,
.channel-card span {
  color: #5f6b7c;
  font-size: 13px;
}

.progress {
  height: 6px;
  background: #e8edf4;
}

.progress span {
  background: linear-gradient(90deg, #2563eb, #22c55e);
}

.tag {
  border: 0;
  background: #eef3fb;
  color: #536176;
  font-size: 11px;
}

.tag.urgent {
  background: #fff1e6;
  color: #c2410c;
}

.chat-panel {
  top: 62px;
  width: var(--chat-width);
  height: calc(100dvh - 62px);
  border-left: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  box-shadow: -18px 0 44px rgba(15, 23, 42, 0.08);
}

.close-chat {
  width: 30px;
  height: 30px;
  background: #111827;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.quick-actions {
  gap: 8px;
  padding: 12px 50px 0 12px;
}

.quick-actions button {
  min-height: 34px;
  border-color: rgba(15, 23, 42, 0.1);
  background: #ffffff;
  font-size: 12px;
}

.agent-console {
  margin: 12px 12px 0;
  border-color: rgba(15, 23, 42, 0.1);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.agent-console-head {
  background: #ffffff;
  padding: 11px 13px;
}

.agent-console-head strong {
  color: #111827;
}

#agentStatus.busy::before {
  background: var(--accent);
}

.message-list {
  gap: 12px;
  padding: 12px;
}

.message {
  border-color: rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.05);
  padding: 12px;
}

.message.user {
  border-color: transparent;
  background: #111827;
  color: #ffffff;
}

.message.agent {
  background: #ffffff;
}

.message-meta {
  font-family: var(--sans);
  font-size: 12px;
}

.message-body {
  font-size: 14px;
  line-height: 1.7;
}

.message-section {
  border-left-color: rgba(37, 99, 235, 0.52);
}

.message.agent .message-section {
  background: #f8fafc;
}

.message-body .message-heading {
  color: #111827;
  font-size: 15px;
}

.composer {
  margin: 12px;
  border-color: rgba(15, 23, 42, 0.12);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

textarea::placeholder {
  color: #8a94a6;
}

.open-inbox {
  background: #111827;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.2);
}

.modal-backdrop,
.drawer-backdrop {
  background: rgba(15, 23, 42, 0.34);
}

.modal,
.document-drawer {
  border-color: rgba(15, 23, 42, 0.1);
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

.modal-close,
.drawer-close {
  background: #111827;
  color: #ffffff;
}

.modal-form input,
.modal-form textarea,
.copy-panel {
  border-color: rgba(15, 23, 42, 0.12);
  background: #ffffff;
}

.drawer-head {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 50%),
    #ffffff;
}

.drawer-head span {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.drawer-head h2 {
  font-size: 22px;
  font-weight: 850;
}

.drawer-body {
  background: #fbfcfe;
}

.drawer-report {
  color: #1f2937;
}

.drawer-report .message-heading {
  font-size: 19px;
}

.drawer-report .message-section {
  border-left-color: rgba(37, 99, 235, 0.45);
}

.drawer-actions {
  background: #ffffff;
}

.creation-inline-panel {
  border-color: rgba(37, 99, 235, 0.18);
  background: #ffffff;
}

.creation-live,
.creation-inline-panel .creation-live {
  border-color: rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.09), transparent 58%),
    #f8fafc;
}

.creation-core {
  border-color: rgba(37, 99, 235, 0.18);
  background: #ffffff;
}

.creation-core span,
.creation-core i::after,
.creation-scan span {
  background: #2563eb;
}

.creation-copy strong {
  font-size: 20px;
}

.creation-meter b {
  font-family: var(--sans);
  font-size: 30px;
}

.creation-lane {
  border-color: rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: #ffffff;
}

.creation-lane.active {
  border-color: rgba(37, 99, 235, 0.36);
  background: #f5f8ff;
}

.creation-lane.active b,
.creation-lane.done b {
  background: var(--accent-dark);
}

.creation-stream {
  border-color: rgba(15, 23, 42, 0.12);
  background: #0f172a;
}

.toast {
  background: #ffffff;
}

@media (max-width: 980px) {
  :root {
    --chat-width: 100vw;
    --side-width: 100%;
  }

  .topbar {
    min-height: auto;
    padding: 10px 14px;
  }

  .side-nav {
    top: 0;
    background: rgba(255, 255, 255, 0.92);
  }

  .dashboard {
    padding: 14px;
  }

  .hero-panel h1 {
    font-size: 30px;
  }

  .deliverable-panel .doc-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-panel {
    top: auto;
    height: min(72vh, 560px);
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
  }

  .top-actions {
    gap: 8px;
  }

  .top-actions > .bevel {
    min-height: 34px;
    padding: 7px 10px;
  }

  .deliverable-panel .doc-list {
    grid-template-columns: 1fr;
  }

  .doc-button,
  .deliverable-panel .doc-button {
    min-height: 144px;
    padding: 14px;
  }

  .doc-button::after {
    left: 72px;
  }

  h2 {
    font-size: 17px;
  }
}

/* NuPhy Sage inspired product skin */
:root {
  --brand-50: #edfbf7;
  --brand-100: #d4f5ec;
  --brand-200: #a8eedd;
  --brand-300: #6de0c8;
  --brand-400: #3dd4b5;
  --brand-500: #1bc4a2;
  --brand-600: #15a88c;
  --brand-700: #118770;
  --ink-900: #111827;
  --ink-800: #1f2937;
  --ink-700: #374151;
  --ink-600: #4b5563;
  --ink-500: #6b7280;
  --ink-400: #9ca3af;
  --ink-300: #d1d5db;
  --ink-200: #e5e7eb;
  --ink-100: #f3f4f6;
  --ink-50: #f9fafb;
  --bg: #f7fbfa;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --ink: var(--ink-900);
  --muted: var(--ink-500);
  --line: var(--ink-200);
  --line-strong: var(--ink-300);
  --accent: var(--brand-500);
  --accent-dark: var(--brand-600);
  --accent-soft: var(--brand-50);
  --good: var(--brand-600);
  --bad: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --shadow: 0 24px 56px rgba(17, 24, 39, 0.12);
  --shadow-soft: 0 2px 8px rgba(17, 24, 39, 0.06);
  --shadow-hover: 0 8px 24px rgba(17, 24, 39, 0.08);
  --shadow-brand: 0 4px 14px rgba(27, 196, 162, 0.35);
  --radius: 8px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --sans: "Inter", "PingFang SC", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  --serif: var(--sans);
  --mono: "SFMono-Regular", "Menlo", "Consolas", "Microsoft YaHei", monospace;
  --chat-width: 420px;
  --side-width: 260px;
  --gap: 16px;
}

html,
body {
  background: var(--bg);
}

body {
  color: var(--ink-800);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
.brand,
.login-copy h1,
.login-card h2,
.hero-panel h1,
.drawer-head h2,
.drawer-report .message-heading {
  color: var(--ink-900);
  font-family: var(--sans);
  letter-spacing: 0;
}

.brand {
  display: grid;
  grid-template-columns: 32px minmax(0, auto);
  gap: 10px;
  align-items: center;
  color: var(--ink-900);
  font-size: 17px;
  font-weight: 760;
  line-height: 1.2;
}

.brand::before {
  content: "";
  grid-row: 1 / span 2;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--brand-500);
  box-shadow: var(--shadow-brand);
}

.brand::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 0;
  background: #ffffff;
  clip-path: polygon(50% 0, 62% 36%, 100% 50%, 62% 64%, 50% 100%, 38% 64%, 0 50%, 38% 36%);
  transform: translateY(-50%);
}

.topbar .brand::after {
  left: 9px;
}

.login-nav .brand::after {
  left: 9px;
}

.brand small {
  color: var(--ink-500);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
}

.lockup {
  font-size: 18px;
}

.login-view {
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 10% 20%, rgba(27, 196, 162, 0.08), transparent 26rem),
    linear-gradient(90deg, rgba(17, 24, 39, 0.06) 1px, transparent 1px);
  background-size: auto, 1px 100%;
  background-position: center, 50% 0;
}

.login-nav,
.topbar {
  border-bottom: 1px solid var(--ink-200);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
  backdrop-filter: blur(16px);
}

.login-nav {
  min-height: 72px;
  padding: 20px 48px;
}

.login-main {
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 430px);
  gap: 72px;
  align-items: center;
  width: min(1200px, calc(100vw - 96px));
  min-height: calc(100vh - 72px);
  padding: 56px 0;
}

.login-copy {
  max-width: 680px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0 0 20px;
  border: 1px solid var(--brand-200);
  border-radius: 999px;
  background: rgba(237, 251, 247, 0.72);
  color: var(--brand-700);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 760;
  line-height: 1;
  padding: 8px 12px;
  text-transform: none;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-500);
}

.login-copy h1 {
  max-width: 760px;
  margin-bottom: 18px;
  color: var(--ink-900);
  font-size: clamp(42px, 5.6vw, 68px);
  font-weight: 780;
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.login-copy p:not(.eyebrow) {
  max-width: 560px;
  color: var(--ink-600);
  font-size: 16px;
  line-height: 1.8;
}

.login-proof {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 36px;
}

.proof-row {
  min-height: 116px;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
  padding: 18px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.proof-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.proof-row span,
.proof-row small {
  color: var(--ink-500);
  font-size: 12px;
}

.proof-row strong {
  margin: 10px 0 4px;
  color: var(--ink-900);
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 780;
}

.login-card {
  border: 1px solid var(--ink-200);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: 0 32px 80px rgba(17, 24, 39, 0.12);
  padding: 30px;
}

.login-card h2 {
  font-size: 28px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.auth-tabs {
  gap: 4px;
  border-color: var(--ink-200);
  border-radius: var(--r-md);
  background: var(--ink-100);
  padding: 4px;
}

.auth-tabs button {
  min-height: 32px;
  border-radius: var(--r-sm);
  color: var(--ink-600);
  font-size: 13px;
}

.auth-tabs button.active {
  background: var(--surface);
  color: var(--brand-700);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
}

.login-card label {
  color: var(--ink-700);
  font-size: 13px;
}

.login-card input,
.modal-form input,
.modal-form textarea,
.input,
.select,
.textarea {
  border-color: var(--ink-200);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink-800);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.login-card input:focus,
.modal-form input:focus,
.modal-form textarea:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 4px var(--brand-50);
}

.topbar {
  min-height: 64px;
  padding: 14px 24px;
}

.top-actions {
  gap: 10px;
}

.bevel,
.god-mode,
.task-actions button,
.quick-actions button {
  min-height: 38px;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: none;
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 720;
  padding: 9px 14px;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 180ms ease, transform 140ms ease;
}

.bevel:hover,
.task-actions button:hover,
.quick-actions button:hover {
  border-color: var(--brand-300);
  background: var(--brand-50);
  color: var(--brand-700);
  box-shadow: none;
}

.bevel:active,
.god-mode:active,
.task-actions button:active,
.quick-actions button:active {
  transform: translateY(0);
}

.god-mode,
#sendButton,
#authSubmit,
#runCycleButton,
.task-actions button:first-child {
  border-color: transparent;
  background: var(--brand-500);
  color: #ffffff;
  box-shadow: var(--shadow-brand);
}

.god-mode:hover,
#sendButton:hover,
#authSubmit:hover,
#runCycleButton:hover,
.task-actions button:first-child:hover {
  background: var(--brand-600);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(27, 196, 162, 0.4);
}

.text-button {
  color: var(--brand-700);
  font-size: 13px;
  font-weight: 720;
}

.menu-popover {
  top: calc(100% + 8px);
  right: 24px;
  width: 250px;
  border-color: var(--ink-200);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.menu-popover button {
  min-height: 40px;
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 620;
}

.menu-popover button:hover {
  background: var(--ink-100);
  color: var(--ink-900);
}

.app-shell {
  grid-template-columns: var(--side-width) minmax(0, 1fr);
  min-height: calc(100vh - 64px);
  background: var(--bg);
}

.side-nav {
  top: 64px;
  min-height: calc(100vh - 64px);
  border-right: 1px solid var(--ink-200);
  background: #ffffff;
  padding: 24px 20px;
}

.side-nav button {
  display: flex;
  align-items: center;
  min-height: 40px;
  border-radius: var(--r-md);
  color: var(--ink-600);
  font-size: 14px;
  font-weight: 560;
  margin-bottom: 3px;
  padding: 10px 12px;
  transition: background 140ms ease, color 140ms ease;
}

.side-nav button:hover {
  background: var(--ink-100);
  color: var(--ink-800);
  box-shadow: none;
}

.side-nav button.active {
  position: relative;
  background: var(--brand-50);
  color: var(--brand-700);
  font-weight: 760;
  box-shadow: none;
}

.side-nav button.active::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--brand-500);
}

.dashboard {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px;
  padding: 32px 40px;
}

.dashboard[data-view="tasks"] {
  grid-template-columns: minmax(min(100%, 360px), 1.2fr) minmax(min(100%, 300px), 0.8fr);
}

.hero-panel,
.panel,
.metric-card {
  border: 1px solid var(--ink-200);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.hero-panel {
  padding: 24px;
  background: var(--surface);
}

.hero-panel h1 {
  margin-bottom: 6px;
  font-size: 28px;
  font-weight: 780;
  line-height: 1.16;
  letter-spacing: -0.02em;
}

.hero-panel p:not(.eyebrow) {
  max-width: 720px;
  color: var(--ink-600);
  font-size: 14px;
}

.panel {
  padding: 20px;
}

.section-head {
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--ink-200);
  padding-bottom: 14px;
}

h2 {
  color: var(--ink-900);
  font-size: 18px;
  font-weight: 760;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.meta,
.task-meta,
.activity-item span {
  color: var(--ink-500);
  font-family: var(--sans);
  font-size: 12px;
}

.agent-card,
.task-card,
.channel-card,
.soft-card,
.activity-item,
.modal-item {
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: none;
  padding: 14px;
}

.task-card,
.agent-card,
.channel-card {
  transition: background 140ms ease, border-color 140ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.task-card:hover,
.agent-card:hover,
.channel-card:hover {
  border-color: var(--brand-200);
  background: #ffffff;
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.agent-card strong,
.channel-card strong,
.task-card strong {
  color: var(--ink-900);
  font-size: 15px;
  font-weight: 720;
}

.agent-card p,
.task-card p,
.soft-card p,
.activity-item p,
.channel-card span {
  color: var(--ink-600);
  font-size: 13px;
}

.progress {
  height: 6px;
  background: var(--ink-100);
}

.progress span {
  background: var(--brand-500);
}

.tag {
  min-height: 24px;
  border: 1px solid var(--ink-200);
  border-radius: 999px;
  background: var(--ink-100);
  color: var(--ink-600);
  font-size: 12px;
  font-weight: 660;
}

.tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.tag.urgent {
  border-color: var(--brand-200);
  background: var(--brand-50);
  color: var(--brand-700);
}

.deliverable-panel {
  grid-column: 1 / -1;
  background: var(--surface);
}

.deliverable-panel .doc-list {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.doc-button,
.deliverable-panel .doc-button {
  min-height: 150px;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.doc-button::before {
  height: 0;
}

.doc-button:hover {
  border-color: var(--brand-200);
  background: #ffffff;
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.doc-icon,
.deliverable-panel .doc-button .doc-icon {
  width: 46px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
  color: var(--brand-700);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.1;
  word-break: keep-all;
}

.doc-button[data-tone="report"] .doc-icon,
.doc-button[data-tone="asset"] .doc-icon {
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
  color: var(--brand-700);
}

.doc-button[data-tone="leads"] .doc-icon {
  background: linear-gradient(135deg, #e6f8f1, #cff0e2);
  color: #14804a;
}

.doc-button[data-tone="proposal"] .doc-icon {
  background: linear-gradient(135deg, #fef3e2, #fde3be);
  color: #b45309;
}

.doc-button[data-tone="plan"] .doc-icon {
  background: linear-gradient(135deg, #e6f0fe, #cfdffd);
  color: #2563eb;
}

.doc-type {
  border: 1px solid var(--brand-200);
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
}

.doc-content strong,
.deliverable-panel .doc-button > span:nth-child(2) {
  color: var(--ink-900);
  font-size: 15px;
  font-weight: 760;
  line-height: 1.36;
}

.doc-content small {
  color: var(--ink-600);
  font-size: 13px;
}

.doc-meta {
  right: 18px;
  bottom: 16px;
  color: var(--ink-500);
  font-size: 12px;
}

.doc-button::after {
  left: 76px;
  bottom: 16px;
  color: var(--brand-700);
  font-size: 12px;
  font-weight: 760;
}

.activity-item {
  grid-template-columns: 76px minmax(0, 1fr);
}

.chat-panel {
  top: 64px;
  height: calc(100dvh - 64px);
  border-left: 1px solid var(--ink-200);
  background: var(--surface);
  box-shadow: -16px 0 40px rgba(17, 24, 39, 0.08);
}

.surprise-chip {
  top: 12px;
  right: 12px;
}

.close-chat {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--ink-100);
  color: var(--ink-600);
  box-shadow: none;
  font-size: 18px;
}

.close-chat:hover {
  background: var(--brand-50);
  color: var(--brand-700);
}

.quick-actions {
  gap: 8px;
  padding: 14px 54px 0 14px;
}

.quick-actions button {
  min-height: 34px;
  border-color: var(--ink-200);
  background: var(--surface);
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 660;
}

.agent-console {
  margin: 14px 14px 0;
  border-color: var(--ink-200);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.agent-console-head {
  border-bottom-color: var(--ink-200);
  background: var(--surface);
  padding: 13px 14px;
}

.agent-console-head strong {
  color: var(--ink-900);
  font-size: 15px;
  font-weight: 760;
}

.agent-status,
#agentStatus {
  color: var(--ink-500);
  font-size: 12px;
}

#agentStatus.busy::before {
  background: var(--brand-500);
}

.message-list {
  gap: 12px;
  padding: 14px;
  background: var(--ink-50);
}

.message {
  border-color: var(--ink-200);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
  padding: 13px 14px;
}

.message.user {
  border-color: transparent;
  background: var(--brand-500);
  color: #ffffff;
  box-shadow: var(--shadow-brand);
}

.message.agent {
  background: var(--surface);
}

.message-meta {
  color: inherit;
  font-family: var(--sans);
  font-size: 12px;
  opacity: 0.68;
}

.message-body {
  font-size: 14px;
  line-height: 1.72;
}

.message-section {
  border-left-color: var(--brand-300);
}

.message.agent .message-section {
  background: var(--ink-50);
}

.message-body .message-heading {
  color: var(--ink-900);
  font-size: 15px;
  font-weight: 760;
}

.message.pending::after,
.drawer-loading span {
  border-color: rgba(27, 196, 162, 0.22);
  border-top-color: var(--brand-600);
}

.composer {
  margin: 14px;
  border-color: var(--ink-200);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 8px;
}

.attach {
  color: var(--brand-700);
}

textarea {
  color: var(--ink-800);
  font-size: 14px;
}

textarea::placeholder {
  color: var(--ink-400);
}

.open-inbox {
  background: var(--brand-500);
  box-shadow: var(--shadow-brand);
}

.open-inbox::after {
  background: #ffffff;
}

.modal-backdrop,
.drawer-backdrop {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}

.modal,
.document-drawer {
  border-color: var(--ink-200);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-close,
.drawer-close {
  border-radius: var(--r-sm);
  background: var(--ink-100);
  color: var(--ink-600);
}

.modal-close:hover,
.drawer-close:hover {
  background: var(--brand-50);
  color: var(--brand-700);
}

.drawer-head {
  border-bottom-color: var(--ink-200);
  background: var(--surface);
}

.drawer-head span {
  border: 1px solid var(--brand-200);
  background: var(--brand-50);
  color: var(--brand-700);
}

.drawer-head h2 {
  font-size: 22px;
  font-weight: 760;
}

.drawer-head p {
  color: var(--ink-500);
}

.drawer-body {
  background: var(--ink-50);
}

.drawer-report {
  color: var(--ink-800);
}

.drawer-report .message-heading {
  color: var(--ink-900);
  font-size: 19px;
  font-weight: 760;
}

.drawer-report .message-section {
  border-left-color: var(--brand-300);
}

.drawer-actions {
  border-top-color: var(--ink-200);
  background: var(--surface);
}

.creation-inline-panel {
  border-color: var(--brand-200);
  background: var(--surface);
}

.creation-live,
.creation-inline-panel .creation-live {
  border-color: var(--ink-200);
  border-radius: var(--r-lg);
  background:
    linear-gradient(135deg, rgba(27, 196, 162, 0.1), transparent 58%),
    var(--surface);
}

.creation-core {
  border-color: var(--brand-200);
  background: var(--brand-50);
}

.creation-core span,
.creation-core i::after,
.creation-scan span {
  background: var(--brand-500);
}

.creation-copy strong {
  font-size: 20px;
  font-weight: 760;
}

.creation-meter b {
  color: var(--ink-900);
  font-family: var(--sans);
  font-size: 30px;
  font-weight: 760;
}

.creation-lane {
  border-color: var(--ink-200);
  border-radius: var(--r-md);
  background: var(--surface);
}

.creation-lane.active {
  border-color: var(--brand-300);
  background: var(--brand-50);
}

.creation-lane.active b,
.creation-lane.done b {
  background: var(--brand-500);
}

.creation-stream {
  border-color: #172133;
  border-radius: var(--r-lg);
  background: #0f172a;
}

.toast {
  border-color: var(--ink-200);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-hover);
}

@media (max-width: 1320px) {
  .dashboard {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  }
}

@media (max-width: 980px) {
  :root {
    --chat-width: 100vw;
    --side-width: 100%;
  }

  .login-nav {
    padding: 16px 22px;
  }

  .login-main {
    grid-template-columns: 1fr;
    width: min(760px, calc(100vw - 36px));
    min-height: auto;
    gap: 28px;
    padding: 36px 0;
  }

  .login-copy h1 {
    font-size: 42px;
  }

  .login-proof {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topbar {
    min-height: auto;
    padding: 12px 14px;
  }

  .app-shell {
    display: block;
    padding-right: 0;
  }

  .side-nav {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    min-height: 0;
    gap: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--ink-200);
    padding: 10px 14px;
  }

  .side-nav button {
    flex: 0 0 auto;
    width: auto;
    margin-bottom: 0;
    white-space: nowrap;
  }

  .side-nav button.active::before {
    display: none;
  }

  .dashboard,
  .dashboard[data-view="tasks"] {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .deliverable-panel .doc-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-panel {
    top: auto;
    height: min(72vh, 580px);
    border-top: 1px solid var(--ink-200);
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .login-main {
    width: calc(100vw - 28px);
  }

  .login-copy h1 {
    font-size: 34px;
  }

  .login-proof {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 22px;
  }

  .top-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard,
  .dashboard[data-view="tasks"] {
    padding: 14px;
  }

  .hero-panel,
  .panel {
    padding: 16px;
  }

  .deliverable-panel .doc-list {
    grid-template-columns: 1fr;
  }

  .doc-button,
  .deliverable-panel .doc-button {
    min-height: 142px;
    padding: 16px;
  }

  .doc-button::after {
    left: 74px;
  }
}

/* Single-panel chat refinement */
.chat-panel {
  padding: 14px;
  background: var(--bg);
}

.quick-actions,
.surprise-chip,
.chat-spacer {
  display: none !important;
}

.agent-console {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.agent-console-head {
  flex: 0 0 auto;
  min-height: 64px;
  padding: 14px 14px 12px;
}

.agent-console-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.agent-console-actions .text-button {
  min-height: 32px;
  border-radius: var(--r-sm);
  padding: 0 8px;
}

.agent-console-actions .text-button:hover {
  background: var(--brand-50);
}

.close-chat {
  position: static;
  flex: 0 0 auto;
}

.message-list {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px;
}

.composer {
  flex: 0 0 auto;
  grid-template-columns: 34px minmax(0, 1fr) 72px;
  gap: 10px;
  align-items: center;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--ink-200);
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
  padding: 10px 12px;
}

.chat-panel.is-busy .composer {
  border-color: var(--ink-200);
}

.attach {
  min-height: 36px;
  border-radius: var(--r-sm);
}

.attach:hover {
  background: var(--brand-50);
}

#sendButton {
  min-height: 36px;
}

@media (max-width: 980px) {
  .chat-panel {
    padding: 10px;
  }

  .agent-console {
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
}

@media (max-width: 560px) {
  .composer {
    grid-template-columns: 30px minmax(0, 1fr) 66px;
    padding: 9px 10px;
  }
}

/* Compact icon sidebar */
@media (min-width: 981px) {
  :root {
    --side-width: 132px;
  }

  .side-nav {
    padding: 18px 10px;
  }

  .side-nav button {
    gap: 8px;
    min-height: 38px;
    padding: 9px 10px;
    font-size: 13px;
  }

  .side-nav button.active::before {
    left: -10px;
    top: 9px;
    bottom: 9px;
  }

  .side-nav button::after {
    content: "";
    order: -1;
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    background: currentColor;
    opacity: 0.82;
    -webkit-mask: var(--side-icon) center / 17px 17px no-repeat;
    mask: var(--side-icon) center / 17px 17px no-repeat;
  }

  .side-nav button[data-view="today"] {
    --side-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 2a1 1 0 0 1 1 1v1h8V3a1 1 0 1 1 2 0v1h1a3 3 0 0 1 3 3v11a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h1V3a1 1 0 0 1 1-1Zm13 8H4v8a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-8ZM5 6a1 1 0 0 0-1 1v1h16V7a1 1 0 0 0-1-1H5Zm10.7 6.3a1 1 0 0 1 0 1.4l-3.4 3.4a1 1 0 0 1-1.4 0l-1.8-1.8a1 1 0 1 1 1.4-1.4l1.1 1.1l2.7-2.7a1 1 0 0 1 1.4 0Z'/%3E%3C/svg%3E");
  }

  .side-nav button[data-view="agents"] {
    --side-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M11 2a1 1 0 1 1 2 0v2h2a5 5 0 0 1 5 5v6a5 5 0 0 1-5 5H9a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5h2V2Zm-2 4a3 3 0 0 0-3 3v6a3 3 0 0 0 3 3h6a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3H9Zm.5 5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3Zm5 0a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3Zm-5.2 3.3a1 1 0 0 1 1.4 0A1.8 1.8 0 0 0 12 15a1.8 1.8 0 0 0 1.3-.7a1 1 0 1 1 1.4 1.4A3.7 3.7 0 0 1 12 17a3.7 3.7 0 0 1-2.7-1.3a1 1 0 0 1 0-1.4Z'/%3E%3C/svg%3E");
  }

  .side-nav button[data-view="tasks"] {
    --side-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Zm0 2v14h14V5H5Zm11.7 4.3a1 1 0 0 1 0 1.4l-5.1 5.1a1 1 0 0 1-1.4 0l-2.4-2.4a1 1 0 0 1 1.4-1.4l1.7 1.7l4.4-4.4a1 1 0 0 1 1.4 0Z'/%3E%3C/svg%3E");
  }

  .side-nav button[data-view="channels"] {
    --side-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a10 10 0 1 1 0 20a10 10 0 0 1 0-20Zm0 2a8 8 0 1 0 0 16a8 8 0 0 0 0-16Zm0 3a5 5 0 1 1 0 10a5 5 0 0 1 0-10Zm0 2a3 3 0 1 0 0 6a3 3 0 0 0 0-6Zm0 1.5a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3Z'/%3E%3C/svg%3E");
  }

  .side-nav button[data-view="records"] {
    --side-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 3h10.2a2 2 0 0 1 1.4.6l2.8 2.8A2 2 0 0 1 21 7.8V19a2 2 0 0 1-2 2H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3Zm0 2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h13V8h-3a1 1 0 0 1-1-1V5H6Zm11 1.4V6h-.4l.4.4ZM8 10h8a1 1 0 1 1 0 2H8a1 1 0 1 1 0-2Zm0 4h6a1 1 0 1 1 0 2H8a1 1 0 1 1 0-2Z'/%3E%3C/svg%3E");
  }
}

/* Task view should use the full workspace, not leave an empty second column */
.dashboard[data-view="tasks"] {
  grid-template-columns: minmax(0, 1fr);
}

.dashboard[data-view="tasks"] #tasks {
  grid-column: 1 / -1;
}

.dashboard[data-view="tasks"] #tasks .task-list {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: start;
}

.dashboard[data-view="tasks"] #tasks .task-card {
  min-height: 0;
}

@media (max-width: 760px) {
  .dashboard[data-view="tasks"] #tasks .task-list {
    grid-template-columns: 1fr;
  }
}

/* Tighten workspace gutters and slim the assistant panel */
@media (min-width: 981px) {
  .dashboard {
    padding: 18px 14px;
  }

  .dashboard[data-view="tasks"] {
    padding: 18px 14px;
  }
}

.chat-panel {
  padding: 8px 10px 8px 6px;
  border-left: 0;
  background: transparent;
  box-shadow: none;
}

.agent-console {
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.06);
}

.agent-console-head {
  min-height: 48px;
  padding: 10px 10px 9px 12px;
}

.agent-console-head strong {
  font-size: 15px;
  line-height: 1.15;
}

#agentStatus {
  margin-top: 2px;
  font-size: 11px;
}

#agentStatus.ready:empty {
  display: none;
}

.agent-console-actions {
  gap: 6px;
}

.agent-console-actions .text-button,
.close-chat {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-radius: 8px;
  padding: 0;
}

.clear-chat::before {
  content: "";
  width: 15px;
  height: 15px;
  background: currentColor;
  opacity: 0.9;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 21a2 2 0 0 1-2-2V8H4a1 1 0 1 1 0-2h4V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2h4a1 1 0 1 1 0 2h-1v11a2 2 0 0 1-2 2H7Zm3-17v2h4V4h-4ZM7 8v11h10V8H7Zm3 2a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Zm4 0a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Z'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 21a2 2 0 0 1-2-2V8H4a1 1 0 1 1 0-2h4V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2h4a1 1 0 1 1 0 2h-1v11a2 2 0 0 1-2 2H7Zm3-17v2h4V4h-4ZM7 8v11h10V8H7Zm3 2a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Zm4 0a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Z'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
}

.message-list {
  padding: 12px;
}

.composer {
  grid-template-columns: 30px minmax(0, 1fr) 66px;
  gap: 8px;
  padding: 7px 10px;
}

.attach {
  min-height: 30px;
  font-size: 20px;
}

textarea {
  min-height: 30px;
  max-height: 82px;
}

#sendButton {
  min-height: 32px;
  padding: 7px 12px;
}

@media (max-width: 980px) {
  .chat-panel {
    padding: 8px;
  }
}

/* Decision center consolidation */
.topbar .brand small {
  display: none;
}

#reports[data-view-panel="today"],
#tasks[data-view-panel="today"] {
  grid-column: 1 / -1;
}

#tasks[data-view-panel="today"] .task-list {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
}

.deliverable-panel .doc-list {
  grid-template-columns: 1fr;
  gap: 18px;
}

.section-more {
  display: flex;
  grid-column: 1 / -1;
  justify-content: center;
  padding-top: 2px;
}

.section-more button {
  min-height: 32px;
  border: 1px solid var(--ink-200);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink-700);
  cursor: pointer;
  font-size: 13px;
  font-weight: 720;
  padding: 7px 16px;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.section-more button:hover {
  border-color: var(--brand-200);
  background: var(--brand-50);
  color: var(--brand-700);
  transform: translateY(-1px);
}

.doc-category {
  display: grid;
  gap: 10px;
}

.doc-category + .doc-category {
  border-top: 1px solid var(--ink-200);
  padding-top: 16px;
}

.doc-category-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.doc-category-head div {
  display: grid;
  gap: 3px;
}

.doc-category-head strong {
  color: var(--ink-900);
  font-size: 15px;
  font-weight: 780;
  line-height: 1.2;
}

.doc-category-head span {
  color: var(--ink-500);
  font-size: 12px;
  line-height: 1.35;
}

.doc-category-head em {
  min-width: max-content;
  border: 1px solid var(--brand-200);
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  padding: 6px 9px;
}

.doc-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.deliverable-panel .doc-category-grid .doc-button {
  min-height: 132px;
  grid-template-columns: 42px minmax(0, 1fr);
  padding: 14px;
}

.deliverable-panel .doc-category-grid .doc-icon {
  width: 40px;
  height: 38px;
  border-radius: 9px;
}

.deliverable-panel .doc-category-grid .doc-meta {
  right: 14px;
  bottom: 12px;
}

.deliverable-panel .doc-category-grid .doc-button::after {
  left: 68px;
  bottom: 12px;
}

@media (min-width: 981px) {
  .topbar {
    min-height: 52px;
    padding: 8px 18px;
  }

  .topbar .brand {
    grid-template-columns: 28px minmax(0, auto);
    gap: 9px;
    min-height: 32px;
    font-size: 15px;
  }

  .topbar .brand::before {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  .topbar .brand::after {
    left: 8px;
    width: 12px;
    height: 12px;
  }

  .top-actions {
    gap: 8px;
  }

  .top-actions .bevel {
    min-height: 32px;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 12px;
  }

  .app-shell {
    min-height: calc(100vh - 52px);
  }

  .side-nav {
    top: 52px;
    min-height: calc(100vh - 52px);
    padding: 14px 8px;
  }

  .chat-panel {
    top: 52px;
    height: calc(100dvh - 52px);
  }

  .side-nav button[data-view="today"] {
    --side-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm0 2v12h14V6H5Zm10.7 3.3a1 1 0 0 1 0 1.4l-4.1 4.1a1 1 0 0 1-1.4 0l-1.9-1.9a1 1 0 0 1 1.4-1.4l1.2 1.2l3.4-3.4a1 1 0 0 1 1.4 0Z'/%3E%3C/svg%3E");
  }

  .side-nav button[data-view="agents"] {
    --side-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M8 11a4 4 0 1 1 0-8a4 4 0 0 1 0 8Zm0-2a2 2 0 1 0 0-4a2 2 0 0 0 0 4Zm8-1a3 3 0 1 1 0-6a3 3 0 0 1 0 6Zm0-2a1 1 0 1 0 0-2a1 1 0 0 0 0 2ZM4.5 13h7A3.5 3.5 0 0 1 15 16.5V19a1 1 0 0 1-2 0v-2.5a1.5 1.5 0 0 0-1.5-1.5h-7A1.5 1.5 0 0 0 3 16.5V19a1 1 0 1 1-2 0v-2.5A3.5 3.5 0 0 1 4.5 13Zm12.5-2h2.5A3.5 3.5 0 0 1 23 14.5V17a1 1 0 1 1-2 0v-2.5a1.5 1.5 0 0 0-1.5-1.5H17a1 1 0 1 1 0-2Z'/%3E%3C/svg%3E");
  }
}

/* Strengthen decision-center hierarchy */
#reports,
#tasks {
  overflow: hidden;
  border-color: #d8e1ea;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
  padding: 0;
}

#reports .section-head,
#tasks .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  border-bottom: 1px solid #d9e2ec;
  background:
    linear-gradient(90deg, rgba(27, 196, 162, 0.11), rgba(255, 255, 255, 0) 38%),
    #f8fbfa;
  padding: 14px 18px;
}

#tasks .section-head {
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.09), rgba(255, 255, 255, 0) 38%),
    #f8fafc;
}

#reports .section-head::before,
#tasks .section-head::before {
  content: "";
  flex: 0 0 auto;
  width: 4px;
  height: 24px;
  border-radius: 999px;
  background: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(27, 196, 162, 0.11);
}

#tasks .section-head::before {
  background: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

#reports .section-head h2,
#tasks .section-head h2 {
  flex: 1 1 auto;
  color: var(--ink-900);
  font-size: 18px;
  font-weight: 840;
}

#reports .section-head .meta,
#tasks .section-head .meta {
  flex: 0 0 auto;
  border: 1px solid var(--ink-200);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink-600);
  font-size: 12px;
  font-weight: 660;
  line-height: 1;
  padding: 7px 10px;
}

#reports .doc-list,
#tasks .task-list {
  padding: 16px 18px 18px;
}

#reports .doc-list {
  gap: 14px;
}

#tasks .task-list {
  gap: 12px;
}

#reports .doc-category {
  border: 1px solid #dce6ee;
  border-radius: 12px;
  background: #fbfefd;
  padding: 12px;
}

#reports .doc-category + .doc-category {
  border-top: 1px solid #dce6ee;
  padding-top: 12px;
}

#reports .doc-category-head {
  align-items: center;
  border-radius: 9px;
  background: #f2f8f6;
  padding: 9px 10px;
}

#reports .doc-category-head strong {
  font-size: 15px;
  font-weight: 820;
}

#reports .doc-category-head span {
  color: var(--ink-600);
  font-size: 12px;
}

#reports .doc-category-head em {
  border-color: rgba(27, 196, 162, 0.32);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

#reports .doc-category-grid {
  gap: 10px;
}

#reports .doc-button,
#tasks .task-card {
  position: relative;
  overflow: hidden;
  border-color: #d7e1ea;
  background: #ffffff;
  box-shadow: 0 7px 18px rgba(17, 24, 39, 0.07);
}

#reports .doc-button::before,
#tasks .task-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  height: auto;
  background: var(--brand-500);
}

#tasks .task-card::before {
  background: #2563eb;
}

#reports .doc-button:hover,
#tasks .task-card:hover {
  border-color: var(--brand-300);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.11);
}

#reports .doc-content strong,
#tasks .task-card strong {
  color: #0f172a;
  font-size: 16px;
  font-weight: 820;
  line-height: 1.35;
}

#reports .doc-content small,
#tasks .task-card p {
  color: var(--ink-600);
  font-size: 13px;
  line-height: 1.58;
}

#tasks .task-card {
  padding-left: 18px;
}

#tasks .task-meta {
  border-top: 1px dashed var(--ink-200);
  margin-top: 10px;
  padding-top: 8px;
}

#reports .section-more,
#tasks .section-more {
  padding-top: 0;
}

@media (max-width: 720px) {
  #reports .section-head,
  #tasks .section-head {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 13px 14px;
  }

  #reports .section-head h2,
  #tasks .section-head h2 {
    flex-basis: calc(100% - 24px);
  }

  #reports .doc-list,
  #tasks .task-list {
    padding: 14px;
  }
}

/* Keep report-card footer actions separate from summary text */
#reports .doc-button,
#reports .deliverable-panel .doc-button,
#reports .doc-category-grid .doc-button {
  min-height: 150px;
  padding: 14px 16px 42px 18px;
}

#reports .doc-content {
  gap: 6px;
  min-width: 0;
}

#reports .doc-content small {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#reports .doc-button::after {
  left: 68px;
  bottom: 14px;
  z-index: 2;
  border-radius: 999px;
  background: #ffffff;
  padding-right: 8px;
}

#reports .doc-meta {
  right: 16px;
  bottom: 14px;
  z-index: 2;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink-500);
  padding-left: 10px;
}

#reports .doc-icon {
  align-self: start;
}

@media (max-width: 720px) {
  #reports .doc-button,
  #reports .deliverable-panel .doc-button,
  #reports .doc-category-grid .doc-button {
    min-height: 142px;
    padding: 13px 14px 40px 16px;
  }

  #reports .doc-button::after {
    left: 64px;
  }
}

/* Precise vertical alignment for brand lockup and chat composer */
.topbar .brand {
  position: relative;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  line-height: 1;
}

.topbar .brand span {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.topbar .brand::before {
  flex: 0 0 auto;
  grid-row: auto;
}

.composer {
  align-items: center;
}

.composer textarea,
#chatInput {
  display: block;
  height: 36px;
  min-height: 36px;
  line-height: 20px;
  overflow-y: hidden;
  padding: 8px 0;
}

#chatInput::placeholder {
  line-height: 20px;
}

@media (max-width: 560px) {
  .composer textarea,
  #chatInput {
    height: 34px;
    min-height: 34px;
    padding: 7px 0;
  }
}

/* Remove decorative side strips inside cards */
#reports .doc-button::before,
#tasks .task-card::before {
  content: none;
  display: none;
}

#reports .doc-button,
#reports .deliverable-panel .doc-button,
#reports .doc-category-grid .doc-button {
  padding-left: 14px;
}

#tasks .task-card {
  padding-left: 14px;
}

/* Report list mode: reduce nested panels and card fatigue */
#reports .doc-list {
  gap: 2px;
  padding: 12px 18px 16px;
}

#reports .doc-category {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

#reports .doc-category + .doc-category {
  border-top: 1px solid var(--ink-200);
  margin-top: 10px;
  padding-top: 10px;
}

#reports .doc-category-head {
  min-height: 34px;
  border-radius: 0;
  background: transparent;
  padding: 2px 0 8px;
}

#reports .doc-category-head strong {
  font-size: 14px;
  font-weight: 820;
}

#reports .doc-category-head span {
  font-size: 12px;
}

#reports .doc-category-head em {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--brand-700);
  font-size: 12px;
  padding: 0;
}

#reports .doc-category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid #edf2f7;
}

#reports .doc-button,
#reports .deliverable-panel .doc-button,
#reports .doc-category-grid .doc-button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 92px;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  border: 0;
  border-bottom: 1px solid #edf2f7;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 11px 0;
}

#reports .doc-button:hover {
  border-color: #edf2f7;
  background: #f8fbfa;
  box-shadow: none;
  transform: none;
}

#reports .doc-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 11px;
}

#reports .doc-content {
  gap: 4px;
}

#reports .doc-type {
  width: fit-content;
  border-radius: 999px;
  font-size: 11px;
  padding: 3px 7px;
}

#reports .doc-content strong {
  display: block;
  overflow: hidden;
  color: #0f172a;
  font-size: 15px;
  font-weight: 780;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#reports .doc-content small {
  display: block;
  overflow: hidden;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#reports .doc-button::after {
  position: static;
  justify-self: end;
  align-self: end;
  grid-column: 3;
  grid-row: 1;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

#reports .doc-meta {
  position: static;
  justify-self: end;
  align-self: start;
  grid-column: 3;
  grid-row: 1;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

@media (max-width: 720px) {
  #reports .doc-list {
    padding: 10px 14px 14px;
  }

  #reports .doc-button,
  #reports .deliverable-panel .doc-button,
  #reports .doc-category-grid .doc-button {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    min-height: 82px;
    padding: 11px 0;
  }

  #reports .doc-meta {
    display: none;
  }

  #reports .doc-button::after {
    justify-self: start;
    grid-column: 2;
    grid-row: auto;
  }
}

/* Report list cleanup: remove counts, redundant actions, avatars, and double rules */
#reports .doc-category-head {
  min-height: 26px;
  padding: 0 0 6px;
}

#reports .doc-category-head em {
  display: none;
}

#reports .doc-category-grid {
  border-top: 0;
}

#reports .doc-category + .doc-category {
  border-top: 1px solid #e8eef5;
  margin-top: 8px;
  padding-top: 10px;
}

#reports .doc-button,
#reports .deliverable-panel .doc-button,
#reports .doc-category-grid .doc-button {
  grid-template-columns: minmax(0, 1fr);
  min-height: 66px;
  border-bottom: 0;
  padding: 8px 0 10px;
}

#reports .doc-button + .doc-button {
  border-top: 1px solid #eef3f7;
}

#reports .doc-icon,
#reports .doc-meta,
#reports .doc-button::after {
  display: none;
}

#reports .doc-content {
  grid-column: 1;
}

#reports .doc-type {
  margin-bottom: 1px;
}

@media (max-width: 720px) {
  #reports .doc-button,
  #reports .deliverable-panel .doc-button,
  #reports .doc-category-grid .doc-button {
    grid-template-columns: minmax(0, 1fr);
    min-height: 66px;
    padding: 8px 0 10px;
  }
}

/* Task cards: equal rhythm and obvious action feedback */
#tasks[data-view-panel="today"] .task-list,
.dashboard[data-view="tasks"] #tasks .task-list {
  align-items: stretch;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

#tasks .task-card {
  display: flex;
  flex-direction: column;
  min-height: 248px;
  height: 100%;
  border-color: #d8e1ea;
  background: #ffffff;
  padding: 16px;
}

#tasks .task-card[data-state="confirmed"] {
  border-color: rgba(27, 196, 162, 0.46);
  background: linear-gradient(180deg, #ffffff, rgba(237, 251, 247, 0.74));
}

#tasks .task-card[data-state="delegated"] {
  border-color: rgba(37, 99, 235, 0.36);
  background: linear-gradient(180deg, #ffffff, rgba(239, 246, 255, 0.8));
}

#tasks .task-card[data-state="paused"] {
  border-color: #d9e1ea;
  background: #f8fafc;
}

#tasks .task-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

#tasks .task-top strong {
  display: -webkit-box;
  min-height: 44px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#tasks .task-card p {
  display: -webkit-box;
  min-height: 62px;
  margin-top: 12px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

#tasks .task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
}

#tasks .task-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--ink-200);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink-600);
  font-size: 12px;
  font-weight: 760;
  line-height: 1;
  padding: 4px 9px;
  white-space: nowrap;
}

#tasks .task-state[data-state="confirmed"] {
  border-color: rgba(27, 196, 162, 0.34);
  background: var(--brand-50);
  color: var(--brand-700);
}

#tasks .task-state[data-state="delegated"] {
  border-color: rgba(37, 99, 235, 0.24);
  background: #eff6ff;
  color: #1d4ed8;
}

#tasks .task-state[data-state="paused"] {
  border-color: #d7dee8;
  background: #f1f5f9;
  color: #64748b;
}

#tasks .task-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

#tasks .task-actions button,
.modal-item .task-actions button {
  min-height: 40px;
  border-color: #dbe3ec;
  background: #ffffff;
  box-shadow: none;
  color: var(--ink-700);
  font-weight: 760;
}

#tasks .task-actions button:hover,
.modal-item .task-actions button:hover {
  border-color: var(--brand-300);
  background: var(--brand-50);
  box-shadow: none;
}

#tasks .task-actions button.selected,
.modal-item .task-actions button.selected {
  border-color: var(--brand-500);
  background: var(--brand-500);
  box-shadow: 0 10px 22px rgba(27, 196, 162, 0.22);
  color: #ffffff;
}

#tasks .task-actions button.selected[data-task-choice="agent"],
.modal-item .task-actions button.selected[data-task-choice="agent"] {
  border-color: #2563eb;
  background: #2563eb;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.2);
}

#tasks .task-actions button.selected[data-task-choice="pause"],
.modal-item .task-actions button.selected[data-task-choice="pause"] {
  border-color: #64748b;
  background: #64748b;
  box-shadow: 0 10px 20px rgba(100, 116, 139, 0.18);
}

#tasks .task-actions button:disabled,
.modal-item .task-actions button:disabled {
  opacity: 1;
}

@media (max-width: 720px) {
  #tasks[data-view-panel="today"] .task-list,
  .dashboard[data-view="tasks"] #tasks .task-list {
    grid-template-columns: 1fr;
  }

  #tasks .task-card {
    min-height: 230px;
  }
}

/* Compact dashboard hero: remove redundant label space */
.hero-panel {
  min-height: 0;
  padding: 18px 28px;
}

.hero-panel .eyebrow {
  display: none;
}

.hero-panel h1 {
  margin: 0 0 6px;
}

.hero-panel p:not(.eyebrow) {
  line-height: 1.45;
}

.hero-panel .god-mode {
  min-height: 44px;
  padding: 10px 20px;
}

@media (max-width: 720px) {
  .hero-panel {
    gap: 12px;
    padding: 16px;
  }

  .hero-panel .god-mode {
    min-height: 40px;
  }
}
