/* Встречи и ответственность RACI — стиль АС: Tahoma, зелёный #3F8D49 / #CFE6CF */
:root {
  --g: #3F8D49; --g-d: #2f6e38; --g-l: #CFE6CF; --g-xl: #EEF6EE;
  --ink: #1f2a22; --mut: #5d6b60; --line: #d6e3d7; --bg: #f6f9f6;
  --warn: #8a5a00; --warn-bg: #fff4dc; --bad: #9b1c1c; --bad-bg: #fde8e8; --info-bg: #e9f1fb;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 Tahoma, Verdana, sans-serif; color: var(--ink); background: var(--bg);
  overflow-wrap: anywhere; }
a { color: var(--g-d); }
h1 { font-size: 21px; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 0 0 6px; }
p { margin: 6px 0; }
.wrap { max-width: 780px; margin: 0 auto; padding: 12px 12px 120px; }

/* шапка */
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top)); background: #fff; border-bottom: 3px solid var(--g); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: bold; min-width: 0; }
.brand img { height: 30px; width: auto; }
.brand span { font-size: 15px; }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mut); }
.who form { margin: 0; }
.tabs { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--line); }
.tab { padding: 7px 12px; border-radius: 18px; background: var(--g-l); color: var(--g-d); text-decoration: none;
  white-space: nowrap; font-size: 14px; }
.tab.on { background: var(--g); color: #fff; }

/* карточки */
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0 0 12px; }
.card.center { max-width: 420px; margin: 40px auto; text-align: center; }
.role { color: var(--mut); font-size: 14px; margin: 0 0 6px; }
.muted { color: var(--mut); }
.small { font-size: 13px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.person, .rec { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 10px;
  background: var(--g-xl); border: 1px solid var(--g-l); color: var(--ink); text-decoration: none; }
.p-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.p-line { font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ev { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.diff { margin: 6px 0 0; font-size: 14px; }
.diff .was { color: var(--mut); white-space: pre-wrap; }
.diff .now { white-space: pre-wrap; }
details summary { cursor: pointer; color: var(--g-d); font-size: 14px; }

/* состояния */
.st { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 13px; }
.st-draft { background: #eef0ee; color: #4a544c; }
.st-ready { background: var(--g-l); color: var(--g-d); }
.st-discussed { background: var(--g); color: #fff; }
.st-changed { background: var(--warn-bg); color: var(--warn); }
.st-none { background: #eef0ee; color: var(--mut); }
.st-unknown { background: var(--bad-bg); color: var(--bad); }
.msg { padding: 8px 10px; border-radius: 8px; font-size: 14px; }
.msg.warn { background: var(--warn-bg); color: var(--warn); }
.msg.bad { background: var(--bad-bg); color: var(--bad); }
.msg.info { background: var(--info-bg); color: #1d3f6b; }

/* кнопки: нажимаемое — светло-зелёная плашка */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px;
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--g); background: var(--g-l); color: var(--g-d);
  font: inherit; font-size: 15px; text-decoration: none; cursor: pointer; text-align: center; }
.btn.primary { background: var(--g); color: #fff; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--mut); }
.btn.small { min-height: 34px; padding: 4px 10px; font-size: 14px; }
.btn.wide { width: 100%; margin-top: 10px; }
.btn[disabled] { opacity: .55; cursor: default; }
.link-btn { background: none; border: 0; color: var(--g-d); font: inherit; font-size: 14px; text-decoration: underline;
  cursor: pointer; padding: 4px; }
.chip { border: 1px solid var(--g); background: var(--g-l); color: var(--g-d); border-radius: 16px; padding: 6px 12px;
  font: inherit; font-size: 14px; cursor: pointer; }
.chip.on { background: var(--g); color: #fff; }
a.chip { text-decoration: none; }
.filters, .presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* мгновенный отклик и ожидание (>400 мс) */
.press { transition: transform .06s, filter .06s; -webkit-tap-highlight-color: transparent; }
.press.down { transform: scale(.97); filter: brightness(.93); }
.busy { position: relative; pointer-events: none; }
.busy::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite; margin-left: 6px; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .press, .busy::after { transition: none; animation-duration: 2s; } }

/* формы */
label { display: block; font-size: 14px; color: var(--mut); }
input[type=date] { font: inherit; font-size: 16px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); max-width: 100%; }
.field { margin: 0 0 14px; }
.lbl { display: block; font-size: 14px; color: var(--mut); margin-bottom: 4px; }
.two { display: flex; flex-wrap: wrap; gap: 10px; }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; color: var(--ink); font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--g); }
.range { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 6px 0 12px; }
.q .hint { color: var(--mut); font-size: 14px; margin: 0 0 8px; }
.qn { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--g); color: #fff; font-size: 13px; margin-right: 8px; vertical-align: 1px; }
textarea { width: 100%; font: inherit; font-size: 16px; padding: 10px; border: 1px solid var(--line); border-radius: 8px;
  resize: vertical; min-height: 84px; background: #fff; color: var(--ink); }
textarea:focus, input:focus { outline: 2px solid var(--g-l); border-color: var(--g); }
textarea[readonly] { background: var(--g-xl); }
.q.nocase-on textarea { min-height: 50px; }
.crumbs { margin-bottom: 6px; font-size: 14px; }

/* нижняя панель сохранения */
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: #fff; border-top: 1px solid var(--line);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center; justify-content: space-between; box-shadow: 0 -2px 10px rgba(0,0,0,.05); }
.sb-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.sstate { font-size: 14px; color: var(--mut); }
.sstate.dirty { color: var(--warn); }
.sstate.bad { color: var(--bad); }
.sstate.ok { color: var(--g-d); }
@media (min-width: 820px) {
  .savebar { left: 50%; transform: translateX(-50%); max-width: 780px; border: 1px solid var(--line);
    border-radius: 12px 12px 0 0; }
}
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 90px; background: var(--ink); color: #fff;
  padding: 8px 14px; border-radius: 8px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none;
  max-width: 90vw; z-index: 9; }
.toast.on { opacity: 1; }
@media (max-width: 420px) {
  .brand span { font-size: 13px; }
  .who-name { display: none; }
  .savebar .btn { min-height: 40px; padding: 6px 10px; font-size: 14px; }
}

/* договорённости */
.agr-list { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; }
.agr { border: 1px solid var(--line); border-left: 4px solid var(--g); border-radius: 10px; padding: 10px 12px; background: #fff; }
.agr.st-done { border-left-color: #9cc7a2; background: #fafdfa; }
.agr.st-cancelled { border-left-color: #c9cfca; background: #fafafa; }
.agr.od { border-left-color: var(--bad); }
.agr-what { font-weight: bold; white-space: pre-wrap; }
.agr-line { font-size: 14px; margin-top: 4px; }
.agr-row { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.agr-line i { color: var(--mut); font-style: normal; }
.agr-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.st-a-todo { background: #eef0ee; color: #4a544c; }
.st-a-doing { background: var(--info-bg); color: #1d3f6b; }
.st-a-done { background: var(--g-l); color: var(--g-d); }
.st-a-cancelled { background: #eee; color: #777; }
.bad-t { color: var(--bad); }
.ok-t { color: var(--g-d); }
.warn-t { color: var(--warn); }
.from-rec { margin: -4px 0 6px 6px; }
h2.sec { margin: 18px 0 8px; }

/* нижнее окно формы */
.sheet-ov { position: fixed; inset: 0; background: rgba(20, 30, 22, .35); z-index: 20; display: flex; align-items: flex-end;
  justify-content: center; }
.sheet { background: #fff; width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; border-radius: 14px 14px 0 0;
  padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
@media (min-width: 700px) { .sheet-ov { align-items: center; } .sheet { border-radius: 14px; } }
body.noscroll { overflow: hidden; }
.f { display: block; margin: 10px 0; }
.f > span { display: block; font-size: 14px; color: var(--mut); margin-bottom: 4px; }
.f small { display: block; margin-top: 2px; }
select, input[type=text] { width: 100%; font: inherit; font-size: 16px; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink); }
.helpers { display: flex; flex-wrap: wrap; gap: 0 14px; margin-bottom: 6px; }
.helpers .check { margin: 4px 0; font-size: 15px; }
