/* ==========================================================================
   Mushroom Marking Lab: one calm design system for every screen.
   Dark is the default. Flat surfaces, thin borders, no glow.
   ========================================================================== */

/* one theme: dark, with the amber accent of the site */
:root {
  color-scheme: dark;
  --bg: #121212;
  --surface: #1b1b1b;
  --surface-2: #232323;
  --border: #353535;
  --text: #f3efe6;
  --muted: #a8a196;
  --accent: #e0a547;
  --accent-hover: #efb85c;
  --accent-soft: #3a2c14;
  --accent-ink: #1c1405;
  --ok: #8cc58a;
  --ok-soft: #1f2e1d;
  --ok-ink: #10200f;
  --warn: #ef8a4a;
  --warn-soft: #3a2415;
  --bad: #e47b74;
  --bad-soft: #3a1f1d;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: none;
  --shadow-pop: 0 14px 36px rgba(0, 0, 0, .55);
  --ease: cubic-bezier(.3, .7, .4, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 13.5px/1.45 "Segoe UI", Inter, system-ui, -apple-system, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
/* keep keyboard focus visible under sticky bars */
:focus-visible { scroll-margin: 80px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.25; }
a { color: var(--accent); }
img { display: block; max-width: 100%; }
::selection { background: var(--accent-soft); color: var(--text); }

/* ---------- buttons ---------- */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 500; white-space: nowrap; text-decoration: none;
  cursor: pointer; user-select: none;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .1s var(--ease);
}
.btn:hover, button:hover { background: var(--surface-2); border-color: var(--accent); }
.btn:active, button:active { transform: scale(.97); }
.btn:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn:disabled, button:disabled { opacity: .45; cursor: default; transform: none; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { min-height: 42px; padding: 0 16px; font-size: 14px; font-weight: 600; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }

/* decision buttons: colour carries the meaning, without glow */
.btn-accept { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-accept:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-reject { color: var(--bad); }
.btn-reject:hover { border-color: var(--bad); }
.btn-unsure { color: var(--warn); }
.btn-unsure:hover { border-color: var(--warn); }

/* a chosen tool or option: filled with the accent, no glow, no size change */
.is-on, .btn.on, button.on {
  background: var(--accent) !important; border-color: var(--accent) !important; color: var(--accent-ink) !important;
}

/* ---------- form fields ---------- */
select, input[type=text], input:not([type]) {
  min-height: 34px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit;
  transition: border-color .15s var(--ease);
}
select:hover, input:hover { border-color: var(--accent); }
select:focus, input:focus { outline: none; border-color: var(--accent); }
input[type=range] { accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }

/* ---------- segmented control: EN | RU ---------- */
.seg {
  display: inline-flex; padding: 2px; gap: 2px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2);
}
.seg button {
  min-height: 26px; padding: 0 10px; border: none; border-radius: 999px; background: transparent;
  color: var(--muted); font-size: 12px; font-weight: 600;
}
.seg button:hover { background: transparent; color: var(--text); border: none; }
.seg button.is-on, .seg button.on { background: var(--surface) !important; color: var(--text) !important; box-shadow: var(--shadow); }

/* ---------- surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px;
}
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.empty { padding: 26px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }

/* badges: status in words and a dot */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--muted); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--bad { background: var(--bad-soft); color: var(--bad); }

/* chips: filters */
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); text-decoration: none; font-weight: 500; }
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* progress */
.progress { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .35s var(--ease); }

/* ---------- motion: short and quiet ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .25s var(--ease); }
.btn.is-saved { background: var(--ok) !important; border-color: var(--ok) !important; color: #fff !important; }

/* ---------- popover: opens next to an outline ---------- */
.popover { position: fixed; z-index: 60; min-width: 230px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); animation: rise .15s var(--ease); }
.popover__head { padding: 7px 10px 5px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.popover__item { display: flex; width: 100%; min-height: 36px; justify-content: flex-start; padding: 0 10px; border: none; border-radius: 8px; background: transparent; font-weight: 500; }
.popover__item:hover { background: var(--surface-2); border: none; color: var(--accent); }
.popover__item:active { transform: none; background: var(--accent-soft); }
.popover__item--danger { color: var(--bad); }
.popover__item--danger:hover { background: var(--bad-soft); color: var(--bad); }
.popover__sep { height: 1px; margin: 5px 4px; background: var(--border); }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; background: rgba(8, 12, 11, .5); }
.modal { width: min(540px, calc(100vw - 32px)); max-height: 88vh; overflow: auto; padding: 22px 24px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-pop); line-height: 1.6; }
.modal h2 { font-size: 17px; margin-bottom: 10px; }
.modal ol { padding-left: 20px; margin: 0; }
.modal li { margin-bottom: 6px; }
.modal__foot { display: flex; justify-content: flex-end; margin-top: 14px; }

/* ---------- where the language and theme controls sit: in the top bar ---------- */
.lab-slot { display: inline-flex; align-items: center; gap: 6px; }

* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
