:root[data-theme="dark"] {
  color-scheme: dark;
  --theme-bg: #000;
  --theme-panel: #1c1c1e;
  --theme-panel-raised: #2c2c2e;
  --theme-panel-hover: #3a3a3c;
  --theme-text: #f5f5f7;
  --theme-muted: #a1a1a6;
  --theme-border: #38383a;
  --theme-accent: #0a84ff;
  --theme-cover-glass: #ffffff24;
}
:root[data-theme="light"] {
  color-scheme: light;
  --theme-bg: #fff;
  --theme-panel: #f5f5f7;
  --theme-panel-raised: #ebebef;
  --theme-panel-hover: #e1e1e6;
  --theme-text: #1d1d1f;
  --theme-muted: #6e6e73;
  --theme-border: #d2d2d7;
  --theme-accent: #007aff;
  --theme-cover-glass: #ffffff70;
}

/* Authenticated editor: full neutral dark and light palettes. */
:root[data-theme] body,
:root[data-theme] #viewport { color: var(--theme-text); background: var(--theme-bg); }
:root[data-theme] header,
:root[data-theme] .subbar,
:root[data-theme] #selection-bar,
:root[data-theme] #mask-edit-bar,
:root[data-theme] footer,
:root[data-theme] #mobile-nav,
:root[data-theme] body.mobile-ui #mobile-nav { background: var(--theme-panel); border-color: var(--theme-border); }
:root[data-theme] aside,
:root[data-theme] body.mobile-ui #sidebar,
:root[data-theme] .inspect-preview-pane,
:root[data-theme] .candidate-compare > div,
:root[data-theme] .translation-candidate,
:root[data-theme] .page-loading-indicator { color: var(--theme-text); background: var(--theme-panel); border-color: var(--theme-border); }
:root[data-theme] .library { border-color: var(--theme-border); }
:root[data-theme] .library label,
:root[data-theme] .brand small,
:root[data-theme] #backend-label,
:root[data-theme] #page-info,
:root[data-theme] #work-count,
:root[data-theme] .muted,
:root[data-theme] .thumbnail small,
:root[data-theme] .preview-zoom-controls span,
:root[data-theme] .candidate-compare strong { color: var(--theme-muted); }
:root[data-theme] button,
:root[data-theme] body.mobile-ui #mobile-tools-dialog .toolbar > button { color: var(--theme-text); background: var(--theme-panel-raised); border-color: var(--theme-border); }
:root[data-theme] button:hover:not(:disabled),
:root[data-theme] body.mobile-ui #mobile-tools-dialog .toolbar > button:hover:not(:disabled) { background: var(--theme-panel-hover); }
:root[data-theme] .toolbar button { background: transparent; border-color: transparent; }
:root[data-theme] .toolbar button.accent,
:root[data-theme] .toolbar button[aria-pressed="true"],
:root[data-theme] button.accent,
:root[data-theme] button[aria-pressed="true"],
:root[data-theme] body.mobile-ui #mobile-nav button[aria-pressed="true"],
:root[data-theme] body.mobile-ui #mobile-tools-dialog .toolbar > button.accent,
:root[data-theme] body.mobile-ui #mobile-tools-dialog .toolbar > button[aria-pressed="true"] { color: #fff; background: var(--theme-accent); border-color: var(--theme-accent); }
:root[data-theme] input,
:root[data-theme] select,
:root[data-theme] textarea { color: var(--theme-text); background: var(--theme-panel-raised); border-color: var(--theme-border); color-scheme: inherit; }
:root[data-theme] input:focus,
:root[data-theme] textarea:focus,
:root[data-theme] select:focus { border-color: var(--theme-accent); }
:root[data-theme] dialog { color: var(--theme-text); background: var(--theme-panel); border-color: var(--theme-border); }
:root[data-theme] .dialog-heading,
:root[data-theme] body.mobile-ui .dialog-heading,
:root[data-theme] body.mobile-ui .inspect-dialog .dialog-actions { color: var(--theme-text); background: var(--theme-panel); }
:root[data-theme] dialog::backdrop { background: #0008; }
:root[data-theme] .notice { color: var(--theme-text); background: var(--theme-panel-raised); }
:root[data-theme] .help-tooltip { color: var(--theme-text); background: var(--theme-panel); border-color: var(--theme-border); }
:root[data-theme] #context-menu { color: var(--theme-text); background: var(--theme-panel); border-color: var(--theme-border); }
:root[data-theme] #context-menu button { color: var(--theme-text); }
:root[data-theme] #context-menu button:hover:not(:disabled) { color: #fff; background: var(--theme-accent); }
:root[data-theme] #source-hover { color: var(--theme-text); background: var(--theme-panel); border-color: var(--theme-border); }
:root[data-theme] #source-preview-viewport,
:root[data-theme] #secondary-source-preview-viewport { background: var(--theme-bg); scrollbar-color: #777 var(--theme-panel); }
:root[data-theme] #sidebar-toggle,
:root[data-theme] body.mobile-ui #sidebar-toggle { color: var(--theme-text); background: var(--theme-panel-raised); border-color: var(--theme-border); }
:root[data-theme] #sidebar-toggle:hover { background: var(--theme-panel-hover); }
:root[data-theme] .translation-candidate:hover,
:root[data-theme] .translation-candidate.selected { background: var(--theme-panel-hover); border-color: var(--theme-accent); }
:root[data-theme] .translation-candidate input { accent-color: var(--theme-accent); }
:root[data-theme] #full-text-warning { color: var(--theme-text); background: color-mix(in srgb, #b86b35 16%, var(--theme-panel)); border-color: color-mix(in srgb, #b86b35 48%, var(--theme-border)); }
:root[data-theme] #page-trash { color: var(--theme-text); background: color-mix(in srgb, #d72e3e 28%, var(--theme-panel)); }
:root[data-theme] #page-trash.drag-over { background: #a52e39; }
:root[data-theme] .thumbnail:hover { background: var(--theme-panel-raised); }
:root[data-theme] .thumbnail.selected { background: color-mix(in srgb, var(--theme-accent) 24%, var(--theme-panel)); border-color: var(--theme-accent); }
:root[data-theme] .project-card,
:root[data-theme] .translation-candidate { color: var(--theme-text); }
:root[data-theme] #page-loading { color: var(--theme-text); background: #0009; }

:root[data-theme="light"] #selection-hint,
:root[data-theme="light"] #mask-edit-hint { color: var(--theme-muted); }
:root[data-theme="light"] #upload-overlay { color: var(--theme-text); background: #eaf5ffed; border-color: var(--theme-accent); }
:root[data-theme="light"] .ocr-selection-preview { color: #413500; background: #fff5ca; }
:root[data-theme="light"] .error,
:root[data-theme="light"] .library button.danger { color: #a12620; }
:root[data-theme="light"] .usage-warning { color: #805800; }
:root[data-theme="light"] #page-trash { color: #7f1d1d; background: #fff0f0; border-color: #cf4040; }
:root[data-theme="light"] #source-hover { background: #fffbea; }
:root[data-theme="light"] .connection.ok { color: #16803c; }
:root[data-theme="light"] .connection.fail { color: #c62828; }
:root[data-theme="light"] .connection { color: #737373; }

.theme-open-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.theme-dialog { width: min(420px, calc(100vw - 32px)); padding: 22px; color: var(--theme-text); background: var(--theme-panel); border: 1px solid var(--theme-border); border-radius: 14px; box-shadow: 0 18px 70px #0008; }
.theme-dialog::backdrop { background: #0008; }
.theme-dialog form { margin: 0; }
.theme-dialog h2 { margin: 0 0 9px; font-size: 20px; }
.theme-dialog p { color: var(--theme-muted); line-height: 1.55; }
.theme-dialog label { display: grid; gap: 8px; margin: 16px 0; }
.theme-dialog select { width: 100%; min-height: 42px; padding: 8px 10px; color: var(--theme-text); background: var(--theme-panel-raised); border: 1px solid var(--theme-border); border-radius: 8px; font: inherit; }
.theme-dialog .theme-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.theme-dialog button { min-height: 38px; padding: 8px 13px; color: var(--theme-text); background: var(--theme-panel-raised); border: 1px solid var(--theme-border); border-radius: 8px; font: inherit; cursor: pointer; }
.theme-dialog button.theme-save { color: var(--theme-bg); background: var(--theme-text); }
.theme-dialog button:focus-visible { outline: 2px solid var(--theme-accent); outline-offset: 2px; }

/* Login, registration and private image space share the same appearance. */
body.portal { color: var(--theme-text); background: var(--theme-bg); color-scheme: inherit; }
body.portal h1,
body.portal h2,
body.portal h3,
body.portal label,
body.portal strong { color: var(--theme-text); }
body.portal p,
body.portal footer { color: var(--theme-muted); }
body.portal section { color: var(--theme-text); background: var(--theme-panel); border-color: var(--theme-border); }
body.portal input,
body.portal select,
body.portal textarea { color: var(--theme-text); background: var(--theme-panel-raised); border-color: var(--theme-border); color-scheme: inherit; }
body.portal input::placeholder,
body.portal textarea::placeholder { color: var(--theme-muted); }
body.portal button,
body.portal a.button { color: var(--theme-text); background: var(--theme-panel-raised); border-color: var(--theme-border); }
body.portal button:hover:not(:disabled),
body.portal a.button:hover { background: var(--theme-panel-hover); }
body.portal a:not(.button) { color: var(--theme-accent); }
body.portal #message { color: var(--theme-text); }
body.portal .portal-header-actions { margin-left: auto; }
body.portal .theme-open-button { white-space: nowrap; }

html[data-theme] body.portal.space-page,
html[data-theme] body.portal.space-page #space.private-space { color: var(--theme-text); background: var(--theme-bg); color-scheme: inherit; }
html[data-theme] body.portal.space-page .space-sidebar { background: var(--theme-panel); border-color: var(--theme-border); }
html[data-theme] body.portal.space-page .space-brand,
html[data-theme] body.portal.space-page .space-nav a,
html[data-theme] body.portal.space-page .space-nav .space-nav-theme,
html[data-theme] body.portal.space-page .profile-copy strong,
html[data-theme] body.portal.space-page .storage-label strong,
html[data-theme] body.portal.space-page .space-heading h1,
html[data-theme] body.portal.space-page .project-section-heading h2,
html[data-theme] body.portal.space-page .stat-card strong,
html[data-theme] body.portal.space-page .project-card-title,
html[data-theme] body.portal.space-page .panel-heading h2,
html[data-theme] body.portal.space-page .admin-panel h2,
html[data-theme] body.portal.space-page .admin-panel h3 { color: var(--theme-text); }
html[data-theme] body.portal.space-page .space-nav a:hover,
html[data-theme] body.portal.space-page .space-nav a.active,
html[data-theme] body.portal.space-page .space-nav .space-nav-theme:hover { background: var(--theme-panel-raised); }
html[data-theme] body.portal.space-page .nav-icon,
html[data-theme] body.portal.space-page .profile-copy span,
html[data-theme] body.portal.space-page .storage-box p,
html[data-theme] body.portal.space-page .storage-label,
html[data-theme] body.portal.space-page .space-eyebrow,
html[data-theme] body.portal.space-page .space-heading p,
html[data-theme] body.portal.space-page .project-section-heading p,
html[data-theme] body.portal.space-page .panel-heading p,
html[data-theme] body.portal.space-page .stat-card span,
html[data-theme] body.portal.space-page .stat-card small,
html[data-theme] body.portal.space-page .project-card-meta,
html[data-theme] body.portal.space-page .key-note,
html[data-theme] body.portal.space-page .admin-panel p { color: var(--theme-muted); }
html[data-theme] body.portal.space-page .space-sidebar-bottom,
html[data-theme] body.portal.space-page .space-sidebar { border-color: var(--theme-border); }
html[data-theme] body.portal.space-page .profile-avatar,
html[data-theme] body.portal.space-page .storage-box progress,
html[data-theme] body.portal.space-page .storage-box progress::-webkit-progress-bar,
html[data-theme] body.portal.space-page .view-switch,
html[data-theme] body.portal.space-page .stat-card,
html[data-theme] body.portal.space-page .project-status,
html[data-theme] body.portal.space-page .empty-projects,
html[data-theme] body.portal.space-page .settings-lock { color: var(--theme-text); background: var(--theme-panel-raised); }
html[data-theme] body.portal.space-page .profile-avatar,
html[data-theme] body.portal.space-page .stat-card,
html[data-theme] body.portal.space-page .project-card,
html[data-theme] body.portal.space-page .api-settings-panel,
html[data-theme] body.portal.space-page .admin-panel,
html[data-theme] body.portal.space-page .empty-projects { border-color: var(--theme-border); }
html[data-theme] body.portal.space-page .storage-box progress::-webkit-progress-value,
html[data-theme] body.portal.space-page .storage-box progress::-moz-progress-bar { background: var(--theme-text); }
html[data-theme] body.portal.space-page .sidebar-logout,
html[data-theme] body.portal.space-page .space-button { color: var(--theme-text) !important; background: var(--theme-panel-raised) !important; border-color: var(--theme-border) !important; }
html[data-theme] body.portal.space-page .sidebar-logout:hover,
html[data-theme] body.portal.space-page .space-button:hover { background: var(--theme-panel-hover) !important; }
html[data-theme] body.portal.space-page .space-button.primary { color: var(--theme-bg) !important; background: var(--theme-text) !important; border-color: var(--theme-text) !important; }
html[data-theme] body.portal.space-page .space-button.primary:hover { opacity: .86; }
html[data-theme] body.portal.space-page .space-search { flex-direction: row; gap: 0; margin: 0; color: var(--theme-muted); background: var(--theme-panel); border-color: var(--theme-border); }
html[data-theme] body.portal.space-page .space-search input { color: var(--theme-text); background: transparent; }
html[data-theme] body.portal.space-page .space-search input::placeholder { color: var(--theme-muted); }
html[data-theme] body.portal.space-page .view-switch button { color: var(--theme-muted) !important; }
html[data-theme] body.portal.space-page .view-switch button.selected { color: var(--theme-text) !important; background: var(--theme-bg) !important; }
html[data-theme] body.portal.space-page .project-section-heading #project-count { color: var(--theme-muted); background: var(--theme-panel-raised); }
html[data-theme] body.portal.space-page .project-card { color: var(--theme-text); background: var(--theme-panel); }
html[data-theme] body.portal.space-page .project-cover,
html[data-theme] body.portal.space-page .project-cover.cover-1,
html[data-theme] body.portal.space-page .project-cover.cover-2,
html[data-theme] body.portal.space-page .project-cover.cover-3 { background: var(--theme-panel-raised); }
html[data-theme] body.portal.space-page .project-cover::before,
html[data-theme] body.portal.space-page .project-cover::after { border-color: var(--theme-border); background: var(--theme-cover-glass); }
html[data-theme] body.portal.space-page .cover-symbol { color: var(--theme-text); background: var(--theme-panel); border-color: var(--theme-border); }
html[data-theme] body.portal.space-page .project-page-badge { color: var(--theme-text); background: var(--theme-panel); }
html[data-theme] body.portal.space-page .api-settings-panel,
html[data-theme] body.portal.space-page .admin-panel { color: var(--theme-text); background: var(--theme-panel); }
html[data-theme] body.portal.space-page #key-form label,
html[data-theme] body.portal.space-page #policy-form label,
html[data-theme] body.portal.space-page .key-state { color: var(--theme-text); }
html[data-theme] body.portal.space-page #key-form input,
html[data-theme] body.portal.space-page #policy-form input,
html[data-theme] body.portal.space-page #policy-form select,
html[data-theme] body.portal.space-page .admin-panel input,
html[data-theme] body.portal.space-page .admin-panel button { color: var(--theme-text); background: var(--theme-panel-raised); border-color: var(--theme-border); }
html[data-theme] body.portal.space-page .admin-panel .row { border-color: var(--theme-border); }
html[data-theme] body.portal.space-page > main > #message { color: var(--theme-text); background: var(--theme-panel); border-color: var(--theme-border); }
html[data-theme] body.portal.space-page :focus-visible { outline-color: var(--theme-accent); }

.portal .space-nav .space-nav-theme { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; color: var(--theme-text); background: transparent; border: 0; border-radius: 9px; font-size: 15px; text-align: left; transition: background .15s ease; }
.portal .space-nav .space-nav-theme:hover { background: var(--theme-panel-raised); }
@media(max-width:640px) {
  .portal .space-nav .space-nav-theme { flex: 0 0 auto; min-height: 40px; gap: 7px; padding: 0 10px; font-size: 12px; }
}


/* Minimal email-only authentication pages inspired by the supplied reference. */
html[data-theme] body.portal.auth-page { min-height: 100vh; min-height: 100svh; color: var(--theme-text); background: var(--theme-bg); }
body.portal.auth-page > main { box-sizing: border-box; width: 100%; max-width: none; min-height: 100vh; min-height: 100svh; margin: 0; padding: clamp(48px, 10vh, 112px) 24px 48px; }
body.portal.auth-page > main > #portal-brand { position: relative; display: flex; justify-content: center; min-height: 36px; margin: 0; padding: 0; text-align: center; }
body.portal.auth-page > main > #portal-brand .logo,
body.portal.auth-page > main > #portal-brand p { display: none; }
body.portal.auth-page > main > #portal-brand > div:not(.portal-header-actions) { margin: 0; }
body.portal.auth-page > main > #portal-brand h1 { margin: 0; color: var(--theme-text); font-size: 27px; font-weight: 650; letter-spacing: -.035em; }
body.portal.auth-page .portal-header-actions { position: absolute; top: -5px; right: clamp(0px, 3vw, 32px); margin: 0; }
body.portal.auth-page .theme-open-button { min-height: 36px; padding: 7px 11px; color: var(--theme-muted); background: transparent; border: 1px solid var(--theme-border); border-radius: 8px; font-size: 13px; }
body.portal.auth-page > main > #message { box-sizing: border-box; width: min(456px, 100%); margin: 20px auto 0; padding: 0; text-align: center; }
body.portal.auth-page > main > #entry,
body.portal.auth-page > main > #reset-panel { box-sizing: border-box; width: min(456px, 100%); margin: clamp(124px, 20vh, 190px) auto 0; padding: 0; color: var(--theme-text); background: transparent; border: 0; border-radius: 0; }
body.portal.auth-page > main > #entry > h2,
body.portal.auth-page > main > #reset-panel > h2 { margin: 0; color: var(--theme-text); font-size: 28px; font-weight: 650; letter-spacing: -.025em; text-align: center; }
body.portal.auth-page .auth-subtitle { margin: 7px 0 26px; color: var(--theme-muted); font-size: 14px; text-align: center; }
body.portal.auth-page #login-form,
body.portal.auth-page #register-form,
body.portal.auth-page #verification-code-form,
body.portal.auth-page #reset-form { margin: 0; }
body.portal.auth-page #login-form label,
body.portal.auth-page #register-form label,
body.portal.auth-page #verification-code-form label,
body.portal.auth-page #reset-form label { display: grid; gap: 8px; margin: 17px 0; color: var(--theme-text); font-size: 14px; font-weight: 550; }
body.portal.auth-page #login-form input,
body.portal.auth-page #register-form input,
body.portal.auth-page #verification-code-form input,
body.portal.auth-page #reset-form input { box-sizing: border-box; width: 100%; min-height: 46px; padding: 11px 13px; color: var(--theme-text); background: var(--theme-bg); border: 1px solid var(--theme-border); border-radius: 8px; font-size: 15px; }
body.portal.auth-page #login-form input:focus,
body.portal.auth-page #register-form input:focus,
body.portal.auth-page #verification-code-form input:focus,
body.portal.auth-page #reset-form input:focus { outline: 2px solid color-mix(in srgb, var(--theme-accent) 35%, transparent); outline-offset: 1px; border-color: var(--theme-accent); }
body.portal.auth-page .password-input-row { gap: 8px; }
body.portal.auth-page .password-input-row .password-toggle { min-width: 66px; color: var(--theme-muted); background: var(--theme-panel); border-color: var(--theme-border); }
body.portal.auth-page .turnstile-widget { display: flex; justify-content: center; min-height: 66px; margin: 16px 0 18px; }
body.portal.auth-page .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
body.portal.auth-page .actions > button[type="submit"],
body.portal.auth-page #reset-form > button { grid-column: 1 / -1; width: 100%; min-height: 46px; color: var(--theme-bg); background: var(--theme-text); border: 1px solid var(--theme-text); border-radius: 8px; font-size: 15px; font-weight: 600; }
body.portal.auth-page .actions > button[type="submit"]:hover:not(:disabled),
body.portal.auth-page #reset-form > button:hover:not(:disabled) { opacity: .84; }
body.portal.auth-page .actions > #forgot,
body.portal.auth-page .actions > a.button,
body.portal.auth-page #verification-code-panel .actions > button:not([type="submit"]) { min-height: 42px; padding: 8px 10px; color: var(--theme-muted); background: transparent; border: 0; font-size: 13px; text-align: center; text-decoration: none; }
body.portal.auth-page #entry > p:not(.auth-subtitle) { margin: 25px 0 0; color: var(--theme-muted); font-size: 12px; line-height: 1.7; text-align: center; }
body.portal.auth-page #entry > p a { color: var(--theme-text); }
body.portal.auth-page #verification-code-panel { margin: 34px 0 0; padding: 25px 0 0; background: transparent; border: 0; border-top: 1px solid var(--theme-border); border-radius: 0; }
body.portal.auth-page #verification-code-panel h3 { margin: 0 0 8px; color: var(--theme-text); font-size: 20px; text-align: center; }
body.portal.auth-page #verification-code-panel > p { color: var(--theme-muted); font-size: 13px; text-align: center; }
body.portal.auth-page #verification-code-panel .actions > button[type="submit"] { grid-column: 1 / -1; }
body.portal.auth-page #verification-code-panel > #login-after-verification { display: block; margin-top: 12px; color: var(--theme-text); text-align: center; }
body.portal.auth-page > main > #reset-panel { margin-top: clamp(124px, 20vh, 190px); }
body.portal.auth-page :focus-visible { outline-color: var(--theme-accent); }
:root[data-theme="light"] body.portal.auth-page .actions > button[type="submit"],
:root[data-theme="light"] body.portal.auth-page #reset-form > button { color: #fff; background: #000; border-color: #000; }
:root[data-theme="dark"] body.portal.auth-page .actions > button[type="submit"],
:root[data-theme="dark"] body.portal.auth-page #reset-form > button { color: #000; background: #fff; border-color: #fff; }
@media(max-width: 600px) {
  body.portal.auth-page > main { padding: 48px 22px 32px; }
  body.portal.auth-page > main > #portal-brand h1 { font-size: 24px; }
  body.portal.auth-page .portal-header-actions { top: 52px; right: 0; }
  body.portal.auth-page .theme-open-button { min-height: 32px; padding: 5px 9px; font-size: 12px; }
  body.portal.auth-page > main > #entry,
  body.portal.auth-page > main > #reset-panel { margin-top: clamp(112px, 18vh, 160px); }
  body.portal.auth-page .actions { gap: 7px; }
}

/* Credit voucher wallet in the private image space. */
html[data-theme] body.portal.space-page .credits-panel { max-width: 1480px; color: var(--theme-text); background: var(--theme-panel); border-color: var(--theme-border); }
body.portal.space-page .credits-panel > .panel-heading { margin-bottom: 18px; }
body.portal.space-page .credit-balance-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 18px 0 22px; padding: 18px 20px; color: var(--theme-text); background: var(--theme-panel-raised); border: 1px solid var(--theme-border); border-radius: 10px; }
body.portal.space-page .credit-balance-card span { color: var(--theme-muted); font-size: 14px; }
body.portal.space-page .credit-balance-card strong { color: var(--theme-text); font-size: clamp(24px, 3vw, 32px); font-variant-numeric: tabular-nums; }
body.portal.space-page #redeem-credit-form { max-width: 720px; }
body.portal.space-page .credit-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
body.portal.space-page #redeem-credit-form label { display: grid; gap: 7px; margin: 0 0 14px; color: var(--theme-text); font-size: 13px; }
body.portal.space-page #redeem-credit-form input { box-sizing: border-box; width: 100%; min-height: 42px; color: var(--theme-text); background: var(--theme-bg); border: 1px solid var(--theme-border); border-radius: 8px; font: inherit; }
body.portal.space-page #redeem-credit-form input::placeholder { color: var(--theme-muted); }
body.portal.space-page #redeem-credit-form input:focus-visible { outline: 2px solid var(--theme-accent); outline-offset: 1px; }
body.portal.space-page #redeem-credit-form > button { min-width: 150px; }
body.portal.space-page .credits-panel .credit-history-title { margin: 28px 0 10px; color: var(--theme-text); font-size: 16px; }
body.portal.space-page .credit-vouchers { display: grid; gap: 8px; }
body.portal.space-page .credit-voucher-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 4px 14px; padding: 13px 14px; color: var(--theme-text); background: var(--theme-bg); border: 1px solid var(--theme-border); border-radius: 8px; }
body.portal.space-page .credit-voucher-code { overflow-wrap: anywhere; color: var(--theme-text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
body.portal.space-page .credit-voucher-amount { color: var(--theme-text); font-size: 14px; font-variant-numeric: tabular-nums; }
body.portal.space-page .credit-voucher-date,
body.portal.space-page .credit-empty { grid-column: 1 / -1; margin: 0; color: var(--theme-muted); font-size: 12px; }
@media(max-width:640px) {
  body.portal.space-page .credit-balance-card { padding: 14px; }
  body.portal.space-page .credit-form-grid { grid-template-columns: 1fr; gap: 0; }
  body.portal.space-page #redeem-credit-form > button { width: 100%; }
  body.portal.space-page .credit-voucher-row { gap: 6px; padding: 11px; }
  body.portal.space-page .credit-voucher-code { font-size: 11px; }
}
