:root {
  color-scheme: light;
  --ink: #18181b;
  --muted: #71717a;
  --line: #e4e4e7;
  --canvas: #fff;
  --paper: #fff;
  --nav: #fafafa;
  --accent: #18181b;
  --accent-dark: #303036;
  --accent-pale: #f4f4f5;
  --radius: 12px;
  --sidebar-width: 248px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "Cascadia Code", Consolas, monospace;
}
.auth-page { min-height: 100svh; display: grid; place-items: center; padding: 32px 16px; background: var(--nav); }
.auth-shell { width: min(100%, 440px); margin: 0; padding: 0; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; color: var(--ink); text-decoration: none; font-size: 18px; }
.auth-panel { padding: 30px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.auth-panel h1 { margin: 4px 0 12px; font-size: 27px; }
.auth-panel .fields { margin-top: 24px; }
.auth-submit { width: 100%; margin-top: 22px; min-height: 42px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12px; margin: 22px 0 0; }
@media(max-width:480px) { .auth-panel { padding: 24px 20px; } }
.account-devices { min-width: 820px; }
.account-devices .actions { flex-wrap: wrap; }
.device-history { margin-top: 8px; max-width: 240px; }
.device-history summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.device-history ul { padding-left: 16px; max-height: 220px; overflow-y: auto; overflow-wrap: anywhere; }
.device-history li { margin: 8px 0; font-size: 12px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid #71717a; outline-offset: 3px; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 20; padding: 10px 16px; background: var(--ink); color: white; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.icon { width: 18px; height: 18px; flex-shrink: 0; display: block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[data-icon] { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); z-index: 5; display: flex; flex-direction: column; padding: 20px 12px 12px; background: var(--nav); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 25px; min-height: 60px; }
.brand-icon { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 750; letter-spacing: -.6px; }
.brand-copy { font-size: 16px; font-weight: 700; line-height: 1.35; letter-spacing: -.4px; }
.brand-copy>span { display: block; color: var(--muted); font-size: 11px; font-weight: 400; letter-spacing: 0; }
.brand-badge { margin-left: auto; font: 600 8px var(--mono); letter-spacing: .4px; }
nav { overflow: auto; flex: 1; scrollbar-width: thin; }
.nav-label { padding: 18px 10px 7px; color: var(--muted); font-size: 11px; font-weight: 500; white-space: nowrap; }
.nav-label:first-child { padding-top: 0; }
nav button { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 36px; padding: 8px 10px; margin: 2px 0; border: 0; border-radius: 6px; background: transparent; color: #52525b; text-align: left; font-size: 13px; font-weight: 450; }
nav button:hover { background: #f0f0f2; color: var(--ink); }
nav button.active { background: #eaeaed; color: #18181b; font-weight: 600; }
nav button.active:after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-left: auto; }
nav .icon { width: 17px; height: 17px; }
.sidebar-bottom { padding: 14px 8px 0; margin-top: 18px; border-top: 1px solid var(--line); }
.local-profile { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.profile-avatar { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.profile-copy strong { display: block; font-size: 12px; font-weight: 600; }
.profile-copy>span, .sidebar-version { color: var(--muted); font-size: 10px; }
.sidebar-version { margin: 9px 0 2px; }
#connection-status { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #a1a1aa; flex-shrink: 0; }
.online .dot { background: #15803d; }
.workspace { margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 64px; min-height: 64px; padding: 0 32px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; background: #fff; position: sticky; top: 0; z-index: 3; }
.breadcrumb, .toolbar, .actions { display: flex; align-items: center; gap: 8px; }
.breadcrumb { font-size: 12px; min-width: 0; }
.breadcrumb-root, .slash { color: var(--muted); }
.breadcrumb-divider { width: 1px; height: 18px; background: var(--line); margin: 0 8px; }
#breadcrumb-page { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar { flex-shrink: 0; }
#busy { font-size: 11px; color: var(--muted); }
#busy:before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border: 1.5px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
main { width: min(1600px, 100%); margin: 0 auto; padding: 30px 32px 40px; flex: 1; min-width: 0; scroll-margin-top: 80px; }
main:focus { outline: none; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 6px; font: 500 9px var(--mono); letter-spacing: 1.5px; color: var(--muted); }
h1 { margin: 0; font-size: 28px; font-weight: 650; line-height: 1.2; letter-spacing: -1px; }
#page-description { margin: 8px 0 0; color: var(--muted); font-size: 13px; max-width: 640px; }
.page-actions { flex-shrink: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 8px 12px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 550; line-height: 1.3; text-decoration: none; white-space: nowrap; box-shadow: 0 1px 2px #00000008; }
.button:hover { background: var(--accent-dark); }
.button:disabled { opacity: .45; box-shadow: none; }
.button .icon { width: 14px; height: 14px; }
.button.secondary, .button.light { background: #fff; border-color: var(--line); color: var(--ink); }
.button.secondary:hover, .button.light:hover { background: #f4f4f5; }
.button.ghost { background: transparent; color: #52525b; border-color: transparent; box-shadow: none; }
.button.ghost:hover { background: #f4f4f5; color: var(--ink); }
.button.danger { background: #b91c1c; border-color: #b91c1c; }
.button.danger:hover { background: #991b1b; }
.button.small { min-height: 29px; padding: 5px 9px; font-size: 11px; }
.icon-button { display: inline-flex; justify-content: center; align-items: center; width: 30px; height: 30px; padding: 5px; border: 0; border-radius: 5px; background: transparent; color: #52525b; font-size: 22px; flex-shrink: 0; }
.icon-button:hover { background: #f4f4f5; color: #18181b; }
.badge { display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px; font-size: 10px; font-weight: 500; white-space: nowrap; }
.badge.quiet { color: #52525b; background: #fafafa; }
.badge.green { color: #166534; background: #f0fdf4; border-color: #dcfce7; }
.badge.red { color: #991b1b; background: #fef2f2; border-color: #fee2e2; }
.badge.blue { color: #1e40af; background: #eff6ff; border-color: #dbeafe; }
.badge.amber { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat, .card { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px #00000004; }
.stat { padding: 20px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-top .icon { width: 16px; height: 16px; color: var(--muted); }
.label { margin: 0; color: #52525b; font-size: 12px; }
.stat strong { display: block; margin: 12px 0 10px; font-size: clamp(23px, 2.1vw, 32px); line-height: 1.2; letter-spacing: -1px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat .money-stat { font-size: clamp(19px, 1.9vw, 29px); }
.stat .hint { color: var(--muted); font-size: 11px; }
.card { padding: 22px; }
.card h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.3px; }
.card h3 { font-size: 13px; margin: 20px 0 8px; }
.card p { color: #52525b; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.card-head .muted { display: block; margin-top: 4px; }
.muted, .table-sub, .section-note { color: var(--muted) !important; font-size: 12px; }
.table-sub { margin-top: 4px; font-size: 11px; }
.section-note { margin: 14px 0 0 !important; font-size: 11px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.grid.wide-left { grid-template-columns: 1.25fr .75fr; }
.overview-insights { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 20px; }
.activity-metrics { display: grid; gap: 24px; margin-top: 26px; }
.metric-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 9px; font-size: 12px; }
.metric-label strong { font-weight: 550; }
.metric-label>span { color: var(--muted); font-variant-numeric: tabular-nums; }
progress { display: block; appearance: none; width: 100%; height: 7px; border: 0; border-radius: 99px; overflow: hidden; background: #f4f4f5; }
progress::-webkit-progress-bar { background: #f4f4f5; border-radius: 99px; }
progress::-webkit-progress-value { background: #27272a; border-radius: 99px; }
progress::-moz-progress-bar { background: #27272a; border-radius: 99px; }
.metric:nth-child(2) progress::-webkit-progress-value { background: #71717a; }
.metric:nth-child(3) progress::-webkit-progress-value { background: #a1a1aa; }
.metric:nth-child(2) progress::-moz-progress-bar { background: #71717a; }
.metric:nth-child(3) progress::-moz-progress-bar { background: #a1a1aa; }
.payment-total { margin: 12px 0 4px; font-size: 30px; font-weight: 650; line-height: 1.25; letter-spacing: -1px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.payment-summary { display: grid; gap: 0; margin-top: 18px; }
.payment-summary>div { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid #f0f0f2; padding: 11px 0; font-size: 12px; color: #52525b; }
.payment-summary strong { color: var(--ink); font-weight: 550; }
.payment-summary .attention { color: #b45309; }
.overview-tables { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.overview-tables .table-wrap { border: 0; border-radius: 0; }
.overview-tables table { min-width: 480px; }
.overview-tables .card { padding-bottom: 12px; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quick-grid .button { justify-content: flex-start; padding: 12px; }
.quick-grid .icon { margin-right: 3px; color: var(--muted); }
.summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.summary>div { padding: 12px 10px 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
.summary small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.welcome { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; padding: 22px; background: #fafafa; }
.welcome>.welcome-icon { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.welcome-copy { flex: 1; }
.welcome h2 { font-size: 16px; }
.welcome p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.offline-guide { margin-top: 22px; }
.offline-guide .quick-grid { margin-top: 18px; }
.maintenance { background: #fafafa; box-shadow: none; }
.maintenance>summary { cursor: pointer; font-size: 12px; font-weight: 550; color: #52525b; }
.maintenance[open]>summary { margin-bottom: 18px; }
.maintenance .card-head { margin-bottom: 0; }
.maintenance p { font-size: 12px; margin-bottom: 0; }
#notice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; margin-bottom: 20px; border: 1px solid #dbeafe; border-radius: 8px; background: #eff6ff; color: #1e40af; font-size: 12px; overflow-wrap: anywhere; }
#notice.success { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
#notice.error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
#notice.warning { border-color: #fde68a; background: #fffbeb; color: #92400e; }
#notice button { margin-left: auto; border: 0; background: transparent; color: inherit; font-size: 18px; line-height: 1; padding: 0 2px; }
input, select, textarea { width: 100%; min-width: 0; min-height: 36px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-size: 12px; box-shadow: 0 1px 2px #00000003; }
input::placeholder, textarea::placeholder { color: #8c8c95; }
input:focus, select:focus, textarea:focus { border-color: #a1a1aa; outline: 2px solid #e4e4e7; outline-offset: 1px; }
input:disabled { background: #f4f4f5; color: var(--muted); }
textarea { min-height: 86px; resize: vertical; }
input[type="checkbox"] { appearance: auto; width: 14px; height: 14px; min-height: 0; flex-shrink: 0; accent-color: var(--ink); box-shadow: none; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: block; min-width: 0; }
.field.full, .wide { grid-column: 1/-1; }
.field>span { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 500; color: #3f3f46; }
.checkline { display: flex; align-items: center; gap: 8px; color: #52525b; font-size: 12px; }
.spaced { margin-top: 20px; }
form>.button { margin-top: 18px; }
.grow { flex: 1; }
.right { justify-content: flex-end; }
.callout { padding: 12px 14px; margin-top: 16px; border: 1px solid var(--line); border-radius: 7px; background: #fafafa; color: #52525b; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.callout.warning { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.callout.success { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.toolbar-mini { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.toolbar-mini input { flex: 1; }
.toolbar-mini select { width: 180px; }
.filter-bar { display: grid; grid-template-columns: minmax(180px, 1fr) 160px 160px auto; gap: 10px; align-items: end; margin-bottom: 20px; }
.filter-bar.devices-filter { grid-template-columns: minmax(180px, 1fr) 150px 130px auto auto; align-items: center; }
.filter-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.table-wrap { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 8px; scrollbar-width: thin; }
table { border-collapse: collapse; width: 100%; min-width: 650px; background: #fff; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid #efeff1; vertical-align: middle; font-size: 12px; }
th { background: #fafafa; color: var(--muted); font-size: 11px; font-weight: 500; white-space: nowrap; }
td strong { font-weight: 550; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafafa; }
code, .log-json { font: 11px/1.6 var(--mono); }
.empty { padding: 34px 20px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); text-align: center; font-size: 12px; }
.empty strong { display: block; color: #3f3f46; font-weight: 550; margin-bottom: 5px; }
.loading-state { background: #fafafa; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; color: var(--muted); font-size: 11px; }
dialog { width: min(940px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); box-shadow: 0 20px 80px #00000026; }
dialog::backdrop { background: #00000060; }
.modal-heading { display: flex; position: sticky; top: 0; z-index: 1; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); background: #fff; }
.modal-heading h2 { margin: 0; font-size: 17px; line-height: 1.4; font-weight: 600; letter-spacing: -.4px; }
#modal-body { padding: 22px 24px 26px; }
.modal-narrow { max-width: 540px; }
.detail-section { margin-top: 24px; }
.log-json { white-space: pre-wrap; background: #fafafa; border: 1px solid var(--line); border-radius: 8px; padding: 14px; overflow: auto; max-height: 340px; }
.modal-error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.wrap { overflow-wrap: anywhere; }
footer { display: flex; justify-content: space-between; gap: 16px; padding: 16px 32px; border-top: 1px solid #f0f0f2; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.footer-version { font-family: var(--mono); flex-shrink: 0; }
.sidebar-backdrop { display: none; }
body.sidebar-collapsed { --sidebar-width: 68px; }
.sidebar-collapsed .brand { padding-left: 4px; }
.sidebar-collapsed .brand-copy, .sidebar-collapsed .brand-badge, .sidebar-collapsed .nav-label, .sidebar-collapsed .nav-text, .sidebar-collapsed .profile-copy, .sidebar-collapsed #connection-status, .sidebar-collapsed .sidebar-version { display: none; }
.sidebar-collapsed nav button { justify-content: center; padding: 10px; }
.sidebar-collapsed nav button.active:after { display: none; }
.sidebar-collapsed nav button:nth-of-type(5), .sidebar-collapsed nav button:nth-of-type(10) { margin-top: 20px; }
.sidebar-collapsed .sidebar-bottom { padding-left: 5px; padding-right: 5px; }
.sidebar-collapsed .local-profile { margin-bottom: 0; }
@media (min-width: 1600px) { .stat { padding: 24px; } }
@media (max-width: 1390px) { .overview-tables { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1260px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-insights { grid-template-columns: minmax(0, 1.2fr) minmax(250px, 1fr); }
  .page-heading { align-items: flex-start; }
  .filter-bar, .filter-bar.devices-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat strong { font-size: 30px; }
  .stat .money-stat { font-size: 27px; }
}
@media (max-width: 1050px) {
  .topbar { padding: 0 22px; }
  main { padding: 26px 22px 36px; }
  .breadcrumb-root, .slash { display: none; }
  .grid.wide-left, .overview-insights { grid-template-columns: minmax(0, 1fr); }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-heading { flex-wrap: wrap; }
  .payment-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .payment-summary>div { display: block; }
  .payment-summary strong { display: block; margin-top: 6px; }
}
@media (max-width: 760px) {
  body, body.sidebar-collapsed { --sidebar-width: 248px; }
  .sidebar { visibility: hidden; transform: translateX(-100%); z-index: 10; box-shadow: 10px 0 40px #00000012; }
  .workspace { margin-left: 0; }
  .sidebar-open { overflow: hidden; }
  .sidebar-open .sidebar { transform: none; visibility: visible; }
  .sidebar nav button { min-height: 44px; }
  .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 9; border: 0; background: #00000055; }
  .topbar { padding: 0 16px; height: 58px; min-height: 58px; }
  main { padding: 24px 16px 32px; }
  .breadcrumb-divider { margin: 0 4px; }
  .toolbar { gap: 3px; }
  .toolbar .button { font-size: 11px; min-height: 34px; padding: 7px 9px; }
  #busy { position: fixed; bottom: 16px; right: 16px; z-index: 15; padding: 10px 14px; background: #18181b; color: white; border-radius: 8px; box-shadow: 0 3px 12px #0002; }
  .page-heading { gap: 16px; margin-bottom: 22px; }
  h1 { font-size: 26px; }
  .stats { gap: 12px; }
  .stat { padding: 16px; }
  .stat strong { font-size: 28px; }
  .stat .money-stat { font-size: 23px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .overview-insights { gap: 16px; }
  .card { padding: 18px; }
  .actions { flex-wrap: wrap; }
  .page-actions { flex-wrap: nowrap; }
  .toolbar-mini { flex-wrap: wrap; }
  .toolbar-mini input { flex-basis: 100%; }
  .toolbar-mini select { width: auto; flex: 1; }
  .welcome { flex-wrap: wrap; }
  .welcome-copy { flex-basis: calc(100% - 70px); }
  .welcome>.button { margin-left: 60px; }
  footer { padding: 16px; }
  .sidebar-collapsed .brand { padding-left: 8px; }
  .sidebar-collapsed .brand-copy, .sidebar-collapsed .brand-badge, .sidebar-collapsed .profile-copy, .sidebar-collapsed .nav-label, .sidebar-collapsed .nav-text, .sidebar-collapsed .sidebar-version { display: block; }
  .sidebar-collapsed #connection-status { display: flex; }
  .sidebar-collapsed nav button { justify-content: flex-start; padding: 8px 10px; }
  .sidebar-collapsed nav button.active:after { display: block; }
  .sidebar-collapsed nav button:nth-of-type(5), .sidebar-collapsed nav button:nth-of-type(10) { margin-top: 2px; }
  .sidebar-collapsed .local-profile { margin-bottom: 16px; }
}
@media (max-width: 480px) {
  #breadcrumb-page { max-width: 100px; font-size: 11px; }
  .breadcrumb-divider { display: none; }
  .toolbar .button { font-size: 10px; padding: 7px; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat { padding: 18px; }
  .stat strong, .stat .money-stat { font-size: 30px; }
  .fields, .filter-bar, .filter-bar.devices-filter { grid-template-columns: minmax(0, 1fr); }
  .summary { grid-template-columns: minmax(0, 1fr); }
  .card-head { flex-wrap: wrap; gap: 10px; }
  .payment-summary { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .payment-summary>div { display: flex; }
  .payment-summary strong { margin: 0; }
  .payment-total { font-size: 29px; }
  .quick-grid { grid-template-columns: minmax(0, 1fr); }
  .pager { flex-wrap: wrap; }
  dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .modal-heading { padding: 16px; }
  #modal-body { padding: 18px 16px; }
}
@media (max-width: 760px) {
  .account-devices { min-width: 0; }
  .account-devices thead { display: none; }
  .account-devices tbody, .account-devices tr, .account-devices td { display: block; }
  .account-devices tr { padding: 12px; border-bottom: 1px solid var(--line); }
  .account-devices tr:last-child { border-bottom: 0; }
  .account-devices td { padding: 6px 0; border: 0; overflow-wrap: anywhere; white-space: normal; }
  .account-devices td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
}
@media (prefers-reduced-motion: reduce) { #busy:before { animation: none; } }
@media (max-width: 760px) {
  .vault-table, .accounts-table { min-width: 0; }
  .vault-table tbody, .vault-table tr, .vault-table td, .accounts-table tbody, .accounts-table tr, .accounts-table td { display: block; }
  .vault-table tr, .accounts-table tr { padding: 12px; border-bottom: 1px solid var(--line); }
  .vault-table td, .accounts-table td { padding: 6px 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  .vault-table tbody tr { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 0 8px; }
  .vault-table td { grid-column: 2; }
  .vault-table td:first-child { grid-column: 1; grid-row: 1; }
  .vault-table thead, .vault-table thead tr { display: block; }
  .vault-table th, .accounts-table thead { display: none; }
  .vault-table th:first-child { display: flex; align-items: center; gap: 8px; }
  .vault-table th:first-child::after { content: 'Chọn tất cả'; }
  .vault-table td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; margin-bottom: 3px; }
  .vault-table .actions { flex-wrap: wrap; }
  .accounts-table tr:last-child, .vault-table tbody tr:last-child { border-bottom: 0; }
}

/* Website + phát hành online */
.card + .card, .card + details.card, details.card + .card { margin-top: 18px; }
.manual-release > summary { cursor: pointer; font-size: 15px; font-weight: 600; letter-spacing: -.3px; }
.manual-release[open] > summary { margin-bottom: 8px; }
.publish-log { margin-top: 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 7px; background: #fafafa; font-size: 12px; }
.publish-log.done { border-color: #bbf7d0; background: #f0fdf4; }
.publish-log.failed { border-color: #fecaca; background: #fef2f2; }
.publish-log-head { display: flex; justify-content: space-between; gap: 10px; }
.publish-log ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.7; overflow-wrap: anywhere; }
.publish-log code { font-size: 11px; }
.summary + .actions, .summary + .callout, .summary + form { margin-top: 14px; }
.fields > p.full { grid-column: 1 / -1; margin: 0; }