:root {
  color-scheme: light;
  --ink: #182825;
  --muted: #697874;
  --line: #dfe6e2;
  --paper: #ffffff;
  --canvas: #f4f6f3;
  --brand: #173f3a;
  --brand-2: #28685f;
  --accent: #edb75d;
  --danger: #b8443d;
  --shadow-sm: 0 5px 18px rgba(27, 52, 47, 0.07);
  --shadow-lg: 0 24px 70px rgba(18, 44, 40, 0.22);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% -10%, rgba(237, 183, 93, 0.14), transparent 36%),
    var(--canvas);
  -webkit-tap-highlight-color: transparent;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(40, 104, 95, 0.23);
  outline-offset: 2px;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.app-shell {
  width: 100%;
  min-height: 100dvh;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 760px;
  height: 78px;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 20px 0;
}

.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  color: #fff;
  background: var(--brand);
  border-radius: 14px;
  box-shadow: 0 6px 14px rgba(23, 63, 58, 0.2);
  place-items: center;
}

.brand-mark svg {
  width: 23px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(207, 218, 213, 0.82);
  border-radius: 50%;
  place-items: center;
}

.icon-button svg {
  width: 21px;
}

.profile-button {
  color: var(--brand);
  background: #e1ede8;
  border-color: #d2e4dd;
}

.profile-button span {
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.035em;
}

.view {
  width: min(100%, 760px);
  min-height: calc(100dvh - 176px);
  margin: 0 auto;
  animation: view-in 180ms ease-out;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.week-panel {
  margin: 0 12px;
  padding: 16px 10px;
  color: #fff;
  background:
    radial-gradient(circle at 84% 14%, rgba(237, 183, 93, 0.26), transparent 31%),
    linear-gradient(145deg, #173f3a, #1c5049);
  border-radius: 27px;
  box-shadow: 0 16px 38px rgba(23, 63, 58, 0.16);
}

.week-controls {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 12px;
  align-items: center;
  padding: 0 8px;
}

.week-controls .icon-button {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.week-label {
  text-align: center;
}

.week-label p,
.week-label h1 {
  margin: 0;
}

.week-label p {
  color: #bcd1cc;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.week-label h1 {
  margin-top: 3px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.day-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(47px, 1fr));
  gap: 4px;
  overflow-x: auto;
  padding: 0 2px 2px;
  scrollbar-width: none;
}

.day-strip::-webkit-scrollbar {
  display: none;
}

.day-button {
  display: grid;
  min-width: 47px;
  min-height: 75px;
  padding: 9px 4px 7px;
  color: #c0d2ce;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 16px;
  place-items: center;
}

.day-button span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.day-button strong {
  color: #fff;
  font-size: 18px;
}

.day-button i {
  display: block;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

.day-button i.is-empty {
  background: transparent;
}

.day-button.is-weekend {
  opacity: 0.67;
}

.day-button.is-selected {
  color: var(--brand);
  background: #fff;
  border-color: #fff;
  box-shadow: 0 6px 18px rgba(5, 28, 25, 0.2);
}

.day-button.is-selected strong {
  color: var(--brand);
}

.day-button.is-selected i {
  background: var(--brand-2);
}

.day-button.is-today:not(.is-selected) {
  border-color: rgba(255, 255, 255, 0.24);
}

.content-section,
.page-heading,
.base-list,
.settings-group,
.settings-card,
.danger-link,
.app-version,
#baseView > .secondary-action {
  margin-right: 20px;
  margin-left: 20px;
}

.agenda-section {
  padding-top: 28px;
}

.timetable-section {
  margin-right: 12px;
  margin-left: 12px;
  padding-top: 24px;
}

.timetable-heading {
  padding: 0 8px;
}

.week-summary {
  display: grid;
  gap: 3px;
  text-align: right;
}

.week-summary strong {
  color: var(--brand);
  font-size: 13px;
}

.week-summary span {
  color: var(--muted);
  font-size: 12px;
}

.timetable-help {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 14px 8px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.timetable-help svg {
  flex: 0 0 auto;
  width: 18px;
  color: var(--brand-2);
}

.timetable-scroll {
  overflow: auto;
  background: #d8dfdc;
  border: 1px solid #cfd8d4;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  overscroll-behavior-inline: contain;
  scrollbar-color: #9fb0aa #edf1ef;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.timetable-scroll:focus-visible {
  outline: 3px solid rgba(40, 104, 95, 0.23);
  outline-offset: 3px;
}

.timetable-grid {
  display: grid;
  grid-template-columns: 36px 84px repeat(5, minmax(116px, 1fr));
  gap: 1px;
  min-width: 706px;
  background: #d8dfdc;
}

.table-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  min-height: 58px;
  padding: 8px 6px;
  color: #263a36;
  background: #eef2f0;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  place-items: center;
}

.table-header--number {
  left: 0;
  z-index: 8;
}

.table-header--time {
  left: 37px;
  z-index: 8;
}

.table-header--day {
  gap: 2px;
}

.table-header--day strong {
  font-size: 12px;
}

.table-header--day span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.table-header--day.is-today {
  color: #fff;
  background: var(--brand);
}

.table-header--day.is-today span {
  color: #c8dbd6;
}

.table-row-number,
.table-time {
  position: sticky;
  z-index: 3;
  display: grid;
  min-height: 78px;
  color: #3f504c;
  background: #f7f9f8;
  place-items: center;
}

.table-row-number {
  left: 0;
  font-size: 12px;
  font-weight: 800;
}

.table-time {
  left: 37px;
  align-content: center;
  gap: 3px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.table-time strong {
  font-size: 12px;
}

.table-time span {
  color: var(--muted);
  font-size: 11px;
}

.grid-cell {
  position: relative;
  min-height: 78px;
  background: #fff;
}

.grid-cell.is-today-column {
  background: #f4f9f7;
}

button.grid-cell--empty {
  display: grid;
  width: 100%;
  padding: 0;
  place-items: center;
}

.grid-cell--empty span {
  display: grid;
  width: 27px;
  height: 27px;
  color: #657771;
  border: 1px dashed #b5c2bd;
  border-radius: 9px;
  font-size: 18px;
  font-weight: 400;
  opacity: 0.3;
  place-items: center;
  transition: opacity 140ms, transform 140ms, background 140ms;
}

.grid-cell--empty:hover span,
.grid-cell--empty:focus-visible span,
.grid-cell--empty:active span {
  color: var(--brand);
  background: #e5f0ec;
  border-color: var(--brand-2);
  opacity: 1;
  transform: scale(1.06);
}

.grid-cell--occupied {
  display: grid;
  gap: 4px;
  align-content: stretch;
  padding: 5px;
}

.grid-event {
  position: relative;
  display: grid;
  gap: 3px;
  align-content: center;
  width: 100%;
  min-height: 67px;
  padding: 7px 8px;
  overflow: hidden;
  color: #24312f;
  text-align: center;
  background: var(--event-soft);
  border-left: 4px solid var(--event-color);
  border-radius: 9px;
}

.grid-event:active {
  transform: scale(0.98);
}

.grid-event-title {
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.grid-event-meta {
  color: #5e6d69;
  font-size: 10px;
  font-weight: 650;
}

.grid-event-status {
  justify-self: center;
  padding: 2px 5px;
  color: var(--event-color);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 99px;
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.grid-event.has-conflict::after {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  background: #c45d38;
  border: 2px solid #fff;
  border-radius: 50%;
  content: "";
}

.grid-event.is-cancelled {
  opacity: 0.55;
  filter: grayscale(0.35);
}

.grid-event.is-cancelled .grid-event-title,
.grid-event.is-cancelled .grid-event-meta {
  text-decoration: line-through;
}

.grid-cell.has-multiple .grid-event {
  min-height: 39px;
  padding: 5px 7px;
}

.grid-cell-add {
  position: absolute;
  right: 3px;
  bottom: 3px;
  z-index: 2;
  display: grid;
  width: 21px;
  height: 21px;
  padding: 0;
  color: var(--brand);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #c6d3ce;
  border-radius: 7px;
  box-shadow: 0 2px 5px rgba(24, 40, 37, 0.1);
  font-size: 15px;
  font-weight: 700;
  opacity: 0.75;
  place-items: center;
}

.grid-cell-add:hover,
.grid-cell-add:focus-visible {
  opacity: 1;
}

.outside-events {
  margin-top: 30px;
  padding: 0 8px;
}

.outside-events-heading h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.outside-events-list {
  display: grid;
  gap: 20px;
  margin-top: 14px;
}

.outside-day h3 {
  margin: 0 0 9px;
  color: #4b5a56;
  font-size: 13px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--brand-2);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.105em;
}

.section-heading h2,
.page-heading h1 {
  margin: 0;
  letter-spacing: -0.035em;
}

.section-heading h2 {
  font-size: clamp(22px, 6vw, 28px);
}

.text-button,
.inline-action {
  padding: 7px 0;
  color: var(--brand-2);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
}

.day-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin-top: 17px;
  padding: 10px 13px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #e2e8e4;
  border-radius: 14px;
}

.day-summary span:first-child {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
}

.day-summary strong {
  font-size: 13px;
}

.day-summary small {
  color: var(--muted);
  font-size: 11px;
}

.summary-ok,
.summary-warning {
  font-size: 10px;
  font-weight: 750;
  text-align: right;
}

.summary-ok { color: #31806f; }
.summary-warning { color: #ad5c36; }

.events-list {
  display: grid;
  gap: 10px;
  margin-top: 13px;
}

.event-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px 4px 1fr 18px;
  gap: 13px;
  align-items: center;
  width: 100%;
  min-height: 88px;
  padding: 13px 14px 13px 12px;
  text-align: left;
  background: var(--paper);
  border: 1px solid #e4e9e6;
  border-radius: 19px;
  box-shadow: var(--shadow-sm);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.event-card:active {
  transform: scale(0.988);
}

.event-time {
  text-align: right;
}

.event-time strong,
.event-time small {
  display: block;
}

.event-time strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.event-time small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.event-line {
  align-self: stretch;
  background: var(--event-color);
  border-radius: 4px;
}

.event-content {
  min-width: 0;
}

.event-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.event-topline strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-topline em {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: var(--event-color);
  background: var(--event-soft);
  border-radius: 99px;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.event-meta {
  display: block;
  overflow: hidden;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-badges {
  display: flex;
  gap: 5px;
  margin-top: 7px;
}

.event-badges:empty {
  display: none;
}

.event-badges i {
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}

.warning-badge { color: #9c542e; background: #fae9dd; }
.note-badge { color: #596661; background: #edf1ef; }

.event-chevron {
  width: 18px;
  color: #9aa7a2;
}

.event-card.is-cancelled {
  opacity: 0.62;
  background: #f1f3f1;
  box-shadow: none;
}

.event-card.is-cancelled .event-topline strong,
.event-card.is-cancelled .event-time {
  text-decoration: line-through;
}

.empty-state {
  padding: 35px 20px 28px;
  text-align: center;
  background: rgba(255, 255, 255, 0.56);
  border: 1px dashed #cfd9d4;
  border-radius: 22px;
}

.empty-state > span {
  display: grid;
  width: 74px;
  height: 74px;
  margin: 0 auto 16px;
  color: var(--brand-2);
  background: #e2efea;
  border-radius: 26px;
  place-items: center;
  transform: rotate(-3deg);
}

.empty-state svg {
  width: 44px;
  stroke-width: 2.5;
}

.empty-state h3 {
  margin: 0;
  font-size: 18px;
}

.empty-state p {
  max-width: 280px;
  margin: 7px auto 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.empty-state button {
  padding: 10px 15px;
  color: #fff;
  background: var(--brand);
  border-radius: 11px;
  font-size: 12px;
  font-weight: 750;
}

.page-heading {
  padding-top: 23px;
}

.page-heading h1 {
  font-size: 31px;
}

.page-heading > p:last-child {
  max-width: 560px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.base-list {
  display: grid;
  gap: 22px;
  margin-top: 25px;
}

.base-day {
  overflow: hidden;
  background: #fff;
  border: 1px solid #e2e8e4;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.base-day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}

.base-day-heading h2 {
  margin: 0;
  font-size: 15px;
}

.base-day-heading span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.base-event {
  display: grid;
  grid-template-columns: 8px 1fr 18px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 60px;
  padding: 10px 16px;
  text-align: left;
  background: #fff;
  border-top: 1px solid #edf0ee;
}

.base-event:active { background: #f7f9f8; }

.base-dot {
  width: 8px;
  height: 8px;
  background: var(--event-color);
  border-radius: 50%;
}

.base-event strong,
.base-event small {
  display: block;
}

.base-event strong { font-size: 13px; }
.base-event small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.base-event > svg { width: 17px; color: #a0aaa6; }

.base-empty {
  margin: 0;
  padding: 5px 16px 16px;
  color: #99a49f;
  font-size: 12px;
}

.secondary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: calc(100% - 40px);
  min-height: 48px;
  margin-top: 20px;
  padding: 12px 16px;
  color: var(--brand);
  background: #e2efea;
  border: 1px solid #d1e3dc;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 750;
}

.secondary-action svg { width: 19px; }

.settings-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  margin-top: 24px;
  padding: 18px;
  background: #fff;
  border: 1px solid #e2e8e4;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.settings-card h2 {
  margin: 1px 0 6px;
  font-size: 15px;
}

.settings-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.settings-icon {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  color: #53625e;
  background: #edf1ef;
  border-radius: 13px;
  place-items: center;
}

.settings-icon--green {
  color: var(--brand-2);
  background: #e2efea;
}

.settings-icon svg { width: 20px; }

.settings-group {
  overflow: hidden;
  margin-top: 16px;
  background: #fff;
  border: 1px solid #e2e8e4;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.settings-row {
  display: grid;
  grid-template-columns: 40px 1fr 18px;
  gap: 13px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 12px 15px;
  text-align: left;
  background: #fff;
}

.settings-row + .settings-row { border-top: 1px solid #e9eeeb; }
.settings-row strong, .settings-row small { display: block; }
.settings-row strong { font-size: 13px; }
.settings-row small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.chevron { width: 18px; color: #9ca6a2; }

.legend-card {
  display: block;
}

.legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 13px;
}

.legend span {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
}

.legend i {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  background: var(--legend-color);
  border-radius: 50%;
}

.danger-link {
  display: block;
  margin-top: 24px;
  padding: 10px 0;
  color: var(--danger);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.app-version {
  margin-top: 22px;
  color: #9aa5a0;
  font-size: 10px;
  text-align: center;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  left: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  max-width: 540px;
  min-height: 69px;
  margin: 0 auto;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(212, 222, 217, 0.9);
  border-radius: 23px;
  box-shadow: 0 15px 42px rgba(29, 55, 50, 0.18);
  backdrop-filter: blur(16px);
}

.nav-item {
  display: grid;
  gap: 2px;
  height: 52px;
  padding: 5px;
  color: #87938f;
  background: transparent;
  border-radius: 15px;
  font-size: 9px;
  font-weight: 700;
  place-items: center;
}

.nav-item svg { width: 22px; }

.nav-item.is-active {
  color: var(--brand);
  background: #edf4f1;
}

.fab {
  position: fixed;
  z-index: 25;
  right: max(24px, calc((100vw - 540px) / 2 + 24px));
  bottom: calc(91px + env(safe-area-inset-bottom));
  display: grid;
  width: 58px;
  height: 58px;
  padding: 0;
  color: #fff;
  background: linear-gradient(145deg, #28685f, #173f3a);
  border: 5px solid var(--canvas);
  border-radius: 19px;
  box-shadow: 0 10px 24px rgba(23, 63, 58, 0.3);
  place-items: center;
  transform: rotate(2deg);
  transition: opacity 160ms, transform 160ms;
}

.fab svg { width: 25px; stroke-width: 2.2; }
.fab:active { transform: scale(0.94) rotate(0); }
.fab.is-hidden { opacity: 0; pointer-events: none; transform: translateY(12px) scale(0.8); }

.sheet-dialog {
  width: min(100%, 580px);
  max-width: none;
  max-height: min(92dvh, 850px);
  margin: auto auto 0;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
}

.sheet-dialog::backdrop {
  background: rgba(12, 29, 26, 0.48);
  backdrop-filter: blur(3px);
}

.sheet-dialog[open] {
  animation: sheet-up 220ms cubic-bezier(.2,.8,.2,1);
}

@keyframes sheet-up {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.sheet {
  max-height: min(92dvh, 850px);
  padding: 9px 20px calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
  background: #fff;
  border-radius: 28px 28px 0 0;
  box-shadow: var(--shadow-lg);
}

.sheet-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 17px;
  background: #d9e0dc;
  border-radius: 3px;
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 21px;
}

.sheet-header h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.03em;
}

.sheet-header .icon-button {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  background: #f1f4f2;
  border-color: transparent;
}

.form-field {
  display: grid;
  gap: 7px;
  margin: 0 0 15px;
  padding: 0;
  border: 0;
}

.form-field > span,
.form-field legend {
  color: #52615d;
  font-size: 11px;
  font-weight: 750;
}

.form-field > span small { font-weight: 500; }

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 47px;
  padding: 11px 13px;
  background: #f7f9f8;
  border: 1px solid #dce4e0;
  border-radius: 12px;
  font-size: 14px;
}

.form-field textarea {
  min-height: 80px;
  resize: vertical;
}

.form-field input[aria-invalid="true"] { border-color: #d57870; }

.scope-field legend { margin-bottom: 7px; }

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  background: #eef2f0;
  border-radius: 13px;
}

.segmented-control label { cursor: pointer; }
.segmented-control input { position: absolute; opacity: 0; pointer-events: none; }

.segmented-control span {
  display: grid;
  min-height: 38px;
  padding: 8px;
  color: #71807b;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 750;
  text-align: center;
  place-items: center;
}

.segmented-control input:checked + span {
  color: var(--brand);
  background: #fff;
  box-shadow: 0 3px 9px rgba(25, 52, 47, 0.08);
}

.scope-field:disabled { opacity: 0.75; }

.time-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-error {
  min-height: 0;
  color: var(--danger);
  font-size: 10px;
}

.field-error:empty { display: none; }
.time-error { display: block; margin: -8px 0 13px; }

.conflict-note {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: -6px 0 15px;
  padding: 9px 11px;
  color: #9b542f;
  background: #faede4;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 650;
}

.conflict-note svg { flex: 0 0 auto; width: 17px; }

.sheet-actions {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 10px;
  margin-top: 20px;
}

.sheet-actions--edit {
  display: block;
  margin-top: 4px;
}

.primary-button,
.ghost-button,
.danger-button,
.danger-outline {
  min-height: 48px;
  padding: 11px 14px;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 750;
}

.primary-button { color: #fff; background: var(--brand); }
.ghost-button { color: #52615d; background: #eef2f0; }
.danger-button { display: flex; gap: 8px; align-items: center; color: var(--danger); background: #fbefed; }
.danger-button svg { width: 18px; }
.danger-outline { width: 100%; color: var(--danger); background: #fff; border: 1px solid #e9c6c2; }

.detail-sheet { position: relative; overflow: hidden auto; }
.detail-accent { position: absolute; top: 0; right: 0; left: 0; height: 5px; }

.detail-info {
  display: grid;
  gap: 13px;
  margin: 4px 0 23px;
  padding: 16px;
  background: #f6f8f7;
  border-radius: 15px;
}

.detail-info span {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.detail-info span svg { width: 18px; color: var(--brand-2); }
.detail-info p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.detail-info .cancelled-notice { padding: 8px 10px; color: var(--danger); background: #faeae8; border-radius: 9px; font-weight: 700; }

.detail-actions { display: grid; gap: 10px; }
.detail-actions .secondary-action { width: 100%; margin: 0; }

.secondary-action--white {
  background: #fff;
  border-color: #d5dfdb;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: calc(99px + env(safe-area-inset-bottom));
  left: 20px;
  max-width: 420px;
  margin: 0 auto;
  padding: 13px 16px;
  color: #fff;
  background: #203a36;
  border-radius: 13px;
  box-shadow: 0 12px 34px rgba(14, 35, 31, 0.25);
  font-size: 12px;
  font-weight: 650;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms, transform 160ms;
}

.toast.is-visible { opacity: 1; transform: translateY(0); }
.dialog-open { overflow: hidden; }
[hidden] { display: none !important; }

@media (min-width: 640px) {
  .topbar { height: 90px; }
  .week-panel { margin-right: 20px; margin-left: 20px; padding: 21px 16px 15px; }
  .week-controls { padding-bottom: 0; }
  .content-section, .page-heading, .base-list, .settings-group, .settings-card, .danger-link, .app-version, #baseView > .secondary-action { margin-right: 32px; margin-left: 32px; }
  .content-section.timetable-section { margin-right: 20px; margin-left: 20px; }
  .day-strip { gap: 8px; }
  .day-button { min-height: 80px; }
  .events-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .empty-state { grid-column: 1 / -1; }
  .sheet-dialog { margin-bottom: auto; }
  .sheet { border-radius: 28px; }
  .base-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

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