:root {
  --surface: #fff;
  --heading-font: Georgia, serif;
  --body-font: Arial, Helvetica, sans-serif;
  --card-radius: 0px;
  --button-radius: 0px;
  --heading-scale: 1;
}
body, button, input, select, textarea { font-family: var(--body-font); }
h1, h2, h3, .stat b, .counter strong, .client-row h3 { font-family: var(--heading-font); }
.page-head h1, .gallery-head h1 { font-size: calc(46px * var(--heading-scale)); }
.login-copy h1 { font-size: calc(58px * var(--heading-scale)); }
.panel, .stat, .client-row, .modal, .theme-preview-card { background: var(--surface); border-radius: var(--card-radius); }
button, .button-link, input, select, textarea { border-radius: var(--button-radius); }
.page-head-actions { display:flex; gap:9px; flex-wrap:wrap; justify-content:flex-end; }
.theme-editor-dialog { width:min(1180px,96vw); max-height:94vh; }
.theme-editor-dialog::backdrop { background:rgba(15,13,10,.82); }
.theme-editor-form { background:var(--paper); max-height:94vh; overflow:auto; border:1px solid var(--line); }
.theme-editor-toolbar { position:sticky; top:0; z-index:3; display:flex; justify-content:space-between; gap:20px; align-items:start; padding:24px 28px 18px; background:var(--surface); border-bottom:1px solid var(--line); }
.theme-editor-toolbar h2 { margin:4px 0; font-size:34px; }
.theme-editor-toolbar p { margin:4px 0; }
.theme-layout { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(310px,.75fr); gap:22px; padding:24px 28px; }
.theme-controls { display:grid; gap:16px; }
.theme-controls fieldset { border:1px solid var(--line); background:var(--surface); padding:18px; margin:0; border-radius:var(--card-radius); }
.theme-controls legend { padding:0 8px; font-weight:800; font-size:11px; letter-spacing:.12em; }
.theme-presets { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.theme-preset { min-height:48px; padding:8px; border:1px solid var(--line); background:var(--paper); font-size:10px; font-weight:800; }
.theme-preset:hover, .theme-preset:focus { border-color:var(--gold); }
.theme-color-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
.theme-color-field { display:grid; gap:7px; font-size:11px; font-weight:700; }
.theme-color-control { display:grid; grid-template-columns:46px 1fr; }
.theme-color-control input[type="color"] { width:46px; min-height:42px; padding:3px; border:1px solid var(--line); background:#fff; }
.theme-color-control .theme-hex { min-width:0; padding:10px; border:1px solid var(--line); border-left:0; text-transform:uppercase; background:#fff; }
.theme-setting-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:0 14px; }
.theme-setting-grid input[type="range"] { padding:0; accent-color:var(--gold); }
.theme-setting-grid output { float:right; color:var(--gold); }
.theme-preview-wrap { position:sticky; top:120px; align-self:start; min-width:0; }
.theme-preview-actions { display:flex; gap:7px; align-items:center; margin-bottom:10px; }
.theme-preview-actions b { margin-right:auto; }
.theme-preview-actions button { padding:7px 8px; }
.theme-preview-actions button.active { background:var(--ink); color:#fff; }
.theme-preview { margin:auto; width:100%; min-height:390px; border:1px solid var(--line); background:var(--paper); box-shadow:0 15px 45px rgba(0,0,0,.11); transition:width .25s ease; overflow:hidden; border-radius:var(--card-radius); }
.theme-preview.mobile { width:310px; }
.theme-preview-top { height:58px; padding:0 18px; display:flex; align-items:center; justify-content:space-between; background:var(--ink); color:#fff; font-size:10px; letter-spacing:.11em; }
.theme-preview-top span { font-weight:300; }
.theme-preview-top i { display:grid; place-items:center; width:30px; height:30px; border-radius:50%; background:var(--gold); font-style:normal; }
.theme-preview-body { padding:28px; }
.theme-preview-body h3 { margin:7px 0; font-size:calc(32px * var(--heading-scale)); font-weight:500; }
.theme-preview-body>p:not(.eyebrow) { color:var(--muted); font-size:12px; line-height:1.5; }
.theme-preview-card { display:grid; gap:10px; margin-top:28px; padding:18px; border:1px solid var(--line); }
.theme-preview-card small { color:var(--muted); }
.theme-preview-card button { justify-self:start; }
.theme-contrast { display:grid; gap:6px; margin-top:12px; }
.theme-contrast p { margin:0; padding:9px 11px; font-size:11px; }
.theme-contrast .ok { background:#deeedf; color:#285636; }
.theme-contrast .warning { background:#fff0d2; color:#6c4d10; }
.theme-history { margin:0 28px 24px; padding:20px; background:var(--surface); border:1px solid var(--line); }
.theme-history h3 { margin:0; font-size:22px; }
#themeHistoryList { display:grid; gap:8px; margin-top:14px; }
.theme-history-row { display:grid; grid-template-columns:1fr auto; gap:12px; align-items:center; padding:10px 0; border-top:1px solid var(--line); }
.theme-history-row p { margin:2px 0; font-size:11px; color:var(--muted); }
.theme-editor-footer { position:sticky; bottom:0; z-index:3; display:grid; grid-template-columns:auto 1fr auto auto; gap:10px; padding:16px 28px; border-top:1px solid var(--line); background:var(--surface); }
@media(max-width:850px) {
  .theme-layout { grid-template-columns:1fr; padding:18px; }
  .theme-preview-wrap { position:static; }
  .theme-presets { grid-template-columns:repeat(2,1fr); }
  .theme-history { margin:0 18px 18px; }
  .theme-editor-footer { grid-template-columns:1fr 1fr; padding:14px 18px; }
  .theme-editor-footer span { display:none; }
}
@media(max-width:520px) {
  .page-head-actions { width:100%; justify-content:flex-start; }
  .theme-editor-toolbar { padding:18px; }
  .theme-editor-toolbar h2 { font-size:28px; }
  .theme-color-grid, .theme-setting-grid { grid-template-columns:1fr; }
  .theme-preview-actions button { font-size:8px; }
}
