:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-border: #bfdbfe;
  --text: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --surface: #ffffff;
  --background: #f8fafc;
  --sidebar-bg: #f8fafc;
  --sidebar-text: #334155;
  --sidebar-active: #ffffff;
  --sidebar-active-text: #0f172a;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;
  --success: #10b981;
  --success-soft: #ecfdf5;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --sidebar-width: 240px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--background);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 15px; line-height: 1.6; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
button { touch-action: manipulation; }
button:disabled, select:disabled { cursor: not-allowed; }
button:disabled { opacity: .5; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 26px; line-height: 1.3; letter-spacing: -0.025em; margin-bottom: 8px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 600; line-height: 1.5; margin-bottom: 0; }
h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
p { margin-bottom: 12px; }
strong, b { font-weight: 600; }
.muted { color: var(--text-secondary); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 100; background: white; padding: 12px 20px; border: 2px solid var(--primary); border-radius: var(--radius); }
.skip-link:focus { top: 12px; }

.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); padding: 24px 16px; background: var(--sidebar-bg); color: var(--sidebar-text); display: flex; flex-direction: column; z-index: 20; border-right: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; color: var(--text); }
.brand strong { display: block; font-size: 18px; letter-spacing: -0.01em; font-weight: 600; }
.brand small { display: block; color: var(--text-muted); font-size: 11px; margin-top: 2px; }
.brand-mark { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.brand-mark svg { width: 100%; height: 100%; }
.nav-label { color: var(--text-muted); font-size: 11px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; padding: 16px 12px 8px; }
.main-nav { display: flex; flex-direction: column; gap: 4px; }
.main-nav a { color: var(--text-secondary); padding: 10px 12px; border-radius: var(--radius-sm); display: flex; align-items: center; gap: 12px; transition: all 0.15s ease; font-size: 14px; font-weight: 500; }
.main-nav a:hover { background: var(--border-light); color: var(--text); }
.main-nav a[aria-current="page"] { background: var(--sidebar-active); color: var(--sidebar-active-text); box-shadow: var(--shadow-sm); font-weight: 600; }
.nav-unfinished-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--danger); margin-left: auto; }
.nav-symbol { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 400; line-height: 1; flex-shrink: 0; color: var(--text-secondary); }
.main-nav a[aria-current="page"] .nav-symbol { color: var(--primary); }
.chart-symbol { align-items: flex-end; gap: 2px; padding: 2px 0; }
.chart-symbol i { display: block; width: 3px; height: 6px; background: currentColor; border-radius: 1px; }
.chart-symbol i:nth-child(2) { height: 12px; }
.chart-symbol i:nth-child(3) { height: 9px; }
.settings-symbol { width: 16px; height: 16px; border: 1.5px solid currentColor; border-radius: 4px; position: relative; }
.settings-symbol::after { content: ""; width: 4px; height: 4px; border: 1.5px solid currentColor; border-radius: 50%; }
.sidebar-note { margin-top: auto; padding-top: 20px; font-size: 12px; border-top: 1px solid var(--border); }
.sidebar-note strong { color: var(--text); font-size: 12px; }
.sidebar-note p { color: var(--text-muted); margin: 8px 0 12px; font-size: 11px; line-height: 1.6; }
.local-indicator { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--success); margin-right: 8px; vertical-align: 2px; }
.integration-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.integration-tags span { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px 8px; color: var(--text-muted); font-size: 10px; background: var(--surface); }

.app-shell { margin-left: var(--sidebar-width); min-height: 100vh; }
.topbar { min-height: 64px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 12px 24px; gap: 12px 20px; }
.workspace-name { color: var(--text-muted); font-size: 13px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.workspace-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.workspace-divider { color: var(--border); margin: 0 2px; }
#header-view-name { color: var(--text); font-weight: 500; }
.identity-area { display: flex; align-items: center; gap: 12px; min-width: 0; }
.identity-current { display: flex; flex-direction: column; text-align: right; min-width: 60px; }
.identity-current strong { color: var(--text); font-size: 13px; font-weight: 500; }
.identity-current > span { color: var(--text-muted); font-size: 11px; }
main { max-width: 1400px; margin: 0 auto; padding: 24px; min-height: calc(100vh - 100px); }
main:focus { outline: none; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.page-heading p { color: var(--text-secondary); font-size: 14px; margin: 0; }
.eyebrow { display: block; color: var(--primary); font-size: 12px; font-weight: 600; margin-bottom: 6px; letter-spacing: 0; }
.heading-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.button { min-height: 36px; border-radius: var(--radius-sm); padding: 8px 16px; border: 1px solid transparent; font-size: 13px; font-weight: 500; line-height: 1.4; display: inline-flex; justify-content: center; align-items: center; gap: 6px; white-space: nowrap; transition: all 0.15s ease; }
.button-primary { background: var(--primary); color: white; border-color: var(--primary); }
.button-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.button-secondary { background: var(--surface); color: var(--text-secondary); border-color: var(--border); }
.button-secondary:hover:not(:disabled) { background: var(--border-light); border-color: var(--border); }
.button-quiet { background: transparent; color: var(--text-muted); }
.button-quiet:hover:not(:disabled) { background: var(--border-light); color: var(--text); }
.button-danger { background: var(--danger); color: white; border-color: var(--danger); }
.button-danger:hover:not(:disabled) { background: #dc2626; }
.button-danger-soft { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-border); }
.button-danger-soft:hover:not(:disabled) { background: #fee2e2; }
.button-small { min-height: 32px; padding: 6px 12px; font-size: 12px; }
.text-button { padding: 4px 0; border: 0; background: none; color: var(--primary); font-size: 13px; font-weight: 500; min-height: 28px; white-space: nowrap; }
.text-button:hover { text-decoration: underline; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.summary-label { display: block; font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; font-weight: 500; }
.summary-value { display: block; font-size: 30px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; margin-bottom: 4px; font-variant-numeric: tabular-nums; color: var(--text); }
.summary-note { display: block; color: var(--text-muted); font-size: 13px; }
.scope-note { color: var(--text-muted); font-size: 12px; margin: 12px 0 20px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; box-shadow: var(--shadow-sm); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--border-light); }
.panel-heading .muted { margin: 4px 0 0; font-size: 12px; }
.panel-caption { color: var(--text-secondary); font-size: 12px; text-align: right; }
.title-with-count { display: flex; align-items: center; gap: 10px; }
.count-label { font-size: 12px; background: var(--border-light); color: var(--text); padding: 2px 8px; border-radius: var(--radius-sm); font-variant-numeric: tabular-nums; font-weight: 500; }
.panel-description { color: var(--text-secondary); font-size: 13px; margin: 12px 20px; }
.filter-bar { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: var(--surface); border-bottom: 1px solid var(--border-light); }
.search-field { flex: 1; max-width: 360px; }
.search-field input { background: var(--background); padding-left: 12px; min-height: 36px; font-size: 13px; }
.filter-select { display: flex; gap: 8px; align-items: center; }
.filter-select label { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.filter-select select { min-height: 36px; min-width: 120px; font-size: 13px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 14px; }
.data-table thead { background: var(--background); }
.data-table th { padding: 12px 16px; color: var(--text-secondary); font-weight: 600; font-size: 13px; border-bottom: 2px solid var(--border); white-space: nowrap; }
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border-light); vertical-align: middle; color: var(--text); }
.data-table th:first-child, .data-table td:first-child { padding-left: 20px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 20px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--border-light); }
.task-table { min-width: 720px; }
.task-table td:first-child { width: 35%; min-width: 200px; }
.task-title-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.task-id { color: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.task-title-button { border: 0; padding: 0; text-align: left; color: var(--text); background: transparent; line-height: 1.5; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; max-width: 100%; }
.task-title-button:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.person-cell { display: flex; flex-direction: column; gap: 2px; min-width: 60px; }
.person-cell strong { font-weight: 500; color: var(--text); }
.person-cell small { font-size: 11px; color: var(--text-muted); }
.level-label { font-size: 12px; white-space: nowrap; }
.date-cell { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.date-cell-inner { display: flex; flex-direction: column; gap: 2px; }
.remaining-normal { color: var(--text-muted); font-size: 11px; }
.remaining-urgent { color: var(--warning); font-size: 11px; font-weight: 500; }
.remaining-overdue { color: var(--danger); font-size: 11px; font-weight: 600; }
.align-right { text-align: right; }
.tag { font-size: 12px; padding: 4px 10px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; line-height: 1.5; font-weight: 500; }
.tag[class*="status-"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag-neutral, .status-draft, .status-cancelled, .status-unknown { background: var(--border-light); color: var(--text); }
.status-pending, .status-cancel_pending { background: #fff7ed; color: #9a3412; }
.status-assigned { background: #eff6ff; color: #1d4ed8; }
.status-in_progress { background: #f0f9ff; color: #0369a1; }
.status-awaiting_confirmation { background: #faf5ff; color: #6d28d9; }
.status-confirmed { background: #ecfdf5; color: #047857; }
.table-footer { display: flex; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.workflow-strip { display: flex; align-items: center; justify-content: center; gap: 16px; color: var(--text-muted); font-size: 12px; padding: 8px 0 16px; }
.workflow-strip span { white-space: nowrap; }
.workflow-strip b { color: var(--text-muted); font-size: 11px; margin-right: 6px; font-variant-numeric: tabular-nums; font-weight: 500; }
.workflow-strip i { display: block; width: 32px; height: 1px; background: var(--border); }
.page-footer { display: flex; justify-content: space-between; gap: 15px; color: var(--text-muted); font-size: 12px; padding-top: 20px; margin-top: 12px; border-top: 1px solid var(--border); }

input:not([type="checkbox"]), select, textarea { display: block; width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); color: var(--text); padding: 8px 12px; line-height: 1.5; min-width: 0; min-height: 38px; transition: border-color 0.15s ease; }
input:not([type="checkbox"]):focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; font-size: 13px; }
input[readonly] { background: var(--background); color: var(--text-muted); }
textarea { resize: vertical; min-height: 88px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
input:disabled, textarea:disabled, select:disabled { background: var(--background); color: var(--text-muted); opacity: 1; }
.plain-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text); }
.required { color: var(--danger); font-size: 11px; font-weight: 400; margin-left: 4px; }
.field-hint { display: block; font-size: 12px; color: var(--text-muted); line-height: 1.6; margin-bottom: 0; overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.field-wide { grid-column: 1 / -1; }
.form-intro { color: var(--text-muted); font-size: 13px; margin: 0 0 20px; line-height: 1.7; }
.create-panel > .form-intro { margin: 16px 20px; }
.create-panel form { padding: 0 20px 20px; }
.field-explanation { background: var(--primary-soft); border: 1px solid var(--primary-border); border-radius: var(--radius-sm); padding: 14px; gap: 6px; align-self: end; }
.field-explanation strong { color: var(--primary); font-size: 13px; }
.field-explanation span { color: var(--text-secondary); font-size: 12px; line-height: 1.7; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--border); padding-top: 16px; margin-top: 20px; }
.form-footer .muted { font-size: 12px; }

.message { padding: 12px 16px; border: 1px solid var(--border); background: var(--border-light); color: var(--text-secondary); border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; overflow-wrap: anywhere; line-height: 1.7; }
.message-error { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-border); }
.message-success { color: #059669; background: var(--success-soft); border-color: #a7f3d0; }
.inset-message { margin: 4px 20px 16px; }
form > .message, .action-form > .message { margin-top: 16px; margin-bottom: 0; }
.notice { border: 1px solid var(--primary-border); border-left: 3px solid var(--primary); background: var(--primary-soft); padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; color: var(--text); font-size: 13px; }
.notice strong { display: block; color: var(--text); font-size: 13px; margin-bottom: 4px; font-weight: 600; }
.notice span { display: block; font-size: 13px; line-height: 1.7; color: var(--text-secondary); }
.error-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid var(--danger-border); padding: 20px; border-radius: var(--radius); background: var(--danger-soft); margin-bottom: 20px; color: var(--danger); }
.error-panel p { margin: 6px 0 0; font-size: 13px; }
.loading-state { min-height: 160px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--text-muted); font-size: 13px; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { padding: 48px 24px; text-align: center; color: var(--text-muted); }
.empty-state h3 { font-size: 14px; color: var(--text-secondary); font-weight: 500; margin-bottom: 6px; }
.empty-state p { font-size: 13px; margin-bottom: 0; }
.empty-state.compact { padding: 32px 24px; }
.empty-lines { width: 40px; height: 44px; margin: 0 auto 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); position: relative; background: var(--background); }
.empty-lines::before, .empty-lines::after { content: ""; position: absolute; height: 2px; border-radius: 1px; background: var(--border); left: 8px; }
.empty-lines::before { top: 14px; width: 18px; }
.empty-lines::after { top: 22px; width: 12px; }
.login-panel { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 24px; display: flex; align-items: center; gap: 24px; background: var(--surface); box-shadow: var(--shadow); }
.login-panel h2 { font-size: 18px; margin-bottom: 8px; }
.login-panel p { color: var(--text-secondary); font-size: 13px; max-width: 600px; line-height: 1.7; }
.login-panel p:last-child { margin: 0; font-size: 12px; color: var(--text-muted); }
.login-illustration { width: 64px; height: 80px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; padding: 16px 10px; transform: rotate(-3deg); box-shadow: var(--shadow-md); }
.login-illustration span { display: block; height: 4px; background: var(--border); border-radius: 2px; }
.login-illustration span:first-child { background: var(--primary); width: 20px; height: 6px; }
.login-illustration span:last-child { width: 24px; }

#stats-summary { margin-bottom: 20px; }
.stats-table td { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stats-table td:first-child { font-weight: 500; color: var(--text); }
.stats-table td:nth-child(n+3) { min-width: 76px; }
#assessment-stats .stats-table { min-width: 820px; }
#assessment-stats td:last-child { min-width: 160px; max-width: 280px; font-size: 12px; }
.settings-permission { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.settings-permission .muted { font-size: 12px; }
.settings-body { padding: 20px; }
.section-number { color: var(--text-muted); font-size: 20px; font-weight: 300; letter-spacing: -1px; }
.weekday-fieldset { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.weekday-fieldset legend { font-size: 13px; color: var(--text); font-weight: 500; padding: 0; margin-bottom: 10px; }
.weekday-options { display: flex; gap: 8px; flex-wrap: wrap; }
.weekday-options label { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; min-height: 38px; transition: all 0.15s ease; }
.weekday-options label:has(input:checked) { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary); }
.time-range { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 13px; }
.time-range input { flex: 1; width: 0; }
.deadline-note { background: var(--background); border-radius: var(--radius-sm); padding: 12px 16px; margin-top: 20px; color: var(--text-secondary); font-size: 12px; line-height: 1.7; }
.deadline-note strong { display: block; color: var(--text); margin-bottom: 2px; font-size: 13px; font-weight: 500; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; cursor: pointer; }
.toggle-row span { display: flex; flex-direction: column; gap: 4px; }
.toggle-row strong { font-size: 14px; }
.toggle-row small { color: var(--text-muted); font-size: 12px; }
.toggle-row input { appearance: none; -webkit-appearance: none; width: 36px; height: 20px; border-radius: 10px; background: var(--border); position: relative; transition: background 0.15s; margin: 0; }
.toggle-row input::after { content: ""; position: absolute; width: 14px; height: 14px; background: white; border-radius: 50%; top: 3px; left: 3px; transition: transform 0.15s; box-shadow: var(--shadow-sm); }
.toggle-row input:checked { background: var(--primary); }
.toggle-row input:checked::after { transform: translateX(16px); }
.rules-table { table-layout: fixed; margin-bottom: 12px; }
.rules-table th { color: var(--text-secondary); font-size: 12px; font-weight: 500; background: var(--background); }
.rules-table th, .rules-table td { padding: 10px 14px; border: 1px solid var(--border); }
.rules-table th:first-child { width: 22%; }
.rules-table tbody th { background: var(--surface); }
.rules-table input { max-width: 200px; font-size: 13px; font-variant-numeric: tabular-nums; }
.settings-save-bar { margin-top: 0; border: 0; padding: 0 0 12px; }

.task-dialog { width: min(760px, calc(100% - 32px)); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text); background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; }
.task-dialog[open] { display: flex; flex-direction: column; }
.task-dialog::backdrop { background: rgb(15 23 42 / 0.5); backdrop-filter: blur(4px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.dialog-heading > div { min-width: 0; }
.dialog-heading h2 { font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; max-height: 120px; overflow: auto; }
.dialog-heading .eyebrow { font-size: 11px; margin-bottom: 4px; }
.dialog-heading > button { flex-shrink: 0; }
.dialog-content { overflow-y: auto; overscroll-behavior: contain; padding: 20px 24px; min-height: 0; }
.dialog-footer { padding: 14px 24px; border-top: 1px solid var(--border); background: var(--background); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; }
.dialog-footer .muted { font-size: 11px; }
.detail-tags { display: flex; gap: 8px; margin-bottom: 20px; }
.detail-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; background: var(--background); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; margin: 0 0 20px; }
.detail-meta-item dt { color: var(--text-secondary); font-size: 12px; margin-bottom: 4px; font-weight: 500; }
.detail-meta-item dd { margin: 0; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.detail-section { border-top: 1px solid var(--border-light); padding-top: 20px; margin-bottom: 20px; }
.detail-section > p { font-size: 13px; line-height: 1.7; }
.multiline { white-space: pre-wrap; overflow-wrap: anywhere; }
.action-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.action-form { padding: 16px; background: var(--background); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: 16px; }
.action-form-title { font-size: 14px; font-weight: 600; color: var(--primary); margin-bottom: 8px; }
.action-form-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item { position: relative; border-left: 2px solid var(--border); padding: 0 0 20px 20px; margin-left: 4px; }
.timeline-item:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline-item::before { content: ""; position: absolute; left: -5px; top: 5px; width: 8px; height: 8px; background: var(--text-muted); border: 2px solid var(--surface); border-radius: 50%; box-shadow: var(--shadow-sm); }
.timeline-item:first-child::before { background: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.timeline-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.timeline-heading strong { font-size: 14px; color: var(--text); font-weight: 600; }
.timeline-heading time { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.timeline-person { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }
.timeline-item > p { font-size: 14px; color: var(--text); margin: 8px 0 0; }
.history-changes { font-size: 12px; color: var(--text-secondary); padding: 8px 12px; background: var(--background); border-radius: var(--radius-sm); margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.history-changes p { margin-bottom: 4px; }
.history-changes p:last-child { margin-bottom: 0; }
.noscript-message { position: fixed; bottom: 20px; left: 20px; right: 20px; z-index: 100; background: var(--warning-soft); border: 1px solid #fde68a; padding: 16px; border-radius: var(--radius); color: #92400e; }

@media (min-width: 1550px) {
  :root { --sidebar-width: 256px; }
  main { padding: 32px 40px; }
  .topbar { padding-left: 40px; padding-right: 40px; }
}

@media (max-width: 1200px) {
  :root { --sidebar-width: 220px; }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .brand { gap: 10px; }
  .brand strong { font-size: 16px; }
  .brand small { font-size: 10px; }
  .topbar { padding: 12px 20px; }
  .workspace-name { font-size: 12px; }
  .identity-current { display: none; }
  main { padding: 20px; }
  .summary-grid { gap: 12px; }
  .summary-card { padding: 16px; }
  .summary-label { font-size: 12px; }
  .summary-value { font-size: 24px; }
  .data-table th, .data-table td { padding-left: 12px; padding-right: 12px; }
}

@media (max-width: 960px) {
  :root { --sidebar-width: 0px; }
  .sidebar { position: static; width: 100%; padding: 16px 20px 0; }
  .brand { padding: 0 0 12px; }
  .brand strong { font-size: 16px; }
  .brand small { display: inline; margin-left: 8px; font-size: 10px; }
  .brand > span:last-child { display: flex; align-items: baseline; }
  .brand-mark { height: 24px; width: 24px; }
  .nav-label, .sidebar-note { display: none; }
  .main-nav { flex-direction: row; gap: 8px; }
  .main-nav a { padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13px; gap: 8px; }
  .main-nav a[aria-current="page"] { box-shadow: none; border-bottom: 2px solid var(--primary); }
  .topbar { min-height: 56px; }
  .identity-current { display: flex; }
  .summary-card { padding: 16px; }
}

@media (max-width: 700px) {
  .sidebar { padding: 16px 12px 0; }
  .brand { padding-bottom: 12px; }
  .main-nav { gap: 4px; justify-content: space-between; flex-wrap: wrap; }
  .main-nav a { padding: 10px 8px; gap: 6px; font-size: 12px; flex: 1 1 calc(50% - 4px); justify-content: center; }
  .nav-symbol { font-size: 16px; width: 14px; height: 14px; }
  .settings-symbol { width: 14px; height: 14px; }
  .topbar { padding: 10px 12px; gap: 10px; }
  .workspace-name { display: none; }
  .identity-area { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
  .identity-current { grid-column: 1; grid-row: 1; flex-direction: row; align-items: center; gap: 8px; text-align: left; }
  .identity-current strong { font-size: 12px; }
  .identity-current > span { font-size: 11px; }
  #logout-button { grid-column: 2; grid-row: 1; padding: 3px 6px; min-height: 24px; font-size: 11px; }
  main { padding: 20px 12px; min-height: 60vh; }
  h1 { font-size: 20px; margin-bottom: 6px; }
  .page-heading { align-items: flex-start; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
  .page-heading .eyebrow { font-size: 11px; margin-bottom: 4px; }
  .page-heading p { font-size: 13px; }
  .heading-actions { width: 100%; gap: 8px; }
  .heading-actions .button { flex: 1; }
  .button { min-height: 38px; }
  .button-small { min-height: 34px; }
  .page-heading > .button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .summary-card { padding: 14px; }
  .summary-value { font-size: 24px; margin-top: 4px; margin-bottom: 4px; }
  .summary-card:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1px 12px; }
  .summary-card:last-child .summary-value { grid-column: 2; grid-row: 1 / 3; margin: 0; font-size: 22px; }
  .summary-card:last-child .summary-note { grid-column: 1; grid-row: 2; }
  .scope-note { font-size: 11px; margin: 10px 0 16px; line-height: 1.6; }
  .panel { margin-bottom: 16px; }
  .panel-heading { padding: 14px 16px; gap: 10px; }
  .panel-heading h2 { font-size: 15px; }
  .panel-caption { font-size: 11px; max-width: 120px; }
  .filter-bar { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .search-field { max-width: none; width: 100%; flex: auto; }
  .filter-select { flex: 1; gap: 8px; }
  .filter-select select { flex: 1; width: 0; min-width: 100px; min-height: 36px; }
  .filter-select label { font-size: 12px; }
  .filter-bar .button { font-size: 11px; padding: 6px 8px; }
  .task-table, #assessment-stats .stats-table { min-width: 0; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .data-table tbody { padding: 0 12px 12px; }
  .data-table tr { padding: 12px 0; border-top: 1px solid var(--border); }
  .data-table tr:last-child { padding-bottom: 0; }
  .data-table td, .data-table td:first-child, .data-table td:last-child { padding: 4px 0; border: 0; width: 100%; min-width: 0; max-width: none; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; text-align: right; font-size: 12px; }
  .data-table td::before { content: attr(data-label); color: var(--text-muted); font-size: 11px; flex-shrink: 0; text-align: left; }
  .data-table .primary-cell { text-align: left; justify-content: flex-start; padding-top: 0; padding-bottom: 10px; font-weight: 600; color: var(--text); }
  .data-table .primary-cell::before { display: none; }
  .task-title-cell { width: 100%; gap: 4px; }
  .task-title-button { font-size: 13px; }
  .task-id { font-size: 10px; }
  .person-cell { flex-direction: row; align-items: baseline; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .person-cell small { font-size: 11px; }
  .data-table .row-action { margin-top: 6px; border-top: 1px dashed var(--border); justify-content: flex-end; padding-top: 8px; padding-bottom: 0; }
  .data-table .row-action::before { display: none; }
  .row-action .text-button { padding: 5px 10px; background: var(--primary-soft); border-radius: var(--radius-sm); min-height: 32px; }
  .stats-table tbody { padding-top: 0; }
  .stats-table tr:first-child { border-top: 0; }
  .stats-table .primary-cell { font-size: 13px; margin-bottom: 4px; }
  .stats-table td:nth-child(n+3), #assessment-stats td:last-child { min-width: 0; max-width: none; }
  .table-footer { padding: 10px 16px; font-size: 11px; }
  .table-footer > span:last-child { display: none; }
  .workflow-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 14px; max-width: 280px; margin: 0 auto; font-size: 11px; padding-top: 4px; }
  .workflow-strip i { display: none; }
  .workflow-strip b { margin-right: 4px; }
  .page-footer { flex-direction: column; gap: 2px; font-size: 11px; margin-top: 8px; padding-top: 14px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .field-wide { grid-column: auto; }
  input:not([type="checkbox"]), textarea, select { font-size: 15px; }
  .field input[readonly] { font-size: 13px; }
  .field-explanation { padding: 12px; }
  .field-hint { font-size: 11px; }
  .create-panel > .form-intro { margin: 12px; font-size: 12px; }
  .create-panel form { padding: 0 12px 16px; }
  .form-footer { flex-direction: column; align-items: stretch; gap: 12px; margin-top: 18px; padding-top: 14px; }
  .form-footer .button { width: 100%; }
  .notice { padding: 12px; margin-bottom: 16px; }
  .notice strong { font-size: 12px; }
  .notice span { font-size: 11px; }
  .message { font-size: 12px; padding: 10px 12px; }
  .inset-message { margin: 0 12px 14px; }
  .loading-state { min-height: 140px; font-size: 12px; }
  .empty-state { padding: 36px 16px; }
  .empty-state p { font-size: 12px; line-height: 1.7; }
  .error-panel { padding: 16px; flex-direction: column; align-items: stretch; gap: 12px; }
  .login-panel { padding: 20px 16px; gap: 0; margin-bottom: 20px; }
  .login-panel h2 { font-size: 16px; }
  .login-illustration { display: none; }
  .login-panel .eyebrow { font-size: 10px; }
  .login-panel p { font-size: 12px; }
  .panel-description { font-size: 12px; margin: 12px 16px; }
  .settings-body { padding: 16px; }
  .settings-permission { gap: 8px; flex-wrap: wrap; }
  .weekday-options { gap: 6px; }
  .weekday-options label { padding: 6px 10px; font-size: 12px; gap: 4px; }
  .weekday-options input { margin-left: 0; }
  .time-range { gap: 8px; }
  .time-range input { padding: 8px 6px; font-size: 15px; }
  .deadline-note { padding: 10px; font-size: 11px; }
  .toggle-row { gap: 14px; }
  .rules-table th, .rules-table td { padding: 8px 6px; font-size: 11px; }
  .rules-table th:first-child { width: 21%; }
  .rules-table thead th { font-size: 10px; }
  .rules-table input { padding: 6px 4px; font-size: 13px; }
  .settings-save-bar { padding-bottom: 4px; gap: 10px; }
  .task-dialog { width: calc(100% - 16px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); border-radius: var(--radius); }
  .dialog-heading { padding: 16px; gap: 10px; }
  .dialog-heading h2 { font-size: 16px; max-height: 100px; }
  .dialog-heading .button { padding: 6px 8px; min-height: 32px; font-size: 12px; }
  .dialog-content { padding: 16px; }
  .dialog-footer { padding: 10px 16px; gap: 8px; }
  .dialog-footer .muted { font-size: 10px; }
  .dialog-footer .button { flex-shrink: 0; }
  .detail-meta { padding: 12px; gap: 14px 10px; }
  .detail-meta-item dt { font-size: 11px; }
  .detail-meta-item dd { font-size: 12px; }
  .detail-section { padding-top: 16px; margin-bottom: 18px; }
  .detail-section > p { font-size: 12px; }
  .action-buttons { gap: 6px; }
  .action-buttons .button { font-size: 11px; padding: 8px 10px; min-height: 36px; }
  .action-form { padding: 14px 12px; }
  .action-form-footer { flex-direction: column-reverse; gap: 8px; }
  .action-form-footer .button { width: 100%; }
  .timeline-heading { gap: 6px; flex-wrap: wrap; }
  .timeline-heading strong { font-size: 12px; }
  .timeline-heading time { font-size: 10px; }
  .timeline-item { padding-left: 16px; }
}

/* Assessment management */
.assessment-summary {
  display: flex; flex-wrap: wrap; gap: 12px 20px; padding: 12px 16px;
  background: var(--background); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13px; color: var(--text-secondary);
}
.assessment-summary span { white-space: nowrap; }
.assessment-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.button-link {
  background: none; border: none; padding: 4px 8px; font-size: 12px;
  cursor: pointer; border-radius: var(--radius-sm); font-weight: 500;
  transition: background 0.15s;
}
.button-confirm-sm { color: var(--success); }
.button-confirm-sm:hover { background: var(--success-soft); }
.button-waive-sm { color: var(--text-muted); }
.button-waive-sm:hover { background: var(--border-light); }
.tag-success { background: var(--success-soft); color: #065f46; border: 1px solid #a7f3d0; }
.tag-muted { background: var(--border-light); color: var(--text-muted); border: 1px solid var(--border); }
.change-item { padding: 2px 0; font-size: 13px; color: var(--text-secondary); }
.change-item.muted { color: var(--text-muted); font-style: italic; }
.settings-panel { margin-top: 20px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .spinner { animation: none; border-top-color: var(--primary); border-right-color: var(--primary); }
}
