:root {
  --bg: #07111f;
  --panel: rgba(14, 29, 48, .82);
  --panel-solid: #0e1d30;
  --line: rgba(148, 180, 205, .16);
  --muted: #8ea6b9;
  --text: #edf7fb;
  --cyan: #50e3c2;
  --cyan-2: #2ab7ca;
  --blue: #5f7cff;
  --warning: #f3b95f;
  --danger: #ff6f7d;
  --shadow: 0 24px 80px rgba(0, 0, 0, .34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; overflow-x: hidden; color: var(--text); background: radial-gradient(circle at 16% 10%, #112c43 0, transparent 33%), linear-gradient(150deg, #07111f 20%, #091a2a 65%, #07111f); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .13; 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: 48px 48px; mask-image: linear-gradient(to bottom, black, transparent 82%); }
.ambient { position: fixed; width: 340px; height: 340px; border-radius: 50%; filter: blur(110px); pointer-events: none; opacity: .17; }
.ambient-a { top: -140px; right: 8%; background: var(--cyan); }
.ambient-b { bottom: -180px; left: 4%; background: var(--blue); }
a { color: #cde8f1; text-decoration: none; }
a:hover { color: var(--cyan); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 76px; padding: 0 max(24px, calc((100vw - 1180px)/2)); border-bottom: 1px solid var(--line); background: rgba(7, 17, 31, .78); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand > span:last-child { display: grid; line-height: 1.15; }
.brand b { letter-spacing: .04em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #07151d; font-weight: 900; background: linear-gradient(135deg, var(--cyan), #8ff3de); box-shadow: 0 8px 26px rgba(80, 227, 194, .26); }
.brand-mark-large { width: 52px; height: 52px; border-radius: 16px; font-size: 22px; }
.topbar nav { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.topbar nav a, .nav-button { color: var(--muted); font-size: 14px; }
.topbar nav a:hover, .nav-button:hover { color: var(--text); }
.topbar nav form { margin: 0; }
.nav-button { border: 0; padding: 0; background: transparent; }
.mobile-nav-title, .menu-toggle, .nav-backdrop, .nav-drawer-head { display: none; }

.shell { position: relative; z-index: 1; width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 58px 0 80px; }
.auth-shell { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.auth-card { width: min(440px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 28px; background: rgba(11, 27, 44, .88); box-shadow: var(--shadow); backdrop-filter: blur(22px); }
.auth-brand { margin-bottom: 30px; }
.auth-brand h1 { margin: 18px 0 8px; font-size: 34px; }
.auth-brand p:not(.eyebrow), .auth-note { color: var(--muted); }
.auth-note { margin: 20px 0 0; text-align: center; font-size: 12px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 30px; }
.page-head h1 { margin: 4px 0 8px; font-size: clamp(30px, 4vw, 48px); letter-spacing: -.035em; }
.page-head p:not(.eyebrow) { margin: 0; color: var(--muted); }
.head-actions { display: flex; gap: 10px; }
.eyebrow { margin: 0; color: var(--cyan); font-weight: 800; font-size: 11px; letter-spacing: .2em; }

.panel { border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: 0 16px 52px rgba(0, 0, 0, .18); backdrop-filter: blur(16px); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px 26px; border-bottom: 1px solid var(--line); }
.panel-head h2, .form-section h2, .qr-panel h2, .danger-zone h2 { margin: 0 0 5px; font-size: 18px; }
.panel-head p, .form-section p, .qr-panel p, .danger-zone p { margin: 0; color: var(--muted); font-size: 13px; }
.narrow-panel { width: min(620px, 100%); padding: 28px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card { position: relative; overflow: hidden; min-height: 150px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, rgba(18, 41, 64, .9), rgba(10, 25, 42, .88)); }
.stat-card::after { content: ""; position: absolute; width: 90px; height: 90px; right: -34px; bottom: -40px; border-radius: 50%; background: var(--blue); filter: blur(30px); opacity: .18; }
.stat-card.accent::after { background: var(--cyan); opacity: .32; }
.stat-card.warn::after { background: var(--warning); opacity: .28; }
.stat-card span, .stat-card small { display: block; color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; margin: 14px 0 10px; font-size: 38px; letter-spacing: -.04em; }
.stat-card .stat-size { font-size: 27px; margin-top: 22px; }

.analytics-summary .stat-card small { position: relative; z-index: 1; }
.analytics-filter { display: grid; grid-template-columns: minmax(240px, 1fr) auto auto; align-items: end; gap: 12px; margin-bottom: 20px; padding: 18px; }
.analytics-filter label { min-width: 0; }
.analytics-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 20px; margin-bottom: 20px; }
.analytics-lower-grid { grid-template-columns: .85fr 1.15fr; margin-top: 20px; margin-bottom: 0; }
.analytics-panel { overflow: hidden; }
.analytics-panel-body { display: grid; gap: 28px; padding: 26px; }
.analytics-metric { display: grid; gap: 13px; }
.analytics-metric > div { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.analytics-metric span, .traffic-split span { color: var(--muted); font-size: 12px; }
.analytics-metric b { font-size: 20px; }
.traffic-split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.traffic-split > div { display: grid; gap: 9px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.018); }
.traffic-split strong { font-size: 15px; overflow-wrap: anywhere; }
.status-breakdown { display: grid; padding: 12px 26px 18px; }
.status-breakdown > div { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.status-breakdown > div:last-child { border-bottom: 0; }
.status-breakdown span { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-dot-ok { background: var(--cyan); box-shadow: 0 0 0 4px rgba(80,227,194,.08); }
.status-dot-warn { background: var(--warning); }
.status-dot-off { background: var(--danger); }
.status-dot-muted { background: #687b89; }
.analytics-table-panel { overflow: hidden; }
.usage-cell { min-width: 150px; }
.usage-cell > span { display: block; margin-bottom: 7px; font-size: 11px; color: var(--muted); }
.usage-cell progress { min-width: 120px; }
.compact-list { display: grid; padding: 8px 24px 14px; }
.compact-list > a { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 2px; border-bottom: 1px solid var(--line); }
.compact-list > a:last-child { border-bottom: 0; }
.compact-list span { display: grid; gap: 5px; }
.compact-list small, .compact-empty { color: var(--muted); font-size: 12px; }
.compact-list strong { color: var(--cyan); font-size: 13px; }
.compact-empty { padding: 26px 2px; }
.configuration-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; padding: 24px 26px 28px; }
.configuration-grid h3 { margin: 0 0 14px; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.configuration-grid p { display: flex; justify-content: space-between; gap: 10px; margin: 8px 0; font-size: 12px; }
.configuration-grid p span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.configuration-grid p b { color: var(--cyan); }
.configuration-grid small { color: var(--muted); }
.activity-grid { grid-template-columns: 1.25fr .75fr; }
.daily-activity { display: grid; gap: 9px; padding: 22px 26px 26px; }
.daily-activity > div { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 13px; }
.daily-activity span, .daily-activity b { color: var(--muted); font-size: 11px; }
.daily-activity b { text-align: right; color: var(--text); }
.rank-list { display: grid; padding: 10px 26px 18px; }
.rank-list > div { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-width: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rank-list > div:last-child { border-bottom: 0; }
.rank-list code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list strong { color: var(--cyan); font-size: 12px; }
.rank-list-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
.destination-panel, .recent-connections { margin-bottom: 20px; }
.account-usage-panel { margin-top: 20px; }
.inline-danger { padding: 5px 9px; color: #ffd5d9; border: 1px solid rgba(255,111,125,.3); border-radius: 8px; background: rgba(255,111,125,.08); font-size: 11px; }
.inline-danger:hover { color: #fff; background: rgba(255,111,125,.2); }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px; font-weight: 750; font-size: 14px; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #06181b; background: linear-gradient(135deg, var(--cyan), #91f4df); box-shadow: 0 10px 28px rgba(80, 227, 194, .18); }
.button-primary:hover { color: #06181b; }
.button-ghost { color: var(--text); border-color: var(--line); background: rgba(255,255,255,.025); }
.button-danger { color: #fff; background: rgba(255, 80, 101, .78); }
.button-wide { width: 100%; }

.stack-form { display: grid; gap: 18px; }
label { display: grid; gap: 8px; color: #c8d9e3; font-size: 13px; font-weight: 650; }
label small { color: var(--muted); font-weight: 450; }
input, select, textarea { width: 100%; color: var(--text); border: 1px solid rgba(145, 178, 204, .22); border-radius: 11px; outline: none; background: rgba(3, 13, 24, .62); }
input, select { height: 46px; padding: 0 13px; }
textarea { padding: 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: rgba(80, 227, 194, .72); box-shadow: 0 0 0 3px rgba(80, 227, 194, .09); }
input:disabled { color: var(--muted); background: rgba(255,255,255,.025); }
select option { background: var(--panel-solid); }

.form-layout { display: grid; gap: 20px; }
.form-section { padding: 28px; }
.section-title { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 25px; }
.section-title > span { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; color: var(--cyan); border: 1px solid rgba(80, 227, 194, .25); background: rgba(80, 227, 194, .07); font-weight: 850; font-size: 11px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.check-group { display: flex; align-items: center; gap: 24px; padding-top: 25px; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--cyan); }
.form-actions { display: flex; justify-content: flex-end; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 17px 20px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255,255,255,.018); }
.actions { display: flex; gap: 15px; justify-content: flex-end; }
.empty { padding: 48px; text-align: center; color: var(--muted); }
.user-cell { display: flex; align-items: center; gap: 12px; }
.user-cell > div { display: grid; gap: 3px; }
.user-cell small { color: var(--muted); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; color: var(--cyan); background: rgba(80, 227, 194, .09); font-weight: 850; }
.status, .tag { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 750; }
.status-ok { color: var(--cyan); background: rgba(80, 227, 194, .09); }
.status-off { color: #bdc8cf; background: rgba(180, 195, 205, .08); }
.tag { color: #b8caff; background: rgba(95, 124, 255, .1); }
code { color: #c6f8ed; font-family: "SFMono-Regular", Consolas, monospace; }

.service-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; padding: 30px; margin-bottom: 20px; background: linear-gradient(135deg, rgba(17, 48, 68, .92), rgba(13, 29, 48, .85)); }
.service-hero h2 { margin: 14px 0 8px; font-size: clamp(25px, 4vw, 38px); letter-spacing: -.035em; }
.service-hero h2 span { color: var(--cyan); }
.service-hero p { margin: 0; color: var(--muted); }
.service-status { display: flex; align-items: center; gap: 9px; color: var(--cyan); font-size: 12px; font-weight: 750; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 5px rgba(80, 227, 194, .1); }
.pulse-off { background: #8496a3; box-shadow: 0 0 0 5px rgba(132, 150, 163, .1); }
.usage-meter { display: grid; gap: 10px; }
.meter-head { display: flex; justify-content: space-between; gap: 15px; font-size: 12px; }
.meter-head span, .usage-meter small { color: var(--muted); }
progress.meter { width: 100%; height: 9px; border: 0; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.08); }
progress.meter::-webkit-progress-bar { background: rgba(255,255,255,.08); }
progress.meter::-webkit-progress-value { background: linear-gradient(90deg, var(--cyan-2), var(--cyan)); border-radius: 99px; }
progress.meter::-moz-progress-bar { background: linear-gradient(90deg, var(--cyan-2), var(--cyan)); border-radius: 99px; }

.detail-grid { display: grid; grid-template-columns: 1.55fr .75fr; gap: 20px; }
.credential-panel { overflow: hidden; }
.credentials { margin: 0; padding: 8px 26px 20px; }
.credentials > div { display: grid; grid-template-columns: 160px 1fr; align-items: center; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.credentials dt { color: var(--muted); font-size: 12px; }
.credentials dd { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0; min-width: 0; }
.credentials code { overflow: hidden; text-overflow: ellipsis; }
.credentials button, [data-copy] { color: var(--cyan); border: 0; background: transparent; font-size: 12px; }
.credentials button.copied, [data-copy].copied { color: #fff; }
.secret-value { color: #ffd599; }
.link-field { padding: 0 26px 26px; }
.link-field .button { margin-top: 5px; justify-self: start; }
.subscription-reset { padding: 0 26px 26px; }
.adjustment-panel { margin-top: 20px; overflow: hidden; }
.adjustment-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; padding: 26px; }
.adjustment-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.018); }
.adjustment-buttons { display: flex; gap: 8px; }
.qr-panel { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: 26px; }
.qr-frame { display: grid; place-items: center; padding: 18px; border-radius: 18px; background: #fff; }
.qr-frame img { display: block; width: min(100%, 250px); aspect-ratio: 1; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-top: 20px; padding: 26px; border-color: rgba(255, 111, 125, .23); }
.danger-actions, .delete-form { display: flex; align-items: center; gap: 10px; }
.delete-form input { width: 210px; }

.flash-stack { display: grid; gap: 10px; margin-bottom: 20px; }
.auth-shell .flash-stack { position: fixed; top: 22px; width: min(440px, calc(100% - 40px)); }
.flash { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-solid); box-shadow: var(--shadow); font-size: 13px; }
.flash-error { color: #ffd5d9; border-color: rgba(255, 111, 125, .35); }
.flash-success { color: #c9fff3; border-color: rgba(80, 227, 194, .3); }
.flash-credential { color: #fff1c8; border-color: rgba(243, 185, 95, .36); overflow-wrap: anywhere; }
.notice { margin-bottom: 22px; padding: 13px 15px; border-radius: 11px; color: #ffe6b7; background: rgba(243, 185, 95, .1); }
.empty-state { display: grid; justify-items: start; gap: 15px; padding: 50px; }
.empty-state h1, .empty-state h2 { margin: 0; }
.empty-state p:not(.eyebrow) { margin: 0; color: var(--muted); }

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid, .service-hero, .analytics-grid, .analytics-lower-grid, .activity-grid, .adjustment-grid { grid-template-columns: 1fr; }
  .danger-zone { align-items: flex-start; flex-direction: column; }
  .topbar { padding: 0 20px; }
}

@media (max-width: 1024px) {
  .detail-grid, .service-hero, .analytics-grid, .analytics-lower-grid, .activity-grid, .adjustment-grid { grid-template-columns: 1fr; }
  .shell { width: calc(100% - 24px); padding: 26px 0 calc(56px + env(safe-area-inset-bottom)); }
  body.menu-open { overflow: hidden; }
  .topbar { height: calc(64px + env(safe-area-inset-top)); min-height: 64px; padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); overflow: visible; }
  .mobile-nav-title { display: block; color: var(--text); font-size: 15px; font-weight: 800; letter-spacing: .04em; }
  .menu-toggle { display: grid; width: 44px; height: 44px; place-content: center; gap: 5px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.04); }
  .menu-toggle span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--text); transition: transform .18s ease, opacity .18s ease; }
  .menu-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .menu-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav-backdrop { position: fixed; z-index: 30; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; visibility: hidden; opacity: 0; background: rgba(2, 8, 16, .7); backdrop-filter: blur(3px); transition: opacity .2s ease, visibility .2s ease; }
  .menu-open .nav-backdrop { visibility: visible; opacity: 1; }
  .topbar nav { position: fixed; z-index: 31; top: 0; right: 0; bottom: 0; display: flex; width: min(86vw, 360px); height: 100dvh; margin: 0; padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) 18px; overflow-y: auto; align-items: stretch; flex-direction: column; gap: 10px; visibility: hidden; transform: translateX(105%); border-left: 1px solid var(--line); background: rgba(8, 20, 35, .98); box-shadow: -24px 0 70px rgba(0,0,0,.42); transition: transform .22s ease, visibility .22s ease; }
  .menu-open .topbar nav { visibility: visible; transform: translateX(0); }
  .nav-drawer-head { display: flex; min-height: 48px; align-items: center; justify-content: space-between; margin-bottom: 8px; padding: 0 2px 12px; border-bottom: 1px solid var(--line); }
  .nav-drawer-head strong { font-size: 17px; }
  .menu-close { display: grid; width: 44px; height: 44px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: rgba(255,255,255,.04); font-size: 28px; line-height: 1; }
  .topbar nav a, .topbar nav form { width: 100%; flex: 0 0 auto; }
  .topbar nav a, .nav-button { display: flex; width: 100%; min-height: 50px; align-items: center; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); color: #d7e4ec; font-size: 15px; white-space: nowrap; }
  .topbar nav a:active, .nav-button:active { border-color: rgba(80,227,194,.45); background: rgba(80,227,194,.09); }
  .topbar nav form { margin-top: auto; padding-top: 12px; }
  .topbar .nav-button { justify-content: center; color: #ffd5d9; border-color: rgba(255,111,125,.24); background: rgba(255,111,125,.07); }
  .brand small { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 18px; margin-bottom: 22px; }
  .page-head h1 { font-size: 34px; }
  .page-head > .button { width: 100%; }
  .head-actions { width: 100%; }
  .head-actions .button { width: auto; min-width: 0; flex: 1; padding-inline: 12px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { min-height: 118px; padding: 18px; border-radius: 17px; }
  .stat-card strong { margin: 10px 0 6px; font-size: 30px; }
  .stat-card .stat-size { margin-top: 17px; font-size: 20px; overflow-wrap: anywhere; }
  .field-grid { grid-template-columns: 1fr; }
  .traffic-split, .configuration-grid, .rank-list-wide { grid-template-columns: 1fr; }
  .analytics-filter { grid-template-columns: 1fr; align-items: stretch; }
  .analytics-filter .button { width: 100%; }
  .daily-activity > div { grid-template-columns: 82px 1fr 28px; }
  .panel { border-radius: 18px; }
  .panel-head { padding: 19px 18px; }
  .auth-shell { min-height: 100svh; padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom)); }
  .auth-card { padding: 30px 22px; border-radius: 22px; }
  .form-section { padding: 22px 18px; }
  input, select, textarea { font-size: 16px; }
  .form-actions .button { width: 100%; }
  .check-group, .danger-actions, .delete-form { align-items: stretch; flex-direction: column; }
  .danger-zone { padding: 20px 18px; }
  .danger-actions, .danger-actions > form, .delete-form { width: 100%; }
  .danger-actions .button, .delete-form .button { width: 100%; }
  .adjustment-grid { gap: 12px; padding: 14px; }
  .adjustment-form { grid-template-columns: 1fr; }
  .adjustment-buttons .button { flex: 1; }
  .delete-form input { width: 100%; }
  .service-hero { gap: 26px; padding: 22px 18px; }
  .service-hero h2 { overflow-wrap: anywhere; }
  .meter-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .credentials { padding-inline: 18px; }
  .credentials > div { grid-template-columns: 1fr; gap: 8px; }
  .credentials dd { gap: 8px; }
  .credentials code { white-space: normal; overflow-wrap: anywhere; }
  .credentials button, [data-copy] { min-width: 44px; min-height: 44px; padding: 0 10px; }
  .link-field { padding-inline: 18px; }
  .link-field .button, .subscription-reset .button { width: 100%; }
  .subscription-reset { padding-inline: 18px; }
  .qr-panel { padding: 20px 18px; }
  .qr-frame { width: min(100%, 320px); margin-inline: auto; padding: 14px; }
  .empty-state { padding: 34px 22px; }
  .analytics-panel-body, .configuration-grid { padding: 20px 18px; }
  .status-breakdown { padding-inline: 18px; }
  .compact-list, .daily-activity, .rank-list { padding-inline: 18px; }

  .table-wrap { overflow: visible; }
  .mobile-cards, .mobile-cards tbody, .mobile-cards tr, .mobile-cards td { display: block; width: 100%; }
  .mobile-cards thead { display: none; }
  .mobile-cards tbody { padding: 12px; }
  .mobile-cards tr { margin-bottom: 12px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.018); }
  .mobile-cards tr:last-child { margin-bottom: 0; }
  .mobile-cards td { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); white-space: normal; overflow-wrap: anywhere; }
  .mobile-cards td:last-child { border-bottom: 0; }
  .mobile-cards td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
  .mobile-cards td[colspan] { display: block; padding: 28px 12px; border: 0; }
  .mobile-cards td[colspan]::before { content: none; }
  .mobile-cards .actions { display: grid; grid-template-columns: 88px repeat(2, minmax(0, auto)); justify-content: start; }
  .mobile-cards .actions a, .mobile-cards .actions button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); }
  .mobile-cards .usage-cell > span, .mobile-cards .usage-cell > progress { grid-column: 2; }
  .mobile-cards .usage-cell::before { grid-row: 1 / span 2; }
}

@media (max-width: 360px) {
  .stats-grid { grid-template-columns: 1fr; }
  .head-actions { flex-direction: column; }
  .mobile-cards td { grid-template-columns: 76px minmax(0, 1fr); }
  .mobile-cards .actions { grid-template-columns: 76px repeat(2, minmax(0, auto)); }
}

@media (hover: none) {
  .button:hover { transform: none; }
}
