/* MeshMind — UI */
:root {
  --bg: #f4f5fa; --bg-2: #eceef6; --card: #ffffff; --text: #141722; --muted: #646c7c; --line: #e2e5ee;
  --accent: #5a4ff3; --accent-2: #4639e0; --accent-soft: #eeedff; --grad: linear-gradient(135deg, #5a4ff3 0%, #8b5cf6 55%, #c056e8 100%);
  --ok: #10865a; --ok-soft: #e2f6ec; --warn: #a6620b; --warn-soft: #fff2dc; --err: #c03636; --err-soft: #fde8e8;
  --shadow: 0 1px 2px rgba(20, 23, 34, .04), 0 6px 24px rgba(20, 23, 34, .06);
  --shadow-lg: 0 10px 40px rgba(40, 30, 120, .14);
  --r: 18px; --r-sm: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f15; --bg-2: #141722; --card: #161a24; --text: #eceef4; --muted: #9aa2b3; --line: #262b38;
    --accent: #8579ff; --accent-2: #9d93ff; --accent-soft: #221f45;
    --ok: #4cd394; --ok-soft: #112b20; --warn: #f3b04f; --warn-soft: #33260f; --err: #ff8686; --err-soft: #361819;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .25); --shadow-lg: 0 14px 50px rgba(0, 0, 0, .5);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
h1, h2, h3 { letter-spacing: -.02em; }
h1 { font-size: 2rem; line-height: 1.15; margin: 28px 0 8px; }
h2 { font-size: 1.35rem; margin: 34px 0 14px; }
h3 { margin: 0 0 6px; font-size: 1.08rem; }
p { margin: 0 0 10px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); }
.top .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.12rem; color: var(--text); }
.logo:hover { color: var(--text); }
.mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(90, 79, 243, .35); }
.mark svg { width: 20px; height: 20px; }
nav { display: flex; align-items: center; gap: 4px; }
nav a, nav button.link { color: var(--text); padding: 8px 12px; border-radius: 10px; font-weight: 500; }
nav a:hover, nav button.link:hover { background: var(--bg-2); color: var(--text); }
nav .btn { margin-left: 6px; }
.inline { display: inline; margin: 0; }
@media (max-width: 560px) { nav .hide-sm { display: none; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: #fff; border: 0; border-radius: 12px; padding: 12px 20px; font: inherit; font-weight: 600; cursor: pointer; transition: background .15s, transform .05s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: var(--accent-2); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.grad { background: var(--grad); box-shadow: 0 6px 20px rgba(90, 79, 243, .32); }
.btn.grad:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { background: var(--bg-2); color: var(--text); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.soft:hover { filter: brightness(.97); color: var(--accent); }
.btn.danger { background: var(--err-soft); color: var(--err); }
.btn.sm { padding: 8px 13px; font-size: .9rem; border-radius: 10px; }
.btn.wide { width: 100%; }
button.link { background: none; border: 0; font: inherit; cursor: pointer; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--bg-2); color: var(--text); }
.icon-btn svg, .btn svg { width: 18px; height: 18px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 16px; }
.g3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* landing */
.hero { position: relative; padding: 64px 0 40px; }
.hero::before { content: ""; position: absolute; inset: 0 -40vw; z-index: -1; background: radial-gradient(600px 300px at 20% 10%, color-mix(in srgb, #8b5cf6 22%, transparent), transparent 70%), radial-gradient(500px 260px at 85% 30%, color-mix(in srgb, #5a4ff3 18%, transparent), transparent 70%); }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.eyebrow b { color: var(--ok); }
.hero h1 { font-size: clamp(2.2rem, 6.4vw, 3.6rem); margin: 18px 0 14px; max-width: 760px; }
.hero h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 620px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.feature .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 14px; }
.feature .ic svg { width: 22px; height: 22px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.plan { position: relative; text-align: left; }
.plan.best { border: 2px solid var(--accent); box-shadow: var(--shadow-lg); }
.plan .tag { position: absolute; top: -12px; right: 16px; background: var(--grad); color: #fff; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.plan .price { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; }
.plan ul { list-style: none; padding: 0; margin: 14px 0 0; color: var(--muted); }
.plan li { padding: 3px 0; }
.plan li::before { content: "✓"; color: var(--ok); font-weight: 700; margin-right: 8px; }
.calc { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.steps li { counter-increment: s; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--grad); color: #fff; font-weight: 700; margin-bottom: 10px; }

/* forms */
.narrow { max-width: 430px; margin: 40px auto; }
.form label { display: block; margin: 14px 0; font-weight: 600; font-size: .95rem; }
.input, .form input[type=email], .form input[type=password], .form input[type=number], .form input[type=text] {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s; }
.input:focus, .form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.alert { padding: 11px 14px; border-radius: 12px; margin: 12px 0; font-size: .95rem; }
.alert.err { background: var(--err-soft); color: var(--err); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.seg { border: 0; padding: 0; margin: 16px 0; }
.seg legend { font-weight: 600; font-size: .95rem; margin-bottom: 8px; }
.seg .opts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.seg label { margin: 0; font-weight: 400; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label > span { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; height: 100%; transition: border-color .15s, background .15s; }
.seg label > span b { font-weight: 650; }
.seg small { color: var(--muted); font-size: .82rem; }
.seg input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.seg input:focus-visible + span { box-shadow: 0 0 0 4px var(--accent-soft); }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 6px; background: var(--card); }
.form label .stepper { display: flex; width: max-content; margin-top: 8px; }
.form .stepper input[type=number] { display: block; width: 64px; height: 44px; margin: 0; padding: 0; border: 0; border-left: 1.5px solid var(--line); border-right: 1.5px solid var(--line); border-radius: 0; background: var(--card); box-shadow: none; }
.form .stepper input[type=number]:focus { box-shadow: none; background: var(--accent-soft); }
.stepper button { width: 44px; height: 44px; border: 0; background: var(--bg); color: var(--text); font-size: 1.3rem; cursor: pointer; }
.stepper button:hover { background: var(--bg-2); }
.stepper input { width: 64px; height: 44px; border: 0; text-align: center; font: inherit; font-weight: 700; background: var(--card); color: var(--text); -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 0 6px; border-top: 1px dashed var(--line); margin-top: 8px; }
.total b { font-size: 1.6rem; letter-spacing: -.02em; }

/* pills & status */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .82rem; font-weight: 550; background: var(--bg-2); color: var(--muted); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.err { background: var(--err-soft); color: var(--err); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.acc { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.dot.err { background: var(--err); }
.dot.warn { background: var(--warn); }

/* cabinet */
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sub-card { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.sub-card .days { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.progress { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; margin: 12px 0 6px; }
.progress i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 14px; position: relative; transition: box-shadow .2s, transform .2s; }
.tile:hover { box-shadow: var(--shadow-lg); }
.tile.dim { opacity: .75; }
.tile-top { display: flex; gap: 12px; align-items: flex-start; }
.dev { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.dev.awg { background: color-mix(in srgb, #c056e8 16%, transparent); color: #a63ad0; }
.dev svg { width: 24px; height: 24px; }
.tile-title { flex: 1; min-width: 0; }
.tile-title h3 { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); margin-top: 3px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.tile-actions { display: flex; gap: 8px; margin-top: auto; }
.tile-actions .btn { flex: 1; }
.tile .note { font-size: .88rem; padding: 10px 12px; border-radius: 12px; }
.add-tile { display: grid; place-items: center; text-align: center; min-height: 190px; border: 2px dashed var(--line); background: transparent; box-shadow: none; color: var(--muted); border-radius: var(--r); padding: 20px; }
.add-tile:hover { border-color: var(--accent); color: var(--accent); }
.add-tile .plus { width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 0 auto 10px; font-size: 1.6rem; }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu .pop { position: absolute; right: 0; top: 40px; z-index: 5; min-width: 200px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; }
.menu .pop button, .menu .pop a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; border-radius: 10px; cursor: pointer; }
.menu .pop button:hover, .menu .pop a:hover { background: var(--bg-2); }
.menu .pop .danger { color: var(--err); }
.menu .pop svg { width: 16px; height: 16px; }

/* dialog */
dialog { border: 0; border-radius: 22px; padding: 0; width: min(560px, calc(100vw - 24px)); background: var(--card); color: var(--text); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(10, 12, 20, .55); backdrop-filter: blur(3px); }
.dlg { padding: 24px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dlg-head h3 { margin: 0; font-size: 1.2rem; }
.qr-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.qr { width: 100%; background: #fff; border-radius: 14px; padding: 8px; border: 1px solid var(--line); }
.howto { margin: 0; padding-left: 18px; color: var(--muted); font-size: .93rem; }
.howto li { margin: 5px 0; }
@media (max-width: 560px) { .qr-wrap { grid-template-columns: 1fr; } .qr { max-width: 260px; margin: 0 auto; display: block; } }

.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--muted); padding-top: 40px; padding-bottom: 36px; font-size: .9rem; }
@media (max-width: 560px) { h1 { font-size: 1.65rem; } .card { padding: 18px; } .hero { padding-top: 40px; } }
.list { margin-top: 10px; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.list-row:first-child { border-top: 0; }

/* ===== app shell (admin + settings) ===== */
.shell { display: grid; grid-template-columns: 230px 1fr; gap: 24px; margin-top: 24px; align-items: start; }
.side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; }
.side .side-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 6px 12px 8px; font-weight: 700; }
.side a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text); font-weight: 550; }
.side a:hover { background: var(--bg-2); color: var(--text); }
.side a.on { background: var(--accent-soft); color: var(--accent); }
.side a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.side .count { margin-left: auto; background: var(--warn); color: #fff; font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.main { min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 1.7rem; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 28px 0 12px; }
.section-title h2 { margin: 0; font-size: 1.12rem; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
  .side { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; scrollbar-width: none; }
  .side .side-title { display: none; }
  .side a { white-space: nowrap; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); }
  .side a.on { border-color: transparent; }
}

/* stat cards */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat-card { display: flex; gap: 14px; align-items: flex-start; }
.stat-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.stat-ic svg { width: 20px; height: 20px; }
.stat-ic.ok { background: var(--ok-soft); color: var(--ok); } .stat-ic.warn { background: var(--warn-soft); color: var(--warn); }
.stat { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .85rem; }

/* rows (lists instead of dense tables) */
.rows { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; padding: 13px 18px; border-top: 1px solid var(--line); color: var(--text); }
.row:first-child { border-top: 0; }
a.row:hover, button.row:hover { background: color-mix(in srgb, var(--bg-2) 60%, transparent); color: var(--text); }
button.row { width: 100%; border-left: 0; border-right: 0; border-bottom: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { color: var(--muted); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .side-info { text-align: right; flex: none; }
.row .chev { color: var(--muted); flex: none; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; font-weight: 750; color: #fff; background: var(--grad); text-transform: uppercase; }
.avatar.sm { width: 34px; height: 34px; border-radius: 10px; font-size: .9rem; }
.ic-box { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--bg-2); color: var(--muted); }
.ic-box svg { width: 20px; height: 20px; }
.ic-box.on { background: var(--ok-soft); color: var(--ok); }
.ic-box.awg { background: color-mix(in srgb, #c056e8 16%, transparent); color: #a63ad0; }
.ic-box.wg { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 640px) { .row { padding: 12px 14px; gap: 10px; } .row .hide-m { display: none; } }

/* toolbar */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 220px; max-width: 340px; position: relative; }
.toolbar .search input { margin: 0; padding-left: 38px; }
.toolbar .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.chipbar { display: flex; gap: 6px; flex-wrap: wrap; }
.chipbar a { padding: 7px 13px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); color: var(--muted); font-size: .9rem; font-weight: 550; }
.chipbar a:hover { color: var(--text); }
.chipbar a.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chipbar a .n { opacity: .6; margin-left: 4px; }

/* drawer dialog */
dialog.drawer { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(460px, 100vw); border-radius: 22px 0 0 22px; }
dialog.drawer[open] { animation: slidein .18s ease-out; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 560px) { dialog.drawer { width: 100vw; border-radius: 0; } }
.drawer .dlg { display: flex; flex-direction: column; gap: 6px; min-height: 100%; }
.drawer-group { border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-top: 10px; }
.drawer-group h4 { margin: 0 0 10px; font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.drawer-group .inline-form { display: flex; gap: 8px; }
.drawer-group .inline-form .input { margin: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row form { margin: 0; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 600; display: flex; gap: 10px; align-items: center; animation: toast 4.5s ease forwards; max-width: calc(100vw - 32px); }
.toast.ok { background: var(--ok); color: #fff; } .toast.err { background: var(--err); color: #fff; } .toast.warn { background: var(--warn); color: #fff; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 12px); } 6%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 12px); visibility: hidden; } }

/* switch */
.switch-row { display: flex; align-items: center; gap: 16px; }
.switch { position: relative; width: 50px; height: 30px; border-radius: 99px; background: var(--line); flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch.on { background: var(--ok); } .switch.on::after { transform: translateX(20px); }
.tbl { width: 100%; }
.table-wrap { overflow-x: auto; }
select.input { appearance: auto; }
/* guide */
.gtabs { display: flex; gap: 4px; margin: 18px 0 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px; width: max-content; max-width: 100%; overflow-x: auto; }
.gtabs button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.gtabs button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.gpane { display: none; } .gpane.on { display: block; }
.gsteps { counter-reset: g; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.gsteps li { counter-increment: g; display: flex; gap: 12px; align-items: flex-start; }
.gsteps li::before { content: counter(g); flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .85rem; display: grid; place-items: center; margin-top: 1px; }
.guide code { background: var(--bg-2); padding: 1px 6px; border-radius: 6px; font-size: .88em; }
/* one-time code */
.otp { display: flex; gap: 8px; align-items: center; justify-content: flex-start; margin: 10px 0 4px; }
.otp-cell { width: 48px; height: 58px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text);
  font: inherit; font-size: 1.6rem; font-weight: 750; text-align: center; caret-color: var(--accent); transition: border-color .15s, box-shadow .15s, background .15s; padding: 0; }
.otp-cell:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.otp-cell:not(:placeholder-shown), .otp-cell:valid:not([value=""]) { }
.otp.full .otp-cell { border-color: var(--accent); }
.otp.busy .otp-cell { opacity: .6; }
.otp.shake { animation: shake .35s; }
.otp.shake .otp-cell { border-color: var(--err); }
.otp-sep { width: 10px; height: 2px; background: var(--line); border-radius: 2px; }
.otp-center { justify-content: center; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (max-width: 400px) { .otp { gap: 6px; } .otp-cell { width: 40px; height: 50px; font-size: 1.35rem; } .otp-sep { width: 6px; } }
/* tabs inside pages */
.js .tab-pane { display: none; } .js .tab-pane.on { display: block; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; box-shadow: none; }
.otp-status:empty { display: none; }
.otp + .otp-status + .otp-submit, .otp + .otp-submit { margin-top: 12px; }
/* chart */
.chart-wrap { position: relative; margin-top: 12px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .grid.base { stroke: var(--muted); stroke-opacity: .5; }
.chart .axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--accent); transition: fill .12s; }
.chart .bar.on { fill: var(--accent-2); }
.chart .hit { fill: transparent; cursor: pointer; }
.tip { position: absolute; top: -6px; transform: translate(-50%, -100%); background: var(--text); color: var(--bg); padding: 7px 11px; border-radius: 10px; font-size: .85rem; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 1px; z-index: 3; }
.tip span { opacity: .75; font-size: .78rem; }
@media (max-width: 560px) { .chart .axis { font-size: 14px; } }

/* admin/settings menu on phones: a tidy grid instead of a sideways scroller */
@media (max-width: 860px) {
  .side { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; overflow: visible; padding: 0; }
  .side a { flex-direction: column; justify-content: center; gap: 4px; padding: 10px 6px; font-size: .8rem; text-align: center; white-space: normal; line-height: 1.2; position: relative; }
  .side a svg { width: 20px; height: 20px; }
  .side .count { position: absolute; top: 6px; right: 8px; margin: 0; }
}
.tip[hidden] { display: none; }
.chart .axis { font-size: 12px; }
@media (max-width: 560px) { .chart .axis { font-size: 19px; } .chart-card { padding: 16px 12px; } }
@media (max-width: 440px) {
  .top .bar { min-height: 56px; gap: 6px; }
  .logo { font-size: 1rem; gap: 8px; } .mark { width: 30px; height: 30px; }
  nav { gap: 0; } nav a, nav button.link { padding: 8px 7px; font-size: .9rem; }
  nav .btn.sm { padding: 7px 10px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; } .stats .card { padding: 14px; } .stat { font-size: 1.35rem; }
  .stats .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* ===== auth (login / register) ===== */
.auth { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 0; margin: 28px 0 10px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); min-height: 560px; }
.auth-brand { background: var(--grad); color: #fff; position: relative; overflow: hidden; }
.auth-brand::after { content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%; right: -140px; bottom: -160px; background: rgba(255,255,255,.12); }
.auth-brand-in { position: relative; z-index: 1; padding: 36px; display: flex; flex-direction: column; height: 100%; }
.auth-brand h2 { font-size: 1.7rem; line-height: 1.2; margin: 40px 0 26px; color: #fff; }
.auth-brand ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.auth-brand li { display: flex; gap: 14px; align-items: flex-start; font-size: .95rem; line-height: 1.4; color: rgba(255,255,255,.88); }
.auth-brand li b { color: #fff; }
.auth-brand li > span { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; font-size: 1.05rem; }
.auth-brand-foot { margin-top: auto; padding-top: 28px; font-size: .85rem; color: rgba(255,255,255,.75); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h1 { font-size: 1.75rem; margin: 0 0 6px; }
.auth-sub { color: var(--muted); margin: 0 0 22px; }
.auth-form .field { margin-bottom: 16px; }
.auth-form label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.label-row label { margin-bottom: 6px; }
.auth-form input[type=text], .auth-form input[type=email], .auth-form input[type=password] {
  width: 100%; height: 46px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text);
  font: inherit; font-size: 1rem; transition: border-color .15s, box-shadow .15s; }
.auth-form input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.auth-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.auth-form input.bad { border-color: var(--err); }
.auth-form .hint { display: block; margin-top: 6px; font-size: .8rem; color: var(--muted); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px !important; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: none; color: var(--muted); border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.pw-eye:hover { color: var(--text); background: var(--bg-2); }
.pw-eye svg { width: 19px; height: 19px; }
.pw-eye.on { color: var(--accent); }
.pw-meter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 8px; }
.pw-meter i { height: 4px; border-radius: 4px; background: var(--line); transition: background .2s; }
.pw-meter[data-s="1"] i:nth-child(-n+1) { background: var(--err); }
.pw-meter[data-s="2"] i:nth-child(-n+2) { background: var(--warn); }
.pw-meter[data-s="3"] i { background: var(--ok); }
.auth-submit { height: 48px; margin-top: 6px; font-size: 1rem; }
.auth-legal { margin: 14px 0 0; font-size: .8rem; color: var(--muted); text-align: center; line-height: 1.45; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; background: transparent; border: 0; box-shadow: none; min-height: 0; margin-top: 8px; }
  .auth-brand { display: none; }
  .auth-main { padding: 18px 0 8px; align-items: flex-start; }
  .auth-box { max-width: 420px; margin: 0 auto; }
}
.gsteps li { display: block; position: relative; padding-left: 38px; min-height: 26px; line-height: 1.5; }
.gsteps li::before { position: absolute; left: 0; top: 0; margin: 0; }
.chart-visits .bar { fill: color-mix(in srgb, var(--ok) 85%, var(--accent)); }
.chart-visits .bar.on { fill: var(--ok); }
/* ===== stats v2 ===== */
.seg-switch { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; }
.seg-switch a, .seg-switch button { padding: 7px 14px; border-radius: 9px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap; }
.seg-switch a:hover, .seg-switch button:hover { color: var(--text); }
.seg-switch .on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.seg-switch.small a, .seg-switch.small button { padding: 6px 12px; font-size: .86rem; }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.kpi-top .stat-ic { width: 36px; height: 36px; border-radius: 10px; }
.kpi-top .stat-ic svg { width: 18px; height: 18px; }
.kpi-val { font-size: 1.65rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-label { color: var(--muted); font-size: .85rem; }
.delta { font-size: .78rem; font-weight: 650; padding: 3px 8px; border-radius: 99px; background: var(--bg-2); color: var(--muted); white-space: nowrap; }
.delta.up { background: var(--ok-soft); color: var(--ok); }
.delta.down { background: var(--err-soft); color: var(--err); }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.chart-pane { display: none; } .chart-pane.on { display: block; }
.chart-wrap { position: relative; }
.chart.is-empty .grid { stroke-dasharray: 3 5; }
.chart-empty { position: absolute; inset: 0 0 26px 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 10px; pointer-events: none; }
.chart-empty b { font-size: 1rem; }
.chart-empty span { color: var(--muted); font-size: .88rem; max-width: 320px; }
.chart-table { margin-top: 12px; }
#data-table-toggle.on, [data-table-toggle].on { background: var(--bg-2); }
.hbar { margin-top: 14px; }
.hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: .92rem; margin-bottom: 6px; }
.hbar-top b { font-variant-numeric: tabular-nums; }
.hbar-track { height: 10px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.hbar-track i { display: block; height: 100%; min-width: 0; border-radius: 99px; background: var(--accent); transition: width .3s; }
.hbar-track.funnel i { background: var(--ok); }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px) { .kpis { gap: 10px; } .kpi { padding: 13px 14px; } .kpi-val { font-size: 1.3rem; } .kpi-top .stat-ic { width: 32px; height: 32px; } .chart-empty { inset: 0 0 26px 0; } }
/* sessions v2 */
.day-head { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 10px; font-size: .95rem; }
.row.sess .grow { display: flex; flex-direction: column; gap: 2px; }
.dur-track { height: 4px; border-radius: 99px; background: var(--bg-2); margin-top: 6px; max-width: 360px; overflow: hidden; }
.dur-track i { display: block; height: 100%; border-radius: 99px; background: color-mix(in srgb, var(--accent) 70%, transparent); }
.dur-track i.on { background: var(--ok); }
.sess-dur { font-weight: 650; font-size: .92rem; white-space: nowrap; }
/* no sideways scroll: decorative glows must never widen the page */
html, body { overflow-x: clip; max-width: 100%; }
.hero { overflow-x: clip; overflow-y: visible; }
.hero::before { inset: -40px -16px 0; }
/* hero glow: full-bleed, soft edges; the page itself (html/body overflow-x: clip) prevents sideways scroll */
.hero { overflow: visible; }
.hero::before { top: -90px; bottom: -80px; left: 50%; right: auto; width: 100vw; transform: translateX(-50%);
  background: radial-gradient(640px 340px at 28% 30%, color-mix(in srgb, #8b5cf6 20%, transparent), transparent 72%),
              radial-gradient(560px 300px at 78% 40%, color-mix(in srgb, #5a4ff3 16%, transparent), transparent 72%); }
/* ===== pricing (one block: term + devices + total) ===== */
.pricing { display: grid; grid-template-columns: 1.25fr 1fr; gap: 0; padding: 0; overflow: hidden; }
.pricing-controls { padding: 26px; display: flex; flex-direction: column; gap: 22px; }
.pc-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 10px; }
.term-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.term-pick label { position: relative; }
.term-pick input { position: absolute; opacity: 0; pointer-events: none; }
.term-pick span { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s; height: 100%; }
.term-pick span b { font-size: 1rem; }
.term-pick em { font-style: normal; font-size: .72rem; font-weight: 700; color: #fff; background: var(--grad); padding: 2px 8px; border-radius: 99px; }
.term-pick input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.term-pick input:focus-visible + span { box-shadow: 0 0 0 4px var(--accent-soft); }
.dev-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dev-row .stepper { margin-top: 0; }
.pricing-note { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.5; padding-top: 16px; border-top: 1px dashed var(--line); }
.pricing-total { background: var(--grad); color: #fff; padding: 26px; display: flex; flex-direction: column; }
.pt-sum { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.pt-break { margin-top: 8px; font-size: .9rem; opacity: .9; font-variant-numeric: tabular-nums; }
.pt-list { list-style: none; padding: 0; margin: 18px 0 22px; display: grid; gap: 7px; font-size: .92rem; }
.pt-list li::before { content: "✓"; font-weight: 800; margin-right: 9px; }
.pt-btn { margin-top: auto; background: #fff; color: #3b2fd6; width: 100%; }
.pt-btn:hover { background: #f1efff; color: #3b2fd6; }
@media (max-width: 760px) {
  .pricing { grid-template-columns: 1fr; }
  .pricing-controls, .pricing-total { padding: 20px; }
  .term-pick { gap: 8px; } .term-pick span { padding: 12px 10px; } .term-pick span b { font-size: .92rem; }
  .pt-sum { font-size: 2.2rem; }
}
/* lock page scroll while any dialog is open; long dialogs scroll inside themselves */
html:has(dialog[open]) { overflow: hidden; scrollbar-gutter: stable; }
body.modal-open { overflow: hidden; }
dialog { max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
dialog.drawer { max-height: 100dvh; }
/* ===== checkout (order page) ===== */
.checkout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 20px; align-items: start; margin-top: 8px; }
.co-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.co-mode { align-self: flex-start; }
.co-info { background: var(--accent-soft); color: var(--text); border-radius: 14px; padding: 12px 16px; font-size: .93rem; line-height: 1.5; }
.co-step { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.co-step-head { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.co-step-head h3 { margin: 0; font-size: 1.05rem; }
.co-step-head p { margin: 1px 0 0; color: var(--muted); font-size: .85rem; }
.co-num { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); color: #fff; font-weight: 800; display: grid; place-items: center; flex: none; }
.co-opt { position: relative; display: block; cursor: pointer; }
.co-opt input { position: absolute; opacity: 0; pointer-events: none; }
.co-opt > span { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg); transition: border-color .15s, background .15s, box-shadow .15s; position: relative; }
.co-opt > span b { font-size: 1rem; }
.co-opt > span small { color: var(--muted); font-size: .84rem; line-height: 1.4; }
.co-opt > span em { position: absolute; top: -9px; right: 12px; font-style: normal; font-size: .7rem; font-weight: 700; color: #fff; background: var(--grad); padding: 2px 8px; border-radius: 99px; }
.co-opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.co-opt input:focus-visible + span { box-shadow: 0 0 0 4px var(--accent-soft); }
.co-opt:hover > span { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.co-terms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.co-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.co-ic { font-style: normal; font-size: 1.25rem; margin-bottom: 2px; }
.co-devices { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.stepper.big button { width: 52px; height: 52px; font-size: 1.5rem; }
.stepper.big input { width: 70px; height: 52px; font-size: 1.3rem; }
.co-dev-text { display: flex; flex-direction: column; gap: 2px; }
.co-dev-text b { font-size: 1.05rem; } .co-dev-text small { color: var(--muted); font-size: .84rem; }
.co-summary { position: sticky; top: 84px; }
.co-sum-card { background: var(--grad); color: #fff; border-radius: 20px; padding: 22px; box-shadow: var(--shadow-lg); }
.co-lines { margin: 4px 0 0; display: grid; gap: 8px; }
.co-lines > div { display: flex; justify-content: space-between; gap: 10px; font-size: .93rem; }
.co-lines > div[hidden] { display: none; }
.co-lines dt { opacity: .8; } .co-lines dd { margin: 0; font-weight: 650; text-align: right; }
.co-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.25); }
.co-total span { opacity: .85; } .co-total b { font-size: 2.1rem; letter-spacing: -.03em; line-height: 1; }
.co-break { font-size: .82rem; opacity: .85; margin-top: 6px; text-align: right; min-height: 1.2em; }
.co-pay { width: 100%; margin-top: 16px; background: #fff; color: #3b2fd6; height: 50px; font-size: 1rem; }
.co-pay:hover { background: #f1efff; color: #3b2fd6; }
.co-next { list-style: none; counter-reset: c; padding: 0; margin: 16px 0 0; display: grid; gap: 6px; font-size: .84rem; opacity: .9; }
.co-next li { counter-increment: c; display: flex; gap: 8px; align-items: baseline; }
.co-next li::before { content: counter(c); width: 18px; height: 18px; border-radius: 6px; background: rgba(255,255,255,.22); display: inline-grid; place-items: center; font-size: .72rem; font-weight: 700; flex: none; }
[data-show][hidden] { display: none !important; }
@media (max-width: 860px) {
  .checkout { grid-template-columns: 1fr; }
  .co-summary { position: static; }
}
@media (max-width: 520px) {
  .co-terms { grid-template-columns: repeat(3, 1fr); gap: 7px; } .co-opt > span { padding: 12px 10px; } .co-opt > span b { font-size: .92rem; }
  .co-modes { grid-template-columns: 1fr; }
  .co-step { padding: 16px; }
}
/* ===== header: full nav on desktop, button + burger on phones ===== */
.nav-mobile { display: none; align-items: center; gap: 8px; }
.nav-menu { position: relative; }
.nav-menu > summary { list-style: none; width: 40px; height: 40px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu[open] > summary { background: var(--bg-2); }
.nav-pop { position: absolute; right: 0; top: 48px; width: min(260px, calc(100vw - 32px)); background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 30; display: flex; flex-direction: column; }
.nav-pop a, .nav-pop .nav-exit { display: block; padding: 11px 12px; border-radius: 10px; color: var(--text); font-weight: 550; text-align: left; }
.nav-pop a:hover, .nav-pop .nav-exit:hover { background: var(--bg-2); color: var(--text); }
.nav-pop form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--line); }
.nav-pop .nav-exit { width: 100%; border: 0; background: none; font: inherit; cursor: pointer; color: var(--err); font-weight: 600; }
.nav-who { padding: 10px 12px 8px; font-weight: 700; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.nav-who small { font-weight: 400; color: var(--muted); font-size: .8rem; }
@media (max-width: 760px) {
  .nav-full { display: none; }
  .nav-mobile { display: flex; }
}
/* ===== header v3: links + account menu (desktop), main button + burger (phones) ===== */
.hnav { display: flex; align-items: center; gap: 8px; }
.hlinks { display: flex; align-items: center; gap: 2px; margin-right: 6px; }
.hnav .hlinks a { color: var(--muted); padding: 8px 12px; border-radius: 10px; font-weight: 550; }
.hnav .hlinks a:hover { color: var(--text); background: var(--bg-2); }
.hnav .hlinks a.on { color: var(--text); background: var(--bg-2); }
.hnav .hlogin { color: var(--text); padding: 8px 12px; border-radius: 10px; font-weight: 600; }
.hnav .hlogin:hover { background: var(--bg-2); color: var(--text); }
.hmain { display: none !important; }
.nav-menu { position: relative; }
.nav-menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); width: auto; transition: background .15s, border-color .15s; }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary:hover, .nav-menu[open] > summary { background: var(--bg-2); }
.nav-menu.guest { display: none; }
.hav { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); color: #fff; font-weight: 750; font-size: .9rem; display: grid; place-items: center; flex: none; }
.hav.lg { width: 38px; height: 38px; border-radius: 11px; font-size: 1rem; }
.hname { font-weight: 600; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hchev { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.nav-menu[open] .hchev { transform: rotate(180deg); }
.hburger { display: none; width: 20px; height: 20px; }
.nav-pop { position: absolute; right: 0; top: 50px; width: 260px; max-width: calc(100vw - 32px); background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 30; display: flex; flex-direction: column; animation: popin .14s ease-out; }
@keyframes popin { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.nav-pop a, .nav-pop .nav-exit { display: block; padding: 10px 12px; border-radius: 10px; color: var(--text); font-weight: 550; font-size: .95rem; text-align: left; }
.nav-pop a:hover, .nav-pop .nav-exit:hover { background: var(--bg-2); color: var(--text); }
.nav-pop form { margin: 0; padding: 0; border: 0; }
.nav-pop .nav-exit { width: 100%; border: 0; background: none; font: inherit; font-size: .95rem; cursor: pointer; color: var(--err); font-weight: 600; }
.nav-sep { height: 1px; background: var(--line); margin: 5px 6px; }
.nav-who { display: flex; gap: 10px; align-items: center; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.nav-who b { display: block; font-size: .98rem; }
.nav-who small { display: block; color: var(--muted); font-size: .8rem; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) {
  .hlinks, .hnav .hlogin { display: none; }
  .hmain { display: inline-flex !important; }
  .nav-menu.guest { display: block; }
  .nav-menu > summary { width: 40px; padding: 0; justify-content: center; }
  .nav-menu > summary .hav, .nav-menu > summary .hname, .nav-menu > summary .hchev { display: none; }
  .hburger { display: block; }
  .nav-pop { top: 48px; }
}
.nav-pop .nav-who { flex-direction: row; align-items: center; text-align: left; }
.nav-pop .nav-who > div { min-width: 0; }
/* menu items that duplicate visible header links are shown only on phones */
.nav-pop .m-only { display: none; }
@media (max-width: 760px) { .nav-pop .m-only { display: block; } }
