/* ============================================================
   Redwards — Glass design system
   Two themes: glassy light (default) & glassy dark.
   Brand red: #9D1616
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Brand */
  --red: #9D1616;
  --red-deep: #6E0D0D;
  --red-bright: #C42222;

  /* Token colours */
  --token-red: #D3372C;
  --token-yellow: #E8A317;
  --token-blue: #2B6CB0;
  --token-platinum: #B8C2CC;

  /* Type */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow-glass: 0 8px 32px rgba(20, 6, 6, 0.12);
  --blur: 22px;
}

/* ---------- Light theme (default) ---------- */
:root, [data-theme="light"] {
  color-scheme: light;
  --bg: #f4f1ef;
  --bg-blob-a: rgba(157, 22, 22, 0.16);
  --bg-blob-b: rgba(232, 163, 23, 0.14);
  --bg-blob-c: rgba(43, 108, 176, 0.10);

  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-inner: rgba(255, 255, 255, 0.35);

  --text: #221a1a;
  --text-dim: #6b5f5f;
  --text-faint: #9a8d8d;

  --input-bg: rgba(255, 255, 255, 0.6);
  --input-border: rgba(34, 26, 26, 0.12);
  --input-focus: rgba(157, 22, 22, 0.55);

  --danger-bg: rgba(157, 22, 22, 0.08);
  --success: #1c7c46;
  --success-bg: rgba(28, 124, 70, 0.10);
  --autofill-bg: #efe9e7;
  --option-bg: #ffffff;
  --option-fg: #221a1a;
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0a0b;
  --bg-blob-a: rgba(157, 22, 22, 0.30);
  --bg-blob-b: rgba(232, 163, 23, 0.10);
  --bg-blob-c: rgba(43, 108, 176, 0.12);

  --glass: rgba(28, 20, 21, 0.55);
  --glass-strong: rgba(34, 25, 26, 0.75);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-inner: rgba(255, 255, 255, 0.04);

  --text: #f3eded;
  --text-dim: #b5a6a6;
  --text-faint: #7d6f6f;

  --input-bg: rgba(255, 255, 255, 0.06);
  --input-border: rgba(255, 255, 255, 0.14);
  --input-focus: rgba(196, 34, 34, 0.75);

  --danger-bg: rgba(196, 34, 34, 0.16);
  --success: #4cc586;
  --success-bg: rgba(76, 197, 134, 0.12);

  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.45);
  --autofill-bg: #241a1b;
  --option-bg: #221819;
  --option-fg: #f3eded;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient gradient blobs behind the glass */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.ambient::before,
.ambient::after,
.ambient .blob-c {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}
.ambient::before {
  width: 55vmax; height: 55vmax;
  top: -20vmax; left: -15vmax;
  background: var(--bg-blob-a);
}
.ambient::after {
  width: 45vmax; height: 45vmax;
  bottom: -18vmax; right: -12vmax;
  background: var(--bg-blob-b);
}
.ambient .blob-c {
  width: 35vmax; height: 35vmax;
  top: 40%; left: 55%;
  background: var(--bg-blob-c);
}

/* ---------- Glass card ---------- */
.glass {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass), inset 0 1px 0 var(--glass-inner);
}

/* ---------- Auth layout ---------- */
.auth-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 30px 30px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
  text-align: center;
}
.brand img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(157, 22, 22, 0.35);
}
.brand h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.brand p {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
}

/* Floating glass token coins — signature element */
.coins { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.coin {
  position: absolute;
  border-radius: 50%;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: inset 0 2px 8px rgba(255,255,255,0.35), 0 10px 30px rgba(0,0,0,0.15);
  animation: drift 9s ease-in-out infinite;
}
.coin.red    { background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.55), rgba(211,55,44,.75)); }
.coin.yellow { background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.55), rgba(232,163,23,.75)); }
.coin.blue   { background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.55), rgba(43,108,176,.75)); }
@keyframes drift {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%     { transform: translateY(-16px) rotate(6deg); }
}
@media (prefers-reduced-motion: reduce) {
  .coin { animation: none; }
}

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 13px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus-visible {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(157, 22, 22, 0.15);
}
.field .hint { font-size: 12px; color: var(--text-faint); margin-top: 5px; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.pw-toggle {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  padding: 8px; cursor: pointer;
  color: var(--text-faint);
  font-size: 16px;
  line-height: 1;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, opacity .12s;
}
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--red-bright), var(--red-deep));
  box-shadow: 0 6px 20px rgba(157, 22, 22, 0.35);
}
.btn-primary:hover:not([disabled]) { box-shadow: 0 8px 26px rgba(157, 22, 22, 0.45); }

.btn-ghost {
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
}

.btn .spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-label { opacity: .8; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Messages ---------- */
.msg {
  display: none;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.45;
  margin-bottom: 16px;
}
.msg.show { display: block; }
.msg.error { background: var(--danger-bg); color: var(--red-bright); }
.msg.success { background: var(--success-bg); color: var(--success); }

/* ---------- Links & footer ---------- */
.auth-links {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
  font-size: 14px;
  color: var(--text-dim);
}
.auth-links a {
  color: var(--red-bright);
  font-weight: 600;
  text-decoration: none;
}
.auth-links a:hover { text-decoration: underline; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  z-index: 50;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  cursor: pointer;
  font-size: 18px;
  color: var(--text);
}

/* ---------- Steps (signup) ---------- */
.step { display: none; }
.step.active { display: block; animation: fadeUp .25s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.step-dots {
  display: flex; gap: 6px; justify-content: center;
  margin-bottom: 22px;
}
.step-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--input-border);
  transition: background .2s, width .2s;
}
.step-dots span.on {
  width: 22px; border-radius: 6px;
  background: var(--red-bright);
}

.welcome-name {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  text-align: center;
  margin: 4px 0 2px;
}

.terms-box {
  max-height: 260px;
  overflow-y: auto;
  padding: 16px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-dim);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.terms-box h3 { color: var(--text); font-size: 14px; margin: 14px 0 6px; }
.terms-box h3:first-child { margin-top: 0; }

.check-row {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; margin-bottom: 18px; cursor: pointer;
}
.check-row input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--red); }

/* ---------- App placeholder page ---------- */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.app-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 18px 12px;
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  border-bottom: 1px solid var(--glass-border);
}
.app-header .title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 19px;
}
.app-main {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px calc(90px + env(safe-area-inset-bottom));
}
.bottom-nav {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 40;
  display: flex; gap: 4px;
  padding: 6px;
  border-radius: 999px;
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 66px;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
}
.bottom-nav a.active {
  color: #fff;
  background: linear-gradient(135deg, var(--red-bright), var(--red-deep));
}
.bottom-nav .ico { font-size: 18px; line-height: 1; }

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

/* ============================================================
   Feed — Phase 2
   ============================================================ */

.feed-toolbar {
  position: sticky;
  top: calc(58px + env(safe-area-inset-top));
  z-index: 30;
  display: flex;
  gap: 8px;
  padding: 10px;
  margin-bottom: 16px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}
.feed-toolbar::-webkit-scrollbar { display: none; }
.feed-toolbar select {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 999px;
  padding: 8px 12px;
  outline: none;
  cursor: pointer;
  flex: 0 0 auto;
}
.feed-toolbar .tb-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  flex: 0 0 auto;
}

.feed-list { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Post card ---------- */
.post {
  padding: 16px 16px 12px;
  position: relative;
  overflow: hidden;
}
.post-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.avatar {
  width: 42px; height: 42px; flex: 0 0 auto;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700; font-size: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--red-bright), var(--red-deep));
  object-fit: cover;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-who { flex: 1; min-width: 0; line-height: 1.35; }
.post-who .line { font-size: 14px; }
.post-who .recv { font-weight: 700; }
.post-who .sup { color: var(--text-dim); }
.post-who .time { font-size: 12px; color: var(--text-faint); margin-top: 1px; }

.token-chip {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  font-weight: 700; font-size: 13px;
  color: #fff;
  background: var(--chip, var(--text-dim));
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}
.token-chip .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.85);
}

.cat-tag {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--red-bright);
  margin-bottom: 6px;
}
.post-desc { font-size: 14.5px; line-height: 1.5; margin: 0 0 10px; }
.post-photo {
  width: 100%; border-radius: var(--radius-md);
  margin-bottom: 10px; display: block;
  max-height: 340px; object-fit: cover;
}

.post-foot {
  display: flex; gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--glass-border);
}
.act {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  padding: 8px 12px; border-radius: 999px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--text-dim);
  transition: background .12s, color .12s, transform .1s;
}
.act:hover { background: var(--input-bg); }
.act:active { transform: scale(.94); }
.act .ico { font-size: 16px; line-height: 1; }
.act.liked { color: var(--red-bright); }
.act.liked .ico { animation: pop .3s ease; }
@keyframes pop { 0%{transform:scale(1)} 45%{transform:scale(1.35)} 100%{transform:scale(1)} }

/* ---------- Special award card ---------- */
.post.special {
  border: none;
  background:
    linear-gradient(var(--glass-strong), var(--glass-strong)) padding-box,
    linear-gradient(135deg, #E8A317, #C42222, #9D1616, #E8A317) border-box;
  border: 1.5px solid transparent;
  background-size: 100% 100%, 300% 300%;
  animation: sheen 8s ease infinite;
}
@keyframes sheen { 0%,100%{background-position:0 0,0% 50%} 50%{background-position:0 0,100% 50%} }
@media (prefers-reduced-motion: reduce) { .post.special { animation: none; } }
.ribbon {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 10px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 12px;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, #E8A317, #C42222);
  box-shadow: 0 4px 14px rgba(196,34,34,0.35);
}
.ribbon .tro { font-size: 14px; }

.post.platinum {
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--glass-strong), var(--glass-strong)) padding-box,
    linear-gradient(135deg, #d7dde3, #9aa6b2, #eef2f5, #b8c2cc) border-box;
}
.ribbon.plat { background: linear-gradient(135deg, #9aa6b2, #6b7684); color: #fff; }

/* ---------- Comment sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
  display: none;
  align-items: flex-end; justify-content: center;
}
.sheet-backdrop.open { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.sheet {
  width: 100%; max-width: 560px;
  max-height: 82dvh;
  display: flex; flex-direction: column;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  animation: slideUp .25s ease;
}
@keyframes slideUp { from{transform:translateY(100%)} to{transform:translateY(0)} }
@media (min-width: 620px) {
  .sheet-backdrop.open { align-items: center; }
  .sheet { border-radius: var(--radius-lg); animation: fadeUp .2s ease; }
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--glass-border);
}
.sheet-head h3 { margin: 0; font-family: var(--font-display); font-size: 17px; }
.sheet-close {
  background: none; border: none; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--text-dim);
  padding: 4px 8px;
}
.sheet-body { flex: 1; overflow-y: auto; padding: 14px 18px; }
.comment {
  display: flex; gap: 10px; margin-bottom: 14px;
}
.comment .avatar { width: 34px; height: 34px; font-size: 12px; }
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-name { font-weight: 700; font-size: 13.5px; }
.comment .c-text { font-size: 14px; line-height: 1.45; margin: 1px 0 2px; }
.comment .c-time { font-size: 11px; color: var(--text-faint); }
.comments-empty { text-align: center; color: var(--text-faint); font-size: 14px; padding: 24px 0; }
.sheet-foot {
  display: flex; gap: 8px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--glass-border);
}
.sheet-foot input {
  flex: 1; font: inherit; font-size: 14px; color: var(--text);
  background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: 999px; padding: 11px 15px; outline: none;
}
.sheet-foot input:focus-visible { border-color: var(--input-focus); }
.sheet-foot .btn { width: auto; padding: 11px 18px; }

/* ---------- Feed states ---------- */
.feed-empty, .feed-loading {
  text-align: center; padding: 40px 20px; color: var(--text-dim);
}
.feed-empty .big, .feed-loading .big { font-size: 40px; margin-bottom: 10px; }
.skeleton {
  height: 150px; border-radius: var(--radius-lg);
  background: linear-gradient(100deg, var(--glass) 30%, var(--glass-inner) 50%, var(--glass) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  margin-bottom: 14px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============================================================
   Tokens / Wallet — Phase 3
   ============================================================ */
.page-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; margin: 4px 0 2px; }
.page-sub { color: var(--text-dim); font-size: 14px; margin: 0 0 18px; }

.balance-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
@media (min-width: 640px) { .balance-grid { grid-template-columns: repeat(4, 1fr); } }

.bal-card {
  padding: 16px 16px 14px;
  display: flex; flex-direction: column; gap: 4px;
  position: relative; overflow: hidden;
}
.bal-card .bname { font-size: 13px; font-weight: 700; color: var(--text-dim); }
.bal-card .bnum { font-family: var(--font-display); font-size: 34px; font-weight: 700; line-height: 1; }
.bal-card .brar { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--text-faint); }

/* CSS coin-stack visual */
.coin-stack {
  position: absolute; top: 14px; right: 14px;
  width: 46px; height: 40px;
}
.coin-stack .disc {
  position: absolute; left: 0; width: 46px; height: 16px;
  border-radius: 50%;
  background: var(--cc, #888);
  box-shadow: inset 0 2px 4px rgba(255,255,255,.4), inset 0 -3px 6px rgba(0,0,0,.35);
  border: 1px solid rgba(0,0,0,.15);
}
.coin-stack .disc:nth-child(1) { top: 0; }
.coin-stack .disc:nth-child(2) { top: 8px; }
.coin-stack .disc:nth-child(3) { top: 16px; }
.coin-stack .disc:nth-child(4) { top: 24px; }
.cc-red      { --cc: linear-gradient(180deg,#e6564b,#b81f16); }
.cc-yellow   { --cc: linear-gradient(180deg,#f2be4d,#d68e0c); }
.cc-blue     { --cc: linear-gradient(180deg,#4d84c8,#1f5596); }
.cc-platinum { --cc: linear-gradient(180deg,#e8edf1,#9aa6b2); }

/* Section header */
.section-head { display: flex; align-items: center; gap: 9px; margin: 0 0 3px; }
.section-head .ic { font-size: 19px; }
.section-head h2 { font-family: var(--font-display); font-size: 19px; font-weight: 700; margin: 0; }
.section-note { color: var(--text-dim); font-size: 13.5px; margin: 0 0 16px; }

/* Exchange */
.exchange { padding: 18px 16px; margin-bottom: 22px; }
.xrow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 16px 0;
}
.xrow + .xrow { border-top: 1px solid var(--glass-border); }
.xside { text-align: center; }
.xside .amt { font-weight: 700; font-size: 14px; line-height: 1.25; }
.xside .mini { font-size: 22px; margin: 6px 0 4px; }
.xside .rar { font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.rar.common { color: var(--token-red); }
.rar.rare   { color: var(--token-yellow); }
.rar.epic   { color: var(--token-blue); }
.xswap { font-size: 20px; color: var(--text-faint); }
.xbtns { display: flex; flex-direction: column; gap: 8px; grid-column: 1 / -1; margin-top: 6px; }
@media (min-width: 560px) {
  .xrow { grid-template-columns: 1fr auto 1fr auto; }
  .xbtns { grid-column: auto; flex-direction: row; margin-top: 0; }
}
.xbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px; border: none; border-radius: var(--radius-md);
  font: inherit; font-size: 13px; font-weight: 700; color: #fff; cursor: pointer;
  white-space: nowrap; transition: transform .1s, opacity .12s, box-shadow .12s;
}
.xbtn:active { transform: scale(.96); }
.xbtn:disabled { opacity: .38; cursor: not-allowed; }
.xbtn.down { background: linear-gradient(135deg,#e6564b,#c42222); }
.xbtn.up-y { background: linear-gradient(135deg,#f2be4d,#d68e0c); }
.xbtn.up-b { background: linear-gradient(135deg,#4d84c8,#1f5596); }

/* Recent activity */
.activity { padding: 16px 4px 6px; }
.act-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 13px 12px;
  border-radius: var(--radius-md);
}
.act-row + .act-row { border-top: 1px solid var(--glass-border); }
.act-desc { font-size: 14px; font-weight: 500; }
.act-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim); }
.act-change { font-weight: 700; font-size: 13px; text-align: right; white-space: nowrap; }
.act-date { font-size: 12px; color: var(--text-faint); text-align: right; }
.chg-pos { color: var(--success); }
.chg-neg { color: var(--red-bright); }
@media (min-width: 640px) {
  .act-row { grid-template-columns: 2fr 1fr 1fr auto; align-items: center; }
  .act-date { min-width: 96px; }
}

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  z-index: 80; opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: #fff;
  background: rgba(28,20,21,.92); backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: linear-gradient(135deg,#1c7c46,#0f5c31); }
.toast.err { background: linear-gradient(135deg,#c42222,#8a1414); }

/* ============================================================
   Shop & Claimed — Phase 4
   ============================================================ */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 620px) { .shop-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .shop-grid { grid-template-columns: repeat(4, 1fr); } }

.product {
  display: flex; flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.product .p-photo {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  background: var(--glass-inner);
  display: block;
}
.product .p-photo.placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: var(--text-faint);
}
.product .p-body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product .p-cat {
  font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-faint);
}
.product .p-name { font-weight: 700; font-size: 14.5px; line-height: 1.3; }
.product .p-desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product .p-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; }
.price-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px;
  font-weight: 800; font-size: 13px; color: #fff;
  background: var(--pc, var(--text-dim));
}
.price-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.9); }
.p-stock { font-size: 11px; color: var(--text-faint); }
.p-stock.out { color: var(--red-bright); font-weight: 700; }
.redeem-btn {
  width: 100%; margin-top: 8px;
  padding: 10px; border: none; border-radius: var(--radius-md);
  font: inherit; font-size: 13px; font-weight: 700; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--red-bright), var(--red-deep));
  transition: transform .1s, opacity .12s;
}
.redeem-btn:active { transform: scale(.97); }
.redeem-btn:disabled { opacity: .4; cursor: not-allowed; }

/* Redeem confirm sheet */
.confirm-card { text-align: center; padding: 8px 4px 4px; }
.confirm-card .c-photo {
  width: 120px; height: 120px; border-radius: var(--radius-md);
  object-fit: cover; margin: 0 auto 14px; display: block;
}
.confirm-card h3 { font-family: var(--font-display); margin: 0 0 4px; font-size: 19px; }
.confirm-card .c-price { font-size: 15px; color: var(--text-dim); margin-bottom: 4px; }
.confirm-card .c-after { font-size: 13px; color: var(--text-faint); margin-bottom: 18px; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn { flex: 1; }

/* Claimed list */
.claimed-item {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 15px;
}
.claimed-item + .claimed-item { border-top: 1px solid var(--glass-border); }
.claimed-item .ci-ic {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: var(--glass-inner);
}
.claimed-item .ci-body { flex: 1; min-width: 0; }
.claimed-item .ci-name { font-weight: 700; font-size: 14.5px; }
.claimed-item .ci-date { font-size: 12px; color: var(--text-faint); }
.status-pill {
  flex: 0 0 auto; font-size: 11px; font-weight: 700;
  padding: 5px 11px; border-radius: 999px;
}
.status-pill.done { color: var(--success); background: var(--success-bg); }
.status-pill.pending { color: var(--token-yellow); background: rgba(232,163,23,.14); }

/* ============================================================
   Award flow (supervisor) — Phase 5
   ============================================================ */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 45;
  display: none;               /* shown only for supervisors/admins */
  align-items: center; gap: 8px;
  padding: 14px 20px;
  border: none; border-radius: 999px;
  font-family: var(--font-body); font-size: 15px; font-weight: 700;
  color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--red-bright), var(--red-deep));
  box-shadow: 0 8px 24px rgba(157,22,22,.45);
  transition: transform .12s, box-shadow .12s;
}
.fab.show { display: inline-flex; animation: fadeUp .3s ease; }
.fab:active { transform: scale(.95); }
.fab .plus { font-size: 20px; line-height: 1; }

.award-sheet { max-height: 88dvh; }
.award-body { padding: 16px 18px; overflow-y: auto; }
.award-step-title { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-faint); margin: 4px 0 8px; }

/* Employee search + list */
.emp-search {
  width: 100%; font: inherit; font-size: 15px; color: var(--text);
  background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: var(--radius-md); padding: 12px 14px; outline: none; margin-bottom: 10px;
}
.emp-search:focus-visible { border-color: var(--input-focus); }
.emp-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.emp-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--radius-md); cursor: pointer;
  border: 1px solid transparent; background: var(--input-bg);
}
.emp-item:hover { border-color: var(--input-border); }
.emp-item.sel { border-color: var(--input-focus); background: var(--danger-bg); }
.emp-item .avatar { width: 36px; height: 36px; font-size: 13px; }
.emp-item .en { font-weight: 600; font-size: 14px; }
.emp-item .ee { font-size: 12px; color: var(--text-faint); }

/* Reward type chips */
.rt-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.rt-chip {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 9px 13px; border-radius: var(--radius-md); cursor: pointer;
  background: var(--input-bg); border: 1px solid var(--input-border);
  font-size: 13.5px; font-weight: 600;
}
.rt-chip.sel { border-color: var(--input-focus); background: var(--danger-bg); }
.rt-chip .rv { font-size: 11px; color: var(--text-faint); font-weight: 700; }

/* Quantity stepper */
.qty-stepper { display: flex; align-items: center; gap: 14px; margin: 4px 0 2px; }
.qty-stepper button {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--input-border); background: var(--input-bg);
  font-size: 22px; font-weight: 700; color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.qty-stepper button:active { transform: scale(.92); }
.qty-stepper .qv {
  font-family: var(--font-display); font-size: 30px; font-weight: 700; min-width: 56px; text-align: center;
}
.qty-cur { font-size: 12px; color: var(--text-faint); }

.award-field { margin: 14px 0; }
.award-field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.award-field textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--text); resize: vertical; min-height: 70px;
  background: var(--input-bg); border: 1px solid var(--input-border); border-radius: var(--radius-md);
  padding: 11px 13px; outline: none;
}
.award-field textarea:focus-visible { border-color: var(--input-focus); }
.photo-pick { display: flex; align-items: center; gap: 12px; }
.photo-pick label.pbtn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 10px 14px; border-radius: var(--radius-md);
  background: var(--input-bg); border: 1px solid var(--input-border);
  font-size: 13px; font-weight: 600;
}
.photo-pick img.prev { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; }
.quota-note { font-size: 12.5px; color: var(--text-dim); margin: 2px 0 0; }
.quota-note b { color: var(--text); }

/* ============================================================
   Admin section — Phase 6
   ============================================================ */
.admin-gate {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 15px; gap: 10px;
}
.admin-shell { min-height: 100dvh; display: flex; }

.admin-sidebar {
  width: 234px; flex: 0 0 auto;
  position: sticky; top: 0; align-self: flex-start; height: 100dvh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 14px calc(16px + env(safe-area-inset-bottom));
  background: var(--glass); backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  border-right: 1px solid var(--glass-border);
  z-index: 40;
}
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.admin-brand img { width: 34px; height: 34px; border-radius: 9px; }
.admin-brand span { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.admin-nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600; color: var(--text-dim);
  text-decoration: none; transition: background .12s, color .12s;
}
.admin-nav-link:hover { background: var(--input-bg); color: var(--text); }
.admin-nav-link.active { color: #fff; background: linear-gradient(135deg, var(--red-bright), var(--red-deep)); }
.admin-nav-link .ic { font-size: 17px; width: 20px; text-align: center; }
.admin-nav-spacer { flex: 1; }
.admin-nav-foot { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--glass-border); padding-top: 10px; }
.admin-ver { font-size: 11px; color: var(--text-faint); padding: 4px 12px 0; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 22px; 
  background: var(--glass); backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  border-bottom: 1px solid var(--glass-border);
}
.admin-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.admin-topbar .sp { flex: 1; }
.admin-user { display: flex; align-items: center; gap: 10px; }
.admin-user .who { font-size: 13px; color: var(--text-dim); text-align: right; line-height: 1.2; }
.admin-user .who b { display: block; color: var(--text); font-size: 13.5px; }
.admin-burger { display: none; background: none; border: none; font-size: 22px; color: var(--text); cursor: pointer; }
.admin-content { padding: 24px 22px 60px; max-width: 1200px; width: 100%; }

/* Overview stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { padding: 18px 18px 16px; }
.stat-card .sv { font-family: var(--font-display); font-size: 32px; font-weight: 700; line-height: 1; }
.stat-card .sl { font-size: 13px; color: var(--text-dim); margin-top: 6px; }
.stat-card .si { font-size: 20px; margin-bottom: 8px; }

/* Admin tables */
.admin-panel { padding: 4px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 12px; }
.panel-head h2 { font-family: var(--font-display); font-size: 18px; margin: 0; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-faint); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--glass-border); }
.admin-table td { padding: 11px 12px; border-bottom: 1px solid var(--glass-border); font-size: 14px; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.tbl-photo { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; background: var(--glass-inner); }
.tbl-photo.ph { display: inline-flex; align-items: center; justify-content: center; font-size: 20px; }
.tbl-name { font-weight: 600; }
.tbl-sub { font-size: 12px; color: var(--text-faint); }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.pill.on { color: var(--success); background: var(--success-bg); }
.pill.off { color: var(--text-faint); background: var(--input-bg); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn { background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 9px;
  width: 34px; height: 34px; cursor: pointer; font-size: 15px; color: var(--text); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { border-color: var(--input-focus); }
.icon-btn.danger:hover { color: var(--red-bright); border-color: var(--red-bright); }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 40px; height: 23px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--input-border); border-radius: 999px; transition: .2s; cursor: pointer; }
.switch .track::before { content:''; position: absolute; height: 17px; width: 17px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .track { background: var(--success); }
.switch input:checked + .track::before { transform: translateX(17px); }

/* Admin form modal */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display:block; font-size: 12.5px; font-weight: 600; color: var(--text-dim); margin-bottom: 5px; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--text);
  background: var(--input-bg); border: 1px solid var(--input-border); border-radius: var(--radius-md);
  padding: 10px 12px; outline: none;
}
.form-grid textarea { min-height: 64px; resize: vertical; }
.form-grid input:focus-visible, .form-grid select:focus-visible, .form-grid textarea:focus-visible { border-color: var(--input-focus); }

.admin-empty { text-align: center; padding: 40px; color: var(--text-dim); }

@media (max-width: 860px) {
  .admin-sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-glass); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-burger { display: inline-flex; }
  .admin-user .who { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}
.admin-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 39; display: none; }
.admin-scrim.show { display: block; }

/* ============================================================
   Special awards (admin) — Phase 7
   ============================================================ */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; margin-bottom: 18px; }
.seg button {
  border: none; background: none; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--text-dim); padding: 8px 16px; border-radius: 999px;
}
.seg button.active { color: #fff; background: linear-gradient(135deg, var(--red-bright), var(--red-deep)); }

.sa-cols { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 820px) { .sa-cols { grid-template-columns: 1fr 1fr; } }

.sa-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 10px; }
.sa-type {
  padding: 12px 13px; border-radius: var(--radius-md); cursor: pointer;
  background: var(--input-bg); border: 1px solid var(--input-border);
  display: flex; flex-direction: column; gap: 6px;
}
.sa-type.sel {
  border-color: transparent;
  background:
    linear-gradient(var(--glass-strong), var(--glass-strong)) padding-box,
    linear-gradient(135deg,#E8A317,#C42222) border-box;
  border: 1.5px solid transparent;
}
.sa-type-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sa-type-name { font-weight: 700; font-size: 14px; line-height: 1.25; }
.sa-type-desc { font-size: 12px; color: var(--text-dim); line-height: 1.35;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden; }

/* ============================================================
   Profiles — Phase 10
   ============================================================ */
.tap { cursor: pointer; }
.tap:hover { text-decoration: underline; }
.avatar.tap:hover { text-decoration: none; opacity: .9; }

.prof-header { padding: 22px 20px; margin-bottom: 18px; text-align: center; }
.prof-avatar {
  width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 30px; color: #fff;
  background: linear-gradient(135deg, var(--red-bright), var(--red-deep)); overflow: hidden;
}
.prof-avatar img { width: 100%; height: 100%; object-fit: cover; }
.prof-name { font-family: var(--font-display); font-size: 23px; font-weight: 700; margin: 0 0 4px; }
.prof-sub { color: var(--text-dim); font-size: 14px; margin: 0 0 12px; }
.badges { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.badge { font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 999px; }
.badge.admin { color: #fff; background: linear-gradient(135deg,var(--red-bright),var(--red-deep)); }
.badge.sup { color: var(--token-blue); background: rgba(43,108,176,.14); }
.badge.emp { color: var(--text-dim); background: var(--input-bg); }
.prof-stats { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.prof-stat { background: var(--input-bg); border-radius: var(--radius-md); padding: 10px 16px; min-width: 92px; }
.prof-stat .v { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.prof-stat .l { font-size: 11px; color: var(--text-faint); }
.prof-switch { display: inline-flex; gap: 8px; margin-top: 14px; }
.prof-switch a { text-decoration: none; }

.back-btn { background: none; border: none; cursor: pointer; font-size: 15px; color: var(--text); display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; }

/* Supervisor awarded-out */
.sup-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; margin-bottom: 16px; align-items: center; }
.sup-filters select { font: inherit; font-size: 13px; font-weight: 600; color: var(--text); background: var(--input-bg);
  border: 1px solid var(--input-border); border-radius: 999px; padding: 8px 12px; outline: none; cursor: pointer; }
.sup-filters .tb-label { font-size: 12px; font-weight: 600; color: var(--text-faint); }

.awarded-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 13px 14px; align-items: center; }
.awarded-row + .awarded-row { border-top: 1px solid var(--glass-border); }
.awarded-row .ar-who { font-weight: 600; font-size: 14px; }
.awarded-row .ar-meta { font-size: 12px; color: var(--text-faint); }
.awarded-row .ar-amt { font-weight: 700; font-size: 13px; text-align: right; white-space: nowrap; }
.awarded-row .ar-date { font-size: 11px; color: var(--text-faint); text-align: right; }
@media (min-width: 640px) { .awarded-row { grid-template-columns: 1.4fr 1fr auto auto; } .awarded-row .ar-date { min-width: 90px; } }

/* ============================================================
   Metrics + Pickups — Phase 11
   ============================================================ */
.mbar-row { display: grid; grid-template-columns: 150px 1fr 110px; align-items: center; gap: 12px; padding: 9px 4px; }
.mbar-row + .mbar-row { border-top: 1px solid var(--glass-border); }
.mbar-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbar-name a { color: var(--text); text-decoration: none; }
.mbar-name a:hover { color: var(--red-bright); text-decoration: underline; }
.mbar-track { height: 22px; background: var(--input-bg); border-radius: 999px; overflow: hidden; }
.mbar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--red-bright), var(--red-deep)); min-width: 3px; transition: width .4s ease; }
.mbar-val { text-align: right; font-size: 13px; }
.mbar-val b { font-family: var(--font-display); }
.mbar-val .sub { color: var(--text-faint); font-size: 11px; }

.color-bars { display: flex; flex-direction: column; gap: 10px; padding: 4px; }
.cbar { display: grid; grid-template-columns: 74px 1fr 46px; align-items: center; gap: 10px; }
.cbar .cn { font-size: 13px; font-weight: 600; }
.cbar .ct { height: 16px; background: var(--input-bg); border-radius: 999px; overflow: hidden; }
.cbar .cf { height: 100%; border-radius: 999px; }
.cf.red { background: var(--token-red); } .cf.yellow { background: var(--token-yellow); }
.cf.blue { background: var(--token-blue); } .cf.platinum { background: var(--token-platinum); }
.cbar .cv { text-align: right; font-weight: 700; font-size: 13px; }

/* ============================================================
   QA polish — Phase 13
   ============================================================ */
.header-actions { display: flex; gap: 8px; align-items: center; }
.hact { width: auto; padding: 9px 14px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.hact .hic { display: none; font-size: 16px; line-height: 1; }
@media (max-width: 480px) {
  .header-actions { gap: 6px; }
  .hact { padding: 9px; }
  .hact .lbl { display: none; }
  .hact .hic { display: inline; }
  .app-header .title { font-size: 17px; }
}

/* ============================================================
   Welcome tutorial + avatar upload — Phase 14
   ============================================================ */
.tut-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.tut-backdrop.open { display: flex; animation: fadeIn .2s ease; }
.tut-card {
  width: 100%; max-width: 420px;
  padding: 30px 26px 24px; text-align: center;
  position: relative;
}
.tut-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; font-size: 22px; color: var(--text-dim); cursor: pointer;
}
.tut-icon { font-size: 54px; margin-bottom: 10px; line-height: 1; }
.tut-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin: 0 0 10px; }
.tut-body { color: var(--text-dim); font-size: 15px; line-height: 1.55; margin: 0 0 22px; min-height: 84px; }
.tut-body b { color: var(--text); }
.tut-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.tut-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--input-border); transition: .2s; }
.tut-dots span.on { width: 20px; border-radius: 6px; background: var(--red-bright); }
.tut-nav { display: flex; gap: 10px; }
.tut-nav .btn { flex: 1; }

/* avatar upload badge */
.avatar-cam {
  position: absolute; right: -2px; bottom: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--red-bright), var(--red-deep));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer; border: 2px solid var(--bg);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

/* ============================================================
   Input contrast — app-wide legibility (Phase 15)
   Guarantees typed text, placeholders, dropdown options and
   autofilled values are readable in both light and dark themes.
   ============================================================ */
input, select, textarea, button { color: var(--text); }

/* Typed text always uses full-strength theme text colour */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  color: var(--text);
  -webkit-text-fill-color: var(--text);
}

/* Placeholders: dim but clearly legible (not the near-invisible default) */
input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
  -webkit-text-fill-color: var(--text-faint);
  opacity: 1;
}

/* Native dropdown option lists — force solid, legible colours per theme
   (translucent select backgrounds don't carry into the popup list) */
select option,
select optgroup {
  background-color: var(--option-bg);
  color: var(--option-fg);
}

/* Selected value shown in a closed <select> */
select:required:invalid { color: var(--text-faint); }   /* empty-state placeholder-style */
select { text-shadow: none; }

/* Browser autofill: keep text visible and background on-theme */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--autofill-bg) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-out 0s;
}

/* Disabled fields still readable, just muted */
input:disabled, select:disabled, textarea:disabled { color: var(--text-dim); -webkit-text-fill-color: var(--text-dim); opacity: 1; }

/* ============================================================
   Settings restructure — Phase 16 (tabs + collapsible sections)
   ============================================================ */
.admin-back { margin-right: 6px; font-size: 14px; }
details.acc {
  margin-bottom: 14px;
  padding: 0;
  overflow: hidden;
}
details.acc > summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px;
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
}
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after {
  content: '⌄'; font-size: 20px; color: var(--text-dim);
  transition: transform .2s; line-height: 1;
}
details.acc[open] > summary::after { transform: rotate(180deg); }
details.acc > summary:hover { color: var(--red-bright); }
.acc-body { padding: 0 18px 18px; }
.acc-body .panel-head { padding: 6px 0 12px; }

/* ============================================================
   No mobile zoom (Phase 17)
   Prevents double-tap-to-zoom and iOS text auto-resize.
   Pinch/focus zoom is disabled via the viewport meta.
   ============================================================ */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { touch-action: manipulation; }
button, a, input, select, textarea, label, .act, .bottom-nav a, .admin-nav-link, .tap { touch-action: manipulation; }

/* ============================================================
   Award tabs + people search (Phase 20)
   ============================================================ */
.award-body .seg { width: 100%; }
.award-body .seg button { flex: 1; }

.people-search { position: relative; margin-bottom: 14px; }
.people-search input {
  width: 100%; font: inherit; font-size: 14px; color: var(--text);
  background: var(--glass); backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border); border-radius: 999px; padding: 12px 16px; outline: none;
}
.people-search input:focus-visible { border-color: var(--input-focus); }
.people-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 25;
  display: none; flex-direction: column; gap: 2px; padding: 6px;
  max-height: 320px; overflow-y: auto;
  border-radius: var(--radius-md);
  background: var(--glass-strong); backdrop-filter: blur(var(--blur)) saturate(160%);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow-glass);
}
.people-results.open { display: flex; }
.people-results a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: var(--radius-sm); text-decoration: none; color: var(--text);
}
.people-results a:hover { background: var(--input-bg); }
.people-results .avatar { width: 32px; height: 32px; font-size: 12px; }
.people-results .pn { font-weight: 600; font-size: 14px; }
.people-results .pe { font-size: 12px; color: var(--text-faint); }
