@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/AtkinsonHyperlegibleNext-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/AtkinsonHyperlegibleNext-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/AtkinsonHyperlegibleNext-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
:root {
  color-scheme: light dark;
  --ink: #2a1f3d;
  --canvas: #e8e5ee;
  --paper: #fbfafd;
  --muted: #524a63;
  --gold: #c9d64b;
  --gold-text: #4e5711;
  --ridge: #2a1f3d;
  --on-ridge: #fbfafd;
  --confirmed-text: #1d5b47;
  --ok-bg: #dcefe6;
  --warn-text: #5a4708;
  --laterite: #9e2a3f;
  --cancel-bg: #f6dce2;
  --amber-bg: #f3ecca;
  --on-gold: #2a1f3d;
  --add-fg: #c9d64b;
  --thread-1: #a3b236;
  --thread-2: #7b61c4;
  --thread-3: #2f9a8d;
  --thread-4: #c98e1e;
  --focus: #2a1f3d;
  --hill-1: #d6d0e2;
  --hill-2: #c7bfd8;
  --hill-3: #b7adcc;
  --sun: rgb(201 214 75 / 0.55);
  --glass-pct: 55%;
  --sheet-pct: 90%;
  --card-pct: 80%;
  --clear-pct: 22%;
  --clear-filter: blur(18px) saturate(170%) brightness(1.04);
  --clear-sheen: rgb(255 255 255 / 0.55);
  --clear-rim: rgb(255 255 255 / 0.95);
  --clear-lowrim: rgb(255 255 255 / 0.4);
  --field-1: rgb(123 97 196 / 0.30);
  --field-2: rgb(201 214 75 / 0.34);
  --field-3: rgb(47 154 141 / 0.24);
  --glass-edge: rgb(255 255 255 / 0.72);
  --glass-rim: rgb(255 255 255 / 0.9);
  --glass-shadow: 0 10px 30px rgb(42 31 61 / 0.12), 0 2px 6px rgb(42 31 61 / 0.06);
  --line: color-mix(in srgb, var(--ink) 10%, transparent);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family:
    "Atkinson Hyperlegible Next",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--canvas);
}
:root[data-theme="dark"] {
    --ink: #ede8f4;
    --canvas: #15111d;
    --paper: #221b2e;
    --muted: #aba2bb;
    --gold-text: #c9d64b;
    --focus: #c9d64b;
    --ridge: #c9d64b;
    --on-ridge: #2a1f3d;
    --add-fg: #2a1f3d;
    --thread-1: #c9d64b;
    --thread-2: #a58bea;
    --thread-3: #5cc5b7;
    --thread-4: #e7b54a;
    --confirmed-text: #8fd3b4;
    --ok-bg: #163a30;
    --warn-text: #e9d98a;
    --laterite: #ff9aae;
    --cancel-bg: #3a1a24;
    --amber-bg: #3a3315;
    --hill-1: #1e1829;
    --hill-2: #251e33;
    --hill-3: #2e2640;
    --sun: rgb(201 214 75 / 0.24);
    --glass-pct: 74%;
    --sheet-pct: 94%;
    --card-pct: 86%;
    --clear-pct: 42%;
    --clear-filter: blur(22px) saturate(140%) brightness(0.85);
    --clear-sheen: rgb(255 255 255 / 0.10);
    --clear-rim: rgb(255 255 255 / 0.22);
    --clear-lowrim: rgb(255 255 255 / 0.06);
    --field-1: rgb(165 139 234 / 0.26);
    --field-2: rgb(201 214 75 / 0.14);
    --field-3: rgb(92 197 183 / 0.18);
    --glass-edge: rgb(255 255 255 / 0.1);
    --glass-rim: rgb(255 255 255 / 0.12);
    --glass-shadow: 0 14px 34px rgb(0 0 0 / 0.45);
  }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --ink: #ede8f4;
    --canvas: #15111d;
    --paper: #221b2e;
    --muted: #aba2bb;
    --gold-text: #c9d64b;
    --focus: #c9d64b;
    --ridge: #c9d64b;
    --on-ridge: #2a1f3d;
    --add-fg: #2a1f3d;
    --thread-1: #c9d64b;
    --thread-2: #a58bea;
    --thread-3: #5cc5b7;
    --thread-4: #e7b54a;
    --confirmed-text: #8fd3b4;
    --ok-bg: #163a30;
    --warn-text: #e9d98a;
    --laterite: #ff9aae;
    --cancel-bg: #3a1a24;
    --amber-bg: #3a3315;
    --hill-1: #1e1829;
    --hill-2: #251e33;
    --hill-3: #2e2640;
    --sun: rgb(201 214 75 / 0.24);
    --glass-pct: 74%;
    --sheet-pct: 94%;
    --card-pct: 86%;
    --clear-pct: 42%;
    --clear-filter: blur(22px) saturate(140%) brightness(0.85);
    --clear-sheen: rgb(255 255 255 / 0.10);
    --clear-rim: rgb(255 255 255 / 0.22);
    --clear-lowrim: rgb(255 255 255 / 0.06);
    --field-1: rgb(165 139 234 / 0.26);
    --field-2: rgb(201 214 75 / 0.14);
    --field-3: rgb(92 197 183 / 0.18);
    --glass-edge: rgb(255 255 255 / 0.1);
    --glass-rim: rgb(255 255 255 / 0.12);
    --glass-shadow: 0 14px 34px rgb(0 0 0 / 0.45);
  }
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
body.locked {
  overflow: hidden;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 16px;
  background: var(--paper);
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}
@media (hover: hover) and (pointer: fine) {
  button:hover {
    background: color-mix(in srgb, var(--canvas) 85%, var(--ink) 4%);
  }
}
button:active {
  background: color-mix(in srgb, var(--canvas) 96%, var(--ink) 4%);
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
button.primary {
  background: var(--ridge);
  border-color: var(--ridge);
  color: var(--on-ridge);
}
@media (hover: hover) and (pointer: fine) {
  button.primary:hover {
    background: color-mix(in srgb, var(--ridge) 90%, var(--ink) 10%);
  }
}
button.danger {
  color: var(--laterite);
  border-color: var(--laterite);
}
button.quiet {
  background: transparent;
}
a {
  color: var(--gold-text);
  text-underline-offset: 4px;
}
::selection {
  color: var(--on-gold);
  background: var(--gold);
}
input,
textarea {
  caret-color: var(--ridge);
}
* {
  scrollbar-color: var(--muted) var(--canvas);
  scrollbar-width: thin;
}
*:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 1px var(--ink);
}
[hidden] {
  display: none !important;
}
svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
h1 {
  font-size: 1.5rem;
  line-height: 1.2;
  margin: 0 0 8px;
  font-weight: 700;
}
h2 {
  font-size: 1.125rem;
  line-height: 1.3;
  margin: 24px 0 12px;
  font-weight: 600;
}
h3 {
  font-size: 1.0625rem;
  margin: 0 0 8px;
}
p {
  margin: 0 0 16px;
  max-width: 72ch;
}
small,
.secondary,
.muted {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.45;
}
.secondary {
  margin-top: 16px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 12px;
  background: var(--paper);
}
.skip:focus {
  top: 8px;
}
.shell {
  max-width: 1180px;
  margin-inline: auto;
  padding: 24px 16px calc(96px + env(safe-area-inset-bottom));
}
.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--canvas);
  padding-top: env(safe-area-inset-top);
}
.header-inner {
  max-width: 1180px;
  margin: auto;
  min-height: 72px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  min-height: 44px;
}
.brand img {
  object-fit: contain;
  flex-shrink: 0;
}
.avatar {
  border-radius: 50%;
  width: 44px;
  padding: 0;
  flex-shrink: 0;
  background: var(--paper);
}
.page-head {
  margin-bottom: 24px;
}
.page-head p {
  margin: 0;
}
.login {
  max-width: 400px;
  margin: 24px auto;
}
.login-header {
  position: relative;
  isolation: isolate;
  min-height: 260px;
  margin-inline: -16px;
  padding: 164px 16px 24px;
  text-align: center;
}
.login-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("/login-sketch.png") center / cover no-repeat;
  opacity: 0.24;
}
.login-header p {
  margin: 0;
}
.login > p {
  text-align: center;
}
:where(:root[data-theme="dark"]) .login-header::before {
    filter: invert(1);
    opacity: 0.24;
  }

@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme])) .login-header::before {
    filter: invert(1);
    opacity: 0.24;
  }
}

.login form {
  margin-top: 32px;
}
.login input {
  min-height: 52px;
}
.login .primary {
  width: 100%;
  margin-top: 8px;
}
form {
  display: grid;
  gap: 16px;
}
label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  min-width: 0;
}
input:not([type="checkbox"]),
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent);
  border-radius: 12px;
  background: var(--paper);
  font-weight: 400;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
input[type="checkbox"] {
  appearance: auto;
  accent-color: var(--ridge);
  width: 20px;
  height: 20px;
  flex: none;
  margin: 0;
}
label small {
  font-weight: 400;
  min-height: 1.45em;
}
.password-input {
  position: relative;
  display: flex;
  gap: 4px;
}
.password-input input {
  padding-right: 72px;
}
.password-input button {
  position: absolute;
  right: 4px;
  top: 4px;
  border: 0;
  min-width: 64px;
}
.password-input + button {
  margin-top: 8px;
}
.login form > label[for] {
  margin-bottom: -12px;
}
.check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 0;
  font-weight: 400;
}
.filters {
  margin-bottom: 24px;
}
.search-label {
  font-size: 0.9375rem;
}
.filter-row {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
}
.filter-row > label {
  flex: 1 1 132px;
  font-size: 0.9375rem;
}
.filter-row .hide-cancelled {
  flex: 1 0 145px;
}
.filter-row select {
  border-radius: 999px;
  min-height: 44px;
  padding-inline: 12px 28px;
}
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.list > li + li {
  border-top: 1px solid var(--line);
}
.day-group {
  margin: 24px 0;
}
.day-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 12px;
}
.day-number {
  text-align: center;
  min-width: 56px;
  display: grid;
  gap: 4px;
}
.day-number strong {
  font-size: 2.25rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  border-radius: 999px;
  font-weight: 700;
  padding: 4px;
}
.day-number small {
  font-weight: 400;
}
.today .day-number strong {
  background: var(--gold);
  color: var(--on-gold);
}
.day-heading .day-label {
  font-size: 1.125rem;
  line-height: 1.3;
  font-weight: 600;
}
.day-label small {
  display: block;
  margin-top: 4px;
}
.row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 0;
  padding: 16px 12px;
  min-height: 64px;
  font-weight: 400;
}
.row .row-time {
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.row-time small {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.2;
  margin-top: 8px;
}
.row-main {
  min-width: 0;
}
.row-title {
  font-weight: 600;
  display: block;
  font-size: 1.0625rem;
}
.row-location,
.row-lead,
.row-extra {
  display: block;
  color: var(--muted);
  font-size: 0.9375rem;
  margin-top: 4px;
}
.row-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}
.row-heading .row-title {
  min-width: 0;
  overflow-wrap: anywhere;
}
.row .badge {
  flex-shrink: 0;
  margin: 0;
  max-width: 48%;
}
.row-date {
  display: block;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.badge {
  display: inline-block;
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.2;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--canvas);
  white-space: normal;
  color: var(--ink);
}
.badge.confirmed {
  background: color-mix(in srgb, var(--ridge) 12%, var(--paper));
  color: var(--confirmed-text);
}
.badge.tentative,
.badge.review {
  background: var(--amber-bg);
  color: var(--ink);
}
.badge.cancelled {
  color: var(--laterite);
  background: color-mix(in srgb, var(--laterite) 8%, var(--paper));
}
.row.cancelled .row-title {
  text-decoration: line-through;
  color: var(--muted);
}
.row.review {
  border-left: 3px solid var(--gold);
}
.empty {
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.empty p:last-child {
  margin: 0;
}
.show-more {
  display: block;
  margin: 24px auto 0;
}
.reminder-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  margin: 0 0 24px;
  border-left: 3px solid var(--gold);
  background: var(--paper);
  border-radius: 0 12px 12px 0;
}
.reminder-banner p {
  margin: 0;
  flex: 1;
}
.feedback {
  padding: 12px 16px;
  background: var(--paper);
  border-left: 3px solid var(--ridge);
  margin-bottom: 16px;
}
.error {
  color: var(--laterite);
  border-color: var(--laterite);
}
.offline-banner {
  padding: 12px 16px;
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  background: var(--amber-bg);
}
.offline-banner p {
  margin: 0;
}
.loading {
  display: grid;
  gap: 1px;
  border-radius: 16px;
  overflow: hidden;
}
.skeleton {
  height: 80px;
  background: var(--paper);
  position: relative;
}
.skeleton:after {
  content: "";
  display: block;
  background: var(--canvas);
  height: 12px;
  margin: 20px 24px;
  width: 60%;
  border-radius: 6px;
}
.month-controls {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
.month-controls h2 {
  font-size: 1.5rem;
  text-align: center;
  margin: 0;
}
.month-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.icon-button {
  width: 44px;
  padding: 8px;
}
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 24px;
}
.weekday {
  font-size: 0.8125rem;
  text-align: center;
  padding: 8px 0;
  color: var(--muted);
}
.month-cell {
  min-height: 64px;
  min-width: 0;
  border: 0;
  border-radius: 12px;
  padding: 4px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  font-size: 0.9375rem;
}
.month-cell[aria-pressed="true"] {
  box-shadow: inset 0 0 0 2px var(--ink);
}
.month-cell.past .date-number {
  color: var(--muted);
}
.date-number {
  width: 32px;
  min-height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.month-cell.today .date-number {
  background: var(--gold);
  color: var(--on-gold);
}
.event-dots {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
  min-height: 12px;
  font-size: 0.8125rem;
  line-height: 1;
}
.event-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
}
.event-dot.confirmed {
  background: var(--ridge);
}
.event-dot.review,
.event-dot.tentative {
  background: var(--gold-text);
}
.event-dot.cancelled {
  background: var(--laterite);
}
.month-titles {
  display: none;
}
.glass {
  --glass-tint: color-mix(in srgb, var(--paper) 58%, transparent);
  background: var(--glass-tint);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid color-mix(in srgb, #fff 55%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 70%, transparent),
    inset 0 -1px 0 color-mix(in srgb, var(--ink) 6%, transparent),
    0 10px 30px color-mix(in srgb, var(--ink) 18%, transparent),
    0 2px 6px color-mix(in srgb, var(--ink) 10%, transparent);
  position: relative;
  isolation: isolate;
  color: var(--ink);
  font-weight: 600;
}
.glass:before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    120% 80% at 30% 0%,
    color-mix(in srgb, #fff 45%, transparent),
    transparent 60%
  );
  mix-blend-mode: soft-light;
  z-index: -1;
}
.navigation {
  position: fixed;
  z-index: 10;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  height: auto;
  min-height: max(64px, 4em);
  font-size: 1rem;
  max-width: 480px;
  margin-inline: auto;
  border-radius: 28px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 4px;
  transition: transform 240ms var(--ease);
}
.navigation.nav-hidden {
  transform: translateY(calc(100% + 32px + env(safe-area-inset-bottom)));
}
.navigation button {
  background: transparent;
  border: 0;
  border-radius: 20px;
  padding: 2px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  position: relative;
  z-index: 1;
  font-size: 0.8125rem;
  line-height: 1.2;
  font-weight: 600;
  min-width: 0;
  min-height: calc(4em - 8px);
  overflow-wrap: anywhere;
}
.navigation button[aria-current="page"] {
  font-weight: 700;
}
.navigation button[aria-current="page"] > svg,
.navigation button[aria-current="page"] .nav-icon > svg {
  color: var(--on-gold);
}
.nav-bead {
  position: absolute;
  left: 0;
  top: 6px;
  width: 56px;
  height: 32px;
  border-radius: 999px;
  background: var(--gold);
  transition: transform 280ms var(--ease);
  pointer-events: none;
}
.nav-icon {
  position: relative;
  min-height: 24px;
  height: 1.8462em;
}
.count {
  position: absolute;
  top: -5px;
  right: -10px;
  background: var(--gold);
  color: var(--on-gold);
  min-width: 1.3847em;
  min-height: 1.3847em;
  height: auto;
  padding: 0.0769em 0.3077em;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2308;
}
.add-event {
  position: fixed;
  z-index: 9;
  right: max(20px, calc((100vw - 480px) / 2));
  bottom: calc(88px + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 16px;
  color: var(--gold-text);
}
.add-event span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
dialog {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  max-width: calc(100% - 32px);
  padding: 24px;
  border-radius: 24px;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--ink) 18%, transparent);
}
dialog::backdrop {
  background: color-mix(in srgb, var(--ink) 24%, transparent);
}
.detail {
  position: fixed;
  inset: calc(env(safe-area-inset-top) + 8px) 0 0;
  max-width: 100%;
  width: 100%;
  height: calc(100dvh - env(safe-area-inset-top) - 8px);
  max-height: none;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 24px 24px 0 0;
  overflow: hidden;
}
.detail[open] {
  display: flex;
  flex-direction: column;
}
.detail-top {
  border-radius: 24px 24px 0 0;
  padding: 44px 16px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  box-shadow: none;
}
.detail-top h2 {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin: 0;
}
.sheet-handle {
  position: absolute;
  top: 0;
  left: calc(50% - 28px);
  width: 56px;
  height: 44px;
  touch-action: none;
}
.sheet-handle::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 10px;
  width: 36px;
  height: 5px;
  background: var(--muted);
  border-radius: 999px;
  pointer-events: none;
}
.detail-body {
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  overflow: auto;
  overscroll-behavior: contain;
  flex: 1;
  min-height: 0;
}
.detail-title {
  font-size: 1.5rem;
  line-height: 1.2;
  margin: 12px 0 20px;
}
.detail-date {
  font-weight: 600;
}
.detail-body .read-line {
  margin-bottom: 8px;
}
.detail-body .notes {
  white-space: pre-wrap;
  margin: 24px 0;
}
.detail-body .button-row {
  margin: 24px 0;
}
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.fields {
  display: grid;
  gap: 16px;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin: 8px 0 0;
  min-width: 0;
}
legend {
  font-weight: 600;
  padding: 0 4px;
}
.recipient-tools {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}
.recipient-row {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  min-height: 48px;
}
.recipient-row:last-child {
  border-bottom: 0;
}
.edit-footer {
  position: sticky;
  bottom: 0;
  padding: 12px;
  margin: 0 -4px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  border-radius: 16px;
  box-shadow: none;
}
.edit-footer button {
  flex: 1 1 12ch;
}
.detail-body details {
  padding-block: 16px;
  border-top: 1px solid var(--line);
}
summary {
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
  font-weight: 600;
}
details p {
  margin-top: 12px;
}
dl {
  margin: 8px 0;
}
dt {
  font-size: 0.9375rem;
  color: var(--muted);
  margin-top: 12px;
}
dd {
  margin: 4px 0 0;
  white-space: pre-wrap;
}
.audit-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.audit-list > li {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.audit-list p {
  margin: 4px 0;
}
.audit-changes {
  margin: 8px 0;
  padding-left: 20px;
  font-size: 0.9375rem;
}
.menu-sheet {
  position: fixed;
  inset: auto 0 0;
  max-width: 100%;
  width: 100%;
  margin: 0;
  border-radius: 24px 24px 0 0;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.menu-sheet header,
.account-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.menu-sheet h2,
.account-dialog h2,
.confirm-dialog h2 {
  margin: 0;
}
.menu-items {
  display: grid;
  gap: 4px;
}
.menu-items button {
  text-align: left;
  min-height: 52px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.confirm-dialog {
  max-width: min(440px, calc(100% - 32px));
}
.confirm-dialog p {
  margin: 16px 0 24px;
}
.account-dialog {
  width: 440px;
}
.narrow-form {
  max-width: 440px;
}
.account-create {
  margin: 16px 0 24px;
  border-block: 1px solid var(--line);
  padding-block: 8px;
}
.account-form {
  padding: 16px 0;
}
.account {
  padding: 20px;
}
.account p {
  margin: 4px 0;
}
.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin-top: 16px;
}
.account-actions label {
  flex: 1 1 120px;
  font-size: 0.9375rem;
}
.account-actions button {
  flex: 1 0 auto;
}
.activity-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}
.toast,
.update-ready {
  font-weight: 600;
  position: fixed;
  z-index: 50;
  bottom: calc(88px + env(safe-area-inset-bottom));
  left: 16px;
  right: 16px;
  max-width: 440px;
  margin: auto;
  border-radius: 16px;
  padding: 16px;
}
.update-ready {
  display: flex;
  align-items: center;
  gap: 16px;
  bottom: calc(160px + env(safe-area-inset-bottom));
}
.update-ready span {
  flex: 1;
}
.error-retry {
  margin-top: 12px;
}
.signed-out .app-header {
  display: none;
}
.signed-out .shell {
  padding-top: 32px;
}
.session-expired .login {
  position: relative;
  z-index: 20;
}
.session-expired .shell {
  min-height: 100dvh;
}
.forced-password #navigation,
.forced-password #new-event {
  display: none !important;
}
@media (min-width: 600px) {
  .fields {
    grid-template-columns: 1fr 1fr;
  }
  .row {
    grid-template-columns: 56px minmax(0, 1fr);
    padding: 16px 20px;
  }
  .row .badge {
    margin-top: 0;
  }
  .month-controls {
    grid-template-columns: 44px 1fr 44px auto;
  }
  .month-actions {
    grid-column: auto;
  }
  .menu-sheet {
    inset: auto 16px 16px;
    margin-inline: auto;
    max-width: 480px;
    border-radius: 24px;
  }
  .account-form {
    grid-template-columns: 1fr 1fr;
  }
  .account-form p,
  .account-form button {
    grid-column: 1/-1;
  }
}
@media (min-width: 1024px) {
  .shell {
    padding: 32px 32px 48px 120px;
    max-width: 1300px;
  }
  .header-inner {
    padding-inline: 120px 32px;
    max-width: 1300px;
  }
  .signed-out .shell,
  .signed-out .header-inner {
    padding-left: 32px;
  }
  .navigation {
    left: 0;
    right: auto;
    top: 0;
    bottom: 0;
    margin: 0;
    width: 88px;
    max-width: none;
    height: 100dvh;
    border-radius: 0 28px 28px 0;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 72px);
    padding: 112px 4px 12px;
    align-content: start;
  }
  .navigation button {
    min-height: 64px;
    gap: 6px;
  }
  .nav-bead {
    top: 0;
    left: 16px;
  }
  .navigation.nav-hidden {
    transform: none;
  }
  .add-event {
    top: 20px;
    left: 8px;
    bottom: auto;
    right: auto;
    width: 72px;
    height: auto;
    min-height: 72px;
    border-radius: 14px;
    padding: 8px;
    background: var(--ridge);
    color: var(--on-ridge);
    font-size: 0.8125rem;
    line-height: 1.2;
    box-shadow: none;
    display: grid;
    justify-items: center;
    gap: 4px;
    z-index: 11;
  }
  .add-event:before {
    display: none;
  }
  .add-event span {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
  }
  .work-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }
  .work-grid.detail-open {
    grid-template-columns: minmax(0, 1fr) 420px;
  }
  .detail {
    position: sticky;
    top: 104px;
    inset-inline: auto;
    bottom: auto;
    width: 420px;
    height: calc(100dvh - 128px);
    max-height: 900px;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: none;
  }
  .detail-top {
    padding-top: 16px;
  }
  .sheet-handle {
    display: none;
  }
  .detail-body {
    padding: 24px;
  }
  .month-cell {
    min-height: 104px;
    align-items: stretch;
    padding: 8px 4px;
  }
  .month-cell .date-number {
    align-self: center;
  }
  .month-titles {
    display: grid;
    gap: 4px;
    text-align: left;
    font-size: 0.8125rem;
    min-width: 0;
  }
  .month-titles span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .event-dots {
    display: none;
  }
  .toast {
    left: 120px;
    bottom: 24px;
  }
  .update-ready {
    left: 120px;
    bottom: 100px;
  }
  .menu-sheet {
    inset: 96px auto auto 104px;
    margin: 0;
    width: 360px;
  }
  .offline-banner {
    padding-left: 120px;
  }
  .forced-password .shell,
  .forced-password .header-inner {
    padding-left: 32px;
  }
}
:where(:root[data-theme="dark"]) .glass {
    --glass-tint: color-mix(in srgb, var(--paper) 80%, transparent);
    border-color: color-mix(in srgb, #fff 14%, transparent);
    box-shadow:
      inset 0 1px 0 color-mix(in srgb, #fff 18%, transparent),
      0 10px 30px rgb(0 0 0 / 0.5);
  }:where(:root[data-theme="dark"]) .detail-top,
:where(:root[data-theme="dark"]) .edit-footer,
:where(:root[data-theme="dark"]) .add-event {
    box-shadow: none;
  }

@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme])) .glass {
    --glass-tint: color-mix(in srgb, var(--paper) 80%, transparent);
    border-color: color-mix(in srgb, #fff 14%, transparent);
    box-shadow:
      inset 0 1px 0 color-mix(in srgb, #fff 18%, transparent),
      0 10px 30px rgb(0 0 0 / 0.5);
  }:where(:root:not([data-theme])) .detail-top,
:where(:root:not([data-theme])) .edit-footer,
:where(:root:not([data-theme])) .add-event {
    box-shadow: none;
  }
}

@supports not (
  (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))
) {
  .glass {
    background: color-mix(in srgb, var(--paper) 96%, transparent);
  }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .glass {
    background: var(--paper);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: 2px solid var(--ink);
  }
  .glass:before {
    display: none;
  }
  .add-event {
    color: var(--gold-text);
  }
  .list,
  dialog {
    border: 2px solid var(--ink);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
  .navigation.nav-hidden {
    transform: none;
  }
}

/* Rem-based clearance preserves navigation at enlarged text sizes. */
@media (max-width: 1023px) {
  .shell {
    padding-bottom: calc(max(96px, 6rem) + env(safe-area-inset-bottom));
  }
  .navigation button {
    justify-content: flex-start;
    padding-top: 4px;
  }
  .add-event {
    bottom: calc(max(88px, 5.5rem) + env(safe-area-inset-bottom));
  }
  .toast {
    bottom: calc(max(88px, 5.5rem) + env(safe-area-inset-bottom));
  }
  .update-ready {
    bottom: calc(max(160px, 10rem) + env(safe-area-inset-bottom));
  }
}
.app-header.glass {
  position: sticky;
}
.range-continuation {
  margin-top: 16px;
}

.navigation button > svg,
.navigation button > .nav-icon {
  order: -1;
}

/* WebKit's native painted select can ignore the requested touch height. */
select {
  -webkit-appearance: none;
  appearance: none;
  height: 3rem;
  padding-right: 44px;
}
label:has(> select) {
  position: relative;
}
label:has(> select)::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: calc(1.5rem - 4px);
  width: 8px;
  height: 8px;
  border-right: 1.75px solid currentColor;
  border-bottom: 1.75px solid currentColor;
  transform: rotate(45deg);
  pointer-events: none;
}
.filter-row select {
  height: 2.75rem;
  padding-block: 8px;
  padding-right: 40px;
}
.filter-row label:has(> select)::after {
  bottom: calc(1.375rem - 4px);
}

/* R2: compact phone tools, readable row status, and deliberate account actions. */
#open-filters { flex-shrink: 0; max-width: 100%; font-size: .9375rem; white-space: nowrap; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filter-chip { border-radius: 999px; font-size: .9375rem; }
.filter-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 48px); }
.filter-dialog header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.filter-dialog h2 { margin: 0; font-size: 1.125rem; }
.account { padding: 16px; }
.account h2 { margin-bottom: 4px; }
.account-actions { margin-top: 12px; flex-wrap: wrap; }
.account-actions button { flex: 0 0 auto; }
.account-manage { margin-top: 8px; }
.account-manage summary { width: fit-content; min-height: 44px; padding: 10px 0; cursor: pointer; }
.account-manage .button-row { padding-block: 8px; }
.account > button { margin-top: 8px; }
@media (max-width: 1023px) {
  .page-head { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
  .page-head > div { min-width: 0; flex: 1 1 120px; }
  #main[data-current-pane="dashboard"] .page-head > div { flex: 1 0 auto; max-width: 100%; }
  #main[data-current-pane="month"] #screen-subtitle { display: none; }
  #main[data-current-pane="month"] { padding-top: 16px; }
  #main[data-current-pane="month"] .page-head { align-items: center; margin-bottom: 12px; }
  #main[data-current-pane="month"] .month-controls { margin-bottom: 12px; }
  #main[data-current-pane="month"] .page-head h1 { margin: 0; }
  #main[data-current-pane="agenda"] .list > li:last-child .row,
  #reminder-list .list > li:last-child .row { padding-bottom: 72px; }
}

/* Dashboard and shared chiefs directory use the established working surfaces. */
#dashboard-greeting { margin-bottom: 4px; font-size: 1.5rem; overflow-wrap: anywhere; }
#dashboard-date { margin: 0 0 24px; }
#dashboard-list .row { grid-template-columns: minmax(0, 1fr); padding: 20px; }
#dashboard-list .row-time { margin-bottom: 4px; }
#dashboard-list .row-date { margin-bottom: 8px; }
.dashboard-actions { margin-top: 24px; }
.chief-directory-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 24px 0; }
.chief-directory-tools > label:first-child { flex: 1 1 240px; }
.chief-entry { padding: 20px; }
.chief-entry h2 { margin: 0 0 8px; overflow-wrap: anywhere; }
.chief-entry p { margin: 6px 0; overflow-wrap: anywhere; }
.chief-entry button { margin-top: 12px; }
.chief-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 32px); }
.chief-dialog header { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.chief-dialog h2 { margin: 0; font-size: 1.125rem; }
.chief-picker { min-width: 0; }
.chief-picker > label { margin-top: 12px; }
.chief-picker input { margin-top: 8px; }
.selected-chiefs { display: flex; flex-wrap: wrap; gap: 8px; }
.chief-chip { display: flex; align-items: center; gap: 4px; padding-left: 12px; border-radius: 12px; background: var(--canvas); min-width: 0; max-width: 100%; }
.chief-chip > span { overflow-wrap: anywhere; }
.chief-chip button { flex: none; min-width: 44px; padding: 8px; border: 0; background: transparent; }
.chief-suggestions { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); max-height: 240px; overflow-y: auto; }
.chief-suggestions [role="option"] { min-height: 48px; padding: 12px; cursor: pointer; overflow-wrap: anywhere; }
.chief-suggestions [aria-selected="true"] { background: var(--canvas); outline: 2px solid var(--gold-text); outline-offset: -2px; }
@media (min-width: 1024px) { .navigation { grid-template-columns: minmax(0,1fr); } }

/* CAL-026: compact appearance controls alongside the existing account button. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.header-inner > .brand { min-width: 0; }
.appearance { position: relative; }
#appearance-button { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; }
.appearance-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 220px; max-width: calc(100vw - 32px); padding: 16px; border-radius: 16px; background: var(--paper); box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 20%, transparent); }
.appearance-panel fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.appearance-panel legend { font-weight: 600; padding: 0; margin-bottom: 8px; }
.appearance-panel label { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.appearance-panel input { width: 20px; height: 20px; margin: 0; accent-color: var(--ridge); }
.appearance-panel p { margin: 8px 0 0; }

/* Ridge haze, 25 November 2026 (CAL-027): ridge backdrop, liquid glass surfaces and touch motion. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: min(520px, 70vh);
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 48% at 82% 100%, var(--hill-3) 98.5%, transparent 100%),
    radial-gradient(ellipse 85% 62% at 12% 104%, var(--hill-2) 98.5%, transparent 100%),
    radial-gradient(ellipse 95% 72% at 68% 112%, var(--hill-1) 98.5%, transparent 100%),
    radial-gradient(circle at 78% 300px, var(--sun) 0 72px, transparent 73px);
}
.glass,
.list,
.empty,
.reminder-banner,
dialog,
.appearance-panel {
  --glass-tint: color-mix(in srgb, var(--paper) var(--glass-pct), transparent);
  background: var(--glass-tint);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-rim), var(--glass-shadow);
}
.list,
.empty {
  border-radius: 22px;
  /* Performance budget: live blur only on floating chrome; cards keep tint, rim and shadow. */
  --glass-tint: color-mix(in srgb, var(--paper) var(--card-pct), transparent);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
dialog,
.detail,
.menu-sheet,
.appearance-panel {
  --glass-tint: color-mix(in srgb, var(--paper) var(--sheet-pct), transparent);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
dialog::backdrop {
  background: rgb(42 31 61 / 0.28);
}
.reminder-banner {
  border-left: 0;
  border-radius: 20px;
  background: color-mix(in srgb, var(--ink) 86%, transparent);
  color: var(--canvas);
  border-color: rgb(255 255 255 / 0.14);
}
.reminder-banner button {
  background: var(--gold);
  color: var(--on-gold);
  border-color: transparent;
}
.add-event {
  background: color-mix(in srgb, var(--ink) 86%, transparent);
  color: var(--add-fg);
  border-color: rgb(255 255 255 / 0.14);
  border-radius: 20px;
}
.badge.confirmed { background: var(--ok-bg); color: var(--confirmed-text); }
.badge.tentative,
.badge.review { background: var(--amber-bg); color: var(--warn-text); }
.badge.cancelled { background: var(--cancel-bg); color: var(--laterite); }
.nav-bead {
  box-shadow: 0 4px 14px rgb(201 214 75 / 0.45);
  transition:
    transform 440ms cubic-bezier(0.34, 1.32, 0.52, 1),
    scale 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.nav-bead.moving { scale: 1.22 0.94; }
.navigation button {
  transition: transform 160ms var(--ease);
}
.navigation button:active { transform: scale(0.94); }
.navigation button .nav-icon > svg,
.navigation button > svg {
  transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.navigation button[aria-current="page"] .nav-icon > svg,
.navigation button[aria-current="page"] > svg {
  transform: translateY(-2px) scale(1.06);
}
button {
  transition: transform 140ms var(--ease);
}
button:active { transform: scale(0.97); }
.row:active { transform: scale(0.99); }
dialog[open] {
  animation: glass-rise 200ms cubic-bezier(0.05, 0.7, 0.1, 1);
}
dialog[open]::backdrop {
  animation: glass-fade 240ms ease-out;
}
.appearance-panel:not([hidden]) {
  animation: glass-pop 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-origin: top right;
}
.toast:not([hidden]) {
  animation: glass-rise 220ms cubic-bezier(0.05, 0.7, 0.1, 1);
}
@keyframes glass-rise { from { transform: translateY(14px); } }
@keyframes glass-fade { from { opacity: 0; } }
@keyframes glass-pop { from { transform: scale(0.96) translateY(-4px); } }
@media (max-width: 1023px) {
  #main[data-current-pane="agenda"] .list > li:last-child .row,
  #reminder-list .list > li:last-child .row { padding-bottom: 16px; }
  #event-list,
  #reminder-list { padding-bottom: 96px; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .list, .empty, dialog, .appearance-panel {
    background: color-mix(in srgb, var(--paper) 96%, transparent);
  }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .glass, .list, .empty, dialog, .appearance-panel, .reminder-banner, .add-event {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: 2px solid var(--ink);
  }
  .glass, .list, .empty, dialog, .appearance-panel { background: var(--paper); }
  .reminder-banner, .add-event { background: var(--ink); }
  body::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-bead.moving { scale: 1; }
  .navigation button[aria-current="page"] .nav-icon > svg,
  .navigation button[aria-current="page"] > svg { transform: none; }
  dialog[open], dialog[open]::backdrop, .appearance-panel:not([hidden]), .toast:not([hidden]) { animation: glass-fade 120ms ease-out; }
}
.login-header {
  padding-top: 212px;
  min-height: 0;
}
.login-header::before {
  inset: 8px 0 auto 0;
  height: 196px;
  background-size: contain;
  background-position: center top;
  opacity: 0.38;
}
:where(:root[data-theme="dark"]) .login-header::before { opacity: 0.32; }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme])) .login-header::before { opacity: 0.32; }
}
.menu-items button {
  background: transparent;
  border-bottom-color: var(--line);
}
.menu-items #logout,
#logout {
  color: var(--laterite);
  border-bottom: 0;
}

/* CAL-028: engagement cards carry one thin thread on their own edge (drawn by drawThread). */
.thread-card {
  position: relative;
}
.thread-card > svg.thread {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
}
.thread-card > svg.thread .t1 { stroke: var(--thread-1); }
.thread-card > svg.thread .t2 { stroke: var(--thread-2); }
.thread-card > svg.thread .t3 { stroke: var(--thread-3); }
.thread-card > svg.thread .t4 { stroke: var(--thread-4); }
.thread-card > .list > li + li {
  border-top-color: transparent;
}
.thread-card .row.review {
  border-left: 0;
}

/* Clear glass, 25 November 2026 (CAL-030): engagement cards become see-through liquid glass.
   A fixed colour field sits behind the content so the blur has something to bend; cards
   get live blur, a low tint, a top sheen and a bright specular rim. Text stays on a tint
   that keeps 4.5:1 (tests/test_ridge_haze.py). */
/* The ridge now fades by mask, so the colour field shows through without a seam. */
body::before {
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(38vmax 30vmax at 8% 38%, var(--field-1), transparent 70%),
    radial-gradient(34vmax 28vmax at 96% 62%, var(--field-2), transparent 70%),
    radial-gradient(40vmax 30vmax at 30% 96%, var(--field-3), transparent 70%);
}
.list,
.empty {
  --glass-tint: color-mix(in srgb, var(--paper) var(--clear-pct), transparent);
  background:
    linear-gradient(165deg, var(--clear-sheen), transparent 38%),
    var(--glass-tint);
  -webkit-backdrop-filter: var(--clear-filter);
  backdrop-filter: var(--clear-filter);
  border: 1px solid transparent;
  box-shadow:
    inset 0 1px 0 var(--clear-rim),
    inset 1px 0 0 var(--clear-lowrim),
    inset -1px 0 0 var(--clear-lowrim),
    inset 0 -1px 0 var(--clear-lowrim),
    var(--glass-shadow);
}
.list .row { background: transparent; }
@media (hover: hover) and (pointer: fine) {
  .list .row:hover { background: color-mix(in srgb, var(--paper) 40%, transparent); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .list, .empty { background: color-mix(in srgb, var(--paper) 96%, transparent); }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .list, .empty { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; border: 2px solid var(--ink); box-shadow: none; }
  body::after { display: none; }
}

/* Phone alerts card and engagement alert status (CAL-031, CAL-035). */
.alerts-card {
  margin: 16px 0 24px;
  padding: 16px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--paper) var(--sheet-pct), transparent);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-rim), var(--glass-shadow);
}
.alerts-card h2 { margin: 0 0 8px; font-size: 1.125rem; }
.alerts-card p { margin: 0 0 12px; }
.alerts-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.alerts-actions button { min-height: 44px; }
.alert-person { padding: 12px 0; border-top: 1px solid var(--line); }
.alert-person:first-of-type { border-top: 0; }
.alert-person p { margin: 4px 0 8px; }
.alert-list { margin: 0; padding-left: 20px; }
.alert-list li { margin: 4px 0; }
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .alerts-card { background: var(--paper); border: 2px solid var(--ink); box-shadow: none; }
}

/* The engagement sheet blurs what is behind it, so agenda text never shows through
   the words being read (found in the CAL-035 screenshots; glass look kept). */
.detail {
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .detail { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--paper); }
}

/* Monday.com-inspired views, 25 November 2026 (CAL-038 to CAL-042). */
.view-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 4px 0 16px;
}
.saved-views {
  display: flex;
  gap: 8px;
  flex: 1 1 320px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
  margin: -2px;
}
.saved-views::-webkit-scrollbar { display: none; }
.saved-views button,
.layout-switch button {
  flex: none;
  min-height: 44px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0 16px;
}
.saved-views button[aria-pressed="true"],
.layout-switch button[aria-pressed="true"] {
  background: var(--ridge);
  color: var(--on-ridge);
  border-color: var(--ridge);
}
.layout-switch {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--glass-edge);
  background: color-mix(in srgb, var(--paper) 60%, transparent);
}
.layout-switch button { border: 0; background: transparent; }

/* One-tap status beside a card (CAL-038). */
/* It sits where the badge was, beside the title (R2-5), above the card's own button. */
li.has-status { position: relative; }
li.has-status .row-heading { padding-right: 8rem; }
li.has-status > .status-button {
  position: absolute;
  top: 8px;
  right: 8px;
  max-width: 8rem;
  z-index: 2;
}
.status-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}
.status-button .status-mark { font-size: 0.75rem; color: var(--muted); }
.status-dialog { width: min(400px, calc(100% - 32px)); }
.status-dialog h2 { margin: 0 0 4px; font-size: 1.125rem; }
.status-options { display: grid; gap: 8px; margin: 16px 0; }
.status-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: transparent;
  text-align: left;
}
.status-option[aria-current="true"] { border: 2px solid var(--ridge); }
.status-note { font-size: 0.8125rem; color: var(--muted); font-weight: 400; }
.status-cancel, .status-restore { margin-top: 8px; width: 100%; min-height: 48px; }

/* Week groups (CAL-042). */
.week-group { margin-bottom: 8px; }
.week-heading { margin: 20px 0 4px; font-size: 1rem; }
.week-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-align: left;
}
.week-toggle::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 160ms var(--ease);
  margin: 0 6px 4px 2px;
  flex: none;
}
.week-toggle[aria-expanded="false"]::before { transform: rotate(-45deg); margin-bottom: 0; }
.week-label { flex: 1; min-width: 0; }
.week-count { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 0.9375rem; white-space: nowrap; }
@media (max-width: 599px) {
  /* Phones: the count sits under the week label instead of squeezing it. */
  .week-toggle { flex-wrap: wrap; row-gap: 2px; }
  .week-count { flex-basis: 100%; margin-left: 24px; font-size: 0.875rem; }
}

/* Desktop table (CAL-039). */
.table-card {
  border-radius: 22px;
  overflow: hidden;
  --glass-tint: color-mix(in srgb, var(--paper) var(--clear-pct), transparent);
  background: linear-gradient(165deg, var(--clear-sheen), transparent 38%), var(--glass-tint);
  -webkit-backdrop-filter: var(--clear-filter);
  backdrop-filter: var(--clear-filter);
  box-shadow: inset 0 1px 0 var(--clear-rim), inset 0 -1px 0 var(--clear-lowrim), var(--glass-shadow);
}
.event-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.event-table th,
.event-table td { padding: 8px 12px; text-align: left; vertical-align: middle; border-top: 1px solid var(--line); }
.event-table thead th { border-top: 0; color: var(--muted); font-size: 0.875rem; font-weight: 600; white-space: nowrap; }
.event-table td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sort-button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}
.week-row th {
  background: color-mix(in srgb, var(--paper) 55%, transparent);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
}
.table-title {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-align: left;
}
@media (hover: hover) and (pointer: fine) {
  .table-title:hover { text-decoration: underline; }
  .event-table tbody tr.event-row:hover { background: color-mix(in srgb, var(--paper) 40%, transparent); }
}
.event-row.cancelled td { color: var(--muted); }
.mine-heading { font-size: 1rem; margin: 20px 0 8px; }
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .table-card { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; border: 2px solid var(--ink); box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .week-toggle::before { transition: none; }
}
/* Small dialogs blur what is behind them too, so list text never shows through their words. */
.status-dialog,
.confirm-dialog {
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .status-dialog, .confirm-dialog { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--paper); }
}
