/* CrossPoint Tools: tokens and controls every tool shares (cp.tlzz.de). Each tool adds its own
   layout in its own stylesheet. */
:root {
  --bg: #efeee9; --side: #f8f7f4; --card: #ffffff; --ink: #1f1e1b; --muted: #67655e; --faint: #9a978e;
  --line: #e2dfd7; --line2: #d3cfc4; --hover: #f1efe9;
  --accent: #2c5d8c; --accent-ink: #fff; --accent-soft: #e6eef6; --accent-line: #b9cde2;
  --warn: #a8670f; --warn-soft: #fbf0dc; --bad: #b0432f; --good: #2e7d4f;
  --mark: #ff6a1f;
  --device: #2b2a27; --device-edge: #3a3935;
  --radius: 10px; --shadow: 0 1px 2px rgba(30, 28, 22, .06), 0 4px 16px rgba(30, 28, 22, .06);
  --pop-shadow: 0 10px 40px rgba(20, 18, 14, .18), 0 2px 6px rgba(20, 18, 14, .08);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #161615; --side: #1d1d1b; --card: #252422; --ink: #ecebe5; --muted: #a5a39b; --faint: #75736c;
    --line: #33322f; --line2: #43423e; --hover: #2b2a27;
    --accent: #8db8e0; --accent-ink: #10202f; --accent-soft: #233140; --accent-line: #3d5670;
    --warn: #e3b061; --warn-soft: #3a2f1c; --bad: #e08a76; --good: #7cc79a;
    --device: #0d0d0c; --device-edge: #2a2927;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --pop-shadow: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 13.5px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line2); background: var(--card); border-radius: 8px; padding: 5px 11px; line-height: 1.3; }
button:hover { border-color: var(--faint); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; padding: 6px 16px; }
button.primary:hover { filter: brightness(1.08); }
button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
button.ghost:hover { background: var(--hover); color: var(--ink); }
button.link { border: 0; background: none; padding: 0; color: var(--accent); }
button.link:hover { text-decoration: underline; }
button.icon { width: 32px; height: 32px; padding: 0; display: inline-grid; place-items: center; border-color: transparent; background: transparent; color: var(--muted); }
button.icon:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
button.toggle { border-color: var(--line2); color: var(--muted); }
button.toggle.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
button.toggle svg { width: 16px; height: 16px; vertical-align: -3px; }
select, input[type=number], input[type=text] { background: var(--card); border: 1px solid var(--line2); border-radius: 8px; padding: 4px 8px; }
input[type=range] { accent-color: var(--accent); }
.hidden { display: none !important; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12px; }
header.top { display: flex; align-items: center; gap: 14px; padding: 8px 16px; background: var(--side); border-bottom: 1px solid var(--line); min-height: 54px; }
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 15px; white-space: nowrap; }
.brand small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.brand .mark { width: 28px; height: 28px; border-radius: 7px; background: var(--device); color: #f1efe8; display: grid; place-items: center; font: 700 13px/1 system-ui, -apple-system, sans-serif; letter-spacing: -.03em; }
.iconbar { display: flex; gap: 2px; }
/* segmented controls */
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line2); border-radius: 8px; padding: 2px; gap: 2px; background: var(--card); }
.seg button { border: 0; border-radius: 6px; padding: 3px 9px; font-size: 12.5px; background: transparent; color: var(--muted); }
.seg button:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.seg button:disabled { opacity: .4; }
.pop { position: fixed; z-index: 40; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--pop-shadow); padding: 12px 14px; max-height: calc(100vh - 80px); overflow: auto; }
.pop h4 { margin: 4px 0 8px; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.pop .hint { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.menu { display: grid; gap: 1px; min-width: 210px; }
.menu button { text-align: left; border: 0; background: transparent; padding: 6px 10px; border-radius: 6px; display: flex; gap: 10px; }
.menu button:hover { background: var(--hover); }
.menu button small { margin-left: auto; color: var(--faint); }
textarea { width: 100%; min-height: 160px; font: 12.5px/1.45 var(--mono); background: var(--card); border: 1px solid var(--line2); border-radius: 8px; padding: 8px; resize: vertical; }
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(20, 18, 14, .35); display: grid; place-items: center; padding: 20px; }
.dialog { background: var(--card); border-radius: 14px; box-shadow: var(--pop-shadow); width: min(620px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 20px 22px; }
.dialog h3 { margin: 0 0 4px; font-size: 18px; }
.dialog .lead { color: var(--muted); margin: 0 0 16px; }
.dialog .field { display: grid; gap: 4px; margin-bottom: 14px; }
.dialog .field > label { font-weight: 600; font-size: 12.5px; }
.dialog .field .hint { color: var(--muted); font-size: 12px; }
.dlg-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 8px 0 4px; }
.progress > div { height: 100%; background: var(--accent); transition: width .2s; }
.ok { color: var(--good); }
.err { color: var(--bad); }
.welcome { margin: 60px auto; max-width: 480px; text-align: center; color: var(--muted); display: grid; gap: 10px; }
.welcome b { color: var(--ink); font-size: 16px; }
.kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line2); border-radius: 4px; padding: 0 4px; color: var(--muted); }
