:root {
  color-scheme: light;
  --ink: #18313a;
  --muted: #6e8185;
  --line: #d9e3e1;
  --paper: #f7faf8;
  --accent: #c7472d;
  --accent-dark: #963421;
  --teal: #176e6a;
  --soft: #eef5f2;
  --warn: #fff4e8;
  --panel: rgba(255, 255, 255, .92);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  font-family: "Avenir Next", "PingFang SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, #dcece6, transparent 34rem),
    radial-gradient(circle at 100% 100%, #f4e7df, transparent 38rem),
    linear-gradient(180deg, #f8fbfa, #f3f6f4);
}
.shell {
  display: flex;
  flex-direction: column;
  width: min(1480px, calc(100% - 32px));
  height: 100vh;
  margin: 0 auto;
  padding: 20px 0 12px;
}
.hero { flex: 0 0 auto; padding: 8px 4px 16px; }
.hero-top, .section-title, .plan-head, .result-group-title, .pane-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.eyebrow, .section-title span, .result-group-title span, .pane-heading > div > span {
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
h1 {
  margin: 5px 0 3px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -.045em;
}
.hero p { max-width: 760px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.workspace {
  display: grid;
  grid-template-columns: minmax(360px, .78fr) minmax(620px, 1.35fr);
  flex: 1 1 auto;
  min-height: 0;
  gap: 16px;
}
.chat-pane, .result-pane {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(194, 210, 205, .9);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 18px 46px rgba(22, 60, 53, .09);
  backdrop-filter: blur(16px);
}
.chat-pane { display: flex; flex-direction: column; }
.pane-heading {
  flex: 0 0 auto;
  min-height: 70px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 253, 252, .92);
}
.pane-heading h2 { margin: 2px 0 0; font-size: 18px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #2d9684; box-shadow: 0 0 0 5px #dff1eb; }
.safe-label { padding: 6px 9px; border-radius: 999px; color: var(--teal); background: var(--soft); font-size: 11px; font-weight: 700; white-space: nowrap; }
.chat {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 16px;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}
.message {
  width: fit-content;
  max-width: 90%;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 5px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(22, 60, 53, .06);
  line-height: 1.68;
}
.message strong { color: var(--teal); font-size: 12px; }
.message p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user {
  align-self: flex-end;
  border-color: #18313a;
  border-radius: 16px 16px 5px 16px;
  background: #18313a;
  color: #f8fffc;
}
.message.user strong { color: #b9e1d6; }
.composer {
  flex: 0 0 auto;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}
textarea {
  display: block;
  width: 100%;
  min-height: 90px;
  max-height: 210px;
  resize: vertical;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  line-height: 1.6;
}
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.composer-bar span { min-width: 0; overflow-wrap: anywhere; }
.result-pane {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.result-heading {
  position: sticky;
  top: 0;
  z-index: 4;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 253, 252, .96);
  backdrop-filter: blur(16px);
}
.result-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: calc(100% - 70px);
  padding: 48px;
  text-align: center;
}
.result-empty[hidden] { display: none; }
.result-empty h3 { margin: 18px 0 6px; font-family: Georgia, "Songti SC", serif; font-size: 25px; }
.result-empty p { max-width: 480px; margin: 0; color: var(--muted); line-height: 1.75; }
.empty-mark { display: grid; grid-template-columns: repeat(3, 26px); align-items: end; gap: 7px; height: 62px; }
.empty-mark i { display: block; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #2b827b, #b7d8ce); }
.empty-mark i:nth-child(1) { height: 34px; }
.empty-mark i:nth-child(2) { height: 58px; background: linear-gradient(180deg, var(--accent), #e9b8a8); }
.empty-mark i:nth-child(3) { height: 45px; }
.draft, .job { display: grid; gap: 12px; margin: 0; padding: 20px; }
.job { border-top: 1px solid var(--line); }
.section-title h2, .job h2 { margin: 2px 0 0; font-size: 20px; }
.task-count { padding: 7px 11px; border-radius: 999px; background: var(--soft); color: var(--teal); font-size: 12px; font-weight: 800; white-space: nowrap; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0 0; }
.fact { min-width: 0; padding: 11px 12px; border-radius: 11px; background: var(--soft); color: var(--muted); font-size: 12px; }
.fact b { display: block; color: var(--teal); font-size: 20px; }
.standard-line, .ready { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.standard-line span, .parameter span, .result-grid span { color: var(--muted); font-size: 12px; }
.standard-line b { min-width: 0; text-align: right; overflow-wrap: anywhere; }
.case-list, .plans { display: grid; gap: 10px; }
.case-card { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfc; }
.case-card h3, .result-group h3, .plan-card h4 { margin: 0; }
.parameters { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px; margin-top: 12px; }
.parameter { min-width: 0; padding: 10px; border: 1px solid #e5ecea; border-radius: 10px; background: #fff; }
.parameter span, .parameter b { display: block; }
.parameter b { margin-top: 3px; overflow-wrap: anywhere; }
.source { display: inline-block; margin-top: 6px; padding: 2px 6px; border-radius: 999px; color: var(--teal); background: var(--soft); font-size: 10px; font-style: normal; }
.source.weather_reference { color: #8d5018; background: #fff0df; }
.weather-note, .warning { margin: 10px 0 0; color: #8a551e; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.assumptions, .parameter-hints, .missing, .ready { margin-top: 0; }
.assumptions { padding: 12px 14px; border-radius: 12px; background: #f4f7f5; font-size: 12px; }
.assumptions p { margin: 5px 0 0; color: var(--muted); }
.parameter-hints { padding: 12px 14px; border: 1px solid #e8c98f; border-radius: 12px; background: #fff8e8; color: #714b18; font-size: 12px; }
.parameter-hints p { margin: 5px 0 0; line-height: 1.6; }
.download-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.download-actions button { min-height: 46px; }
.missing { padding: 12px 14px; border: 1px solid #f0c89f; border-radius: 12px; background: var(--warn); }
.missing p { margin: 5px 0 0; overflow-wrap: anywhere; }
.ready { border-color: #b9d8cd; background: #f1f8f5; }
.wide { width: 100%; margin-top: 0; }
button { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 10px; padding: 10px 17px; background: #fff; color: var(--ink); font: inherit; cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary { border-color: var(--accent); background: var(--accent); color: white; font-weight: 800; }
button.primary:hover { background: var(--accent-dark); }
button.quiet { padding: 7px 11px; color: var(--muted); font-size: 12px; }
button:disabled { opacity: .55; cursor: wait; }
.progress { height: 8px; overflow: hidden; border-radius: 8px; background: #e7efed; }
.progress i { display: block; width: 0; height: 100%; background: var(--accent); transition: width .25s ease; }
.result-group { padding-top: 14px; border-top: 1px solid var(--line); }
.result-group:first-of-type { padding-top: 0; border-top: 0; }
.result-group-title { align-items: flex-end; }
.result-group-title h3 { max-width: 70%; text-align: right; overflow-wrap: anywhere; }
.plans { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-top: 10px; }
.plan-card { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfc; }
.plan-head { align-items: flex-start; }
.status-pill { max-width: 55%; padding: 3px 7px; border-radius: 999px; color: var(--teal); background: var(--soft); font-size: 10px; text-align: center; overflow-wrap: anywhere; }
.layers { min-height: 42px; margin: 9px 0; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.result-grid div { min-width: 0; padding: 8px; border-radius: 8px; background: #fff; }
.result-grid span, .result-grid b { display: block; overflow-wrap: anywhere; }
.result-grid b { margin-top: 2px; font-size: 13px; }
footer { flex: 0 0 auto; padding: 9px 4px 0; color: var(--muted); font-size: 11px; }
@media (max-width: 1120px) {
  .workspace { grid-template-columns: minmax(330px, .75fr) minmax(0, 1.25fr); }
  .plans { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
}
@media (max-width: 820px) {
  body { overflow: auto; }
  .shell { width: calc(100% - 20px); height: auto; min-height: 100vh; padding-top: 14px; }
  .workspace { display: flex; flex-direction: column; }
  .chat-pane { min-height: 620px; }
  .result-pane { min-height: 520px; overflow: visible; }
  .result-heading { position: static; }
  .chat { min-height: 320px; }
  .result-empty { min-height: 430px; }
  .parameters, .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plans { grid-template-columns: 1fr; }
  .download-actions { grid-template-columns: 1fr; }
  .standard-line, .ready { align-items: flex-start; flex-direction: column; }
  .standard-line b { text-align: left; }
}
@media (max-width: 460px) {
  .hero-top { align-items: flex-start; }
  .hero p { font-size: 13px; }
  .pane-heading { padding: 12px 14px; }
  .chat, .draft, .job { padding: 14px; }
  .parameters { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .composer-bar { align-items: flex-end; }
  .result-group-title { align-items: flex-start; flex-direction: column; }
  .result-group-title h3 { max-width: none; text-align: left; }
}
