/* glomVPN partner panel — brand: warm paper + ember orange */
:root {
  --bg: #fbf7f1;
  --surface: #ffffff;
  --surface-2: #f6efe6;
  --ink: #1d1712;
  --ink-2: #5e5249;
  --ink-3: #9a8d82;
  --line: #ece2d6;
  --ember: #ff6a14;
  --ember-2: #ff9a3d;
  --ember-soft: #fff0e4;
  --ember-ink: #b6430a;
  --good: #1f9d63;
  --good-soft: #e5f6ee;
  --bad: #d64232;
  --bad-soft: #fde9e6;
  --radius: 18px;
  --radius-s: 12px;
  --shadow: 0 1px 0 rgba(60, 35, 10, .04), 0 8px 24px -12px rgba(120, 60, 10, .18);
  --tabs-h: 64px;
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 500 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, textarea, select { font: inherit; color: inherit; }
b, strong { font-weight: 700; }

/* ---------- header */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px 10px;
  background: linear-gradient(var(--bg) 70%, rgba(251, 247, 241, 0));
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand b { color: var(--ember); font-weight: 800; }
.brand small {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ember-ink); background: var(--ember-soft); padding: 3px 7px; border-radius: 999px;
}
.brand-mark {
  width: 22px; height: 22px; border-radius: 7px;
  background: radial-gradient(circle at 35% 35%, #ffd2a8 0 18%, var(--ember-2) 40%, var(--ember) 75%);
  box-shadow: 0 0 0 3px var(--ember-soft);
}
.bot-switch {
  display: flex; align-items: center; gap: 6px; max-width: 55%;
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 12px; font-weight: 600; font-size: 13px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bot-switch::after { content: "▾"; color: var(--ink-3); }

/* ---------- layout */
.view { padding: 4px 16px calc(var(--tabs-h) + 28px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
.section-title { margin: 22px 2px 10px; font-size: 13px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 12px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack > * + * { margin-top: 10px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- hero */
.hero {
  position: relative; overflow: hidden; border: 0; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #ffb15c 0%, var(--ember) 45%, #e04d05 100%);
  box-shadow: 0 14px 30px -14px rgba(224, 77, 5, .65);
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 70%);
}
.hero .label { font-size: 13px; font-weight: 600; opacity: .9; }
.hero .big { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 6px; }
.hero .sub { font-size: 13px; opacity: .92; }
.hero .status-pill { background: rgba(255, 255, 255, .22); color: #fff; }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 14px 0 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px; }
.kpi .k { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.kpi .v { font-size: 20px; font-weight: 800; letter-spacing: -.01em; margin-top: 2px; }
.kpi .d { font-size: 12px; color: var(--ink-2); }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; background: var(--good-soft); color: var(--good);
}
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill.off { background: var(--surface-2); color: var(--ink-2); }
.status-pill.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- chart */
.chart { width: 100%; height: 150px; display: block; margin-top: 8px; }
.chart .bar { fill: var(--ember); }
.chart .bar.zero { fill: var(--line); }
.chart .axis { fill: var(--ink-3); font-size: 10px; font-family: var(--font); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); margin-top: 4px; }

/* ---------- progress */
.progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 10px 0 6px; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--ember-2), var(--ember)); }
.level-on { background: linear-gradient(135deg, #fff6ec, #ffe6cf); border-color: #ffd2ad; }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 13px 16px; font-weight: 700; cursor: pointer;
  background: var(--ember); color: #fff; width: 100%; min-height: 48px;
  box-shadow: 0 8px 18px -10px rgba(255, 106, 20, .9);
  transition: transform .08s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.dark { background: var(--ink); box-shadow: none; }
.btn.danger { background: var(--bad-soft); color: var(--bad); box-shadow: none; }
.btn.small { width: auto; min-height: 36px; padding: 8px 12px; border-radius: 11px; font-size: 13px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.link-btn { background: none; border: 0; color: var(--ember-ink); font-weight: 700; padding: 6px 0; cursor: pointer; }

/* ---------- forms */
.field { display: block; }
.field + .field { margin-top: 12px; }
.field > span { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 0 2px 6px; }
.input, textarea.input {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 13px;
  padding: 12px 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; min-height: 92px; }
.input:focus { border-color: var(--ember); box-shadow: 0 0 0 4px var(--ember-soft); }
.input.err { border-color: var(--bad); }
.hint { font-size: 12px; color: var(--ink-3); margin: 6px 2px 0; }
.hint.err { color: var(--bad); }
.hint.good { color: var(--good); }
.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.amounts .chip { text-align: center; padding: 10px 0; }

/* list rows */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; }
.item + .item { border-top: 1px solid var(--line); }
.item .main { flex: 1; min-width: 0; }
.item .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .r { text-align: right; font-weight: 700; white-space: nowrap; }
.item .s.wrap { white-space: normal; }
.item.tap { cursor: pointer; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--ink-3); }
.item .r.plus { color: var(--good); }
.item .r.minus { color: var(--ink); }
.avatar {
  flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  background: var(--ember-soft); color: var(--ember-ink); font-weight: 800;
}

/* switch */
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #e3d8cc; transition: background .2s; }
.switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s;
}
.switch input:checked + i { background: var(--ember); }
.switch input:checked + i::after { transform: translateX(18px); }

/* segmented sub-tabs */
.seg { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 14px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 1 0 auto; border: 0; background: none; padding: 8px 6px; border-radius: 11px;
  font-weight: 700; font-size: 13px; color: var(--ink-2); cursor: pointer;
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(60, 35, 10, .12); }

.post { white-space: pre-wrap; font-size: 14px; line-height: 1.5; }
.empty { text-align: center; padding: 28px 16px; color: var(--ink-3); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* sticky save bar */
.savebar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding: 10px 16px; background: linear-gradient(rgba(251, 247, 241, 0), var(--bg) 35%); z-index: 6;
}
.savebar .btn { max-width: 608px; margin: 0 auto; display: flex; }

/* ---------- bottom tabs */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 7;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.tabs button {
  border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 11px; font-weight: 700; color: var(--ink-3); cursor: pointer;
}
.tabs button.active { color: var(--ember); }
.ic { width: 24px; height: 24px; display: block; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.ic-home { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
.ic-bot { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='8' width='16' height='12' rx='3'/%3E%3Cpath d='M12 4v4M9 13h.01M15 13h.01M9 17h6'/%3E%3C/svg%3E"); }
.ic-money { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='6' width='18' height='13' rx='3'/%3E%3Cpath d='M3 10h18M16 15h2'/%3E%3C/svg%3E"); }
.ic-users { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20c.6-3.4 3.3-5.5 6.5-5.5s5.9 2.1 6.5 5.5M16 4.8a3.5 3.5 0 0 1 0 6.4M18.5 14.8c1.7.8 2.8 2.6 3 5.2'/%3E%3C/svg%3E"); }

/* ---------- sheet & toast */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(29, 23, 18, .38); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-card {
  width: 100%; max-width: 640px; max-height: 88vh; overflow: auto; background: var(--bg);
  border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  animation: up .2s ease-out;
}
.sheet-card h3 { margin: 0 0 12px; font-size: 18px; }
@keyframes up { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.toast {
  position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
  z-index: 30; max-width: 90vw; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .5);
}
.toast[hidden] { display: none; }

.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, #f1e9df 0%, #f8f2ea 50%, #f1e9df 100%); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.gate { text-align: center; padding: 60px 20px; }
.gate .brand-mark { width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 16px; display: block; }
.gate h2 { margin: 0 0 8px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
