/* One visual language, taken from the approved operation editor.
   Financial direction remains semantic; the accent is reserved for interaction.
   Three interface themes share the markup; html[data-theme] picks their colors. */
:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #000;
  --panel-raised: #111;
  --soft: #181818;
  --line: #515151;
  --muted: #858585;
  --icon: #777;
  --white: #fff;
  --text: var(--white);
  --accent: #399af6;
  --accent-hover: #66b5ff;
  --accent-soft: #101b28;
  --green: #4bd864;
  --red: #ff453a;
  --income-surface: #14231a;
  --expense-surface: #291917;
  --radius: 8px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* Shared by all themes. */
  --surface: #1c1c1e;
  --surface-raised: #2c2c2e;
  --hairline: #262626;
  --secondary: #8e8e93;
  --on-accent: #000;
  --key-digit: #2c2c30;
  --key-function: #46474e;
  /* Classic theme (default). */
  --op-key: #d9752b;
  --op-key-text: #fff;
  --radius-control: 10px;
  --radius-block: 0px;
  --block-gap: 0px;
  font-family: var(--font-body);
  font-synthesis: none;
}
html[data-theme="quick"] {
  --accent: #64d2ff;
  --accent-hover: #8fdfff;
  --accent-soft: #0d2430;
  --op-key: #0a84ff;
  --op-key-text: #fff;
  --radius-control: 12px;
  --radius-block: 14px;
  --block-gap: 12px;
}
html[data-theme="tiles"] {
  --accent: #a98bff;
  --accent-hover: #c2adff;
  --accent-soft: #1d1630;
  --op-key: #6e56cf;
  --op-key-text: #fff;
  --radius-control: 12px;
  --radius-block: 16px;
  --block-gap: 8px;
}
/* Windows keep their pre-redesign colors in every theme until their own stage is
   approved (decision of 03.11.2026). Stage 2 operation forms (#editor.op-v2) take
   the theme's colors. */
html[data-theme="quick"] dialog:not(.op-v2),
html[data-theme="tiles"] dialog:not(.op-v2) {
  --accent: #399af6;
  --accent-hover: #66b5ff;
  --accent-soft: #101b28;
}
body { font-family: var(--font-body); }
button, input, select, textarea { font-family: inherit; }

/* ---- «Ещё → Тема» ---- */
.theme-intro { margin: 4px 0 14px; font-size: 14px; line-height: 1.4; color: var(--secondary); }
.theme-choices { display: grid; gap: 12px; }
.theme-choice {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 132px;
  padding: 12px;
  border: 2px solid var(--surface);
  border-radius: 16px;
  background: var(--surface);
  color: var(--white);
  text-align: left;
}
.theme-choice[aria-checked="true"] { border-color: var(--accent); }
.theme-choice-copy { display: grid; gap: 6px; min-width: 0; }
.theme-choice-copy strong { font-size: 18px; }
.theme-choice-copy small { font-size: 13px; line-height: 1.35; color: #aeaeb2; }
.theme-choice-check {
  width: 28px;
  height: 28px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--on-accent);
}
.theme-choice[aria-checked="true"] .theme-choice-check { background: var(--accent); }
.theme-choice-check svg { width: 16px; height: 16px; stroke-width: 2.6; }
/* Miniature screens drawn in each theme's own colors, whatever theme is active. */
.theme-preview {
  position: relative;
  width: 82px;
  height: 108px;
  border: 1px solid #3a3a3c;
  border-radius: 12px;
  background: #000;
  overflow: hidden;
}
.theme-preview i {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 12px;
  border-radius: 3px;
  background: #1c1c1e;
}
.theme-preview i:nth-child(1) { top: 10px; }
.theme-preview i:nth-child(2) { top: 28px; }
.theme-preview i:nth-child(3) { top: 46px; }
.theme-preview b { position: absolute; left: 8px; right: 8px; bottom: 26px; height: 10px; border-radius: 3px; }
.theme-preview s { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 12px; border-radius: 3px; }
.theme-preview-classic i { border-radius: 0; background: linear-gradient(90deg, #48484a 60%, transparent 60%, transparent 76%, #c4302a 76%); }
.theme-preview-classic b { background: #399af6; }
.theme-preview-classic s { background: linear-gradient(90deg, #d9752b 25%, #2c2c30 25%); }
.theme-preview-quick i { border-radius: 6px; }
.theme-preview-quick b { background: #64d2ff; }
.theme-preview-quick s { background: linear-gradient(90deg, #0a84ff 25%, #2c2c30 25%); }
.theme-preview-tiles i { right: auto; width: 30px; height: 14px; border-radius: 5px; }
.theme-preview-tiles i:nth-child(2) { top: 10px; left: 44px; }
.theme-preview-tiles i:nth-child(3) { top: 28px; }
.theme-preview-tiles b { background: #a98bff; }
.theme-preview-tiles s { background: linear-gradient(90deg, #6e56cf 25%, #2c2c30 25%); }

.theme-preview-original i { border-radius: 0; background: linear-gradient(90deg, #48484a 55%, transparent 55%, transparent 74%, #d9302c 74%); }
.theme-preview-original i:nth-child(1) { height: 18px; background: linear-gradient(90deg, #fff 22%, transparent 22%); }
.theme-preview-original b { background: transparent; border: 1px solid #515151; }
.theme-preview-original s { background: linear-gradient(90deg, #d9752b 25%, #333744 25%); }
