/* Shared canvas + tokens for the mobile interface designs (Busabase / Buda). */

:root {
  --screen-w: 390px;
  --screen-h: 844px;

  --ink: #131311;
  --ink-2: #5f5f59;
  --ink-3: #94948c;
  --ink-4: #b4b4ac;

  --paper: #ffffff;
  --grouped: #f6f6f4;
  --grouped-2: #efefeb;

  --line: #e6e6e0;
  --line-soft: #eeeee8;

  --green: #0e7a4a;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --green-soft: #eaf4ee;
  --amber: #a9661a;
  --amber-soft: #f8f0e4;

  --accent: #131311;
  --danger: #b23a2e;
  --radius-card: 12px;
  --radius-row: 10px;

  --shadow-seg: 0 1px 2px rgba(0, 0, 0, 0.06), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  --shadow-float: 0 6px 20px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px;
  background: #d9d9d4;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  width: var(--screen-w);
  height: var(--screen-h);
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
}

/* ── status bar ─────────────────────────────────────────────── */
.statusbar {
  display: flex;
  flex: none;
  align-items: flex-end;
  justify-content: space-between;
  height: 54px;
  padding: 0 24px 6px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.statusbar .glyphs { display: flex; align-items: center; gap: 6px; }

/* ── navigation bar ─────────────────────────────────────────── */
.navbar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 12px;
}

.navbar .navTitle {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: center;
}

.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--grouped-2);
  color: var(--ink-2);
}

.iconbtn.plain { background: none; color: var(--ink); }

/* ── large header ───────────────────────────────────────────── */
.appheader {
  display: flex;
  flex: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 20px 12px;
}

.appheader h1 {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.14;
}

.appheader .sub {
  margin-top: 5px;
  color: var(--ink-3);
  font-size: 13px;
  letter-spacing: -0.005em;
}

/* ── segmented control ──────────────────────────────────────── */
.segmented {
  display: flex;
  flex: none;
  gap: 2px;
  margin: 0 16px 14px;
  padding: 2px;
  border-radius: 10px;
  background: var(--grouped-2);
}

.segmented button {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.segmented button b { font-weight: 500; font-variant-numeric: tabular-nums; }
.segmented button.on { background: var(--paper); box-shadow: var(--shadow-seg); color: var(--ink); font-weight: 600; }
.segmented button.on b { color: var(--ink); }

/* ── list ───────────────────────────────────────────────────── */
.scroll { flex: 1; min-height: 0; overflow: hidden; }

.grouphead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 20px 8px;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.grouphead.space { padding-top: 22px; }

.card {
  margin: 0 16px;
  border-radius: var(--radius-card);
  background: var(--paper);
  overflow: hidden;
}

.row {
  position: relative;
  display: grid;
  grid-template-columns: 13px minmax(0, 1fr) auto;
  column-gap: 9px;
  padding: 13px 16px 14px;
}

.row + .row::before {
  position: absolute;
  top: 0;
  right: 16px;
  left: 16px;
  height: 1px;
  background: var(--line-soft);
  content: '';
}

.row .dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--ink-4);
}

.dot[data-state='approved'] { background: var(--green); }
.dot[data-state='review'] { background: var(--amber); }
.dot[data-state='done'] { background: var(--ink-4); }

.rowTitle {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.34;
}

.rowMeta {
  margin-top: 5px;
  color: var(--ink-3);
  font-size: 12.5px;
  letter-spacing: -0.004em;
  font-variant-numeric: tabular-nums;
}

.rowFoot {
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 12.5px;
  letter-spacing: -0.004em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rowStatus {
  padding-top: 1px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.rowStatus[data-state='approved'] { color: var(--green); }
.rowStatus[data-state='review'] { color: var(--amber); }
.rowStatus[data-state='done'] { color: var(--ink-3); }

/* ── section blocks (detail screens) ────────────────────────── */
.section { padding: 0 20px; }
.section + .section { margin-top: 26px; }

.section h3 {
  margin-bottom: 10px;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.panel {
  border-radius: var(--radius-card);
  background: var(--grouped);
  padding: 14px 16px;
}

.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .prow { padding: 13px 16px; }
/* Inset the row divider 16px from both edges, matching the run-log rows. */
.panel.flush .prow + .prow { position: relative; border-top: 0; }
.panel.flush .prow + .prow::before {
  position: absolute;
  top: 0;
  right: 16px;
  left: 16px;
  height: 1px;
  background: var(--line-soft);
  content: '';
}

.prow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.prow .k { color: var(--ink-2); font-size: 13.5px; }
.prow .v { overflow: hidden; max-width: 62%; font-size: 13.5px; font-variant-numeric: tabular-nums; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.prow .v .old { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.prow .v .arrow { padding: 0 6px; color: var(--ink-4); }
.prow .v .new { color: var(--green); font-weight: 500; }

.note { color: var(--ink-2); font-size: 14px; letter-spacing: -0.006em; line-height: 1.5; }
.quote { color: var(--ink); font-size: 15px; letter-spacing: -0.012em; line-height: 1.45; }
.quote::before { content: '“'; }
.quote::after { content: '”'; }

.receipt {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--ink-3);
  font-size: 12.5px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--grouped);
  color: var(--ink-2);
  font-size: 12.5px;
  letter-spacing: -0.004em;
}

.chiprow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ── bottom action bar ──────────────────────────────────────── */
.actionbar {
  display: flex;
  flex: none;
  gap: 10px;
  padding: 12px 16px 0;
}

.actionbar.bottom { padding-bottom: 34px; }

/* ── buttons ────────────────────────────────────────────────── */
/* One component, three sizes, one fill scale. Every button in a set
   shares the same height and radius; width is decided by the container.
     .btn            default action           --btn-h
     .btn.compact    inline action            --btn-h-sm
     .send           circular icon action     --btn-icon
   Fill: .primary (accent) · .secondary (soft) · .ghost (text only, no fill)
   Width: .actionbar / .btnrow children split the row equally;
          .authbody / .stack children stretch full width;
          .compact and .actions children take their content width. */
.btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: var(--btn-min, 88px);
  height: var(--btn-h, 48px);
  padding: 0 var(--btn-pad, 18px);
  border: 0;
  border-radius: var(--btn-r, 12px);
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: -0.012em;
  white-space: nowrap;
}

.btn.secondary { background: var(--grouped-2); color: var(--ink); }
.btn.destructive { background: var(--grouped-2); color: var(--danger); }
.btn.primary { background: var(--accent); color: #fff; font-weight: 600; }
.btn.ghost { background: none; color: var(--ink-2); font-weight: 400; }

.actionbar > .btn,
.btnrow > .btn { flex: 1 1 0; min-width: 0; padding: 0 var(--btn-pad-bar, 12px); }

.authbody > .btn,
.stack > .btn { width: 100%; }

.btn.compact { min-width: 0; height: var(--btn-h-sm, 34px); padding: 0 14px; font-size: 13px; }

.send {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--btn-icon, 40px);
  height: var(--btn-icon, 40px);
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}

/* ── home indicator ─────────────────────────────────────────── */
.home { display: flex; flex: none; justify-content: center; align-items: center; height: 34px; margin-top: auto; }
.home i { width: 139px; height: 5px; border-radius: 3px; background: var(--ink); opacity: 0.82; }
/* the indicator sits on the surface above it, never on the page behind it */
.tabbar + .home,
.composer + .home,
.sheet + .home,
.gfoot + .home { background: var(--paper); }

/* ── auth + settings primitives ─────────────────────────────── */
.brandmark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
}

.authh { flex: none; padding: 0 20px; }
.authh h1 { font-size: 27px; font-weight: 600; letter-spacing: -0.026em; line-height: 1.16; }
.authh p { margin-top: 8px; color: var(--ink-2); font-size: 14px; letter-spacing: -0.006em; line-height: 1.5; }

.authform { display: flex; flex: none; flex-direction: column; gap: 10px; margin-top: 24px; padding: 0 20px; }

.field {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 15px;
  border-radius: 12px;
  background: var(--grouped);
  font-size: 15px;
  letter-spacing: -0.008em;
}
.field .ph { color: var(--ink-3); }
.field .caret { width: 1.5px; height: 19px; background: var(--ink); }
.field .trail { margin-left: auto; color: var(--ink-3); font-size: 13px; }
.field .hint { margin-left: auto; color: var(--green); font-size: 12.5px; }

.fieldlabel { margin: 0 15px 6px; color: var(--ink-2); font-size: 12px; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; }

.divider { display: flex; align-items: center; gap: 12px; margin: 20px 20px 14px; color: var(--ink-4); font-size: 12px; }
.divider::before, .divider::after { flex: 1; height: 1px; background: var(--line); content: ''; }

.authfoot { flex: none; padding: 20px 20px 0; text-align: center; color: var(--ink-3); font-size: 13px; }
.authfoot b { color: var(--ink); font-weight: 500; }

.legal { flex: none; padding: 20px 24px 0; color: var(--ink-4); font-size: 12px; line-height: 1.5; text-align: center; }

.switch { position: relative; flex: none; width: 46px; height: 28px; border-radius: 14px; background: var(--grouped-2); }
.switch.on { background: var(--accent); }
.switch i { position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.switch.on i { left: 20px; }

.chev { display: flex; align-items: center; color: var(--ink-4); }

.profileblock { display: flex; flex: none; align-items: center; gap: 14px; padding: 4px 20px 22px; }
.profileblock h2 { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.profileblock p { margin-top: 3px; color: var(--ink-3); font-size: 13px; }
.profileblock .badge { display: inline-flex; align-items: center; height: 24px; margin-top: 8px; padding: 0 9px; border-radius: 7px; background: var(--grouped-2); color: var(--ink-2); font-size: 11.5px; }

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--grouped-2);
  color: var(--ink-2);
  font-size: 18px;
  font-weight: 500;
}

.signout { flex: none; padding: 22px 20px 0; color: var(--ink-2); font-size: 14.5px; }

/* ── real photo avatars ─────────────────────────────────────── */
.avatar.photo,
.pav.photo,
.thumb.photo { padding: 0; overflow: hidden; background: var(--grouped-2); }
.avatar.photo img,
.pav.photo img,
.thumb.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ── centered auth layout ───────────────────────────────────── */
.authwrap {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  justify-content: center;
  padding: 0 24px;
}

.authhero { display: flex; flex: none; flex-direction: column; align-items: center; text-align: center; }
.authhero .brandmark { width: 68px; height: 68px; border-radius: 20px; }
.authhero .brandmark svg { width: 32px; height: 32px; }
.authhero .wordmark { margin-top: 15px; color: var(--ink-3); font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; }
.authhero h1 { margin-top: 14px; font-size: 29px; font-weight: 600; letter-spacing: -0.028em; line-height: 1.14; }
.authhero p { margin-top: 10px; max-width: 268px; color: var(--ink-2); font-size: 14px; letter-spacing: -0.006em; line-height: 1.5; }

.authbody { display: flex; flex: none; flex-direction: column; gap: 10px; margin-top: 30px; }
.authbody .divider { margin: 16px 0 10px; }
.authbody .forgot { align-self: center; margin-top: 2px; color: var(--ink-3); font-size: 13px; }

/* ── sign out row ───────────────────────────────────────────── */
.signout {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  height: 52px;
  margin: 22px 16px 0;
  padding: 0;
  border-radius: var(--radius-card);
  background: var(--paper);
  color: var(--danger);
  font-size: 15px;
  letter-spacing: -0.008em;
}
