:root {
  --navy: #172554;
  --navy-2: #243b75;
  --ink: #172033;
  --muted: #6b7280;
  --line: #e5e7eb;
  --surface: #ffffff;
  --bg: #f5f7fb;
  --soft-blue: #eff6ff;
  --soft-green: #ecfdf5;
  --soft-orange: #fff7ed;
  --soft-purple: #f5f3ff;
  --danger: #b91c1c;
  --shadow: 0 8px 24px rgba(23, 37, 84, .07);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.app-header { background: var(--navy); color: white; }
.header-inner { max-width: 1120px; margin: 0 auto; min-height: 72px; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { font-size: 12px; font-weight: 800; letter-spacing: .08em; border: 1px solid rgba(255,255,255,.35); padding: 9px 8px; border-radius: 9px; }
.brand strong { display: block; letter-spacing: .05em; font-size: 15px; }
.brand span { display: block; margin-top: 2px; font-size: 11px; opacity: .72; }
.header-date { font-size: 12px; opacity: .8; white-space: nowrap; }
.app-shell { max-width: 1120px; margin: 0 auto; padding: 28px 20px 110px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-heading h1 { margin: 0; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.02em; }
.page-heading p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.date-control { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.date-control label { font-size: 12px; color: var(--muted); }
.date-control input { width: 150px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 20px; }
.card h2, .card h3 { margin: 0; font-size: 17px; }
.card h3 { font-size: 14px; }
.card-intro { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 7px 0 16px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-title small { color: var(--muted); font-size: 11px; font-weight: 400; }
.eyebrow { margin: 0 0 6px; color: var(--navy-2); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.hero-card { background: linear-gradient(135deg, #172554, #294483); color: #fff; border: none; }
.hero-card .eyebrow, .hero-card .card-intro { color: rgba(255,255,255,.72); }
.hero-card .hero-title { margin: 0; max-width: 720px; font-size: clamp(21px, 4vw, 34px); line-height: 1.25; }
.hero-card .hero-sub { max-width: 680px; margin: 10px 0 0; line-height: 1.7; color: rgba(255,255,255,.82); font-size: 13px; }
.hero-actions { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.btn { border: 1px solid transparent; background: var(--navy); color: #fff; padding: 11px 15px; border-radius: 10px; font-weight: 700; font-size: 13px; transition: transform .15s, opacity .15s, background .15s; }
.btn:hover { opacity: .9; transform: translateY(-1px); }
.btn.secondary { background: #fff; border-color: var(--line); color: var(--navy); }
.hero-card .btn.secondary { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.22); color: #fff; }
.btn.ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn.danger { background: #fff; color: var(--danger); border-color: #fecaca; }
.btn.small { padding: 7px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
input, textarea, select { width: 100%; border: 1px solid #d1d5db; border-radius: 10px; color: var(--ink); background: #fff; padding: 10px 11px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(37, 59, 117, .12); }
textarea { min-height: 88px; resize: vertical; line-height: 1.6; }
label.field { display: block; font-size: 12px; font-weight: 700; margin: 0 0 14px; }
label.field > span { display: block; margin-bottom: 6px; }
label.field .hint { color: var(--muted); font-weight: 400; line-height: 1.5; margin-top: 4px; }
.required { color: var(--danger); margin-left: 3px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 16px; }
.saved-note { color: #047857; font-size: 12px; }
.status-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.status-options label { position: relative; }
.status-options input { position: absolute; opacity: 0; pointer-events: none; }
.status-options span { display: block; text-align: center; padding: 10px 6px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 12px; font-weight: 700; background: #fff; }
.status-options input:checked + span { border-color: var(--navy); color: var(--navy); background: var(--soft-blue); }
.status-options .status-done input:checked + span { border-color: #059669; color: #047857; background: var(--soft-green); }
.status-options .status-partial input:checked + span { border-color: #d97706; color: #b45309; background: var(--soft-orange); }
.status-options .status-not input:checked + span { border-color: #dc2626; color: #b91c1c; background: #fef2f2; }
.status-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; padding: 5px 8px; border-radius: 999px; font-weight: 900; font-size: 15px; }
.status-pill.good { background: var(--soft-green); color: #047857; }
.status-pill.mid { background: var(--soft-orange); color: #b45309; }
.status-pill.bad { background: #fef2f2; color: #b91c1c; }
.status-pill.pending { background: #f3f4f6; color: var(--muted); font-size: 12px; }
.metric-card { padding: 16px; }
.metric-label { color: var(--muted); font-size: 12px; }
.metric-value { margin-top: 7px; font-size: 26px; font-weight: 800; color: var(--navy); }
.metric-note { color: var(--muted); font-size: 11px; margin-top: 3px; }
.kpi-list { display: grid; gap: 10px; margin-top: 14px; }
.kpi-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 10px; font-size: 12px; }
.kpi-row .bar { height: 7px; background: #eef0f4; border-radius: 99px; overflow: hidden; }
.kpi-row .bar i { display: block; height: 100%; background: var(--navy-2); border-radius: 99px; }
.empty-state { padding: 22px 10px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.7; }
.info-box { padding: 13px 14px; border-radius: 10px; background: var(--soft-blue); color: #1e3a8a; font-size: 12px; line-height: 1.65; }
.warning-box { padding: 13px 14px; border-radius: 10px; background: var(--soft-orange); color: #92400e; font-size: 12px; line-height: 1.65; }
.review-item { border-top: 1px solid var(--line); padding-top: 17px; margin-top: 17px; }
.review-item:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.review-label { font-size: 12px; font-weight: 800; color: var(--navy-2); margin-bottom: 8px; }
.review-text { font-size: 13px; line-height: 1.75; white-space: pre-wrap; }
.axis-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.axis-box { border: 1px solid var(--line); border-left: 4px solid var(--navy-2); padding: 12px; border-radius: 10px; background: #fff; }
.axis-box.blue { border-left-color: #2563eb; }
.axis-box.purple { border-left-color: #7c3aed; }
.axis-box.green { border-left-color: #059669; }
.axis-box.orange { border-left-color: #ea580c; }
.axis-box h4 { margin: 0 0 7px; font-size: 12px; }
.axis-box p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.chat-log { display: grid; gap: 10px; max-height: 340px; overflow: auto; margin: 12px 0; }
.chat-bubble { max-width: 92%; padding: 10px 12px; border-radius: 12px; font-size: 12px; line-height: 1.65; white-space: pre-wrap; }
.chat-bubble.user { justify-self: end; color: #fff; background: var(--navy); }
.chat-bubble.assistant { justify-self: start; background: #f3f4f6; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { min-height: 58px; }
.chat-form .btn { flex: 0 0 auto; }
.history-list { display: grid; gap: 8px; }
.history-row { width: 100%; text-align: left; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; color: var(--ink); }
.history-row:hover { border-color: var(--navy-2); }
.history-row strong { font-size: 13px; }
.history-row small { color: var(--muted); font-size: 11px; }
.history-row .date { font-weight: 800; color: var(--navy); }
.tag { display: inline-flex; border-radius: 999px; background: #f3f4f6; color: #4b5563; padding: 4px 7px; font-size: 10px; margin: 2px; }
.setting-row { display: grid; grid-template-columns: 1fr 180px; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-title { font-weight: 700; font-size: 13px; }
.setting-desc { margin-top: 4px; color: var(--muted); line-height: 1.6; font-size: 11px; }
.switch { display: flex; justify-content: flex-end; align-items: center; gap: 8px; font-size: 12px; }
.switch input { width: auto; }
.footer-note { margin-top: 18px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.bottom-nav { position: fixed; z-index: 10; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; padding: 8px max(10px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.94); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
.bottom-nav button { width: min(25vw, 180px); border: 0; background: transparent; color: var(--muted); padding: 5px 6px; border-radius: 9px; font-size: 10px; }
.bottom-nav button span { display: block; font-size: 19px; line-height: 1.25; margin-bottom: 2px; }
.bottom-nav button.active { color: var(--navy); background: var(--soft-blue); font-weight: 800; }
.toast-region { position: fixed; z-index: 30; top: 84px; right: 18px; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); }
.toast { background: var(--navy); color: #fff; border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow); font-size: 12px; line-height: 1.5; }
@media (max-width: 760px) {
  .app-shell { padding: 22px 13px 104px; }
  .header-inner { padding-inline: 13px; }
  .header-date { display: none; }
  .page-heading { display: block; }
  .date-control { margin-top: 13px; justify-content: flex-start; }
  .date-control input { flex: 1; max-width: 180px; }
  .grid-2, .grid-3, .axis-grid { grid-template-columns: 1fr; }
  .card { padding: 16px; border-radius: 13px; }
  .kpi-row { grid-template-columns: 112px 1fr auto; }
  .setting-row { grid-template-columns: 1fr; gap: 10px; }
  .switch { justify-content: flex-start; }
  .history-row { grid-template-columns: 1fr auto; }
  .history-row small { grid-column: 1 / -1; }
}
