@font-face {
  font-family: 'Minecraft';
  src: url('/fonts/Minecraft-Regular.woff2') format('woff2');
  font-weight: normal; font-style: normal; font-display: block;
}
:root {
  --bg: #11140f;
  --card: rgba(14, 17, 12, 0.84);
  --line: rgba(255, 255, 255, 0.10);
  --text: #f1f4ec;
  --muted: #a3ad9b;
  --accent: #86d15c;
  --accent-ink: #0d1507;
  --danger: #e5685d;
  --warn: #e0b95c;
  --font-pixel: "Minecraft", ui-monospace, monospace;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 15% 0%, rgba(134, 209, 92, 0.07), transparent 60%),
    radial-gradient(900px 500px at 90% 100%, rgba(134, 209, 92, 0.05), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.page { max-width: 1120px; margin: 0 auto; padding: 26px 18px 70px; }
.hidden { display: none !important; }
a { color: var(--accent); }

/* шапка */
.top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-pixel); font-size: 24px; letter-spacing: .5px; color: var(--text); text-decoration: none; cursor: pointer; }
.brand:hover .brand__mark { background: #96dd6d; }
.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.brand__mark { width: 22px; height: 22px; background: var(--accent); box-shadow: inset -3px -3px 0 rgba(0,0,0,.35), inset 3px 3px 0 rgba(255,255,255,.15); }
.brand__sub { font-family: var(--font-ui); font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.top__right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.dot { width: 7px; height: 7px; background: #5d6457; box-shadow: 0 0 0 2px rgba(255,255,255,.06); }
.status[data-state="online"] .dot { background: var(--accent); box-shadow: 0 0 9px rgba(134,209,92,.75); }

/* кнопки */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 34px; padding: 8px 14px; font-family: var(--font-pixel); font-size: 13px; line-height: 1;
  color: var(--text); text-decoration: none; background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14); border-radius: 0;
  box-shadow: inset -2px -2px 0 rgba(0,0,0,.35), inset 2px 2px 0 rgba(255,255,255,.07);
  cursor: pointer; transition: background-color .15s ease;
}
.btn:hover { background: rgba(255,255,255,.13); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn--primary { color: var(--accent-ink); background: var(--accent); border-color: #4f8a33; }
.btn--primary:hover { background: #96dd6d; }
.btn--sm { min-height: 28px; padding: 5px 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: default; }

/* карточки */
.card { padding: 18px 20px 20px; margin-bottom: 16px; background: var(--card); border: 1px solid var(--line); }
.card__title { font-family: var(--font-pixel); font-size: 16px; margin: 0 0 4px; letter-spacing: .3px; }
.card__hint { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpi {
  appearance: none; text-align: left; font-family: inherit; color: inherit; cursor: pointer;
  padding: 14px 16px; background: rgba(255,255,255,.03); border: 1px solid var(--line);
  transition: background-color .15s ease, border-color .15s ease;
}
.kpi:hover { background: rgba(255,255,255,.07); border-color: rgba(134,209,92,.35); }
.kpi:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
tr.is-focus td { background: rgba(134,209,92,.10); }
.kpi__value { display: block; font-family: var(--font-pixel); font-size: 22px; line-height: 1.1; }
.kpi__label { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }

/* табы */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  padding: 8px 14px; font-family: var(--font-pixel); font-size: 13px; color: var(--muted);
  background: transparent; border: 1px solid transparent; cursor: pointer;
}
.tab[aria-selected="true"] { color: var(--text); background: rgba(255,255,255,.06); border-color: var(--line); }
.tab:hover { color: var(--text); }

/* таблицы */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tr:last-child td { border-bottom: none; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); }
.tag { display: inline-block; padding: 2px 7px; font-size: 11.5px; border: 1px solid var(--line); color: var(--muted); }
.tag--ok { color: var(--accent); border-color: rgba(134,209,92,.35); }
.tag--bad { color: var(--danger); border-color: rgba(229,104,93,.35); }
.tag--warn { color: var(--warn); border-color: rgba(224,185,92,.35); }

/* формы */
label.check { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
input[type="checkbox"] { accent-color: var(--accent); }
input[type="text"], input[type="number"], textarea {
  width: 100%; padding: 9px 11px; font-family: var(--font-ui); font-size: 13px;
  color: var(--text); background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 0;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, textarea:focus { outline: 1px solid var(--accent); }
.field { margin-bottom: 12px; }
.field__label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* вход */
.login { max-width: 420px; margin: 8vh auto 0; }
.login .card { padding: 24px; }
.notice { padding: 10px 12px; border: 1px solid var(--line); color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.notice--bad { color: var(--danger); border-color: rgba(229,104,93,.35); }
.notice--ok { color: var(--accent); border-color: rgba(134,209,92,.35); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; margin: 2px 5px 2px 0;
  font-size: 12px; line-height: 1.4; border: 1px solid var(--line); color: var(--muted);
  cursor: pointer; user-select: none; background: transparent; transition: background-color .12s ease, color .12s ease;
}
.chip:hover { background: rgba(255,255,255,.05); }
.chip[data-state="read"] { color: var(--text); border-color: rgba(134,209,92,.45); background: rgba(134,209,92,.08); }
.chip[data-state="act"] { color: var(--accent-ink); background: var(--accent); border-color: #4f8a33; }
.chip[data-state="act"]::after { content: "⚡"; font-size: 11px; }
.chip--toggle { border-style: dashed; }
.chip--toggle[data-state="on"] { color: var(--accent); border-color: rgba(134,209,92,.45); border-style: solid; }
.save-state { font-size: 12px; color: var(--muted); }
.save-state[data-state="saving"] { color: var(--warn); }
.save-state[data-state="ok"] { color: var(--accent); }
.proj { border-top: 1px solid var(--line); padding: 10px 0; }
.proj:first-child { border-top: none; }
.proj__head { display: flex; align-items: center; gap: 10px; }
.proj__head .check { margin: 0; color: var(--text); font-size: 13px; }
.proj__doc, .proj__mem {
  margin-top: 12px; padding: 14px 16px; background: rgba(0,0,0,.22); border: 1px solid var(--line);
  font-size: 13px; line-height: 1.65; overflow-wrap: anywhere;
}
.proj__doc h1, .proj__doc h2, .proj__doc h3 { font-family: var(--font-pixel); font-weight: normal; letter-spacing: .3px; margin: 16px 0 8px; line-height: 1.3; }
.proj__doc h1 { font-size: 19px; margin-top: 0; }
.proj__doc h2 { font-size: 16px; }
.proj__doc h3 { font-size: 14px; }
.proj__doc p { margin: 8px 0; }
.proj__doc ul, .proj__doc ol { margin: 8px 0; padding-left: 20px; }
.proj__doc li { margin: 3px 0; }
.proj__doc code { background: rgba(255,255,255,.06); padding: 1px 5px; color: var(--accent); }
.proj__doc pre { background: rgba(0,0,0,.4); border: 1px solid var(--line); padding: 12px; overflow-x: auto; }
.proj__doc pre code { background: none; padding: 0; color: var(--text); }
.proj__doc blockquote { margin: 10px 0; padding: 6px 12px; border-left: 2px solid rgba(134,209,92,.45); color: var(--muted); }
.proj__doc table { font-size: 12.5px; margin: 10px 0; }
.proj__doc a { color: var(--accent); }
.proj__doc hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.md-source { color: var(--muted); font-size: 11.5px; margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line); }
.health { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.health:last-child { border-bottom: none; }
.health__name { min-width: 150px; }
.confirm { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.confirm:last-child { border-bottom: none; }
.schedule { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 6px 0; }
.person { border-top: 1px solid var(--line); padding: 10px 0; }
.person:first-child { border-top: none; }
.person__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.person__body { margin-top: 12px; padding: 14px 16px; background: rgba(0,0,0,.22); border: 1px solid var(--line); }
.person__section { margin-bottom: 14px; }
.person__label { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.person__form { display: flex; gap: 8px; flex-wrap: wrap; }
.person__form select { min-width: 160px; padding: 8px 10px; color: var(--text); background: rgba(0,0,0,.25); border: 1px solid var(--line); }
.person__form input { flex: 1; min-width: 240px; }
.memory { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.memory:last-child { border-bottom: none; }
.memory__date { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.memory__text { flex: 1; }
.memory__del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 17px; line-height: 1; padding: 0 4px; }
.memory__del:hover { color: var(--danger); }
/* Наблюдателю показываем данные, но не кнопки правок. */
body[data-role="viewer"] #restartBot,
body[data-role="viewer"] #clearQueue,
body[data-role="viewer"] .person__form,
body[data-role="viewer"] .memory__del,
body[data-role="viewer"] .proj__head input,
body[data-role="viewer"] .chip,
body[data-role="viewer"] .report-times,
body[data-role="viewer"] .report-on { display: none; }

.toast { position: fixed; right: 18px; bottom: 18px; padding: 10px 14px; background: #1a1f16; border: 1px solid var(--line); font-size: 13px; opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }
