/* Look copied from the Skytrak pocket tools: dark navy panels, amber accents, JetBrains Mono, spaced caps. */
:root {
  --radius: .75rem;
  --panel: #0a0f15;
  --card: #111c26;
  --card2: #0b121a;
  --line: #22384a;
  --amber: #f5a524;
  --amberdim: #c9811a;
  --read: #f2e9d6;
  --dim: #7a8a96;
  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --tab-h: 68px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(ellipse 120% 50% at 50% -10%, rgba(245,165,36,.13), transparent 65%), var(--panel);
  color: var(--read);
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
}
a { color: var(--amber); text-decoration: none; }
.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }
.caps, .label, button, th, .tab, .pill, .badge { text-transform: uppercase; letter-spacing: .18em; }
.label { font-size: 10px; color: var(--dim); margin-bottom: 6px; display: block; }
.muted { color: var(--dim); }
.small { font-size: 11px; }
.right { text-align: right; }
.amber { color: var(--amber); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
h1 { font-size: 18px; } h2 { font-size: 13px; } h3 { font-size: 11px; color: var(--dim); }

/* header */
#top { padding: 14px 0 0; position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--panel), rgba(10,15,21,.92)); backdrop-filter: blur(8px); }
#top .wrap { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--read); font-weight: 800; letter-spacing: .22em; font-size: 15px; }
.logo { width: 30px; height: 30px; border-radius: 9px; background: rgba(245,165,36,.16); color: var(--amber); display: grid; place-items: center; border: 1px solid rgba(245,165,36,.35); }
.live { font-size: 10px; letter-spacing: .2em; color: var(--dim); display: flex; align-items: center; gap: 8px; }
.live .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); }

main { padding-top: 16px; }
.loading { color: var(--dim); letter-spacing: .2em; font-size: 12px; padding: 20px 0; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.card .head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.card .head h2 { font-size: 12px; }
.card .head .tag { font-size: 10px; letter-spacing: .18em; color: var(--dim); text-transform: uppercase; }
.inner { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.inner + .inner { margin-top: 8px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big { font-size: 34px; font-weight: 800; letter-spacing: .02em; line-height: 1; }
.big small { font-size: 14px; color: var(--amber); margin-left: 3px; font-weight: 500; }
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .label { margin: 0; }
.hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }

/* forms */
input, select, textarea {
  width: 100%; background: var(--card2); color: var(--read); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 14px; height: 48px; font: inherit; font-size: 16px; outline: none; -webkit-appearance: none; appearance: none;
}
input[type="date"], input[type="time"], input[type="datetime-local"] { min-width: 0; }
input::-webkit-date-and-time-value { text-align: left; }
textarea { height: auto; min-height: 72px; padding: 12px 14px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(245,165,36,.15); }
input::placeholder { color: #4b5b68; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.field { margin-bottom: 12px; }
.field .hint { font-size: 11px; color: var(--dim); margin-top: 5px; }
.calc { display: flex; align-items: center; justify-content: space-between; background: rgba(245,165,36,.08); border: 1px solid rgba(245,165,36,.35); border-radius: 12px; padding: 10px 14px; margin: -4px 0 12px; }
.calc b { font-size: 22px; color: var(--amber); font-weight: 800; }
.calc b small { font-size: 12px; margin-left: 2px; }

button, .btn {
  font: inherit; font-weight: 700; font-size: 12px; cursor: pointer; border: 1px solid transparent; border-radius: 12px;
  padding: 0 16px; height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
}
.btn-primary { background: var(--amber); color: var(--panel); width: 100%; box-shadow: 0 8px 24px rgba(245,165,36,.25); }
.btn-primary:active { background: var(--amberdim); }
.btn-ghost { background: var(--card2); color: var(--read); border-color: var(--line); width: 100%; }
.btn-danger { background: transparent; color: var(--bad); border-color: rgba(248,113,113,.4); width: 100%; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 10px; border-radius: 10px; width: auto; }
.btn-pill { height: 32px; padding: 0 12px; font-size: 10px; border-radius: 999px; background: rgba(245,165,36,.12); color: var(--amber); border-color: rgba(245,165,36,.35); width: auto; }
button:disabled { opacity: .5; cursor: default; }
.btnrow { display: flex; gap: 10px; }
.btnrow > * { flex: 1; }
.stack > * + * { margin-top: 10px; }

/* pills + badges */
.badge { font-size: 9px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); }
.badge.ok { color: var(--ok); border-color: rgba(74,222,128,.4); background: rgba(74,222,128,.08); }
.badge.warn { color: var(--warn); border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.08); }
.badge.due, .badge.bad { color: var(--bad); border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.08); }
.badge.amber { color: var(--amber); border-color: rgba(245,165,36,.4); background: rgba(245,165,36,.08); }
.swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: 6px; }

/* lists */
.list .item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.list .item:last-child { border-bottom: 0; }
.item .main { min-width: 0; flex: 1; }
.item .val { flex: none; max-width: 48%; }
.item .title { font-weight: 700; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { font-size: 11px; color: var(--dim); margin-top: 2px; }
.item .val { text-align: right; font-weight: 700; white-space: nowrap; }
.item .val .sub { margin-top: 2px; font-weight: 400; }

/* banner */
.banner { border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; }
.banner.warn { background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.4); color: var(--warn); }
.banner.bad { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.4); color: var(--bad); }
.banner.amber { background: rgba(245,165,36,.1); border: 1px solid rgba(245,165,36,.4); color: var(--amber); }

/* calendar */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-nav button { background: var(--card2); border-color: var(--line); color: var(--read); width: 40px; height: 40px; padding: 0; border-radius: 10px; font-size: 16px; }
.cal-nav .title { font-weight: 800; letter-spacing: .18em; text-transform: uppercase; font-size: 13px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid .wd { font-size: 9px; letter-spacing: .15em; color: var(--dim); text-align: center; padding: 4px 0 6px; }
.cal-grid .d { position: relative; aspect-ratio: 1 / .95; border-radius: 10px; border: 1px solid transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; color: var(--read); background: transparent; padding: 0; height: auto; font-weight: 500; letter-spacing: 0; }
.cal-grid .d.other { color: #3f4f5c; }
.cal-grid .d.today { color: var(--amber); font-weight: 800; }
.cal-grid .d.sel { background: rgba(245,165,36,.14); border-color: var(--amber); }
.cal-grid .d .dots { display: flex; gap: 3px; height: 5px; margin-top: 3px; }
.cal-grid .d .dots i { width: 5px; height: 5px; border-radius: 50%; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 10px; letter-spacing: .15em; color: var(--dim); text-transform: uppercase; margin-top: 12px; }
.timeline { position: relative; margin-top: 4px; }
.timeline .hour { height: 48px; border-top: 1px solid var(--line); position: relative; display: flex; }
.timeline .hour:last-child { border-bottom: 1px solid var(--line); }
.timeline .hour .t { width: 52px; font-size: 10px; color: var(--dim); padding-top: 4px; letter-spacing: .1em; flex: none; }
.timeline .hour .slot { flex: 1; cursor: pointer; border-radius: 8px; }
.timeline .hour .slot:active { background: rgba(245,165,36,.08); }
.timeline .blk { position: absolute; left: 56px; right: 0; border-radius: 10px; padding: 6px 10px; font-size: 11px; overflow: hidden; cursor: pointer; border: 1px solid; border-left-width: 4px; line-height: 1.3; }
.timeline .blk b { display: block; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }
.timeline .blk .chk { position: absolute; right: 8px; top: 6px; font-size: 10px; letter-spacing: .1em; }
.timeline .nowline { position: absolute; left: 48px; right: 0; height: 2px; background: var(--amber); box-shadow: 0 0 8px var(--amber); pointer-events: none; }
.timeline .nowline::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }

/* sheet */
#sheet-root .backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
#sheet-root .sheet { width: 100%; max-width: 680px; max-height: 92vh; overflow: auto; background: var(--card); border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); box-shadow: 0 -20px 60px rgba(0,0,0,.5); animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet .grab { width: 44px; height: 4px; border-radius: 2px; background: var(--line); margin: -6px auto 14px; }
.sheet .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sheet .close { background: transparent; border: 0; color: var(--dim); font-size: 22px; height: 32px; width: 32px; padding: 0; }
@media (min-width: 720px) { #sheet-root .backdrop { align-items: center; } #sheet-root .sheet { border-radius: 22px; border-bottom: 1px solid var(--line); } }

/* tab bar */
#tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(10,15,21,.96); border-top: 1px solid var(--line); display: flex; justify-content: space-around; align-items: center; z-index: 10; backdrop-filter: blur(10px); }
#tabbar a { display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--dim); font-size: 9px; letter-spacing: .18em; font-weight: 700; width: 20%; }
#tabbar a svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#tabbar a.active { color: var(--amber); }
#tabbar a.fab { width: 48px; height: 48px; border-radius: 50%; background: var(--amber); color: var(--panel); box-shadow: 0 8px 24px rgba(245,165,36,.35); flex: none; justify-content: center; }
#tabbar a.fab svg { width: 24px; height: 24px; stroke-width: 2.4; }

/* toast */
#toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--card); border: 1px solid var(--line); color: var(--read); padding: 12px 16px; border-radius: 12px; font-size: 12px; z-index: 50; max-width: 90vw; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
#toast.err { border-color: var(--bad); color: var(--bad); }
#toast.ok { border-color: var(--ok); }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; font-size: 9px; color: var(--dim); padding: 6px 6px 6px 0; border-bottom: 1px solid var(--line); font-weight: 500; }
td { padding: 8px 6px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
.diff { font-size: 11px; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-top: 8px; white-space: pre-wrap; word-break: break-word; color: var(--dim); }
.diff b { color: var(--read); }
.menu a.item { color: var(--read); }
.menu .item .arrow { color: var(--dim); }
.auth { margin-top: 24px; }
.auth h1 { margin-bottom: 14px; }
.kbd { font-size: 11px; color: var(--dim); }
