:root {
  color-scheme: light;
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  color: #242239;
  background: #f4f5fa;
  --ink: #242239;
  --muted: #625e75;
  --line: #e8e6f0;
  --paper: #fff;
  --canvas: #f4f5fa;
  --accent: #7c6cf2;
  --purple: #5040bd;
  --lavender: #efedff;
  --green: #2f6b57;
  --green-pale: #e8f4ed;
  --danger: #ab2550;
  --shadow: 0 1px 2px #2d25450a, 0 4px 18px #2d254506;
  --topbar: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
body:has(dialog[open]) { overflow: hidden; }
body, button, input, select, textarea { font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 1px; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
svg { display: block; flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.topbar {
  position: sticky; z-index: 2; top: 0; min-height: var(--topbar);
  display: flex; align-items: center; gap: 15px; padding: 10px 26px;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark, .login-mark { display: grid; place-items: center; flex: none; color: var(--purple); background: var(--lavender); border: 1px solid #e4defe; border-radius: 12px; width: 40px; height: 40px; }
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { display: flex; align-items: center; flex-wrap: wrap; column-gap: 3px; font-size: 16px; font-weight: 800; letter-spacing: .01em; }
.brand-divider { color: #8a819e; }
.brand-ai, .preview-badge { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.brand-ai { background: var(--green-pale); color: var(--green); }
.brand-ai svg { width: 14px; height: 14px; }
.preview-badge { margin-left: auto; background: #f1eefc; color: var(--purple); }

.login-screen { display: grid; min-height: calc(100dvh - var(--topbar)); place-items: center; padding: 28px 16px 68px; }
.login-card { width: min(100%, 400px); padding: 35px; background: var(--paper); border: 1px solid #e4e0ee; border-radius: 22px; box-shadow: 0 15px 50px #33236a13; }
.login-mark { width: 50px; height: 50px; margin-bottom: 16px; }
.login-mark svg { width: 25px; height: 25px; }
.login-card h1 { margin-bottom: 26px; font-size: 26px; letter-spacing: -.025em; }
.login-card label, .field-label { display: block; margin-bottom: 7px; font-weight: 750; }
.login-card input, .staff-form select, .staff-form textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; background: var(--paper);
  border: 1px solid #d8d5e4; border-radius: 9px;
}
.login-card input[aria-invalid="true"] { border-color: var(--danger); }
.form-error { margin-top: 8px; color: var(--danger); font-size: 13px; }
.login-submit { width: 100%; margin-top: 18px; }

.button, .icon-button {
  display: inline-flex; min-height: 44px; align-items: center; justify-content: center;
  gap: 8px; padding: 8px 14px; border: 1px solid transparent; border-radius: 9px; font-weight: 750;
}
.button svg { width: 17px; height: 17px; }
.primary { color: #fff; background: #5c4ad0; box-shadow: 0 2px 4px #5840bf26; }
.primary:hover:not(:disabled) { background: #4f3bc4; }
.secondary, .icon-button { border-color: var(--line); background: var(--paper); color: var(--ink); }
.secondary:hover:not(:disabled), .icon-button:hover { background: var(--lavender); color: var(--purple); }
.icon-button { width: 44px; padding: 0; flex: none; }

.workspace { display: grid; grid-template-columns: 204px minmax(0, 1fr); min-height: calc(100dvh - var(--topbar)); }
.sidebar {
  display: flex; flex-direction: column; gap: 12px; position: sticky; top: var(--topbar);
  height: calc(100dvh - var(--topbar)); padding: 24px 15px 15px; background: var(--paper);
  border-right: 1px solid var(--line); overflow: auto;
}
.sidebar-nav { display: grid; gap: 6px; }
.nav-button {
  min-width: 44px; min-height: 46px; display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border: 1px solid transparent; border-radius: 9px; background: transparent;
  color: var(--muted); text-align: left; font-weight: 700; white-space: nowrap;
}
.nav-button:hover { background: #f6f4fb; color: var(--purple); }
.nav-button[aria-current="page"] { color: var(--purple); background: var(--lavender); border-color: #e6e0fe; }
.logout { margin-top: auto; }
.main-content { width: 100%; max-width: 1580px; min-width: 0; margin: 0 auto; padding: 33px clamp(22px, 3.1vw, 50px) 38px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 23px; }
.page-heading h1 { font-size: clamp(26px, 2.7vw, 36px); line-height: 1.25; font-weight: 800; letter-spacing: -.035em; }
.page-heading p { margin-top: 7px; color: var(--muted); }
.date-label { display: inline-flex; align-items: center; gap: 7px; flex: none; font-size: 13px; }
.date-label svg { width: 16px; height: 16px; }

.metrics { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; }
.metric {
  display: flex; align-items: flex-start; gap: 11px; min-width: 0; padding: 17px 15px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow);
}
.metric-icon { display: grid; place-items: center; flex: none; width: 37px; height: 37px; color: var(--purple); background: var(--lavender); border-radius: 10px; }
.metric-ai .metric-icon { color: var(--green); background: var(--green-pale); }
.metric-review .metric-icon { color: #82501a; background: #fff0d9; }
.metric-time .metric-icon { color: #554d77; background: #eeebf5; }
.metric h2 { color: var(--muted); font-size: 12px; line-height: 1.45; font-weight: 700; }
.metric-value { display: flex; align-items: baseline; gap: 4px; margin-top: 4px; font-size: 29px; line-height: 1.08; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.metric-value small { color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: normal; }
.metric-value .skeleton { width: 46px; height: 26px; }

.surface { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.surface-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; padding: 12px 18px; }
.surface-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.surface-title h2 { font-size: 18px; letter-spacing: -.02em; }
.result-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.search-field {
  display: flex; align-items: center; gap: 8px; width: min(100%, 286px); min-height: 44px;
  padding: 0 11px; border: 1px solid #ddd9e8; border-radius: 9px; color: var(--muted); background: #fcfbfe;
}
.search-field:has(:focus-visible) { outline: 2px solid var(--purple); outline-offset: 2px; }
.search-field svg { width: 17px; height: 17px; pointer-events: none; }
.search-field input { width: 100%; min-width: 0; min-height: 44px; padding: 0; border: 0; background: transparent; font-size: 13px; outline: none; }
input[type="search"]::-webkit-search-cancel-button { appearance: none; }
::placeholder { color: #6c6680; }
.filter-bar { padding: 0 18px 13px; }
.segments { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px; max-width: 100%; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: #f6f5fa; }
.segments button { min-width: 44px; min-height: 44px; padding: 5px 11px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.segments button:hover { color: var(--purple); background: #f0edfe; }
.segments button[aria-pressed="true"] { color: var(--purple); background: var(--paper); border-color: #e4def9; box-shadow: 0 1px 4px #37207b10; }

.case-columns, .case-row {
  display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(65px, .83fr) minmax(72px, 1.25fr) 67px 114px 18px;
  gap: 12px; align-items: center; width: 100%; padding-inline: 18px;
}
.case-columns { min-height: 37px; border-block: 1px solid var(--line); color: var(--muted); background: #f8f7fc; font-size: 12px; font-weight: 750; }
.case-list { list-style: none; padding: 0; }
.case-list > li + li { border-top: 1px solid var(--line); }
.case-list > li:last-child .case-row { border-radius: 0 0 15px 15px; }
.case-row { min-height: 83px; padding-block: 10px; border: 0; background: transparent; text-align: left; }
.case-row:hover, .case-row[aria-expanded="true"] { background: #f8f6ff; }
.case-row:focus-visible { outline-offset: -3px; }
.case-main { min-width: 0; display: flex; align-items: center; gap: 11px; }
.case-thumb, .event-thumb, .photo-empty {
  display: grid; place-items: center; flex: none; overflow: hidden; background: #eeecf5; color: #6e6785;
}
.case-thumb { position: relative; width: 53px; height: 50px; border-radius: 8px; }
.case-thumb img, .event-thumb img { width: 100%; height: 100%; object-fit: cover; }
.case-copy { display: grid; min-width: 0; gap: 2px; }
.case-subject, .case-item, .case-place, .case-unit, .case-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-subject { font-size: 14px; font-weight: 800; }
.case-item, .case-meta, .case-unit, .case-place { color: var(--muted); font-size: 12px; }
.case-meta { display: flex; flex-wrap: wrap; column-gap: 7px; font-size: 11px; font-variant-numeric: tabular-nums; }
.case-meta time { white-space: nowrap; }
.case-id { color: var(--purple); font-weight: 700; }
.case-arrow { justify-self: end; color: #81769b; width: 17px; height: 17px; }
.pill { display: inline-flex; align-items: center; justify-content: center; justify-self: start; gap: 5px; padding: 4px 7px; border-radius: 7px; font-size: 11px; font-weight: 800; line-height: 1.4; white-space: nowrap; }
.status-pill::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; }
.status-new { color: #5340bd; background: #eee9ff; }
.status-processing { color: #805019; background: #fff2d7; }
.status-closed, .tone-neutral { color: #555269; background: #efedf4; }
.ai-1 { color: var(--green); background: var(--green-pale); }
.ai-2 { color: #715307; background: #fff3c8; }
.ai-3 { color: #9a451b; background: #ffeadb; }
.tone-error { color: var(--danger); background: #fbeaf0; }

.empty-state { display: grid; justify-items: center; gap: 9px; padding: 35px 18px 42px; text-align: center; border-top: 1px solid var(--line); }
.empty-state img { width: min(156px, 100%); height: 100px; object-fit: contain; }
.empty-state > svg { width: 35px; height: 35px; color: var(--purple); margin-bottom: 4px; }
.empty-state h3 { font-size: 16px; }
.empty-state p { color: var(--muted); max-width: 35ch; }
.empty-state .button { margin-top: 4px; }
.skeleton { display: block; height: 15px; border-radius: 6px; background: #eeebf5; }
.skeleton-stack { display: grid; gap: 12px; }
.login-loading .skeleton { height: 45px; }
.login-loading .skeleton-short { width: 32%; height: 15px; }
.list-skeleton { padding: 0 18px; }
.skeleton-row { display: grid; grid-template-columns: 53px minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 15px; padding: 12px 0; align-items: center; min-height: 72px; border-top: 1px solid var(--line); }
.skeleton-row > :first-child { height: 45px; }
.skeleton-row > :last-child { width: 75%; }

.events-scroll { overflow: auto; border-radius: 0 0 15px 15px; }
.events-scroll:focus-visible { outline-offset: -3px; }
.event-table { width: 100%; min-width: 830px; border-collapse: collapse; text-align: left; }
.event-table th, .event-table td { padding: 8px 11px; border-top: 1px solid var(--line); vertical-align: middle; }
.event-table th:first-child, .event-table td:first-child { padding-left: 18px; }
.event-table th:last-child, .event-table td:last-child { padding-right: 18px; }
.event-table th { background: #f8f7fc; color: var(--muted); white-space: nowrap; font-size: 12px; }
.event-table td { font-size: 13px; }
.event-table td:nth-child(2), .event-table td:nth-child(6) { white-space: nowrap; }
.event-table time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.event-table .pill { margin-block: 2px; }
.event-case { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; border: 0; padding: 3px; background: transparent; text-align: left; }
.event-case:hover { text-decoration: underline; }
.event-item { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.event-thumb { position: relative; width: 50px; height: 44px; padding: 0; border: 0; border-radius: 6px; }
.event-thumb:hover { box-shadow: 0 0 0 2px var(--accent); }

dialog { color: var(--ink); }
dialog::backdrop { background: #211a3b57; }
.detail-dialog {
  position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; width: min(680px, 92vw);
  height: 100dvh; max-height: none; max-width: none; border: 0; border-left: 1px solid var(--line);
  background: #f8f7fc; box-shadow: -12px 0 55px #1c123126; overflow: hidden;
}
.detail-dialog[open] { display: flex; flex-direction: column; }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 16px 23px; border-bottom: 1px solid var(--line); background: var(--paper); }
.detail-id { margin-bottom: 3px; color: var(--purple); font-weight: 800; font-size: 12px; overflow-wrap: anywhere; }
.detail-id:empty { display: none; }
.detail-header h2 { font-size: clamp(20px, 2.2vw, 25px); line-height: 1.35; letter-spacing: -.025em; overflow-wrap: anywhere; }
.detail-body { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 18px 23px 31px; display: grid; align-content: start; gap: 14px; }
.detail-intro { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 12px; }
.detail-intro time { margin-right: auto; font-variant-numeric: tabular-nums; }
.detail-section { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.section-heading h3 { font-size: 16px; letter-spacing: -.02em; }
.section-heading svg { width: 18px; height: 18px; color: var(--purple); }
.ai-section { background: #f2f8f4; border-color: #d7e8de; }
.ai-section .section-heading h3, .ai-section .section-heading svg { color: var(--green); }
.ai-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 12px; }
.ai-tier { color: var(--green); font-weight: 750; font-size: 12px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 15px; }
.field-grid .wide-field { grid-column: 1 / -1; }
.field-grid dt { margin-bottom: 3px; color: var(--muted); font-size: 12px; font-weight: 750; }
.field-grid dd { overflow-wrap: anywhere; white-space: pre-wrap; }
.edited-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 12px; padding: 0; margin-top: 5px; list-style: none; }
.edited-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.map-link { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; gap: 5px; margin-top: 3px; color: var(--purple); font-weight: 750; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.map-link svg { width: 16px; height: 16px; }
.photo-button { position: relative; display: block; overflow: hidden; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 10px; background: #eeecf5; }
.photo-button:hover { box-shadow: 0 0 0 2px var(--accent); }
.photo-button img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero-photo { width: 100%; height: clamp(160px, 27vh, 270px); }
.thumb-expand { position: absolute; bottom: 8px; right: 8px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; color: #fff; background: #211d34c9; }
.thumb-expand svg { width: 17px; height: 17px; }
.photos-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-photo + .photos-grid, .photo-empty + .photos-grid { margin-top: 9px; }
.attachment-photo { width: 82px; height: 63px; }
.photo-empty { gap: 5px; min-height: 82px; padding: 9px; border-radius: 10px; font-size: 12px; }
.photo-missing img { display: none; }
.photo-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.staff-form fieldset { display: grid; gap: 13px; min-width: 0; margin: 0; padding: 0; border: 0; }
.staff-form textarea { min-height: 90px; resize: vertical; }
.staff-actions { display: flex; justify-content: flex-end; }
.staff-actions button { min-width: 94px; }
.timeline { padding: 0; list-style: none; }
.timeline li { position: relative; padding: 0 0 14px 20px; overflow-wrap: anywhere; }
.timeline li::before { content: ""; position: absolute; top: 6px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent); }
.timeline li:not(:last-child)::after { content: ""; position: absolute; top: 16px; bottom: 0; left: 4px; width: 1px; background: #e0daf1; }
.timeline li:last-child { padding-bottom: 0; }
.timeline-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 9px; font-weight: 750; }
.timeline time { color: var(--muted); font-size: 12px; font-weight: 500; }
.timeline p { margin-top: 3px; white-space: pre-wrap; }
.detail-placeholder { color: var(--muted); }
.detail-skeleton .skeleton:first-child { height: 172px; }
.detail-skeleton .skeleton:nth-child(2) { width: 63%; }
.detail-skeleton .skeleton:nth-child(3) { height: 100px; }
.detail-body .empty-state { border-top: 0; }

.lightbox { width: min(900px, calc(100vw - 30px)); max-width: none; max-height: calc(100dvh - 30px); padding: 0; border: 1px solid #302a41; border-radius: 13px; background: #201d2c; color: #fff; }
.lightbox::backdrop { background: #181426c9; }
.lightbox-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 11px 7px 16px; }
.lightbox-header h2 { font-size: 15px; }
.lightbox-media img { width: 100%; max-height: calc(100dvh - 100px); display: block; object-fit: contain; }
.lightbox-media p { text-align: center; padding: 30px; }
.toast {
  position: fixed; z-index: 4; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); display: flex; align-items: center;
  gap: 9px; max-width: calc(100vw - 36px); padding: 12px 15px; border-radius: 11px;
  color: var(--ink); background: var(--paper); border: 1px solid #ded8ef; box-shadow: 0 7px 30px #25305024;
}
.toast:empty { display: none; }
.toast svg { color: var(--purple); }
.toast.toast-error svg { color: var(--danger); }

@media (max-width: 1050px) {
  .workspace { grid-template-columns: 156px minmax(0, 1fr); }
  .sidebar { padding-inline: 10px; }
  .metric { padding-inline: 11px; gap: 8px; }
  .metric-icon { width: 33px; height: 33px; }
  .case-columns, .case-row { gap: 8px; padding-inline: 12px; }
  .case-thumb { width: 44px; height: 44px; }
  .case-main { gap: 7px; }
}

@media (max-width: 760px) {
  :root { --topbar: 66px; }
  .topbar { gap: 7px 10px; padding: 8px 13px; flex-wrap: wrap; position: relative; }
  .brand { gap: 8px; }
  .brand-mark { width: 35px; height: 35px; border-radius: 10px; }
  .brand-mark svg { width: 21px; height: 21px; }
  .brand-name { font-size: 13px; }
  .brand-ai, .preview-badge { font-size: 10px; padding: 3px 6px; }
  .workspace { display: block; }
  .sidebar { height: auto; position: sticky; z-index: 1; top: 0; flex-direction: row; align-items: center; justify-content: space-between; gap: 6px; padding: 5px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-nav { display: flex; gap: 3px; }
  .nav-button { min-height: 44px; gap: 5px; padding: 5px 8px; font-size: 13px; }
  .nav-button svg { width: 16px; height: 16px; }
  .logout { margin-top: 0; }
  .main-content { padding: 21px 12px 28px; }
  .page-heading { margin-bottom: 16px; align-items: flex-start; gap: 8px; }
  .page-heading p { font-size: 13px; }
  .page-heading .date-label { display: none; }
  .page-heading > .button { flex: none; padding-inline: 8px; font-size: 12px; }
  .metrics { grid-template-columns: minmax(0, 1fr); gap: 7px; margin-bottom: 16px; }
  .metric { align-items: center; gap: 10px; padding: 8px 11px; border-radius: 10px; }
  .metric > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; flex: 1; }
  .metric-value { margin-top: 0; font-size: 23px; }
  .metric-value .skeleton { height: 23px; }
  .surface-heading { min-height: 56px; padding: 10px 11px; }
  #cases-view .surface-heading { align-items: stretch; flex-direction: column; gap: 8px; }
  .search-field { width: 100%; }
  .filter-bar { padding: 0 10px 10px; }
  .segments { gap: 2px; }
  .segments button { padding-inline: 8px; font-size: 12px; }
  .case-columns { display: none; }
  .case-list { border-top: 1px solid var(--line); }
  .case-row { grid-template-columns: minmax(0, 1fr) max-content 16px; min-height: 97px; gap: 4px 7px; padding: 9px 10px; }
  .case-main { grid-column: 1 / 3; }
  .case-arrow { grid-column: 3; grid-row: 1 / 4; }
  .case-unit { grid-column: 1; grid-row: 2; }
  .case-place { grid-column: 1; grid-row: 3; }
  .case-unit, .case-place { padding-left: 51px; font-size: 11px; }
  .case-row .status-pill { grid-column: 2; grid-row: 2; }
  .case-row .ai-pill { grid-column: 2; grid-row: 3; }
  .detail-dialog { width: 100vw; border: 0; }
  .detail-header { padding: 13px 12px; }
  .detail-body { padding: 11px 10px 24px; gap: 10px; }
  .detail-section { padding: 13px; }
  .events-scroll { overscroll-behavior-inline: contain; }
  .skeleton-row { grid-template-columns: 45px minmax(0, 1.5fr) minmax(0, 1fr); }
  .skeleton-row > :nth-child(n+4) { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .button, .icon-button, .nav-button, .case-row, .segments button { transition: color .16s, background-color .16s, border-color .16s, box-shadow .16s; }
  .skeleton { animation: skeleton-pulse 1.45s ease-in-out infinite alternate; }
  .login-shake { animation: field-shake .28s ease-in-out; }
  .toast:not(:empty) { animation: toast-in .22s ease-out both; }
  .detail-dialog {
    opacity: 0; transform: translateX(20px);
    transition: opacity .23s, transform .23s, overlay .23s allow-discrete, display .23s allow-discrete;
  }
  .detail-dialog[open] { opacity: 1; transform: translateX(0); }
  @starting-style { .detail-dialog[open] { opacity: 0; transform: translateX(20px); } }
  .lightbox[open] { animation: toast-in .18s ease-out both; }
  @keyframes skeleton-pulse { to { opacity: .5; } }
  @keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }
  @keyframes field-shake { 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
}
