/* Токени і база. Графіт + одна сигнальна лампа (accent) + три кольори рішень. */
:root {
  --bg: #18191b;
  --bg-deep: #0f1011;
  --panel: #202124;
  --raise: #292a2e;
  --raise-2: #33353a;
  --line: #36383d;
  --line-soft: #2a2c30;
  --text: #ecebe7;
  --text-2: #b0aea8;
  --text-3: #85837d;

  --accent: #ff9a3d;          /* лампа запису / маркер монтажера */
  --accent-ink: #1e1206;
  --accent-soft: rgba(255, 154, 61, .14);

  --ok: #4cc38a;
  --ok-soft: rgba(76, 195, 138, .16);
  --reject: #f0575d;
  --reject-soft: rgba(240, 87, 93, .16);
  --recut: #ecd05a;
  --recut-soft: rgba(236, 208, 90, .16);

  --font: "Geologica", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 15px;
  --fs-lg: 18px;
  --fs-xl: 22px;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;

  --top-h: 52px;
  --act-h: 60px;
  --tab-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  --t-fast: 120ms;
  --t-mid: 200ms;
  --t-slow: 280ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.3, 1.4, .5, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-md)/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.num, .time, .badge, .count, kbd { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.noscript { padding: 24px; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

svg.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }

.lamp { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none;
  box-shadow: 0 0 0 3px var(--accent-soft); }

kbd {
  display: inline-block; min-width: 20px; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line);
  border-bottom-width: 2px; background: var(--raise); color: var(--text-2); font: 500 11px/16px var(--font);
  text-align: center;
}

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: var(--r-md); border: 1px solid var(--line); background: var(--raise); color: var(--text);
  font-weight: 500; font-size: var(--fs-md); white-space: nowrap; text-decoration: none;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), color var(--t-fast);
}
.btn:hover { background: var(--raise-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-accent:hover { background: #ffad63; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--raise); color: var(--text); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: var(--fs-sm); }
.btn-lg { min-height: 48px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-danger { color: var(--reject); }
.btn-danger:hover { background: var(--reject-soft); }
.link-sm { font-size: var(--fs-sm); color: var(--text-2); text-decoration: none; padding: 6px 2px; }
.link-sm:hover { color: var(--accent); }

/* Поля */
.field { display: grid; gap: 6px; }
.field-label { font-size: var(--fs-sm); color: var(--text-2); }
input[type=text], input[type=password], input[type=url], textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--bg-deep); color: var(--text); transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input[type=text]:focus, input[type=password]:focus, input[type=url]:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-error { color: var(--reject); font-size: var(--fs-sm); }

.badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; line-height: 1;
}

/* Завантаження застосунку */
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.boot-lamp { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* Скелетон */
.skel { background: linear-gradient(90deg, var(--panel) 0, var(--raise) 50%, var(--panel) 100%);
  background-size: 200% 100%; animation: skel 1.2s linear infinite; border-radius: var(--r-sm); }
@keyframes skel { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important;
    transition-duration: 1ms !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; }
