:root {
  color-scheme: light;
  --ink: #172e4b;
  --muted: #6d7b8d;
  --line: #dce3ed;
  --paper: #ffffff;
  --canvas: #f3f6fa;
  --brand: #214a78;
  --brand-dark: #122d50;
  --brand-soft: #e8f0fa;
  --accent: #f7c75e;
  --danger: #a63d4a;
  --shadow: 0 12px 32px rgba(23, 49, 46, .08);
  --radius: 18px;
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(11, 95, 85, .28); outline-offset: 2px;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; background: var(--ink); color: #fff; padding: .8rem 1rem; border-radius: 8px; }
.skip-link:focus { top: 1rem; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 242px minmax(0, 1fr); grid-template-rows: 72px minmax(0, 1fr); }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 24px; color: #fff; background: var(--brand-dark); box-shadow: 0 3px 16px rgba(0,0,0,.15); z-index: 5; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border: 2px solid rgba(255,255,255,.75); border-radius: 13px; color: var(--accent); font-weight: 900; letter-spacing: -.04em; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font-size: 1rem; }
.brand-copy span { margin-top: 3px; color: #bdd5cf; font-size: .72rem; letter-spacing: .05em; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; background: rgba(255,255,255,.08); font-size: .78rem; white-space: nowrap; }
.status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #aebdb9; }
.status-online::before { background: #71d8a6; box-shadow: 0 0 0 4px rgba(113,216,166,.13); }
.status-offline::before { background: var(--accent); }
.status-error::before { background: #ff8c96; }

.sidebar { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; padding: 24px 14px; border-right: 1px solid var(--line); background: #f8fbfa; }
.primary-nav { display: grid; gap: 6px; }
.primary-nav button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 14px; border: 0; border-radius: 12px; color: #425652; background: transparent; font-weight: 700; cursor: pointer; text-align: left; }
.primary-nav button span { display: grid; place-items: center; width: 27px; height: 27px; color: var(--brand); font-size: 1.1rem; }
.primary-nav button:hover { background: #edf5f2; }
.primary-nav button[aria-current="page"] { color: #fff; background: var(--brand); box-shadow: 0 8px 18px rgba(11,95,85,.2); }
.primary-nav button[aria-current="page"] span { color: var(--accent); }
.sidebar-note { margin-top: auto; display: flex; flex-direction: column; gap: 5px; padding: 15px; border: 1px solid #cae0da; border-radius: 13px; background: var(--brand-soft); }
.sidebar-note strong { color: var(--brand-dark); font-size: .8rem; }
.sidebar-note span { color: var(--muted); font-size: .72rem; line-height: 1.45; }

.workspace { min-width: 0; display: flex; flex-direction: column; }
.workspace-toolbar { min-height: 68px; display: flex; align-items: center; gap: 14px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.8); backdrop-filter: blur(8px); }
.search-box { flex: 1; min-width: 180px; max-width: 540px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.search-box span { color: var(--brand); font-size: 1.35rem; }
.search-box input { width: 100%; height: 42px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.quick-filters { margin-left: auto; display: flex; gap: 6px; overflow-x: auto; }
.quick-filters button { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; color: #506360; background: #fff; font-size: .76rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
.quick-filters button:hover { border-color: var(--brand); color: var(--brand); }
.quick-filters button[aria-pressed="true"] { border-color: var(--brand); color: #fff; background: var(--brand); }

#main-content { width: min(1450px, 100%); margin: 0 auto; padding: 28px clamp(18px, 3vw, 42px) 60px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 24px; }
.page-header h1 { margin: 4px 0 7px; font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -.04em; }
.page-header p { margin: 0; color: var(--muted); line-height: 1.55; }
.eyebrow { color: var(--brand); font-size: .7rem; font-weight: 900; letter-spacing: .15em; }
.demo-flag { flex: none; padding: 7px 11px; border: 1px solid #dfb54b; border-radius: 999px; color: #795a0a; background: #fff5d8; font-size: .72rem; font-weight: 800; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 30px; }
.summary-grid article { position: relative; overflow: hidden; padding: 19px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.summary-grid article::after { content: ""; position: absolute; right: -20px; top: -25px; width: 85px; height: 85px; border-radius: 50%; background: var(--brand-soft); }
.summary-grid span, .summary-grid small { display: block; position: relative; z-index: 1; color: var(--muted); }
.summary-grid span { font-size: .78rem; font-weight: 700; }
.summary-grid strong { display: block; position: relative; z-index: 1; margin: 6px 0 4px; color: var(--brand-dark); font-size: 1.9rem; }
.summary-grid small { font-size: .7rem; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 20px 0 12px; }
.section-heading h2 { margin: 0; font-size: 1.05rem; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: .76rem; }
.plan-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.plan-card { display: flex; gap: 16px; align-items: center; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.plan-card time { flex: none; width: 62px; height: 62px; display: grid; place-content: center; text-align: center; border-radius: 13px; color: #fff; background: var(--brand); }
.plan-card time strong { font-size: 1.3rem; }
.plan-card time span { color: #c8ddd8; font-size: .64rem; }
.plan-card h2 { margin: 5px 0 4px; font-size: .95rem; }
.plan-card p { margin: 0; color: var(--muted); font-size: .74rem; }
.discipline-tag { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: var(--brand); background: var(--brand-soft); font-size: .67rem; font-weight: 800; }

.inspection-layout { display: grid; grid-template-columns: minmax(190px, 270px) minmax(0, 1fr); gap: 18px; align-items: start; }
.inspection-list, .inspection-sheet, .jobs-panel, .adapter-panel, .trash-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.inspection-list { padding: 0 12px 12px; }
.inspection-list .section-heading { padding: 0 4px; }
.inspection-list-item { display: flex; flex-direction: column; gap: 6px; width: 100%; margin-top: 6px; padding: 13px; border: 1px solid transparent; border-radius: 11px; color: var(--ink); background: #f6f9f8; text-align: left; cursor: pointer; }
.inspection-list-item strong { font-size: .8rem; }
.inspection-list-item span { color: var(--muted); font-size: .68rem; }
.inspection-list-item.active { border-color: #acd0c7; background: var(--brand-soft); }
.inspection-sheet { overflow: hidden; }
.inspection-sheet > header { display: flex; justify-content: space-between; gap: 18px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.inspection-sheet h2 { margin: 7px 0 5px; font-size: 1.25rem; }
.inspection-sheet header p { margin: 0; color: var(--muted); font-size: .76rem; }
.save-state { align-self: flex-start; padding: 7px 10px; border-radius: 999px; color: var(--brand); background: var(--brand-soft); font-size: .68rem; font-weight: 800; white-space: nowrap; }
.notice-banner { display: flex; gap: 12px; margin: 20px 24px 0; padding: 12px 14px; border-left: 4px solid var(--accent); border-radius: 8px; background: #fff8e6; font-size: .76rem; }
.notice-banner span { color: #765f2a; }
.field-grid { display: grid; gap: 14px; padding: 22px 24px; }
.field-card { display: grid; gap: 8px; }
.field-card > span { font-size: .78rem; font-weight: 800; }
.field-card input, .field-card textarea { width: 100%; padding: 12px 13px; border: 1px solid #cbd9d5; border-radius: 10px; color: var(--ink); background: #fbfdfc; resize: vertical; }
.field-card input:focus, .field-card textarea:focus { border-color: var(--brand); background: #fff; }
.field-card small { color: var(--muted); font-size: .66rem; }
.field-card small[data-tone="saving"] { color: #826315; }
.field-card small[data-tone="saved"] { color: var(--brand); }
.field-card small[data-tone="offline"], .field-card small[data-tone="error"] { color: var(--danger); }
.sheet-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 24px 22px; border-top: 1px solid var(--line); background: #fbfdfc; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 13px; border: 1px solid transparent; border-radius: 10px; text-decoration: none; font-size: .75rem; font-weight: 800; cursor: pointer; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button-primary { color: #fff; background: var(--brand); }
.button-primary:hover { background: var(--brand-dark); }
.button-quiet { border-color: var(--line); color: var(--ink); background: #fff; }
.topbar .button-quiet { border-color: rgba(255,255,255,.24); color: #fff; background: rgba(255,255,255,.08); }
.button-danger-quiet { border-color: #eccbd0; color: var(--danger); background: #fff8f9; }
.jobs-panel { margin-top: 22px; padding: 0 18px 10px; }
.job-list, .trash-list { margin: 0; padding: 0; list-style: none; }
.job-list li, .trash-list li { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 13px 2px; border-top: 1px solid #e8eeec; }
.job-list li > div, .trash-list li > div { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 9px; }
.job-list strong, .trash-list strong { overflow: hidden; text-overflow: ellipsis; font-size: .76rem; white-space: nowrap; }
.job-list small, .trash-list small { grid-column: 2; color: var(--muted); font-size: .65rem; }
.failed-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.job-status { padding: 4px 7px; border-radius: 999px; color: #725600; background: #fff1bf; font-size: .63rem; font-weight: 900; }
.job-ready { color: var(--brand-dark); background: var(--brand-soft); }
.job-failed { color: var(--danger); background: #fdebed; }
.empty-row { color: var(--muted); font-size: .78rem; }
.muted { color: var(--muted); font-size: .72rem; }

.settings-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.team-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.team-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.team-card header span { color: var(--brand); font-size: .65rem; font-weight: 800; }
.team-card h2 { margin: 2px 0 0; font-size: 1.1rem; }
.empty-team { min-height: 140px; display: grid; place-items: center; align-content: center; gap: 8px; padding: 20px; color: var(--muted); text-align: center; }
.empty-team > span { display: grid; place-items: center; width: 32px; height: 32px; border: 1px dashed #9cb8b1; border-radius: 50%; }
.empty-team p { margin: 0; font-size: .72rem; line-height: 1.55; }
.member-editor { display: grid; gap: 10px; padding: 14px; }
.member-row { display: grid; grid-template-columns: 92px 90px minmax(100px, .8fr) minmax(180px, 1.5fr) 86px 58px auto; gap: 7px; align-items: end; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.member-row label { display: grid; gap: 4px; min-width: 0; }
.member-row label > span { color: var(--muted); font-size: .65rem; font-weight: 700; }
.member-row input, .member-row select { min-width: 0; width: 100%; height: 38px; padding: 0 9px; border: 1px solid #cbd9d5; border-radius: 9px; background: #fbfdfc; }
.member-active input { width: 22px; height: 38px; margin: 0; }
.team-save { margin: 0 14px 14px; }
.adapter-panel, .trash-panel { margin-top: 18px; padding: 20px; }
.adapter-panel h2, .trash-panel h2 { margin: 0 0 14px; font-size: 1rem; }
.adapter-panel dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.adapter-panel dl > div { display: flex; justify-content: space-between; gap: 15px; padding: 12px 14px; background: #fff; }
.adapter-panel dt { color: var(--muted); font-size: .73rem; }
.adapter-panel dd { margin: 0; font-size: .72rem; font-weight: 700; text-align: right; }
.dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; }
.dot-demo { background: var(--accent); }
.dot-warn { background: var(--danger); }
.dot-off { background: #a7b5b2; }
.empty-state { min-height: 220px; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 30px; border: 1px dashed #b8cbc6; border-radius: var(--radius); color: var(--muted); background: rgba(255,255,255,.6); text-align: center; }
.empty-state span { font-size: 2rem; color: #8dadA5; }
.loading-card { max-width: 650px; margin: 70px auto; padding: 25px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.loading-card p { color: var(--muted); font-size: .8rem; }
.skeleton { width: 70%; height: 20px; border-radius: 8px; background: linear-gradient(90deg,#e8efed,#f7f9f8,#e8efed); background-size: 200% 100%; animation: pulse 1.3s infinite; }
.skeleton.short { width: 42%; height: 12px; margin-top: 10px; }
@keyframes pulse { to { background-position: -200% 0; } }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: grid; gap: 8px; width: min(390px, calc(100vw - 36px)); }
.toast { padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fff; box-shadow: 0 14px 30px rgba(23,49,46,.18); font-size: .78rem; line-height: 1.45; }
.toast-success { border-left: 4px solid var(--brand); }
.toast-error { border-left: 4px solid var(--danger); }
.mobile-nav { display: none; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 84px minmax(0,1fr); }
  .sidebar { padding-inline: 10px; }
  .primary-nav button { justify-content: center; padding: 0; font-size: 0; }
  .primary-nav button span { font-size: 1.1rem; }
  .sidebar-note { display: none; }
  .quick-filters { max-width: 45%; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
  .member-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-row label:nth-of-type(4) { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .app-shell { display: block; padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .topbar { position: sticky; top: 0; min-height: 64px; padding: 0 14px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-copy strong { font-size: .86rem; }
  .brand-copy span { font-size: .64rem; }
  .status-pill { max-width: 115px; overflow: hidden; text-overflow: ellipsis; }
  .topbar #install-button { display: none; }
  .sidebar { display: none; }
  .workspace-toolbar { min-height: auto; display: grid; padding: 10px 14px; }
  .search-box { max-width: none; }
  .quick-filters { max-width: 100%; margin: 0; padding-bottom: 2px; }
  #main-content { padding: 22px 14px 35px; }
  .page-header { align-items: flex-start; }
  .page-header p { font-size: .8rem; }
  .summary-grid, .plan-list { grid-template-columns: 1fr; }
  .summary-grid { gap: 9px; }
  .summary-grid article { padding: 15px 17px; }
  .inspection-layout { grid-template-columns: 1fr; }
  .inspection-list { display: flex; gap: 8px; overflow-x: auto; padding: 10px; scroll-snap-type: x proximity; }
  .inspection-list .section-heading { display: none; }
  .inspection-list-item { flex: 0 0 min(76vw, 280px); margin: 0; scroll-snap-align: start; }
  .inspection-sheet > header { padding: 18px; }
  .notice-banner { margin: 16px 16px 0; flex-direction: column; gap: 4px; }
  .field-grid { padding: 18px 16px; }
  .sheet-actions { padding: 14px 16px 18px; flex-direction: column-reverse; }
  .sheet-actions .button { width: 100%; min-height: 46px; }
  .jobs-panel { padding-inline: 14px; }
  .job-list li { align-items: flex-start; flex-direction: column; }
  .adapter-panel dl { grid-template-columns: 1fr; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(6, 1fr); padding: 7px 5px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); box-shadow: 0 -8px 24px rgba(23,49,46,.08); }
  .mobile-nav button { display: grid; justify-items: center; gap: 2px; min-width: 0; min-height: 47px; padding: 4px 0; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: .58rem; font-weight: 700; }
  .mobile-nav button span { font-size: 1rem; }
  .mobile-nav button[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
}

button, input, select, textarea { touch-action: manipulation; }
button { cursor: pointer; }
input, select, textarea { min-height: 44px; font-size: 16px; }
img, svg { max-width: 100%; height: auto; }
button, a, input, textarea, select { overflow-wrap: anywhere; }
.topbar { border-bottom: 3px solid #d72735; }
.brand-mark { border: 0; border-radius: 11px; object-fit: contain; flex: none; }
.brand-copy span { color: #b9cce2; }
.workspace-toolbar { min-height: 64px; }
.search-box { max-width: 600px; }
.icon-button { display: inline-grid; place-items: center; width: 44px; min-width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--brand); background: #fff; font-size: 1.25rem; line-height: 1; text-decoration: none; }
.topbar .icon-button { border-color: transparent; color: #fff; background: #ffffff10; }
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: clamp(1.65rem, 3vw, 2.25rem); line-height: 1.2; }
.eyebrow { letter-spacing: .02em; font-weight: 700; }
.page-badge { padding: 7px 12px; border-radius: 99px; background: var(--brand-soft); font-size: .8rem; font-weight: 700; }
.button { min-height: 44px; font-size: .84rem; }
.home-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; overflow: hidden; margin-bottom: 18px; padding: 26px 28px; border-radius: 20px; color: #fff; background: linear-gradient(120deg, #122d50, #2f5987); }
.home-hero > div, .home-hero > button { position: relative; z-index: 1; }
.home-hero::after { position: absolute; right: -45px; top: -100px; content: ""; width: 320px; height: 320px; border: 44px solid #ffffff08; border-radius: 50%; }
.home-hero span { color: #c3d7ed; font-size: .8rem; }
.home-hero h2 { margin: 10px 0 0; font-size: 1.65rem; line-height: 1.45; letter-spacing: -.045em; }
.home-hero .button { gap: 18px; color: var(--brand-dark); background: #fff; }
.home-hero .button span { color: var(--brand); font-size: 1.2rem; }
.summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.summary-grid article { padding: 17px 19px; box-shadow: none; }
.summary-grid article::after { display: none; }
.summary-grid strong { margin-bottom: 0; }
.summary-grid strong small { display: inline; margin-left: 5px; font-size: .75rem; font-weight: 500; }
.attendance-panel, .calendar-panel, .create-panel, .login-panel { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.attendance-panel .section-heading { margin-top: 0; }
.attendance-panel input[type="date"], .month-controls input, .device-label input { min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; }
.checklist { display: grid; gap: 8px; }
.checklist-row { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.checklist-row input { flex: none; min-height: 24px; width: 24px; height: 24px; margin: 0; accent-color: var(--brand); }
.checklist-row label { flex: 1; font-size: .95rem; line-height: 1.45; }
.checklist-row input:checked + label { color: var(--muted); text-decoration: line-through; }
.checklist-row .icon-button { width: 34px; min-width: 34px; height: 34px; border: 0; color: var(--muted); }
.checklist-add { display: flex; gap: 8px; margin-top: 14px; }
.checklist-add input { min-width: 0; flex: 1; width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; }
.attendance-save { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.attendance-save > span { color: var(--muted); font-size: .74rem; }
.month-controls { display: flex; align-items: center; gap: 10px; margin: 18px 0; }
.month-controls label { min-width: 0; }
.month-controls input { width: 180px; font-weight: 700; }
.month-controls #go-today { margin-left: auto; }
.discipline-filters { display: flex; gap: 8px; overflow-x: auto; margin: 16px 0 20px; padding: 2px 0 4px; }
.discipline-filters button { min-height: 42px; flex: none; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #fff; font-size: .87rem; font-weight: 700; }
.discipline-filters button[aria-pressed="true"] { border-color: var(--brand); color: #fff; background: var(--brand); }
.calendar-week, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-week span { padding: 8px 0 16px; color: var(--muted); text-align: center; font-size: .78rem; }
.calendar-week span:first-child { color: #c35362; }
.calendar-grid { gap: 5px; }
.calendar-day { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 7px; min-height: 95px; padding: 12px 5px 8px; border: 1px solid transparent; border-radius: 12px; color: var(--ink); background: #f6f8fc; }
.calendar-day strong { font-size: .94rem; }
.calendar-day small { color: var(--muted); font-size: .7rem; }
.calendar-day.is-today strong { color: var(--brand); text-decoration: underline; text-underline-offset: 4px; }
.calendar-day[aria-pressed="true"] { border-color: var(--brand); color: #fff; background: var(--brand); }
.calendar-day[aria-pressed="true"] strong, .calendar-day[aria-pressed="true"] small { color: #fff; }
.calendar-dots { display: flex; gap: 3px; min-height: 5px; }
.discipline-dot { display: block; width: 5px; height: 5px; border-radius: 50%; background: #6c9fd4; }
.dot-0 { background: #d7a733; }.dot-1 { background: #9b86d0; }.dot-2 { background: #5da0cd; }.dot-3 { background: #65b9a8; }
.plan-card { align-items: flex-start; }
.plan-card > div { flex: 1; min-width: 0; }
.plan-card h2 { line-height: 1.4; }
.plan-card p { line-height: 1.6; }
.plan-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 11px; color: var(--muted); background: #fff; font-size: .8rem; line-height: 1.6; }
.plan-notice-error, .plan-card .plan-review { color: #9b5b20; }
.plan-notice-error { border: 1px solid #edcfac; background: #fff8ed; }
.plan-notes { margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.plan-notes h3 { margin: 0 0 12px; font-size: .95rem; }
.plan-notes ul { margin: 0; padding-left: 20px; }
.plan-notes li { padding: 5px 0; font-size: .85rem; line-height: 1.6; white-space: pre-line; }
.plan-notes li span { display: inline-block; margin-right: 9px; color: var(--muted); font-size: .75rem; }
.plan-card .icon-button { flex: none; }
.discipline-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.discipline-card { display: flex; align-items: center; gap: 18px; min-width: 0; min-height: 145px; padding: 26px; border: 1px solid var(--line); border-radius: 18px; text-align: left; color: var(--ink); background: #fff; }
.discipline-card > div { flex: 1; }
.discipline-card h2 { margin: 0 0 7px; font-size: 1.4rem; }
.discipline-card p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.discipline-icon { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 16px; color: #a57713; background: #fff4d5; font-size: 2rem; }
.discipline-1 .discipline-icon { color: #7458a5; background: #f2eafb; }
.discipline-2 .discipline-icon { color: #326aa3; background: #e4f1fc; }
.discipline-3 .discipline-icon { color: #308270; background: #e3f5ee; }
.back-link { min-height: 40px; margin: -8px 0 8px; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: .84rem; }
.create-panel { margin: 16px 0 22px; padding: 0; overflow: hidden; }
.create-panel summary { display: flex; justify-content: space-between; padding: 19px 22px; color: var(--brand); font-weight: 800; cursor: pointer; list-style: none; }
.create-panel summary::-webkit-details-marker { display: none; }
.create-panel[open] summary { border-bottom: 1px solid var(--line); }
.create-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 22px; }
.create-form label, .login-panel label { display: grid; gap: 8px; min-width: 0; }
.create-form label > span, .login-panel label > span { font-size: .8rem; font-weight: 700; }
.create-form input, .create-form select, .login-panel input { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid #ced9e7; border-radius: 10px; color: var(--ink); background: #fff; }
.form-wide { grid-column: 1 / -1; }
.form-error { margin: 0; color: var(--danger); font-size: .8rem; }
.form-error:empty { display: none; }
.sheet-progress { display: flex; justify-content: space-between; gap: 10px; padding: 15px 24px 0; color: var(--muted); font-size: .73rem; }
.field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px; }
.field-card { min-width: 0; padding: 12px; border: 1px solid #e7ecf3; border-radius: 12px; }
.field-card > span { line-height: 1.65; font-size: .84rem; white-space: pre-line; }
.field-card em { color: var(--muted); font-size: .72rem; font-style: normal; }
.field-card input, .field-card select, .field-card textarea { min-width: 0; width: 100%; padding: 11px 12px; border: 1px solid #cbd7e6; border-radius: 8px; color: var(--ink); background: #fff; }
.field-group { font-weight: 700; color: var(--brand); }
.inspection-photo { display: block; width: 100%; max-height: 280px; border-radius: 9px; object-fit: contain; background: #f5f7fa; }
.photo-placeholder { display: grid; place-items: center; min-height: 120px; border: 1px dashed #bdcbdc; border-radius: 9px; color: #8b9db3; background: #f8fafd; font-size: 2rem; }
.photo-upload { position: relative; overflow: hidden; }
.photo-upload input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.field-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 24px 22px; font-size: .8rem; }
.file-actions { display: flex !important; flex-wrap: wrap; gap: 8px !important; }
.device-label { display: grid; gap: 8px; max-width: 400px; margin-top: 18px; font-size: .8rem; }
.phone-connect { margin-top: 18px; padding: 14px; border-radius: 12px; background: var(--brand-soft); }
.phone-connect h3 { margin-top: 0; font-size: .9rem; }
.phone-connect p { margin: 6px 0; font-size: .84rem; overflow-wrap: anywhere; }
.phone-connect a { color: var(--brand); }
.login-panel { max-width: 430px; margin: 45px auto; padding: 30px; }
.login-panel h1 { font-size: 1.5rem; }
.login-panel p { color: var(--muted); line-height: 1.6; font-size: .87rem; }
.login-panel form { display: grid; gap: 18px; margin-top: 24px; }
.history-dialog { width: min(640px, calc(100vw - 28px)); max-height: 85vh; padding: 22px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); }
.history-dialog::backdrop { background: #102a4a77; }
.history-dialog .section-heading { margin-top: 0; }
.history-list { padding-left: 20px; }
.history-list li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .83rem; }
.history-list p { white-space: pre-wrap; overflow-wrap: anywhere; }
.history-list small { color: var(--muted); }
@media (max-width: 1050px) {
  .field-grid { grid-template-columns: 1fr; }
  .discipline-card { padding: 20px; gap: 12px; }
}
@media (max-width: 720px) {
  .topbar { padding-inline: 12px; gap: 9px; }
  .brand-copy strong { font-size: .87rem; }
  .brand-copy span { font-size: .64rem; }
  .topbar-actions { gap: 5px; }
  .topbar .icon-button { width: 34px; min-width: 34px; height: 38px; }
  .status-pill { max-width: 96px; padding-inline: 7px; font-size: .63rem; }
  .status-pill::before { flex: none; width: 6px; height: 6px; }
  .workspace-toolbar { padding: 10px 14px; }
  .search-box input { font-size: .9rem; }
  .home-hero { align-items: flex-start; flex-direction: column; gap: 18px; padding: 23px; }
  .home-hero h2 { font-size: 1.45rem; }
  .home-hero .button { align-self: flex-start; }
  .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .summary-grid article { padding: 13px 11px; border-radius: 13px; }
  .summary-grid span { font-size: .64rem; white-space: nowrap; }
  .summary-grid strong { font-size: 1.7rem; }
  .attendance-panel, .calendar-panel { padding: 14px; }
  .attendance-panel .section-heading { align-items: center; gap: 8px; }
  .attendance-panel .section-heading h2 { font-size: .96rem; }
  .attendance-panel input[type="date"] { width: 142px; font-size: .85rem; padding-inline: 7px; }
  .attendance-save { align-items: flex-start; flex-direction: column; }
  .attendance-save .button { width: 100%; }
  .discipline-menu { grid-template-columns: 1fr; gap: 12px; }
  .discipline-card { min-height: 114px; padding: 20px; }
  .discipline-card h2 { font-size: 1.22rem; }
  .discipline-card p { font-size: .74rem; }
  .month-controls { gap: 7px; }
  .month-controls input { width: 143px; padding-inline: 7px; }
  .month-controls .icon-button { width: 38px; min-width: 38px; }
  .month-controls #go-today { padding-inline: 11px; }
  .discipline-filters { gap: 6px; }
  .discipline-filters button { padding: 0 15px; }
  .calendar-panel { padding: 12px 9px; }
  .calendar-grid { gap: 3px; }
  .calendar-day { min-height: 75px; padding: 10px 2px 7px; gap: 6px; border-radius: 9px; }
  .calendar-day strong { font-size: .82rem; }
  .calendar-day small { font-size: .61rem; }
  .plan-card { gap: 11px; padding: 14px; }
  .plan-card time { width: 51px; height: 57px; }
  .plan-card .icon-button { width: 33px; min-width: 33px; height: 40px; border: 0; }
  .plan-card h2 { font-size: .86rem; }
  .create-form { padding: 17px; gap: 14px 10px; }
  .create-panel summary { padding: 17px; }
  .inspection-sheet > header { flex-direction: column; gap: 12px; }
  .save-state { white-space: normal; }
  .sheet-progress { padding-inline: 16px; font-size: .65rem; }
  .field-grid { gap: 12px; padding: 16px 12px; }
  .field-card { padding: 12px; }
  .field-pagination { padding-inline: 16px; }
  .sheet-actions { flex-direction: column-reverse; }
  .mobile-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); padding-inline: 10px; }
  .mobile-nav button { min-height: 48px; font-size: .68rem; gap: 4px; }
  .mobile-nav button span { font-size: 1.27rem; line-height: 1; }
  .toast-region { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .member-row input, .member-row select { min-height: 44px; font-size: 16px; }
  .login-panel { margin: 16px auto; padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
