:root {
  --ink: #15282b;
  --muted: #52676a;
  --green: #0d6c59;
  --green-dark: #084f42;
  --mint: #e7f3ef;
  --paper: #fffefa;
  --canvas: #f4f2ea;
  --line: #ccd7d4;
  --amber: #9a6200;
  --amber-bg: #fff4d8;
  --shadow: 0 18px 46px rgba(20, 47, 44, .09);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { min-height: 100vh; margin: 0; padding-bottom: 105px; display: flex; flex-direction: column; color: var(--ink); background: var(--canvas); font: 16px/1.55 "Segoe UI", Arial, sans-serif; }
button, textarea { font: inherit; }
.topbar { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 8px max(24px, calc((100vw - 1120px) / 2)); background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 750; }
.brand-logo { display: block; width: 88px; height: 62px; object-fit: contain; }
.connection { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #d49b2a; box-shadow: 0 0 0 4px #f7edcf; }
.connection.online .dot { background: #22a879; box-shadow: 0 0 0 4px #dff3eb; }
.connection.offline .dot { background: #c34a3c; box-shadow: 0 0 0 4px #f7dfdc; }
main { width: min(1120px, calc(100% - 32px)); margin: 46px auto; flex: 1 0 auto; }
.search-panel, .result-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.search-panel { padding: clamp(25px, 5vw, 54px); }
.eyebrow { margin: 0 0 10px; color: var(--green); font-weight: 800; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.025em; }
h1 { max-width: 780px; margin: 0; font-size: clamp(40px, 6vw, 68px); line-height: .98; }
.intro { max-width: 800px; margin: 22px 0 28px; color: var(--muted); }
form { border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: #fff; }
label { display: block; margin-bottom: 8px; font-weight: 750; }
textarea { width: 100%; min-height: 98px; resize: vertical; padding: 15px; border: 1px solid #b8c7c4; border-radius: 11px; color: var(--ink); background: #fbfcfb; }
textarea:focus { outline: 3px solid rgba(13,108,89,.16); border-color: var(--green); }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 14px; }
.privacy { color: var(--muted); font-size: 13px; }
button { border: 0; border-radius: 10px; padding: 13px 20px; background: var(--green); color: white; font-weight: 750; cursor: pointer; }
button:hover { background: var(--green-dark); }
button:focus-visible { outline: 3px solid rgba(13,108,89,.25); outline-offset: 2px; }
button:disabled { opacity: .65; cursor: wait; }
.status-region { min-height: 24px; margin: 18px 4px; color: var(--muted); }
.thinking { padding: 15px 17px; border: 1px solid #bcd7cf; border-radius: 14px; background: #f4faf7; }
.thinking-line { display: flex; align-items: center; gap: 10px; color: var(--green-dark); }
.elapsed { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.spinner { width: 19px; height: 19px; border: 3px solid #b9d9cf; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
.progress-track { position: relative; height: 6px; margin-top: 12px; overflow: hidden; border-radius: 999px; background: #dbe9e5; }
.progress-track span { position: absolute; inset: 0 auto 0 -35%; width: 35%; border-radius: inherit; background: linear-gradient(90deg, var(--green), #39a889); animation: progress 1.4s ease-in-out infinite; }
.thinking p { margin: 8px 0 0; font-size: 13px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes progress { from { left: -35%; } to { left: 105%; } }
.result-panel { padding: clamp(24px, 4vw, 44px); }
.hidden { display: none; }
.result-head { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 22px; }
.result-head h2 { margin: 3px 0 0; font-size: clamp(34px, 4vw, 48px); line-height: 1.05; }
.badge { display: inline-block; border-radius: 999px; padding: 6px 10px; color: var(--green-dark); background: var(--mint); font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.answer-card, .clarification-card, .requirements, .restrictions, .limitations { border-radius: 14px; padding: 20px; }
.answer-card { border: 1px solid #bcd7cf; background: #f4faf7; }
.answer-card h3, .clarification-card h3, .sources-title { margin: 0 0 8px; font-size: 17px; }
.answer-text { margin: 0; font-size: 19px; line-height: 1.55; }
.requirements { margin-top: 18px; border: 1px solid #a9d5c6; background: #f3faf7; }
.requirements h3, .restrictions h3 { margin: 0 0 9px; font-size: 16px; }
.requirements ul, .restrictions ul { margin: 0; padding: 0; list-style: none; }
.requirements li, .restrictions li { position: relative; margin: 10px 0; padding-left: 34px; line-height: 1.45; }
.requirements li::before, .restrictions li::before { position: absolute; left: 0; top: .05em; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: white; font-weight: 900; line-height: 1; }
.requirements li::before { content: "✓"; background: #16805f; }
.restrictions li::before { content: "×"; background: #c43f36; font-size: 18px; }
.limitations li { margin: 7px 0; line-height: 1.45; }
.restrictions { margin-top: 18px; border: 1px solid #e0aaa5; border-left: 4px solid #c43f36; background: #fff1ef; }
.restrictions h3 { color: #8d2721; }
.clarification-card { border-left: 5px solid #d99b1c; background: var(--amber-bg); }
.clarification-card p { margin: 0 0 16px; }
.choice-list { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { color: var(--green-dark); background: white; border: 1px solid var(--green); }
.choice:hover { color: white; }
.reason { margin: 15px 0 0; color: #6e541d; font-size: 14px; }
.citation-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.citation { border-radius: 999px; padding: 6px 10px; background: var(--mint); color: var(--green-dark); font-size: 13px; font-weight: 700; }
.limitations { margin-top: 18px; border-left: 4px solid #d99b1c; background: var(--amber-bg); }
.model-warning { margin-top: 18px; padding: 16px 18px; border-left: 4px solid #567783; border-radius: 12px; background: #edf4f6; }
.model-warning h3, .model-warning p { margin: 0; }
.model-warning h3 { margin-bottom: 5px; font-size: 15px; }
.limitations h3 { margin: 0 0 6px; font-size: 15px; }
.limitations ul { margin: 0; padding-left: 20px; }
.sources { margin-top: 24px; }
details { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; background: white; }
summary { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 16px; cursor: pointer; font-weight: 750; }
summary::marker { color: var(--green); }
.source-body { padding: 0 16px 18px; color: #33494c; }
.source-body blockquote { margin: 0; padding: 0 0 0 15px; border-left: 3px solid #a9cfc3; white-space: pre-wrap; }
.source-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 15px; color: var(--muted); font-size: 12px; }
.source-meta a { color: var(--green-dark); font-weight: 750; }
.error { border-left: 5px solid #c34a3c; background: #fff0ee; border-radius: 12px; padding: 18px; }
.feedback { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-top:22px; padding-top:18px; border-top:1px solid var(--line); }
.feedback button { margin-left:4px; padding:9px 14px; }
.feedback-status { color:#8d2721; font-size:13px; }
.feedback-form { width:100%; display:grid; gap:8px; padding:16px; border:1px solid var(--line); border-radius:12px; background:#fbfcfb; }
.feedback-form input { width:100%; padding:11px; border:1px solid #b8c7c4; border-radius:9px; font:inherit; }
.feedback-form textarea { min-height:82px; }
.feedback-form div { display:flex; flex-wrap:wrap; gap:8px; }
.site-footer { position: fixed; z-index: 50; right: 0; bottom: 0; left: 0; width: 100%; padding: 12px max(16px, calc((100vw - 1120px) / 2)); border-top: 1px solid var(--line); color: var(--muted); background: var(--paper); box-shadow: 0 -8px 24px rgba(20, 47, 44, .08); font-size: 13px; }
.footer-inner { display: flex; align-items: center; gap: 18px; width: min(1120px, 100%); margin: 0 auto; }
.footer-logo { flex: 0 0 auto; width: 76px; height: 52px; object-fit: contain; }
.site-footer p { margin: 3px 0; }
.site-footer strong { color: var(--ink); }

@media (max-width: 680px) {
  body { padding-bottom: 125px; }
  .topbar { padding: 0 16px; }
  .brand-logo { width: 68px; height: 50px; }
  .brand span { font-size: 14px; }
  .connection span:last-child { display: none; }
  main { margin-top: 22px; }
  .search-panel, .result-panel { border-radius: 16px; }
  .form-row, .result-head { align-items: stretch; flex-direction: column; }
  .form-row button { width: 100%; }
  .privacy { order: 2; text-align: center; }
  .choice { width: 100%; }
  .footer-inner { align-items: flex-start; }
  .footer-logo { width: 58px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .spinner, .progress-track span { animation-duration: 2.5s; }
}
