:root {
  --bg: #f6f3f7;
  --card: #ffffff;
  --ink: #23304a;       /* основной текст — тёмно-синий, не чёрный */
  --muted: #6b7591;
  --line: #e4dfe8;
  --accent: #ce1780;    /* фирменный малиновый ФБ */
  --accent-soft: #fbe6f2;
  --ok: #1f8f62;
  --ok-soft: #e3f4ec;
  --warn: #b7701a;
  --warn-soft: #fdf1df;
  --bad: #c3343d;
  --bad-soft: #fbe5e6;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.45 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--accent); }
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.net { font-size: 13px; color: var(--bad); background: var(--bad-soft); padding: 2px 8px; border-radius: 99px; }
main { max-width: 720px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 4px 0 14px; line-height: 1.25; }
h2 { font-size: 18px; margin: 22px 0 10px; }
h3 { font-size: 16px; margin: 14px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: var(--card); border-color: var(--bad); color: var(--bad); }
.btn.big { width: 100%; min-height: 58px; font-size: 18px; }
.btn.wide { width: 100%; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn.icon { min-width: 44px; padding: 0 10px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
label.f { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=date], textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-height: 48px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); margin-top: 1px; }

/* список встреч */
.mlist a.card { display: block; color: inherit; text-decoration: none; }
.mlist .t { font-weight: 600; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--line); color: var(--ink); white-space: nowrap; }
.pill.rec { background: var(--bad-soft); color: var(--bad); }
.pill.proc { background: var(--warn-soft); color: var(--warn); }
.pill.done { background: var(--ok-soft); color: var(--ok); }

/* выбор типа */
.kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kind { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 12px; text-align: center; color: var(--ink); text-decoration: none; font-weight: 600; min-height: 96px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.kind .e { font-size: 28px; }
.kind.off { opacity: .5; }
.kind.off small { color: var(--muted); font-weight: 400; }

/* запись */
.recbar { display: flex; align-items: center; gap: 12px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--bad); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.timer { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.level { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.level i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .1s; }
.banner { border-radius: var(--radius); padding: 14px; margin-bottom: 12px; font-weight: 600; }
.banner.bad { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.info { background: var(--accent-soft); color: var(--accent); }
.intro { border: 2px solid var(--accent); }
.intro .who { font-size: 20px; font-weight: 700; }
.person { display: flex; gap: 10px; align-items: flex-start; }
.person .n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.person .fio { font-weight: 600; word-break: break-word; }
.person .pos { color: var(--muted); font-size: 14px; }
.person .acts { display: flex; gap: 6px; flex: none; }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: rot .8s linear infinite; vertical-align: -3px; }
@keyframes rot { to { transform: rotate(360deg); } }
.bottom-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 calc(8px + env(safe-area-inset-bottom)); }

/* обработка */
.prog { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.prog i { display: block; height: 100%; background: var(--accent); transition: width .4s; }

/* протокол */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; -webkit-overflow-scrolling: touch; }
.tab { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab .star { color: #f2b705; }
.proto h2 { border-bottom: 2px solid var(--accent-soft); padding-bottom: 4px; }
.proto ul, .proto ol { padding-left: 20px; margin: 6px 0; }
.proto li { margin: 4px 0; }
.task { border-left: 4px solid var(--accent); padding: 10px 12px; background: var(--card); border-radius: 0 12px 12px 0; margin-bottom: 8px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.task .who { font-weight: 700; }
.task .due { font-size: 14px; font-weight: 600; color: var(--ok); }
.task .due.none { color: var(--warn); }
.task .q { font-size: 13px; color: var(--muted); font-style: italic; margin-top: 4px; }
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp th, .cmp td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.cmp td.num { text-align: right; font-variant-numeric: tabular-nums; }
details.tr summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.line { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.line b { font-weight: 600; }
.line.unk b { color: var(--warn); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.meta-grid { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 15px; }
.meta-grid dt { color: var(--muted); }
.meta-grid dd { margin: 0; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); background: var(--ink); color: #fff; padding: 12px 14px; border-radius: 12px; z-index: 20; font-size: 15px; max-width: 688px; margin: 0 auto; }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.print-only { display: none; }

/* шапка: Штат и меню */
.topnav { position: relative; display: flex; gap: 8px; align-items: center; margin-left: auto; }
.net + .topnav { margin-left: 8px; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(35, 48, 74, .15); min-width: 190px; padding: 6px; z-index: 10; }
.menu a { display: block; padding: 12px 14px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 600; }
.menu a:active, .menu a:hover { background: var(--accent-soft); }

/* представление: что услышано */
.intro .heard { font-size: 22px; font-weight: 700; line-height: 1.25; margin-top: 4px; }
.intro .said { color: var(--muted); font-style: italic; margin-top: 6px; }

/* лист выбора человека */
.sheet-bg { position: fixed; inset: 0; background: rgba(35, 48, 74, .45); z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-width: 720px; max-height: 88vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.plist { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow-y: auto; }
.pitem { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; cursor: pointer; }
.pitem span { color: var(--muted); font-size: 14px; }
.pitem:active { background: var(--accent-soft); }
.pnew summary { cursor: pointer; font-weight: 600; padding: 12px 0 4px; color: var(--accent); }

/* запись совещания */
.audio audio { width: 100%; }
button.tm { border: 0; background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 1px 6px; font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; margin-right: 6px; cursor: pointer; }

@media print {
  .top, .toolbar, .tabs, .no-print, .toast, .bottom-actions { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; font-size: 12pt; }
  main { max-width: none; padding: 0; }
  .card, .task { border-color: #ccc; break-inside: avoid; }
  details.tr { display: none; }
}
