:root {
  color-scheme: light;
  --bg: #f7f5f0;
  --surface: rgba(255,255,255,.78);
  --text: #202124;
  --muted: #6b6b73;
  --line: rgba(32,33,36,.09);
  --purple: #7f37d6;
  --cyan: #00bcd4;
  --shadow: 0 20px 56px rgba(42,43,47,.1);
  --max: 1180px;
}
* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 14% 0%, rgba(123,196,189,.22), transparent 30rem),
    radial-gradient(circle at 92% 12%, rgba(139,92,246,.13), transparent 28rem),
    linear-gradient(180deg, #fafaf7, var(--bg) 54%, #f3f0ea);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
.page { width: min(100% - 40px, var(--max)); margin: 0 auto; }
.site-header {
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(250,250,247,.82);
  backdrop-filter: blur(18px);
}
.nav { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 760; text-decoration: none; }
.brand-mark { display: grid; width: 32px; gap: 5px; }
.brand-mark span { display: block; height: 6px; border-radius: 99px; background: linear-gradient(90deg,#b16cf0,#13bdbd); }
.brand-mark span:nth-child(1){width:30px}.brand-mark span:nth-child(2){width:20px}.brand-mark span:nth-child(3){width:26px}.brand-mark span:nth-child(4){width:12px}
.nav-actions { display: flex; align-items: center; gap: 8px; }
.button, .status-chip {
  display: inline-flex; min-height: 40px; align-items: center; justify-content: center;
  padding: 0 14px; border: 1px solid var(--line); border-radius: 7px;
  background: rgba(255,255,255,.72); color: var(--text); font-size: 14px; text-decoration: none;
}
.button { cursor: pointer; font-weight: 680; }
.button.primary { border-color: transparent; background: linear-gradient(135deg,#7f37d6,#b15fea); color: #fff; }
.button:disabled { opacity: .55; cursor: default; }
.status-chip { gap: 8px; border-radius: 999px; color: var(--muted); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); }
main { padding: 42px 0 76px; }

.hero { margin-bottom: 24px; }
.hero > div {
  padding: 34px; border: 1px solid var(--line); border-radius: 8px;
  background: linear-gradient(135deg,rgba(255,255,255,.9),rgba(238,231,255,.55)); box-shadow: var(--shadow);
}
.eyebrow, .section-kicker { margin: 0 0 10px; color: #6f52bb; font-size: 12px; font-weight: 760; text-transform: uppercase; }
.hero h1 { margin: 0 0 14px; font-size: clamp(32px,5vw,52px); line-height: 1.05; }
.hero p:last-child { max-width: 680px; margin: 0; color: var(--muted); line-height: 1.7; }

.access-denied {
  padding: 34px; border: 1px dashed rgba(32,33,36,.2); border-radius: 8px;
  color: var(--muted); text-align: center; line-height: 1.7;
}
.access-denied strong { display: block; margin-bottom: 8px; color: var(--text); font-size: 18px; }

.assistant-root { display: grid; gap: 20px; }

.assistant-layout { display: grid; grid-template-columns: minmax(0,1fr) 380px; gap: 18px; align-items: start; }
@media (max-width: 860px) { .assistant-layout { grid-template-columns: 1fr; } }

.chat-panel { order: 1; }
.briefing-panel { order: 2; display: grid; align-content: start; gap: 10px; }
@media (min-width: 861px) {
  .chat-panel { order: 0; }
  .briefing-panel { order: 1; }
}

.briefing-panel, .chat-panel, .todo-panel {
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  box-shadow: var(--shadow); padding: 24px;
}
.todo-panel { display: grid; gap: 16px; }

.todo-detail-list { display: grid; gap: 10px; max-height: 480px; overflow-y: auto; }
.todo-detail-empty { color: var(--muted); text-align: center; padding: 16px 0; }
.todo-detail-item {
  border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.6);
}
.todo-detail-item summary {
  cursor: pointer; padding: 10px 12px; font-size: 14px; font-weight: 660;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; list-style: none;
}
.todo-detail-item summary::-webkit-details-marker { display: none; }
.todo-detail-badge {
  flex-shrink: 0; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
  color: var(--muted); background: rgba(32,33,36,.06);
}
.todo-detail-form {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px 20px; align-items: end;
}
.todo-detail-item .todo-detail-form { padding: 0 14px 16px; }
.todo-create-form { border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.todo-detail-span2 { grid-column: span 2; }
.todo-detail-form label {
  display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 680; min-width: 0;
}
.todo-detail-form input, .todo-detail-form select {
  width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px;
  background: rgba(255,255,255,.85); color: var(--text); font-size: 14px;
}
.todo-detail-form .todo-detail-checkbox {
  display: flex; flex-direction: row; align-items: center; gap: 6px;
}
.todo-detail-form .todo-detail-checkbox input { width: auto; padding: 0; }
.todo-detail-status { font-size: 12px; font-weight: 700; color: var(--cyan); }
.todo-detail-status--failed { color: #c0392b; }
h2 { margin: 0; font-size: 22px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }

.briefing-body { color: var(--text); line-height: 1.7; }
.briefing-body p { margin: 0 0 10px; }
.briefing-empty { color: var(--muted); }
.briefing-meta { color: var(--muted); font-size: 12px; }

.chat-log {
  display: flex; flex-direction: column; gap: 14px;
  min-height: 260px; max-height: 480px; overflow-y: auto;
  padding: 4px 2px; margin-bottom: 14px;
}
.chat-empty { color: var(--muted); text-align: center; padding: 24px 0; }
.chat-message { display: grid; gap: 4px; }
.chat-role { font-size: 11px; font-weight: 720; color: var(--muted); }
.chat-message--user .chat-role { text-align: right; }
.chat-bubble {
  padding: 10px 14px; border-radius: 10px; line-height: 1.6; white-space: pre-wrap;
  background: rgba(255,255,255,.7); border: 1px solid var(--line); max-width: 90%;
}
.chat-message--user .chat-bubble {
  margin-left: auto; background: linear-gradient(135deg,rgba(127,55,214,.12),rgba(177,95,234,.14));
  border-color: rgba(127,55,214,.2);
}

.chat-actions { display: grid; gap: 10px; margin-top: 4px; }
.action-card {
  border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px;
  background: rgba(255,255,255,.65); display: grid; gap: 10px;
}
.action-card p { margin: 0; line-height: 1.6; }
.action-card--done { border-color: rgba(0,188,212,.4); background: rgba(0,188,212,.08); }
.action-card--failed { border-color: rgba(214,55,55,.35); background: rgba(214,55,55,.06); }
.action-btn-row { display: flex; gap: 8px; }
.action-status { font-size: 12px; font-weight: 700; color: var(--cyan); }
.action-status--failed { color: #c0392b; }

.chat-compose { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: end; }
.chat-input {
  width: 100%; resize: vertical; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.85);
}
