/* Aperture Motion on the phone. The desktop's colours, a phone's proportions. */
:root {
  --bg: #0b0b0b;
  --text: #f2f2f2;
  --muted: #8a8a8a;
  --faint: #5c5c5c;
  --line: #232323;
  --surface: #171717;
  --surface-2: #202020;
  --panel: #141414;
  --track: #262626;
  --green: #1fc464;
  --green-soft: rgba(31, 196, 100, .14);
  --red: #ff5b5b;
  --red-soft: rgba(255, 91, 91, .13);
  --amber: #f0a33a;
  --scrim: rgba(0, 0, 0, .55);
  --tabs: rgba(14, 14, 14, .92);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f6f6;
    --text: #111111;
    --muted: #7d7d7d;
    --faint: #a8a8a8;
    --line: #e6e6e6;
    --surface: #ffffff;
    --surface-2: #f0f0f0;
    --panel: #ffffff;
    --track: #e8e8e8;
    --green: #16a454;
    --green-soft: rgba(22, 164, 84, .11);
    --red: #d81f2a;
    --red-soft: rgba(216, 31, 42, .08);
    --amber: #c27a12;
    --scrim: rgba(0, 0, 0, .3);
    --tabs: rgba(250, 250, 250, .94);
    color-scheme: light;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%;
  -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--muted); }
textarea { min-height: 84px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 0; }
label > input, label > select, label > textarea { margin-top: 6px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.err { color: var(--red); font-size: 14px; min-height: 1em; margin-top: 10px; }
[hidden] { display: none !important; }

/* ----- frame */
#app { min-height: 100%; }
#top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  padding: calc(var(--safe-top) + 14px) 18px 10px;
  background: linear-gradient(var(--bg) 82%, transparent);
}
#title { margin: 0; font-size: 30px; letter-spacing: -.02em; font-weight: 700; }
.sync { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); padding: 6px 0 8px; max-width: 55%; }
.sync span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.sync.ok .dot { background: var(--green); }
.sync.warn .dot { background: var(--amber); }
.sync.bad .dot { background: var(--red); }
#screen { padding: 4px 16px calc(var(--safe-bottom) + 96px); outline: none; }

#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(var(--safe-bottom) + 4px);
  background: var(--tabs); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
#tabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; color: var(--faint); }
#tabs svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#tabs button.on { color: var(--text); }

/* ----- building blocks */
.card { background: var(--surface); border-radius: 16px; padding: 16px; margin: 0 0 12px; }
.card h2, .section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.section-title { margin: 22px 4px 8px; display: flex; justify-content: space-between; align-items: baseline; }
.section-title .count { text-transform: none; letter-spacing: 0; color: var(--faint); font-weight: 500; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.big { font-size: 40px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.mid { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.pill { font-size: 12px; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.green { background: var(--green-soft); color: var(--green); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 16px; border-radius: 12px;
  background: var(--surface-2); font-weight: 600; font-size: 15px; min-height: 44px; }
.btn.primary, button.primary { background: var(--text); color: var(--bg); }
.btn.go { background: var(--green); color: #fff; }
.btn.danger { color: var(--red); background: var(--red-soft); }
.btn.wide, button.primary { width: 100%; }
.btn:disabled, button.primary:disabled { opacity: .45; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.btns .btn { flex: 1 1 auto; }

.bar { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; margin-top: 12px; }
.bar > div { height: 100%; background: var(--text); border-radius: 3px; transition: width .4s; }
.bar.done > div { background: var(--green); }

.seg { display: flex; background: var(--surface-2); border-radius: 10px; padding: 3px; margin: 2px 0 14px; }
.seg button { flex: 1; padding: 7px 0; border-radius: 8px; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.15); }

/* lists */
.list { background: var(--surface); border-radius: 14px; overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; min-height: 52px; width: 100%; text-align: left; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item:active { background: var(--surface-2); }
.item .dotc { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--faint); }
.item .main { flex: 1; min-width: 0; }
.item .t1 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .t2 { font-size: 13px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .side { font-size: 13px; color: var(--muted); text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.item.sent .t1 { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.item.late .side { color: var(--red); }
.empty { color: var(--muted); text-align: center; padding: 26px 10px; font-size: 15px; }
.check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--faint); flex: none; display: grid; place-items: center; }
.check.on { background: var(--green); border-color: var(--green); }
.check.on::after { content: ""; width: 9px; height: 5px; border: 2.5px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }

/* timer */
.clock { font-size: 64px; font-weight: 300; letter-spacing: -.02em; font-variant-numeric: tabular-nums; text-align: center; margin: 18px 0 6px; }
.clock.small { font-size: 34px; font-weight: 600; text-align: left; margin: 0; }
.timer-sub { text-align: center; color: var(--muted); font-size: 14px; min-height: 1.3em; }
.running .clock { color: var(--green); }
.tally { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.tally > div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.tally .k { font-size: 12px; color: var(--muted); }
.tally .v { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; }
.daybar { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 14px; }
.daybar .d { width: 64px; color: var(--muted); }
.daybar .b { flex: 1; height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; }
.daybar .b > div { height: 100%; background: var(--text); border-radius: 4px; }
.daybar .h { width: 48px; text-align: right; font-variant-numeric: tabular-nums; }

/* board */
.cardrow .t2 .due.late { color: var(--red); }

/* sheet */
#sheet { position: fixed; inset: 0; z-index: 20; }
#sheet .scrim { position: absolute; inset: 0; background: var(--scrim); animation: fade .18s; }
#sheet .panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--panel); border-radius: 18px 18px 0 0; padding: 10px 18px calc(var(--safe-bottom) + 18px);
  animation: rise .22s cubic-bezier(.2,.8,.2,1);
}
#sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: var(--track); margin: 0 auto 12px; }
#sheet h3 { margin: 4px 0 2px; font-size: 20px; }
#sheet .sub { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checkline { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text); margin-top: 14px; }
.checkline input { width: 22px; height: 22px; flex: none; margin: 0; -webkit-appearance: checkbox; appearance: auto; }
@keyframes rise { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

#toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--safe-bottom) + 84px); z-index: 30;
  background: var(--text); color: var(--bg); border-radius: 12px; padding: 12px 14px; font-size: 14px; text-align: center;
  box-shadow: 0 6px 24px rgba(0,0,0,.25); animation: rise .2s;
}
#update { position: fixed; left: 16px; right: 16px; top: calc(var(--safe-top) + 8px); z-index: 31; padding: 12px; border-radius: 12px;
  background: var(--green); color: #fff; font-weight: 600; }

/* sign-in */
#gate { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: grid; place-items: center; padding: 24px; }
#signIn { width: 100%; max-width: 380px; }
#signIn .brand { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
#signIn .primary { margin-top: 18px; padding: 14px; border-radius: 12px; font-weight: 650; }
