:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --ink: #152321;
  --muted: #60706d;
  --line: #d8d4cc;
  --primary: #0f4c5c;
  --primary-2: #1b6b65;
  --accent: #b54f2a;
  --surface: #fffdf8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, textarea { font: inherit; }
button { min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; }
.app-shell { width: min(1040px, 100%); margin: 0 auto; padding: 20px; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: start; padding: 14px 0 18px; }
.eyebrow { margin: 0 0 6px; color: var(--primary); font-weight: 700; text-transform: uppercase; font-size: .78rem; }
h1 { margin: 0; font-size: clamp(2rem, 7vw, 4rem); line-height: 1; letter-spacing: 0; }
h2 { margin: 0 0 12px; font-size: 1.3rem; letter-spacing: 0; }
.topbar p:last-child { color: var(--muted); margin: 10px 0 0; font-size: 1.05rem; }
.status-pill { padding: 0 14px; white-space: nowrap; color: var(--primary); font-weight: 700; }
.tabs { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 8px 0; background: var(--bg); }
.tab { min-height: 48px; padding: 0 8px; font-weight: 700; }
.tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.view { display: none; }
.view.active { display: block; }
.card-list { display: grid; gap: 12px; margin-top: 10px; }
.action-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 18px; box-shadow: 0 8px 28px rgba(21,35,33,.06); }
.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.type-label { color: var(--accent); font-weight: 800; font-size: .78rem; text-transform: uppercase; }
.action-card h2 { margin-top: 4px; }
.summary-text { color: var(--muted); font-size: 1.05rem; }
.proposal { border-left: 4px solid var(--primary-2); padding-left: 12px; margin: 14px 0; }
.actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.agree { background: var(--primary); border-color: var(--primary); color: white; }
.reject { border-color: var(--accent); color: var(--accent); }
.why { color: var(--primary); }
.kans-grid { display: grid; gap: 8px; margin: 12px 0; }
.kans-grid div { border-top: 1px solid var(--line); padding-top: 8px; }
.chat-panel, .system-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.chat-log { min-height: 48vh; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 80%; padding: 12px 14px; border-radius: 8px; background: #e8efed; }
.bubble.user { align-self: end; background: var(--primary); color: white; }
.composer { display: grid; grid-template-columns: 52px 1fr 76px; gap: 8px; margin-top: 12px; }
.composer input, textarea { min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: white; }
.login-form { display: grid; gap: 10px; }
.login-form input { min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.login-error { color: var(--accent); min-height: 1.2em; }
.icon-button { font-weight: 800; }
.send-button, .upload-button { background: var(--primary-2); color: white; border-color: var(--primary-2); }
.upload-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; margin-top: 10px; padding: 0 14px; border-radius: 8px; cursor: pointer; }
.upload-button input { display: none; }
.switch-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.switch-row [data-mode="NOODSTOP"] { color: white; background: #8f2f2f; border-color: #8f2f2f; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; color: var(--muted); }
dialog { border: 0; border-radius: 8px; padding: 0; width: min(620px, calc(100% - 24px)); }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog article { padding: 18px; background: var(--surface); }
.close { float: right; min-height: 36px; }
.hidden { display: none; }
.history { margin-top: 12px; color: var(--muted); }
@media (max-width: 680px) {
  .app-shell { padding: 14px; }
  .topbar { display: block; }
  .status-pill { margin-top: 12px; width: 100%; }
  .tabs { grid-template-columns: repeat(2, 1fr); }
  .actions { grid-template-columns: 1fr; }
  .card-head { display: block; }
  .composer { grid-template-columns: 52px 1fr; }
  .send-button { grid-column: 1 / -1; }
  .bubble { max-width: 100%; }
}
