:root {
  --bg: #f1f2f4;
  --fg: #15171a;
  --surface: #fff;
  --surface-variant: #e7e8ea;
  --muted: #5e6266;
  --primary: #c20302;
  --on-primary: #fff;
  --today-bg: rgba(194, 3, 2, 0.12);
  --now-bg: rgba(194, 3, 2, 0.07);
  --mark-bg: rgba(194, 3, 2, 0.12);
  --foreign-bg: rgba(0, 0, 0, 0.05);
  --selected-bg: rgba(194, 3, 2, 0.10);
  --chip-bg: #fadadb;
  --chip-border: #c9cbcf;
  --button-border: rgba(194, 3, 2, 0.4);
  --today-border: rgba(194, 3, 2, 0.35);
  --online: #086b35;
  --tile: #f4f5f7;
  --online-bg: rgba(8, 107, 53, 0.12);
  --divider: #e2e3e5;
  --outline: #808387;
  --overlay: rgba(0, 0, 0, 0.45);
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000;
    --fg: #f5f5f5;
    --surface: #141414;
    --surface-variant: #1f1f1f;
    --muted: #9aa0a6;
    --primary: #ff6b70;
    --on-primary: #000;
    --today-bg: rgba(255, 107, 112, 0.14);
    --now-bg: rgba(255, 107, 112, 0.07);
    --mark-bg: rgba(255, 107, 112, 0.12);
    --foreign-bg: rgba(255, 255, 255, 0.07);
    --selected-bg: rgba(255, 107, 112, 0.18);
  --chip-bg: #3d2224;
  --chip-border: #3a3a3a;
    --button-border: rgba(255, 107, 112, 0.35);
    --today-border: rgba(255, 107, 112, 0.35);
    --online: #4cc38a;
    --tile: #1c1c1c;
    --online-bg: rgba(76, 195, 138, 0.14);
    --divider: #262626;
    --outline: #6e6e6e;
    --overlay: rgba(0, 0, 0, 0.65);
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000;
  --fg: #f5f5f5;
  --surface: #141414;
  --surface-variant: #1f1f1f;
  --muted: #9aa0a6;
  --primary: #ff6b70;
  --on-primary: #000;
  --today-bg: rgba(255, 107, 112, 0.14);
  --now-bg: rgba(255, 107, 112, 0.07);
  --mark-bg: rgba(255, 107, 112, 0.12);
  --foreign-bg: rgba(255, 255, 255, 0.07);
  --selected-bg: rgba(255, 107, 112, 0.18);
  --chip-bg: #3d2224;
  --chip-border: #3a3a3a;
  --button-border: rgba(255, 107, 112, 0.35);
  --today-border: rgba(255, 107, 112, 0.35);
  --online: #4cc38a;
  --tile: #1c1c1c;
  --online-bg: rgba(76, 195, 138, 0.14);
  --divider: #262626;
  --outline: #6e6e6e;
  --overlay: rgba(0, 0, 0, 0.65);
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--covered, 166px) + 14px);
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  overflow-x: hidden;
}
body.dialog-open { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: inherit;
}
button:disabled { cursor: default; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.list-row:focus-visible, .pin-open:focus-visible, .pin-star:focus-visible,
.role-row:focus-visible, .tab:focus-visible, .segment:focus-visible { outline-offset: -3px; }
p a, .point a { text-decoration: underline; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 16px; }
.strong { font-weight: 600; }
.boot {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}
.screen {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
}
.head {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}
.topbar {
  display: flex;
  align-items: center;
  min-height: 64px;
  padding: env(safe-area-inset-top) 4px 0 16px;
  background: var(--bg);
}
.screen.picker .topbar,
.screen.settings .topbar {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 10;
  padding-left: 4px;
}
.title-block { flex: 1; min-width: 0; }
.topbar-title {
  flex: 1;
  min-width: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.screen.picker .topbar-title,
.screen.settings .topbar-title { padding-left: 8px; }
.topbar-title.name {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.fetched { font-size: 11px; color: var(--muted); }
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: var(--fg);
  flex: none;
}
.icon-button:active { background: var(--surface-variant); }
.icon-button:disabled { color: var(--muted); }
.icon { display: inline-flex; line-height: 0; }
.icon svg { display: block; }
.icon.spin svg {
  animation: spin 0.45s linear infinite;
  animation-delay: var(--spin-shift, 0ms);
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .icon.spin svg { animation: none; }
}
.tabs { display: flex; }
.week-strip {
  position: -webkit-sticky;
  position: sticky;
  top: calc(var(--head-h, 0px) + var(--row-shift, 0px) + 6px);
  z-index: 9;
  display: flex;
  width: calc(100% - 24px);
  max-width: 420px;
  margin: 6px auto 8px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 0 0 6px var(--bg);
}
@media (min-width: 445px) {
  .week-strip { box-shadow: 0 0 0 1px var(--divider); }
}
.week-strip { overflow: hidden; }
.week-days {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
}
.week-leave {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  right: 4px;
}
.week-pill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc(100% / 7);
  opacity: 0;
  transform: translateX(calc(var(--i, 0) * 100%));
}
.week-pill::before {
  content: '';
  display: block;
  height: 100%;
  max-width: 56px;
  margin: 0 auto;
  border-radius: 10px;
  background: var(--primary);
}
.week-strip.marked .week-pill { opacity: 1; }
.week-day {
  flex: 1;
  min-width: 0;
  padding: 4px 0 7px;
  border: 0;
  background: none;
  color: var(--fg);
  text-align: center;
  position: relative;
}
.week-name { display: block; font-size: 11px; line-height: 16px; font-weight: 500; letter-spacing: 0.5px; color: var(--muted); }
.week-num { display: block; font-size: 16px; font-weight: 600; line-height: 24px; }
.week-day.on { color: var(--on-primary); }
.week-day.on .week-name { color: var(--on-primary); }
.week-day.today::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--primary);
}
.week-day.today.on::after { background: var(--on-primary); }
.tab {
  flex: 1;
  min-width: 0;
  padding: 14px 8px;
  line-height: 20px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  position: relative;
}
.tab.fit-tight { padding-left: 0; padding-right: 0; }
.tab-label {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--primary);
  transform: scaleX(0);
}
.tab.on::after {
  transform: none;
}
@media (min-width: 641px) {
  .head .tab:first-child::after { background: linear-gradient(to right, transparent, var(--primary) 96px); }
  .head .tab:last-child::after { background: linear-gradient(to left, transparent, var(--primary) 96px); }
}
.tabs.soon { margin-bottom: 8px; }
.tabs.float {
  position: -webkit-sticky;
  position: sticky;
  top: var(--head-h, 0);
  z-index: 8;
  margin-bottom: 0;
  background: var(--bg);
}
.screen > .tabs.float { padding-bottom: 8px; }
:root:not([data-glass]) .screen > .tabs.float::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -6px;
  left: 0;
  height: 6px;
  background: var(--bg);
}
.row-hidden > .tabs.float {
  top: calc(var(--head-h, 0px) - var(--row-h, 0px));
  visibility: hidden;
}
.row-moving > .week-strip,
.row-moving > .tabs.float { transition: top 0.2s ease; }
.row-moving.row-hidden > .tabs.float { transition: top 0.2s ease, visibility 0s 0.2s; }
