:root {
  color-scheme: light;
  --navy: #101827;
  --navy-2: #172235;
  --navy-3: #22304a;
  --paper: #f3f5f8;
  --card: #ffffff;
  --ink: #172033;
  --muted: #6d7788;
  --line: #e2e6ec;
  --line-dark: rgba(255, 255, 255, 0.09);
  --red: #d84949;
  --red-dark: #bb3939;
  --green: #14845d;
  --amber: #b76d16;
  --blue: #3468b2;
  --shadow: 0 20px 50px rgba(17, 24, 39, 0.1);
  --radius: 6px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.loading-screen { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; gap: 18px; text-align: center; color: #7c8595; background: var(--paper); transition: opacity .3s ease; }
.loading-screen.hide { opacity: 0; pointer-events: none; }
.loading-screen p { margin: 0; font-size: 13px; letter-spacing: .08em; }

.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand.light { color: white; }
.brand strong, .mobile-brand strong { font-family: Georgia, "Songti SC", serif; font-size: 25px; letter-spacing: .16em; }
.brand small { margin-left: 2px; color: #7f8da3; font-size: 8px; letter-spacing: .19em; }
.brand-mark { display: inline-flex; align-items: flex-end; gap: 2px; width: 31px; height: 31px; padding: 7px 6px; color: white; background: var(--red); transform: skew(-8deg); }
.brand-mark span { display: block; width: 4px; background: currentColor; transform: skew(8deg); }
.brand-mark span:nth-child(1) { height: 8px; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 12px; }
.brand-mark.large { width: 48px; height: 48px; margin: auto; padding: 11px 10px; }
.brand-mark.large span { width: 6px; }

.auth-shell { display: grid; grid-template-columns: minmax(520px, 1.12fr) minmax(480px, .88fr); min-height: 100vh; background: white; }
.auth-brand { position: relative; isolation: isolate; overflow: hidden; color: white; background: linear-gradient(145deg, #121d30 0%, #182741 66%, #101a2b 100%); }
.auth-brand::before { position: absolute; inset: auto -16% -29% auto; z-index: -1; width: 70%; aspect-ratio: 1; content: ""; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 80px rgba(255,255,255,.018), 0 0 0 160px rgba(255,255,255,.013); }
.auth-grid { position: absolute; inset: 0; z-index: -2; opacity: .27; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 58px 58px; mask-image: linear-gradient(90deg, black, transparent 96%); }
.auth-brand-inner { display: flex; flex-direction: column; width: min(650px, 82%); min-height: 100vh; margin: auto; padding: 54px 0 60px; }
.auth-copy { margin: auto 0 74px; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--red); font-size: 10px; font-weight: 750; letter-spacing: .22em; }
.eyebrow::before { width: 24px; height: 1px; content: ""; background: currentColor; }
.eyebrow.light { color: #e36565; }
.auth-copy h1 { max-width: 620px; margin: 23px 0 25px; font-family: Georgia, "Songti SC", serif; font-size: clamp(42px, 4.3vw, 65px); font-weight: 500; line-height: 1.24; letter-spacing: .02em; }
.auth-copy p { max-width: 550px; margin: 0; color: #9ca9ba; font-size: 16px; line-height: 2; }
.auth-features { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-dark); }
.auth-features div { padding: 25px 20px 0 0; border-right: 1px solid var(--line-dark); }
.auth-features div + div { padding-left: 24px; }
.auth-features div:last-child { border-right: 0; }
.auth-features b { display: block; font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.auth-features span { display: block; margin-top: 8px; color: #8491a4; font-size: 11px; }

.auth-panel { display: grid; place-items: center; padding: 45px 8vw; background: #fbfbfc; }
.auth-card { width: min(100%, 430px); }
.mobile-brand { display: none; }
.auth-heading h2 { margin: 15px 0 7px; font-family: Georgia, "Songti SC", serif; font-size: 33px; font-weight: 500; }
.auth-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 35px 0 28px; border-bottom: 1px solid var(--line); }
.auth-tabs button { padding: 13px; color: #818999; background: transparent; border: 0; border-bottom: 2px solid transparent; font-size: 13px; font-weight: 650; }
.auth-tabs button.active { color: var(--red); border-bottom-color: var(--red); }
.stack-form { display: grid; gap: 20px; }
.stack-form label > span { display: block; margin-bottom: 8px; color: #3d4655; font-size: 12px; font-weight: 650; }
.stack-form em { color: #9ba2ad; font-size: 10px; font-style: normal; font-weight: 400; }
.input-wrap { display: flex; align-items: center; height: 50px; padding: 0 14px; background: white; border: 1px solid #dce1e7; border-radius: var(--radius); transition: .2s; }
.input-wrap:focus-within { border-color: #8996aa; box-shadow: 0 0 0 3px rgba(16, 24, 39, .05); }
.input-wrap > svg { flex: 0 0 auto; width: 17px; color: #9ca4b1; }
.input-wrap input { flex: 1; min-width: 0; height: 100%; padding: 0 11px; color: var(--ink); outline: 0; border: 0; background: transparent; font-size: 13px; }
.input-wrap input::placeholder { color: #b2b8c1; }
.peek { display: grid; padding: 5px; color: #9ca4b1; border: 0; background: transparent; }
.peek svg { width: 17px; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 0 22px; color: white; background: var(--red); border: 1px solid var(--red); border-radius: var(--radius); font-size: 13px; font-weight: 700; box-shadow: 0 8px 20px rgba(216,73,73,.17); transition: .18s; }
.primary:hover { background: var(--red-dark); transform: translateY(-1px); }
.primary:disabled { cursor: wait; opacity: .62; transform: none; }
.primary.full { width: 100%; margin-top: 6px; }
.primary svg { width: 17px; }
.auth-legal { display: flex; align-items: flex-start; gap: 10px; margin: 27px 0 0; padding: 17px; color: #848c9a; background: #f2f4f7; border-left: 2px solid #8d98a9; font-size: 10px; line-height: 1.7; }
.auth-legal svg { flex: 0 0 auto; width: 15px; color: #607087; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; width: 242px; flex-direction: column; color: #b4bdcb; background: var(--navy); border-right: 1px solid #202d42; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; min-height: 85px; padding: 0 25px; border-bottom: 1px solid var(--line-dark); }
.sidebar-head .brand { flex-wrap: wrap; column-gap: 9px; }
.sidebar-head .brand small { width: 100%; margin: -3px 0 0 41px; }
.sidebar-close { display: none; color: white; border: 0; background: transparent; }
.sidebar nav { flex: 1; padding: 25px 15px; overflow-y: auto; }
.nav-label { display: block; margin: 5px 13px 11px; color: #647188; font-size: 9px; font-weight: 700; letter-spacing: .17em; }
.nav-label:not(:first-child) { margin-top: 29px; }
.sidebar nav a { display: flex; align-items: center; gap: 13px; min-height: 44px; margin: 3px 0; padding: 0 13px; color: #aeb8c7; text-decoration: none; border-left: 2px solid transparent; border-radius: 3px; font-size: 12px; transition: .16s; }
.sidebar nav a:hover { color: white; background: rgba(255,255,255,.04); }
.sidebar nav a.active { color: white; background: linear-gradient(90deg, rgba(216,73,73,.18), rgba(216,73,73,.05)); border-left-color: var(--red); }
.sidebar nav a svg { width: 18px; }
.sidebar nav a b { margin-left: auto; padding: 3px 6px; color: #e88484; background: rgba(216,73,73,.13); border-radius: 2px; font-size: 8px; font-weight: 600; }
.sidebar-foot { padding: 15px; border-top: 1px solid var(--line-dark); }
.security-chip { display: flex; align-items: center; gap: 10px; padding: 12px; background: rgba(255,255,255,.035); border: 1px solid var(--line-dark); }
.security-chip > svg { width: 15px; color: #6fddac; }
.security-chip div { flex: 1; min-width: 0; }
.security-chip strong, .security-chip span { display: block; }
.security-chip strong { color: #d7dde6; font-size: 10px; }
.security-chip span { margin-top: 3px; color: #69778b; font-size: 8px; }
.security-chip em { width: 6px; height: 6px; background: #36c485; border-radius: 50%; box-shadow: 0 0 0 4px rgba(54,196,133,.08); }
.sidebar-foot > button { display: flex; align-items: center; gap: 11px; width: 100%; margin-top: 9px; padding: 11px; color: #8490a3; background: transparent; border: 0; font-size: 11px; }
.sidebar-foot > button:hover { color: white; }
.sidebar-foot > button svg { width: 16px; }

.app-main { min-height: 100vh; margin-left: 242px; }
.topbar { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; min-height: 85px; padding: 0 34px; background: rgba(255,255,255,.95); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar > div:first-of-type { flex: 1; }
.topbar p { margin: 0 0 4px; color: var(--red); font-size: 8px; font-weight: 800; letter-spacing: .18em; }
.topbar h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 22px; font-weight: 500; }
.menu-btn { display: none; margin-right: 12px; color: var(--ink); border: 0; background: transparent; }
.top-actions { display: flex; align-items: center; gap: 15px; }
.system-state { display: flex; align-items: center; gap: 7px; padding: 7px 10px; color: #607064; background: #f3f8f5; border: 1px solid #dcebe2; font-size: 9px; }
.system-state span { width: 6px; height: 6px; background: #2fac72; border-radius: 50%; }
.balance-chip { padding: 6px 12px; background: #fafbfc; border: 1px solid var(--line); }
.balance-chip span, .balance-chip strong { display: block; }
.balance-chip span { color: #8b94a1; font-size: 7px; }
.balance-chip strong { margin-top: 2px; color: #1a7357; font-family: Georgia, serif; font-size: 12px; }
.icon-button { display: grid; width: 36px; height: 36px; place-items: center; color: #697386; background: white; border: 1px solid var(--line); border-radius: 4px; }
.icon-button svg { width: 16px; }
.user-menu { display: flex; align-items: center; gap: 9px; padding-left: 15px; border-left: 1px solid var(--line); }
.user-menu > span { display: grid; width: 35px; height: 35px; place-items: center; color: white; background: var(--navy-3); border-radius: 3px; font-family: Georgia, serif; }
.user-menu strong, .user-menu small { display: block; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu strong { font-size: 10px; }
.user-menu small { margin-top: 2px; color: #929aa7; font-size: 8px; }

.page-content { width: min(100%, 1500px); margin: auto; padding: 30px 34px 60px; }
.page-intro { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-intro h2 { margin: 0 0 7px; font-family: Georgia, "Songti SC", serif; font-size: 28px; font-weight: 500; }
.page-intro p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.outline-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; color: #3d4656; background: white; border: 1px solid #dce1e7; border-radius: 4px; font-size: 10px; font-weight: 650; }
.outline-btn:hover { border-color: #9ca6b4; }
.outline-btn svg { width: 15px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { position: relative; min-height: 132px; padding: 22px; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.stat-card::after { position: absolute; inset: 0 0 auto; height: 2px; content: ""; background: var(--accent, #637083); }
.stat-head { display: flex; align-items: center; justify-content: space-between; color: #778193; font-size: 10px; }
.stat-icon { display: grid; width: 32px; height: 32px; place-items: center; color: var(--accent, #637083); background: color-mix(in srgb, var(--accent, #637083) 9%, white); border-radius: 3px; }
.stat-icon svg { width: 16px; }
.stat-card b { display: block; margin: 19px 0 6px; font-family: Georgia, serif; font-size: 30px; font-weight: 500; }
.stat-card small { color: #9aa1ad; font-size: 9px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .8fr); gap: 16px; margin-top: 16px; }
.panel { background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 16px; font-weight: 500; }
.panel-head a { color: var(--red); font-size: 9px; text-decoration: none; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 40px; padding: 0 17px; color: #8992a1; background: #fafbfc; border-bottom: 1px solid var(--line); font-size: 8px; font-weight: 700; letter-spacing: .06em; text-align: left; white-space: nowrap; }
td { padding: 14px 17px; border-bottom: 1px solid #edf0f3; font-size: 10px; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: .15s; }
tbody tr:hover { background: #fafbfc; }
.record-person strong, .record-person span { display: block; }
.record-person strong { font-size: 10px; font-weight: 650; }
.record-person span { margin-top: 3px; color: #939ba8; font-size: 8px; }
.mono { color: #606b7c; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 2px; font-size: 8px; }
.badge::before { width: 4px; height: 4px; content: ""; border-radius: 50%; background: currentColor; }
.badge.low, .badge.success { color: #1b7f5e; background: #eaf7f1; }
.badge.medium, .badge.review { color: #a36415; background: #fff5e6; }
.badge.high, .badge.failed { color: #c23f43; background: #fdecED; }
.row-action { padding: 5px; color: #7d8796; background: transparent; border: 0; }
.row-action svg { width: 15px; }
.empty-state { padding: 55px 20px; color: #8c95a3; text-align: center; }
.empty-state svg { width: 30px; height: 30px; margin-bottom: 10px; }
.empty-state p { margin: 0; font-size: 11px; }

.product-chart { padding: 20px; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 24px; align-items: center; gap: 10px; margin: 15px 0; font-size: 9px; }
.bar-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 6px; overflow: hidden; background: #eef1f4; }
.bar-track i { display: block; height: 100%; background: var(--navy-3); }
.bar-row b { font-family: Georgia, serif; font-size: 11px; font-weight: 500; text-align: right; }
.quick-query { display: grid; place-items: center; min-height: 140px; margin-top: 16px; padding: 20px; color: white; text-align: center; background: linear-gradient(140deg, #17243a, #243654); border-radius: var(--radius); }
.quick-query h3 { margin: 9px 0 5px; font-family: Georgia, "Songti SC", serif; font-size: 17px; font-weight: 500; }
.quick-query p { margin: 0 0 14px; color: #96a5ba; font-size: 9px; }
.quick-query .primary { min-height: 36px; font-size: 9px; }

.query-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 18px; align-items: start; }
.query-card { padding: 28px; }
.section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 23px; }
.section-title > span { display: grid; width: 34px; height: 34px; place-items: center; color: var(--red); background: #fdf0f0; }
.section-title svg { width: 17px; }
.section-title h3, .section-title p { margin: 0; }
.section-title h3 { font-family: Georgia, "Songti SC", serif; font-size: 16px; font-weight: 500; }
.section-title p { margin-top: 4px; color: #8d95a2; font-size: 9px; }
.product-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 29px; }
.product-option { position: relative; display: flex; min-height: 78px; align-items: center; gap: 12px; padding: 12px; text-align: left; background: white; border: 1px solid var(--line); border-radius: 4px; }
.product-option:hover { border-color: #abb4c1; }
.product-option.selected { border-color: var(--navy-3); box-shadow: inset 3px 0 var(--red); }
.product-option .product-icon { display: grid; width: 37px; height: 37px; flex: 0 0 auto; place-items: center; color: var(--tone); background: color-mix(in srgb, var(--tone) 9%, white); }
.product-option svg { width: 17px; }
.product-option strong, .product-option span { display: block; }
.product-option strong { font-size: 10px; }
.product-option span { margin-top: 5px; color: #8b94a1; font-size: 8px; line-height: 1.4; }
.product-option em { position: absolute; top: 8px; right: 8px; display: none; width: 15px; height: 15px; place-items: center; color: white; background: var(--navy-3); border-radius: 50%; font-size: 9px; font-style: normal; }
.product-option.selected em { display: grid; }
.query-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 17px; }
.query-form label span { display: block; margin-bottom: 8px; color: #4b5564; font-size: 10px; font-weight: 650; }
.query-form label.full, .query-form .consent-row, .query-form .query-submit { grid-column: 1 / -1; }
.query-form input { width: 100%; height: 45px; padding: 0 13px; color: var(--ink); outline: 0; background: #fff; border: 1px solid #dce1e7; border-radius: 4px; font-size: 11px; }
.query-form input:focus { border-color: #8e99aa; box-shadow: 0 0 0 3px rgba(16,24,39,.04); }
.consent-row { display: flex !important; align-items: flex-start; gap: 9px; padding: 14px; color: #7b8492; background: #f7f8fa; border-left: 2px solid #9ca7b7; font-size: 9px; line-height: 1.65; }
.consent-row input { width: 14px; height: 14px; margin: 1px 0 0; accent-color: var(--red); }
.query-submit { min-height: 48px; }
.query-tips { padding: 23px; }
.query-tips h3 { margin: 0 0 18px; font-family: Georgia, "Songti SC", serif; font-size: 16px; font-weight: 500; }
.tip-list { display: grid; gap: 18px; }
.tip { display: flex; gap: 12px; }
.tip > span { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; color: #506078; background: #f0f3f7; }
.tip svg { width: 14px; }
.tip strong, .tip p { display: block; margin: 0; }
.tip strong { margin: 1px 0 4px; font-size: 10px; }
.tip p { color: #8a93a0; font-size: 8px; line-height: 1.6; }
.provider-note { margin-top: 23px; padding: 16px; color: #7c8696; background: #f8f9fb; border: 1px solid #edf0f3; font-size: 8px; line-height: 1.7; }

.filters { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.filters .search-input { position: relative; flex: 1; max-width: 340px; }
.filters .search-input svg { position: absolute; top: 50%; left: 12px; width: 15px; color: #98a0ad; transform: translateY(-50%); }
.filters input, .filters select { height: 39px; padding: 0 12px; color: #566072; background: white; border: 1px solid #dce1e7; outline: 0; border-radius: 4px; font-size: 10px; }
.filters .search-input input { width: 100%; padding-left: 37px; }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; color: #87909d; border-top: 1px solid var(--line); font-size: 9px; }
.pagination div { display: flex; gap: 6px; }
.pagination button { min-width: 30px; height: 29px; color: #667183; background: white; border: 1px solid var(--line); font-size: 9px; }
.pagination button:disabled { opacity: .4; cursor: default; }

.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.product-card { display: flex; min-height: 210px; flex-direction: column; padding: 23px; background: white; border: 1px solid var(--line); border-top: 2px solid var(--tone); border-radius: var(--radius); }
.product-card > span { display: grid; width: 39px; height: 39px; place-items: center; color: var(--tone); background: color-mix(in srgb, var(--tone) 9%, white); }
.product-card > span svg { width: 18px; }
.product-card small { margin: 20px 0 7px; color: var(--tone); font-size: 8px; font-weight: 750; letter-spacing: .08em; }
.product-card h3 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 17px; font-weight: 500; }
.product-card p { flex: 1; margin: 10px 0; color: #7f8998; font-size: 9px; line-height: 1.75; }
.product-card button { align-self: flex-start; padding: 0; color: var(--red); background: transparent; border: 0; font-size: 9px; }
.product-price { margin-bottom: 13px; color: var(--ink); font-family: Georgia, serif; font-size: 15px; }
.wallet-hero { display: flex; align-items: center; justify-content: space-between; min-height: 160px; margin-bottom: 16px; padding: 30px 35px; color: white; background: linear-gradient(135deg, #18263d, #263b5e); border-radius: var(--radius); }
.wallet-hero span, .wallet-hero strong, .wallet-hero p { display: block; margin: 0; }
.wallet-hero span { color: #9cabc0; font-size: 10px; }
.wallet-hero strong { margin: 12px 0 7px; font-family: Georgia, serif; font-size: 38px; font-weight: 500; }
.wallet-hero p { color: #8999af; font-size: 9px; }
.wallet-hero > svg { width: 65px; height: 65px; color: #d95b5b; stroke-width: 1; }
.money-cell { font-family: ui-monospace, monospace; font-weight: 700; }
.money-cell.income { color: var(--green); }
.money-cell.expense { color: var(--red); }
.subtle { color: #929aa7; font-size: 8px; }
.admin-stats { grid-template-columns: repeat(3, 1fr); margin-bottom: 16px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr); gap: 16px; align-items: start; }
.price-list { padding: 8px 18px; }
.price-row { display: grid; grid-template-columns: minmax(120px,1fr) 105px 75px 58px; align-items: end; gap: 9px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.price-row:last-child { border-bottom: 0; }
.price-row > div strong, .price-row > div span { display: block; }
.price-row > div strong { font-size: 10px; }
.price-row > div span { margin-top: 3px; color: #989fab; font-family: monospace; font-size: 7px; }
.price-row label { color: #8b94a1; font-size: 7px; }
.price-row input { width: 100%; height: 30px; margin-top: 4px; padding: 0 7px; border: 1px solid var(--line); font-size: 9px; }
.price-row label strong { display: block; margin-top: 9px; color: var(--ink); font-size: 10px; }
.price-row .outline-btn { min-height: 30px; padding: 0 8px; }
.admin-queries { margin-top: 16px; }
.delete-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; color: var(--red); background: #fff5f5; border: 1px solid #f3d3d3; font-size: 8px; }
.delete-btn svg { width: 12px; }

.security-hero { display: grid; grid-template-columns: 1fr 220px; gap: 30px; padding: 34px; color: white; background: linear-gradient(135deg, #17243a, #233653); }
.security-hero h2 { margin: 13px 0 12px; font-family: Georgia, "Songti SC", serif; font-size: 29px; font-weight: 500; }
.security-hero p { max-width: 720px; margin: 0; color: #a6b2c3; font-size: 11px; line-height: 1.9; }
.security-shield { display: grid; place-items: center; color: #e26a6a; }
.security-shield svg { width: 90px; height: 90px; stroke-width: .8; }
.security-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 15px; }
.security-card { padding: 23px; }
.security-card svg { width: 24px; color: #52647d; }
.security-card h3 { margin: 17px 0 8px; font-family: Georgia, "Songti SC", serif; font-size: 15px; font-weight: 500; }
.security-card p { margin: 0; color: #808a99; font-size: 9px; line-height: 1.75; }

.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10, 17, 28, .62); backdrop-filter: blur(3px); }
.modal-panel { position: relative; width: min(800px, 100%); max-height: min(88vh, 900px); overflow: hidden auto; background: white; border-radius: 7px; box-shadow: 0 28px 80px rgba(0,0,0,.3); }
.modal-panel > header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; min-height: 82px; padding: 0 25px; background: white; border-bottom: 1px solid var(--line); }
.modal-panel > header h2 { margin: 7px 0 0; font-family: Georgia, "Songti SC", serif; font-size: 20px; font-weight: 500; }
.modal-panel > header button { display: grid; width: 34px; height: 34px; place-items: center; color: #6f7887; background: #f7f8fa; border: 1px solid var(--line); }
#modalBody { padding: 25px; }
.result-summary { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); margin-bottom: 19px; border: 1px solid var(--line); }
.result-summary div { padding: 16px; border-right: 1px solid var(--line); }
.result-summary div:last-child { border-right: 0; }
.result-summary span, .result-summary strong { display: block; }
.result-summary span { color: #8a93a0; font-size: 8px; }
.result-summary strong { margin-top: 7px; font-size: 10px; }
.risk-callout { display: flex; align-items: center; gap: 14px; margin-bottom: 19px; padding: 17px; background: #f7f8fa; border-left: 3px solid var(--risk-color); }
.risk-callout > span { display: grid; width: 34px; height: 34px; place-items: center; color: var(--risk-color); background: white; }
.risk-callout strong, .risk-callout p { display: block; margin: 0; }
.risk-callout strong { font-size: 11px; }
.risk-callout p { margin-top: 4px; color: #798391; font-size: 9px; }
.json-tree { padding: 18px; background: #111b2b; border-radius: 4px; }
.json-tree h3 { margin: 0 0 14px; color: white; font-family: Georgia, "Songti SC", serif; font-size: 14px; font-weight: 500; }
.json-tree pre { margin: 0; overflow: auto; color: #bdc9da; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }

.toast { position: fixed; z-index: 90; right: 24px; bottom: 24px; display: flex; align-items: center; gap: 9px; min-width: 240px; padding: 14px 17px; color: white; background: #172336; border-left: 3px solid #38a978; box-shadow: var(--shadow); font-size: 10px; }
.toast.error { border-left-color: var(--red); }
.toast svg { width: 16px; }
.spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.35); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .query-layout { grid-template-columns: 1fr; }
  .query-tips { display: none; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: .9fr 1.1fr; }
  .auth-features { grid-template-columns: 1fr; }
  .auth-features div { border-right: 0; }
  .auth-features div + div { padding-left: 0; }
  .auth-features div:nth-child(n+2) { display: none; }
}

@media (max-width: 820px) {
  .auth-shell { display: block; background: #f5f6f8; }
  .auth-brand { display: none; }
  .auth-panel { min-height: 100vh; padding: 45px 20px; }
  .mobile-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 45px; }
  .sidebar { transform: translateX(-102%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close, .menu-btn { display: grid; }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 35; display: none; background: rgba(8,15,26,.5); }
  .sidebar.open + .sidebar-overlay { display: block; }
  .app-main { margin-left: 0; }
  .topbar { padding: 0 18px; }
  .page-content { padding: 23px 18px 45px; }
  .system-state, .icon-button { display: none; }
  .balance-chip { display: none; }
  .user-menu div { display: none; }
  .product-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .auth-panel { align-items: start; padding-top: 28px; }
  .auth-heading h2 { font-size: 28px; }
  .stat-grid, .admin-stats, .product-grid, .product-picker, .query-form, .security-grid { grid-template-columns: 1fr; }
  .price-row { grid-template-columns: 1fr 1fr; }
  .query-form label.full, .query-form .consent-row, .query-form .query-submit { grid-column: auto; }
  .page-intro { align-items: flex-start; flex-direction: column; }
  .page-intro .outline-btn { width: 100%; justify-content: center; }
  .stat-card { min-height: 118px; }
  .query-card { padding: 20px; }
  .security-hero { grid-template-columns: 1fr; padding: 25px; }
  .security-shield { display: none; }
  .filters { align-items: stretch; flex-direction: column; }
  .filters .search-input { max-width: none; }
  .result-summary { grid-template-columns: 1fr 1fr; }
  .result-summary div:nth-child(2) { border-right: 0; }
  .result-summary div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .modal { padding: 10px; }
  #modalBody { padding: 17px; }
  .toast { right: 14px; bottom: 14px; left: 14px; }
}
