:root {
  color-scheme: light;
  --page: #f7f8f4;
  --surface: #ffffff;
  --surface-soft: #f1f4ef;
  --ink: #17211b;
  --muted: #66716a;
  --line: #dfe5df;
  --line-strong: #cbd4cc;
  --primary: #176b55;
  --primary-hover: #105744;
  --primary-soft: #e7f2ed;
  --success: #197154;
  --success-bg: #ddf4ea;
  --warning: #9b6410;
  --warning-bg: #fff1ce;
  --danger: #b33c36;
  --danger-bg: #fde8e5;
  --radius: 12px;
  --shadow: 0 12px 35px rgba(28, 48, 38, .08);
  font-family: Inter, Geist, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; color: var(--ink); background: var(--page); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
h1, h2, h3, p { overflow-wrap: anywhere; }
.hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.mono, code { font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; }
.muted { color: var(--muted); }
.positive { color: var(--success); }
.negative { color: var(--danger); }
.skip-link { position: fixed; left: 18px; top: -70px; z-index: 100; padding: 11px 16px; color: #fff; background: var(--primary); border-radius: 8px; }
.skip-link:focus { top: 14px; }

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 43px; color: #fff; background: var(--primary); clip-path: polygon(50% 0, 93% 15%, 86% 76%, 50% 100%, 14% 76%, 7% 15%); font-size: 17px; font-weight: 850; letter-spacing: -.08em; }
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { font-size: 15px; line-height: 1.1; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .11em; text-transform: uppercase; }

.public-header { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 32px; min-height: 72px; padding: 12px clamp(24px, 5vw, 80px); background: rgba(247, 248, 244, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.public-nav { display: flex; justify-content: center; align-items: center; gap: 30px; }
.public-nav a { color: #526058; font-size: 13px; font-weight: 650; text-decoration: none; }
.public-nav a:hover { color: var(--primary); }
.public-header .brand-copy strong { font-size: 18px; }
.public-header .brand-copy small { display: none; }
.public-actions { display: flex; align-items: center; gap: 8px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-weight: 720; font-size: 13px; text-decoration: none; transition: background .18s, border-color .18s, color .18s, transform .18s; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, .sidebar-nav button:focus-visible { outline: 3px solid rgba(23, 107, 85, .22); outline-offset: 2px; }
.button-primary { color: #fff; background: var(--primary); }
.button-primary:hover { background: var(--primary-hover); }
.button-secondary { color: var(--ink); background: var(--surface); border-color: var(--line-strong); }
.button-secondary:hover, .button-quiet:hover, .button-outline:hover { color: var(--primary); background: var(--primary-soft); border-color: #b7d4c8; }
.button-quiet { color: #4e5c54; background: transparent; }
.button-outline { color: var(--ink); background: var(--surface); border-color: var(--line-strong); }
.button-danger { color: var(--danger); background: var(--danger-bg); border-color: #f0c2be; }
.button.small { min-height: 36px; padding: 0 13px; font-size: 12px; }
.button.full { width: 100%; }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; }

.hero { display: grid; grid-template-columns: minmax(590px, .94fr) minmax(650px, 1.12fr); align-items: center; gap: clamp(42px, 4vw, 68px); min-height: 500px; width: 100%; margin: auto; padding: 24px clamp(64px, 5.8vw, 98px) 20px; }
.hero-copy { max-width: 640px; }
.eyebrow, .panel-kicker, .app-overline, .sidebar-label { margin: 0; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; background: #28a977; border: 2px solid #c9eddd; border-radius: 50%; box-shadow: 0 0 0 3px #e1f5ec; }
.hero h1 { margin: 18px 0 0; max-width: 640px; font-size: clamp(51px, 4.2vw, 68px); line-height: 1.08; letter-spacing: -.052em; font-weight: 780; }
.hero h1 span { color: var(--ink); }
.heading-line { display: block; }
.hero-lead { max-width: 45ch; margin: 20px 0 24px; color: #39453e; font-size: 17px; line-height: 1.55; }
.hero-actions { display: flex; gap: 10px; }
.hero-actions .button:first-child { min-width: 294px; }
.hero-actions .button:nth-child(2) { min-width: 276px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 25px; color: #2f3a34; }
.trust-row > div { display: flex; align-items: center; gap: 10px; }
.trust-row i { display: inline-grid; place-items: center; width: 29px; height: 29px; color: var(--primary); font-style: normal; font-size: 22px; }
.trust-row strong, .trust-row small { display: block; }
.trust-row strong { font-size: 11px; }
.trust-row small { margin-top: 2px; color: var(--muted); font-size: 9px; }

.onboarding-panel { display: grid; grid-template-columns: .93fr 1.07fr; min-height: 420px; padding: 25px 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 3px 12px rgba(28, 48, 38, .11); }
.workflow-column { padding-right: 25px; border-right: 1px solid var(--line); }
.workflow-column h2 { margin: 0 0 14px; font-size: 22px; letter-spacing: -.025em; }
.step-list { position: relative; display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.step-list::before { content: ""; position: absolute; left: 17px; top: 30px; bottom: 30px; width: 2px; background: var(--line); }
.step-list::after { content: ""; position: absolute; left: 17px; top: 30px; width: 2px; height: 58px; background: var(--primary); }
.step-list li { position: relative; display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 15px; min-height: 95px; }
.step-list li > span { z-index: 1; display: grid; place-items: center; width: 36px; height: 36px; color: var(--ink); background: #edf0ed; border: 1px solid #e4e7e4; border-radius: 50%; font-size: 13px; font-weight: 800; }
.step-list li.active > span { color: #fff; background: var(--primary); border-color: var(--primary); }
.step-list strong, .step-list small { display: block; }
.step-list strong { font-size: 14px; }
.step-list small { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.active-license-column { display: grid; place-items: center; padding-left: 26px; }
.active-count-block { text-align: center; }
.active-count-block strong, .active-count-block span { display: block; }
.active-count-block strong { color: var(--primary); font-size: clamp(64px, 6vw, 92px); line-height: 1; letter-spacing: -.06em; }
.active-count-block span { margin-top: 13px; color: #435048; font-size: 14px; font-weight: 700; }

.section { max-width: 1420px; margin: auto; padding: 92px clamp(24px, 7vw, 104px); }
.pricing-section { max-width: 1600px; padding: 20px clamp(64px, 5vw, 84px) 26px; border-top: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: 1fr minmax(280px, .65fr); align-items: end; gap: 60px; margin-bottom: 36px; }
.section-heading h2 { margin: 8px 0 0; font-size: clamp(34px, 4vw, 53px); letter-spacing: -.045em; }
.section-heading > p { max-width: 54ch; margin: 0; color: var(--muted); line-height: 1.65; font-size: 14px; }
.compact-heading h2 { font-size: 38px; }
.pricing-heading { display: block; margin: 0 0 12px; text-align: center; }
.pricing-heading h2 { margin: 0; font-size: 25px; }
.pricing-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 18px; }
.pricing-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.price-card { position: relative; display: flex; flex-direction: column; min-height: 250px; padding: 20px 24px; background: var(--surface); border-right: 1px solid var(--line); text-align: center; }
.price-card:last-child { border-right: 0; }
.price-card.featured::before { content: "PHỔ BIẾN"; position: absolute; right: 18px; top: 18px; padding: 5px 8px; color: var(--primary); background: var(--primary-soft); border-radius: 14px; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.price-card small { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.price-card h3 { margin: 4px 0 0; font-size: 14px; }
.price-card .price { margin: 14px 0 4px; color: var(--primary); font-size: clamp(24px, 2.3vw, 31px); font-weight: 780; letter-spacing: -.04em; }
.price-card .price span { color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.plan-features { display: grid; gap: 7px; margin: 10px 0 14px; padding: 10px 0 0; color: #536059; border-top: 1px solid var(--line); list-style: none; font-size: 10px; text-align: left; }
.plan-features li::before { content: "✓"; margin-right: 8px; color: var(--success); font-weight: 800; }
.price-card .button { margin-top: auto; }
.demo-preview { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.demo-preview > strong { font-size: 12px; }
.mini-admin-preview { position: relative; height: 104px; margin: 13px 0; overflow: hidden; background: #f4f7f4; border: 1px solid var(--line); border-radius: 5px; }
.mini-admin-preview span { position: absolute; inset: 0 auto 0 0; width: 24%; background: var(--primary); }
.mini-admin-preview i { position: relative; display: block; width: 57%; height: 9px; margin: 15px 10px 0 34%; background: #dce7e1; border-radius: 2px; }
.demo-preview p { margin: 0 0 13px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.text-button { padding: 0; color: var(--primary); background: transparent; border: 0; cursor: pointer; font-size: 10px; font-weight: 750; }
.download-section { border-top: 1px solid var(--line); }
.download-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.download-button { display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto auto; align-items: center; min-height: 106px; padding: 20px; text-align: left; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; text-decoration: none; }
.download-button > span { grid-row: 1 / 3; display: grid; place-items: center; width: 36px; height: 36px; color: var(--primary); background: var(--primary-soft); border-radius: 8px; font-family: monospace; font-size: 10px; font-weight: 800; }
.download-button strong { align-self: end; font-size: 14px; }
.download-button small { align-self: start; margin-top: 5px; color: var(--muted); font-size: 10px; }
.download-button:not(:disabled):hover { border-color: #a9cdbf; box-shadow: 0 8px 22px rgba(28, 48, 38, .06); }
.download-button:disabled { cursor: not-allowed; opacity: .58; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 25px clamp(24px, 7vw, 104px); color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }

/* Shared application shell */
body.workspace-open { overflow: hidden; }
body.workspace-open .public-header, body.workspace-open #public-site, body.workspace-open #public-footer { display: none; }
.app-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); height: 100dvh; background: var(--page); }
.app-sidebar { position: relative; z-index: 12; display: flex; flex-direction: column; min-width: 0; padding: 20px 15px; background: var(--surface); border-right: 1px solid var(--line); }
.sidebar-brand { padding: 0 7px 22px; border-bottom: 1px solid var(--line); }
.sidebar-label { margin: 24px 11px 8px; color: #879088; font-size: 9px; }
.sidebar-nav { display: grid; gap: 4px; margin-top: 20px; }
.sidebar-nav a, .sidebar-nav button { display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 0 12px; color: #526058; background: transparent; border: 0; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 650; text-align: left; text-decoration: none; }
.sidebar-nav a > span, .sidebar-nav button > span { display: grid; place-items: center; width: 19px; color: #738078; font-size: 15px; }
.sidebar-nav a:hover, .sidebar-nav button:hover { color: var(--primary); background: var(--surface-soft); }
.sidebar-nav a.active, .sidebar-nav button.active { color: var(--primary); background: var(--primary-soft); font-weight: 750; }
.sidebar-nav .active > span { color: var(--primary); }
.sidebar-help { display: flex; gap: 10px; margin-top: auto; padding: 15px; background: var(--surface-soft); border-radius: 9px; }
.sidebar-help > span { flex: 0 0 auto; display: grid; place-items: center; width: 24px; height: 24px; color: var(--primary); background: var(--surface); border: 1px solid var(--line); border-radius: 50%; font-size: 11px; font-weight: 800; }
.sidebar-help strong, .sidebar-help small { display: block; }
.sidebar-help strong { font-size: 11px; }
.sidebar-help small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.server-card { margin-top: auto; padding: 14px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 9px; }
.server-card div { display: flex; align-items: center; font-size: 11px; }
.server-card .status-dot { width: 6px; height: 6px; margin-right: 8px; }
.server-card small { display: block; margin: 7px 0 0 20px; color: var(--muted); font-size: 9px; }
.app-view { min-width: 0; overflow: auto; }
.app-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 22px; min-height: 78px; padding: 13px 28px; background: rgba(255, 255, 255, .95); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.app-header h2 { margin: 5px 0 0; font-size: 20px; letter-spacing: -.025em; }
.app-overline { color: #7b867e; font-size: 8px; }
.app-header-actions { display: flex; align-items: center; gap: 12px; }
.icon-button, .mobile-menu { display: grid; place-items: center; width: 38px; height: 38px; color: #526058; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.icon-button:hover, .mobile-menu:hover { color: var(--primary); background: var(--primary-soft); }
.mobile-menu { display: none; }
.account-chip { display: flex; align-items: center; gap: 9px; padding-left: 12px; border-left: 1px solid var(--line); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; color: var(--primary); background: var(--primary-soft); border-radius: 50%; font-size: 12px; font-weight: 800; }
.admin-avatar { color: #fff; background: var(--primary); }
.account-chip strong, .account-chip small { display: block; }
.account-chip strong { font-size: 11px; }
.account-chip small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.workspace-logout { min-height: 38px; padding-inline: 11px; font-size: 11px; }
.app-content { padding: 26px 28px 48px; }
.user-content { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(330px, .96fr); gap: 20px; align-items: start; }
.content-column { min-width: 0; }
.content-title { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.content-title h3, .panel h3, .section-bar h3, .list-toolbar h3 { margin: 6px 0 0; font-size: 17px; letter-spacing: -.02em; }
.count-pill { padding: 7px 10px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; font-size: 10px; }
.count-pill b { color: var(--ink); }
.panel { padding: 21px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 18px; margin-bottom: 20px; }
.purchase-column { display: grid; gap: 14px; }
.balance-card { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 20px; min-height: 132px; padding: 21px 26px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.wallet-icon { display: grid; place-items: center; width: 62px; height: 62px; color: var(--primary); background: var(--primary-soft); border-radius: 50%; font-size: 31px; font-weight: 400; }
.balance-card div small { display: block; color: var(--ink); font-size: 13px; }
.balance-card div strong { display: block; margin-top: 8px; color: var(--primary); font-size: 27px; letter-spacing: -.03em; }
.gameserver-download-card { display: grid; grid-template-columns: 42px 1fr; gap: 14px; padding: 20px; background: var(--surface); border: 1px solid #a9cdbf; border-radius: 7px; }
.gameserver-download-icon { display: grid; place-items: center; width: 42px; height: 42px; color: #fff; background: var(--primary); border-radius: 7px; font-size: 22px; font-weight: 800; }
.gameserver-download-card small, .gameserver-download-card strong { display: block; }
.gameserver-download-card small { color: var(--primary); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.gameserver-download-card strong { margin-top: 5px; font-size: 17px; }
.gameserver-download-card p { margin: 8px 0 15px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.gameserver-download-card .button { font-family: Inter, Geist, "Segoe UI", Arial, sans-serif; font-size: 13px; font-weight: 720; line-height: 1.2; letter-spacing: 0; }
.form-stack { display: grid; gap: 16px; }
.form-stack label, .field-label { display: grid; gap: 7px; color: #425048; font-size: 11px; font-weight: 700; }
.form-stack label small, .helper { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; font-weight: 450; }
input, select { width: 100%; min-height: 43px; padding: 0 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; }
input::placeholder { color: #9aa39d; }
input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--primary); }
.license-list { display: grid; gap: 16px; }
.license-stack { display: grid; gap: 16px; }
.license-summary-card, .config-card { padding: 24px 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.license-identity { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 18px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.license-shield { display: grid; place-items: center; width: 68px; height: 68px; color: #fff; background: var(--primary); clip-path: polygon(50% 0, 90% 15%, 83% 78%, 50% 100%, 17% 78%, 10% 15%); font-size: 24px; font-weight: 800; }
.license-identity .license-id { font-size: 25px; font-weight: 760; letter-spacing: .01em; }
.license-status-line { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 12px; color: #445048; font-size: 11px; }
.license-status-line .sync-state.good { color: var(--success); }
.license-status-line .sync-state.bad, .expiry-state { color: #e02e28; }
.license-status-line .sync-state.warn { color: var(--warning); }
.hardware-row { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding-top: 18px; }
.hardware-row span, .hardware-row code { display: block; }
.hardware-row span { margin-bottom: 8px; font-size: 11px; }
.hardware-row code { font-size: 12px; letter-spacing: .04em; }
.square-copy { display: grid; place-items: center; width: 39px; height: 39px; flex: 0 0 auto; color: var(--primary); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 5px; cursor: pointer; }
.square-copy:hover { background: var(--primary-soft); }
.license-top { display: flex; align-items: start; justify-content: space-between; gap: 18px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.license-id { font-size: 14px; font-weight: 750; }
.license-meta { display: flex; flex-wrap: wrap; gap: 8px 15px; margin-top: 8px; color: var(--muted); font-size: 10px; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; padding: 0 9px; color: #68736c; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 14px; font-size: 8px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.badge.good { color: var(--success); background: var(--success-bg); border-color: #c4e6d8; }
.badge.bad { color: var(--danger); background: var(--danger-bg); border-color: #efc9c5; }
.badge.warn { color: var(--warning); background: var(--warning-bg); border-color: #eddcae; }
.activation-form { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-top: 18px; }
.activation-locked { margin: 16px 0 0; color: var(--muted); font-size: 10px; }
.config-card h3 { margin: 0; font-size: 20px; }
.config-card > p { margin: 11px 0 13px; color: #4f5b54; font-size: 11px; }
.config-card > p code { color: var(--ink); }
.config-block { display: grid; gap: 9px; }
.config-row { display: grid; grid-template-columns: minmax(0, 1fr) 124px; align-items: stretch; gap: 10px; min-height: 42px; color: var(--ink); font-size: 10px; }
.config-row code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.config-row > code { display: flex; align-items: center; padding: 0 14px; background: #f4f8f5; border: 1px solid #bcd5ca; border-radius: 5px; }
.copy-button { min-width: 112px; padding: 0 12px; color: var(--primary); background: var(--surface); border: 1px solid var(--primary); border-radius: 5px; cursor: pointer; font-size: 10px; font-weight: 700; }
.copy-button:hover { color: #fff; background: var(--primary); }
.config-warning { margin-bottom: 0 !important; color: var(--muted) !important; font-size: 9px !important; }
.setup-guide { margin-top: 13px; padding: 14px 16px; color: #536159; background: var(--primary-soft); border-left: 3px solid var(--primary); border-radius: 7px; font-size: 10px; line-height: 1.65; }
.setup-guide strong { color: var(--ink); }
.setup-guide ol { margin: 7px 0; padding-left: 18px; }
.setup-guide p { margin: 7px 0 0; }
.setup-guide code { color: var(--primary); font-size: 9px; }
.ledger-panel { grid-column: 1 / -1; margin-top: 4px; }
.empty-state { padding: 45px 20px; text-align: center; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty-state strong { display: block; margin-bottom: 7px; font-size: 13px; }
.empty-state p { max-width: 48ch; margin: auto; color: var(--muted); font-size: 10px; line-height: 1.65; }

/* Admin */
.admin-content { padding-top: 20px; }
.admin-summary { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)) auto; align-items: stretch; min-height: 104px; margin-bottom: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.admin-summary > div { display: flex; align-items: center; gap: 15px; padding: 17px 28px; border-right: 1px solid var(--line); }
.summary-icon { display: grid; place-items: center; width: 50px; height: 50px; flex: 0 0 auto; color: var(--primary); background: var(--primary-soft); border-radius: 50%; font-size: 20px; font-style: normal; }
.admin-summary > div > span { display: block; }
.admin-summary b, .admin-summary small { display: block; }
.admin-summary b { color: var(--ink); font-size: 25px; letter-spacing: -.03em; }
.admin-summary small { margin-top: 3px; color: #4d5952; font-size: 10px; }
.admin-summary .button { align-self: center; margin: 0 15px; }
.admin-pane { display: none; }
.admin-pane.active { display: block; }
.license-management { display: grid; grid-template-columns: minmax(520px, 1.5fr) minmax(330px, .72fr); min-height: calc(100dvh - 252px); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.admin-list-panel { min-width: 0; border-right: 1px solid var(--line); }
.list-toolbar { display: flex; align-items: center; gap: 10px; min-height: 72px; padding: 14px 13px; border-bottom: 1px solid var(--line); }
.search-box { position: relative; display: block; flex: 1 1 290px; min-width: 190px; }
.search-box span { position: absolute; left: 12px; top: 11px; color: var(--muted); }
.search-box input { min-height: 38px; padding-left: 34px; font-size: 10px; }
.toolbar-controls { display: flex; gap: 8px; }
.toolbar-controls select { min-height: 38px; width: auto; min-width: 132px; font-size: 9px; }
.toolbar-controls .icon-button { width: 38px; height: 38px; }
.admin-license-table tbody tr { cursor: pointer; }
.admin-license-table tbody tr:hover, .admin-license-table tbody tr.selected { background: var(--primary-soft); }
.admin-license-table tbody tr.selected td:first-child { box-shadow: inset 3px 0 var(--primary); }
.admin-license-table { table-layout: fixed; }
.admin-license-table th:nth-child(1) { width: 19%; }
.admin-license-table th:nth-child(2) { width: 11%; }
.admin-license-table th:nth-child(3) { width: 25%; }
.admin-license-table th:nth-child(4) { width: 14%; }
.admin-license-table th:nth-child(5) { width: 15%; }
.admin-license-table th:nth-child(6) { width: 10%; }
.admin-license-table th:nth-child(7) { width: 6%; }
.admin-license-table td { height: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-license-table .hwid-cell { overflow: hidden; text-overflow: ellipsis; }
.row-arrow { color: var(--ink); text-align: right; font-size: 18px; }
.admin-list-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 62px; margin-top: auto; padding: 11px 15px; color: #4d5851; border-top: 1px solid var(--line); font-size: 9px; }
.admin-list-panel { display: flex; flex-direction: column; }
.admin-list-panel > .table-wrap { flex: 1 1 auto; }
.admin-list-footer > div { display: flex; align-items: center; gap: 7px; }
.admin-list-footer button, .admin-list-footer b { display: grid; place-items: center; width: 33px; height: 33px; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; font-size: 12px; }
.admin-list-footer b { color: #fff; background: var(--primary); border-color: var(--primary); }
.admin-list-footer button { color: var(--muted); }
.admin-editor { padding: 26px; background: #fbfcfa; }
.editor-placeholder { display: grid; justify-items: center; padding: 90px 24px; text-align: center; color: var(--muted); }
.editor-placeholder > span { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 15px; color: var(--primary); background: var(--primary-soft); border-radius: 50%; }
.editor-placeholder strong { color: var(--ink); font-size: 13px; }
.editor-placeholder p { max-width: 30ch; margin: 7px 0 0; font-size: 10px; line-height: 1.55; }
.editor-head { display: flex; justify-content: space-between; gap: 14px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.editor-head h3 { margin: 6px 0 5px; font-size: 16px; }
.editor-head small { color: var(--muted); font-size: 9px; }
.editor-close { width: 34px; height: 34px; color: var(--ink); background: transparent; border: 0; cursor: pointer; font-size: 22px; }
.editor-form { display: grid; gap: 14px; margin-top: 18px; }
.editor-form .two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.editor-form textarea { width: 100%; min-height: 72px; padding: 11px 12px; resize: vertical; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; font-size: 11px; }
.toggle-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.toggle-line strong, .toggle-line small { display: block; }
.toggle-line strong { font-size: 11px; }
.toggle-line small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.advanced-fields { padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; }
.advanced-fields summary { cursor: pointer; color: var(--muted); font-size: 10px; font-weight: 700; }
.advanced-fields > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.editor-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding-top: 4px; }
.section-bar { padding: 17px 20px; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; }
.data-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 0 0 10px 10px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 10px; }
th { padding: 12px 13px; color: #7c867f; background: #fafbf9; border-bottom: 1px solid var(--line); text-align: left; font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td.numeric { font-family: "Cascadia Code", monospace; text-align: right; white-space: nowrap; }
.inline-form { display: grid; grid-template-columns: minmax(105px, .65fr) minmax(150px, 1.2fr) auto; gap: 7px; min-width: 380px; }
.inline-form input, .inline-form select, .plan-edit-form input, .plan-edit-form select, .download-edit-form input, .download-edit-form select { min-height: 35px; font-size: 10px; }
.plan-edit-form { display: grid; grid-template-columns: minmax(170px, 1.5fr) 85px 135px 90px auto; gap: 7px; min-width: 650px; }
.download-edit-form { display: grid; grid-template-columns: minmax(270px, 1fr) 90px auto; gap: 7px; min-width: 500px; }

dialog { width: min(465px, calc(100vw - 30px)); padding: 28px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 70px rgba(20, 35, 27, .2); }
dialog::backdrop { background: rgba(21, 31, 25, .48); backdrop-filter: blur(4px); }
.dialog-close { position: absolute; right: 13px; top: 11px; width: 36px; height: 36px; color: var(--muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer; font-size: 22px; }
.dialog-close:hover { background: var(--surface-soft); }
.dialog-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 23px; }
.dialog-brand strong, .dialog-brand small { display: block; }
.dialog-brand strong { font-size: 14px; }
.dialog-brand small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 26px; padding: 4px; background: var(--surface-soft); border-radius: 9px; }
.auth-switch button { min-height: 35px; color: var(--muted); background: transparent; border: 0; border-radius: 7px; cursor: pointer; font-size: 11px; font-weight: 700; }
.auth-switch button.active { color: var(--primary); background: var(--surface); box-shadow: 0 2px 8px rgba(30, 50, 40, .07); }
dialog h2 { margin: 7px 0 4px; font-size: 24px; letter-spacing: -.035em; }
.form-error { min-height: 16px; margin: 0; color: var(--danger); font-size: 10px; }
.loading-overlay { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; align-items: center; gap: 11px; padding: 13px 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); font-size: 11px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .75s linear infinite; }
.toast-region { position: fixed; right: 20px; top: 90px; z-index: 100; display: grid; gap: 9px; width: min(370px, calc(100vw - 40px)); }
.toast { padding: 14px 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--success); border-radius: 9px; box-shadow: var(--shadow); animation: toast-in .28s ease-out; font-size: 11px; }
.toast.error { border-left-color: var(--danger); }
.skeleton { min-height: 100px; background: linear-gradient(100deg, #f0f3ef 30%, #fafbfa 48%, #f0f3ef 66%); background-size: 250% 100%; animation: shimmer 1.4s infinite; }
.skeleton.tall { min-height: 300px; }
.reveal { animation: rise .55s cubic-bezier(.16,1,.3,1) both; }
.reveal-delay { animation-delay: 100ms; }
@keyframes rise { from { opacity: 0; transform: translateY(13px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(12px); } }
@keyframes shimmer { to { background-position-x: -250%; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1400px) {
  .hero { grid-template-columns: minmax(0, .94fr) minmax(0, 1.12fr); gap: 36px; padding-inline: 56px; }
  .hero-actions .button { flex: 1 1 0; min-width: 0 !important; }
  .onboarding-panel { grid-template-columns: .9fr 1.1fr; padding-inline: 20px; }
  .workflow-column { padding-right: 19px; }
  .active-license-column { padding-left: 20px; }
  .step-list li { gap: 11px; }
  .step-list strong { font-size: 12px; }
  .step-list small { font-size: 9px; }
  .pricing-section { padding-inline: 62px; }
}

@media (max-width: 1100px) {
  .public-nav { display: none; }
  .public-header { grid-template-columns: 1fr auto; }
  .hero { grid-template-columns: 1fr 390px; gap: 42px; padding-inline: 36px; }
  .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .user-content { grid-template-columns: 1fr; }
  .purchase-column { grid-template-columns: minmax(220px, .55fr) 1fr; }
  .ledger-panel { grid-column: auto; }
  .license-management { grid-template-columns: minmax(420px, 1.25fr) minmax(310px, .8fr); }
  .admin-summary { grid-template-columns: repeat(3, 1fr); }
  .admin-summary .button { grid-column: 1 / -1; margin: 12px; }
}

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 70px 24px; }
  .hero-copy { max-width: 660px; }
  .onboarding-panel { max-width: 560px; }
  .section { padding: 72px 24px; }
  .section-heading { grid-template-columns: 1fr; gap: 15px; }
  .pricing-list { grid-template-columns: 1fr 1fr; }
  .price-card:nth-child(2n) { border-right: 0; }
  .price-card { border-bottom: 1px solid var(--line); }
  .download-list { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { position: fixed; inset: 0 auto 0 0; width: 236px; transform: translateX(-102%); box-shadow: var(--shadow); transition: transform .22s ease; }
  .app-shell.sidebar-open .app-sidebar { transform: translateX(0); }
  .mobile-menu { display: grid; }
  .app-header { justify-content: flex-start; padding-inline: 18px; }
  .app-header-actions { margin-left: auto; }
  .account-chip { display: none; }
  .app-content { padding: 20px 18px 40px; }
  .license-management { grid-template-columns: 1fr; }
  .admin-list-panel { border-right: 0; }
  .admin-editor { border-top: 1px solid var(--line); }
}

@media (max-width: 560px) {
  .public-header { padding: 10px 14px; }
  .brand-copy small { display: none; }
  .public-actions { gap: 3px; }
  .public-actions .button { min-height: 38px; padding: 0 10px; font-size: 11px; }
  .hero h1 { font-size: 38px; line-height: 1.06; }
  .heading-line { display: inline; }
  .heading-line + .heading-line::before { content: " "; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .trust-row { align-items: flex-start; flex-direction: column; gap: 9px; }
  .onboarding-panel { grid-template-columns: 1fr; padding: 21px; }
  .workflow-column { padding: 0 0 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .active-license-column { padding: 20px 0 0; }
  .pricing-layout { grid-template-columns: 1fr; }
  .pricing-list { grid-template-columns: 1fr; }
  .price-card { min-height: 280px; border-right: 0; }
  footer { flex-direction: column; }
  .app-header h2 { font-size: 17px; }
  .workspace-logout { display: none; }
  .user-content { display: block; }
  .purchase-column { display: grid; grid-template-columns: 1fr; margin-top: 14px; }
  .ledger-panel { margin-top: 14px; }
  .license-top { align-items: flex-start; flex-direction: column; }
  .activation-form { grid-template-columns: 1fr; }
  .config-row { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .copy-button { min-height: 32px; border-top: 1px solid rgba(255,255,255,.09); border-left: 0; }
  .admin-summary { grid-template-columns: 1fr 1fr; }
  .admin-summary > div:nth-child(2) { border-right: 0; }
  .admin-summary > div:nth-child(3) { grid-column: 1 / -1; border-top: 1px solid var(--line); border-right: 0; }
  .list-toolbar { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .editor-form .two-fields, .advanced-fields > div, .editor-actions { grid-template-columns: 1fr; }
  dialog { padding: 22px; }
  .loading-overlay { inset: auto 12px 12px 12px; justify-content: center; }
}

/* Commerce First public storefront */
#public-site { background: #fcfdfb; }
.public-header {
  min-height: 104px;
  padding: 18px clamp(32px, 3.1vw, 52px);
  background: rgba(252, 253, 251, .96);
  backdrop-filter: blur(16px);
}
.public-header .brand { gap: 16px; }
.public-header .brand-mark { width: 47px; height: 53px; font-size: 21px; }
.public-header .brand-copy strong { font-size: clamp(22px, 1.75vw, 30px); letter-spacing: -.035em; text-transform: uppercase; }
.public-nav { gap: clamp(36px, 4vw, 68px); }
.public-nav a { position: relative; color: #111713; font-size: 18px; font-weight: 560; }
.public-nav a:first-child { color: var(--primary); font-weight: 700; }
.public-nav a:first-child::after { content: ""; position: absolute; left: -12px; right: -12px; bottom: -24px; height: 2px; background: var(--primary); }
.public-actions { gap: 24px; }
.public-actions .button { min-width: 184px; min-height: 57px; border-radius: 6px; font-size: 17px; }
.public-actions .button-quiet { color: #17211b; background: #fff; border-color: #89908b; }

.commerce-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 48px;
  min-height: 232px;
  padding: 42px clamp(38px, 3.5vw, 60px) 38px;
}
.commerce-hero-copy h1 { margin: 0; font-size: clamp(43px, 3.65vw, 61px); line-height: 1.05; letter-spacing: -.055em; font-weight: 790; }
.commerce-hero-copy p { margin: 18px 0 0; color: #4e5751; font-size: clamp(16px, 1.4vw, 23px); line-height: 1.45; }
.active-license-metric { display: flex; align-items: baseline; gap: 20px; padding: 14px 8px 0 24px; white-space: nowrap; }
.active-license-metric strong { color: var(--primary); font-size: clamp(47px, 4vw, 66px); line-height: 1; letter-spacing: -.055em; }
.active-license-metric span { color: #1f2923; font-size: clamp(16px, 1.35vw, 22px); font-weight: 520; }

.commerce-pricing { padding: 0 clamp(38px, 3.1vw, 52px) 35px; }
.commerce-pricing .pricing-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  min-height: 426px;
  background: #fff;
  border: 1px solid #bfc6c0;
  border-radius: 7px;
  overflow: hidden;
}
.commerce-pricing .price-card { min-height: 424px; padding: 40px 32px 32px; border-right: 1px solid #bfc6c0; text-align: center; }
.commerce-pricing .price-card:last-child { border-right: 0; }
.commerce-pricing .price-card.featured::before { display: none; }
.commerce-pricing .price-card h3 { margin: 0; font-size: clamp(29px, 2.25vw, 38px); line-height: 1.15; letter-spacing: -.035em; }
.commerce-pricing .price-card .price { margin: 31px 0 24px; color: #08744f; font-size: clamp(44px, 4.2vw, 70px); line-height: 1; font-weight: 760; letter-spacing: -.045em; }
.commerce-pricing .price-card .price .price-amount { color: inherit; font-size: 1em; font-weight: inherit; letter-spacing: inherit; }
.commerce-pricing .price-card .price .price-currency { margin-left: 10px; color: inherit; font-size: .44em; font-weight: 720; }
.commerce-pricing .plan-features { display: block; margin: 0 0 28px; padding: 32px 12px 0; color: #202a24; border-top: 1px solid #cbd0cc; font-size: clamp(15px, 1.35vw, 22px); text-align: left; }
.commerce-pricing .plan-features li::before { display: inline-grid; place-items: center; width: 29px; height: 29px; margin-right: 14px; border: 2px solid var(--primary); border-radius: 50%; font-size: 16px; line-height: 1; }
.commerce-pricing .price-card .button { width: 100%; min-height: 69px; margin-top: auto; border-radius: 5px; font-size: clamp(18px, 1.45vw, 24px); }
.commerce-pricing .empty-state { grid-column: 1 / -1; align-self: center; }

@media (min-width: 821px) {
  .commerce-pricing .pricing-list[data-plan-count="1"] {
    grid-template-columns: minmax(0, 520px);
    justify-content: center;
    background: transparent;
    border: 0;
  }
  .commerce-pricing .pricing-list[data-plan-count="1"] > .price-card {
    border: 1px solid #bfc6c0;
    border-radius: 7px;
  }
  .commerce-pricing .pricing-list[data-plan-count="2"] {
    grid-template-columns: repeat(2, minmax(0, 520px));
    max-width: 1040px;
    margin-inline: auto;
  }
}

.commerce-downloads { min-height: 146px; background: #fff; border-top: 1px solid #bfc6c0; border-bottom: 1px solid #d7ddd8; }
.commerce-downloads .download-list { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 1080px; min-height: 145px; margin: auto; gap: 0; }
.commerce-downloads .download-button { display: grid; grid-template-columns: 68px 1fr; grid-template-rows: auto auto; align-content: center; min-height: 145px; padding: 28px 48px; color: #151c18; background: transparent; border: 0; border-right: 1px solid #d8ddd9; border-radius: 0; }
.commerce-downloads .download-button:last-child { border-right: 0; }
.commerce-downloads .download-button > span { grid-row: 1 / 3; width: 52px; height: 52px; color: #08744f; background: transparent; border-radius: 0; font-size: 13px; }
.commerce-downloads .download-button > span svg { display: block; width: 48px; height: 48px; fill: currentColor; }
.commerce-downloads .download-button strong { font-size: 18px; font-weight: 690; }
.commerce-downloads .download-button small { margin-top: 7px; font-size: 13px; }
.commerce-downloads .download-button:not(:disabled):hover { background: #f2f7f4; border-color: #d8ddd9; box-shadow: none; }

@media (max-width: 1180px) {
  .public-header { min-height: 84px; }
  .public-actions { gap: 8px; }
  .public-actions .button { min-width: 138px; min-height: 48px; }
  .commerce-hero { min-height: 210px; }
  .commerce-downloads .download-button { padding-inline: 28px; }
}

@media (max-width: 820px) {
  .commerce-hero { grid-template-columns: 1fr; gap: 22px; min-height: 0; padding: 56px 24px 44px; }
  .active-license-metric { padding: 0; }
  .commerce-pricing { padding: 0 24px 28px; }
  .commerce-pricing .pricing-list { grid-template-columns: 1fr; }
  .commerce-pricing .price-card { min-height: 390px; border-right: 0; border-bottom: 1px solid #bfc6c0; }
  .commerce-pricing .price-card:last-child { border-bottom: 0; }
  .commerce-downloads .download-list { grid-template-columns: 1fr; }
  .commerce-downloads .download-button { min-height: 104px; border-right: 0; border-bottom: 1px solid #d8ddd9; }
  .commerce-downloads .download-button:last-child { border-bottom: 0; }
}

@media (max-width: 560px) {
  .public-header { min-height: 70px; }
  .public-header .brand-mark { width: 34px; height: 39px; font-size: 15px; }
  .public-header .brand-copy strong { font-size: 17px; }
  .public-actions .button { min-width: 0; min-height: 39px; }
  .public-actions #open-register { display: none; }
  .commerce-hero-copy h1 { font-size: 42px; }
  .commerce-hero-copy p { font-size: 16px; }
  .active-license-metric { align-items: center; gap: 12px; }
  .active-license-metric strong { font-size: 48px; }
  .active-license-metric span { white-space: normal; font-size: 15px; }
  .commerce-pricing .price-card { min-height: 360px; padding: 34px 22px 24px; }
  .commerce-pricing .price-card .price { font-size: 43px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
