/* ============================================================
   MageTool V2 — Tibia Mage Toolkit
   Theme: deep navy night + vibrant orange (app-style)
   ============================================================ */

:root {
  /* surfaces */
  --bg:            #0f100e;
  --bg-grad-1:     #161814;
  --bg-grad-2:     #0a0b09;
  --surface:       rgba(28, 30, 26, 0.95);
  --surface-solid: #1b1d19;
  --surface-2:     rgba(41, 44, 38, 0.95);
  --surface-hi:    rgba(255, 255, 255, 0.05);
  --inset:         rgba(12, 13, 11, 0.8);

  /* lines */
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-accent: rgba(201, 242, 74, 0.4);

  /* text */
  --text:          #f4f5f0;
  --text-muted:    #b3b8ab;
  --text-dim:      #80867a;

  /* accents */
  --accent:        #c9f24a;
  --accent-2:      #a8e02e;
  --accent-soft:   rgba(201, 242, 74, 0.14);
  --gold:          #ffc95c;
  --gold-soft:     rgba(255, 201, 92, 0.14);
  --green:         #9be15d;
  --green-soft:    rgba(155, 225, 93, 0.14);
  --red:           #ff6473;
  --purple:        #d9a7f7;
  --purple-soft:   rgba(217, 167, 247, 0.16);
  --cyan:          #5ad4e6;

  --radius:        22px;
  --radius-sm:     14px;
  --radius-xs:     10px;
  --shadow:        0 24px 60px -28px rgba(0,0,0,0.85);
  --shadow-sm:     0 10px 30px -18px rgba(0,0,0,0.8);
  --t:             0.22s cubic-bezier(.4,0,.2,1);

  --font-display: 'Outfit', system-ui, sans-serif;
  --font-ui: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(1100px 700px at 15% -10%, #191c14 0%, transparent 55%),
    radial-gradient(900px 700px at 100% 0%, #17181a 0%, transparent 50%),
    linear-gradient(160deg, var(--bg-grad-1) 0%, var(--bg) 45%, var(--bg-grad-2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
::selection { background: var(--accent-soft); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

/* ============================================================
   APP SHELL — app-style: top header + bottom dock
   ============================================================ */
.app { display: block; min-height: 100vh; }
.main {
  max-width: 1120px; margin: 0 auto; min-width: 0;
  display: flex; flex-direction: column; min-height: 100vh;
  padding-bottom: 108px; /* dock clearance */
}

/* ---------- header ---------- */
.apphead {
  display: flex; align-items: center; gap: 14px;
  padding: 22px 28px 12px;
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(180deg, rgba(11,16,36,0.92) 62%, rgba(11,16,36,0));
  backdrop-filter: blur(6px);
}
.ah-ava {
  width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(150deg, var(--accent), #9edb2b);
  display: grid; place-items: center; color: #171b06;
  font-family: var(--font-display); font-weight: 800; font-size: 20px;
  box-shadow: 0 10px 24px -8px rgba(201,242,74,0.65);
  border: none; transition: var(--t);
}
.ah-ava:hover { transform: translateY(-1px) scale(1.03); }
.greet { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.greet small { color: var(--text-dim); font-weight: 600; font-size: 12px; letter-spacing: .02em; text-transform: capitalize; }
.greet b { font-family: var(--font-display); font-weight: 700; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.greet b span { color: var(--accent); }
.topbar-spacer { flex: 1; }

.voc-switch { display: inline-flex; background: var(--inset); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.voc-opt { padding: 7px 13px; border-radius: 999px; font-weight: 700; font-size: 12px; color: var(--text-dim); background: none; border: none; transition: var(--t); }
.voc-opt:hover { color: var(--text); }
.voc-switch.sorcerer .voc-opt.active { background: linear-gradient(150deg, var(--accent), #9edb2b); color: #171b06; }
.voc-switch.druid .voc-opt.active { background: linear-gradient(150deg, var(--green), #22a45f); color: #06281a; }

.tc-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--gold-soft); border: 1px solid rgba(255,201,92,0.3);
  border-radius: 999px; padding: 9px 14px; color: var(--gold); font-weight: 700; font-size: 13px;
}
.tc-chip svg { width: 15px; height: 15px; }
.tc-chip input {
  width: 52px; background: rgba(0,0,0,0.25); border: 1px solid rgba(255,201,92,0.25);
  border-radius: 8px; color: var(--gold); padding: 4px 6px; font-weight: 700; text-align: right; outline: none;
}

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
  display: grid; place-items: center; transition: var(--t); position: relative; flex: 0 0 auto;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 19px; height: 19px; }
.notif-badge {
  position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 800; display: grid; place-items: center;
  border: 2px solid var(--bg); line-height: 1;
}
.notif-badge[hidden] { display: none; }

/* ---------- pages ---------- */
.pages { padding: 6px 28px 30px; flex: 1; }
.page { display: none; }
.page.active { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: .4; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; }
.page-head p { color: var(--text-muted); font-size: 14px; margin-top: 4px; max-width: 60ch; }

/* ============================================================
   BOTTOM DOCK
   ============================================================ */
.dock {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(15, 16, 14, 0.97);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(22px);
  display: grid; grid-template-columns: 1fr 1fr auto 1fr 1fr;
  align-items: center; gap: 2px;
  max-width: 100%; margin: 0 auto;
  padding: 9px max(18px, calc((100% - 560px) / 2)) calc(9px + env(safe-area-inset-bottom));
  z-index: 90;
}
.dock-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; color: var(--text-dim);
  padding: 7px 4px; border-radius: 16px; transition: var(--t);
  font-size: 10.5px; font-weight: 700; letter-spacing: .01em;
}
.dock-btn svg { width: 22px; height: 22px; }
.dock-btn:hover { color: var(--text-muted); }
.dock-btn.active { color: var(--accent); }
.dock-btn.active svg { filter: drop-shadow(0 4px 10px rgba(201,242,74,0.55)); }
.dock-fab {
  width: 54px; height: 54px; border-radius: 50%;
  margin-top: -30px; justify-self: center;
  background: linear-gradient(150deg, var(--accent), #9edb2b);
  border: 4px solid var(--bg); color: #171b06;
  display: grid; place-items: center; transition: var(--t);
  box-shadow: 0 14px 30px -8px rgba(201,242,74,0.75);
}
.dock-fab svg { width: 24px; height: 24px; }
.dock-fab:hover { transform: translateY(-3px) scale(1.05); }

/* ============================================================
   BOTTOM SHEET
   ============================================================ */
.sheet-back {
  position: fixed; inset: 0; background: rgba(5,8,20,0.7); backdrop-filter: blur(4px);
  display: none; align-items: flex-end; justify-content: center; z-index: 110;
}
.sheet-back.open { display: flex; }
.sheet {
  width: min(560px, 100%); max-height: 82vh; overflow-y: auto;
  background: var(--surface-solid); border: 1px solid var(--border-strong); border-bottom: none;
  border-radius: 26px 26px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  animation: sheetUp .28s cubic-bezier(.3,1,.4,1);
}
@keyframes sheetUp { from { transform: translateY(60%); opacity: .5; } to { transform: none; opacity: 1; } }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 6px auto 14px; }
.sheet h3 { font-size: 17px; margin-bottom: 14px; }
.sheet-item {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: var(--inset); border: 1px solid var(--border); border-radius: 16px;
  padding: 14px 16px; margin-bottom: 8px; color: var(--text);
  transition: var(--t); text-align: left;
}
.sheet-item:hover { border-color: var(--border-accent); transform: translateY(-1px); }
.sheet-item .si-ic {
  width: 42px; height: 42px; border-radius: 13px; flex: 0 0 auto;
  display: grid; place-items: center; color: #fff;
}
.sheet-item .si-ic svg { width: 20px; height: 20px; }
.sheet-item b { font-size: 14px; display: block; }
.sheet-item small { color: var(--text-dim); font-size: 12px; font-weight: 500; }
.sheet-item .si-arrow { margin-left: auto; color: var(--text-dim); }
.sheet-item .si-arrow svg { width: 17px; height: 17px; }

/* ============================================================
   NOTIFICATIONS
   ============================================================ */
.notif-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--inset); border: 1px solid var(--border); border-radius: 16px;
  padding: 14px 16px; margin-bottom: 8px;
}
.notif-card .nc-ic {
  width: 40px; height: 40px; border-radius: 13px; flex: 0 0 auto;
  display: grid; place-items: center; color: #171b06;
  background: linear-gradient(150deg, var(--accent), #9edb2b);
}
.notif-card .nc-ic.green { background: linear-gradient(150deg, var(--green), #6db93a); }
.notif-card .nc-ic.gold { background: linear-gradient(150deg, var(--gold), #d99e3e); color: #3a2400; }
.notif-card .nc-ic.purple { background: linear-gradient(150deg, var(--purple), #b57ee0); color: #241333; }
.notif-card .nc-ic.red { background: linear-gradient(150deg, var(--red), #d43a52); color: #fff; }
.notif-card .nc-ic svg { width: 19px; height: 19px; }
.notif-card b { font-size: 13.5px; display: block; margin-bottom: 2px; }
.notif-card p { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.notif-card p b { display: inline; font-size: inherit; }

/* push-style banner shown on app open */
.push-banner {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%) translateY(-130%);
  width: min(480px, calc(100% - 24px)); z-index: 300;
  background: rgba(24, 26, 21, 0.97); border: 1px solid var(--border-strong);
  border-radius: 20px; padding: 14px 16px;
  display: flex; gap: 13px; align-items: flex-start;
  box-shadow: 0 24px 60px -18px rgba(0,0,0,0.9);
  backdrop-filter: blur(18px);
  transition: transform .45s cubic-bezier(.3,1,.4,1);
  cursor: pointer;
}
.push-banner.show { transform: translateX(-50%) translateY(0); }
.push-banner .pb-ic {
  width: 40px; height: 40px; border-radius: 13px; flex: 0 0 auto;
  background: linear-gradient(150deg, var(--accent), #9edb2b);
  display: grid; place-items: center; color: #171b06;
}
.push-banner .pb-ic svg { width: 19px; height: 19px; }
.push-banner b { font-size: 13.5px; display: block; }
.push-banner p { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.45; }
.push-banner p b { display: inline; font-size: inherit; color: var(--gold); }
.push-banner .pb-x { margin-left: auto; flex: 0 0 auto; background: none; border: none; color: var(--text-dim); padding: 2px; }
.push-banner .pb-x svg { width: 16px; height: 16px; }

/* ============================================================
   GENERIC COMPONENTS (shared with inner pages)
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.card-h h3 { font-size: 16px; }
.card-h .sub { color: var(--text-dim); font-size: 12.5px; font-weight: 600; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: var(--surface-hi); color: var(--text-muted); border: 1px solid var(--border);
}
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: var(--border-accent); }
.pill.gold   { background: var(--gold-soft); color: var(--gold); border-color: rgba(255,201,92,0.3); }
.pill.green  { background: var(--green-soft); color: var(--green); border-color: rgba(155,225,93,0.3); }
.pill.purple { background: var(--purple-soft); color: var(--purple); border-color: rgba(139,125,255,0.3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 14px; font-weight: 700; font-size: 14px;
  border: 1px solid transparent; transition: var(--t); color: #171b06;
  background: linear-gradient(150deg, var(--accent), #9edb2b);
  box-shadow: 0 12px 26px -14px rgba(201,242,74,0.9);
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn svg { width: 17px; height: 17px; }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: none; }
.btn.ghost:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn.gold { background: linear-gradient(150deg, var(--gold), #d99e3e); color: #3a2400; box-shadow: 0 12px 26px -14px rgba(255,201,92,0.7); }
.btn.danger { background: transparent; color: var(--red); border-color: rgba(255,100,115,0.4); box-shadow: none; }
.btn.danger:hover { background: rgba(255,100,115,0.12); }
.btn.sm { padding: 8px 13px; font-size: 13px; border-radius: 11px; }
.btn.block { width: 100%; }

.chip-btn {
  padding: 7px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); transition: var(--t);
}
.chip-btn:hover { color: var(--text); border-color: var(--border-strong); }
.chip-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* forms */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-muted); margin-bottom: 7px; }
.field .hint { font-size: 11.5px; color: var(--text-dim); margin-top: 5px; font-weight: 500; }
.hint { font-size: 11.5px; color: var(--text-dim); margin-top: 5px; font-weight: 500; }
.inp, .sel, textarea.inp {
  width: 100%; background: var(--inset); border: 1px solid var(--border);
  border-radius: 13px; padding: 12px 14px; color: var(--text); font-size: 14px; font-weight: 600;
  transition: var(--t); outline: none;
}
.inp:focus, .sel:focus, textarea.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inp::placeholder { color: var(--text-dim); font-weight: 500; }
textarea.inp { resize: vertical; min-height: 70px; line-height: 1.5; }
.inp-wrap { position: relative; display: flex; align-items: center; }
.inp-suffix { position: absolute; right: 14px; color: var(--text-dim); font-size: 12.5px; font-weight: 700; pointer-events: none; }
.inp-prefix { position: absolute; left: 14px; color: var(--text-dim); font-size: 13px; font-weight: 700; pointer-events: none; }
.inp.has-prefix { padding-left: 34px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* metrics */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 14px; }
.metric {
  background: var(--inset); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px 18px; position: relative; overflow: hidden;
}
.metric::before { content:''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--border-strong); }
.metric.accent::before { background: var(--accent); }
.metric.gold::before { background: var(--gold); }
.metric.green::before { background: var(--green); }
.metric.red::before { background: var(--red); }
.metric.purple::before { background: var(--purple); }
.metric .ml { font-size: 11.5px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }
.metric .mv { font-family: var(--font-display); font-weight: 800; font-size: 24px; margin-top: 6px; }
.metric .ms { font-size: 11.5px; color: var(--text-dim); margin-top: 5px; font-weight: 500; }

/* values */
.v-gold { color: var(--gold); }
.v-tc   { color: var(--gold); }
.v-green{ color: var(--green); }
.v-red  { color: var(--red); }
.v-ml   { color: var(--purple); }
.v-accent { color: var(--accent); }

/* item sprite */
.sprite {
  width: 40px; height: 40px; border-radius: 10px; object-fit: contain;
  background: var(--inset); border: 1px solid var(--border); flex: 0 0 auto; padding: 3px;
  image-rendering: -webkit-optimize-contrast;
}
.sprite.lg { width: 52px; height: 52px; }
.sprite.sm { width: 32px; height: 32px; border-radius: 8px; }

/* scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); background-clip: padding-box; }

/* modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(4,7,18,0.7); backdrop-filter: blur(4px);
  display: none; align-items: flex-start; justify-content: center; z-index: 100; padding: 40px 18px; overflow-y: auto;
}
.modal-back.open { display: flex; }
.modal {
  width: 100%; max-width: 760px; background: #1b1d18; border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow); animation: pop .25s ease; margin: 0 auto;
}
.modal.sm { max-width: 460px; }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity:1; transform: none; } }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-h h3 { font-size: 18px; }
.modal-b { padding: 22px 24px; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--border); }
.x-btn { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-hi); border: 1px solid var(--border); color: var(--text-muted); display: grid; place-items: center; transition: var(--t); }
.x-btn:hover { color: var(--text); background: var(--accent-soft); }
.x-btn svg { width: 17px; height: 17px; }

/* toast */
.toast-wrap { position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #22251e; border: 1px solid var(--border-strong); color: var(--text);
  padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 9px; animation: pop .2s ease;
}
.toast.ok { border-color: rgba(155,225,93,0.5); }
.toast.ok b { color: var(--green); }
.toast svg { width: 17px; height: 17px; color: var(--accent); }

/* empty state */
.empty { text-align: center; padding: 48px 20px; color: var(--text-dim); }
.empty svg { width: 38px; height: 38px; opacity: .5; margin-bottom: 12px; }
.empty p { font-size: 14px; max-width: 40ch; margin: 0 auto; }

/* helpers */
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.mono { font-family: var(--font-mono); }
.stack { display: flex; flex-direction: column; }
.gap5 { gap: 5px; } .gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap14 { gap: 14px; } .gap16 { gap: 16px; } .gap20 { gap: 20px; }
.mt2 { margin-top: 2px; } .mt8 { margin-top: 8px; } .mt10 { margin-top: 10px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb10 { margin-bottom: 10px; } .mb12 { margin-bottom: 12px; } .mb14 { margin-bottom: 14px; } .mb16 { margin-bottom: 16px; }
.tac { text-align: center; } .tar { text-align: right; }
.fz10 { font-size: 10px; } .fz11 { font-size: 11px; } .fz12 { font-size: 12px; } .fz13 { font-size: 13px; } .fz16 { font-size: 16px; } .fz18 { font-size: 18px; } .fz20 { font-size: 20px; } .fz24 { font-size: 24px; }
.fw700 { font-weight: 700; } .fw800 { font-weight: 800; }
.grow { flex: 1; min-width: 0; }

.install-btn { position: fixed; right: 16px; bottom: 96px; z-index: 90; display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; color: #fff; border: none;
  background: linear-gradient(150deg, var(--accent), #9edb2b); box-shadow: 0 14px 30px -12px rgba(201,242,74,0.9); transition: var(--t); }
.install-btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.install-btn svg { width: 18px; height: 18px; }
.install-btn[hidden] { display: none; }
.sql-box { background: var(--inset); border: 1px solid var(--border); border-radius: 12px; padding: 14px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.6; color: var(--text-muted); white-space: pre-wrap; overflow-x: auto; }

/* ============================================================
   V2 HOME
   ============================================================ */
.home-hero-ring {
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface) 60%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; display: flex; gap: 26px; align-items: center; flex-wrap: wrap;
  cursor: pointer; transition: var(--t); position: relative; overflow: hidden;
}
.home-hero-ring:hover { border-color: var(--border-accent); transform: translateY(-2px); }
.ring-wrap { position: relative; width: 148px; height: 148px; flex: 0 0 auto; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring-center .rc-pct { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1; }
.ring-center .rc-lbl { font-size: 10.5px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }

.today-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.today-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 16px 18px; transition: var(--t); cursor: pointer; position: relative; overflow: hidden;
}
.today-card:hover { border-color: var(--border-accent); transform: translateY(-2px); }
.today-card .tc-lbl { font-size: 11px; font-weight: 800; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 6px; }
.today-card .tc-lbl svg { width: 14px; height: 14px; }
.today-card .tc-val { font-family: var(--font-display); font-weight: 800; font-size: 24px; margin-top: 7px; }
.today-card .tc-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; font-weight: 500; }

.home-notif-banner {
  display: flex; gap: 14px; align-items: center;
  background: linear-gradient(140deg, rgba(201,242,74,0.16), rgba(201,242,74,0.05));
  border: 1px solid var(--border-accent); border-radius: 18px;
  padding: 15px 18px; margin-bottom: 14px; cursor: pointer; transition: var(--t);
}
.home-notif-banner:hover { transform: translateY(-1px); border-color: var(--accent); }
.home-notif-banner .hb-ic {
  width: 42px; height: 42px; border-radius: 14px; flex: 0 0 auto;
  background: linear-gradient(150deg, var(--accent), #9edb2b); color: #171b06;
  display: grid; place-items: center;
  box-shadow: 0 10px 22px -8px rgba(201,242,74,0.7);
}
.home-notif-banner .hb-ic svg { width: 20px; height: 20px; }
.home-notif-banner b { font-size: 14px; display: block; }
.home-notif-banner p { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.45; }
.home-notif-banner p b { display: inline; font-size: inherit; color: var(--gold); }
.home-notif-banner.done { background: linear-gradient(140deg, rgba(155,225,93,0.14), rgba(155,225,93,0.04)); border-color: rgba(155,225,93,0.4); }
.home-notif-banner.done .hb-ic { background: linear-gradient(150deg, var(--green), #6db93a); box-shadow: 0 10px 22px -8px rgba(155,225,93,0.55); }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tool-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 16px; text-align: left; transition: var(--t); color: var(--text);
  display: flex; flex-direction: column; gap: 11px;
}
.tool-card:hover { border-color: var(--border-accent); transform: translateY(-2px); }
.tool-card .tg-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #fff; }
.tool-card .tg-ic svg { width: 20px; height: 20px; }
.tool-card b { font-size: 13.5px; }
.tool-card small { color: var(--text-dim); font-size: 11.5px; font-weight: 500; line-height: 1.4; }

.recent-log {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 13px 16px; margin-bottom: 8px; transition: var(--t); color: var(--text);
}
.recent-log:hover { border-color: var(--border-accent); transform: translateY(-1px); }
.recent-log .rl-ic { width: 38px; height: 38px; border-radius: 12px; flex: 0 0 auto; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.recent-log .rl-ic svg { width: 18px; height: 18px; }
.recent-log b { font-size: 13.5px; display: block; }
.recent-log small { color: var(--text-dim); font-size: 11.5px; font-weight: 500; }

.home-grid { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1000px) {
  .home-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .apphead { padding: 14px 16px 8px; gap: 10px; }
  .greet b { font-size: 16.5px; }
  .greet small { font-size: 10.5px; }
  .tc-chip { display: none; }
  .voc-opt { padding: 6px 10px; font-size: 11.5px; }
  .ah-ava { width: 40px; height: 40px; font-size: 17px; }
  .icon-btn { width: 40px; height: 40px; }

  .pages { padding: 4px 14px 28px; }
  .page-head { margin-bottom: 16px; }
  .page-head h1 { font-size: 22px; }
  .page-head p { font-size: 12.5px; }
  .page-head .btn { padding: 9px 14px; font-size: 13px; }

  .main { padding-bottom: 96px; }

  .modal-back { padding: 0; align-items: stretch; }
  .modal { max-width: 100%; min-height: 100%; border-radius: 0; border-left: none; border-right: none; margin: 0; }
  .modal.sm { min-height: auto; margin: auto; max-width: 100%; border-radius: var(--radius); }
  .modal-h { padding: 16px 18px; position: sticky; top: 0; background: #1b1d18; z-index: 2; }
  .modal-b { padding: 18px; }
  .modal-f { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); position: sticky; bottom: 0; background: #1b1d18; }

  .grid-2 { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .detail-grid, .two-col, .builder-layout { grid-template-columns: 1fr !important; }

  .home-hero-ring { padding: 18px; gap: 18px; }
  .ring-wrap { width: 118px; height: 118px; }
  .ring-center .rc-pct { font-size: 24px; }
  .today-cards { grid-template-columns: 1fr 1fr; }
  .tool-grid { grid-template-columns: 1fr 1fr; }

  .sets-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .sc-actions { opacity: 1; transform: none; }
  .ss-stats { grid-template-columns: 1fr 1fr; }
  .ss-totals { grid-template-columns: 1fr; gap: 8px; }
  .resist-row { grid-template-columns: 56px 1fr 42px; }

  .install-btn { right: 12px; bottom: 96px; padding: 10px 14px; font-size: 13px; }
}

@media (max-width: 420px) {
  .sets-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .today-cards { grid-template-columns: 1fr; }
}

/* orange stat tile (reference style) */
.today-card.hot {
  background: linear-gradient(150deg, #d3f55f, #b3e838);
  border-color: transparent;
  box-shadow: 0 16px 34px -14px rgba(201,242,74,0.45);
}
.today-card.hot .tc-lbl { color: rgba(23,27,6,0.65); }
.today-card.hot .tc-val { color: #171b06 !important; }
.today-card.hot .tc-sub { color: rgba(23,27,6,0.6); }
.today-card.lilac {
  background: linear-gradient(150deg, #e5bcfa, #cf9af0);
  border-color: transparent;
  box-shadow: 0 16px 34px -14px rgba(217,167,247,0.4);
}
.today-card.lilac .tc-lbl { color: rgba(36,19,51,0.65); }
.today-card.lilac .tc-val { color: #241333 !important; }
.today-card.lilac .tc-sub { color: rgba(36,19,51,0.6); }
.card, .today-card, .tool-card, .recent-log { border-radius: 24px; }
.home-hero-ring, .home-notif-banner { border-radius: 26px; }

/* bare inline icons (e.g. ${ICONS.flame} dropped directly in a .row) — cap size */
.row > svg, .between > svg, h3 > svg, label > svg { width: 18px; height: 18px; flex: 0 0 auto; }

/* search input (item DB, admin) */
.search {
  display: flex; align-items: center; gap: 9px;
  background: var(--inset); border: 1px solid var(--border);
  border-radius: 13px; padding: 10px 13px; transition: var(--t);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search span { display: grid; place-items: center; flex: 0 0 auto; color: var(--text-dim); }
.search span svg, .search > svg { width: 16px; height: 16px; flex: 0 0 auto; }
.search input {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  color: var(--text); font-size: 13.5px; font-weight: 600;
}
.search input::placeholder { color: var(--text-dim); font-weight: 500; }
