:root {
  --bg: #0b0b0c;
  --surface: #121215;
  --surface-2: #17171b;
  --elev: #1d1d22;
  --line: #24242b;
  --line-soft: #1b1b20;
  --ink: #f4f4f6;
  --muted: #96969f;
  --faint: #6c6c76;
  --accent: #ff7a1a;
  --accent-ink: #1a1006;
  --ok: #3ecf8e;
  --bad: #f0575c;
  --radius: 16px;
  --gap: 10px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  padding: 0 14px calc(24px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}
.shell { max-width: 640px; margin: 0 auto; }
.hidden { display: none !important; }

/* top bar */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 0 12px;
  background: linear-gradient(var(--bg) 72%, rgba(11,11,12,0));
}
.brand { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.brand-mark {
  font-weight: 900; letter-spacing: .5px; font-size: 15px;
  color: var(--ink);
}
.brand-mark::after { content: "."; color: var(--accent); }
.brand-sub { color: var(--faint); font-size: 11px; letter-spacing: .9px; text-transform: uppercase; white-space: nowrap; }
.bar-right { display: flex; align-items: center; gap: 8px; }
.me { color: var(--muted); font-size: 11.5px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface);
  color: var(--muted); transition: transform .15s ease, color .15s ease, border-color .15s ease;
}
.icon-btn:active { transform: scale(.94); color: var(--ink); border-color: #34343c; }

/* metrics */
.metrics { display: flex; gap: 6px; margin-bottom: 12px; }
.metric {
  flex: 1; min-width: 0;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 13px;
  padding: 9px 10px;
}
.metric .v { font-size: 17px; font-weight: 700; letter-spacing: -.2px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric .k { color: var(--faint); font-size: 9.5px; letter-spacing: .7px; text-transform: uppercase; margin-top: 3px; }
.metric.wait .v { color: var(--accent); }
.metric.ok .v { color: var(--ok); }
.metric.bad .v { color: var(--bad); }

/* controls */
.controls { display: flex; flex-direction: column; gap: 9px; margin-bottom: 12px; }
.segmented {
  display: flex; gap: 4px; padding: 4px;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 13px;
  overflow-x: auto; scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.seg {
  flex: 1 0 auto; border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 8px 12px; border-radius: 9px; white-space: nowrap;
  transition: background .16s ease, color .16s ease;
}
.seg.active { background: var(--elev); color: var(--ink); }
.seg:active { background: var(--surface-2); }

.search {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 13px;
  padding: 0 12px; height: 42px; color: var(--faint);
  transition: border-color .16s ease;
}
.search:focus-within { border-color: #35353d; color: var(--muted); }
.search input {
  flex: 1; min-width: 0; height: 100%;
  background: none; border: 0; outline: none;
  color: var(--ink); font: inherit; font-size: 13.5px;
}
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* list */
.list { display: flex; flex-direction: column; gap: 8px; }
.card {
  position: relative;
  display: grid; grid-template-columns: 40px 1fr auto; gap: 11px; align-items: center;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 11px 12px; text-align: left; width: 100%; color: inherit; font: inherit;
  transition: border-color .16s ease, background .16s ease, transform .12s ease;
}
.card:active { transform: scale(.995); border-color: #33333b; background: var(--surface-2); }
.card.is-pending { border-color: rgba(255,122,26,.22); }
.avatar {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--elev); color: var(--ink);
  font-weight: 700; font-size: 14px; letter-spacing: .2px;
}
.card.is-pending .avatar { background: rgba(255,122,26,.14); color: var(--accent); }
.card-main { min-width: 0; }
.card-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { color: var(--muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { color: var(--faint); font-size: 11px; margin-top: 4px; display: flex; gap: 7px; flex-wrap: wrap; }
.card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.stamp { color: var(--faint); font-size: 10.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .2px;
  padding: 3px 8px; border-radius: 999px; white-space: nowrap;
}
.chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.chip.pending { color: var(--accent); background: rgba(255,122,26,.12); }
.chip.approved { color: var(--ok); background: rgba(62,207,142,.12); }
.chip.rejected { color: var(--bad); background: rgba(240,87,92,.12); }

/* skeleton */
.sk { height: 62px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-soft); position: relative; overflow: hidden; }
.sk::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.045) 45%, transparent 70%);
  transform: translateX(-100%); animation: sk 1.4s infinite;
}
@keyframes sk { to { transform: translateX(100%); } }

/* empty / denied */
.empty, .denied { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty svg, .denied-lock { color: var(--faint); margin-bottom: 10px; }
.denied-lock {
  width: 48px; height: 48px; border-radius: 15px; margin: 0 auto 14px;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line-soft); color: var(--muted);
}
.empty h2, .denied h2 { color: var(--ink); font-size: 17px; font-weight: 700; margin: 0 0 6px; letter-spacing: -.2px; }
.empty p, .denied p { margin: 0; font-size: 13px; }
.denied-hint { margin-top: 10px !important; color: var(--faint); font-size: 12px !important; }

/* detail sheet */
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 0 12px; }
.back {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; background: none; color: var(--accent); font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 6px 2px;
}
.sheet-id { color: var(--faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }

.detail-body { display: flex; flex-direction: column; gap: 7px; padding-bottom: 150px; }
.field {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 13px;
  padding: 10px 12px;
}
.field .k { color: var(--faint); font-size: 9.5px; letter-spacing: .8px; text-transform: uppercase; margin-bottom: 4px; }
.field .v { font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.field .v a { color: var(--accent); text-decoration: none; word-break: break-all; }
.field.hero { padding: 14px 13px; }
.field.hero .name { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.field.hero .handle { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.field .v.mono { font-variant-numeric: tabular-nums; }

/* dock */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  max-width: 640px; margin: 0 auto;
  padding: 12px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(11, 11, 12, .94);
  border-top: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.dock textarea {
  width: 100%; resize: none;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 13px;
  color: var(--ink); font: inherit; font-size: 13.5px; line-height: 1.4;
  padding: 11px 12px; outline: none; margin-bottom: 9px;
  transition: border-color .16s ease;
}
.dock textarea:focus { border-color: #35353d; }
.dock textarea::placeholder { color: var(--faint); }
.dock-actions { display: flex; gap: 8px; }
.btn {
  flex: 1; min-height: 46px; border: 1px solid transparent; border-radius: 13px;
  font: inherit; font-weight: 700; font-size: 14px; letter-spacing: .1px;
  transition: transform .12s ease, opacity .16s ease, background .16s ease;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .45; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost-danger { background: transparent; color: var(--bad); border-color: rgba(240,87,92,.35); }
.btn.ghost-danger:active { background: rgba(240,87,92,.08); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translate(-50%, 8px);
  background: var(--elev); color: var(--ink); border: 1px solid var(--line);
  padding: 10px 14px; border-radius: 11px; font-size: 12.5px;
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
  max-width: calc(100% - 28px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::after { animation: none !important; transition: none !important; }
}
