@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Newsreader:opsz,wght@6..72,500;6..72,600&display=swap');

:root {
  --ink: #101719;
  --ink-2: #182225;
  --ink-3: #222f31;
  --paper: #f4f2eb;
  --paper-2: #e9e8df;
  --paper-3: #dcded2;
  --muted: #87908a;
  --muted-dark: #65716e;
  --lime: #c7f36a;
  --lime-dim: #87a94b;
  --orange: #f6a06a;
  --line: rgba(16, 23, 25, 0.12);
  --line-light: rgba(244, 242, 235, 0.13);
  --sans: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;
  --serif: 'Newsreader', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 295px 1fr; }
.sidebar { background: var(--ink); color: var(--paper); padding: 29px 24px 25px; display: flex; flex-direction: column; min-height: 100vh; position: relative; overflow: hidden; }
.sidebar::before { content: ''; position: absolute; width: 230px; height: 230px; border: 1px solid rgba(199,243,106,.13); border-radius: 50%; left: -145px; bottom: 90px; }
.sidebar::after { content: ''; position: absolute; width: 310px; height: 310px; border: 1px solid rgba(199,243,106,.06); border-radius: 50%; left: -185px; bottom: 50px; }
.brand-row { display: flex; gap: 12px; align-items: center; position: relative; z-index: 1; }
.brand-mark { width: 35px; height: 31px; position: relative; display: flex; gap: 3px; align-items: end; padding: 0 2px 2px; }
.brand-mark::after { content: ''; position: absolute; width: 2px; height: 27px; background: var(--lime); left: 16px; top: 1px; transform: rotate(5deg); }
.brand-mark span { display: block; width: 14px; height: 25px; border: 2px solid var(--lime); border-radius: 4px 2px 5px 5px; transform: skewY(-9deg); }
.brand-mark span:last-child { transform: skewY(9deg); }
.eyebrow, .section-kicker, .hackathon-label, .version-tag, .breadcrumbs, .date-divider, .message-meta, .source-note, .suggestion-heading, .composer-footer, .connection-status, .local-pill { font-family: var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.eyebrow { color: var(--lime); font-size: 9px; margin-bottom: 2px; }
.brand-name { font-size: 23px; line-height: 1; font-weight: 600; letter-spacing: -.04em; }
.brand-dot { color: var(--lime); }
.rail-rule { height: 1px; background: var(--line-light); margin: 29px 0 28px; }
.secret-card { position: relative; z-index: 1; }
.section-kicker { color: var(--lime); font-size: 9px; display: flex; align-items: center; gap: 7px; margin-bottom: 12px; }
.tiny-lock { color: var(--lime); font-size: 18px; line-height: 0; transform: rotate(-45deg); display: inline-block; }
.secret-card h1, .guard-card h2 { margin: 0; letter-spacing: -.03em; }
.secret-card h1 { font-size: 20px; font-weight: 500; margin-bottom: 10px; }
.muted-copy { color: #94a09b; font-size: 12px; line-height: 1.55; margin: 0 0 22px; max-width: 210px; }
.secret-form label { display: block; color: #b2bcb4; font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 7px; }
.input-wrap { display: flex; border: 1px solid #465553; background: #172022; border-radius: 4px; overflow: hidden; transition: border-color .2s; }
.input-wrap:focus-within { border-color: var(--lime); }
.input-wrap input { min-width: 0; flex: 1; background: transparent; color: var(--paper); border: 0; padding: 11px 12px; outline: 0; font-family: var(--mono); font-size: 13px; letter-spacing: .08em; }
.input-wrap input::placeholder { color: #63706d; letter-spacing: 0; }
.icon-button { border: 0; background: transparent; color: #75837e; padding: 0 11px; font-size: 12px; }
.field-help { font-size: 10px; color: #66736f; margin-top: 7px; }
.primary-button { width: 100%; display: flex; justify-content: space-between; align-items: center; border: 0; background: var(--lime); color: var(--ink); border-radius: 4px; padding: 12px 13px; margin-top: 16px; font-size: 11px; font-weight: 700; transition: transform .18s, background .18s; }
.primary-button:hover { background: #d6ff80; transform: translateY(-1px); }
.primary-button span:last-child { font-size: 15px; }
.lock-status { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line-light); margin-top: 18px; padding-top: 14px; color: #77847e; font-size: 10px; }
.lock-status[data-state='ready'] { color: var(--lime); }
.status-dot { display: inline-block; width: 7px; height: 7px; background: #6f7d79; border-radius: 50%; flex: 0 0 auto; }
.lock-status[data-state='ready'] .status-dot, .connection-status[data-state='ready'] .status-dot { background: var(--lime); box-shadow: 0 0 0 4px rgba(199,243,106,.1); }
.local-pill { color: var(--lime); font-size: 8px; border: 1px solid rgba(199,243,106,.35); padding: 3px 5px; border-radius: 2px; margin-left: auto; }
.guard-card { position: relative; z-index: 1; margin-top: 48px; border-left: 1px solid var(--lime-dim); padding-left: 14px; }
.guard-card h2 { font-size: 13px; font-weight: 500; margin-bottom: 15px; }
.guard-line { color: #a4afaa; display: flex; align-items: flex-start; gap: 8px; font-size: 11px; line-height: 1.45; margin: 10px 0; }
.check-icon { color: var(--lime); font-size: 12px; }
.sidebar-footer { position: relative; z-index: 1; display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; padding-top: 35px; }
.hackathon-label { color: #6e7a76; font-size: 8px; line-height: 1.55; }
.hackathon-label span { color: #465552; }
.version-tag { color: #51615d; font-size: 8px; }

.main-panel { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; padding: 0 6.2vw; background: var(--paper); }
.topbar { min-height: 80px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.breadcrumbs { font-size: 9px; color: #9aa09a; display: flex; align-items: center; gap: 10px; }
.breadcrumbs strong { color: var(--ink); font-weight: 500; }
.crumb-slash { color: var(--lime-dim); }
.topbar-right { display: flex; align-items: center; gap: 23px; }
.connection-status { display: flex; align-items: center; gap: 8px; color: #76817b; font-size: 8px; }
.connection-status[data-state='ready'] { color: #5e7a41; }
.connection-status[data-state='error'] { color: #aa6945; }
.text-button { border: 0; border-bottom: 1px solid var(--ink); background: transparent; color: var(--ink); font-family: var(--mono); font-size: 9px; letter-spacing: .07em; text-transform: uppercase; padding: 0 0 2px; }
.hero-row { display: flex; justify-content: space-between; align-items: end; padding: 65px 0 55px; }
.hero-kicker { display: flex; align-items: center; gap: 9px; color: #6c7771; font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 17px; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime-dim); position: relative; }
.pulse-dot::after { content: ''; position: absolute; inset: -4px; border: 1px solid rgba(135,169,75,.4); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(.8); opacity: .7; } 50% { transform: scale(1.35); opacity: 0; } }
.hero-row h2 { font-size: clamp(43px, 5vw, 73px); line-height: .95; letter-spacing: -.065em; font-weight: 600; margin: 0; }
.hero-row h2 em { font-family: var(--serif); font-weight: 500; color: #768a4c; letter-spacing: -.06em; }
.hero-note { display: flex; gap: 13px; align-items: flex-start; padding-bottom: 6px; }
.note-line { display: block; width: 28px; height: 1px; background: var(--lime-dim); margin-top: 8px; }
.hero-note p { color: #77817b; font-size: 11px; line-height: 1.55; margin: 0; }
.chat-region { flex: 1; max-width: 850px; width: 100%; }
.date-divider { display: flex; align-items: center; gap: 12px; color: #a0a59f; font-size: 8px; }
.divider-line { height: 1px; background: var(--line); flex: 1; }
.message { display: grid; grid-template-columns: 45px 1fr; gap: 13px; padding: 26px 0 0; animation: message-in .25s ease-out both; }
@keyframes message-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.message-index { color: #a1a7a0; font-family: var(--mono); font-size: 9px; padding-top: 5px; }
.message-body { min-width: 0; }
.message-meta { display: flex; align-items: center; gap: 9px; color: #9aa19a; font-size: 8px; }
.message-meta strong { color: var(--ink); font-family: var(--sans); font-size: 11px; letter-spacing: 0; text-transform: none; }
.message-meta time { margin-left: auto; color: #afb3aa; }
.avatar { display: inline-grid; place-items: center; width: 22px; height: 22px; font-family: var(--sans); font-size: 11px; font-weight: 700; }
.avatar-shelf { background: var(--ink); color: var(--lime); border-radius: 50%; }
.avatar-user { background: var(--lime); color: var(--ink); border-radius: 50%; }
.bubble { display: inline-block; max-width: min(680px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 2px 14px 14px 14px; padding: 15px 18px; margin-top: 10px; color: #32403e; font-size: 14px; line-height: 1.58; box-shadow: 0 8px 20px rgba(24, 34, 37, .025); }
.user-message .bubble { background: var(--ink); color: var(--paper); border-color: var(--ink); border-radius: 14px 2px 14px 14px; }
.user-message .message-meta { justify-content: flex-end; }
.user-message .message-meta strong { order: 1; }
.user-message .message-meta .avatar { order: 2; }
.user-message .message-meta time { order: 3; margin-left: 0; }
.user-message .bubble-wrap { display: flex; justify-content: flex-end; }
.source-note { color: #9da59d; display: flex; align-items: center; gap: 6px; font-size: 8px; margin-top: 10px; }
.source-mark { color: var(--lime-dim); font-size: 13px; }
.user-message .source-note { justify-content: flex-end; }
.typing-bubble { color: #7a8580; min-width: 84px; }
.typing-bubble span { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--lime-dim); margin-right: 4px; animation: blink 1s infinite; }
.typing-bubble span:nth-child(2) { animation-delay: .15s; } .typing-bubble span:nth-child(3) { animation-delay: .3s; margin-right: 0; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.suggestions { max-width: 850px; width: 100%; padding-top: 44px; }
.suggestion-heading { display: flex; align-items: center; gap: 11px; color: #a0a59f; font-size: 8px; }
.suggestion-rule { width: 45px; height: 1px; background: var(--paper-3); }
.suggestion-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.suggestion { border: 1px solid #d5d8ce; background: transparent; color: #68746f; border-radius: 2px; padding: 9px 11px; font-size: 11px; text-align: left; transition: border-color .18s, color .18s, background .18s; }
.suggestion span { color: var(--lime-dim); font-family: var(--mono); font-size: 9px; margin-right: 6px; }
.suggestion:hover { border-color: var(--lime-dim); color: var(--ink); background: rgba(199,243,106,.12); }
.composer { margin: 35px 0 25px; max-width: 850px; width: 100%; }
.composer-inner { display: flex; align-items: center; gap: 12px; border: 1px solid #bfc6bc; background: #fff; padding: 7px 8px 7px 15px; border-radius: 4px; box-shadow: 0 10px 26px rgba(24, 34, 37, .035); transition: border-color .2s, box-shadow .2s; }
.composer-inner:focus-within { border-color: var(--lime-dim); box-shadow: 0 0 0 3px rgba(199,243,106,.18); }
.composer-mark { font-size: 21px; color: var(--lime-dim); transform: rotate(-45deg); }
.composer-inner input { border: 0; outline: 0; color: var(--ink); min-width: 0; flex: 1; font-size: 13px; background: transparent; }
.composer-inner input::placeholder { color: #969f98; }
.send-button { border: 0; background: var(--ink); color: var(--lime); display: flex; align-items: center; gap: 12px; border-radius: 3px; padding: 11px 13px; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; transition: background .18s, transform .18s; }
.send-button:hover { background: var(--ink-3); transform: translateY(-1px); }
.send-button:disabled { opacity: .5; cursor: wait; }
.composer-footer { display: flex; justify-content: space-between; padding: 9px 2px 0; color: #a1a69f; font-size: 8px; letter-spacing: .03em; }
kbd { border: 1px solid #ccd1c8; border-radius: 2px; padding: 2px 4px; color: #717b75; }
.toast { position: fixed; right: 24px; bottom: 24px; background: var(--ink); color: var(--paper); border-left: 3px solid var(--orange); padding: 12px 15px; font-size: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.15); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s; max-width: 330px; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 240px 1fr; }
  .sidebar { padding-left: 18px; padding-right: 18px; }
  .main-panel { padding: 0 4vw; }
  .hero-row { padding-top: 48px; }
  .hero-note { display: none; }
}
@media (max-width: 680px) {
  .app-shell { display: block; }
  .sidebar { min-height: auto; padding: 20px 20px 19px; }
  .rail-rule { margin: 18px 0 20px; }
  .secret-card { max-width: 420px; }
  .guard-card { display: none; }
  .sidebar-footer { display: none; }
  .main-panel { min-height: calc(100vh - 370px); padding: 0 20px; }
  .topbar { min-height: 62px; }
  .connection-status { display: none; }
  .hero-row { padding: 42px 0 38px; }
  .hero-row h2 { font-size: 48px; }
  .message { grid-template-columns: 30px 1fr; gap: 7px; }
  .message-index { font-size: 8px; }
  .bubble { font-size: 13px; }
  .composer-footer span:first-child { max-width: 60%; line-height: 1.4; }
}
