/* Kids calendar. The look follows the Blockwise design system's "Premium v2"
   register (/projects/blockwise/docs/design/design-system.md): neutral surfaces,
   near-black ink for actions, Manrope headings over Inter, the 10 / 16 / 20 / pill
   radius roles, the 4-8-12-16-24-32-48 spacing scale and 150 / 250 / 350 ms motion.
   On a phone it behaves like an app: a bottom tab bar, sheets, safe areas. */

@font-face {
  font-family: Manrope;
  src: url('/fonts/manrope.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url('/fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --subtle: #f1f2f4;
  --ink: #16181d;
  --muted: #545a66;
  --line: #e9ebef;
  --line-heavy: #d3d7df;
  --control: #858c99; /* the edge of anything a person can act on */
  --scrim: rgba(16, 18, 23, 0.55);
  --warning: #8a5a00;
  --warning-soft: #fdf6e7;
  --success: #006d38;
  --success-soft: #ecfdf5;
  --error: #ba1a1a;
  --error-soft: #ffdad6;
  /* One fill per parent, equal in weight: ink and blue. Both carry white text. */
  --steve: #16181d;
  --emily: #2468c4;
  --r-ctl: 10px;
  --r-card: 16px;
  --r-panel: 20px;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-float: 0 4px 20px rgba(15, 23, 42, 0.08);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --display: Manrope, Inter, system-ui, sans-serif;
  --tabbar: 64px;
}

* {
  box-sizing: border-box;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
}
html {
  color: var(--ink);
  background: var(--bg);
  font: 400 16px/24px Inter, system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
body {
  margin: 0;
}
h1,
h2,
h3,
p,
ul {
  margin: 0;
}
ul {
  padding: 0;
  list-style: none;
}
h1 {
  font: 700 28px/36px var(--display);
  letter-spacing: -0.02em;
}
h2 {
  font: 600 18px/26px var(--display);
  letter-spacing: -0.01em;
}
h3 {
  font: 600 16px/24px var(--display);
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.meta {
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.muted {
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}

/* -- the three zones on a laptop ---------------------------------------------- */

#app {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 320px;
  min-height: 100dvh;
}
.rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 12px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  font: 700 16px/24px var(--display);
}
.brand img {
  border-radius: 8px;
}
.rail-nav {
  display: grid;
  gap: 4px;
}
.rail-nav button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: none;
  padding: 10px 12px;
  border-radius: var(--r-ctl);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--muted);
  text-align: left;
  transition: background 150ms, color 150ms;
}
.rail-nav button:hover {
  background: var(--subtle);
}
.rail-nav button[aria-pressed='true'] {
  background: var(--subtle);
  color: var(--ink);
}
.rail-nav .badge {
  margin-left: auto;
}
.rail-foot {
  margin-top: auto;
  padding: 0 12px;
}
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 9999px;
  background: var(--ink);
  color: var(--surface);
  font: 600 12px/1 Inter, sans-serif;
}
.work {
  padding: 32px;
  display: grid;
  gap: 24px;
  align-content: start;
  max-width: 1040px;
  width: 100%;
  justify-self: center;
}
.context {
  padding: 32px 24px 32px 0;
  display: grid;
  gap: 16px;
  align-content: start;
}
.tabbar {
  display: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 16px;
  display: grid;
  gap: 12px;
}
.now {
  gap: 4px;
}
.now-who {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 22px/30px var(--display);
  letter-spacing: -0.01em;
}
.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: none;
}
.swatch.who-steve {
  background: var(--steve);
}
.swatch.who-emily {
  background: var(--emily);
}
.swatch.who-split {
  background: linear-gradient(135deg, var(--steve) 50%, var(--emily) 50%);
}

/* -- controls ----------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 9999px;
  padding: 9px 18px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 150ms var(--ease), background 150ms;
}
.btn:active,
.icon:active,
.cell:active,
.mini:active {
  transform: scale(0.97);
}
.btn.primary {
  background: var(--ink);
  color: var(--surface);
}
.btn.secondary {
  background: var(--surface);
  border-color: var(--control);
}
.btn.ghost {
  background: none;
  color: var(--muted);
}
.btn.danger {
  background: var(--error-soft);
  color: var(--error);
}
.icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--control);
  border-radius: 50%;
  background: var(--surface);
  transition: transform 150ms var(--ease);
}
.link {
  border: 0;
  background: none;
  padding: 0;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--line-heavy);
  text-underline-offset: 4px;
}
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9999px;
  background: var(--subtle);
}
.seg.wide {
  display: flex;
}
.seg button {
  flex: 1 1 auto;
  min-height: 36px;
  border: 0;
  background: none;
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: background 150ms, color 150ms;
}
.seg button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--line);
}
input[type='date'],
input[type='time'],
input[type='text'],
input[type='email'],
input[type='url'],
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--control);
  border-radius: var(--r-ctl);
  background: var(--surface);
  padding: 9px 12px;
  font-size: 16px;
  line-height: 24px;
}
textarea {
  resize: vertical;
  display: block;
}
.field {
  display: grid;
  gap: 6px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}
.pair {
  display: grid;
  grid-template-columns: minmax(0, 150px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  font-size: 14px;
}
.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--ink);
}
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* -- month --------------------------------------------------------------------- */

.top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  overflow: hidden;
  touch-action: pan-y;
}
.dow {
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.cell {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr auto;
  align-items: start;
  gap: 4px;
  min-height: 104px;
  padding: 8px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  text-align: left;
  transition: transform 150ms var(--ease), background 150ms;
}
.cell:nth-child(7n) {
  border-right: 0;
}
.cell.blank {
  background: var(--bg);
}
.cell.hols {
  background: var(--subtle);
}
button.cell:hover {
  background: #eceef2;
}
.cell:focus-visible {
  outline-offset: -3px;
  z-index: 1;
}
.num {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.today .num {
  background: var(--ink);
  color: var(--surface);
}
.marks {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  color: var(--muted);
}
.marks svg,
.key-box svg {
  width: 14px;
  height: 14px;
}
.tag {
  grid-column: 1 / -1;
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.cell .pill {
  grid-column: 1 / -1;
  justify-self: start;
}
/* A day set by hand, away from the usual pattern: a line along its top. */
.cell.moved,
.key-box.moved {
  box-shadow: inset 0 3px 0 var(--ink);
}
/* A suggested change that is not answered yet: a dashed edge. It is drawn
   as its own layer so the keyboard focus ring still shows on that day. */
.cell.asked::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 2px dashed var(--warning);
  border-radius: 8px;
  pointer-events: none;
}
.key-box.asked {
  border: 2px dashed var(--warning);
}

.pill {
  display: inline-block;
  border-radius: 9999px;
  padding: 2px 10px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
  color: #ffffff;
}
.pill.who-steve {
  background: var(--steve);
}
.pill.who-emily {
  background: var(--emily);
}
.pill.who-split {
  background: var(--surface);
  border-color: var(--ink);
  color: var(--ink);
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.dot.public {
  background: var(--ink);
}
.dot.free {
  border: 1.5px solid var(--ink);
}
.key-box {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 18px;
  border-radius: 4px;
  color: var(--muted);
  flex: none;
}
.key-box.hols {
  background: var(--subtle);
  border: 1px solid var(--line-heavy);
}
.key-box.moved {
  border: 1px solid var(--line-heavy);
}
.legend summary {
  font: 600 16px/24px var(--display);
  cursor: pointer;
}
.legend li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}
.legend .pill {
  font-size: 11px;
  padding: 0 8px;
}
.specials {
  display: grid;
  gap: 4px;
  font-size: 14px;
}
.specials li {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

/* -- year ----------------------------------------------------------------------- */

.year {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.mini {
  text-align: left;
  gap: 10px;
  transition: transform 150ms var(--ease), box-shadow 150ms;
}
.mini:hover {
  box-shadow: var(--shadow-float);
}
.mini-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font: 600 16px/24px var(--display);
}
.mini-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.mini-grid i {
  font-style: normal;
  font-size: 11px;
  line-height: 1;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #ffffff;
}
.mini-grid i:empty {
  visibility: hidden;
}
.mini-grid i.who-steve {
  background: var(--steve);
}
.mini-grid i.who-emily {
  background: var(--emily);
}
.mini-grid i.who-split {
  background: linear-gradient(135deg, var(--steve) 50%, var(--emily) 50%);
}
/* School holidays: a short line inside the day. Public holiday: bold. Today: a ring. */
.mini-grid i {
  position: relative;
}
.mini-grid i.hols::after {
  content: '';
  position: absolute;
  left: 28%;
  right: 28%;
  bottom: 2px;
  height: 2px;
  border-radius: 1px;
  background: #ffffff;
}
.mini-grid i.public {
  font-weight: 800;
  text-decoration: underline;
}
.mini-grid i.today {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* -- requests ------------------------------------------------------------------- */

.group {
  display: grid;
  gap: 12px;
}
.ask {
  display: grid;
  gap: 8px;
  justify-items: start;
}
.ask-what {
  font: 600 16px/24px var(--display);
}
.ask-msg,
.detail {
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding-left: 12px;
  border-left: 2px solid var(--line-heavy);
}
.ask .field {
  justify-self: stretch;
}
.card.asks,
section.asks {
  background: var(--warning-soft);
}
.card.asks {
  border-color: #f0dfb6;
}
.answered {
  gap: 0;
  padding: 0 16px;
}
.answered li {
  display: grid;
  gap: 4px;
  justify-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.answered li:last-child {
  border-bottom: 0;
}
.status {
  font-size: 12px;
  line-height: 18px;
  font-weight: 600;
  padding: 1px 10px;
  border-radius: 9999px;
  background: var(--subtle);
  color: var(--muted);
}
.status.approved {
  background: var(--success-soft);
  color: var(--success);
}
.status.declined {
  background: var(--error-soft);
  color: var(--error);
}

/* -- changes -------------------------------------------------------------------- */

.activity {
  display: grid;
  gap: 16px;
}
.activity li {
  display: grid;
  gap: 4px;
  justify-items: start;
  font-size: 14px;
  line-height: 20px;
}

/* -- sheets ------------------------------------------------------------------- */

dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: 88dvh;
  border: 0;
  border-radius: var(--r-panel);
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  overflow-y: auto;
  overscroll-behavior: contain;
}
dialog[open] {
  animation: sheet-in 350ms var(--ease);
}
dialog::backdrop {
  background: var(--scrim);
  animation: fade-in 250ms ease-out;
}
@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
}
@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
.work.enter > * {
  animation: rise 350ms var(--ease) both;
}
.work.enter > :nth-child(2) {
  animation-delay: 40ms;
}
.work.enter > :nth-child(3) {
  animation-delay: 80ms;
}
.work.enter > :nth-child(n + 4) {
  animation-delay: 120ms;
}
.grab {
  display: none;
}
.sheet-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  padding: 20px 24px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.sheet-head h2 {
  font-size: 22px;
  line-height: 30px;
}
dialog section {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
dialog section:last-child {
  border-bottom: 0;
}
dialog section > .seg,
dialog section > .field,
dialog section > .pair,
dialog section > ul,
dialog section > details,
dialog section > .ask,
dialog section > .terms {
  justify-self: stretch;
}
.day-now {
  gap: 4px;
}
.notes,
.files {
  display: grid;
  gap: 12px;
}
.notes li {
  display: grid;
  gap: 4px;
  justify-items: start;
  padding: 12px 16px;
  background: var(--subtle);
  border-radius: var(--r-card);
}
.note-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.files li {
  display: flex;
  gap: 12px;
  align-items: start;
}
.files img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--r-ctl);
  border: 1px solid var(--line);
  display: block;
}
.files a {
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}
.file-btn {
  cursor: pointer;
}
.file-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.file-btn:focus-within {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}
.terms {
  display: grid;
  gap: 8px;
}
.term {
  display: grid;
  grid-template-columns: 104px 1fr 1fr;
  gap: 8px;
  align-items: center;
  font-size: 14px;
}
.fold {
  border: 1px solid var(--line-heavy);
  border-radius: var(--r-card);
  padding: 12px 16px;
}
.fold[open] {
  display: grid;
  gap: 12px;
  justify-items: start;
}
.fold summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}
.dated {
  justify-self: stretch;
  display: grid;
  gap: 8px;
  font-size: 14px;
}
.dated li {
  display: grid;
  grid-template-columns: 124px 1fr auto;
  gap: 8px;
  align-items: baseline;
}
.add-row {
  justify-self: stretch;
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 8px;
}

#toast {
  /* A popover: the browser centres and borders one by default. */
  inset: auto;
  margin: 0;
  border: 0;
  overflow: visible;
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  border-radius: 9999px;
  background: var(--ink);
  color: var(--surface);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  box-shadow: var(--shadow-float);
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms, transform 250ms var(--ease);
  z-index: 2147483647;
}
#toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* -- the sign-in pages -------------------------------------------------------- */

body.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
}
body.gate #app {
  display: block;
  min-height: 0;
  width: min(100%, 400px);
}
.gate-card {
  width: min(100%, 400px);
  display: grid;
  gap: 16px;
  justify-items: start;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 32px 24px;
  background: var(--surface);
  box-shadow: var(--shadow-float);
}
.gate-card .field {
  justify-self: stretch;
}
.loading {
  padding: 32px;
  color: var(--muted);
}

/* -- narrower screens ----------------------------------------------------------- */

/* Shown only when the right column is gone. */
.narrow {
  display: none;
}

@media (min-width: 1051px) {
  h1 {
    font-size: 32px;
    line-height: 40px;
  }
}

@media (max-width: 1050px) {
  #app {
    grid-template-columns: 208px minmax(0, 1fr);
  }
  .context {
    display: none;
  }
  .narrow {
    display: grid;
    gap: 12px;
  }
}

/* A phone: no rail. A tab bar along the bottom, and sheets that rise from it. */
@media (max-width: 760px) {
  #app {
    display: block;
    padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
  }
  .rail {
    display: none;
  }
  .tabbar {
    position: fixed;
    inset: auto 0 0;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: calc(var(--tabbar) + env(safe-area-inset-bottom));
    padding: 0 4px env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .tabbar button {
    position: relative;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 2px;
    border: 0;
    background: none;
    font-size: 11px;
    line-height: 14px;
    font-weight: 500;
    color: var(--muted);
    transition: color 150ms, transform 150ms var(--ease);
  }
  .tabbar button:active {
    transform: scale(0.94);
  }
  .tabbar svg {
    width: 24px;
    height: 24px;
  }
  .tabbar button[aria-pressed='true'] {
    color: var(--ink);
  }
  .tabbar button[aria-pressed='true'] svg {
    stroke-width: 2.1;
  }
  .tabbar .badge {
    position: absolute;
    top: 6px;
    left: calc(50% + 6px);
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    border: 2px solid var(--surface);
    box-sizing: content-box;
    padding: 0 3px;
  }
  .work {
    padding: calc(16px + env(safe-area-inset-top)) 16px 24px;
    gap: 16px;
  }
  .top {
    align-items: center;
  }
  .top-actions .btn {
    padding-inline: 14px;
  }
  .btn,
  .icon {
    min-height: 44px;
  }
  .icon {
    width: 44px;
  }
  .seg button {
    min-height: 44px;
    padding-inline: 8px;
  }
  .link {
    padding-block: 12px;
  }
  .check {
    min-height: 44px;
  }
  summary {
    padding-block: 10px;
  }
  .cell {
    min-height: 76px;
    padding: 5px 3px 6px;
    gap: 2px;
    grid-template-columns: 1fr;
    grid-template-rows: auto 14px auto;
    justify-items: center;
  }
  .num {
    min-width: 24px;
    height: 24px;
    font-size: 14px;
  }
  .marks {
    justify-self: center;
    height: 14px;
    gap: 2px;
  }
  .marks svg {
    width: 12px;
    height: 12px;
  }
  .tag {
    display: none;
  }
  .cell .pill {
    justify-self: stretch;
    font-size: 11px;
    line-height: 16px;
    padding: 2px 0;
    text-align: center;
    overflow: hidden;
  }
  .cell.asked::after {
    inset: 2px;
  }
  .dow {
    padding: 8px 0;
  }
  .year {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .mini {
    padding: 12px;
  }
  .mini-head {
    flex-direction: column;
    gap: 0;
  }
  .mini-grid {
    gap: 2px;
  }
  .mini-grid i {
    font-size: 10px;
    border-radius: 5px;
  }
  dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: var(--r-panel) var(--r-panel) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  dialog[open] {
    animation: sheet-up 350ms var(--ease);
  }
  .grab {
    display: block;
    width: 36px;
    height: 4px;
    margin: 8px auto 0;
    border-radius: 9999px;
    background: var(--line-heavy);
  }
  .sheet-head {
    padding: 12px 16px 14px;
  }
  dialog section {
    padding: 18px 16px;
  }
  .term {
    grid-template-columns: 1fr 1fr;
  }
  .term span {
    grid-column: 1 / -1;
    font-weight: 600;
  }
  .dated li {
    grid-template-columns: 1fr auto;
  }
  .dated li .meta {
    grid-column: 1 / -1;
  }
  .add-row {
    grid-template-columns: 1fr;
  }
  #toast {
    bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
