:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-soft: #f8f9fb;
  --text: #20242c;
  --muted: #757b87;
  --line: #e4e7ec;
  --accent: #5261c9;
  --accent-soft: #eef0ff;
  --danger: #c64d55;
  --danger-soft: #fff1f2;
  --warning: #c27a2b;
  --waiting: #7c62b2;
  --success: #31856c;
  --shadow: 0 8px 28px rgba(31, 37, 51, .055);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
body.auth-pending .app-shell { visibility: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(82, 97, 201, .18); outline-offset: 1px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 212px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 18px 20px; background: #fafbfc; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 28px; }
.brand-mark { width: 37px; height: 37px; display: grid; place-items: center; color: white; font-weight: 700; background: var(--accent); border-radius: 10px; box-shadow: 0 6px 18px rgba(82, 97, 201, .24); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: .08em; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 2px; }
nav { display: grid; gap: 5px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 9px; background: transparent; color: #626873; padding: 11px 12px; text-align: left; transition: background .12s, color .12s; }
.nav-item .nav-icon { width: 18px; flex: 0 0 auto; text-align: center; font-weight: 700; }
.nav-item .nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item[draggable="true"] { cursor: grab; }
.nav-item[draggable="true"]:active { cursor: grabbing; }
.nav-item.dragging { opacity: .38; background: #e8eaf2; }
.nav-item:hover { background: #f0f1f4; color: var(--text); }
.nav-item.active { color: var(--accent); background: var(--accent-soft); font-weight: 650; }
.sidebar-tip { margin-top: auto; padding: 10px; color: var(--muted); font-size: 12px; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--success); }

.auth-screen { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.auth-screen[hidden] { display: none; }
.auth-card { width: min(390px, 100%); display: grid; gap: 16px; padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 18px 55px rgba(31, 37, 51, .1); }
.auth-card .brand-mark { margin-bottom: 2px; }
.auth-card h1 { margin: 3px 0 5px; font-size: 28px; }
.auth-card p { margin: 0; color: var(--muted); font-size: 13px; }
.auth-card label { display: grid; gap: 7px; color: #626873; font-size: 12px; }
.auth-card input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.auth-card .auth-error { min-height: 18px; color: var(--danger); font-size: 12px; }
.auth-card .primary-btn { width: 100%; min-height: 42px; }
.online-account { margin-left: auto; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.online-account[hidden] { display: none; }
.online-account button { padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px; color: #626873; background: white; }
.nav-item.online-unavailable { opacity: .45; }

main { min-width: 0; padding: 40px clamp(24px, 4.2vw, 66px) 70px; }
.global-bar { max-width: 1240px; margin: 0 auto 24px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.global-bar[hidden] { display: none; }
.domain-switch, .calendar-view-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #e9ebef; }
.domain-switch button, .calendar-view-switch button { min-width: 58px; padding: 7px 12px; border: 0; border-radius: 7px; color: #6f7580; background: transparent; font-size: 12px; }
.domain-switch button.active, .calendar-view-switch button.active { color: var(--text); background: white; box-shadow: 0 1px 5px rgba(31,37,51,.1); font-weight: 650; }
.scope-caption { color: var(--muted); font-size: 11px; }
.page { display: none; max-width: 1240px; margin: 0 auto; }
.page.active { display: block; }
.page-header { min-height: 65px; margin-bottom: 24px; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.page-header h1 { margin: 3px 0 0; font-size: clamp(26px, 3vw, 34px); line-height: 1.15; letter-spacing: -.035em; font-weight: 720; }
.eyebrow { margin: 0; color: var(--muted); font-size: 12px; letter-spacing: .06em; }
.page-header-actions { display: flex; align-items: center; gap: 9px; }
.section-search { width: min(250px, 32vw); display: grid; grid-template-columns: auto minmax(0, 1fr) 24px; align-items: center; gap: 6px; padding: 0 7px 0 10px; border: 1px solid var(--line); border-radius: 9px; color: #8a9099; background: white; }
.section-search:focus-within { border-color: #b7bee8; box-shadow: 0 0 0 3px rgba(82,97,201,.07); }
.section-search input { width: 100%; min-width: 0; padding: 8px 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 12px; }
.section-search button { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; color: #9298a2; background: transparent; }
.section-search button:hover { color: var(--text); background: #f0f1f4; }
.section-search-results { margin: -12px 0 14px; padding: 8px 14px; }
.section-search-result { width: 100%; display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 2px; border: 0; border-top: 1px solid #f0f1f3; color: var(--text); background: transparent; text-align: left; }
.section-search-result:first-child { border-top: 0; }
.section-search-result:hover { background: #fafbfc; }
.section-search-result time, .section-search-result small { color: var(--muted); font-size: 11px; }
.section-search-result strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.section-search-result > span { min-width: 0; }
.section-search-result > span strong { display: block; }
.section-search-result em { display: -webkit-box; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; font-style: normal; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.search-match-excerpt { display: -webkit-box; margin-top: 5px; overflow: hidden; color: #737985; font-size: 10px; font-style: normal; font-weight: 400; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.search-highlight { padding: 0 1px; border-radius: 3px; color: inherit; background: #edf0ca; }
.search-empty { padding: 16px 4px; color: var(--muted); text-align: center; font-size: 12px; }
.search-empty strong, .search-empty span { display: block; }
.search-empty span { margin-top: 4px; color: #a0a5ae; }

.quick-capture { position: relative; margin-bottom: 28px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 10px; background: var(--surface); border: 1px solid #dfe2e8; border-radius: 16px; padding: 11px 11px 11px 17px; box-shadow: 0 11px 30px rgba(35, 42, 60, .08); }
.quick-capture:focus-within { border-color: #aeb6ee; box-shadow: 0 11px 30px rgba(35, 42, 60, .08), 0 0 0 4px rgba(82,97,201,.08); }
.quick-plus { color: var(--accent); font-size: 27px; font-weight: 300; }
.quick-capture input { min-width: 0; border: 0; outline: 0; padding: 9px 2px; font-size: 16px; background: transparent; color: var(--text); }
.quick-capture input::placeholder { color: #a0a5ae; }
.quick-capture select { border: 0; border-left: 1px solid var(--line); padding: 8px 10px; color: #626873; background: white; outline: 0; font-size: 12px; }
.quick-capture button { border: 0; border-radius: 9px; padding: 10px 18px; background: var(--accent); color: #fff; font-weight: 650; }
.quick-hint { position: absolute; top: calc(100% + 7px); left: 19px; color: #9a9fa8; font-size: 11px; }
.quick-date-control { position: relative; }
.quick-capture .quick-date-button { min-width: 76px; padding: 8px 10px; border: 1px solid var(--line); color: #626873; background: #f8f9fb; font-size: 11px; font-weight: 600; white-space: nowrap; }
.quick-capture .quick-date-button:hover, .quick-capture .quick-date-button[aria-expanded="true"] { color: var(--accent); background: var(--accent-soft); }
.quick-date-panel { position: absolute; z-index: 12; top: calc(100% + 9px); right: 0; width: 286px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 16px 45px rgba(31, 37, 51, .16); }
.quick-date-panel[hidden] { display: none; }
.quick-date-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.quick-capture .quick-date-options button { padding: 7px 8px; border: 1px solid #eceef2; border-radius: 7px; color: #626873; background: #fafbfc; font-size: 11px; font-weight: 500; text-align: left; }
.quick-capture .quick-date-options button:hover { color: var(--accent); border-color: #d8dcf2; background: #f3f5ff; }
.quick-date-panel label { display: grid; gap: 5px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.quick-date-panel input { width: 100%; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .75fr); gap: 18px; margin-top: 40px; align-items: start; }
.dashboard-main, .dashboard-side { display: grid; gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.danger-panel { border-color: #f0d9dc; }
.section-title, .section-title > div { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.section-title h2 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.section-icon { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px; font-size: 11px; font-weight: 750; }
.section-icon.danger { background: var(--danger-soft); color: var(--danger); }
.section-icon.today { background: var(--accent-soft); color: var(--accent); }
.section-icon.next { background: #edf6f3; color: var(--success); }
.section-icon.waiting { background: #f4effb; color: var(--waiting); }
.section-icon.projects { background: #fff5e8; color: var(--warning); }
.section-icon.inbox { background: #eef2f5; color: #647285; }
.section-icon.repeat, .section-icon.data { background: var(--accent-soft); color: var(--accent); }
.section-icon.learning { background: #edf6f3; color: var(--success); }
.section-icon.bill { background: #edf6f3; color: var(--success); }
.section-icon.health, .section-icon.health-check, .section-icon.health-metric, .section-icon.health-followup, .section-icon.health-watch { color: #397967; background: #edf6f3; }
.count { color: var(--muted); font-size: 12px; }
.section-subtitle { margin: 7px 0 14px 33px; color: var(--muted); font-size: 12px; }

.task-list { margin-top: 11px; }
.task-row { min-height: 48px; display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; align-items: center; gap: 9px; border-top: 1px solid #f0f1f3; }
.task-row:first-child { border-top: 0; }
.check-btn { width: 19px; height: 19px; padding: 0; border: 1.5px solid #b8bec8; border-radius: 50%; background: #fff; color: transparent; line-height: 1; }
.check-btn:hover { border-color: var(--success); color: var(--success); }
.task-row.completed .check-btn { background: var(--success); border-color: var(--success); color: white; }
.task-row.completed .task-name { color: #979ca4; text-decoration: line-through; }
.cancelled-mark { display: grid; place-items: center; color: #9a7b7e; background: #f5eeee; border-color: #d9c6c8; cursor: default; }
.task-row.cancelled { opacity: .68; }
.task-row.cancelled .task-name { color: #858a92; }
.cancelled-tag { color: #8b676b; background: #f5eeee; }
.task-main { min-width: 0; padding: 9px 0; cursor: pointer; }
.task-name { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 5px; color: var(--muted); font-size: 11px; }
.project-tag, .status-tag, .type-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 5px; background: var(--surface-soft); }
.project-dot { width: 6px; height: 6px; border-radius: 50%; }
.status-tag.wait { color: var(--waiting); background: #f5f0fb; }
.task-date { white-space: nowrap; font-size: 12px; color: var(--muted); }
.task-date.overdue { color: var(--danger); font-weight: 650; }
.empty { padding: 18px 4px 7px; color: #a0a5ae; font-size: 13px; text-align: center; }

.date-group { margin-top: 13px; }
.date-heading { display: flex; align-items: center; gap: 8px; padding: 9px 0 5px; color: #626873; font-size: 12px; font-weight: 650; }
.date-heading::after { content: ""; height: 1px; background: #f0f1f3; flex: 1; }
.date-group .task-list { margin-top: 0; }
.upcoming-tools { display: flex; align-items: center; gap: 10px; }
.range-switch { display: inline-flex; padding: 2px; border-radius: 8px; background: #eef0f3; }
.range-switch button { padding: 5px 8px; border: 0; border-radius: 6px; color: #747a85; background: transparent; font-size: 10px; }
.range-switch button.active { color: var(--accent); background: white; box-shadow: 0 1px 4px rgba(31,37,51,.1); font-weight: 650; }

.waiting-list { margin-top: 10px; }
.waiting-card { border-top: 1px solid #f0f1f3; padding: 12px 1px; cursor: pointer; }
.waiting-card:first-child { border-top: 0; }
.waiting-card strong { display: block; font-size: 13px; line-height: 1.4; font-weight: 600; }
.waiting-card div { margin-top: 6px; color: var(--muted); font-size: 11px; display: flex; justify-content: space-between; gap: 8px; }
.waiting-card .review-due { color: var(--danger); font-weight: 650; }
.project-summary { margin-top: 9px; }
.bill-reminder-list { margin-top: 8px; }
.bill-reminder-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 10px 1px; border-top: 1px solid #f0f1f3; }
.bill-reminder-item:first-child { border-top: 0; }
.bill-reminder-date { color: var(--danger); font-size: 11px; font-weight: 650; }
.bill-reminder-item strong { display: block; font-size: 13px; }
.bill-reminder-item small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.health-reminder-list { margin-top: 8px; }
.health-reminder-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 10px 1px; border-top: 1px solid #f0f1f3; }
.health-reminder-item:first-child { border-top: 0; }
.health-reminder-item > span { color: var(--success); font-size: 11px; font-weight: 650; }
.health-reminder-item strong, .health-reminder-item small { display: block; }
.health-reminder-item strong { font-size: 12px; }
.health-reminder-item small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.project-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 1px; border-top: 1px solid #f0f1f3; cursor: pointer; }
.project-line:first-child { border-top: 0; }
.project-line-name { min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.project-line-name span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-count { color: var(--muted); font-size: 12px; }
.risk-mark { display: inline-grid; place-items: center; width: 17px; height: 17px; margin-left: 4px; color: var(--danger); background: var(--danger-soft); border-radius: 50%; font-size: 10px; font-weight: 750; }

.primary-btn, .ghost-btn { border-radius: 9px; padding: 9px 15px; font-size: 13px; font-weight: 650; }
.primary-btn { color: white; background: var(--accent); border: 1px solid var(--accent); }
.primary-btn:hover { background: #4655bc; }
.ghost-btn { color: #626873; background: white; border: 1px solid var(--line); }
.toolbar { margin-bottom: 14px; display: grid; grid-template-columns: minmax(240px, 1fr) 150px 180px; gap: 10px; }
.toolbar input, .toolbar select, .inline-form input, .stack-form input, .stack-form select, #task-form input, #task-form select, #task-form textarea, #matter-form input, #matter-form select, #matter-form textarea, #matter-entry-form input, #matter-entry-form select, #bill-form input, #bill-form select, #bill-form textarea, #life-event-form input, #life-event-form select, #life-event-form textarea, #calendar-create-form input, #calendar-create-form select, #calendar-create-form textarea, #course-form input, #course-form select, #course-form textarea, #day-tag-form input, #day-tag-form textarea, .health-dialog input, .health-dialog select, .health-dialog textarea, #archive-form input, #archive-form select, #archive-form textarea, #study-entry-form input, #study-resource-form input, #study-resource-form textarea, #shift-dialog input, #shift-dialog select, #shift-dialog textarea { width: 100%; border: 1px solid #dfe2e7; border-radius: 8px; background: white; padding: 9px 10px; color: var(--text); }
#visit-form input, #visit-form select, #visit-form textarea { width: 100%; border: 1px solid #dfe2e7; border-radius: 8px; background: white; padding: 9px 10px; color: var(--text); }
#visit-form label { display: grid; gap: 6px; color: #626873; font-size: 12px; }
.search-box { display: flex; align-items: center; gap: 8px; padding-left: 11px; background: white; border: 1px solid #dfe2e7; border-radius: 8px; }
.search-box input { border: 0; outline: 0; padding-left: 0; }
.toolbar .section-search { width: auto; }
.toolbar .section-search input { padding: 8px 0; border: 0; outline: 0; }
.task-table-panel { padding: 5px 18px; min-height: 210px; }
.task-table .task-row { grid-template-columns: 25px minmax(0, 1fr) 130px 100px; }
.table-project { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.inline-form { margin-bottom: 18px; display: grid; grid-template-columns: minmax(230px, 1fr) minmax(200px, 1.3fr) 44px auto; align-items: center; gap: 11px; }
.inline-form label { font-weight: 650; }
.inline-form p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.inline-form input[type="color"] { padding: 4px; height: 39px; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.project-toolbar { display: flex; align-items: center; gap: 9px; margin: -6px 0 13px; }
.project-toolbar label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.project-toolbar select { min-width: 150px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: white; }
.project-toolbar > span { margin-left: auto; color: var(--muted); font-size: 10px; }
.subview-switch { display: inline-flex; gap: 3px; margin-bottom: 14px; padding: 3px; border-radius: 9px; background: #eceef2; }
.subview-switch button { padding: 7px 14px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 12px; }
.subview-switch button.active { color: var(--text); background: white; box-shadow: 0 1px 3px rgba(25,30,42,.08); }
.visit-toolbar { display: grid; grid-template-columns: repeat(6, minmax(100px, 1fr)); gap: 8px; margin-bottom: 14px; padding: 10px; }
.visit-toolbar select { min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.visit-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.visit-card { display: grid; gap: 7px; text-align: left; cursor: pointer; }
.visit-card-top { display: flex; justify-content: space-between; gap: 8px; }
.visit-card-top i { color: #68755f; font-size: 10px; font-style: normal; }
.visit-card > span:not(.visit-card-top) { color: var(--muted); font-size: 11px; }
.visit-card-tags { min-height: 16px; color: #6d75a7 !important; }
.visit-option-manager { margin-top: 16px; }
.visit-option-manager summary { cursor: pointer; color: var(--muted); }
#visit-option-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
#visit-option-columns h3 { font-size: 13px; }
#visit-option-columns form, .visit-tag-create { display: flex; gap: 5px; }
#visit-option-columns input { min-width: 0; width: 100%; padding: 7px; border: 1px solid var(--line); border-radius: 7px; }
.visit-option-list { display: grid; gap: 5px; margin-top: 8px; }
.visit-option-list > div { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto auto; align-items: center; gap: 5px; padding: 6px; border-radius: 7px; background: var(--surface-soft); font-size: 10px; }
.visit-option-list button { border: 0; background: transparent; font-size: 10px; }
.visit-option-drag { cursor: grab; color: #a3a7af; }
#visit-dialog { width: min(720px, calc(100vw - 24px)); }
#visit-form { max-height: 88vh; overflow-y: auto; }
.visit-tag-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.visit-tag-picker label { display: inline-flex !important; grid-template-columns: auto auto; align-items: center; gap: 4px !important; padding: 5px 8px; border-radius: 999px; background: var(--surface-soft); }
.visit-tag-picker input { width: auto !important; }
.visit-tag-create { margin-top: 7px; }
.visit-detail { max-width: 850px; margin: 0 auto; }
.visit-detail-head { display: flex; justify-content: space-between; gap: 12px; }
.visit-detail-head h1 { margin: 4px 0 16px; }
.visit-detail-facts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
.visit-detail-facts span { display: grid; gap: 4px; padding: 9px; border-radius: 8px; color: var(--muted); background: var(--surface-soft); font-size: 10px; }
.visit-detail-facts strong { color: var(--text); font-size: 12px; }
.visit-detail-section { margin-top: 18px; border-top: 1px solid var(--line); }
.visit-detail-section h3 { margin-bottom: 7px; font-size: 13px; }
.visit-detail-section p { line-height: 1.65; }
.trip-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.trip-card { display: flex; min-height: 170px; flex-direction: column; align-items: stretch; gap: 8px; padding: 18px; text-align: left; color: var(--text); }
.trip-card:hover { border-color: #c9cee9; transform: translateY(-1px); }
.trip-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.trip-card-top strong { font-size: 16px; }
.trip-card-top i, .trip-hero-side .matter-status { padding: 4px 8px; border-radius: 999px; color: #5965ae; background: #eef0fb; font-size: 11px; font-style: normal; white-space: nowrap; }
.trip-card > span:not(.trip-card-top) { color: var(--muted); font-size: 12px; line-height: 1.5; }
.trip-hero { display: flex; justify-content: space-between; gap: 20px; padding: 24px; }
.trip-hero h1 { margin: 4px 0 8px; }
.trip-hero p { margin: 0; color: var(--muted); }
.trip-hero-side { display: flex; min-width: 150px; flex-direction: column; align-items: flex-end; gap: 10px; color: var(--muted); }
.trip-overview-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; margin-top: 14px; }
.trip-facts, .trip-summary-card, .trip-rich-view { padding: 20px; }
.trip-facts h2, .trip-summary-card h2, .trip-rich-view h2 { margin-top: 0; }
.trip-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.trip-facts h2 { grid-column: 1 / -1; }
.trip-facts span { display: flex; flex-direction: column; gap: 4px; }
.trip-facts small { color: var(--muted); }
.trip-summary-card p { color: #4e5561; line-height: 1.75; }
.trip-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 18px 0 12px; }
.trip-section-head h2, .trip-section-head p { margin: 0; }
.trip-section-head p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.trip-days, .trip-stay-grid, .trip-transport-list { display: grid; gap: 12px; }
.trip-stay-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.trip-transport-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.trip-transport-card { display: grid; gap: 6px; border: 1px solid var(--line); text-align: left; cursor: pointer; }
.trip-transport-card > span { display: flex; align-items: center; gap: 8px; }
.trip-transport-card i { padding: 2px 6px; border-radius: 999px; color: #586078; background: #eef0f6; font-size: 10px; font-style: normal; }
.trip-transport-card small { color: var(--muted); }
.trip-day { padding: 15px; }
.trip-day-head, .trip-stay-card > span { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.trip-day-head > div { display: flex; align-items: baseline; gap: 10px; }
.trip-day-head span { color: var(--muted); font-size: 12px; }
.trip-day-note { margin: 12px 0; padding: 11px 12px; border-radius: 9px; background: var(--surface-soft); }
.trip-route-row { display: grid; grid-template-columns: 54px minmax(0, 1fr); width: 100%; align-items: center; gap: 10px; padding: 11px 4px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; }
.trip-route-row time, .trip-route-row small { color: var(--muted); font-size: 11px; }
.trip-route-row span { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.trip-route-row i { color: #6470b5; font-size: 11px; font-style: normal; }
.trip-route-row b { color: var(--muted); font-size: 10px; }
.trip-stay-card { display: flex; flex-direction: column; gap: 7px; padding: 16px; text-align: left; }
.trip-stay-card i { color: #6470b5; font-size: 11px; font-style: normal; }
.trip-stay-card small { color: var(--muted); }
.trip-expense-group { margin-bottom: 10px; padding: 14px 18px; }
.trip-expense-group h3 { margin: 0 0 8px; }
.trip-expense-group button { display: flex; width: 100%; justify-content: space-between; padding: 9px 0; border: 0; border-top: 1px solid var(--line); background: transparent; }
.month-task.trip { color: #66705c; background: #f1f4ed; }
.trip-dialog { width: min(760px, calc(100vw - 24px)); }
.visit-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.visit-links button, .visit-links span { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: white; font-size: 11px; }
.month-task.visit { color: #725f48; background: #f5f0e8; }
.matter-intro { max-width: 720px; margin: -12px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.matter-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
.matter-group { min-width: 0; }
.matter-group-heading { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.matter-group-heading h2 { margin: 0; font-size: 14px; }
.matter-group-heading span { padding: 1px 7px; border-radius: 999px; color: var(--muted); background: #eceef2; font-size: 10px; }
.matter-card-list { display: grid; gap: 8px; }
.matter-card { display: grid; gap: 7px; width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: white; text-align: left; }
.matter-card:hover { border-color: #cbd0db; }
.matter-card.done, .matter-card.cancelled { opacity: .66; }
.matter-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.matter-card-top strong { min-width: 0; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.matter-card-top i { flex: 0 0 auto; padding: 2px 6px; border-radius: 999px; color: #6a7080; background: #f0f1f4; font-size: 9px; font-style: normal; }
.matter-card-meta, .matter-card-summary { color: var(--muted); font-size: 10px; }
.matter-card-summary { overflow: hidden; line-height: 1.55; text-overflow: ellipsis; white-space: nowrap; }
.matter-detail-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .8fr); gap: 15px; }
.matter-hero { margin-bottom: 15px; }
.matter-hero-title { display: flex; align-items: center; gap: 10px; }
.matter-hero-title h1 { margin: 5px 0 8px; font-size: 25px; }
.matter-hero small { display: block; margin-top: 10px; color: var(--muted); font-size: 10px; }
.matter-status { padding: 3px 8px; border-radius: 999px; color: #4c665d; background: #eaf2ef; font-size: 10px; }
.matter-status.waiting { color: #876d31; background: #f7f0de; }
.matter-status.done, .matter-status.cancelled { color: #777d87; background: #eceef1; }
.matter-rich-body { min-height: 220px; color: #3b414b; font-size: 13px; line-height: 1.75; }
.matter-rich-body blockquote { margin: 10px 0; padding: 7px 11px; border-left: 3px solid #c5cae8; background: #f7f8fc; }
.matter-records-section { max-width: 780px; margin: 0 auto; }
.matter-records-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 22px 0 12px; }
.matter-records-heading h2 { margin: 0; font-size: 20px; }
.matter-entry-inline { display: grid; gap: 13px; margin-bottom: 12px; padding: 16px; }
.matter-entry-inline[hidden] { display: none; }
.matter-entry-inline label { display: grid; gap: 6px; color: #626873; font-size: 12px; }
.matter-entry-inline .rich-editor { min-height: 130px; max-height: 320px; }
.matter-time-toggle { justify-self: start; padding: 2px 0; }
.matter-record-list { display: grid; gap: 8px; }
.matter-record-item { position: relative; padding: 15px 46px 15px 16px; }
.matter-record-item h3 { margin: 0 0 7px; font-size: 14px; }
.matter-record-body { color: #424852; font-size: 13px; line-height: 1.7; }
.matter-record-body p:first-child, .matter-record-body ul:first-child { margin-top: 0; }
.matter-record-body p:last-child, .matter-record-body ul:last-child { margin-bottom: 0; }
.matter-record-time { display: block; margin-top: 9px; color: var(--muted); font-size: 10px; }
.matter-record-menu { position: absolute; top: 10px; right: 10px; }
.matter-record-menu summary { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); list-style: none; cursor: pointer; }
.matter-record-menu summary::-webkit-details-marker { display: none; }
.matter-record-menu[open] summary { background: #f0f1f4; }
.matter-record-menu div { position: absolute; z-index: 3; top: 31px; right: 0; display: grid; min-width: 105px; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: white; box-shadow: 0 10px 30px rgba(25,30,42,.14); }
.matter-record-menu button { padding: 7px 9px; border: 0; border-radius: 6px; color: #626873; background: transparent; text-align: left; font-size: 11px; }
.matter-record-menu button:hover { background: #f4f5f7; }
.matter-record-menu button.danger { color: var(--danger); }
.matter-travel-fields { display: grid; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.matter-travel-fields[hidden] { display: none; }
.matter-travel-days { color: var(--muted); font-size: 11px; }
.travel-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 13px 0; }
.travel-overview div { display: grid; gap: 3px; padding: 9px 11px; border-radius: 8px; background: var(--surface-soft); }
.travel-overview span { color: var(--muted); font-size: 10px; }
.travel-overview strong { overflow-wrap: anywhere; font-size: 12px; }
.travel-guide-link { display: inline-block; margin: 0 0 12px; color: var(--accent); font-size: 12px; }
.travel-section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.travel-section { padding: 13px; }
.travel-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.travel-section-heading h3 { margin: 0; font-size: 14px; }
.travel-section .matter-record-item { margin-top: 7px; border: 1px solid var(--line); box-shadow: none; }
.travel-section-empty { margin: 8px 0 2px; color: var(--muted); font-size: 11px; }
.trip-free-records { margin-top: 16px; padding: 18px; }
.trip-entry-list { display: grid; gap: 10px; }
.trip-entry-card { padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.trip-entry-card > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.trip-entry-card h3 { margin: 0; font-size: 13px; }
.trip-entry-card time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.trip-entry-card .matter-rich-body { margin-top: 7px; }
.trip-entry-actions { display: flex; justify-content: flex-end; gap: 4px; margin-top: 6px; }
.rich-editor.compact { min-height: 110px; }
.travel-bill-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.travel-bill-row span { display: grid; gap: 3px; }
.travel-bill-row small { color: var(--muted); }
.travel-bill-row b { white-space: nowrap; font-size: 12px; }
.matter-more { max-width: 840px; margin: 14px auto 0; padding: 0; }
.matter-more summary { padding: 13px 16px; color: #666d78; font-size: 12px; cursor: pointer; }
.matter-more-content { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 2px 16px 16px; border-top: 1px solid var(--line); }
.matter-more-content h3 { margin: 14px 0 4px; font-size: 13px; }
.matter-more-content p { margin: 0; color: var(--muted); font-size: 10px; }
.matter-task-form { display: grid; grid-template-columns: minmax(0, 1fr) 135px auto; gap: 7px; margin: 12px 0; }
.matter-task-form input { min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; }
.matter-calendar-options { display: grid; grid-template-columns: auto minmax(180px, 1fr); align-items: end; gap: 12px; padding: 10px 12px; border-radius: 9px; background: var(--surface-soft); }
.project-card { cursor: grab; }
.project-card.dragging, .project-category-item.dragging { opacity: .48; outline: 2px dashed #b8bfdc; }
.project-card:hover { border-color: #cfd3dc; }
.project-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.project-card h3 { margin: 0; font-size: 15px; }
.project-card h3 small { color: var(--muted); font-size: 10px; font-weight: 500; }
.project-category-badge { display: inline-block; margin-top: 6px; padding: 2px 6px; border-radius: 999px; color: #707784; background: #f0f1f4; font-size: 9px; }
.project-card-actions { display: flex; align-items: center; gap: 2px; }
.project-card-actions button { border: 0; background: transparent; color: var(--muted); padding: 4px 5px; font-size: 11px; }
.project-card-actions button:hover { color: var(--accent); }
.project-card-actions button.delete:hover { color: var(--danger); }
.project-card-menu { position: relative; }
.project-card-menu summary { width: 28px; height: 26px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); list-style: none; cursor: pointer; }
.project-card-menu summary::-webkit-details-marker { display: none; }
.project-card-menu[open] summary { background: #f0f1f4; }
.project-card-menu div { position: absolute; z-index: 5; top: 29px; right: 0; display: grid; min-width: 92px; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: white; box-shadow: 0 10px 28px rgba(30,35,48,.14); }
.project-card-menu div button { padding: 7px 9px; border-radius: 6px; text-align: left; }
.project-card-menu div button:hover { background: #f3f4f7; }
.project-color { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 12%, transparent); }
.project-number { margin: 24px 0 2px; font-size: 29px; font-weight: 720; letter-spacing: -.04em; }
.project-caption { color: var(--muted); font-size: 12px; }
.risk-line { min-height: 18px; margin-top: 12px; color: var(--danger); font-size: 11px; }
.learning-entry { width: 100%; margin-top: 13px; border: 0; border-radius: 8px; padding: 8px 10px; color: #397967; background: #edf6f3; font-size: 12px; font-weight: 650; }

#project-edit-dialog { width: min(520px, calc(100vw - 28px)); }
.project-edit-note { margin: 0; color: var(--muted); font-size: 11px; }
#project-category-dialog { width: min(820px, calc(100vw - 28px)); }
.project-category-dialog-content { display: grid; gap: 16px; max-height: min(760px, calc(100vh - 30px)); padding: 22px; overflow-y: auto; }
.domain-label-editor { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 9px; padding: 12px; border-radius: 10px; background: var(--surface-soft); }
.domain-label-editor label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.domain-label-editor input { min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.project-category-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.project-category-column { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 11px; }
.project-category-column h3 { margin: 0 0 10px; font-size: 14px; }
.project-category-add { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; margin-bottom: 10px; }
.project-category-add input { min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; }
.project-category-list { display: grid; gap: 6px; }
.project-category-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto repeat(4, auto); align-items: center; gap: 4px; padding: 8px; border: 1px solid #e7e9ed; border-radius: 8px; background: #fafbfc; }
.project-category-item .category-drag { color: #a0a5ad; cursor: grab; }
.project-category-item strong { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.project-category-item small { color: var(--muted); font-size: 9px; }
.project-category-item button { padding: 4px 5px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 10px; }
.project-category-item button:hover { color: var(--accent); background: #eef0f7; }
.project-category-item button.delete:hover { color: var(--danger); }
.project-category-item button:disabled { opacity: .3; }

.learning-layout { display: grid; grid-template-columns: minmax(300px, .75fr) minmax(380px, 1.25fr); gap: 18px; align-items: start; }
.learning-topic-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 17px 0 12px; }
.learning-topic-form input { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; }
.learning-topics { display: grid; gap: 7px; }
.learning-topic { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; border: 1px solid #e7e9ed; border-radius: 10px; padding: 10px 11px; background: #fafbfc; }
.learning-topic-main { min-width: 0; border: 0; padding: 0; color: var(--text); background: transparent; text-align: left; }
.learning-topic-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.learning-topic-main span { display: block; margin-top: 3px; color: var(--success); font-size: 10px; }
.learning-topic-actions { display: flex; gap: 2px; }
.learning-topic-actions button { border: 0; padding: 4px; color: var(--muted); background: transparent; font-size: 10px; }
.learning-topic-actions button:hover { color: var(--accent); }
.learning-topic-actions .delete:hover { color: var(--danger); }

.health-heading { align-items: center; }
.health-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.health-actions .section-search { width: 210px; }
.health-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.health-summary-card { padding: 15px 17px; }
.health-summary-card span { display: block; color: var(--muted); font-size: 11px; }
.health-summary-card strong { display: block; margin-top: 5px; font-size: 24px; }
.health-summary-card.attention strong { color: var(--warning); }
.health-dashboard { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 18px; align-items: start; }
.health-main-column, .health-side-column { display: grid; gap: 18px; }
.health-record-card { padding: 13px 1px; border-top: 1px solid #f0f1f3; }
.health-record-card:first-child { border-top: 0; }
.health-record-card > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.health-record-card strong { font-size: 13px; }
.health-record-card span, .health-record-card small { color: var(--muted); font-size: 10px; }
.health-record-card p { margin: 7px 0 4px; color: #555c67; font-size: 12px; line-height: 1.55; white-space: pre-line; }
.health-record-card .health-abnormal { color: var(--danger); }
.health-followup-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 11px 1px; border-top: 1px solid #f0f1f3; }
.health-followup-row:first-child { border-top: 0; }
.health-followup-row strong, .health-followup-row span { display: block; }
.health-followup-row strong { font-size: 12px; }
.health-followup-row span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.health-followup-row.overdue strong { color: var(--danger); }
.health-watch-item { padding: 11px 1px; border-top: 1px solid #f0f1f3; }
.health-watch-item:first-child { border-top: 0; }
.health-watch-item strong { font-size: 12px; }
.health-watch-item p { margin: 5px 0; color: #626873; font-size: 11px; line-height: 1.5; }
.health-watch-item span { color: var(--muted); font-size: 10px; }
.health-metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.health-metric-card { position: relative; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #fbfbfc; text-align: left; }
.health-metric-card:hover { border-color: #bfc8c5; background: #f7faf9; }
.health-metric-card > span, .health-metric-card > strong, .health-metric-card > small { display: block; }
.health-metric-card > span { padding-right: 42px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.health-metric-card > strong { margin-top: 8px; font-size: 20px; }
.health-metric-card > strong small { color: var(--muted); font-size: 10px; font-weight: 500; }
.health-metric-card > small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.metric-status { position: absolute; top: 10px; right: 9px; padding: 2px 5px; border-radius: 5px; color: var(--danger); background: var(--danger-soft); font-size: 9px; font-style: normal; }
.metric-status.normal { color: var(--success); background: #edf6f3; }
.health-timeline-item { display: grid; grid-template-columns: 70px 9px minmax(0, 1fr); gap: 8px; min-height: 55px; }
.health-timeline-item time { padding-top: 2px; color: var(--muted); font-size: 9px; }
.health-timeline-item i { position: relative; width: 7px; height: 7px; margin-top: 4px; border: 2px solid #87aa9f; border-radius: 50%; }
.health-timeline-item i::after { content: ""; position: absolute; top: 8px; left: 1px; width: 1px; height: 39px; background: #e1e8e5; }
.health-timeline-item:last-child i::after { display: none; }
.health-timeline-item div span, .health-timeline-item div strong, .health-timeline-item div small { display: block; }
.health-timeline-item div span { color: var(--success); font-size: 9px; }
.health-timeline-item div strong { margin-top: 2px; font-size: 11px; }
.health-timeline-item div small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.health-form-options { display: grid; align-content: end; gap: 8px; padding-bottom: 4px; }
.health-more { padding: 0 12px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.health-more summary { padding-top: 11px; color: #626873; font-size: 12px; cursor: pointer; }
.health-more > div { display: grid; gap: 12px; padding-top: 12px; }
.health-dialog { width: min(720px, calc(100vw - 28px)); }
.health-dialog.compact-dialog { width: min(590px, calc(100vw - 28px)); }
.health-dialog form, .health-metric-detail { display: grid; gap: 14px; padding: 24px; }
.health-dialog form label { display: grid; gap: 6px; color: #626873; font-size: 12px; }
.metric-chart { width: 100%; height: 170px; border-radius: 10px; background: #f8faf9; }
.metric-chart line { stroke: #dfe5e2; stroke-width: 1; }
.metric-chart polyline { fill: none; stroke: var(--success); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.metric-chart circle { fill: white; stroke: var(--success); stroke-width: 2; }
.metric-history-row { display: grid; grid-template-columns: 90px 1fr 1.4fr; gap: 9px; padding: 10px 1px; border-top: 1px solid #f0f1f3; font-size: 11px; }
.metric-history-row time, .metric-history-row span { color: var(--muted); }
.health-disclaimer { margin: 0; color: var(--muted); font-size: 10px; }
.month-task.health { color: #397967; background: #e9f4f0; }
.life-event-row.health-event { border-left-color: #6a9b8c; background: #f2f8f6; }

.archive-intro { max-width: 680px; margin: -12px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.archive-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.archive-card { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 12px; min-height: 145px; color: var(--text); text-align: left; }
.archive-card:hover { border-color: #cbd0db; transform: translateY(-1px); }
.archive-card-mark, .archive-hero-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--archive-color); font-size: 20px; font-style: normal; }
.archive-card-main { min-width: 0; }
.archive-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.archive-card-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.archive-card-summary { display: -webkit-box; margin-top: 9px; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.55; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.archive-card-meta { grid-column: 1 / -1; align-self: end; color: #9298a2; font-size: 10px; }
.archive-status { display: inline-flex; flex: 0 0 auto; padding: 3px 7px; border-radius: 8px; color: #6d7480; background: #f0f1f4; font-size: 10px; font-style: normal; font-weight: 600; }
.archive-status.active { color: var(--success); background: #edf6f3; }
.archive-status.paused { color: var(--warning); background: #fff5e8; }
.archive-status.done { color: var(--accent); background: var(--accent-soft); }
.archive-empty { grid-column: 1 / -1; padding: 45px 20px; }
.archive-detail-nav { display: flex; justify-content: space-between; margin-bottom: 12px; }
.archive-hero { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 16px; align-items: center; padding: 25px; }
.archive-hero-mark { width: 58px; height: 58px; border-radius: 16px; font-size: 25px; }
.archive-hero-title { display: flex; align-items: center; gap: 10px; }
.archive-hero-title h1 { margin: 0; font-size: 27px; letter-spacing: -.03em; }
.archive-hero p { margin: 7px 0 0; color: #555c67; font-size: 13px; line-height: 1.6; }
.archive-hero-meta { margin-top: 8px; color: var(--muted); font-size: 11px; }
.archive-tabs { display: flex; gap: 5px; margin: 14px 0; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: #e9ebef; }
.archive-tabs button { min-width: 72px; padding: 7px 13px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 12px; }
.archive-tabs button.active { color: var(--text); background: white; box-shadow: 0 1px 5px rgba(31,37,51,.1); font-weight: 650; }
.archive-content-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 22px 0 12px; }
.archive-content-heading.compact { margin-top: 0; }
.archive-content-heading h2, .archive-overview-copy h2 { margin: 0; font-size: 17px; }
.archive-content-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.archive-overview-grid { display: grid; grid-template-columns: minmax(260px, .7fr) minmax(0, 1.3fr); gap: 16px; align-items: start; }
.archive-overview-copy p { min-height: 68px; color: #5d6470; font-size: 13px; line-height: 1.75; white-space: pre-wrap; }
.archive-overview-copy dl { display: grid; grid-template-columns: repeat(3, 1fr); margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.archive-overview-copy dl div { display: grid; gap: 3px; }
.archive-overview-copy dt { color: var(--muted); font-size: 10px; }
.archive-overview-copy dd { margin: 0; font-size: 20px; font-weight: 700; }
.archive-timeline { display: grid; gap: 9px; }
.archive-entry-card { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; padding: 16px 18px; cursor: pointer; box-shadow: none; }
.archive-entry-card:hover { border-color: #cfd3dc; }
.archive-entry-date span, .archive-entry-date small { display: block; }
.archive-entry-date span { color: var(--accent); font-size: 12px; font-weight: 650; }
.archive-entry-date small { margin-top: 3px; color: #a0a5ae; font-size: 9px; }
.archive-entry-main { min-width: 0; }
.archive-entry-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.archive-entry-title h3 { margin: 0; font-size: 14px; }
.node-badge, .calendar-badge { padding: 2px 6px; border-radius: 6px; color: #75569f; background: #f4effb; font-size: 9px; }
.calendar-badge { color: #397967; background: #edf6f3; }
.archive-entry-main p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.archive-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.archive-tags span { padding: 2px 6px; border-radius: 6px; color: #68707c; background: var(--surface-soft); font-size: 9px; }
.archive-link-note { display: block; margin-top: 8px; color: var(--success); font-size: 10px; }
.archive-resource-list { display: grid; gap: 9px; }
.archive-resource-item { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; cursor: pointer; box-shadow: none; }
.archive-resource-item span { color: var(--muted); font-size: 10px; }
.archive-resource-item h3 { margin: 4px 0 0; font-size: 14px; }
.archive-resource-item p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.archive-resource-item a { flex: 0 0 auto; color: var(--accent); font-size: 11px; text-decoration: none; }

.bill-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.bill-total { display: grid; gap: 8px; box-shadow: none; }
.bill-total span { color: var(--muted); font-size: 12px; }
.bill-total strong { font-size: 25px; letter-spacing: -.03em; }
.bill-toolbar { grid-template-columns: minmax(230px, 1fr) 190px 150px; }
.bill-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, .6fr); gap: 18px; align-items: start; }
.bill-list { margin-top: 10px; }
.bill-item { display: flex; align-items: flex-start; gap: 8px; padding: 15px 2px; border-top: 1px solid #f0f1f3; }
.bill-item:first-child { border-top: 0; }
.bill-item:hover .bill-name { color: var(--accent); }
.bill-item-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; flex: 1; min-width: 0; gap: 14px; cursor: pointer; }
.bill-item-menu { flex: 0 0 auto; margin-top: -3px; }
.bill-search-excerpt { grid-column: 1 / -1; margin-top: -8px; }
.bill-name { display: block; font-size: 14px; }
.bill-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; color: var(--muted); font-size: 11px; }
.bill-meta span { padding: 2px 6px; border-radius: 5px; background: var(--surface-soft); }
.bill-meta .auto-renew { color: var(--danger); background: var(--danger-soft); font-weight: 650; }
.bill-amount { white-space: nowrap; font-size: 15px; font-weight: 700; }
.bill-amount.income { color: var(--success); }
.bill-category-list { margin-top: 8px; }
.bill-category-item { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 9px 1px; border-top: 1px solid #f0f1f3; font-size: 12px; }
.bill-category-item:first-child { border-top: 0; }
.bill-category-item button { border: 0; color: var(--muted); background: transparent; font-size: 11px; }
.bill-category-item.dragging { opacity: .45; }
.bill-category-item small { color: var(--muted); font-size: 10px; }
.bill-category-drag { color: #a0a5ad; cursor: grab; user-select: none; }
.bill-category-fallback { padding: 2px 6px; border-radius: 999px; color: var(--muted); background: var(--surface-soft); font-size: 10px; }
.danger-btn { padding: 9px 15px; border: 1px solid #e6c7ca; border-radius: 9px; color: var(--danger); background: var(--danger-soft); font-size: 13px; font-weight: 650; }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(290px, .7fr); gap: 18px; align-items: start; }
.settings-grid.single-setting { grid-template-columns: minmax(300px, 620px); }
.storage-mode-badge { padding: 4px 8px; border-radius: 999px; color: #626873; background: #f0f1f4; font-size: 10px; }
.storage-usage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.storage-usage-card { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fbfbfc; }
.storage-usage-card > span { display: block; color: var(--muted); font-size: 11px; }
.storage-usage-card > strong { display: block; margin-top: 7px; color: var(--text); font-size: 18px; }
.storage-usage-card > small { display: block; min-height: 15px; margin-top: 4px; color: #9298a2; font-size: 10px; }
.storage-progress { height: 5px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: #e9ebef; }
.storage-progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.storage-progress[data-level="notice"] i { background: #d2a04e; }
.storage-progress[data-level="warning"] i { background: #d77d43; }
.storage-progress[data-level="severe"] i { background: var(--danger); }
.storage-warning { margin-top: 12px; padding: 10px 12px; border-radius: 9px; color: #82651f; background: #fff7dd; font-size: 11px; }
.storage-warning[data-level="warning"] { color: #8b4e26; background: #fff0e5; }
.storage-warning[data-level="severe"] { color: #9b3d43; background: #fff0f1; }
.record-stats { margin-top: 20px; }
.record-stats h3 { margin: 0 0 9px; color: #626873; font-size: 12px; }
.record-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.record-stats-grid div { min-width: 0; padding: 10px; border-radius: 9px; background: var(--surface-soft); }
.record-stats-grid strong, .record-stats-grid span { display: block; }
.record-stats-grid strong { font-size: 17px; }
.record-stats-grid span { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.backup-section, .csv-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.backup-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.backup-section h3, .csv-section h3 { margin: 0; font-size: 13px; }
.backup-section-heading p, .csv-section p, .backup-explain { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.backup-actions { margin-top: 12px; }
.backup-overdue { margin-top: 11px; padding: 9px 11px; border-radius: 8px; color: #866226; background: #fff7df; font-size: 11px; }
.csv-section > div { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.nav-settings-panel { margin-top: 18px; }
.nav-settings-list { display: grid; gap: 6px; margin-top: 16px; }
.nav-setting-row { display: grid; grid-template-columns: 22px minmax(92px, .65fr) minmax(130px, 1fr) auto; align-items: center; gap: 9px; min-height: 50px; padding: 7px 8px; border: 1px solid #e7e9ed; border-radius: 9px; background: #fbfbfc; }
.nav-setting-row.dragging { opacity: .42; border-style: dashed; background: var(--accent-soft); }
.nav-drag-handle { color: #a1a6af; font-size: 18px; cursor: grab; }
.nav-setting-row > div strong, .nav-setting-row > div small { display: block; }
.nav-setting-row > div strong { font-size: 12px; }
.nav-setting-row > div small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.nav-setting-row > input { min-width: 0; width: 100%; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 12px; }
.nav-order-buttons { display: flex; gap: 2px; }
.nav-order-buttons button { width: 27px; height: 27px; padding: 0; border: 0; border-radius: 6px; color: #717781; background: #f0f1f4; }
.nav-order-buttons button:hover:not(:disabled) { color: var(--accent); background: var(--accent-soft); }
.nav-order-buttons button:disabled { opacity: .35; cursor: default; }
.nav-fixed-note { display: flex; justify-content: space-between; margin-top: 11px; color: var(--muted); font-size: 10px; }
.routines-layout { display: grid; grid-template-columns: minmax(340px, .85fr) minmax(360px, 1.15fr); gap: 18px; align-items: start; }
.routine-group + .routine-group { margin-top: 25px; padding-top: 22px; border-top: 1px solid var(--line); }
.domain-dot { width: 9px; height: 9px; border-radius: 50%; }
.domain-dot.work { background: var(--accent); }
.domain-dot.life { background: var(--success); }
.weekday-picker { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.weekday-picker legend { margin-bottom: 7px; color: #626873; font-size: 12px; }
.weekday-picker label { display: inline-flex; align-items: center; justify-content: center; gap: 3px; width: 39px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: white; cursor: pointer; }
.weekday-picker input { width: auto; margin: 0; accent-color: var(--accent); }
.stack-form { display: grid; gap: 13px; padding: 16px; margin-top: 18px; border-radius: 11px; background: var(--surface-soft); }
.stack-form label, #task-form label, #matter-form label, #matter-entry-form label, #bill-form label, #life-event-form label, #calendar-create-form label, #course-form label, #day-tag-form label, #archive-form label, #study-entry-form label, #study-resource-form label, #shift-dialog label { display: grid; gap: 6px; color: #626873; font-size: 12px; }
.stack-form .primary-btn { justify-self: start; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.form-row.three { grid-template-columns: repeat(3, 1fr); }
.rule-list { margin-top: 16px; }
.rule-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 2px; border-top: 1px solid var(--line); }
.rule-item strong { display: block; font-size: 13px; }
.rule-item span { color: var(--muted); font-size: 11px; }
.rule-item-actions { display: flex; align-items: center; gap: 3px; }
.rule-more { position: relative; }
.rule-more summary { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--muted); cursor: pointer; list-style: none; }
.rule-more summary::-webkit-details-marker { display: none; }
.rule-more summary:hover { background: var(--surface-soft); color: var(--text); }
.rule-more > div { position: absolute; z-index: 20; top: calc(100% + 4px); right: 0; min-width: 92px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.rule-more button { display: block; width: 100%; padding: 7px 9px; border: 0; border-radius: 7px; background: transparent; text-align: left; white-space: nowrap; }
.rule-more button:hover { background: var(--surface-soft); }
.text-btn { border: 0; background: transparent; color: var(--accent); font-size: 12px; }
.text-btn.muted { color: var(--muted); }
.data-row { margin-top: 20px; display: grid; gap: 8px; color: var(--muted); font-size: 12px; }
code { padding: 3px 6px; border-radius: 5px; background: #f0f1f4; color: #59606b; font-family: Consolas, monospace; font-size: 11px; word-break: break-all; }
.backup-note { margin-top: 20px; padding: 14px; border-radius: 10px; background: #f6f7fa; }
.backup-note strong { font-size: 13px; }
.backup-note p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }

dialog { width: min(690px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 24px 80px rgba(25, 30, 42, .22); }
dialog::backdrop { background: rgba(30, 34, 43, .4); backdrop-filter: blur(2px); }
#task-form, #matter-form, #bill-form, #life-event-form, #calendar-create-form, #course-form, #day-tag-form, #archive-form, #study-entry-form, #study-resource-form, #backup-restore-form { padding: 24px; display: grid; gap: 15px; }
#matter-dialog { width: min(780px, calc(100vw - 28px)); }
#backup-preview-dialog { width: min(650px, calc(100vw - 28px)); }
.backup-preview-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border-radius: 9px; background: var(--surface-soft); }
.backup-preview-meta span { color: var(--muted); font-size: 11px; }
.backup-preview-meta strong { font-size: 12px; }
.backup-preview-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; max-height: 190px; overflow-y: auto; }
.backup-preview-counts div { padding: 9px; border: 1px solid var(--line); border-radius: 8px; }
.backup-preview-counts strong, .backup-preview-counts span { display: block; }
.backup-preview-counts strong { font-size: 15px; }
.backup-preview-counts span { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.backup-preview-warning { padding: 10px 11px; border-radius: 8px; color: #8b4e26; background: #fff0e5; font-size: 10px; line-height: 1.5; }
.restore-mode { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.restore-mode legend { margin-bottom: 7px; color: #626873; font-size: 11px; }
.restore-mode label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.restore-mode input, .full-restore-confirm input { width: auto; accent-color: var(--accent); }
.restore-mode strong, .restore-mode small { display: block; }
.restore-mode strong { font-size: 12px; }
.restore-mode small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.full-restore-confirm { display: flex; align-items: center; gap: 8px; padding: 10px 11px; border-radius: 8px; color: var(--danger); background: var(--danger-soft); font-size: 11px; }
#calendar-create-dialog { width: min(590px, calc(100vw - 28px)); }
#course-dialog { width: min(620px, calc(100vw - 28px)); }
#activity-dialog { width: min(620px, calc(100vw - 28px)); }
.today-context { display: flex; align-items: center; gap: 8px; }
.today-shift { padding: 2px 7px; border-radius: 999px; color: #707681; background: #f0f1f4; font-size: 10px; }
.today-shift:empty { display: none; }
.calendar-create-more { padding: 0 12px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.calendar-create-more summary { padding: 11px 0 0; color: #626873; font-size: 12px; cursor: pointer; }
.calendar-create-more > div { display: grid; gap: 13px; padding-top: 13px; }
.calendar-create-options { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.calendar-create-options > label { min-width: 110px; }
#study-entry-dialog { width: min(820px, calc(100vw - 28px)); }
.rich-editor-wrap { overflow: hidden; border: 1px solid #dfe2e7; border-radius: 10px; background: white; }
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 3px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.rich-toolbar button { padding: 5px 8px; border: 0; border-radius: 6px; color: #626873; background: transparent; font-size: 11px; }
.rich-toolbar button:hover { color: var(--accent); background: white; }
.rich-editor { min-height: 230px; max-height: 48vh; overflow-y: auto; padding: 15px; color: #333943; font-size: 14px; line-height: 1.75; outline: 0; }
.rich-editor.matter-editor { min-height: 190px; }
.rich-editor:empty::before { content: attr(data-placeholder); color: #a2a7b0; }
.rich-editor h2 { margin: 14px 0 7px; font-size: 20px; }
.rich-editor blockquote { margin: 12px 0; padding: 8px 12px; border-left: 3px solid #b9c0e8; color: #666d79; background: #f7f8fc; }
.rich-editor hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.study-entry-options { display: flex; flex-wrap: wrap; gap: 18px; padding: 11px 12px; border-radius: 9px; background: var(--surface-soft); }
.linked-task-note { padding: 9px 11px; border-radius: 8px; color: var(--success); background: #edf6f3; font-size: 11px; }
.danger-text { margin-right: auto; color: var(--danger); }
.calendar-day-dialog-content { display: grid; gap: 14px; padding: 22px; }
#calendar-day-dialog { width: min(560px, calc(100vw - 28px)); max-height: min(720px, calc(100vh - 32px)); }
.calendar-day-dialog-list { max-height: min(590px, calc(100vh - 130px)); overflow-y: auto; overscroll-behavior: contain; }
.calendar-day-dialog-section + .calendar-day-dialog-section { margin-top: 16px; }
.calendar-day-dialog-section h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 5px; color: var(--muted); font-size: 11px; }
.calendar-day-dialog-section h3 span { padding: 1px 6px; border-radius: 10px; background: #f0f1f4; font-size: 9px; }
.dialog-header { display: flex; justify-content: space-between; align-items: flex-start; }
.dialog-header h2 { margin: 4px 0 0; font-size: 21px; }
.icon-btn { width: 32px; height: 32px; border: 0; border-radius: 8px; color: #7a808b; background: #f3f4f6; font-size: 22px; }
#task-form textarea, #bill-form textarea, #life-event-form textarea, #course-form textarea { resize: vertical; }
.check-line { display: flex !important; grid-template-columns: auto 1fr; align-items: center; justify-content: start; }
.check-line input { width: auto !important; accent-color: var(--accent); }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 3px; }
.dialog-actions span { margin-right: auto; color: var(--muted); font-size: 11px; }
.task-dialog-actions .danger-text { margin-right: 0; }
.task-dialog-actions #dialog-tip { margin-right: auto; }
.task-dialog-actions #cancel-task-btn { color: #796467; border-color: #ded1d3; background: #fbf8f8; }
.task-dialog-actions #cancel-task-btn.restore { color: #626873; border-color: var(--line); background: white; }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 20; transform: translate(-50%, 20px); padding: 10px 16px; border-radius: 9px; background: #262b35; color: white; box-shadow: 0 10px 30px rgba(0,0,0,.18); font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.calendar-heading { align-items: flex-end; }
.calendar-heading-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.calendar-heading-actions .section-search { width: 210px; }
.calendar-filter-bar { display: flex; align-items: end; gap: 14px; margin-bottom: 12px; padding: 11px 13px; box-shadow: none; }
.calendar-filter-bar label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
.calendar-filter-bar select { min-width: 132px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; color: #626873; background: white; font-size: 12px; }
.calendar-filter-bar select:disabled { color: #a5aab2; background: #f3f4f6; cursor: not-allowed; }
.calendar-filter-bar .calendar-shift-toggle { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; white-space: nowrap; }
.calendar-filter-bar .calendar-shift-toggle input { width: auto; accent-color: var(--accent); }
.calendar-filter-bar > span { margin: 0 0 8px auto; color: #9298a2; font-size: 10px; }
.activity-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin: 0 0 12px; }
.activity-stats div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.62); }
.activity-stats span { overflow: hidden; font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.activity-stats strong { color: #545c69; font-size: 11px; white-space: nowrap; }
.calendar-toolbar { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 13px; margin-bottom: 14px; box-shadow: none; }
.calendar-unscheduled-button { margin-left: 5px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; color: #686f7a; background: #fafbfc; font-size: 11px; }
.calendar-unscheduled-button span { color: var(--accent); font-weight: 700; }
.calendar-period-button { margin: 0 3px 0 auto; padding: 6px 9px; border: 0; border-radius: 8px; color: var(--text); background: transparent; font-size: 17px; font-weight: 700; }
.calendar-period-button::after { content: "⌄"; margin-left: 7px; color: #969ca6; font-size: 11px; }
.calendar-period-button:hover, .calendar-period-button[aria-expanded="true"] { background: #f2f3f6; }
.calendar-jump-panel { position: absolute; z-index: 8; top: calc(100% + 7px); right: 12px; width: min(310px, calc(100vw - 40px)); padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 16px 45px rgba(31, 37, 51, .16); }
.calendar-jump-panel[hidden] { display: none; }
.calendar-jump-field, #calendar-jump-form label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.calendar-jump-field input, #calendar-jump-form input { width: 100%; min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: white; font-size: 12px; }
.calendar-jump-or { display: flex; align-items: center; gap: 8px; margin: 9px 0; color: #a0a5ad; font-size: 10px; }
.calendar-jump-or::before, .calendar-jump-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#calendar-jump-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 9px; }
.calendar-jump-error { grid-column: 1 / -1; margin: 0; color: var(--danger); font-size: 10px; }
.calendar-month-shortcuts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.calendar-month-shortcuts[hidden] { display: none; }
.calendar-month-shortcuts button { padding: 6px 4px; border: 1px solid var(--line); border-radius: 7px; color: #777d87; background: white; font-size: 10px; }
.calendar-month-shortcuts button:hover { color: var(--text); background: #f7f8fa; }
.calendar-month-shortcuts button.current { color: #5d67a7; background: #f2f4fc; border-color: #dfe3f5; font-weight: 650; }
.icon-nav { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; color: #626873; background: white; }
.month-calendar { overflow: hidden; padding: 0; }
.calendar-weekdays, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays div { padding: 10px 8px; border-bottom: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 11px; }
.month-day { position: relative; min-height: 126px; padding: 8px; border-right: 1px solid #eceef1; border-bottom: 1px solid #eceef1; background: white; cursor: pointer; }
.month-day:nth-child(7n) { border-right: 0; }
.month-day.outside { background: #fafbfc; color: #b3b7be; }
.month-day:hover { background: #f8f9fd; }
@media (hover: hover) {
  .month-day:hover::after { content: "＋"; position: absolute; right: 8px; bottom: 7px; color: #a4a9b3; font-size: 13px; pointer-events: none; }
}
.month-day.today .day-number { color: white; background: var(--accent); }
.month-day.jump-highlight { background: #f3f5ff; outline: 2px solid rgba(82, 97, 201, .28); outline-offset: -2px; }
.month-day.has-ddl { box-shadow: inset 0 -2px 0 #d4a05d; }
.month-day.has-overdue { box-shadow: inset 0 -2px 0 var(--danger); }
.month-task.matter { color: #67617c; background: #f1eff6; }
.matter-event .life-event-mark { color: #736b92; background: #f0eef6; }
.day-number { width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; color: inherit; background: transparent; font-size: 12px; }
.month-day-head { min-height: 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; }
.day-context-tags { min-width: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; }
.day-context-add { width: 19px; height: 17px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; border: 0; border-radius: 5px; color: #a2a7af; background: transparent; font-size: 12px; line-height: 1; }
.day-context-add:hover, .day-context-add:focus-visible { color: var(--accent); background: #eef0f8; }
.calendar-cell-quick-menu { position: fixed; z-index: 18; width: 174px; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: 0 12px 34px rgba(31, 37, 51, .18); }
.calendar-cell-quick-menu[hidden] { display: none; }
.calendar-cell-quick-date { padding: 4px 7px 6px; color: var(--muted); font-size: 10px; }
.calendar-cell-quick-menu > button { width: 100%; padding: 7px 8px; border: 0; border-radius: 6px; color: #555c68; background: transparent; font-size: 11px; text-align: left; }
.calendar-cell-quick-menu > button:hover { color: var(--text); background: #f3f4f7; }
.calendar-cell-tag-form { display: grid; gap: 8px; }
.calendar-cell-tag-form label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.calendar-cell-tag-form input { width: 100%; min-width: 0; padding: 7px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: white; font-size: 12px; }
.calendar-cell-tag-form > div { display: flex; justify-content: flex-end; gap: 6px; }
.calendar-cell-tag-form button { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; color: #6d737d; background: white; font-size: 10px; }
.calendar-cell-tag-form button.primary-btn { color: white; border-color: var(--accent); background: var(--accent); }
.shift-badge { min-width: 0; max-width: 74px; padding: 2px 5px; border: 0; border-radius: 5px; color: #858a93; background: #f2f3f5; font-size: 8px; line-height: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-tag-badge, .day-tag-more { min-width: 0; max-width: 74px; padding: 2px 5px; border: 0; border-radius: 5px; color: #6c7280; background: #f4f5f7; box-shadow: inset 2px 0 var(--tag-color, #7b8498); font-size: 8px; line-height: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-tag-more { color: var(--accent); box-shadow: none; }
.shift-badge.override { color: #6f6457; background: #f4f1eb; }
.shift-badge.shift-work { color: #777e88; background: #f1f2f4; }
.shift-badge.shift-rest { color: #60776f; background: #edf3f1; }
.shift-badge.shift-holiday { color: #936844; background: #f8f0e6; }
.shift-badge.shift-leave { color: #806781; background: #f5eff5; }
.day-shift-strip { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.65); font-size: 11px; }
.day-shift-strip button { border: 0; color: #666d78; background: transparent; font-weight: 650; }
.shift-dialog-content { display: grid; gap: 16px; max-height: min(760px, calc(100vh - 30px)); padding: 22px; overflow-y: auto; }
#shift-dialog { width: min(610px, calc(100vw - 28px)); }
.shift-section { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; }
.shift-section.subtle { background: #fafbfc; }
.shift-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.shift-section-heading h3 { margin: 0; font-size: 14px; }
.shift-section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.shift-section-heading select { width: auto !important; min-width: 100px; padding: 6px 8px !important; }
.month-task { display: block; width: 100%; margin-top: 5px; padding: 3px 5px; border: 0; border-radius: 5px; background: #f1f3f8; color: #535966; font-size: 10px; line-height: 14px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month-task-line { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; min-height: 20px; margin-top: 5px; border-radius: 5px; background: #f1f3f8; }
.month-task-line.life { background: #edf6f3; color: #397967; }
.month-task-line .month-task { min-width: 0; margin: 0; padding-left: 0; color: inherit; background: transparent; }
.month-check { width: 22px; height: 20px; display: grid; place-items: center; padding: 0; border: 0; color: #8a9099; background: transparent; }
.month-check span { width: 13px; height: 13px; display: grid; place-items: center; border: 1.5px solid currentColor; border-radius: 50%; font-size: 8px; font-weight: 750; line-height: 1; }
.month-task-line.completed { color: #9297a0; background: #f1f2f3; }
.month-task-line.completed .month-task { text-decoration: line-through; opacity: .72; }
.month-task-line.completed .month-check { color: #6f7896; }
.month-task-line.cancelled { color: #8d7b7e; background: #f5f1f1; opacity: .7; }
.month-task-line.cancelled .month-task { opacity: .78; }
.month-task-line.search-match, .month-task.search-match { box-shadow: inset 0 0 0 1px #c6cc73; background: #f6f7df; }
.month-cancel-mark { width: 22px; height: 20px; display: grid; place-items: center; color: #98777b; font-size: 13px; font-weight: 700; }
.month-task.life { background: #edf6f3; color: #397967; }
.month-task.course { background: #eef1f6; color: #556274; }
.month-task.activity { background: #edf5f4; color: #426d69; }
.month-task.record { background: #fff5e8; color: #9a652c; }
.month-task.milestone { background: #f4effb; color: #75569f; font-weight: 650; }
.more-count { display: block; margin-top: 4px; padding: 0; border: 0; color: var(--accent); background: transparent; font-size: 10px; cursor: pointer; }
.calendar-legend { display: flex; gap: 14px; padding: 10px 14px; color: var(--muted); font-size: 10px; }
.calendar-legend span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 2px; background: #dfe2e7; }
.calendar-legend .legend-ddl::before { background: #d4a05d; }
.calendar-legend .legend-overdue::before { background: var(--danger); }
.calendar-legend .legend-record::before { background: #d9a665; }
.calendar-legend .legend-milestone::before { background: #8c6ab4; }
.day-view { display: grid; gap: 14px; }
.day-quick { display: grid; grid-template-columns: minmax(0,1fr) 90px auto; gap: 8px; }
.day-quick input, .day-quick select { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: white; }
.day-add-zone { width: 100%; padding: 16px; border: 1px dashed #d9dce2; border-radius: 11px; color: var(--muted); background: rgba(255,255,255,.6); font-size: 12px; }
.day-add-zone:hover { color: var(--accent); border-color: #bcc3e5; background: #f8f9fd; }
.day-add-zone span { margin-right: 5px; }
.day-tag-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.65); }
.day-tag-strip > span { margin-right: auto; color: var(--muted); font-size: 11px; }
.day-activity-add { width: max-content; padding: 7px 10px; border: 1px solid #dce6e4; border-radius: 8px; color: #53716e; background: #f5f9f8; font-size: 11px; }
.day-activity-add:hover { color: #315f5a; background: #edf5f4; }
#day-tag-dialog { width: min(450px, calc(100vw - 28px)); }
.day-tag-presets { display: grid; gap: 7px; }
.day-tag-presets > span { color: var(--muted); font-size: 11px; }
.day-tag-presets > div, .day-tag-existing { display: flex; flex-wrap: wrap; gap: 6px; }
.day-tag-presets button, .day-tag-existing button { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; color: #656c77; background: #fafbfc; font-size: 11px; }
.day-tag-existing { padding-top: 10px; border-top: 1px solid var(--line); }
.day-tag-existing:empty { display: none; }
#course-dialog.quick-course { width: min(460px, calc(100vw - 28px)); }
#course-dialog.quick-course .course-extended { display: none; }
.day-domain-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.day-domain-panel h2 { margin: 0; font-size: 16px; }
.day-section { margin-top: 16px; }
.day-section h3 { margin: 0 0 4px; color: var(--muted); font-size: 11px; font-weight: 650; }
.life-event-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 50px; padding: 8px 0; border-top: 1px solid #f0f1f3; cursor: pointer; }
.life-event-row:first-child { border-top: 0; }
.life-event-mark { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; color: #9a652c; background: #fff5e8; font-size: 11px; }
.life-event-row.milestone .life-event-mark { color: #75569f; background: #f4effb; }
.life-event-row.course-event .life-event-mark { color: #59687a; background: #eef1f6; }
.life-event-row.activity-event .life-event-mark { color: #426d69; background: #edf5f4; }
.life-event-row strong { display: block; font-size: 13px; }
.life-event-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.life-event-kind { color: var(--muted); font-size: 10px; }
.edit-completion-control { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface-soft); font-size: 11px; }
.edit-completion-control button { display: flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--accent); border-radius: 8px; color: white; background: var(--accent); }
.edit-completion-control button i { font-style: normal; font-size: 15px; line-height: 1; }
.edit-completion-control button.completed { color: #687294; background: #f1f3fa; border-color: #dce0f0; }
.home-unscheduled-panel { box-shadow: none; }
.section-icon.unscheduled { color: #6f7580; background: #eef0f3; }
.home-unscheduled-list { display: grid; margin-top: 3px; }
.home-unscheduled-more { display: block; margin: 9px 0 0 auto; padding: 4px 2px; border: 0; color: #777e89; background: transparent; font-size: 11px; }
.home-unscheduled-more:hover { color: var(--accent); }
.home-unscheduled-more[hidden] { display: none; }
.waiting-details { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }
.waiting-details p { margin: -2px 0 0; color: var(--muted); font-size: 10px; }
#unscheduled-dialog { position: fixed; inset: 0 0 0 auto; width: min(460px, 100vw); max-width: none; height: 100vh; max-height: none; margin: 0; border-radius: 16px 0 0 16px; }
#unscheduled-dialog::backdrop { background: rgba(30, 34, 44, .2); }
.unscheduled-drawer { display: flex; flex-direction: column; height: 100%; padding: 22px 20px; }
.unscheduled-header-actions { display: flex; align-items: center; gap: 7px; }
.unscheduled-intro { margin: -4px 0 14px; color: var(--muted); font-size: 11px; }
.unscheduled-create { display: grid; gap: 8px; margin-bottom: 12px; padding: 11px; border: 1px solid #dfe3f2; border-radius: 10px; background: #f8f9fd; }
.unscheduled-create-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.unscheduled-create-main input, .unscheduled-create select, .unscheduled-create-more input { width: 100%; min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: white; }
.unscheduled-create summary { width: max-content; color: var(--muted); font-size: 10px; cursor: pointer; }
.unscheduled-create-more { display: grid; gap: 9px; margin-top: 9px; }
.unscheduled-create-more label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
#unscheduled-create-waiting { display: grid; grid-template-columns: minmax(0, 1fr) 145px; gap: 9px; }
#unscheduled-create-waiting[hidden] { display: none; }
.unscheduled-list { display: grid; gap: 9px; min-height: 0; overflow-y: auto; }
.unscheduled-item { padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.unscheduled-main { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.unscheduled-check { width: 32px; height: 32px; border: 0; color: #8a9099; background: transparent; font-size: 17px; }
.unscheduled-title { min-width: 0; border: 0; color: var(--text); background: transparent; text-align: left; }
.unscheduled-title strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.unscheduled-title small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.unscheduled-date-toggle { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; color: #626a76; background: #fafbfc; font-size: 10px; white-space: nowrap; }
.unscheduled-waiting { margin: 8px 0 0 38px; color: #7b7180; font-size: 10px; line-height: 1.5; }
.unscheduled-date-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 9px 0 0 38px; padding-top: 9px; border-top: 1px solid #eef0f3; }
.unscheduled-date-panel[hidden] { display: none; }
.unscheduled-date-panel button { padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; color: #656c77; background: white; font-size: 10px; }
.unscheduled-date-panel input { width: 126px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; font-size: 10px; }
.unscheduled-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 8px 0 0 38px; }
.unscheduled-actions button { border: 0; color: var(--muted); background: transparent; font-size: 10px; }
.unscheduled-actions .danger-text { color: #9b6b70; }
.unscheduled-item.compact { padding: 7px 0; border: 0; border-top: 1px solid #f0f1f3; border-radius: 0; }
.unscheduled-item.compact:first-child { border-top: 0; }
.unscheduled-item.compact .unscheduled-waiting { margin-top: 4px; }
.unscheduled-item.compact .unscheduled-date-panel { padding-bottom: 4px; }
.year-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; }
.mini-month { padding: 14px; cursor: pointer; box-shadow: none; }
.mini-month:hover { border-color: #cfd3dc; }
.mini-month h3 { margin: 0 0 10px; font-size: 13px; }
.mini-week, .mini-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.mini-week span { color: #a0a5ae; text-align: center; font-size: 8px; }
.mini-day { aspect-ratio: 1; display: grid; place-items: center; border-radius: 4px; color: #717781; font-size: 8px; }
.mini-day.outside { visibility: hidden; }
.mini-day.density-1 { background: #eef0f8; }
.mini-day.density-2 { background: #dfe3f4; }
.mini-day.density-3 { color: #fff; background: #8994d6; }
.mini-day.today { outline: 1.5px solid var(--accent); }
.mini-day[data-calendar-date] { cursor: pointer; }
.mini-day.has-record::after, .mini-day.has-milestone::after { content: ""; position: absolute; bottom: 1px; width: 3px; height: 3px; border-radius: 50%; background: #d9a665; }
.mini-day.has-milestone::after { background: #8c6ab4; }
.mini-day { position: relative; }

@media (max-width: 980px) {
  .dashboard-grid, .settings-grid, .routines-layout, .learning-layout, .bill-layout, .archive-overview-grid, .health-dashboard, .matter-detail-grid { grid-template-columns: 1fr; }
  .project-grid, .archive-grid { grid-template-columns: repeat(2, 1fr); }
  .year-grid { grid-template-columns: repeat(2, 1fr); }
  .visit-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .auth-card { padding: 24px 20px; }
  .online-account span { display: none; }
  .trip-grid, .trip-overview-grid, .trip-stay-grid, .trip-transport-list { grid-template-columns: 1fr; }
  .trip-hero, .trip-section-head { align-items: flex-start; flex-direction: column; }
  .trip-hero-side { min-width: 0; align-items: flex-start; }
  .trip-route-row { grid-template-columns: 44px minmax(0, 1fr); }
  .trip-route-row b { display: none; }
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 10; top: auto; bottom: 0; width: 100%; height: 66px; padding: 7px 5px; overflow-x: auto; border-top: 1px solid var(--line); border-right: 0; }
  .brand, .sidebar-tip { display: none; }
  nav { display: grid; grid-template-columns: repeat(9, 64px); gap: 1px; width: max-content; min-width: 100%; }
  .nav-item { justify-content: center; flex-direction: column; gap: 1px; padding: 5px 2px; font-size: 10px; }
  .nav-item .nav-icon { font-size: 15px; }
  .nav-item .nav-label { max-width: 60px; font-size: 10px; }
  main { padding: 18px 14px 88px; }
  .global-bar { margin-bottom: 18px; }
  .scope-caption { display: none; }
  .page-header { margin-bottom: 18px; }
  .page-header-actions { align-items: flex-end; flex-direction: column-reverse; }
  .section-search { width: min(230px, 58vw); }
  .section-search-results { margin-top: -8px; }
  .section-search-result { grid-template-columns: 72px minmax(0, 1fr); }
  .section-search-result small { grid-column: 2; }
  .calendar-heading { align-items: flex-start; }
  .calendar-heading-actions { max-width: 235px; align-items: flex-end; flex-direction: column-reverse; }
  .calendar-heading-actions .section-search { width: 220px; }
  .calendar-filter-bar { display: grid; grid-template-columns: 1fr 1fr; }
  .calendar-filter-bar select { min-width: 0; width: 100%; }
  .calendar-filter-bar > span { grid-column: 1 / -1; margin: 0; }
  .calendar-filter-bar .calendar-shift-toggle { margin: 0; }
  .home-heading h1 { font-size: 25px; }
  .quick-capture { grid-template-columns: auto minmax(60px, 1fr) auto auto auto; gap: 5px; padding: 10px 8px; }
  .quick-capture > button[type="submit"] { display: block; padding: 7px 8px; font-size: 11px; }
  .quick-capture .quick-date-button { display: block; min-width: 54px; padding: 7px 5px; }
  .quick-capture select { max-width: 58px; padding: 7px 4px; }
  .quick-date-panel { right: -70px; width: min(286px, calc(100vw - 28px)); }
  .upcoming-heading { align-items: flex-start; }
  .upcoming-tools { align-items: flex-end; flex-direction: column-reverse; gap: 5px; }
  .range-switch button { padding: 5px 6px; }
  .dashboard-grid { margin-top: 38px; }
  .panel { padding: 16px; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .bill-toolbar { grid-template-columns: 1fr 1fr; }
  .bill-toolbar #bill-direction-filter { grid-column: 1 / -1; }
  .search-box { grid-column: 1 / -1; }
  .task-table .task-row { grid-template-columns: 25px minmax(0, 1fr) auto; }
  .table-project { display: none; }
  .inline-form { grid-template-columns: 1fr 44px auto; }
  .inline-form > div { grid-column: 1 / -1; }
  .project-grid { grid-template-columns: 1fr; }
  .project-toolbar { flex-wrap: wrap; }
  .project-toolbar > span { width: 100%; margin-left: 0; }
  #project-edit-dialog, #project-category-dialog { width: 100%; max-width: none; max-height: 90vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  #project-edit-form, .project-category-dialog-content { max-height: 90vh; overflow-y: auto; padding: 18px 14px 22px; }
  .domain-label-editor, .project-category-columns { grid-template-columns: 1fr; }
  .project-category-item { grid-template-columns: auto minmax(0,1fr) auto auto auto; }
  .project-category-item small, .project-category-item .category-drag { display: none; }
  .archive-grid { grid-template-columns: 1fr; }
  .matter-groups { grid-template-columns: 1fr; }
  .matter-task-form { grid-template-columns: 1fr; }
  .matter-calendar-options { grid-template-columns: 1fr; }
  .matter-more-content { grid-template-columns: 1fr; }
  .visit-toolbar, #visit-option-columns, .visit-detail-facts { grid-template-columns: 1fr; }
  .visit-grid { grid-template-columns: 1fr; }
  #visit-dialog { width: 100%; max-width: none; max-height: 92vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .travel-overview, .travel-section-grid { grid-template-columns: 1fr; }
  .health-heading { align-items: flex-start; }
  .health-actions { max-width: 235px; }
  .health-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .health-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-dialog { width: 100%; max-width: none; max-height: 90vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .health-dialog form, .health-metric-detail { max-height: 90vh; overflow-y: auto; padding: 18px 16px 22px; }
  .archive-card { min-height: 128px; }
  .archive-hero { grid-template-columns: 48px minmax(0, 1fr); padding: 18px; }
  .archive-hero-mark { width: 44px; height: 44px; border-radius: 12px; font-size: 20px; }
  .archive-hero-title h1 { font-size: 22px; }
  .archive-tabs { overflow-x: auto; }
  .archive-tabs button { min-width: 68px; }
  .archive-content-heading { align-items: center; }
  .archive-entry-card { grid-template-columns: 58px minmax(0, 1fr); padding: 14px; }
  .archive-resource-item { align-items: flex-start; }
  #archive-form, #study-entry-form, #study-resource-form { padding: 18px 16px 20px; }
  .rich-editor { min-height: 190px; max-height: 38vh; }
  .study-entry-options { display: grid; gap: 10px; }
  .form-row, .form-row.three { grid-template-columns: 1fr; }
  .bill-summary-grid { grid-template-columns: 1fr 1fr; }
  .storage-usage-grid { grid-template-columns: 1fr; }
  .record-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-setting-row { grid-template-columns: 20px minmax(0, 1fr) auto; }
  .nav-setting-row > div { display: none; }
  .nav-drag-handle { opacity: .35; }
  .backup-section-heading { align-items: flex-start; }
  .backup-preview-counts { grid-template-columns: repeat(2, 1fr); }
  #backup-preview-dialog { width: 100%; max-width: none; max-height: 88vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  #backup-restore-form { max-height: 88vh; overflow-y: auto; padding: 18px 16px 22px; }
  .month-day { min-height: 116px; padding: 5px; }
  .day-context-add { width: 24px; height: 24px; margin: -3px; }
  .month-task { margin-top: 3px; padding: 2px 3px; font-size: 9px; line-height: 11px; }
  .month-task-line { grid-template-columns: 36px minmax(0, 1fr); min-height: 36px; margin-top: 3px; }
  .month-task-line .month-task { padding-left: 0; }
  .month-check { width: 36px; height: 36px; }
  .more-count { margin-top: 3px; font-size: 9px; }
  #calendar-day-dialog { width: 100%; max-width: none; max-height: 82vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  #unscheduled-dialog { inset: auto 0 0; width: 100%; height: min(82vh, 720px); border-radius: 16px 16px 0 0; }
  .unscheduled-drawer { padding: 18px 14px 20px; }
  .unscheduled-header-actions .ghost-btn { padding-inline: 8px; font-size: 10px; }
  #unscheduled-create-waiting { grid-template-columns: 1fr; }
  .unscheduled-date-toggle { min-height: 36px; }
  .unscheduled-date-panel button { min-height: 36px; }
  #calendar-create-dialog { width: 100%; max-width: none; max-height: 88vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  #course-dialog, #activity-dialog { width: 100%; max-width: none; max-height: 90vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .activity-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #day-tag-dialog { width: 100%; max-width: none; max-height: 86vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  #shift-dialog { width: 100%; max-width: none; max-height: 90vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  #calendar-create-form { max-height: 88vh; overflow-y: auto; padding: 18px 16px 22px; }
  #course-form { max-height: 90vh; overflow-y: auto; padding: 18px 16px 22px; }
  #day-tag-form { max-height: 86vh; overflow-y: auto; padding: 18px 16px 22px; }
  .shift-dialog-content { max-height: 90vh; padding: 18px 14px 22px; }
  .calendar-day-dialog-content { padding: 18px 16px 20px; }
  .calendar-day-dialog-list { max-height: calc(82vh - 82px); }
  .day-domain-grid { grid-template-columns: 1fr; }
  .year-grid { grid-template-columns: 1fr; }
  .day-quick { grid-template-columns: 1fr 80px; }
  .day-quick button { grid-column: 1 / -1; }
  .dialog-actions span { display: none; }
}
