/* Shared by every Lotse window: tokens, base elements, title bar, buttons.
   The design system behind these values is documented in DESIGN.md. */

:root {
  --bg: #0e1116;
  --surface: #161b22;
  --surface-2: #1d232c;
  --line: #2a313c;
  --text: #e6e9ee;
  --muted: #9aa4b2;
  --faint: #838d9c; /* ≥ 4.5:1 on --surface for help text and placeholders */
  --accent: #3ecfb2;
  --accent-ink: #062520;
  --accent-lift: 14%; /* primary buttons lighten toward the top */
  --speak: #f0b35a;
  --danger: #f07a6a;
  --radius: 12px;
  /* Type scale: title 18 / body 14 / small 12.5 / micro 11.5 */
  --fs-title: 18px;
  --fs-body: 14px;
  --fs-small: 12.5px;
  --fs-micro: 11.5px;
  --font-title: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  /* Tactile controls: lit top edge, grounded bottom edge */
  --lift: inset 0 1px 0 rgb(255 255 255 / .06), 0 1px 0 rgb(0 0 0 / .45), 0 2px 4px -1px rgb(0 0 0 / .35);
  --press: inset 0 1px 3px rgb(0 0 0 / .45);
  --well: inset 0 1px 2px rgb(0 0 0 / .35);
  --titlebar: 36px;
  /* Surfaces that differ between the dark and the daylight theme */
  --phone-bg: #0b1016;
  --bubble: #19212b;
  --bubble-text: #dfe5ee;
  --field: #151b24;
  --panel: #121821;
  --sheet: #171d26;
  --card: #0f151d;
  --track: #141b24;
  --track-sel: #19212b;
  --ag-past: #333c48;
  /* HansePeak summit: navy lifted so it reads on Nachtwasser, traces in Gischt */
  --peak-navy: #3a6aa8;
  --peak-deep: #26508a;
  --peak-trace: #e6e9ee;
  color-scheme: dark;
}

/* Daylight theme (Tageslicht): for bright surroundings, e.g. outdoors. Follows
   the system unless chosen explicitly (theme.js sets data-theme). */
:root[data-theme="light"] {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --line: #d3d9e0;
  --text: #141a21;
  --muted: #4f5a67;
  --faint: #66717e; /* ≥ 4.5:1 on white */
  --accent: #0a7f6a; /* Seefeuer, darkened for text on white (≥ 4.5:1) */
  --accent-ink: #ffffff;
  --accent-lift: 0%; /* white text needs the full Seefeuer tone */
  --speak: #a45f00;
  --danger: #c0392b;
  --lift: inset 0 1px 0 rgb(255 255 255 / .9), 0 1px 0 rgb(0 0 0 / .08), 0 2px 4px -1px rgb(0 0 0 / .12);
  --press: inset 0 1px 3px rgb(0 0 0 / .14);
  --well: inset 0 1px 2px rgb(0 0 0 / .08);
  --phone-bg: #f2f4f7;
  --bubble: #e5e9ee;
  --bubble-text: #141a21;
  --field: #ffffff;
  --panel: #ffffff;
  --sheet: #ffffff;
  --card: #ffffff;
  --track: #eef1f4;
  --track-sel: #e2e7ec;
  --ag-past: #c9d0d8;
  --peak-navy: #1d406f; /* the logo's own navy on light ground */
  --peak-deep: #11305a;
  --peak-trace: #ffffff;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
  --bg: #f3f5f7;
    --surface: #ffffff;
    --surface-2: #eef1f4;
    --line: #d3d9e0;
    --text: #141a21;
    --muted: #4f5a67;
    --faint: #66717e; /* ≥ 4.5:1 on white */
    --accent: #0a7f6a; /* Seefeuer, darkened for text on white (≥ 4.5:1) */
    --accent-ink: #ffffff;
    --accent-lift: 0%;
    --speak: #a45f00;
    --danger: #c0392b;
    --lift: inset 0 1px 0 rgb(255 255 255 / .9), 0 1px 0 rgb(0 0 0 / .08), 0 2px 4px -1px rgb(0 0 0 / .12);
    --press: inset 0 1px 3px rgb(0 0 0 / .14);
    --well: inset 0 1px 2px rgb(0 0 0 / .08);
    --phone-bg: #f2f4f7;
    --bubble: #e5e9ee;
    --bubble-text: #141a21;
    --field: #ffffff;
    --panel: #ffffff;
    --sheet: #ffffff;
    --card: #ffffff;
    --track: #eef1f4;
    --track-sel: #e2e7ec;
    --ag-past: #c9d0d8;
    --peak-navy: #1d406f;
    --peak-deep: #11305a;
    --peak-trace: #ffffff;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Parts that only exist in the web app (back button, sign-out); web.css hides the desktop-only ones there. */
body:not(.web) .web-only { display: none !important; }
/* A PC paired with a Lotse server: KI access, plugins and app registrations live there. */
body.linked .local-only { display: none !important; }
/* Managed by an IT partner (Managed Workplace): technical fields are theirs. */
body.managed .expert { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
  user-select: none;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 32%, transparent); color: var(--text); }
input { caret-color: var(--accent); }
h2, h3 { font-family: var(--font-title); font-size: var(--fs-title); font-weight: 600; line-height: 1.25; letter-spacing: -.005em; }

/* ── Title bar (window controls are drawn by the OS on the right) ── */
.titlebar {
  -webkit-app-region: drag;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 148px 0 12px;
}
.no-drag, .titlebar button { -webkit-app-region: no-drag; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: .01em; }
/* HansePeak summit, flat at title-bar size */
.brand-mark { width: 24px; height: 15px; }
.pk-navy { fill: var(--peak-navy); }
.pk-deep { fill: var(--peak-deep); }
.pk-teal { fill: #34aabd; }
.pk-teal2 { fill: #1a8faa; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

/* ── Buttons ── */
.btn {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: linear-gradient(color-mix(in srgb, #fff 4%, var(--surface-2)), var(--surface-2));
  box-shadow: var(--lift);
  font-weight: 500;
}
.btn:active:not(:disabled) { box-shadow: var(--press); transform: translateY(1px); }
.btn:hover { border-color: var(--faint); }
.btn.primary {
  background: linear-gradient(color-mix(in srgb, #fff var(--accent-lift), var(--accent)), var(--accent));
  border-color: color-mix(in srgb, #000 18%, var(--accent));
  color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .28), 0 1px 0 rgb(0 0 0 / .45), 0 2px 4px -1px rgb(0 0 0 / .35);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 4px 10px; font-size: var(--fs-small); }
.btn:disabled { opacity: .5; cursor: default; }

kbd {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  font-family: inherit;
  font-size: var(--fs-micro);
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
