/* The house look for every mini app: the "Claude +" tweakcn theme (the operator,
   2026-09-19), which is shadcn's token set with Anthropic's palette. Written
   as plain CSS on purpose. Shadcn itself is React components plus Tailwind
   plus a build step, and none of that belongs in a six-row settings screen
   that is served as one file and re-read on every request. What shadcn
   actually gives a page is this: tokens, a radius, a card surface, a focus
   ring, and controls the page draws itself instead of letting the phone draw
   them. That is all here, in about a hundred lines and no dependency. */

:root {
  --background: #faf9f5;
  --foreground: #3d3929;
  --card: #f5f4ef;
  --card-foreground: #141413;
  --popover: #ffffff;
  --popover-foreground: #28261b;
  --primary: #c96442;
  --primary-foreground: #ffffff;
  --secondary: #e9e6dc;
  --secondary-foreground: #535146;
  --muted: #ede9de;
  --muted-foreground: #6e6d68;
  --accent: #e9e6dc;
  --destructive: #b3261e;
  --border: #dad9d4;
  --input: #b4b2a7;
  --ring: #c96442;
  --radius: 1rem;
  /* Status, shared so every app reads a green dot the same way. */
  --ok: #4a7c59;
  --warn: #b4690e;
  --down: #b3261e;
}

html[data-theme="dark"] {
  --background: #262624;
  --foreground: #f1f1ef;
  --card: #2c2c2b;
  --card-foreground: #faf9f5;
  --popover: #30302e;
  --popover-foreground: #e5e5e2;
  --primary: #d97757;
  --primary-foreground: #141413;
  --secondary: #3a3a37;
  --secondary-foreground: #f5f4ee;
  --muted: #1b1b19;
  --muted-foreground: #b7b5a9;
  --accent: #1a1915;
  --destructive: #ef4444;
  --border: #3e3e38;
  --input: #52514a;
  --ring: #d97757;
  --ok: #6fae7f;
  --warn: #e0a34a;
  --down: #ef4444;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* `hidden` must win over a component's own display rule. Without this a
   .btn keeps its display:block and stays on screen while the page believes
   it is gone (found 2026-09-20: the map's own open button sat on top of the
   map). */
[hidden] { display: none !important; }

body {
  margin: 0;
  padding: 20px 16px 48px;
  font: 16px/1.5 Outfit, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--background);
  color: var(--foreground);
}

h1 {
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted-foreground); margin: 0 0 12px;
}

h2 {
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted-foreground); margin: 26px 0 10px;
}

.card {
  background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}

.row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 15px 16px; border: 0; border-bottom: 1px solid var(--border);
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.row:last-child { border-bottom: 0; }
.row:active { background: var(--accent); }
.row .label { flex: 1; }
.row .value { color: var(--muted-foreground); }
.row .chev { color: var(--muted-foreground); font-size: 13px; }
.pending { display: block; font-size: 13px; color: var(--primary); margin-top: 3px; }

/* The switch: what a checkbox looks like once the page draws it. */
.switch { position: relative; width: 44px; height: 26px; flex: none; border-radius: 999px; background: var(--input); transition: background .15s; }
.switch[data-on="true"] { background: var(--primary); }
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 999px; background: #fff; transition: transform .15s;
}
.switch[data-on="true"]::after { transform: translateX(18px); }

button.btn {
  display: block; width: 100%; padding: 13px 16px; margin-top: 12px;
  font: inherit; font-weight: 500; cursor: pointer;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--secondary); color: var(--secondary-foreground);
}
button.btn.primary { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
button.btn.destructive { color: var(--destructive); }
button.btn:active { opacity: .85; }

:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

#note { margin: 14px 4px 0; font-size: 14px; color: var(--muted-foreground); min-height: 20px; }

/* The picker. A <select> hands the list to Android to draw, which is where
   the out-of-place dropdowns came from; this is the same job, drawn here. */
#backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
#backdrop[data-open="true"] { opacity: 1; pointer-events: auto; }
#sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2;
  max-height: 72vh; overflow-y: auto;
  background: var(--popover); color: var(--popover-foreground);
  border-radius: var(--radius) var(--radius) 0 0;
  border-top: 1px solid var(--border);
  padding: 8px 0 24px;
  transform: translateY(100%); transition: transform .18s ease-out;
}
#sheet[data-open="true"] { transform: none; }
#sheet h3 {
  margin: 8px 20px 10px; font-size: 13px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted-foreground);
}
#sheet button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 14px 20px; border: 0; background: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}
#sheet button:active { background: var(--accent); }
#sheet .tick { width: 18px; color: var(--primary); }

/* A grid of small cards: the roster, and whatever counts things next. */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.grid .card { padding: 13px 13px 11px; position: relative; }
.grid .name { font-weight: 600; text-transform: capitalize; }
.grid .sub { color: var(--muted-foreground); font-size: 12px; margin-top: 2px; word-break: break-all; }
.grid .line { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--muted-foreground); }
.dot { position: absolute; top: 13px; right: 13px; width: 9px; height: 9px; border-radius: 50%; background: var(--muted-foreground); }
.up .dot { background: var(--ok); }
.warn .dot { background: var(--warn); }
.down .dot { background: var(--down); }
.tally { display: flex; gap: 18px; margin: 0 2px 16px; font-size: 13px; color: var(--muted-foreground); }
.tally b { color: var(--foreground); font-size: 20px; margin-right: 5px; font-weight: 600; }

.footer { display: flex; gap: 10px; }
.footer .btn { flex: 1; text-align: center; }

a.tile {
  display: flex; align-items: center; gap: 14px; margin-bottom: 12px;
  padding: 18px 16px; text-decoration: none;
  background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); border-radius: var(--radius);
}
a.tile:active { background: var(--accent); }
.tile .icon { font-size: 26px; }
.tile .name { font-weight: 600; }
.tile .what { font-size: 14px; color: var(--muted-foreground); }
