/* 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;
  --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;
  color-scheme: dark;
}

* { 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; }

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; }
.brand-mark { width: 18px; height: 18px; color: var(--accent); }

.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 14%, 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; }
}
