:root {
  color-scheme: light;
  --paper: #edf2fa;
  --card: #f9fbff;
  --ink: #182641;
  --muted: #51617b;
  --line: #d8e1f0;
  --strong-line: #9eafce;
  --accent: #3154a5;
  --on-accent: white;
  --brand: #264483;
  --soft: #e0e9ff;
  --subtle: #eef3fb;
  --weekend: #f4f7fd;
  --selected: #deebff;
  --warm: #f9e8d7;
  --warm-ink: #79502c;
  --danger: #9e3a47;
  --danger-surface: #fceef0;
  --shadow: 0 4px 16px #2439620b;
  font-family: Roboto, 'Segoe UI', Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #0d1422;
  --card: #141e30;
  --ink: #edf2ff;
  --muted: #adbcd6;
  --line: #2b3953;
  --strong-line: #586a8e;
  --accent: #a8bbff;
  --on-accent: #111d38;
  --brand: #bccbff;
  --soft: #243353;
  --subtle: #19253a;
  --weekend: #172237;
  --selected: #25395e;
  --warm: #392e38;
  --warm-ink: #efc1a6;
  --danger: #ffc2c8;
  --danger-surface: #422a30;
  --shadow: 0 6px 22px #0307184d;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
button,
select,
input,
textarea {
  font: inherit;
  color: inherit;
}
button,
select {
  touch-action: manipulation;
}
button {
  border: 0;
  background: transparent;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
button:disabled {
  opacity: 0.5;
}
svg.ico {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.appbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.bar-inner,
main {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 52px);
}
.bar-inner {
  display: flex;
  align-items: center;
  min-height: 68px;
  gap: 42px;
}
.brand,
.bar-actions,
.main-actions,
.ph,
.arrows,
.viewbar,
.select-wrap,
.daily-heading,
.source-head,
.actions {
  display: flex;
  align-items: center;
}
.brand {
  gap: 10px;
  font-size: 22px;
  line-height: 1;
  font-weight: 750;
  letter-spacing: -0.9px;
  white-space: nowrap;
}
.brandmark {
  width: 36px;
  height: 36px;
}
.bar-actions {
  margin-left: auto;
  gap: 3px;
}
.icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  flex: none;
  border-radius: 50%;
  color: var(--accent);
}
.icon:hover,
.icon:active,
.icon[aria-current='page'],
.today:hover {
  background: var(--soft);
}
.tiny {
  width: 34px;
  height: 36px;
}
.tiny svg {
  width: 16px;
  height: 16px;
}
main {
  padding-top: 32px;
  padding-bottom: 42px;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 22px;
}
h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}
.heading h1 {
  margin: 0;
  font-size: clamp(27px, 3.5vw, 38px);
  line-height: 1.16;
  letter-spacing: -1.4px;
  font-weight: 730;
}
.page-purpose {
  margin: 5px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 62ch;
}
.heading h1:focus,
#sheet-title:focus,
h2[id^='inbox-']:focus {
  outline: none;
}
#recognition-inbox .secondary {
  width: 100%;
}
#app-status {
  max-width: 1240px;
  margin: 12px auto 0;
  padding-inline: clamp(18px, 4vw, 52px);
}
#app-status + #profile-error + main,
#app-status:not([hidden]) ~ main {
  padding-top: 18px;
}
.status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--soft);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}
.status-line + .status-line {
  margin-top: 8px;
}
.status-line p {
  margin: 0;
  flex: 1 1 240px;
}
#first-use {
  margin-bottom: 16px;
}
#first-use .icon {
  margin-left: auto;
}
#first-use .ico {
  width: 18px;
}
#settings-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin-bottom: 4px;
  font-size: 14px;
}
#settings-back .ico {
  width: 17px;
  height: 17px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.main-actions,
.actions {
  gap: 9px;
}
.primary,
.secondary,
.danger {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 650;
  font-size: 14px;
  line-height: 1.25;
  text-align: center;
}
.primary {
  color: var(--on-accent);
  background: var(--accent);
}
.primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, var(--ink));
}
.secondary {
  background: var(--card);
  color: var(--accent);
  border-color: var(--strong-line);
}
.secondary:hover {
  background: var(--soft);
}
.danger {
  color: var(--danger);
  background: var(--danger-surface);
  border-color: var(--line);
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(244px, 28%);
  align-items: start;
  gap: 20px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
}
aside {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.calendar-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  min-height: 74px;
  padding: 15px 20px;
}
.ph {
  min-width: 0;
}
.ph h2 {
  font-size: clamp(19px, 2.1vw, 25px);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.7px;
  line-height: 1.12;
}
.ph .icon {
  width: 29px;
  margin-left: 2px;
}
.ph .ico {
  width: 13px;
}
.viewbar {
  gap: 9px;
}
.select-wrap {
  position: relative;
  color: var(--accent);
  border: 1px solid var(--strong-line);
  background: var(--card);
  border-radius: 8px;
  height: 36px;
}
.select-wrap span:first-child {
  display: inline-flex;
  position: absolute;
  left: 8px;
  pointer-events: none;
}
.select-wrap span:last-child {
  position: absolute;
  display: inline-flex;
  right: 7px;
  pointer-events: none;
}
.select-wrap svg {
  width: 14px;
  height: 14px;
}
.select-wrap span:last-child svg {
  width: 10px;
}
.select-wrap select {
  border: 0;
  appearance: none;
  cursor: pointer;
  height: 100%;
  color: inherit;
  background: transparent;
  padding: 0 23px 0 28px;
  font-weight: 650;
  font-size: 13px;
}
.today {
  border-radius: 8px;
  background: var(--soft);
  color: var(--accent);
  padding: 0 12px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 650;
}
.arrows {
  gap: 1px;
}
.arrows button {
  border-radius: 8px;
}
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.month-grid.kw {
  grid-template-columns: 27px repeat(7, minmax(0, 1fr));
}
.dow,
.weeknum {
  text-align: center;
  color: var(--muted);
  background: var(--subtle);
  border-top: 1px solid var(--line);
}
.dow {
  padding: 10px 0;
  font-size: 12px;
  font-weight: 600;
}
.weeknum {
  font-size: 10px;
  display: grid;
  place-content: center;
}
.cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  text-align: left;
  min-height: 76px;
  padding: 5px;
  background: var(--card);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  overflow: hidden;
}
.cell.weekend {
  background: var(--weekend);
}
.cell.outside {
  color: var(--muted);
}
.cell:hover {
  background: var(--subtle);
}
.cell.selected {
  background: var(--selected);
}
.date-num {
  display: grid;
  place-items: center;
  height: 25px;
  min-width: 25px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
}
.is-today .date-num {
  color: var(--accent);
  box-shadow: inset 0 0 0 1.4px var(--accent);
}
.selected .date-num {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: none;
}
.dots {
  display: none;
}
.chip {
  display: block;
  max-width: 100%;
  font-weight: 600;
  font-size: 11px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-left: 3px solid var(--event);
  border-radius: 3px;
  padding: 2px 4px;
  background: var(--soft);
  background: color-mix(in srgb, var(--event) 17%, var(--card));
  color: var(--ink);
}
.more {
  color: var(--muted);
  font-size: 10px;
}
.daily,
.sources {
  padding: 18px;
}
.daily-heading,
.source-head {
  gap: 10px;
}
.section-icon {
  display: inline-grid;
  place-items: center;
  border-radius: 11px;
  width: 36px;
  height: 36px;
  background: var(--soft);
  color: var(--accent);
  flex: none;
}
.section-icon svg {
  width: 20px;
  height: 20px;
}
.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
}
.daily h2,
.source-head h3 {
  margin: 0;
  line-height: 1.2;
  font-size: 18px;
  letter-spacing: -0.4px;
}
.source-head .section-icon {
  background: var(--warm);
  color: var(--warm-ink);
}
.source-head h3 {
  font-size: 16px;
}
#day-items {
  margin-top: 13px;
}
.empty {
  padding: 15px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.empty p {
  margin: 0 0 6px;
}
.textbtn,
#manage {
  padding: 6px 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
}
.source-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.source-dot {
  width: 11px;
  height: 11px;
  border-radius: 4px;
  background: var(--event);
  flex: none;
}
.source-row input,
.setting input {
  width: 19px;
  height: 19px;
  margin-left: auto;
  accent-color: var(--accent);
  flex: none;
}
#sources {
  margin-top: 12px;
}
#manage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding: 13px 0 0;
}
#manage svg {
  width: 16px;
  height: 16px;
}
.row-event {
  display: flex;
  gap: 9px;
  padding: 12px 0;
  width: 100%;
  text-align: left;
  align-items: stretch;
  border-top: 1px solid var(--line);
}
.row-event:hover {
  background: var(--subtle);
}
.row-event:before {
  content: '';
  flex: none;
  width: 4px;
  border-radius: 4px;
  background: var(--event);
}
.event-copy {
  flex: 1;
  min-width: 0;
}
.event-copy strong,
.event-copy small {
  display: block;
  overflow-wrap: anywhere;
}
.event-copy strong {
  margin: 2px 0;
  font-size: 15px;
  line-height: 1.22;
  hyphens: auto;
}
.event-copy small {
  color: var(--muted);
  font-size: 12px;
}
.event-time {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.agenda-group {
  padding: 12px 18px 3px;
  border-top: 1px solid var(--line);
}
.agenda-group h3,
.search-results h3 {
  font-size: 14px;
  margin: 3px 0 8px;
}
.search-results {
  display: grid;
  gap: 14px;
}
.agenda-group .event-copy {
  display: grid;
  grid-template-columns: minmax(max(86px, 18%), max-content) minmax(0, 1fr);
  gap: 2px 10px;
  align-items: start;
}
.agenda-group .event-time {
  grid-row: 1/3;
}
.agenda-group .event-copy strong {
  margin: 0;
}
.agenda-group .event-copy small {
  grid-column: 2;
}
.birthday-group .event-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.daystrip.timehead,
.longrow,
.time-inner {
  display: grid;
  grid-template-columns: 37px repeat(var(--cols), minmax(0, 1fr));
}
.daystrip {
  background: var(--subtle);
  border-top: 1px solid var(--line);
}
.daystrip button {
  min-width: 0;
  padding: 8px 1px 7px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}
.daystrip strong {
  display: grid;
  place-content: center;
  margin: 3px auto 0;
  min-width: 27px;
  width: fit-content;
  height: 27px;
  padding: 0 3px;
  font-size: 14px;
  border-radius: 7px;
  color: var(--ink);
}
.daystrip .active strong {
  background: var(--accent);
  color: var(--on-accent);
}
.daystrip button:hover strong {
  outline: 1px solid var(--accent);
}
.longrow {
  border-block: 1px solid var(--line);
  min-height: 31px;
}
.longrow small {
  align-self: center;
  color: var(--muted);
  font-size: 9px;
  padding: 2px 5px;
}
.longrow > div {
  padding: 3px 2px;
  border-left: 1px solid var(--line);
}
.longrow .chip {
  margin-bottom: 2px;
}
.scrolltime {
  height: clamp(340px, 52vh, 550px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.time-inner {
  height: 1056px;
}
.hours span {
  height: 44px;
  display: block;
  padding-top: 2px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}
.timecol {
  position: relative;
  border-left: 1px solid var(--line);
  background: repeating-linear-gradient(
    to bottom,
    var(--line) 0px,
    var(--line) 1px,
    transparent 1px,
    transparent 44px
  );
}
.timecol.current-day {
  background-color: var(--selected);
}
.block-event {
  position: absolute;
  z-index: 1;
  overflow: hidden;
  text-align: left;
  border: 1px solid #fff9;
  border-radius: 5px;
  background: var(--event);
  color: var(--on-event);
  padding: 2px 4px;
  font-size: 12px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.block-event {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  justify-content: flex-start;
}
.block-event b {
  display: block;
  font-weight: 650;
}
.block-event span {
  display: -webkit-box;
  max-width: 100%;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.now-line {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  left: 0;
  right: 0;
  height: 2px;
  background: #dc4c58;
}
.now-line:before {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  top: -2px;
  left: -2px;
  background: inherit;
  border-radius: 50%;
}
dialog {
  padding: 0;
  margin: auto;
  width: min(560px, calc(100% - 28px));
  max-height: 89dvh;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 19px;
  box-shadow: 0 16px 64px #14223e38;
  overflow: auto;
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: #15203665;
}
@media (min-width: 741px) {
  dialog:has(#web-documents, [data-wide]) {
    width: min(620px, calc(100% - 28px));
  }
}
#sheet {
  scroll-padding: 76px 0 88px;
}
.sheet-header {
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--card);
  gap: 8px;
  min-height: 66px;
  padding: 9px 12px 9px 20px;
  border-bottom: 1px solid var(--line);
}
.sheet-header:has(#sheet-back:not([hidden])) {
  padding-left: 10px;
}
.sheet-heading {
  flex: 1;
  min-width: 0;
}
#sheet-area {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--accent);
}
.sheet-header h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.4px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.sheet-header .icon {
  width: 44px;
  height: 44px;
  color: var(--muted);
}
.sheet-header .ico {
  width: 19px;
  height: 19px;
}
#sheet-area .ico {
  width: 14px;
  height: 14px;
}
#sheet-purpose {
  margin: 0;
  padding: 12px 20px 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
#sheet-panel {
  padding: 20px;
}
#sheet-panel h3 {
  font-size: 18px;
  letter-spacing: -0.3px;
}
#sheet-panel p {
  line-height: 1.5;
}
#sheet-body {
  padding: 16px 20px 20px;
}
.sheet-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  margin: 16px -20px -20px;
  padding: 12px 20px max(12px, env(safe-area-inset-bottom));
  background: var(--card);
  border-top: 1px solid var(--line);
}
.sheet-actions > .danger:first-child:not(:only-child) {
  margin-right: auto;
}
@media (max-height: 520px) {
  .sheet-actions {
    position: static;
  }
  .sheet-header {
    position: static;
  }
}
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
}
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}
.field input:not([type='checkbox']):not([type='radio']):not([type='color']),
.field textarea,
.field select,
.setting select,
.ed-reminder-row :is(input, select) {
  border: 1px solid var(--strong-line);
  background: var(--card);
  border-radius: 9px;
  min-width: 0;
  padding: 9px;
  min-height: 43px;
  font-weight: 450;
}
.field input:not([type='checkbox']):not([type='radio']):not([type='color']),
.field textarea,
.field select {
  width: 100%;
}
.field textarea {
  resize: vertical;
}
.actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}
.fields > button {
  align-self: end;
}
.setting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.setting select {
  max-width: 57%;
}
.stack {
  display: grid;
  gap: 11px;
}
.stack > p,
.stack > h3,
.stack > h4 {
  margin: 0;
}
/* An empty announcement stays in place for screen readers and takes no room. */
[role='status']:empty,
[role='alert']:empty {
  position: absolute;
}
.notice {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}
#toast {
  position: fixed;
  z-index: 15;
  pointer-events: none;
  opacity: 0;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(440px, 94vw);
  padding: 11px 16px;
  border-radius: 10px;
  color: white;
  background: #24334b;
  font-size: 14px;
}
#toast.show {
  opacity: 1;
}
.bar-actions .icon span {
  display: none;
}
@media (min-width: 961px) {
  .bar-actions .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: auto;
    padding: 0 13px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 650;
  }
  .bar-actions .icon span {
    display: inline;
  }
}
@media (min-width: 741px) and (max-width: 860px) {
  .bar-inner {
    gap: 14px;
    padding-inline: 18px;
  }
  .bar-inner .app-tabs button {
    padding-inline: 8px;
  }
}
@media (max-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) minmax(213px, 29%);
    gap: 14px;
  }
  .calendar-tools {
    padding: 14px;
  }
  .viewbar {
    gap: 5px;
  }
  .cell {
    min-height: 65px;
  }
  .daily,
  .sources {
    padding: 15px;
  }
}
@media (max-width: 740px) {
  /* What gets the focus is never below the tabs or the round button. */
  html {
    scroll-padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }
  html:has(body[data-page='calendar']) {
    scroll-padding-bottom: calc(144px + env(safe-area-inset-bottom));
  }
  .bar-inner {
    min-height: 56px;
    padding-inline: 16px;
  }
  .brand {
    font-size: 20px;
    gap: 9px;
  }
  .brandmark {
    width: 31px;
    height: 31px;
  }
  main {
    padding: 16px 12px calc(82px + env(safe-area-inset-bottom));
  }
  #calendar-main {
    padding-bottom: calc(144px + env(safe-area-inset-bottom));
  }
  .heading {
    margin: 0 2px 13px;
    gap: 8px;
  }
  .heading h1 {
    font-size: 24px;
    letter-spacing: -0.8px;
  }
  .heading {
    flex-wrap: wrap;
  }
  .heading > div:first-child {
    display: contents;
  }
  .heading h1 {
    flex: 1 1 auto;
    min-width: min-content;
    overflow-wrap: normal;
  }
  .page-purpose {
    order: 1;
    flex: 1 1 100%;
    max-width: none;
    margin: 0;
  }
  #app-status {
    padding-inline: 12px;
  }
  #app-status:not([hidden]) ~ main {
    padding-top: 14px;
  }
  .main-actions {
    gap: 6px;
  }
  #scan {
    min-height: 38px;
    padding: 7px 10px;
    font-size: 13px;
  }
  #scan .ico {
    width: 17px;
    height: 17px;
  }
  #add {
    position: fixed;
    z-index: 4;
    bottom: calc(77px + env(safe-area-inset-bottom));
    right: max(16px, env(safe-area-inset-right));
    width: 53px;
    height: 53px;
    border: 0;
    border-radius: 50%;
    padding: 0;
    background: var(--accent);
    box-shadow: 0 3px 10px #254d8e38;
  }
  #add .ico {
    width: 25px;
    height: 25px;
    stroke-width: 1.85;
  }
  #add span {
    display: none;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  aside {
    gap: 12px;
  }
  .card {
    border-radius: 13px;
  }
  .calendar-tools {
    min-height: 52px;
    padding: 8px 10px;
    flex-wrap: nowrap;
    gap: 5px;
  }
  .ph h2 {
    font-size: 18px;
    overflow-wrap: normal;
    letter-spacing: -0.5px;
  }
  .ph .icon {
    width: 32px;
    height: 44px;
  }
  .viewbar {
    gap: 4px;
  }
  .arrows {
    gap: 0;
  }
  .arrows .icon {
    width: 27px;
    height: 44px;
  }
  .viewbar .today {
    padding-inline: 7px;
    min-height: 46px;
    font-size: 12px;
  }
  .select-wrap {
    height: 46px;
    display: flex;
    align-items: center;
  }
  .select-wrap select {
    font-size: 12px;
    padding-inline: 6px 16px;
  }
  .select-wrap span:first-child {
    display: none;
  }
  .select-wrap span:last-child {
    right: 3px;
  }
  .month-grid.kw {
    grid-template-columns: 19px repeat(7, minmax(0, 1fr));
  }
  .dow {
    padding: 7px 0;
    font-size: 11px;
  }
  .cell {
    min-height: 43px;
    padding: 4px 1px 2px;
    gap: 2px;
    align-items: center;
    border-left: 0;
    border-top-color: var(--line);
  }
  .cell.selected {
    background: var(--selected);
  }
  .date-num {
    height: 24px;
    min-width: 26px;
  }
  .cell .chip,
  .cell .more {
    display: none;
  }
  .dots {
    display: flex;
    gap: 2px;
  }
  .dots i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--event);
  }
  .daily,
  .sources {
    padding: 14px 16px;
  }
  .source-row,
  .textbtn {
    min-height: 44px;
  }
  #manage {
    min-height: 50px;
    padding-top: 4px;
  }
  .stack > a.notice {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    min-height: 44px;
  }
  .daily h2 {
    font-size: 18px;
  }
  .daily .event-copy {
    display: grid;
    grid-template-columns: minmax(80px, max-content) minmax(0, 1fr);
    gap: 2px 9px;
  }
  .daily .event-time {
    grid-row: 1/3;
  }
  .daily .event-copy strong {
    margin: 0;
  }
  .daily .event-copy small {
    grid-column: 2;
  }
  .scrolltime {
    height: clamp(300px, 48dvh, 450px);
  }
  .block-event {
    font-size: 10px;
    padding: 2px;
  }
  .agenda-group {
    padding-inline: 12px;
  }
  dialog {
    width: min(100%, 530px);
    max-width: 100%;
    max-height: min(92dvh, 900px);
    margin: auto auto 0;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
  }
  #sheet-body,
  #sheet-panel {
    padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  }
  .sheet-header {
    min-height: 62px;
    padding-inline: 16px 8px;
  }
  .sheet-header:has(#sheet-back:not([hidden])) {
    padding-left: 4px;
  }
  #sheet-purpose {
    padding-inline: 16px;
  }
  .sheet-actions {
    margin: 16px -16px calc(-1 * max(16px, env(safe-area-inset-bottom)));
    padding-inline: 16px;
  }
  .sheet-actions > * {
    flex: 1;
  }
  #toast {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }
  dialog #toast {
    bottom: calc(var(--bar, 0px) + 17px);
  }
}
@media (max-width: 410px) {
  .calendar-tools {
    flex-wrap: wrap;
    gap: 0;
  }
  .ph {
    flex: 1 1 100%;
    min-height: 33px;
  }
  .ph .icon {
    width: 44px;
    margin-block: -5px;
  }
  .viewbar {
    width: 100%;
  }
  .arrows {
    margin-left: auto;
  }
  .arrows .icon {
    width: 35px;
  }
  .select-wrap select {
    padding-inline: 23px 17px;
  }
  .select-wrap span:first-child {
    display: inline-flex;
    left: 6px;
  }
  .cell {
    min-height: 39px;
  }
}
@media (max-width: 350px) {
  main {
    padding-inline: 8px;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  .heading h1 {
    font-size: 21px;
  }
}
dialog #toast { bottom: calc(var(--bar, 0px) + 17px); }
body[data-page='calendar'][data-view='birthdays'] #calendar-main { max-width: 864px; }
body[data-page='calendar'][data-view='birthdays'] .layout { grid-template-columns: minmax(0, 1fr); }
body[data-page='calendar'][data-view='birthdays'] .calendar-tools { flex-wrap: wrap; }
.tab-badge, .count {
  display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; line-height: 1;
}
.count { background: var(--soft); color: var(--accent); }
.pill {
  display: inline-flex; align-items: center; width: fit-content; min-height: 24px; padding: 2px 10px; border-radius: 12px;
  background: var(--soft); color: var(--accent); font-size: 12px; font-weight: 650;
}
.pill.is-warm { background: var(--warm); color: var(--warm-ink); }
.pill.is-danger { background: var(--danger-surface); color: var(--danger); }
.section-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin: 0 0 12px; }
.section-head h2 { margin: 0; font-size: 18px; letter-spacing: -.35px; }
.section-head > p { flex: 1 1 100%; margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.empty-state { display: grid; justify-items: center; gap: 8px; padding: 28px 18px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); }
.empty-state strong { color: var(--ink); }
.empty-state p { margin: 0; max-width: 46ch; line-height: 1.45; }
.steps { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; list-style: none; counter-reset: step; font-size: 13px; color: var(--muted); }
.steps li { counter-increment: step; }
.steps li::before { content: counter(step) ' '; font-weight: 700; }
.steps [aria-current='step'] { color: var(--accent); font-weight: 700; }
.steps-short { display: none; margin: 0; font-size: 13px; font-weight: 700; color: var(--accent); }
@media (max-width: 399px) {
  .steps { display: none; }
  .steps-short { display: block; }
}
#archive-body { display: grid; gap: 16px; }
#archive-body section.card { min-width: 0; }
#archive-body > p, .archive-bar > p { margin: 0; }
#archive-body > p:empty { position: absolute; }
.archive-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; margin-block: -6px -10px; font-size: 13px; }
.archive-bar > .textbtn { margin-left: auto; min-height: 44px; padding: 4px 0; }
.notice a { color: inherit; }
.archive-sync { padding-block: 8px; min-height: 60px; }
.archive-sync .actions { gap: 8px; }
.archive-sync .actions button { background: var(--card); padding-block: 8px; }
.archive-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 22%) auto; align-items: end; gap: 10px; }
.archive-toolbar > button { min-height: 43px; }
.archive-toolbar [aria-pressed='true'] { background: var(--selected); border-color: var(--accent); color: var(--accent); }
.doc-list { border-radius: 15px; background: var(--card); border: 1px solid var(--line); }
.doc-list .empty-state { border-top: 0; }
.doc-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px 14px; padding: 12px 16px; min-height: 63px; overflow-wrap: anywhere; }
.doc-row + .doc-row { border-top: 1px solid var(--line); }
.doc-row:focus { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: 14px; }
.doc-row .menu-icon { background: var(--warm); color: var(--warm-ink); }
.doc-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.doc-actions button { min-height: 44px; padding-block: 8px; }
.doc-manage svg.ico { width: 18px; height: 18px; stroke-width: 3; }
.doc-drafts { display: grid; gap: 8px; }
.doc-drafts h2 { margin: 0; font-size: 14px; font-weight: 650; color: var(--muted); }
@media (max-width: 740px) {
  .archive-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .archive-toolbar > :first-child { grid-column: 1 / -1; }
  .archive-sync .actions { width: 100%; }
  .archive-sync .actions button { padding-inline: 11px; font-size: 13px; }
}
@media (max-width: 599px) {
  .doc-row { grid-template-columns: auto minmax(0, 1fr); padding-inline: 14px; }
  .doc-actions { grid-column: 2; justify-content: flex-start; }
  .doc-manage { width: 44px; padding-inline: 0; justify-content: center; }
  .doc-manage span { display: none; }
}
.doc-title { margin: 0; font-size: 18px; letter-spacing: -.3px; line-height: 1.3; overflow-wrap: anywhere; }
.doc-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 14px; line-height: 1.4; }
.doc-facts dt { color: var(--muted); }
.doc-facts dd { margin: 0; overflow-wrap: anywhere; }
.doc-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--soft); color: var(--accent); }
.doc-mark + [role='status'] { color: var(--ink); font-size: 16px; font-weight: 650; }
.doc-mark[hidden] + [role='status'] { color: var(--muted); font-size: inherit; font-weight: inherit; }
[data-doc-summary]:not([hidden]) { overflow-wrap: anywhere; }
.brandmark { object-fit: contain; border-radius: 25%; }
.brand { color: var(--brand); }
#settings-main { max-width: 1040px; }
#settings-main .heading { margin-bottom: 24px; }
.account-menu, .menu-row, .theme-option {
  display: flex; align-items: center; width: 100%; min-width: 0; text-align: left; gap: 14px;
}
.account-menu {
  padding: 20px 22px; border: 1px solid var(--strong-line); border-radius: 17px;
  color: var(--ink); background: var(--soft); margin-bottom: 28px;
}
.account-menu:hover { background: var(--selected); }
.account-icon, .menu-icon, .menu-chevron, .theme-check {
  display: inline-grid; place-items: center; flex: none;
}
.account-icon {
  width: 46px; height: 46px; border: 1px solid var(--strong-line); border-radius: 50%;
  background: var(--card); color: var(--accent);
}
.account-icon .ico { width: 24px; height: 24px; }
.menu-copy { display: grid; gap: 4px; flex: 1; min-width: 0; }
.menu-copy strong { font-size: 15px; font-weight: 650; line-height: 1.25; }
.menu-copy small { font-size: 13px; color: var(--muted); line-height: 1.35; }
.account-menu .menu-copy strong { font-size: 18px; letter-spacing: -.3px; }
.account-menu .menu-copy small { color: var(--muted); }
.menu-chevron { color: var(--muted); }
.menu-chevron .ico { width: 16px; height: 16px; }
.account-menu .menu-chevron { color: var(--accent); }
.settings-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start; gap: 24px;
}
.settings-grid > div { display: grid; gap: 24px; min-width: 0; }
.menu-group { min-width: 0; }
.menu-group h2 {
  font-size: 14px; line-height: 1.35; margin: 0 0 9px 4px;
  font-weight: 650; color: var(--muted);
}
.menu-list {
  border-radius: 15px; overflow: hidden; background: var(--card); border: 1px solid var(--line);
}
.menu-row { padding: 13px 16px; min-height: 63px; }
.menu-row + .menu-row { border-top: 1px solid var(--line); }
.menu-row:hover, .theme-option:hover { background: var(--subtle); }
.menu-row:focus-visible { outline-offset: -3px; }
.menu-row { overflow-wrap: anywhere; }
.menu-row.is-static:hover { background: none; }
.menu-row.is-danger, .menu-row.is-danger .menu-icon { color: var(--danger); }
.menu-row.is-danger .menu-icon { background: var(--danger-surface); }
.menu-trailing { margin-left: auto; flex: none; }
.menu-trailing select { border: 1px solid var(--strong-line); background: var(--card); border-radius: 9px; padding: 7px 9px; min-height: 43px; font-size: 14px; font-weight: 500; }
.menu-trailing input { display: block; width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
label.menu-row { cursor: pointer; }
a.menu-row { color: inherit; text-decoration: none; }
.menu-copy small:empty { display: none; }
.feed-entry { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.feed-entry:first-child { border-top: 0; padding-top: 0; }
.feed-entry > p { margin: 0; }
.plain-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; line-height: 1.45; }
.plain-rows { margin: 0; padding: 0; list-style: none; }
.plain-rows li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.plain-rows small { flex: none; font-size: 13px; color: var(--muted); }
.meter { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.meter meter { width: 100%; height: 14px; }
.meter meter::-webkit-meter-optimum-value { background: var(--accent); }
.meter meter::-moz-meter-bar { background: var(--accent); }
.account-window > section { display: grid; gap: 8px; padding-bottom: 14px; }
.account-window > section:not(:last-child):not(:empty) { border-bottom: 1px solid var(--line); }
.account-window > section:empty { display: none; }
.account-window :is(h3, p) { margin: 0; }
.account-window p { font-size: 14px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.menu-icon {
  width: 36px; height: 36px; border-radius: 10px; background: var(--soft); color: var(--accent);
}
.menu-icon .ico { width: 19px; height: 19px; }
[data-settings='storage'] .menu-icon, [data-settings='mail'] .menu-icon { background: var(--warm); color: var(--warm-ink); }
.theme-options { border: 0; padding: 13px 16px 16px; margin: 0; min-width: 0; display: grid; gap: 8px; }
.theme-options + .menu-row { border-top: 1px solid var(--line); }
.theme-options legend { float: left; width: 100%; font-size: 15px; font-weight: 650; padding: 0; margin-bottom: 4px; }
.theme-option {
  position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer;
}
.theme-option input { position: absolute; opacity: 0; }
.theme-option:has(input:checked) { background: var(--selected); border-color: var(--accent); }
.theme-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-check { width: 22px; color: var(--accent); opacity: 0; }
.theme-option input:checked ~ .theme-check { opacity: 1; }
.storage-options { min-width: 0; padding: 0; border: 0; margin: 0; }
.storage-options legend { font-size: 14px; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 8px; }
.storage-detail { display: block; margin-top: .25rem; font-weight: 400; color: var(--muted); }
#server-welcome {
  min-height: 100dvh; align-content: center; justify-items: center; padding: 32px 20px;
}
.auth-card {
  width: min(100%, 420px); padding: clamp(28px, 5vw, 44px); background: var(--card);
  border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 14px 52px #102b2410;
}
.auth-mark { display: block; width: 66px; height: 66px; margin-bottom: 28px; border-radius: 24%; }
.auth-card h1 { margin: 0; font-size: clamp(27px, 5vw, 33px); line-height: 1.16; letter-spacing: -1.2px; }
.auth-card p { color: var(--muted); margin: 12px 0; line-height: 1.52; }
.auth-card [data-auth-actions] { display: grid; margin-top: 24px; gap: 8px; }
.auth-card [data-auth-actions] button { width: 100%; min-height: 44px; }
.auth-card [data-login-options]:empty { display: none; }
@media (max-width: 740px) {
  #settings-main { padding-inline: 16px; }
  #settings-main .heading { margin: 4px 0 17px; }
  .settings-grid, .settings-grid > div { grid-template-columns: minmax(0, 1fr); gap: 21px; }
  .account-menu { padding: 16px; margin-bottom: 22px; }
  .account-menu .menu-copy strong { font-size: 16px; }
  .menu-row { padding: 12px 15px; }
}

.auth-methods { margin-top: 16px; }
.auth-methods .auth-actions, .auth-methods .auth-form { display: grid; gap: 10px; }
.auth-methods .auth-form { padding-top: 16px; }
.auth-card .auth-step { margin: 0; font-size: 13px; font-weight: 700; color: var(--accent); }
.auth-methods label.field { text-align: start; }
