:root {
  --ink: #11231c;
  --muted: #63746c;
  --line: #d8e4dc;
  --paper: #f4f7f5;
  --surface: #ffffff;
  --green: #087d54;
  --green-strong: #05613f;
  --green-soft: #e8f3ed;
  --blue: #203b55;
  --danger: #bd3b38;
  --shadow: 0 12px 30px rgba(19, 45, 32, 0.07);
}

* { box-sizing: border-box; }
#app[hidden], #login[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea { font: inherit; }
button { border: 0; border-radius: 9px; padding: 11px 15px; background: var(--green); color: #fff; font-weight: 700; cursor: pointer; transition: transform .16s ease, background .16s ease, box-shadow .16s ease; }
button:hover { background: var(--green-strong); box-shadow: 0 5px 14px rgba(8, 125, 84, .18); }
button:active { transform: scale(.98); }
button:disabled { cursor: wait; opacity: .64; box-shadow: none; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 850; letter-spacing: .16em; }
.brand img { width: 29px; height: 29px; object-fit: contain; }

.login { min-height: 100vh; display: grid; grid-template-columns: 1.22fr .78fr; }
.intro { padding: 58px clamp(42px, 7vw, 118px); display: flex; flex-direction: column; position: relative; overflow: hidden; background: linear-gradient(135deg, #f8fbf9, #e5f1e9); }
.intro::after { content: ""; position: absolute; right: -160px; bottom: -210px; width: 470px; height: 470px; border: 1px solid #bcd9c7; border-radius: 50%; }
.intro > p, .login small, header small, .session-rail small { margin: 42px 0 18px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.intro h1 { max-width: 610px; margin: 0 0 24px; font-size: clamp(50px, 6.2vw, 88px); line-height: .94; letter-spacing: -.075em; }
.intro em { color: var(--green); font-style: normal; }
.intro > span { max-width: 505px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.intro-points { display: flex; flex-wrap: wrap; gap: 9px; margin-top: auto; position: relative; z-index: 1; }
.intro-points span { padding: 8px 11px; border: 1px solid #bfd8c7; border-radius: 100px; background: #ffffffaa; color: #335848; font-size: 12px; font-weight: 700; }
.login form { align-self: center; width: min(430px, calc(100% - 54px)); margin: auto; padding: 40px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.login h2 { margin: 14px 0 8px; font-size: 34px; letter-spacing: -.055em; }
.login form p { margin: 0 0 27px; color: var(--muted); }
.login label, .form-card label { display: block; margin: 16px 0; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.login input, .content input, .content textarea { width: 100%; margin-top: 7px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; outline: none; background: #fbfdfb; color: var(--ink); }
.login input:focus, .content input:focus, .content textarea:focus { border-color: #71af8b; box-shadow: 0 0 0 3px #dff0e6; }
.login button { display: flex; justify-content: space-between; width: 100%; margin-top: 12px; }
.login b { display: block; margin-top: 12px; color: var(--danger); font-size: 13px; }
.mobile { display: none; }

#app { display: grid; min-height: 100vh; grid-template-columns: 254px 1fr; }
aside { display: flex; flex-direction: column; padding: 27px 16px 18px; border-right: 1px solid var(--line); background: var(--surface); }
aside > p { margin: 7px 39px 29px; color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
nav { display: grid; gap: 5px; }
nav button { display: flex; align-items: center; gap: 10px; border-radius: 7px; background: transparent; color: var(--muted); text-align: left; box-shadow: none; }
nav button.active, nav button:hover { background: var(--green-soft); color: var(--ink); box-shadow: none; }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: #b0c7bb; }
.active .nav-dot { background: var(--green); box-shadow: 0 0 0 4px #d5ebdd; }
.sidebar-note { display: flex; gap: 9px; margin-top: auto; padding: 14px 12px; border: 1px solid #e4ece7; border-radius: 9px; background: #f5f8f6; color: var(--muted); }
.sidebar-note b { display: block; color: var(--ink); font-size: 11px; }
.sidebar-note small { display: block; margin-top: 3px; font-size: 10px; line-height: 1.45; }
.note-led { flex: none; width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: #42a875; }
#logout { margin-top: 11px; border: 1px solid var(--line); background: transparent; color: var(--muted); box-shadow: none; }
#logout:hover { background: #fafbfa; color: var(--ink); }

.content { width: 100%; max-width: 1540px; margin: auto; padding: 37px 44px; }
.content header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 25px; }
.content h1 { margin: 5px 0; font-size: 38px; letter-spacing: -.06em; }
.content header p { margin: 0; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-actions .secondary { border: 1px solid var(--line); background: #fff; color: var(--ink); box-shadow: none; }
.header-actions span { color: var(--muted); font-size: 11px; font-weight: 750; }
.header-actions i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #42a875; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.card, .table-card, .form-card { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 3px 12px rgba(19, 45, 32, .035); }
.card p { margin: 0; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .07em; }
.card strong { display: block; margin: 13px 0 5px; font-size: 28px; letter-spacing: -.04em; }
.form-card { margin-top: 16px; }.form-card h3 { margin: 0; font-size: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }.form-grid .wide { grid-column: 1 / -1; }.form-card textarea { min-height: 100px; resize: vertical; }
.override-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .8fr) auto; gap: 18px; align-items: end; border-color: #e6d5a0; background: #fffdf6; }.override-card h3 { margin-top: 10px; }.override-card p { max-width: 560px; margin: 8px 0 0; line-height: 1.5; }.override-card textarea { min-height: 72px; }.override-card.override-on { border-color: #e3b0ac; background: #fff7f6; }.danger-button { background: var(--danger); }.danger-button:hover { background: #8d302c; }.override-audit { margin-top: 16px; }
table { width: 100%; border-collapse: collapse; }th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); font-size: 13px; text-align: left; }th { color: var(--muted); font-size: 10px; letter-spacing: .1em; }
.pill { display: inline-block; padding: 4px 8px; border-radius: 100px; background: var(--green-soft); color: #087047; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }.muted { color: var(--muted); }.status { min-height: 16px; padding: 0; color: var(--muted); font-size: 12px; font-weight: 650; }
.theme-choice, .settings-tabs { display: flex; gap: 9px; margin: 18px 0; }.theme-choice button, .settings-tabs button { background: #eef3f0; color: var(--ink); box-shadow: none; }.theme-choice button.selected, .settings-tabs button.selected { background: var(--green); color: #fff; }

.command-workspace { display: grid; min-height: 590px; grid-template-columns: 258px 1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
.session-rail { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); background: #fbfcfb; }
.session-rail-top { display: flex; align-items: center; justify-content: space-between; padding: 17px 14px; border-bottom: 1px solid var(--line); }.session-rail-top small { display: block; margin: 0 0 2px; color: var(--muted); font-size: 9px; }.session-rail-top b { font-size: 12px; }
.new-session { padding: 7px 9px; background: var(--ink); font-size: 11px; box-shadow: none; }.new-session:hover { background: #23382e; }
.session-list { display: grid; gap: 3px; max-height: 58vh; padding: 8px; overflow: auto; }.session-item { display: flex; align-items: flex-start; gap: 9px; padding: 10px 8px; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; box-shadow: none; }.session-item:hover { background: #eef5f0; box-shadow: none; }.session-item.selected { background: var(--green-soft); box-shadow: inset 2px 0 0 var(--green); }
.session-icon { display: grid; flex: none; width: 25px; height: 25px; border-radius: 7px; place-items: center; background: #e7eee9; color: #466555; font-size: 9px; font-weight: 850; letter-spacing: .04em; }.session-item.selected .session-icon { background: #cfe6d8; color: var(--green-strong); }.session-item b, .session-item small { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.session-item b { font-size: 11px; }.session-item small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.35; }.no-sessions { padding: 18px 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }.session-rail-footer { display: flex; gap: 7px; margin-top: auto; padding: 13px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.4; }

.chat-panel { display: grid; min-width: 0; grid-template-rows: auto 1fr auto; }.chat-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 19px; border-bottom: 1px solid var(--line); }.chat-meta > div { display: flex; align-items: center; gap: 9px; }.chat-meta .muted { font-size: 10px; letter-spacing: .05em; }.model-note { color: var(--muted); font-size: 11px; }.state-running, .state-submitting { background: #eef2f9; color: #365a7c; }.state-error, .state-blocked { background: #fbe9e8; color: var(--danger); }
.override-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 19px; border-bottom: 1px solid #e7b7b2; background: #fff1ef; color: #8d302c; font-size: 11px; }.override-banner b { font-size: 10px; letter-spacing: .08em; }.override-banner span { color: #9d524b; }
.chat-thread { display: grid; min-height: 390px; max-height: 58vh; gap: 14px; padding: 25px 28px; overflow: auto; align-content: start; background: linear-gradient(180deg, #fff, #fcfdfc); }.chat-message { max-width: min(760px, 84%); padding: 13px 15px; border-radius: 10px; font-size: 14px; line-height: 1.58; white-space: pre-wrap; }.chat-message small { display: block; margin-bottom: 6px; font-size: 9px; font-weight: 800; letter-spacing: .08em; }.from-user { justify-self: end; border-bottom-right-radius: 3px; background: var(--blue); color: #fff; }.from-agent { justify-self: start; border-bottom-left-radius: 3px; background: var(--green-soft); color: var(--ink); }.chat-notice { max-width: min(760px, 84%); justify-self: start; padding: 12px 14px; border: 1px solid #efc8c5; border-radius: 9px; background: #fff6f5; color: #8d302c; font-size: 13px; line-height: 1.5; }.chat-notice small { display: block; margin-bottom: 5px; font-size: 9px; font-weight: 850; letter-spacing: .1em; }.status-blocked { color: var(--danger); }
.reply-structure { display: grid; gap: 9px; }.reply-section { padding: 9px 10px; border: 1px solid #d7e6dd; border-radius: 7px; background: rgba(255,255,255,.52); white-space: pre-wrap; }.reply-section b { display: block; margin-bottom: 3px; color: var(--green-strong); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }.reply-section.suggested-off-peak-follow-up { border-color: #e9d9a8; background: #fffbef; }.reply-section.suggested-off-peak-follow-up b { color: #896a18; }.reply-section.owner-choice { border-color: #d7cfea; background: #f8f6fe; }.reply-section.owner-choice b { color: #665391; }
.empty-chat { max-width: 510px; margin: auto; padding: 45px 0; color: var(--muted); text-align: center; }.empty-kicker { color: var(--green); font-size: 10px; font-weight: 850; letter-spacing: .15em; }.empty-chat h3 { margin: 8px 0; color: var(--ink); font-size: 27px; letter-spacing: -.05em; }.empty-chat p { margin: 0; line-height: 1.65; }.empty-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 20px; }.empty-chips span { padding: 7px 9px; border: 1px solid var(--line); border-radius: 100px; background: #fff; font-size: 11px; }
.chat-composer { display: grid; grid-template-columns: 1fr auto; gap: 11px; align-items: end; padding: 15px 18px 12px; border-top: 1px solid var(--line); background: #fff; }.composer-field textarea { display: block; min-height: 70px; max-height: 160px; margin: 0; resize: vertical; border-color: #cbd9d0; }.composer-field small { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }.chat-composer button { min-width: 108px; height: 45px; }.chat-composer button span { margin-left: 7px; }.chat-composer .status { grid-column: 1 / -1; }

body.theme-dark { --ink:#ecf5ef; --muted:#a6b7ae; --line:#294237; --paper:#101a15; --surface:#14241b; --green-soft:#18382a; --blue:#254a68; background: var(--paper); }body.theme-dark .intro, body.theme-dark .login form, body.theme-dark aside, body.theme-dark .card, body.theme-dark .table-card, body.theme-dark .form-card, body.theme-dark .command-workspace, body.theme-dark .chat-panel, body.theme-dark .chat-composer { background:#14241b; color:var(--ink); }body.theme-dark .session-rail, body.theme-dark .chat-thread { background:#112017; }body.theme-dark .content input, body.theme-dark .content textarea, body.theme-dark .login input { border-color:var(--line); background:#0e1b14; color:var(--ink); }body.theme-dark nav button, body.theme-dark #logout, body.theme-dark .theme-choice button, body.theme-dark .settings-tabs button { background:#14241b; color:var(--muted); }body.theme-dark nav button.active, body.theme-dark nav button:hover, body.theme-dark .session-item:hover { background:#18382a; color:var(--ink); }body.theme-dark .session-item.selected { background:#1d4230; }body.theme-dark .session-icon { background:#263e31; color:#b7d8c3; }body.theme-dark .chat-thread { background:linear-gradient(180deg,#13231a,#102017); }body.theme-dark .empty-chips span, body.theme-dark .header-actions .secondary { background:#14241b; }body.theme-dark .override-card { background:#261d18; }.theme-dark .override-banner { border-color:#7d4541; background:#321d1b; color:#f1b8b2; }.theme-dark .override-banner span { color:#d99b95; }
body.theme-dark .reply-section { border-color:#315541; background:#183025; }.theme-dark .reply-section.suggested-off-peak-follow-up { border-color:#6d5b24; background:#302a16; }.theme-dark .reply-section.owner-choice { border-color:#514469; background:#272136; }

@media (max-width: 900px) {.login { grid-template-columns:1fr; }.intro { display:none; }.login form { margin:auto; }.mobile { display:flex; }#app { grid-template-columns:1fr; }aside { padding:14px; border-right:0; border-bottom:1px solid var(--line); }aside > p, .sidebar-note, #logout { display:none; }nav { display:flex; overflow:auto; }nav button { padding:9px; white-space:nowrap; }.content { padding:23px 15px; }.content header { align-items:flex-start; gap:14px; }.content h1 { font-size:31px; }.header-actions span { display:none; }.cards, .form-grid, .override-card { grid-template-columns:1fr; }.form-grid .wide { grid-column:auto; }.table-card { overflow:auto; }.command-workspace { grid-template-columns:1fr; }.session-rail { border-right:0; border-bottom:1px solid var(--line); }.session-list { display:flex; max-height:none; padding:8px; overflow:auto; }.session-item { min-width:190px; }.session-rail-footer { display:none; }.chat-thread { min-height:350px; padding:18px; }.chat-composer { grid-template-columns:1fr; }.chat-composer button { width:100%; }.chat-meta { flex-direction:column; align-items:flex-start; }.model-note { display:none; }.override-banner { align-items:flex-start; flex-direction:column; }}
