:root {
  --ink: #113b39;
  --ink-soft: #4c6965;
  --evergreen: #0c453f;
  --teal: #138b82;
  --mint: #dcf3e9;
  --paper: #fffdf7;
  --ground: #eff5ef;
  --line: #c9dfd5;
  --coral: #e76d5b;
  --sun: #efb73d;
  --blue: #478eb7;
  --shadow: 0 18px 45px rgba(21, 64, 59, 0.12);
  --display: "Yu Mincho", "Hiragino Mincho ProN", serif;
  --body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 13% 2%, rgba(185, 224, 191, 0.55), transparent 25rem),
    radial-gradient(circle at 93% 92%, rgba(255, 217, 143, 0.42), transparent 24rem),
    var(--ground);
  font-family: var(--body);
}

button, input { font: inherit; }
button { cursor: pointer; }

.app-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 34px;
}

.app-header, .demo-notice, .workbench { box-shadow: var(--shadow); }

.app-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  background: var(--paper);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 24px 24px 0 0;
}

.brand-lockup, .header-status, .panel-heading, .scenario-strip, .ask-box, .message, .action-meta { display: flex; align-items: center; }
.brand-lockup { gap: 14px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--paper);
  background: var(--evergreen);
  border-radius: 15px 15px 15px 3px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: var(--display); font-size: 26px; letter-spacing: 0.02em; }
h2 { margin: 0; font-family: var(--display); font-size: 26px; letter-spacing: 0.02em; }

.header-status { gap: 9px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.live-dot { width: 9px; height: 9px; background: #74c999; border-radius: 50%; box-shadow: 0 0 0 4px var(--mint); }

.quiet-button {
  margin-left: 12px;
  padding: 8px 11px;
  color: var(--evergreen);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}
.quiet-button:hover { background: var(--mint); }

.demo-notice {
  padding: 10px 24px;
  color: #4c5c44;
  background: #fff6cf;
  border-top: 1px solid #f2dfa0;
  border-bottom: 1px solid #f2dfa0;
  font-size: 13px;
}

.workbench {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr) 286px;
  min-height: 665px;
  background: var(--paper);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 0 0 24px 24px;
  overflow: hidden;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 14px;
  background: #e6f0e9;
  border-right: 1px solid var(--line);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 10px;
  color: var(--ink-soft);
  border: 0;
  border-radius: 13px;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 800;
}
.nav-item:hover, .nav-item.is-active { color: var(--paper); background: var(--evergreen); }
.nav-symbol { display: grid; place-items: center; width: 21px; height: 21px; font-family: Georgia, serif; font-size: 18px; }

.nav-version {
  margin-top: auto;
  padding: 13px 10px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  font-size: 11px;
}
.nav-version span { display: block; margin-bottom: 4px; }
.nav-version b { color: var(--ink); }

.conversation-panel { display: flex; flex-direction: column; min-width: 0; padding: 28px 28px 22px; }
.panel-heading { justify-content: space-between; gap: 16px; }
.emergency-chip { padding: 8px 10px; color: #a64438; background: #ffe2d9; border-radius: 999px; font-size: 11px; font-weight: 900; white-space: nowrap; }

.scenario-strip { flex-wrap: wrap; gap: 8px; margin: 21px 0 16px; }
.scenario-button { padding: 9px 14px; color: var(--ink); border: 1px solid transparent; border-radius: 999px; font-size: 12px; font-weight: 900; }
.scenario-button:hover { transform: translateY(-1px); filter: saturate(1.12); }
.is-earthquake { background: #ffe0da; border-color: #f3c1b8; }
.is-weather { background: #dbeef8; border-color: #bcdce9; }
.is-infection { background: #fff0c7; border-color: #f2db99; }
.is-handover { background: var(--mint); border-color: #bfe4d3; }

.chat-log {
  flex: 1;
  min-height: 330px;
  padding: 8px 0 18px;
  overflow-y: auto;
  scrollbar-color: var(--line) transparent;
}

.message { align-items: flex-start; gap: 11px; max-width: 92%; margin: 11px 0; }
.message.user-message { margin-left: auto; justify-content: flex-end; }
.message-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 33px;
  height: 33px;
  color: var(--paper);
  background: var(--evergreen);
  border-radius: 11px 11px 11px 3px;
  font-size: 9px;
  font-weight: 900;
}
.message-body { padding: 15px 16px; color: var(--ink); background: #edf6ef; border: 1px solid #cfe1d3; border-radius: 4px 17px 17px 17px; }
.user-message .message-body { color: var(--paper); background: var(--teal); border-color: var(--teal); border-radius: 17px 4px 17px 17px; }
.message-body p { margin-bottom: 0; font-size: 14px; line-height: 1.65; }
.message-kicker { margin-bottom: 5px !important; color: var(--teal); font-size: 10px !important; font-weight: 900; letter-spacing: 0.1em; }
.message-subcopy { margin-top: 8px !important; color: var(--ink-soft); font-size: 12px !important; }
.quick-start { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; padding-top: 11px; border-top: 1px solid #cbe0d0; }
.quick-start span { color: var(--ink-soft); font-size: 11px; font-weight: 800; }
.quick-start button { padding: 8px 10px; color: var(--paper); border: 0; border-radius: 999px; background: var(--evergreen); font-size: 11px; font-weight: 900; white-space: nowrap; }
.quick-start button:hover { background: var(--teal); }

.answer-card { margin: 12px 0 16px 44px; max-width: calc(92% - 44px); overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 8px 20px rgba(28, 72, 64, 0.08); }
.answer-top { padding: 15px 16px 13px; background: var(--evergreen); color: var(--paper); }
.answer-top .eyebrow { color: #bfe3d3; }
.answer-top h3 { margin: 0; font-family: var(--display); font-size: 20px; }
.answer-top p { margin: 7px 0 0; color: #e0f3ea; font-size: 12px; line-height: 1.5; }
.action-list { padding: 0 16px; }
.action-row { display: grid; grid-template-columns: 79px 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid #e2ece5; }
.action-row:last-child { border-bottom: 0; }
.action-phase { color: var(--teal); font-size: 11px; font-weight: 900; letter-spacing: 0.04em; }
.action-copy b { display: block; margin-bottom: 3px; font-size: 13px; }
.action-copy span { color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.answer-footer { padding: 12px 16px 15px; color: #7c453b; background: #fff3eb; border-top: 1px solid #f2d5c8; font-size: 12px; line-height: 1.5; }
.source-pill { display: inline-block; margin-top: 9px; padding: 5px 8px; color: var(--evergreen); background: var(--mint); border-radius: 999px; font-size: 10px; font-weight: 900; }

.ask-box { gap: 9px; padding-top: 16px; border-top: 1px solid var(--line); }
.ask-box input { flex: 1; min-width: 0; padding: 14px 15px; color: var(--ink); border: 1px solid #bed6c9; border-radius: 13px; outline: none; background: var(--paper); }
.ask-box input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(19,139,130,0.14); }
.ask-box button { padding: 14px 17px; color: var(--paper); border: 0; border-radius: 13px; background: var(--evergreen); font-weight: 900; }
.ask-box button:hover { background: var(--teal); }

.context-rail { display: flex; flex-direction: column; gap: 14px; padding: 22px 18px; background: #f7faf6; border-left: 1px solid var(--line); }
.rail-card, .screen-card { padding: 16px; background: var(--paper); border: 1px solid #dce9df; border-radius: 17px; }
.source-card h2 { font-size: 20px; }
.source-card > p:not(.eyebrow) { margin: 10px 0; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.source-rule { width: 38px; height: 4px; margin: 14px 0; background: var(--coral); border-radius: 99px; }
.small-copy { font-size: 11px !important; }
.checklist-card ol { margin: 9px 0 0; padding: 0; list-style: none; counter-reset: checklist; }
.checklist-card li { counter-increment: checklist; display: grid; grid-template-columns: 23px 1fr; gap: 7px; padding: 6px 0; color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.checklist-card li::before { content: counter(checklist); display: grid; place-items: center; width: 20px; height: 20px; color: var(--teal); background: var(--mint); border-radius: 50%; font-size: 10px; font-weight: 900; }
.screen-card { margin-top: auto; padding: 8px; overflow: hidden; }
.screen-card img { display: block; width: 100%; border-radius: 12px; }
.screen-card p { margin: 8px 6px 2px; color: var(--ink-soft); font-size: 10px; font-weight: 800; }

.is-hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1040px) {
  .workbench { grid-template-columns: 152px minmax(0, 1fr); }
  .context-rail { display: none; }
}

@media (max-width: 720px) {
  .app-shell { width: 100%; padding: 0; }
  .app-header { min-height: 72px; padding: 12px 16px; gap: 8px; border-radius: 0; }
  .brand-mark { width: 39px; height: 39px; border-radius: 12px 12px 12px 3px; font-size: 11px; }
  .brand-lockup .eyebrow { display: none; }
  .eyebrow { font-size: 9px; }
  h1 { font-size: 21px; }
  .header-status { gap: 6px; font-size: 10px; white-space: nowrap; }
  .header-status .live-dot { width: 8px; height: 8px; box-shadow: 0 0 0 3px var(--mint); }
  .quiet-button { margin-left: 2px; padding: 8px 9px; font-size: 10px; white-space: nowrap; }
  .demo-notice { padding: 9px 16px; font-size: 11px; }
  .workbench { display: block; min-height: 100vh; border: 0; border-radius: 0; }
  .side-nav { position: sticky; top: 0; z-index: 2; flex-direction: row; gap: 4px; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .nav-item { flex: 1 0 auto; width: auto; padding: 9px 10px; font-size: 11px; white-space: nowrap; }
  .nav-symbol { display: none; }
  .nav-version { display: none; }
  .conversation-panel { min-height: calc(100vh - 172px); padding: 21px 16px 16px; }
  h2 { font-size: 22px; }
  .emergency-chip { font-size: 9px; }
  .scenario-strip { margin-top: 16px; }
  .scenario-button { padding: 8px 11px; font-size: 11px; }
  .chat-log { min-height: 390px; }
  .message, .answer-card { max-width: 100%; }
  .answer-card { margin-left: 0; }
  .message-body p { font-size: 13px; }
  .quick-start { align-items: flex-start; flex-direction: column; gap: 8px; }
  .action-row { grid-template-columns: 65px 1fr; }
  .ask-box { position: sticky; bottom: 0; padding: 12px 0 calc(16px + env(safe-area-inset-bottom)); background: var(--paper); }
  .ask-box input { padding: 12px; font-size: 12px; }
  .ask-box button { padding: 12px 14px; font-size: 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  .answer-card, .message { animation: rise-in 220ms ease-out both; }
  @keyframes rise-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
}
