/* THE DRAKIUS STYLE. One file. Every screen in the app uses these parts and nothing else.
   Change a look here, never page by page.

   Shea's standards built in:
   - Apple calm. White, thin gray lines, no heavy banners, no shadows that lift, no glow on hover.
   - Pills 32 tall, words centered. Buttons in a row are the same size. Main action black, far right.
   - Fields 40 tall, soft gray fill, no border, sized to what they hold (name 280, email 300, phone 180).
   - Cards flat with a thin outline and a gray header strip that folds (chevron far right).
   - Never a colored band down the left edge. Nothing shifts when a button is tapped.
   - Selected tab or pill is gray (tabs) or black (choice pills); others stay white.
   - Pop ups compact, one step at a time, no scrolling inside. */

:root {
  --orange: #FF5A1F; --orange-text: #C2410C; --orange-tint: #FFE8DE;
  --ink: #141416; --steel: #6E6E78; --line: #DDDDE2; --fill: #F2F2F4; --raised: #F7F7F9;
  --hover: #F4F4F6; --red: #D92D20; --green: #1E7A3E;
  --r-card: 14px; --r-field: 10px; --pill: 32px; --field: 40px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.4 var(--font); color: var(--ink); background: #fff; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--steel); }
.small { font-size: 13px; }

/* ---------- the frame: rail on the left (bottom bar on a phone), page on the right ---------- */
.frame { display: flex; min-height: 100%; }
.rail { width: 216px; flex: none; border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; }
.rail .logo { height: 24px; width: auto; margin: 2px 10px 22px; align-self: flex-start; }
.rail a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 500; }
.rail a:hover { background: var(--hover); }
.rail a.on { background: var(--fill); font-weight: 600; }
.rail .grow { flex: 1; }
.rail .me { font-size: 13px; color: var(--steel); padding: 8px 12px; border-top: 1px solid var(--line); }
.rail .me button { all: unset; cursor: pointer; color: var(--orange-text); font-weight: 600; }
.page { flex: 1; min-width: 0; padding: 22px 32px 60px; max-width: 1120px; }

.head { display: flex; align-items: center; gap: 12px; min-height: 40px; margin-bottom: 18px; }
.corow { margin-bottom: 6px; }
.corow .co, .head .co { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--steel); font-size: 13px; }
.corow .co img, .head .co img { height: 28px; width: auto; }
.head h1 { font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.head .count { color: var(--steel); font-size: 15px; font-weight: 500; margin-left: 6px; }
.head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.crumb { margin-bottom: 4px; }

.greet { font-size: 28px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.01em; }
.greet .fade { background: linear-gradient(90deg, #FF7A1F, #E0301E); -webkit-background-clip: text; background-clip: text; color: transparent; }
.greet-sub { color: var(--ink); font-size: 17px; margin: 0 0 22px; }

/* ---------- pills and buttons: one size ---------- */
.btn, .pill { height: var(--pill); padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; text-align: center; gap: 6px; cursor: pointer; white-space: nowrap; min-width: 84px; }
.btn:hover, .pill:hover { background: var(--hover); }
.btn.main { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.main:hover { background: #2A2A2E; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.back { min-width: 0; padding: 0 12px; }
.pill.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; background: var(--fill); padding: 4px; border-radius: 22px; width: fit-content; margin-bottom: 14px; }
.pills .pill { border-color: transparent; background: transparent; min-width: 0; }
.pills .pill.on { background: #fff; color: var(--ink); border-color: var(--line); }

/* ---------- fields: sized to what they hold ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 600; }
.field input, .field select { height: var(--field); border: 0; background: var(--fill); border-radius: var(--r-field); padding: 0 12px; font-size: 15px; width: 280px; max-width: 100%; }
.field input:focus, .field select:focus { background: #fff; outline: 1px solid var(--ink); }
.field.email input { width: 300px; } .field.phone input { width: 180px; } .field.code input { width: 170px; letter-spacing: .2em; font-size: 18px; }
.row2 { display: flex; gap: 14px; flex-wrap: wrap; }
.err { color: var(--red); font-size: 13px; min-height: 18px; margin: 2px 0 6px; }

/* ---------- cards: flat, thin line, gray header strip that folds ---------- */
.card { border: 1px solid var(--line); border-radius: var(--r-card); background: #fff; margin-bottom: 16px; overflow: hidden; }
.card > .bar { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; background: var(--raised); border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; }
.card > .bar .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--steel); }
.card > .bar .t { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.card > .bar .n { color: var(--steel); font-size: 13px; font-weight: 600; margin-left: auto; }
.card > .bar .chev { width: 16px; text-align: center; color: var(--steel); transition: transform .15s; }
.card.folded > .bar { border-bottom: 0; }
.card.folded > .bar .chev { transform: rotate(-90deg); }
.card.folded > .body { display: none; }
.card > .body { padding: 6px 0; }
.card > .body.pad { padding: 16px; }
.cards2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.cards2 .card { margin-bottom: 0; }

/* ---------- rows: dot, bold name, gray line under, chevron (the Plate Sharing look) ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; }
.rows li.tap { cursor: pointer; } .rows li.tap:hover { background: var(--hover); }
.rows .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--steel); }
.rows .init { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--ink); }
.rows .txt { flex: 1; min-width: 0; }
.rows .txt b { display: block; font-weight: 600; }
.rows .txt span { display: block; color: var(--steel); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .end { display: flex; gap: 6px; align-items: center; color: var(--steel); font-size: 13px; }
.rows .chev { color: #B5B5BC; font-size: 18px; }
.tag { height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; background: var(--fill); }
.empty { padding: 18px 16px; color: var(--steel); }

/* ---------- switches ---------- */
.sw { appearance: none; width: 42px; height: 26px; border-radius: 13px; background: #D2D2D7; position: relative; cursor: pointer; flex: none; margin: 0; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; }
.sw:checked { background: var(--green); } .sw:checked::after { left: 19px; }
.sw:disabled { opacity: .5; cursor: default; }

/* ---------- Settings: icon boxes ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile { border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; cursor: pointer; background: #fff; text-align: left; }
.tile:hover { background: var(--hover); }
.tile .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--fill); display: grid; place-items: center; margin-bottom: 10px; }
.tile .ic svg { width: 20px; height: 20px; }
.tile b { display: block; } .tile span { color: var(--steel); font-size: 13px; }

/* ---------- pop up: compact sheet, title left, round X right, Cancel and main bottom right ---------- */
.veil { position: fixed; inset: 0; background: rgba(20, 20, 22, .28); display: grid; place-items: center; z-index: 50; padding: 16px; }
.sheet { background: #fff; border-radius: 20px; width: min(460px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.sheet .top { display: flex; align-items: center; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.sheet .top h2 { font-size: 20px; margin: 0; }
.sheet .top .steps { color: var(--steel); font-size: 13px; margin-left: 8px; font-weight: 600; }
.sheet .top .x { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--fill); cursor: pointer; font-size: 16px; line-height: 1; }
.sheet .mid { padding: 16px 18px 4px; overflow: auto; }
.sheet .foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.sheet .rows { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; }
.sheet .rows li { min-height: 50px; }
.sheet .rows li.picked { background: var(--fill); }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 60; }

/* ---------- sign in ---------- */
.gate { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.gate .box { width: min(380px, 100%); }
.gate .logo { height: 30px; margin-bottom: 28px; }
.gate h1 { font-size: 24px; margin: 0 0 6px; }
.gate p { color: var(--steel); margin: 0 0 18px; }
.gate .field input { width: 100%; }
.gate .actions { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.gate .link { all: unset; cursor: pointer; color: var(--orange-text); font-weight: 600; font-size: 14px; }
.qr { display: flex; gap: 16px; align-items: center; margin: 8px 0 16px; }
.qr .key { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: var(--fill); padding: 8px 10px; border-radius: 8px; }
.codes { columns: 2; font-family: ui-monospace, Menlo, monospace; background: var(--fill); padding: 12px 14px; border-radius: 10px; margin: 0 0 16px; }

/* ---------- phone ---------- */
@media (max-width: 760px) {
  .frame { flex-direction: column; }
  .rail { position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: auto; width: auto; flex-direction: row; border-right: 0; border-top: 1px solid var(--line); background: #fff; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); z-index: 40; justify-content: space-around; }
  .rail .logo, .rail .grow, .rail .me { display: none; }
  .rail a { flex-direction: column; height: 44px; gap: 0; font-size: 12px; justify-content: center; padding: 0 10px; }
  .page { padding: 16px 16px 90px; }
  .head h1 { font-size: 24px; }
  .head { flex-wrap: wrap; }
  .field input, .field select, .field.email input { width: 100%; }
  .sheet { align-self: end; border-radius: 20px 20px 0 0; }
  .veil { padding: 0; }
}
