:root {
    --bg: #FAFBFC; --bg-card: #FFFFFF; --bg-hover: #F4F5F7; --bg-input: #F7F8FA;
    --border: #E8ECF1; --border-focus: #3B82F6; --border-hover: #D1D5DB;
    --text-primary: #111827; --text-secondary: #6B7280; --text-tertiary: #9CA3AF; --text-link: #3B82F6;
    --accent: #3B82F6; --accent-hover: #2563EB; --accent-soft: #EFF6FF; --accent-text: #FFFFFF;
    --green: #10B981; --green-soft: #ECFDF5; --red: #EF4444; --red-soft: #FEF2F2;
    --orange: #F59E0B; --orange-soft: #FFFBEB; --purple: #8B5CF6; --purple-soft: #F5F3FF;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05); --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --radius: 12px; --radius-sm: 8px; --radius-lg: 16px;
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --nav-height: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text-primary); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }

/* ── NAV ── */
.site-nav { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.85); backdrop-filter: blur(20px) saturate(1.8); -webkit-backdrop-filter: blur(20px) saturate(1.8); border-bottom: 1px solid var(--border); height: var(--nav-height); display: flex; align-items: center; padding: 0 24px; }
.nav-inner { max-width: 1152px; width: 100%; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.nav-brand { font-weight: 800; font-size: 18px; letter-spacing: -0.5px; color: var(--text-primary); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.nav-brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(16,185,129,0.4); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link { padding: 8px 14px; font-size: 13px; font-weight: 500; color: var(--text-secondary); text-decoration: none; border-radius: var(--radius-sm); transition: all 0.2s; cursor: pointer; }
.nav-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-link.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.nav-link .bi { margin-right: 5px; }
.nav-balance { display: flex; align-items: center; gap: 6px; padding: 6px 14px; background: var(--green-soft); border: 1px solid rgba(16,185,129,0.15); border-radius: 20px; font-size: 13px; font-weight: 700; color: var(--green); margin-right: 8px; }
.nav-user { display: flex; align-items: center; gap: 12px; }
.nav-guest { display: flex; align-items: center; gap: 4px; }
.nav-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--purple)); display: flex; align-items: center; justify-content: center; color: white; font-size: 12px; font-weight: 700; }
.js-avatar { overflow: hidden; }
.js-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.js-avatar.has-img { background: var(--bg-input); }
.nav-profile-top { display: none !important; }

/* ── LAYOUT ── */
.page-wrap { max-width: 1200px; margin: 0 auto; padding: 32px 24px 80px; min-height: calc(100vh - var(--nav-height)); }

/* ── CARDS ── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.card-elevated { box-shadow: var(--shadow-md); }
.card-hover { transition: all 0.2s; cursor: pointer; }
.card-hover:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; font-family: var(--font); font-size: 13px; font-weight: 600; border-radius: var(--radius-sm); border: none; cursor: pointer; transition: all 0.2s; text-decoration: none; line-height: 1.4; }
.btn-primary { background: var(--accent); color: var(--accent-text); box-shadow: 0 1px 2px rgba(59,130,246,0.3); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 2px 8px rgba(59,130,246,0.35); }
.btn-outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--border-hover); color: var(--text-primary); background: var(--bg-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); padding: 8px 12px; }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-hover); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 14px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; letter-spacing: 0.02em; }
.form-input { width: 100%; padding: 10px 14px; font-family: var(--font); font-size: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text-primary); transition: all 0.2s; outline: none; }
.form-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); background: white; }
.form-input::placeholder { color: var(--text-tertiary); }
.form-input-lg { padding: 14px 18px; font-size: 16px; font-family: 'SF Mono', 'Fira Code', monospace, var(--font); letter-spacing: 1px; }
textarea.form-input { resize: vertical; min-height: 120px; font-family: 'SF Mono', 'Fira Code', monospace; font-size: 13px; line-height: 1.8; }
select.form-input { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%239CA3AF'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-pending { background: var(--orange-soft); color: var(--orange); }
.badge-success { background: var(--green-soft); color: var(--green); }
.badge-failed { background: var(--red-soft); color: var(--red); }
.badge-group { padding: 4px 12px; font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }

/* ── TABS ── */
.tab-nav { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab-btn { padding: 12px 20px; font-size: 13px; font-weight: 500; color: var(--text-tertiary); cursor: pointer; border: none; background: none; font-family: var(--font); position: relative; transition: color 0.2s; }
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active { color: var(--accent); font-weight: 600; }
.tab-btn.active::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--accent); border-radius: 2px 2px 0 0; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.25s ease; }

/* ── SERVICE LIST ── */
.svc-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.svc-cat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-tertiary); padding: 20px 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.svc-cat-label:first-child { padding-top: 0; }
.svc-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s; border: 2px solid transparent; }
.svc-item:hover { background: var(--bg-hover); }
.svc-item.selected { background: var(--accent-soft); border-color: var(--accent); }
.svc-icon { font-size: 20px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--bg-hover); flex-shrink: 0; }
.svc-info { flex: 1; min-width: 0; }
.svc-name { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.3; overflow-wrap: anywhere; } /* full name, wraps instead of '...' */
.svc-desc { font-size: 11px; color: var(--text-tertiary); line-height: 1.35; margin-top: 2px; overflow-wrap: anywhere; max-height: 2.7em; overflow: hidden; } /* full name always, description max 2 lines */
.svc-price { font-size: 13px; font-weight: 700; color: var(--green); flex-shrink: 0; }
.svc-search { margin-bottom: 16px; position: relative; }
.svc-search .bi-search { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); font-size: 14px; }
.svc-search input { padding-left: 36px; }
.svc-list-wrap { max-height: 480px; overflow-y: auto; padding-right: 4px; }
.svc-list-wrap::-webkit-scrollbar { width: 4px; }
.svc-list-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── RESULT ── */
.result-box { background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; font-family: 'SF Mono', 'Fira Code', monospace; font-size: 13px; line-height: 1.8; word-break: break-all; max-height: 800px; overflow-y: auto; }

/* ── ORDER TABLE ── */
.order-table { width: 100%; border-collapse: collapse; }
.order-table th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-tertiary); text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.order-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.order-table tr:last-child td { border-bottom: none; }
.order-table tr:hover td { background: var(--bg-hover); }
.order-id { font-weight: 600; color: var(--text-primary); font-family: monospace; }
.order-imei { font-family: monospace; font-size: 12px; color: var(--text-secondary); }

/* ── AUTH PAGE ── */
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - var(--nav-height)); padding: 24px; }
.auth-card { width: 100%; max-width: 460px; }
.auth-title { font-size: 24px; font-weight: 800; margin-bottom: 4px; letter-spacing: -0.5px; }
.auth-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 28px; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-secondary); }
.auth-switch a { color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: none; }

/* ── STATS ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { padding: 20px; }
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-tertiary); margin-bottom: 4px; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -1px; color: var(--text-primary); }
.stat-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }

/* ── TOAST ── */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); animation: slideIn 0.3s ease; max-width: 380px; }
.toast-success { background: #065F46; color: white; }
.toast-error { background: #991B1B; color: white; }
.toast-info { background: #1E40AF; color: white; }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── PAGE TRANSITIONS ── */
.page { display: none; animation: fadeUp 0.3s ease; }
.page.active { display: block; }

/* ── MOBILE ── */
/* no blue flash when tapping on Android / iOS */
* { -webkit-tap-highlight-color: transparent; }
/* invisible layer behind the open phone menu: a tap on it closes the menu */
.menu-backdrop { display: none; position: fixed; inset: 0; z-index: 90; background: transparent; }
.menu-backdrop.show { display: block; }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 20px; color: var(--text-primary); cursor: pointer; padding: 8px; }
@media (max-width: 768px) {
    .page-wrap { padding: 20px 16px 60px; }
    .nav-links { display: none; position: absolute; top: var(--nav-height); left: 0; right: 0; background: white; border-bottom: 1px solid var(--border); flex-direction: column; padding: 8px; box-shadow: var(--shadow-lg); }
    .nav-links.open { display: flex; }
    .mobile-menu-btn { display: block; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-value { font-size: 22px; }
    .nav-user { gap: 8px; }
    .nav-balance { padding: 4px 10px; font-size: 12px; }
    /* minmax(0,1fr): long service names may not widen the column past the screen (iOS Safari) */
    .check-layout { grid-template-columns: minmax(0, 1fr) !important; }
    .dash-grid { grid-template-columns: 1fr !important; }
    #profileForm [style*="grid-template-columns"], #passwordForm [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
    #profileForm [style*="grid-column"], #passwordForm [style*="grid-column"] { grid-column: auto !important; }
}

/* ── CHECK LAYOUT ── */
.check-layout { display: grid; grid-template-columns: 390px 1fr; gap: 24px; align-items: start; }
.section-title { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 4px; }
.section-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 60px 24px; }
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.empty-desc { font-size: 13px; color: var(--text-tertiary); }

/* ── LOADING ── */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-dots::after { content: ''; animation: dots 1.5s steps(3) infinite; }
@keyframes dots { 0% { content: '.'; } 33% { content: '..'; } 66% { content: '...'; } }
/* ── THEME REFRESH ── */
:root { --nav-bg: rgba(255,255,255,0.82); --ring: 0 0 0 4px rgba(59,130,246,0.14); --radius: 14px; --radius-lg: 18px; }
/* background-attachment: fixed paints black / bands on iPad and iPhone Safari → normal scrolling background, gradient only at the top */
html { background: var(--bg); }
body { background: var(--bg); }
.page, .page-wrap { background-color: var(--bg); }
.site-nav { background: var(--nav-bg); }
.card { border-radius: var(--radius-lg); }
.card-elevated { box-shadow: 0 1px 2px rgba(16,24,40,0.04), 0 8px 24px -8px rgba(16,24,40,0.10); }
.btn-primary { background: linear-gradient(180deg, #4F8FF7, var(--accent-hover)); box-shadow: 0 1px 2px rgba(37,99,235,0.3), inset 0 1px 0 rgba(255,255,255,0.18); }
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 6px 16px -4px rgba(37,99,235,0.45); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .75; cursor: progress; }
.form-input:focus { border-color: var(--border-focus); box-shadow: var(--ring); background: var(--bg-card); }
.theme-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; transition: all .2s; }
.theme-btn:hover { color: var(--text-primary); border-color: var(--border-hover); }

/* services column stays in view while the results grow */
@media (min-width: 769px) {
    .check-layout > div:first-child { position: sticky; top: calc(var(--nav-height) + 16px); }
    .check-layout .svc-list-wrap { max-height: calc(100vh - var(--nav-height) - 140px); }
}
.svc-item { border-width: 1.5px; }
.svc-item.selected { box-shadow: 0 0 0 3px rgba(59,130,246,0.10); }
.svc-cat-label.recent { color: var(--accent); }
.svc-id { font-size: 10px; font-weight: 600; color: var(--text-tertiary); background: var(--bg-hover); border-radius: 4px; padding: 0 5px; margin-left: 4px; vertical-align: 1px; }

/* selected service header */
.svc-head { display: flex; align-items: center; gap: 14px; }
.svc-head .svc-icon { font-size: 22px; width: 48px; height: 48px; border-radius: 12px; }
.svc-head-name { font-size: 16px; font-weight: 800; letter-spacing: -.2px; line-height: 1.3; }
.svc-head-sub { font-size: 12px; color: var(--text-tertiary); }
.svc-head-price { margin-left: auto; text-align: right; }
.svc-head-price b { display: block; font-size: 22px; font-weight: 800; color: var(--green); letter-spacing: -.5px; line-height: 1.1; }
.svc-head-price span { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .5px; }
/* service description as label / value rows */
.svc-desc2 { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13.5px; }
.svc-desc2 .k { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-tertiary); padding-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc-desc2 .k .bi { font-size: 13px; color: var(--accent); }
.svc-desc2 .v { color: var(--text-secondary); line-height: 1.6; overflow-wrap: anywhere; }
.svc-desc2 .v.full { grid-column: 1 / -1; }
.svc-desc2.folded .x { display: none; }
.svc-desc2 .d-time { display: inline-flex; align-items: center; padding: 1px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; background: var(--orange-soft); color: var(--orange); }
.svc-desc2 .d-time.fast { background: var(--green-soft); color: var(--green); }
.d-more { margin-top: 8px; border: none; background: none; padding: 2px 0; font-family: var(--font); font-size: 12px; font-weight: 600; color: var(--accent); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
#selectedSvcInfo { margin-bottom: 22px !important; }
@media (max-width: 768px) {
    .svc-desc2 { grid-template-columns: 1fr; gap: 2px; }
    .svc-desc2 .v { margin-bottom: 8px; }
}

/* single / bulk switch */
.mode-switch { display: flex; gap: 4px; padding: 4px; background: var(--bg-hover); border-radius: 12px; margin: 0 0 18px; }
.mode-switch button { flex: 1; border: none; background: transparent; padding: 9px 12px; border-radius: 9px; font-family: var(--font); font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: all .2s; }
.mode-switch button small { font-size: 10px; font-weight: 600; color: var(--text-tertiary); }
.mode-switch button.active { background: var(--bg-card); color: var(--text-primary); box-shadow: 0 1px 3px rgba(16,24,40,0.12); }
.mode-switch button.active .bi { color: var(--accent); }

/* IMEI hint under single input */
.imei-hint { font-size: 11.5px; margin-top: 6px; min-height: 16px; color: var(--text-tertiary); }
.imei-hint.ok { color: var(--green); }
.imei-hint.warn { color: var(--orange); }

/* bulk summary */
.bulk-sum { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--text-tertiary); flex-wrap: wrap; }
.bulk-sum #bulkTotal { font-weight: 700; }
#bulkCtl .btn { padding: 9px 14px; }

/* result box */
.result-box { background: var(--bg-input); border-radius: 12px; word-break: break-word; }
.result-box.failed { border-color: rgba(239,68,68,0.35); background: var(--red-soft); color: var(--red); }
/* check result as label / value rows (built by prettyResult) */
.result-box.pretty { font-family: var(--font); font-size: 13px; line-height: 1.5; padding: 6px 16px 10px; word-break: normal; overflow-wrap: anywhere; max-height: none; }
.result-box .rs-img { text-align: center; padding: 12px 0 6px; }
.result-box .rs-img img { max-width: 100%; max-height: 150px; width: auto; height: auto; object-fit: contain; display: inline-block; }
.result-box .rs-row { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.result-box .rs-row:last-child { border-bottom: none; }
.result-box .rs-k { color: var(--text-tertiary); font-weight: 600; font-size: 12px; }
.result-box .rs-v { color: var(--text-primary); font-weight: 600; }
.result-box .rs-v font, .result-box .rs-v span { font-weight: 700; }
.result-box .rs-full { padding: 7px 0; border-bottom: 1px solid var(--border); color: var(--text-primary); }
.result-box img { max-width: 100%; height: auto; }
@media (max-width: 768px) {
    .result-box.pretty { font-size: 12.5px; padding: 4px 12px 8px; }
    .result-box .rs-row { grid-template-columns: minmax(96px, 42%) minmax(0, 1fr); gap: 10px; padding: 6px 0; }
    .result-box .rs-k { font-size: 11.5px; }
    .result-box .rs-img img { max-height: 120px; }
}
.result-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.result-head .cp-btn { margin-left: auto; }

/* bulk results table */
.res-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.res-tools .tools { margin-left: auto; display: flex; gap: 2px; flex-wrap: wrap; }
.res-tools .btn-ghost { padding: 6px 10px; }
.res-filter { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-hover); border-radius: 20px; }
.res-filter button { border: none; background: transparent; font-family: var(--font); font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; color: var(--text-secondary); cursor: pointer; }
.res-filter button.active { background: var(--bg-card); color: var(--text-primary); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.res-table td { vertical-align: top; }
.res-table .order-row td:first-child { white-space: nowrap; }
.res-table .chev { color: var(--text-tertiary); transition: transform .2s; display: inline-block; }
.res-table .order-row.open .chev { transform: rotate(90deg); }
.res-table .why { display: block; font-family: var(--font); font-size: 11px; color: var(--red); margin-top: 2px; white-space: normal; }
.res-table .order-result-row td { padding-top: 0; }
.res-table .order-result-row:hover td { background: transparent; }
@media (max-width: 768px) {
    .res-table th:nth-child(3), .res-table td:nth-child(3) { display: none; }
    .res-table td, .res-table th { padding: 10px 8px; }
    .svc-head-price b { font-size: 18px; }
}

/* ── DARK THEME (auto, or forced from the nav button) ── */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0B0F17; --bg-card: #121826; --bg-hover: #1A2233; --bg-input: #0F1522;
        --border: #222B3D; --border-hover: #2F3A52; --border-focus: #60A5FA;
        --text-primary: #E6EAF2; --text-secondary: #A3ADC2; --text-tertiary: #6F7A91;
        --accent: #60A5FA; --accent-hover: #3B82F6; --accent-soft: rgba(96,165,250,0.12);
        --green: #34D399; --green-soft: rgba(52,211,153,0.12); --red: #F87171; --red-soft: rgba(248,113,113,0.12);
        --orange: #FBBF24; --orange-soft: rgba(251,191,36,0.12); --purple-soft: rgba(139,92,246,0.14);
        --nav-bg: rgba(11,15,23,0.78);
    }
}
:root[data-theme="dark"] {
    --bg: #0B0F17; --bg-card: #121826; --bg-hover: #1A2233; --bg-input: #0F1522;
    --border: #222B3D; --border-hover: #2F3A52; --border-focus: #60A5FA;
    --text-primary: #E6EAF2; --text-secondary: #A3ADC2; --text-tertiary: #6F7A91;
    --accent: #60A5FA; --accent-hover: #3B82F6; --accent-soft: rgba(96,165,250,0.12);
    --green: #34D399; --green-soft: rgba(52,211,153,0.12); --red: #F87171; --red-soft: rgba(248,113,113,0.12);
    --orange: #FBBF24; --orange-soft: rgba(251,191,36,0.12); --purple-soft: rgba(139,92,246,0.14);
    --nav-bg: rgba(11,15,23,0.78);
}
@media (max-width: 768px) { .nav-links { background: var(--bg-card) !important; } }
/* tablets (iPad): menu items on one line, no wrapping */
@media (min-width: 769px) and (max-width: 1180px) {
    .nav-inner { gap: 10px; }
    .nav-links { gap: 2px; flex-wrap: nowrap; min-width: 0; }
    .nav-link { padding: 7px 9px; font-size: 12.5px; white-space: nowrap; }
    .nav-brand { font-size: 16px; white-space: nowrap; flex-shrink: 0; }
    .nav-balance { white-space: nowrap; }
    .page-wrap { padding-left: 24px; padding-right: 24px; }
    .check-layout { grid-template-columns: minmax(0, 340px) minmax(0, 1fr) !important; gap: 16px !important; }
}
@media (min-width: 769px) and (max-width: 960px) {
    .nav-link .bi { display: none; }
    .nav-link { padding: 7px 7px; }
}

/* ── PUBLIC PAGES (services, legal, contact, footer) ── */
/* full-height layout: page fills the window, footer sits at the bottom without extra scrolling */
body { display: flex; flex-direction: column; min-height: 100vh; }
.site-nav { flex-shrink: 0; }
.page.active { flex: 1 0 auto; }
.page-wrap { min-height: 0; }
.auth-wrap { min-height: 0; padding: 56px 24px; }
.site-foot { flex-shrink: 0; margin-top: auto; }
body.guest .auth-only { display: none !important; }
body:not(.guest) .guest-only { display: none !important; }
body.guest .user-only { display: none !important; }
.admin-card { border-color: rgba(239,68,68,0.25); background: linear-gradient(0deg, var(--red-soft), var(--red-soft)), var(--bg-card); }
.funds-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.funds-grid > .card { padding: 28px 16px !important; }
.funds-grid > .card { display: flex !important; flex-direction: column; align-items: center; justify-content: flex-start; }
.funds-grid > .card .btn { margin-top: auto; }
@media (max-width: 1100px) { .funds-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .funds-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .funds-grid { grid-template-columns: 1fr; } }
/* ── MOBILE: no zoom, no sideways scroll, everything fits ── */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
body { touch-action: pan-x pan-y; }
img, svg, video, canvas, iframe, table { max-width: 100%; }
@media (max-width: 768px) {
    /* iOS zooms in when a field with text under 16px gets focus — keep every field at 16px */
    input, select, textarea, .form-input, select.form-input, textarea.form-input, #orderStatus, #orderSort { font-size: 16px !important; }
    .page-wrap { padding-left: 14px !important; padding-right: 14px !important; }
    .card { min-width: 0; }
    .legal { padding: 22px 16px !important; }
    .legal pre.code { font-size: 11.5px; }
    .co-table th { width: 110px; padding-right: 10px; }
    .co-table td, .co-table th { font-size: 13px; }
    .api-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .svc-item { padding-left: 10px !important; padding-right: 10px !important; gap: 10px !important; }
    .svc-name, .pub-name, .svc-head-title { overflow-wrap: anywhere; }
    /* one line with "…" — -webkit-box makes iOS Safari measure the full unwrapped text and widen the page */
    .svc-desc { white-space: normal !important; overflow-wrap: anywhere; display: block; max-width: 100%; max-height: 2.7em; overflow: hidden; }
    .check-layout > *, .svc-list-wrap, #svcList, .svc-item, .svc-info, .card { min-width: 0; max-width: 100%; }
    .svc-list-wrap { overflow-x: hidden; }
    .svc-item .svc-icon { flex-shrink: 0; }
    .svc-name { white-space: normal; }
    .svc-price { flex-shrink: 0; margin-left: 6px; }
    .svc-head > div:nth-child(2) { flex: 1; min-width: 0; }
    .svc-head-sub { white-space: normal; overflow-wrap: anywhere; }
    /* safety net: nothing inside a page can push the layout sideways */
    .page, .page-wrap { max-width: 100%; overflow-x: clip; }
    /* Order History: each order as a compact card (no sideways table) */
    #page-orders .order-table, #page-orders .order-table tbody { display: block; width: 100%; min-width: 0 !important; }
    #page-orders .order-table thead { display: none; }
    #page-orders .order-table tr.order-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
    #page-orders .order-table tr.order-row td { display: block; padding: 0 !important; border: none !important; font-size: 12.5px; min-width: 0; overflow-wrap: anywhere; background: transparent !important; }
    #page-orders .order-table tr.order-row td:nth-child(1) { grid-column: 1; grid-row: 1; font-size: 13px; }
    #page-orders .order-table tr.order-row td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; }
    #page-orders .order-table tr.order-row td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; font-weight: 600; color: var(--text-primary); }
    #page-orders .order-table tr.order-row td:nth-child(2) { grid-column: 1; grid-row: 3; font-size: 12px; color: var(--text-secondary); }
    #page-orders .order-table tr.order-row td:nth-child(5) { grid-column: 2; grid-row: 3; text-align: right; }
    #page-orders .order-table tr.order-row td:nth-child(6) { grid-column: 1 / -1; grid-row: 4; font-size: 11px !important; }
    #page-orders .order-table tr.order-result-row:not([style*="none"]) { display: block !important; }
    #page-orders .order-table tr.order-result-row td { display: block; padding: 0 10px 12px !important; border-bottom: 1px solid var(--border) !important; }
    #page-orders .order-table tr.order-result-row[style*="display:none"], #page-orders .order-table tr.order-result-row[style*="display: none"] { display: none !important; }
    #page-orders .card { overflow: hidden; }
    #orderTotalBadge { width: 100%; }
    /* phone menu: small dropdown card under the ☰ button */
    .nav-links { top: calc(var(--nav-height) - 6px) !important; left: auto !important; right: 12px !important; width: 230px; border: 1px solid var(--border) !important; border-radius: 14px; box-shadow: 0 12px 32px rgba(15,23,42,.16) !important; z-index: 100; }
    .nav-links.open { flex-direction: column; align-items: stretch; gap: 1px; padding: 6px !important; max-height: calc(100vh - var(--nav-height) - 20px); overflow-y: auto; }
    .nav-links > .nav-link, .nav-guest > .nav-link { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; padding: 9px 10px; font-size: 14px; border-radius: 9px; }
    .nav-links .nav-link .bi { font-size: 15px; width: 18px; text-align: center; margin: 0 !important; }
    .nav-guest { flex-direction: column; align-items: stretch; gap: 1px; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
    .nav-guest .btn { margin: 6px 2px 2px !important; justify-content: center; padding: 9px; font-size: 14px; }
    /* balance on its own full-width row (big balances fit), then theme · avatar · logout */
    .nav-user { flex-wrap: wrap; justify-content: space-between; gap: 8px 6px; border-top: 1px solid var(--border); margin-top: 4px; padding: 8px 4px 2px; }
    .nav-user .nav-balance { order: -1; flex: 1 1 100%; justify-content: center; padding: 8px 10px; font-size: 14px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .nav-user .theme-btn { width: 32px; height: 32px; flex-shrink: 0; margin-right: auto; }
    .nav-user > .nav-link { width: auto; padding: 4px; }
    /* profile (avatar + e-mail) as the first row of the phone menu; not repeated in the bottom row */
    .nav-links .nav-profile-top { display: flex !important; gap: 10px; padding: 8px 10px 10px !important; margin-bottom: 4px; border-bottom: 1px solid var(--border); border-radius: 9px 9px 0 0 !important; }
    body.guest .nav-links .nav-profile-top { display: none !important; }
    .nav-profile-top .nav-avatar { width: 36px; height: 36px; font-size: 14px; flex-shrink: 0; }
    .npt-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
    .npt-text b { font-size: 13px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .npt-text small { font-size: 11.5px; color: var(--text-tertiary); font-weight: 500; }
    .nav-user > .nav-link[data-page="profile"] { display: none; }
    .nav-user .nav-avatar { width: 30px; height: 30px; font-size: 12px; }
    /* search on its own row, status + sort + refresh on the row below */
    #page-orders .ord-search { flex: 1 1 100% !important; min-width: 0 !important; width: 100%; }
    #orderStatus, #orderSort { flex: 1 1 0; min-width: 0 !important; width: auto !important; padding-left: 12px; padding-right: 30px; text-overflow: ellipsis; }
    /* smaller text on phones (form fields stay 16px so iOS does not zoom) */
    .svc-name { font-size: 12.5px !important; line-height: 1.3; }
    .svc-desc { font-size: 10.5px !important; }
    .svc-price { font-size: 12.5px !important; }
    .svc-item { padding-top: 9px !important; padding-bottom: 9px !important; }
    .svc-item .svc-icon { width: 32px !important; height: 32px !important; font-size: 15px !important; }
    .svc-cat-label { font-size: 10px !important; margin-top: 10px !important; }
    .svc-head-name { font-size: 14px !important; }
    .svc-head-sub { font-size: 10.5px !important; }
    .svc-head-price b { font-size: 16px !important; }
    .svc-desc2, .svc-desc2 .v { font-size: 12.5px !important; }
    .svc-desc2 .k { font-size: 10px !important; }
    .section-title { font-size: 20px !important; }
    .section-desc { font-size: 12.5px !important; }
    body { font-size: 13px; }
    .svc-price, .svc-head-price b { white-space: nowrap; }
    .svc-desc2 { font-size: 14px; }
    .svc-desc2 .v { font-size: 14px; }
    .amt-chips button { min-width: 0; padding: 10px 4px; font-size: 13px; }
    .funds-grid > .card { padding: 22px 12px !important; }
    .toast { max-width: calc(100vw - 32px); }
    /* fixed backgrounds jump / leave a seam on iOS */
    body { background-attachment: scroll !important; }
    /* IMEI Check: list scrolls inside its card, the form stays close */
    .svc-list-wrap, .check-layout .svc-list-wrap { max-height: 46vh !important; }
    .svc-head { gap: 10px; align-items: flex-start; }
    .svc-head .svc-icon { width: 40px; height: 40px; font-size: 18px; border-radius: 10px; flex-shrink: 0; }
    .svc-head-name { font-size: 15px; }
    .svc-head-sub { font-size: 11.5px; }
    .svc-head-price b { font-size: 17px !important; }
    .form-input-lg { padding: 12px 14px; letter-spacing: .3px; }
    #selectedSvcInfo { margin-bottom: 16px !important; }
    /* profile: balance under the name, left aligned */
    .prof-bal { text-align: left !important; width: 100%; margin-top: 8px; }
    .section-title { font-size: 22px !important; }
}
@media (max-width: 560px) {
    /* Add Funds: compact rows (icon · name + text · button) */
    .funds-grid { gap: 10px; }
    .funds-grid > .card { display: grid !important; grid-template-columns: 44px 1fr auto; grid-template-areas: "ic t b" "ic d b"; align-items: center; text-align: left !important; padding: 14px 14px !important; column-gap: 12px; }
    .funds-grid > .card > :nth-child(1) { grid-area: ic; font-size: 28px !important; margin: 0 !important; text-align: center; }
    .funds-grid > .card > :nth-child(2) { grid-area: t; margin: 0 !important; font-size: 14px !important; }
    .funds-grid > .card > :nth-child(3) { grid-area: d; margin: 0 !important; font-size: 11.5px !important; line-height: 1.4; }
    .funds-grid > .card > :nth-child(4) { grid-area: b; margin: 0 !important; padding: 7px 10px; font-size: 0; }
    .funds-grid > .card > :nth-child(4) .bi { font-size: 14px; }
}
.ppm-debug { margin-top: 10px; max-height: 360px; overflow: auto; background: #0f172a; color: #e2e8f0; border-radius: var(--radius-sm); padding: 12px 14px; font-family: 'SF Mono','Fira Code',monospace; font-size: 11px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; }
.site-foot.site-foot-s { padding: 22px 24px 26px; text-align: center; }
.foot-s-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 10px; }
.foot-s-links a { font-size: 13px; font-weight: 500; color: var(--text-secondary); text-decoration: none; }
.foot-s-links a:hover { color: var(--accent); }
.foot-s-copy { font-size: 11.5px; color: var(--text-tertiary); }
@media (max-width: 768px) { .site-foot.site-foot-s { padding: 18px 16px 22px; } .foot-s-links { gap: 6px 16px; } .foot-s-links a { font-size: 12.5px; } }
/* dashboard chart */
.chart-card { padding: 18px 20px 14px; margin-bottom: 16px; position: relative; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.chart-sum { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.chart-sum b { color: var(--text-primary); font-weight: 700; }
.chart-range { display: inline-flex; background: var(--bg-input); border: 1px solid var(--border); border-radius: 9px; padding: 2px; flex-shrink: 0; }
.chart-range button { border: none; background: none; font-family: var(--font); font-size: 11.5px; font-weight: 700; color: var(--text-tertiary); padding: 5px 10px; border-radius: 7px; cursor: pointer; }
.chart-range button.active { background: var(--bg-card); color: var(--text-primary); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.chart-box { height: 190px; position: relative; }
.chart-box svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-box .grid line { stroke: var(--border); stroke-width: 1; }
.chart-box .ax { fill: var(--text-tertiary); font-size: 10.5px; font-family: var(--font); }
.chart-box .bar { fill: var(--accent); }
.chart-box .bar.pend { fill: var(--orange); }
.chart-box .col:hover .bar, .chart-box .col.on .bar { opacity: .75; }
.chart-box .hit { fill: transparent; cursor: pointer; }
.chart-empty { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 12.5px; color: var(--text-tertiary); }
.chart-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--text-secondary); margin-top: 8px; }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-tip { position: absolute; pointer-events: none; display: none; background: var(--text-primary); color: var(--bg-card); font-size: 11.5px; line-height: 1.45; padding: 7px 10px; border-radius: 8px; white-space: nowrap; z-index: 5; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.chart-tip b { font-weight: 700; }
@media (max-width: 768px) { .chart-card { padding: 14px 14px 10px; } .chart-box { height: 160px; } }
/* payment history */
.exp-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: 12px; }
.exp-grid .exp-list { grid-row: span 2; }
.exp-grid .exp-list textarea { height: calc(100% - 42px); min-height: 110px; }
@media (max-width: 700px) { .exp-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .exp-grid .exp-list { grid-column: 1 / -1; grid-row: auto; } }
.ph-row { display: grid; grid-template-columns: max-content minmax(0, 1fr) auto 90px; gap: 12px; align-items: center; padding: 11px 20px; border-bottom: 1px solid var(--border); font-size: 13px; }
.ph-row:last-child { border-bottom: none; }
.ph-date { color: var(--text-tertiary); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ph-r { text-align: right; }
.ph-m b { font-weight: 600; }
.ph-m small { display: block; color: var(--text-tertiary); font-size: 11px; font-family: 'SF Mono','Fira Code',monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-amt { font-weight: 700; color: var(--green); white-space: nowrap; }
.ph-r a { font-size: 12px; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
@media (max-width: 768px) {
    .ph-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 11px 14px; }
    .ph-date { grid-column: 1; grid-row: 2; }
    .ph-amt { grid-column: 2; grid-row: 1; text-align: right; }
    .ph-r { grid-column: 2; grid-row: 2; text-align: right; }
}
.pay-ok { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border: 1px solid rgba(16,185,129,0.35); background: var(--green-soft); color: var(--green); border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.55; font-weight: 600; }
.pay-ok .bi { font-size: 16px; margin-top: 1px; }
.pay-wait { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border: 1px solid rgba(59,130,246,0.3); background: var(--accent-soft); color: var(--text-secondary); border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.55; }
.pay-wait .spinner { flex-shrink: 0; margin-top: 2px; }
.pay-wait b { color: var(--text-primary); }
.pay-err { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border: 1px solid rgba(239,68,68,0.35); background: var(--red-soft); color: var(--red); border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.55; overflow-wrap: anywhere; }
.pay-err .bi { font-size: 16px; margin-top: 1px; }
.pay-err b { color: var(--red); }
.pay-err a { color: var(--accent); font-weight: 600; text-decoration: none; }
.amt-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0 14px; }
.amt-chips button { flex: 1; min-width: 64px; border: 1px solid var(--border); background: var(--bg-input); color: var(--text-primary); font-family: var(--font); font-size: 14px; font-weight: 700; padding: 10px 8px; border-radius: var(--radius-sm); cursor: pointer; transition: all .15s; }
.amt-chips button:hover { border-color: var(--border-hover); }
.amt-chips button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.legal pre.code { background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin: 8px 0 12px; font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12.5px; line-height: 1.6; color: var(--text-primary); overflow-x: auto; white-space: pre; }
.legal code { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12.5px; background: var(--bg-hover); padding: 1px 6px; border-radius: 4px; color: var(--text-primary); }
.api-table th { width: auto; }
.api-table td, .api-table th { padding-right: 12px; font-size: 13px; vertical-align: top; }
.agree { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text-secondary); margin: 4px 0 8px; cursor: pointer; line-height: 1.5; }
.agree input { margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }
.agree a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-card { position: relative; }
.pub-hero { margin-bottom: 20px; }
.pub-hero h1 { font-size: 28px; font-weight: 800; letter-spacing: -.5px; line-height: 1.2; }
.pub-hero p { color: var(--text-secondary); max-width: 680px; margin-top: 6px; font-size: 14px; }
.pub-points { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--text-secondary); font-weight: 500; }
.pub-points .bi { color: var(--green); margin-right: 4px; }
.cat-chips { display: flex; gap: 6px; flex-wrap: nowrap; margin-top: 12px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chips button { flex-shrink: 0; white-space: nowrap; }
.cat-chips button { border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); font-family: var(--font); font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 20px; cursor: pointer; transition: all .15s; }
.cat-chips button:hover { border-color: var(--border-hover); color: var(--text-primary); }
.cat-chips button small { color: var(--text-tertiary); font-weight: 600; margin-left: 3px; font-size: 11px; }
.cat-chips button.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.pub-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-tertiary); margin: 28px 0 10px; }
.pub-cat:first-child { margin-top: 4px; }
.pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pub-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color .2s, box-shadow .2s; min-width: 0; }
.pub-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); }
.pub-top { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.pub-name { font-size: 13.5px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.pub-full { font-size: 11.5px; color: var(--text-tertiary); font-weight: 500; margin-top: 2px; }
.pub-desc { font-size: 12px; color: var(--text-secondary); white-space: pre-line; max-height: 38px; overflow: hidden; cursor: pointer; -webkit-mask-image: linear-gradient(#000 50%, transparent); mask-image: linear-gradient(#000 50%, transparent); overflow-wrap: anywhere; }
.pub-desc.open { max-height: none; -webkit-mask-image: none; mask-image: none; }
.pub-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.pub-price b { font-size: 18px; font-weight: 800; color: var(--green); letter-spacing: -.3px; }
.pub-price span { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .5px; margin-left: 4px; }
.pub-note { font-size: 12px; color: var(--text-tertiary); margin-top: 24px; text-align: center; }

.legal { max-width: 820px; margin: 0 auto; padding: 36px 40px; }
.legal h1 { font-size: 26px; font-weight: 800; letter-spacing: -.5px; line-height: 1.25; }
.legal .upd { font-size: 12px; color: var(--text-tertiary); margin: 4px 0 20px; }
.legal h2 { font-size: 16px; font-weight: 700; margin: 28px 0 8px; letter-spacing: -.2px; }
.legal p, .legal li { font-size: 14px; color: var(--text-secondary); line-height: 1.75; }
.legal p + p { margin-top: 10px; }
.legal ul { padding-left: 22px; margin: 8px 0; }
.legal li + li { margin-top: 4px; }
.legal a { color: var(--accent); font-weight: 600; text-decoration: none; }
.legal b { color: var(--text-primary); }
.co-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.co-table th { text-align: left; font-size: 12px; color: var(--text-tertiary); font-weight: 600; padding: 10px 16px 10px 0; width: 190px; vertical-align: top; border-bottom: 1px solid var(--border); }
.co-table td { font-size: 14px; color: var(--text-primary); padding: 10px 0; border-bottom: 1px solid var(--border); }
.co-table tr:last-child th, .co-table tr:last-child td { border-bottom: none; }
.co-table a { color: var(--accent); text-decoration: none; font-weight: 600; }
.bank-table td:last-child { width: 44px; text-align: right; padding-left: 8px; }
.bank-table td { overflow-wrap: anywhere; }
.cf-form { display: grid; gap: 14px; margin: 8px 0 8px; }
.cf-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 600px) { .cf-row { grid-template-columns: minmax(0, 1fr); } }
.cf-form .btn { justify-self: start; }
.cf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.cf-note { padding: 12px 14px; border-radius: var(--radius); font-size: 13px; }
.cf-note.ok { background: rgba(16, 185, 129, .1); color: #047857; border: 1px solid rgba(16, 185, 129, .3); }
.cf-note.err { background: rgba(239, 68, 68, .08); color: #b91c1c; border: 1px solid rgba(239, 68, 68, .25); }
.sess-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 20px; }
.sess-grid .sv { font-size: 13px; color: var(--text-primary); overflow-wrap: anywhere; }
.sess-grid .sk { font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 1px; }
.sess-grid .sv .mono { font-family: monospace; font-size: 12.5px; }
.sess-flag { font-size: 16px; margin-right: 4px; vertical-align: -1px; }
@media (max-width: 420px) { .sess-grid { grid-template-columns: minmax(0, 1fr); } }
.api-try { margin: 0 0 16px; padding: 28px 40px; }
#page-api .legal { max-width: none; }
@media (max-width: 768px) { .api-try { padding: 20px 18px; } }
.api-try-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.api-try-title i { color: var(--accent); }
.api-try-sub { font-size: 13px; color: var(--text-secondary); margin: 2px 0 14px; }
.api-try-guest { font-size: 13px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-input); border: 1px solid var(--border); margin-bottom: 12px; }
.api-try-guest a { color: var(--accent); font-weight: 600; }
.at-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.at-svc-info { font-size: 12px; color: var(--text-tertiary); margin: 8px 0 0; min-height: 18px; }
.at-svc-info b { color: var(--green); }
.at-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin: 14px 0 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.at-key-btn { font-weight: 500; color: var(--accent); cursor: pointer; font-size: 12px; }
.at-url { display: flex; align-items: center; gap: 6px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 6px 8px 12px; }
.at-url code { flex: 1; min-width: 0; font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12.5px; overflow-wrap: anywhere; color: var(--text-primary); }
.at-tabs { display: flex; gap: 4px; margin: 14px 0 0; flex-wrap: wrap; align-items: center; }
.at-tabs button { border: 1px solid var(--border); background: transparent; color: var(--text-secondary); font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 8px 8px 0 0; cursor: pointer; font-family: inherit; }
.at-tabs button.on { background: var(--bg-input); color: var(--text-primary); border-bottom-color: var(--bg-input); }
.at-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.at-tabs .at-copycode { border-radius: 8px; border: none; color: var(--accent); }
.at-code.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.at-tabs { margin-top: 16px !important; }
.at-code { background: var(--bg-input); border: 1px solid var(--border); border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm); padding: 12px 14px; margin: 0; font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12.5px; line-height: 1.6; color: var(--text-primary); overflow-x: auto; white-space: pre; }
.at-json { border-radius: var(--radius-sm); max-height: 420px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.at-json .k { color: #7c3aed; } .at-json .s { color: #059669; } .at-json .n { color: #d97706; } .at-json .b { color: #2563eb; }
.at-sbx { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 12.5px; color: var(--text-secondary); cursor: pointer; user-select: none; }
.at-sbx input { position: absolute; opacity: 0; pointer-events: none; }
.at-sw { flex: 0 0 auto; width: 36px; height: 20px; border-radius: 20px; background: var(--border); position: relative; transition: background .2s; }
.at-sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.at-sbx input:checked + .at-sw { background: var(--green); }
.at-sbx input:checked + .at-sw::after { transform: translateX(16px); }
.at-sbx b { color: var(--text-primary); }
.at-warn.hot { color: var(--red); font-weight: 600; }
.at-warn.hot b { color: var(--red); }
#atSend.confirm { background: var(--red); border-color: var(--red); }
.at-run { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.at-warn { font-size: 12px; color: var(--text-tertiary); }
.at-warn b { color: var(--orange); }
.at-ok { color: var(--green); } .at-err { color: var(--red); }
@media (max-width: 900px) { .at-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .at-grid > .at-order[style*="span 2"] { grid-column: 1 / -1 !important; } }
@media (max-width: 560px) { .at-grid { grid-template-columns: minmax(0, 1fr); } .at-grid > div { grid-column: auto !important; } .at-code { font-size: 11.5px; } }
/* desktop menu: links start next to the logo, account controls stay on the right */
@media (min-width: 769px) {
    .nav-inner { justify-content: flex-start; gap: 28px; }
    .nav-links { flex: 1; min-width: 0; }
    .nav-links > .nav-user, .nav-links > .nav-guest { margin-left: auto; }
}
.dash-row { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.dash-row:last-child { border-bottom: none; }
.dash-row:hover { background: var(--bg-hover); }
.dash-row.off { cursor: default; } .dash-row.off:hover { background: transparent; }
.dr-main { flex: 1; min-width: 0; }
.dr-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-meta { font-size: 11.5px; color: var(--text-tertiary); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-meta .mono { font-family: monospace; }
.dr-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.dr-cost { font-size: 12px; font-weight: 600; color: var(--green); }
.dr-cnt { font-size: 11.5px; color: var(--text-tertiary); }
.dr-rank { width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dr-bar { height: 4px; border-radius: 4px; background: var(--bg-input); margin-top: 6px; overflow: hidden; }
.dr-bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; opacity: .7; }
@media (max-width: 560px) { .dash-row { padding: 10px 14px; } .dr-cnt { display: none; } }
.cp-mini { border: none; background: transparent; color: var(--text-tertiary); cursor: pointer; padding: 2px 4px; border-radius: 6px; font-size: 12px; opacity: .55; transition: opacity .15s, background .15s; vertical-align: 1px; }
.cp-mini:hover { opacity: 1; background: var(--bg-hover); color: var(--accent); }
.res-tools { display: flex; justify-content: flex-end; gap: 6px; margin: 4px 0 6px; flex-wrap: wrap; }
.svc-item { position: relative; }
.pend-note { margin-top: 10px; font-size: 12px; color: var(--orange); display: flex; align-items: center; gap: 8px; }
.svc-fav { border: none; background: transparent; color: var(--text-tertiary); cursor: pointer; padding: 4px; margin-left: -4px; font-size: 14px; opacity: 0; transition: opacity .15s, color .15s; flex-shrink: 0; }
.svc-item:hover .svc-fav, .svc-fav.on, .svc-item.selected .svc-fav { opacity: 1; }
.svc-fav.on { color: #f59e0b; }
.svc-fav:hover { color: #f59e0b; }
@media (hover: none) { .svc-fav { opacity: .5; } .svc-fav.on { opacity: 1; } }
.svc-cat-label.fav { color: #d97706; }
.prof-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.prof-grid > .card { margin-bottom: 0 !important; }
.pw-in-card { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.pw-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 560px) { .pw-grid { grid-template-columns: minmax(0, 1fr); } }
.sess-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--text-tertiary); }
#sessGrid { margin-bottom: 14px; }
.prof-col { min-width: 0; }
@media (max-width: 768px) { .site-nav { padding-left: 14px !important; padding-right: 14px !important; } }
@media (max-width: 960px) { .prof-grid { grid-template-columns: minmax(0, 1fr); } }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0 8px; }
.contact-card { display: flex; gap: 12px; align-items: center; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text-primary); background: var(--bg-input); transition: border-color .2s; }
.contact-card:hover { border-color: var(--accent); }
.contact-card .bi { font-size: 20px; color: var(--accent); }
.contact-card small { display: block; font-size: 11px; color: var(--text-tertiary); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.contact-card span { font-size: 14px; font-weight: 700; }

.site-foot { border-top: 1px solid var(--border); background: var(--bg-card); padding: 32px 24px 24px; }
@media (max-width: 768px) {
    .legal { padding: 24px 18px; }
    .co-table th { width: 120px; }
    .pub-hero h1 { font-size: 23px; }
    .site-foot { padding: 28px 16px 20px; }
}

/* compact service rows: smaller icon, less padding, star floats in the corner (takes no width) */
#svcList .svc-item { gap: 10px; padding: 9px 12px; }
#svcList .svc-icon { width: 30px; height: 30px; font-size: 15px; border-radius: 7px; }
#svcList .svc-name { font-size: 12.5px; letter-spacing: -.1px; }
#svcList .svc-price { font-size: 12.5px; }
#svcList .svc-icon { position: relative; }
#svcList .svc-fav { position: absolute; top: -5px; right: -5px; margin: 0; padding: 0; width: 15px; height: 15px; display: flex; align-items: center; justify-content: center; font-size: 9px; line-height: 1; border-radius: 50%; background: var(--bg-card); box-shadow: 0 0 0 1px var(--border); } /* small star badge on the icon corner */
#svcList .svc-fav.on { box-shadow: 0 0 0 1px rgba(245,158,11,.45); }
@media (max-width: 768px) { #svcList .svc-item { padding: 9px 10px !important; } #svcList .svc-icon { width: 28px !important; height: 28px !important; font-size: 14px !important; } }
