:root {
  color-scheme: light;
  --ink: #221d1d;
  --muted: #57585d;
  --surface: #fff;
  --ground: #f6f7f8;
  --line: #dedee4;
  --red: #c60010;
  --focus: #1c5cc5;
  --nav: 228px;
  --detail: 340px;
  font: 16px/1.65 "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--ground);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button, input, select, textarea { min-height: 44px; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1 { font-size: clamp(1.8rem, 4vw, 2.55rem); font-weight: 740; line-height: 1.25; }
h2 { font-size: 1.18rem; line-height: 1.45; }
small { color: var(--muted); }
label { display: block; font-weight: 620; }
input, select, textarea { width: 100%; border: 1px solid #77787f; border-radius: 7px; background: white; padding: 8px 12px; }
textarea { resize: vertical; }
.topbar { min-height: 66px; display: flex; align-items: center; gap: 16px; padding: 9px clamp(16px, 3vw, 36px); background: white; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; font-size: 1.1rem; }
.top-label { color: var(--muted); font-size: .86rem; padding-left: 15px; border-left: 1px solid var(--line); }
.account { margin-left: auto; display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: .88rem; flex-wrap: wrap; }
.quiet, .primary, .panel-heading { border-radius: 8px; border: 1px solid transparent; padding: 7px 14px; font-weight: 650; }
.quiet { background: white; border-color: #aaaab2; }
.quiet:hover { background: var(--ground); }
.primary { color: white; background: var(--red); white-space: nowrap; }
.primary:hover { background: #a5000e; }
.intro { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 24px; }
.intro-card { width: min(100%, 430px); padding: 40px; border: 1px solid var(--line); border-top: 4px solid var(--red); background: var(--surface); border-radius: 16px; }
.intro-card h1 { margin-top: 8px; }
.intro-card p { color: var(--muted); margin: 10px 0 24px; }
.intro-card label { margin-bottom: 6px; }
.intro-card .primary { margin-top: 16px; width: 100%; }
.workspace { display: grid; grid-template-columns: var(--nav) minmax(0, 1fr); min-height: calc(100vh - 66px); }
.navigation { position: relative; min-width: 0; background: white; border-right: 1px solid var(--line); padding: 18px 14px; }
.panel-heading { width: 100%; text-align: left; background: transparent; padding-left: 8px; }
.panel-heading span { float: right; }
summary { cursor: pointer; padding: 10px 8px; min-height: 44px; color: var(--muted); font-weight: 600; }
.services { display: grid; gap: 6px; }
.services button { text-align: left; border: 1px solid transparent; border-radius: 8px; background: white; padding: 7px 12px; }
.services button[aria-pressed="true"] { color: #90000b; background: #fbecee; font-weight: 700; border-color: #f4cbd2; }
.setup { margin: 18px 4px; text-align: left; font-size: .88rem; }
.main { min-width: 0; padding: clamp(16px, 3vw, 44px); }
.section-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 22px; }
.service-label { color: var(--muted); font-weight: 600; margin-bottom: 5px; }
.board { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.board.with-detail { grid-template-columns: minmax(0, 1fr) minmax(0, var(--detail)); }
.list-panel, .detail { background: white; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.list-toolbar { padding: 16px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; border-bottom: 1px solid var(--line); }
.search { display: flex; align-items: center; gap: 8px; max-width: 100%; color: var(--muted); font-size: .88rem; flex-wrap: wrap; }
.search input { width: 150px; }
.cases, .history ol { list-style: none; padding: 0; margin: 0; }
.cases li + li { border-top: 1px solid var(--line); }
.case-row { width: 100%; text-align: left; padding: 14px 18px; background: white; border: 0; display: grid; gap: 4px; min-width: 0; }
.case-row:hover, .case-row[aria-current="true"] { background: #f5f7ff; }
.case-row[aria-current="true"] { box-shadow: inset 3px 0 var(--focus); }
.case-row strong, .detail dd, .detail h2 { overflow-wrap: anywhere; }
.row-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; color: var(--muted); font-size: .84rem; }
.case-status { color: #38527e; font-size: .84rem; font-weight: 690; }
.case-next { color: var(--muted); overflow-wrap: anywhere; }
.empty { color: var(--muted); padding: 24px 18px; }
.detail { position: relative; padding: 10px 14px 18px; }
.detail h2 { margin-top: 4px; }
#detail-content { padding: 10px 8px 0; }
.facts { margin: 16px 0; }
.facts > div { padding: 8px 0; }
.facts dt { color: var(--muted); font-size: .85rem; }
.facts dd { margin: 0; }
.history { border-top: 1px solid var(--line); margin-top: 16px; }
.history li { padding: 8px 0; border-top: 1px solid var(--line); }
.history li small { display: block; }
.divider { position: absolute; display: grid; align-items: center; justify-content: center; width: 18px; height: 100%; top: 0; right: -9px; cursor: col-resize; touch-action: none; z-index: 1; }
.divider::before { content: ''; width: 3px; height: 42px; background: #9297a2; border-radius: 4px; }
.detail .divider { left: -9px; right: auto; }
.nav-folded { --nav: 128px; }
.detail-folded { --detail: 128px; }
dialog { width: min(490px, calc(100% - 28px)); max-height: calc(100vh - 28px); border: 1px solid var(--line); border-radius: 16px; padding: 22px; color: var(--ink); }
dialog::backdrop { background: #16172488; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 11px; }
.dialog-header .quiet { font-size: 1.33rem; min-width: 44px; padding: 1px 8px; }
#case-form label { margin: 10px 0 3px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 17px; }
.voice { display: flex; align-items: center; gap: 10px; margin-top: 7px; color: var(--muted); font-size: .88rem; }
.feedback:not(:empty) { position: fixed; bottom: 16px; right: 16px; max-width: calc(100% - 32px); padding: 10px 14px; border-radius: 7px; color: white; background: var(--ink); z-index: 2; }
.error { display: grid; gap: 3px; padding: 12px; margin-top: 10px; border: 1px solid var(--red); border-radius: 8px; background: #fff6f6; overflow-wrap: anywhere; }
.error strong { color: #9a000d; }
.global-error { position: fixed; right: 16px; bottom: 65px; width: min(400px, calc(100% - 32px)); z-index: 3; }
@media (max-width: 1020px) {
  .board.with-detail { grid-template-columns: minmax(0, 1fr); }
  .detail { max-height: var(--detail); overflow: auto; padding-bottom: 24px; }
  .detail .divider { position: sticky; bottom: 0; top: auto; width: 100%; height: 18px; cursor: row-resize; }
  .detail .divider::before { width: 42px; height: 3px; }
}
@media (max-width: 700px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .navigation { border-right: none; border-bottom: 1px solid var(--line); max-height: var(--nav); overflow: auto; padding: 8px 16px 20px; }
  .navigation .divider { position: sticky; bottom: 0; top: auto; width: 100%; height: 18px; cursor: row-resize; }
  .navigation .divider::before { width: 42px; height: 3px; }
  .topbar { flex-wrap: wrap; }
  .section-title { align-items: flex-start; }
  .intro-card { padding: 25px; }
}

