:root {
  color-scheme: light;
  --bg: #f4f6f4;
  --surface: #ffffff;
  --surface-soft: #f8faf8;
  --text: #18211d;
  --muted: #68736d;
  --line: #e2e7e3;
  --brand: #1f6b4f;
  --brand-strong: #15533d;
  --brand-soft: #e5f1eb;
  --ball: #d7ef53;
  --practice: #3679c7;
  --practice-soft: #e8f1fb;
  --official: #d56a2e;
  --official-soft: #fff0e7;
  --danger: #c34e45;
  --danger-soft: #fbeceb;
  --shadow: 0 8px 28px rgba(24, 33, 29, 0.07);
  --radius: 18px;
  --radius-sm: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app-loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.launch-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--brand);
  font-size: 20px;
}

.brand-ball {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ball);
  display: inline-block;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(24, 33, 29, 0.08);
}

.brand-ball::before,
.brand-ball::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 50%;
  top: 1px;
}

.brand-ball::before { left: -17px; }
.brand-ball::after { right: -17px; }

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(420px, 1.08fr);
  background: var(--surface);
}

.login-visual {
  padding: 64px;
  background: var(--brand);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}

.login-visual::after {
  content: "";
  position: absolute;
  width: 430px;
  height: 430px;
  border: 75px solid rgba(215, 239, 83, 0.12);
  border-radius: 50%;
  right: -210px;
  bottom: -140px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
  position: relative;
  z-index: 1;
}

.login-copy { max-width: 470px; position: relative; z-index: 1; }
.login-copy h1 { font-size: clamp(38px, 5vw, 66px); line-height: 1.08; margin: 0 0 24px; letter-spacing: -2px; }
.login-copy p { margin: 0; color: rgba(255,255,255,.78); font-size: 18px; line-height: 1.8; }

.login-panel {
  display: grid;
  place-items: center;
  padding: 40px;
}

.login-card { width: min(420px, 100%); }
.login-card h2 { margin: 0 0 8px; font-size: 30px; }
.login-card > p { margin: 0 0 34px; color: var(--muted); }

.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label, .field-label { color: #35413b; font-size: 14px; font-weight: 700; }
.field small { color: var(--muted); line-height: 1.45; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  outline: none;
  min-height: 46px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

textarea { resize: vertical; min-height: 110px; line-height: 1.65; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,107,79,.1); }
input::placeholder, textarea::placeholder { color: #9aa39e; }

.button {
  border: 0;
  min-height: 44px;
  padding: 10px 17px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 750;
  transition: transform .12s ease, opacity .12s ease, background .12s ease;
}

.button:hover { background: var(--brand-strong); }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .48; cursor: not-allowed; }
.button.full { width: 100%; }
.button.secondary { background: var(--brand-soft); color: var(--brand); }
.button.secondary:hover { background: #d9e9e1; }
.button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.button.ghost:hover { background: var(--surface-soft); }
.button.danger { background: var(--danger-soft); color: var(--danger); }
.button.small { min-height: 36px; padding: 7px 11px; font-size: 13px; border-radius: 10px; }
.button.icon-only { width: 42px; padding: 0; }
.button svg, .nav-button svg, .icon-button svg { width: 20px; height: 20px; flex: 0 0 auto; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  padding: 26px 18px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 30;
}

.sidebar-brand { display: flex; align-items: center; gap: 11px; font-size: 19px; font-weight: 850; padding: 4px 10px 30px; }
.sidebar-nav { display: grid; gap: 6px; }

.nav-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 47px;
  padding: 0 14px;
  border-radius: 12px;
  font-weight: 700;
  text-align: left;
}

.nav-button:hover { background: var(--surface-soft); color: var(--text); }
.nav-button.active { background: var(--brand-soft); color: var(--brand); }
.sidebar-foot { margin-top: auto; display: grid; gap: 12px; }

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 999px;
  padding: 8px 11px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sync-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #7f8b85; }
.sync-pill.synced::before { background: var(--brand); }
.sync-pill.pending::before { background: #d18c25; }
.sync-pill.offline::before { background: #8b9490; }
.sync-pill.error::before { background: var(--danger); }
.sync-pill.syncing::before { background: var(--practice); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .25; } }

.main-area { grid-column: 2; min-width: 0; padding: 28px 34px 110px; }
.page { width: min(1180px, 100%); margin: 0 auto; }

.page-header {
  min-height: 58px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.page-header h1 { margin: 0; font-size: 29px; line-height: 1.2; letter-spacing: -.5px; }
.page-header p { margin: 7px 0 0; color: var(--muted); }
.header-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

.hero {
  background: var(--brand);
  color: #fff;
  border-radius: 24px;
  padding: 30px;
  min-height: 210px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  width: 250px;
  height: 250px;
  border: 52px solid rgba(215,239,83,.13);
  border-radius: 50%;
  right: -90px;
  top: -115px;
}

.hero-kicker { margin: 0 0 14px; color: rgba(255,255,255,.68); font-size: 14px; font-weight: 700; }
.hero h2 { margin: 0; font-size: clamp(30px, 4vw, 47px); max-width: 620px; letter-spacing: -1.1px; }
.hero p { margin: 14px 0 0; color: rgba(255,255,255,.74); position: relative; z-index: 1; }
.hero .hero-author { font-size: 15px; font-weight: 700; letter-spacing: .2px; }
.hero-actions { display: flex; gap: 10px; margin-top: 26px; position: relative; z-index: 2; }
.hero .button { background: var(--ball); color: #233016; }
.hero .button:hover { background: #e1f66b; }
.hero .button.ghost { background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.18); color: #fff; }

.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.home { grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); margin-top: 18px; }
.stack { display: grid; gap: 14px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(24,33,29,.025);
}

.panel-pad { padding: 20px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 19px 20px 14px; }
.panel-header h2, .panel-header h3 { margin: 0; font-size: 17px; }
.panel-header a, .text-button { border: 0; background: none; color: var(--brand); padding: 0; font-weight: 700; text-decoration: none; }

.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 20px 20px; }
.quick-action { border: 1px solid var(--line); border-radius: 14px; padding: 15px; background: var(--surface); text-align: left; min-height: 104px; display: flex; flex-direction: column; justify-content: space-between; }
.quick-action:hover { border-color: #b7c9bf; background: var(--surface-soft); }
.quick-action strong { display: block; font-size: 15px; }
.quick-action span { color: var(--muted); font-size: 12px; }
.quick-action svg { color: var(--brand); width: 23px; height: 23px; }

.event-list { display: grid; }
.event-row {
  appearance: none;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: inherit;
  width: 100%;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  text-align: left;
}

.event-row:first-child { border-top: 0; }
.event-row:hover { background: var(--surface-soft); }
.event-time { color: var(--muted); font-size: 13px; font-weight: 750; }
.event-main { min-width: 0; }
.event-title { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-meta { margin-top: 5px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-side { display: flex; align-items: center; gap: 9px; }

.type-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; background: var(--brand); }
.type-dot.practice_match { background: var(--practice); }
.type-dot.official_match { background: var(--official); }

.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; background: var(--surface-soft); color: var(--muted); font-size: 11px; font-weight: 800; }
.badge.training { background: var(--brand-soft); color: var(--brand); }
.badge.practice_match { background: var(--practice-soft); color: var(--practice); }
.badge.official_match { background: var(--official-soft); color: var(--official); }
.badge.cancelled { background: #eff1f0; color: #87908b; text-decoration: line-through; }
.badge.completed { background: var(--brand-soft); color: var(--brand); }

.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty strong { color: var(--text); display: block; margin-bottom: 6px; }

.home-schedule-head { padding-bottom: 10px; }
.home-next-list { border-bottom: 1px solid var(--line); }
.home-next-event { grid-template-columns: 112px minmax(0, 1fr) auto; padding-top: 13px; padding-bottom: 13px; }
.next-event-when { display: grid; gap: 3px; color: var(--muted); font-size: 12px; }
.next-event-when strong { color: var(--text); font-size: 13px; white-space: nowrap; }
.home-fortnight { width: 100%; border: 0; background: transparent; color: inherit; padding: 14px 20px 18px; text-align: left; }
.home-fortnight:hover { background: var(--surface-soft); }
.fortnight-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.fortnight-head strong { font-size: 13px; }
.fortnight-head > span { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.fortnight-head svg { width: 16px; height: 16px; }
.fortnight-week, .fortnight-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.fortnight-week { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.fortnight-grid { row-gap: 5px; }
.fortnight-day { min-height: 38px; display: grid; place-items: center; align-content: center; gap: 2px; border-radius: 10px; }
.fortnight-day.today { background: var(--brand-soft); color: var(--brand); }
.fortnight-number { font-size: 13px; font-weight: 800; }
.fortnight-dots { min-height: 6px; display: flex; justify-content: center; gap: 2px; }
.fortnight-dots .type-dot { width: 5px; height: 5px; }

.calendar-layout { display: grid; grid-template-columns: minmax(560px, 1fr) 360px; gap: 18px; align-items: start; }
.calendar-panel { overflow: hidden; }
.calendar-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid var(--line); }
.calendar-toolbar h2 { margin: 0; font-size: 20px; }
.calendar-controls { display: flex; align-items: center; gap: 7px; }
.icon-button { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; width: 38px; height: 38px; display: grid; place-items: center; color: var(--text); }
.icon-button:hover { background: var(--surface-soft); }

.calendar-week { display: grid; grid-template-columns: repeat(7, 1fr); color: var(--muted); font-size: 12px; text-align: center; padding: 12px 12px 6px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 12px 14px; gap: 4px; }
.calendar-day { border: 1px solid transparent; background: transparent; border-radius: 12px; min-height: 92px; padding: 9px; text-align: left; color: inherit; overflow: hidden; }
.calendar-day:hover { background: var(--surface-soft); }
.calendar-day.outside { opacity: .38; }
.calendar-day.selected { border-color: var(--brand); background: var(--brand-soft); }
.calendar-day.today .day-number { background: var(--brand); color: #fff; }
.day-number { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; font-size: 13px; font-weight: 800; }
.day-events { display: grid; gap: 4px; margin-top: 6px; }
.day-event { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 10px; color: var(--muted); }
.day-event span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-event .type-dot { width: 6px; height: 6px; }
.day-more { color: var(--muted); font-size: 10px; padding-left: 11px; }

.selected-day { position: sticky; top: 24px; }
.selected-day-head { padding: 20px; border-bottom: 1px solid var(--line); }
.selected-day-head h3 { margin: 0; font-size: 19px; }
.selected-day-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

.filters { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-chip { border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); padding: 8px 12px; min-height: 38px; font-weight: 700; font-size: 13px; }
.filter-chip.active { color: var(--brand); border-color: #a8c8b8; background: var(--brand-soft); }
.search { flex: 1 1 240px; position: relative; }
.search input { padding-left: 40px; background: var(--surface); }
.search svg { position: absolute; left: 13px; top: 13px; width: 19px; height: 19px; color: var(--muted); }

.inspiration-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.inspiration-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-height: 190px; display: flex; flex-direction: column; }
.inspiration-card:hover { border-color: #b8c9c0; }
.inspiration-image { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--surface-soft); display: block; }
.inspiration-body { padding: 16px; display: grid; gap: 13px; flex: 1; }
.inspiration-text { margin: 0; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--surface-soft); color: var(--muted); border-radius: 7px; padding: 4px 7px; font-size: 11px; font-weight: 700; }
.card-foot { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }

.settings-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.settings-card { padding: 22px; }
.settings-card h2 { margin: 0 0 6px; font-size: 18px; }
.settings-card > p { margin: 0 0 22px; color: var(--muted); line-height: 1.6; }
.settings-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.info-list { display: grid; gap: 12px; }
.info-row { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.info-row:last-child { border: 0; padding-bottom: 0; }
.info-row span { color: var(--muted); }
.info-row strong { text-align: right; }
.motto-list { display: grid; gap: 10px; }
.motto-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.motto-item > div { min-width: 0; display: grid; gap: 5px; }
.motto-item strong { line-height: 1.55; }
.motto-item span { color: var(--muted); font-size: 13px; }
.motto-item .icon-button { flex: 0 0 auto; color: var(--danger); background: var(--surface); }

.conflict-card { border: 1px solid #efc2be; background: #fffafa; border-radius: 13px; padding: 14px; margin-top: 12px; }
.conflict-card strong { display: block; margin-bottom: 5px; }
.conflict-card p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.conflict-actions { display: flex; gap: 8px; }

.bottom-nav { display: none; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 24, 19, .45);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  backdrop-filter: blur(3px);
}

.modal {
  width: min(780px, 100%);
  max-height: min(900px, calc(100vh - 48px));
  background: var(--surface);
  border-radius: 22px;
  box-shadow: 0 26px 80px rgba(15,24,19,.24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal.small { width: min(500px, 100%); }
.modal > form { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; overflow: hidden; }
.modal-header { padding: 20px 22px 16px; display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 22px; }
.modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.modal-body { min-height: 0; flex: 1 1 auto; padding: 22px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.modal-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 22px calc(14px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.modal-footer-right { display: flex; gap: 10px; margin-left: auto; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.field.full { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; padding-top: 10px; margin: 4px 0 18px; border-top: 1px solid var(--line); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section h3 { margin: 0 0 5px; font-size: 16px; }
.form-section p { margin: 0; color: var(--muted); font-size: 13px; }
.priority-section h3 { color: var(--brand-strong); }

.schedule-fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 12px; }
.schedule-fields .span-2 { grid-column: span 2; }
.schedule-fields .field { margin-bottom: 12px; gap: 6px; }
.schedule-fields input, .schedule-fields select { min-height: 42px; padding: 9px 11px; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 47px; }
.input-suffix span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; pointer-events: none; }
.compact-textarea { min-height: 88px; }

.category-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.category-option input { position: absolute; opacity: 0; pointer-events: none; }
.category-option span { display: inline-flex; align-items: center; min-height: 38px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-weight: 700; font-size: 13px; }
.category-option input:checked + span { background: var(--brand-soft); color: var(--brand); border-color: #9ec3b1; }

.satisfaction { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.satisfaction label { position: relative; }
.satisfaction input { position: absolute; opacity: 0; }
.satisfaction span { display: grid; place-items: center; min-height: 42px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-weight: 800; }
.satisfaction input:checked + span { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }

.ai-box { border: 1px solid #cadbd2; background: #f7fbf9; border-radius: 14px; padding: 14px; margin-bottom: 18px; }
.ai-box-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 9px; }
.ai-box-head strong { font-size: 14px; }
.ai-box textarea { background: var(--surface); min-height: 130px; }
.ai-hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; line-height: 1.5; }

.image-uploader { border: 1px dashed #bdc9c2; border-radius: 14px; min-height: 104px; padding: 12px; }
.image-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.image-item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-soft); }
.image-item img { width: 100%; height: 100%; object-fit: cover; }
.image-remove { position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(23,31,27,.74); color: #fff; display: grid; place-items: center; }
.image-add { border: 0; background: var(--surface-soft); color: var(--muted); border-radius: 10px; aspect-ratio: 1; min-height: 74px; font-size: 24px; }
.image-add:hover { background: var(--brand-soft); color: var(--brand); }

.detail-block { margin-bottom: 18px; }
.detail-block h3 { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.detail-block p { margin: 0; white-space: pre-wrap; line-height: 1.75; }
.detail-images { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.detail-images img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 11px; background: var(--surface-soft); }
.detail-links { display: grid; gap: 8px; }
.detail-link { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); padding: 11px 12px; border-radius: 10px; text-decoration: none; color: var(--brand); overflow: hidden; }
.detail-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.quick-sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-sheet button { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); min-height: 104px; padding: 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; text-align: left; font-weight: 750; }
.quick-sheet button:hover { background: var(--surface-soft); }
.quick-sheet strong { display: block; font-size: 16px; }
.quick-sheet small { color: var(--muted); display: block; margin-top: 3px; font-weight: 500; }
.quick-sheet svg { width: 23px; height: 23px; flex: 0 0 auto; color: var(--brand); }

.toast-region { position: fixed; right: 22px; bottom: 24px; z-index: 200; display: grid; gap: 9px; pointer-events: none; }
.toast { min-width: 260px; max-width: 410px; background: #1c2822; color: #fff; padding: 13px 15px; border-radius: 12px; box-shadow: var(--shadow); animation: toast-in .2s ease; }
.toast.error { background: #943e37; }
.toast.success { background: var(--brand); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.mobile-topbar { display: none; }
.desktop-only { display: initial; }
.mobile-only { display: none; }

@media (max-width: 1020px) {
  .app-shell { grid-template-columns: 82px 1fr; }
  .sidebar { width: 82px; padding: 22px 12px; }
  .sidebar-brand { justify-content: center; padding-inline: 0; }
  .sidebar-brand strong, .nav-button span, .sidebar-foot .sync-pill span { display: none; }
  .nav-button { justify-content: center; padding: 0; }
  .main-area { grid-column: 2; padding-inline: 24px; }
  .calendar-layout { grid-template-columns: 1fr; }
  .selected-day { position: static; }
  .inspiration-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 720px) {
  .login-page { grid-template-columns: 1fr; background: var(--bg); }
  .login-visual { min-height: 230px; padding: 28px 24px; justify-content: flex-start; gap: 32px; }
  .login-copy h1 { font-size: 34px; margin-bottom: 12px; letter-spacing: -.8px; }
  .login-copy p { font-size: 14px; line-height: 1.6; }
  .login-panel { padding: 28px 20px 50px; place-items: start center; }
  .login-card h2 { font-size: 25px; }

  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-area { padding: calc(74px + var(--safe-top)) 14px calc(88px + var(--safe-bottom)); }
  .mobile-topbar { position: fixed; display: flex; align-items: center; justify-content: space-between; top: 0; left: 0; right: 0; height: calc(62px + var(--safe-top)); padding: var(--safe-top) 16px 0; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); z-index: 40; backdrop-filter: blur(12px); }
  .mobile-brand { display: flex; align-items: center; gap: 9px; font-weight: 850; }
  .mobile-brand .brand-ball { width: 28px; height: 28px; }

  .bottom-nav { position: fixed; display: grid; grid-template-columns: repeat(5, 1fr); left: 0; right: 0; bottom: 0; min-height: calc(68px + var(--safe-bottom)); padding: 6px 8px var(--safe-bottom); background: rgba(255,255,255,.97); border-top: 1px solid var(--line); z-index: 50; backdrop-filter: blur(14px); }
  .bottom-nav .nav-button { min-height: 56px; flex-direction: column; gap: 2px; padding: 4px; border-radius: 10px; font-size: 11px; justify-content: center; }
  .bottom-nav .nav-button span { display: block; }
  .bottom-nav .nav-button.record-nav { width: 50px; height: 50px; min-height: 50px; border-radius: 50%; justify-self: center; align-self: start; margin-top: -17px; background: var(--brand); color: #fff; box-shadow: 0 7px 18px rgba(31,107,79,.25); }
  .bottom-nav .record-nav span { display: none; }
  .bottom-nav .record-nav svg { width: 26px; height: 26px; }

  .page-header { margin-bottom: 17px; min-height: auto; align-items: center; }
  .page-header h1 { font-size: 24px; }
  .page-header p { font-size: 13px; }
  .page-header .header-actions .button span { display: none; }
  .page-header .header-actions .button { width: 43px; padding: 0; }

  .hero { padding: 23px; min-height: 200px; border-radius: 20px; }
  .hero h2 { font-size: 29px; line-height: 1.38; letter-spacing: -.7px; }
  .hero-actions { flex-wrap: wrap; }

  .grid.home, .grid.two, .settings-layout { grid-template-columns: 1fr; }
  .panel { border-radius: 16px; }
  .event-row { grid-template-columns: 47px minmax(0,1fr) auto; padding: 15px 16px; gap: 10px; }
  .event-side .badge { display: none; }

  .home-next-event { grid-template-columns: 90px minmax(0,1fr) auto; padding-block: 12px; }
  .next-event-when strong { font-size: 12px; }
  .home-fortnight { padding: 12px 14px 15px; }
  .fortnight-day { min-height: 34px; }

  .calendar-page .page-header { margin-bottom: 9px; }
  .calendar-page .page-header p { display: none; }
  .calendar-page .filters { flex-wrap: nowrap; gap: 6px; margin-bottom: 9px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .calendar-page .filters::-webkit-scrollbar { display: none; }
  .calendar-page .search { flex: 0 0 184px; }
  .calendar-page .search input { min-height: 38px; padding-block: 7px; }
  .calendar-page .search svg { top: 10px; }
  .calendar-page .filter-chip { flex: 0 0 auto; min-height: 36px; padding: 7px 11px; }
  .calendar-page .calendar-layout { gap: 8px; }

  .calendar-toolbar { padding: 9px 12px; }
  .calendar-toolbar h2 { font-size: 17px; }
  .calendar-controls { gap: 5px; }
  .calendar-controls .button.small { min-height: 34px; }
  .calendar-controls .icon-button { width: 34px; height: 34px; }
  .calendar-panel { margin-inline: -14px; border-radius: 0; border-inline: 0; }
  .calendar-week { padding: 6px 8px 3px; }
  .calendar-grid { padding: 0 8px 7px; gap: 2px; }
  .calendar-day { min-height: 43px; padding: 2px; border-radius: 8px; text-align: center; }
  .day-number { width: 24px; height: 24px; margin-inline: auto; font-size: 12px; }
  .day-events { display: flex; justify-content: center; gap: 2px; margin-top: 1px; min-height: 6px; }
  .day-event { display: block; }
  .day-event span:last-child, .day-more { display: none; }
  .day-event .type-dot { width: 5px; height: 5px; }
  .selected-day { margin-top: 0; }
  .selected-day-head { padding: 11px 14px; }
  .selected-day-head h3 { font-size: 17px; }
  .selected-day-head p { margin-top: 3px; font-size: 12px; }
  .selected-day .event-row { padding-block: 11px; }
  .selected-day .panel-pad { padding: 12px 14px; }
  .inspiration-grid { grid-template-columns: 1fr; }

  .modal-backdrop { align-items: end; padding: max(8px, var(--safe-top)) 0 0; }
  .modal, .modal.small { width: 100%; max-height: calc(100dvh - max(8px, var(--safe-top))); border-radius: 22px 22px 0 0; }
  .modal-header { padding: 14px 16px 12px; }
  .modal-header h2 { font-size: 21px; }
  .modal-header p { margin-top: 3px; }
  .modal-header .icon-button { width: 40px; height: 40px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding-inline: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .form-section { grid-column: auto; }
  .form-grid > .field { margin-bottom: 14px; }
  .form-section { margin-bottom: 14px; }
  .schedule-fields { grid-column: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; }
  .schedule-fields .span-2 { grid-column: 1 / -1; }
  .schedule-fields .field { min-width: 0; margin-bottom: 10px; }
  .schedule-fields label { font-size: 13px; }
  .modal textarea { min-height: 94px; }
  .modal textarea.compact-textarea { min-height: 78px; }
  .modal .ai-box textarea { min-height: 110px; }
  .modal.small .modal-body { padding-top: 14px; }
  .quick-sheet button { min-height: 96px; padding: 12px; }
  .quick-sheet small { font-size: 12px; line-height: 1.35; }
  .image-list { grid-template-columns: repeat(3, 1fr); }
  .detail-images { grid-template-columns: repeat(2, 1fr); }
  .toast-region { left: 14px; right: 14px; bottom: calc(82px + var(--safe-bottom)); }
  .toast { min-width: 0; max-width: none; width: 100%; }
  .desktop-only { display: none !important; }
  .mobile-only { display: initial; }
}

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