:root {
  color-scheme: light;
  --bg: #f4f7f8;
  --panel: #ffffff;
  --panel-2: #edf8f6;
  --line: #dfe7e9;
  --text: #172126;
  --muted: #68777e;
  --primary: #17a58f;
  --primary-2: #087e70;
  --green: #16a085;
  --yellow: #f5b82e;
  --red: #e85b62;
  --radius: 18px;
  --shadow: 0 10px 32px rgb(25 51 58 / 7%);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: linear-gradient(135deg, #f8fafb, #f1f6f6); color: var(--text); font-size: 16px; }
button, input, select, textarea { font: inherit; }
button { touch-action: manipulation; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px; border-right: 1px solid var(--line); background: rgb(255 255 255 / 92%); backdrop-filter: blur(16px); display: flex; flex-direction: column; z-index: 5; }
.brand { color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.1rem; padding: 0 8px 28px; }
.brand-mark { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(135deg, #24b7a0, #0b8b79); color: white; box-shadow: 0 8px 22px rgb(23 165 143 / 20%); }
.nav { display: grid; gap: 8px; }
.nav-item { min-height: 50px; border: 0; border-radius: 14px; background: transparent; color: var(--muted); text-align: left; padding: 0 14px; display: flex; align-items: center; gap: 12px; font-weight: 700; cursor: pointer; }
.nav-icon, .ui-icon { width: 24px; height: 24px; flex: 0 0 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover, .nav-item.active { color: var(--text); background: var(--panel-2); }
.nav-item.active { box-shadow: inset 3px 0 var(--primary); color: var(--primary-2); }
.sync-states { margin-top: auto; display: grid; gap: 10px; }
.sync-state { color: var(--muted); font-size: .82rem; display: flex; align-items: center; gap: 8px; padding: 0 10px; }
.sync-state span { width: 8px; height: 8px; background: var(--green); border-radius: 50%; box-shadow: 0 0 10px var(--green); }
.sync-state.error span { background: var(--red); box-shadow: 0 0 10px var(--red); }
.sync-state.syncing span { animation: sync-pulse 1s ease-in-out infinite; }
@keyframes sync-pulse { 50% { opacity: .25; transform: scale(.75); } }

.main { min-width: 0; padding: 28px clamp(22px, 2.5vw, 44px) 48px; }
.topbar { min-height: 100px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 28px; }
.eyebrow { color: var(--muted); margin: 0 0 6px; font-weight: 650; text-transform: capitalize; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.8rem, 3vw, 3rem); line-height: 1; letter-spacing: -.04em; }
h2 { font-size: 1.25rem; letter-spacing: -.02em; }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-left: auto; }
.weather-chip, .clock { min-height: 100px; padding: 0 24px; border: 1px solid var(--line); border-radius: 20px; background: rgb(255 255 255 / 82%); display: flex; align-items: center; gap: 12px; font-weight: 750; white-space: nowrap; }
.weather-chip { font-size: 2rem; }
.clock { font-variant-numeric: tabular-nums; font-size: 2.3rem; }
.ai-launch { min-height: 50px; padding: 0 16px; border: 0; border-radius: 16px; display: inline-flex; align-items: center; gap: 8px; color: white; background: linear-gradient(135deg, #7259d8, #9a67cf); box-shadow: 0 9px 24px rgb(114 89 216 / 20%); font-weight: 800; cursor: pointer; }
.ai-launch .ui-icon { width: 21px; height: 21px; }

.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.stack { display: grid; gap: 20px; align-content: start; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: rgb(255 255 255 / 94%); box-shadow: var(--shadow); overflow: hidden; }
.card-inner { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: 9px; }
.card-head .count { background: var(--line); color: var(--muted); min-width: 28px; height: 28px; border-radius: 10px; display: inline-grid; place-items: center; font-size: .82rem; }
.source-badge { display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; border-radius: 999px; background: #e6f7f2; color: var(--primary-2); font-size: .7rem; font-weight: 800; letter-spacing: 0; white-space: nowrap; vertical-align: middle; }
.source-badge.warning { background: #fff3dc; color: #9a6200; }
.text-button { color: #aab4ff; border: 0; padding: 8px; background: transparent; font-weight: 750; cursor: pointer; }
.text-button.danger { color: var(--red); }
.button { min-height: 46px; border-radius: 14px; border: 1px solid var(--line); padding: 0 18px; font-weight: 780; color: var(--text); cursor: pointer; }
.button.primary { border: 0; color: white; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 10px 24px rgb(23 165 143 / 22%); }
.button.ghost { background: var(--panel-2); }
.button.danger { color: #a63e45; border-color: #f0c9cc; background: #fff4f4; }
.icon-button { width: 44px; height: 44px; border-radius: 13px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-size: 1.5rem; cursor: pointer; }

.timeline { display: grid; gap: 12px; }
.event { display: grid; grid-template-columns: 76px 7px 1fr; align-items: center; gap: 14px; min-height: 64px; }
.event-time { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 750; }
.event-dot { width: 7px; height: 42px; border-radius: 6px; background: var(--primary); }
.event-title { margin: 0 0 4px; font-weight: 780; }
.event-meta { color: var(--muted); font-size: .86rem; }
.emoji, .member-avatar, .emoji-select { font-family: "Noto Color Emoji", "Segoe UI Emoji", "Apple Color Emoji", sans-serif; }
.feature-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #8c68c6; background: #f2edfa; }
.icon-action { display: inline-flex; align-items: center; gap: 1px; }
.icon-action .ui-icon { width: 20px; height: 20px; }
.rank { color: var(--muted); font-variant-numeric: tabular-nums; }

.list { display: grid; gap: 10px; }
.list-row { min-height: 58px; border: 1px solid transparent; border-radius: 15px; background: #f7f9fa; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 10px; }
.list-row:hover { border-color: var(--line); }
.list-row.done .row-title { color: var(--muted); text-decoration: line-through; }
.check { appearance: none; width: 30px; height: 30px; border-radius: 10px; border: 2px solid #526084; cursor: pointer; display: grid; place-content: center; }
.check:checked { border-color: var(--green); background: var(--green); }
.check:checked::after { content: "✓"; color: white; font-weight: 1000; }
.row-title { font-weight: 730; overflow-wrap: anywhere; }
.row-meta { color: var(--muted); font-size: .82rem; margin-top: 3px; }
.row-actions { display: flex; align-items: center; gap: 5px; }
.mini-action { border: 0; background: transparent; color: var(--muted); min-width: 38px; min-height: 38px; border-radius: 10px; cursor: pointer; }
.mini-action:hover { background: var(--line); color: var(--text); }
.danger-action:hover { color: var(--red); background: #fff1f2; }
.person { display: inline-flex; align-items: center; gap: 7px; }
.person-dot { width: 9px; height: 9px; border-radius: 50%; }
.points-pill { color: var(--yellow); font-weight: 800; white-space: nowrap; }

.quick-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; margin-top: 14px; }
.quick-add.shopping-add { grid-template-columns: minmax(220px, 1fr) minmax(90px, .3fr) minmax(180px, .55fr) auto; }
.input, .select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; background: #fbfcfc; color: var(--text); outline: none; }
.textarea { width: 100%; min-height: 150px; resize: vertical; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fbfcfc; color: var(--text); outline: none; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgb(23 165 143 / 12%); }
label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; font-size: .9rem; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-help { margin: -5px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }

.empty { min-height: 120px; display: grid; place-items: center; text-align: center; padding: 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: 16px; }
.empty strong { display: block; color: var(--text); margin-bottom: 5px; }
.notice { padding: 14px 16px; border-radius: 14px; color: var(--muted); background: rgb(255 201 105 / 8%); border: 1px solid rgb(255 201 105 / 24%); }
.notice-error { color: #8f3439; background: #fff3f3; border-color: #f3c9cc; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 9px; }
.day { min-height: 112px; padding: 13px 10px; border: 1px solid var(--line); border-radius: 16px; background: #fafcfc; cursor: pointer; }
.day.today { border-color: var(--primary); background: #edf8f6; }
.day-name { color: var(--muted); text-transform: uppercase; font-size: .72rem; font-weight: 800; }
.day-number { font-size: 1.35rem; margin: 3px 0 12px; font-weight: 850; }
.day-meal { font-size: .82rem; line-height: 1.25; }
.members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.member-card { position: relative; border: 1px solid var(--line); border-radius: 18px; background: #fafcfc; padding: 18px; }
.member-avatar { width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 14px; }
.member-name { font-weight: 850; font-size: 1.08rem; }
.member-points { color: var(--yellow); margin-top: 5px; }
.member-edit { position: absolute; top: 10px; right: 10px; width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; }
.member-edit:hover { background: var(--panel-2); color: var(--primary-2); }
.member-edit .ui-icon { width: 20px; height: 20px; }
.member-actions { display: flex; gap: 4px; margin: 8px -8px -8px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.page-head h2 { font-size: 1.65rem; margin: 0; }
.full-card { min-height: 60vh; }
.calendar-groups { display: grid; gap: 20px; }
.date-group h3 { color: var(--muted); text-transform: capitalize; font-size: .9rem; letter-spacing: .02em; }
.segmented { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.segmented button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 750; cursor: pointer; }
.segmented button.active { color: var(--primary-2); background: var(--panel-2); }
.shopping-list-switch { flex: 0 0 auto; }
.shopping-list-switch button { display: inline-flex; align-items: center; gap: 7px; }
.shopping-list-switch button span { min-width: 22px; padding: 2px 6px; border-radius: 999px; background: var(--line); color: var(--muted); font-size: .7rem; }
.shopping-list-switch button.active span { background: rgb(23 165 143 / 14%); color: var(--primary-2); }
.shopping-list-switch.compact { width: 100%; margin: -5px 0 14px; }
.shopping-list-switch.compact button { flex: 1 1 50%; justify-content: center; min-height: 38px; padding: 0 8px; font-size: .76rem; }
.shopping-list-title { margin-bottom: 12px; }
.shopping-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.shopping-pagination span { min-width: 105px; color: var(--muted); text-align: center; font-size: .86rem; font-variant-numeric: tabular-nums; }
.shopping-pagination .button { min-width: 112px; }
.shopping-pagination .button:disabled { opacity: .4; cursor: default; }
.calendar-toolbar { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 9px; margin-bottom: 12px; }
.calendar-toolbar h3 { margin: 0; text-align: center; text-transform: capitalize; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 18px; color: var(--muted); font-size: .86rem; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 7px; }
.calendar-legend i { width: 10px; height: 10px; border-radius: 50%; }
.calendar-week { display: grid; grid-template-columns: repeat(7, minmax(115px, 1fr)); min-height: 480px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.calendar-column { min-width: 0; padding: 10px; border-right: 1px solid var(--line); background: #fbfcfc; }
.calendar-column:last-child { border-right: 0; }
.calendar-column header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: var(--muted); text-transform: uppercase; font-size: .75rem; }
.calendar-column header strong { width: 30px; height: 30px; display: grid; place-items: center; color: var(--text); font-size: 1rem; }
.calendar-column.is-today header strong, .month-cell.is-today > strong { border-radius: 50%; color: white; background: var(--primary); }
.calendar-column-events { display: grid; gap: 7px; }
.compact-event { min-width: 0; padding: 8px; border-left: 4px solid var(--event-color); border-radius: 8px; background: white; font-size: .78rem; font-weight: 730; overflow: hidden; text-overflow: ellipsis; }
.compact-event span { display: block; color: var(--muted); font-size: .68rem; font-weight: 650; }
.no-events { color: #aab4b8; font-size: .78rem; }
.calendar-month-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 8px 8px; color: var(--muted); text-align: center; font-size: .75rem; font-weight: 800; }
.calendar-month { display: grid; grid-template-columns: repeat(7, minmax(100px, 1fr)); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.month-cell { min-width: 0; min-height: 112px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: white; }
.month-cell:nth-child(7n) { border-right: 0; }
.month-cell:nth-last-child(-n+7) { border-bottom: 0; }
.month-cell.other-month { background: #f7f9fa; opacity: .55; }
.month-cell > strong { width: 28px; height: 28px; display: grid; place-items: center; margin-bottom: 4px; }
.month-cell .compact-event { white-space: nowrap; padding: 5px 6px; margin-top: 4px; }
.more-events { display: block; margin: 5px; color: var(--muted); font-size: .72rem; }
.calendar-day-view { max-width: 820px; margin: 0 auto; }
.calendar-day-view h3 { text-transform: capitalize; }
.calendar-page-actions { display: flex; align-items: center; gap: 10px; }
.sync-button { display: inline-flex; align-items: center; gap: 8px; }
.sync-button .ui-icon { width: 19px; height: 19px; }
.sync-button:disabled { opacity: .45; cursor: default; }
.dialog-hint { margin: 0; color: var(--muted); line-height: 1.5; }
.color-input { padding: 6px; }

dialog { width: min(540px, calc(100vw - 30px)); max-height: calc(100vh - 30px); padding: 0; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); color: var(--text); box-shadow: 0 30px 80px rgb(25 51 58 / 25%); }
dialog::backdrop { background: rgb(25 42 48 / 42%); backdrop-filter: blur(4px); }
.ai-dialog { width: min(680px, calc(100vw - 30px)); }
.ai-dialog .dialog-card { max-height: calc(100vh - 34px); overflow-y: auto; }
.ai-dialog .dialog-head { align-items: flex-start; }
.ai-dialog .dialog-head .eyebrow { margin-bottom: 4px; }
.ai-intro { color: var(--muted); line-height: 1.5; }
.ai-usage { margin: 14px 0 18px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 15px; background: #f7f9fa; }
.ai-usage-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.ai-usage-head strong { font-size: .92rem; }
.ai-usage-head span, .ai-usage-note { color: var(--muted); font-size: .75rem; }
.ai-usage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 16px; }
.ai-usage-item { display: grid; grid-template-columns: 1fr auto; gap: 5px 8px; align-items: center; font-size: .8rem; }
.ai-usage-item strong { font-size: .78rem; }
.ai-usage-bar { grid-column: 1 / -1; height: 5px; overflow: hidden; border-radius: 999px; background: #e4e9eb; }
.ai-usage-bar i { display: block; width: var(--usage); height: 100%; border-radius: inherit; background: var(--primary); }
.ai-usage-note { margin: 9px 0 0; line-height: 1.35; }
.usage-nav { margin-top: 12px; }
.usage-nav .nav-item { width: 100%; }
.usage-page { max-width: 1000px; }
.usage-page .ai-usage { margin-top: 0; padding: 20px; }
.usage-page .ai-usage-item { font-size: 1rem; padding: 10px 0; }
.usage-page .ai-usage-item strong { font-size: .95rem; }
.ai-input { min-height: 112px; }
.ai-compose-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.mic-button { display: inline-flex; align-items: center; gap: 8px; }
.mic-button .ui-icon { width: 20px; height: 20px; }
.mic-button.recording { color: white; border-color: var(--red); background: var(--red); animation: mic-pulse 1.2s ease-in-out infinite; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 7px rgb(232 91 98 / 13%); } }
.ai-result { margin-top: 18px; }
.ai-message { margin-bottom: 12px; line-height: 1.5; }
.ai-action-list { display: grid; gap: 9px; }
.ai-action-card { padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: #f7f9fa; }
.ai-action-card strong, .ai-action-card span { display: block; }
.ai-action-card span { margin-top: 4px; color: var(--muted); font-size: .84rem; }
.ai-confirm { display: flex; justify-content: flex-end; margin-top: 14px; }
.ai-loading { min-height: 54px; display: flex; align-items: center; gap: 10px; color: var(--muted); }
.ai-loading > span { width: 12px; height: 12px; border-radius: 50%; background: #8060d5; animation: sync-pulse 1s ease-in-out infinite; }
.recording-hint > span { background: var(--red); }
.dialog-card { padding: 24px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.dialog-head h2 { margin: 0; }
#dialog-fields { display: grid; gap: 15px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.form-error { min-height: 20px; color: var(--red); margin: 10px 0 0; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; padding: 14px 18px; border-radius: 14px; background: #173b35; color: white; font-weight: 800; transform: translateY(120px); opacity: 0; transition: .25s ease; }
.toast.show { transform: none; opacity: 1; }

@media (max-width: 920px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: auto 0 0; width: 100%; height: auto; padding: 8px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); border: 0; border-top: 1px solid var(--line); }
  .brand, .sync-states { display: none; }
  .sidebar { display: flex; flex-direction: row; overflow-x: auto; align-items: stretch; }
  .nav { grid-template-columns: repeat(7, minmax(64px, 1fr)); gap: 2px; flex: 7; }
  .usage-nav { display: flex; margin-top: 0; min-width: 64px; flex: 1; }
  .nav-item { min-height: 56px; justify-content: center; padding: 5px; font-size: .68rem; gap: 2px; flex-direction: column; text-align: center; }
  .nav-item.active { box-shadow: none; background: var(--panel-2); }
  .nav-icon { width: 21px; height: 21px; }
  .main { padding: 22px 16px 94px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .topbar { min-height: 64px; margin-bottom: 20px; }
  .clock { display: none; }
  .weather-chip { min-height: 44px; padding: 0 12px; }
  .ai-launch { min-height: 44px; padding: 0 12px; }
  .ai-usage-grid { grid-template-columns: 1fr; }
  .week-strip { grid-template-columns: repeat(7, minmax(74px, 1fr)); overflow-x: auto; padding-bottom: 7px; }
  .quick-add.shopping-add { grid-template-columns: 1fr; }
  .calendar-page-head { align-items: flex-start; flex-direction: column; }
  .shopping-page-head { align-items: flex-start; flex-direction: column; }
  .shopping-page-head .page-actions { width: 100%; }
  .shopping-page-head .shopping-list-switch { max-width: 100%; overflow-x: auto; }
  .shopping-pagination { justify-content: space-between; gap: 6px; }
  .shopping-pagination .button { min-width: 0; padding: 0 12px; }
  .calendar-page-actions { width: 100%; flex-wrap: wrap; }
  .calendar-view { overflow-x: auto; padding-bottom: 8px; }
  .calendar-week { min-width: 850px; }
  .calendar-month-weekdays, .calendar-month { min-width: 760px; }
}

@media (max-width: 1250px) and (min-width: 921px) {
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .topbar h1 { font-size: 1.65rem; }
  .weather-chip .condition { display: none; }
  .card-inner { padding: 17px; }
  .field-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  .event { grid-template-columns: 62px 6px 1fr; gap: 10px; }
  .toast { left: 16px; right: 16px; bottom: 90px; text-align: center; }
  .ai-launch span { display: none; }
  .ai-compose-actions { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

.tt-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.tt-meta { display: grid; grid-template-columns: minmax(180px, 1.2fr) 1fr 1fr; align-items: end; gap: 20px; margin-bottom: 20px; }
.tt-meta label { min-width: 0; }
.tt-label { display: block; font-size: .86rem; color: var(--muted); margin-bottom: 8px; }
.tt-meta strong { display: block; min-height: 44px; padding: 10px 0; font-size: 1.25rem; }
.tt-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.tt-table { width: 100%; min-width: 960px; border-collapse: collapse; table-layout: fixed; }
.tt-table th, .tt-table td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px; }
.tt-table thead th { padding: 14px 5px; font-size: .95rem; background: #f5f8fa; }
.tt-table th:first-child { width: 80px; }
.tt-table th:nth-child(2) { width: 116px; }
.tt-table th:last-child:has(.tt-label) { width: 64px; }
.tt-table .tt-today { box-shadow: inset 0 -3px var(--primary); color: var(--primary-2); }
.tt-table tbody th { font-weight: 750; }
.tt-row-label { text-align: center; padding-inline: 4px; }
.tt-time span { display: block; text-align: center; color: var(--muted); line-height: 1.6; font-variant-numeric: tabular-nums; }
.tt-time .input { padding: 3px; min-height: 44px; font-size: .9rem; }
.tt-time .input + .input { margin-top: 4px; }
.tt-subject { display: flex; align-items: center; min-height: 48px; padding: 10px 12px; border: 1px solid rgb(0 0 0 / 4%); border-radius: 10px; font-size: 1rem; overflow-wrap: anywhere; }
input.tt-subject { display: block; width: 100%; padding-inline: 8px; }
select.tt-subject { display: block; width: 100%; padding-inline: 8px 24px; }
.tt-pick { width: 100%; text-align: left; font-family: inherit; cursor: pointer; }
.tt-pick:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.settings-sections { margin-bottom: 24px; flex-wrap: wrap; }
.settings-sections button { min-height: 48px; }
.subject-settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.subject-setting { display: grid; gap: 12px; background: white; border: 1px solid var(--line); border-radius: 14px; padding: 16px; font: inherit; text-align: left; cursor: pointer; }
.subject-setting > span:last-child { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; }
.tt-today-list { max-height: 340px; overflow-y: auto; padding-right: 6px; }
.tt-today-child + .tt-today-child { margin-top: 20px; }
.tt-today-child h3 { margin: 0 0 10px; font-size: 1rem; }
.tt-today-child h3 small { color: var(--muted); font-weight: normal; }
.tt-today-lesson { display: grid; grid-template-columns: 94px minmax(0,1fr); gap: 8px; align-items: center; margin-top: 5px; }
.tt-today-lesson > span:first-child { font-size: .8rem; color: var(--muted); }
.tt-today-lesson .tt-subject { min-height: 36px; padding: 6px 10px; font-size: .9rem; }
.tt-subject .tt-free { color: inherit; }
.tt-peach { background: #ffe6d9; }.tt-blue { background: #dfeaff; }.tt-purple { background: #ece2fc; }
.tt-mint { background: #ddf5ec; }.tt-green { background: #e1f5d2; }.tt-yellow { background: #fff3c9; }
.tt-pink { background: #ffe1ef; }.tt-cyan { background: #ddf6fc; }.tt-neutral { background: #f5f7f9; }
.tt-free { color: #97a3a9; margin: auto; }.tt-bottom { margin-top: 16px; flex-wrap: wrap; }
.tt-note { display: block; margin-top: 22px; }.tt-note p { white-space: pre-wrap; margin-bottom: 0; }
.tt-note textarea { min-height: 72px; }
.tt-empty { padding: 28px 0 10px; }.tt-empty .field-help { margin-top: 16px; }
.tt-form .form-error:empty { display: none; }.tt-form .icon-button { min-width: 44px; min-height: 44px; }
@media (max-width: 700px) { .tt-meta { grid-template-columns: 1fr 1fr; gap: 12px; }.tt-meta > :first-child { grid-column: 1 / -1; } }
:root { --task-gap: 16px; }
.task-groups { display: grid; gap: var(--task-gap); }
.task-groups h3 { margin: 0 0 16px; }
.task-groups summary { cursor: pointer; padding: 20px; font-weight: 700; min-height: 48px; }
.compact-event small { display: block; font-size: 12px; font-weight: normal; }
button.compact-event { display: block; width: 100%; text-align: left; font-family: inherit; cursor: pointer; min-height: 44px; }
.all-day-label { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.all-day-label input { width: 24px; height: 24px; }
.task-groups .row-actions .mini-action { min-width: 44px; min-height: 44px; }
@media (max-width: 600px) {
  .task-groups .row-actions { flex-wrap: wrap; justify-content: flex-end; }
  .calendar-page-actions { flex-wrap: wrap; }
  .page-head { flex-wrap: wrap; gap: 12px; }
}
.calendar-time-scroll { overflow: auto; max-height: 70vh; border: 1px solid var(--line, #dce6e8); border-radius: 12px; overscroll-behavior: contain; }
.calendar-time-grid { display: grid; align-items: stretch; padding-bottom: 16px; background: #fff; }
.calendar-time-heading { position: sticky; top: 0; z-index: 5; background: #f3f8f8; border-right: 1px solid #dce6e8; padding: 6px; text-align: center; }
.calendar-time-heading.is-today { background: #d8f2ec; }
.calendar-time-heading button, .month-day-button { border: 0; background: transparent; font: inherit; font-weight: 750; color: inherit; cursor: pointer; min-height: 44px; min-width: 44px; }
.calendar-all-day { padding: 8px; border-right: 1px solid #dce6e8; border-bottom: 1px solid #dce6e8; background: #f8fbfa; min-width: 0; }
.calendar-all-day > small { display: block; color: #52636b; margin: 4px 0; }
.calendar-time-day { position: relative; border-right: 1px solid #dce6e8; min-width: 0; }
.calendar-time-day.is-today { background: #f6fcfa; }
.calendar-hour { position: absolute; left: 0; right: 0; border-top: 1px solid #e4ebed; pointer-events: none; }
.calendar-hour > span { display: block; position: absolute; left: 3px; top: 3px; width: 48px; font-size: 10px; line-height: 1.15; color: #52636b; }
.calendar-time-events { position: absolute; inset: 0 4px 0 54px; }
.calendar-time-event { position: absolute; min-height: 0; padding: 3px 5px; border: 0; border-left: 4px solid var(--event-color); border-radius: 5px; background: #eaf0f3; color: #172c35; text-align: left; overflow: hidden; font: inherit; font-size: 12px; cursor: pointer; box-sizing: border-box; }
.calendar-time-event:hover, .calendar-time-event:focus-visible { background: #d7e7eb; outline: 2px solid #147c70; z-index: 3; }
.calendar-time-event > span, .calendar-time-event > strong, .calendar-time-event > small { display: block; overflow-wrap: anywhere; line-height: 1.25; }
.calendar-time-event > span { font-size: 11px; }
.calendar-time-event > small { font-size: 10px; margin-top: 3px; }
.calendar-list-event { display: grid; width: 100%; min-height: 48px; gap: 3px; margin: 5px 0; border: 1px solid #dce6e8; border-left: 4px solid var(--event-color); border-radius: 6px; background: #fff; color: #172c35; padding: 8px; text-align: left; font: inherit; cursor: pointer; overflow-wrap: anywhere; }
.calendar-list-event span, .calendar-list-event small { font-size: 12px; color: #52636b; }
.calendar-list-details { margin-top: 12px; }
.calendar-list-details summary { min-height: 48px; padding: 12px; cursor: pointer; }
.calendar-list-details section { padding: 10px; }
.calendar-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.overlap-badge { display: inline-block; background: #fff0cf; color: #765000; border: 0; border-radius: 5px; padding: 4px 6px; font-size: 11px; font-weight: 650; white-space: normal; }
button.overlap-badge, button.more-events { cursor: pointer; min-height: 44px; }
.event-time .overlap-badge { padding: 3px 1px; margin-top: 3px; font-size: 9px; overflow-wrap: anywhere; }
.event-time { overflow-wrap: anywhere; }
#dialog-submit[hidden] { display: none; }
[hidden] { display: none !important; }
.login-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 450px); padding: 28px; }
.login-card h1 { font-size: 2rem; margin: 16px 0; }
.login-card p { overflow-wrap: anywhere; line-height: 1.5; }
.login-card form > label { display: block; margin: 20px 0; }
.login-card .input { display: block; width: 100%; margin-top: 8px; }
.login-card .login-remember { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.login-remember input { width: 24px; height: 24px; flex-shrink: 0; }
.login-card .button { min-height: 48px; width: 100%; }
.login-card #login-retry { margin-top: 20px; min-height: 44px; }
