/* Кабан доска — японская палитра: бумага васи, тушь сумi, киноварь сю. */
:root {
  --bg: #f4efe4;          /* васи */
  --panel: #ebe3d3;
  --card: #fbf8f1;
  --text: #24211c;        /* сумi */
  --muted: #7a7165;
  --line: #d9ccb4;
  --accent: #c8402d;      /* сю — киноварь */
  --accent-text: #fbf8f1;
  --accent-deep: #94291b;
  --danger: #b3261e;
  --danger-bg: #f6ddd6;
  --warn-bg: #f3e6c4;
  --chip: #efe7d7;
  --dir-clients: #5b7a3a; /* маття */
  --dir-product: #2e4a7d; /* ай — индиго */
  --dir-agency: #a8701a;  /* кинтя — охра */
  --shadow: 0 1px 2px rgba(60, 40, 20, .08);
  --serif: Georgia, "Times New Roman", serif;
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20'%3E%3Cg fill='%23f4efe4' stroke='%23c8402d' stroke-opacity='.16'%3E%3Ccircle cx='0' cy='10' r='18'/%3E%3Ccircle cx='0' cy='10' r='13'/%3E%3Ccircle cx='0' cy='10' r='8'/%3E%3Ccircle cx='40' cy='10' r='18'/%3E%3Ccircle cx='40' cy='10' r='13'/%3E%3Ccircle cx='40' cy='10' r='8'/%3E%3Ccircle cx='20' cy='20' r='18'/%3E%3Ccircle cx='20' cy='20' r='13'/%3E%3Ccircle cx='20' cy='20' r='8'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181c;        /* ночная тушь */
    --panel: #202227;
    --card: #2a2c32;
    --text: #ece5d8;
    --muted: #a39a8c;
    --line: #3a3c43;
    --accent: #e0604a;
    --accent-text: #17181c;
    --accent-deep: #a8402f;
    --danger: #f08070;
    --danger-bg: #3d2522;
    --warn-bg: #3a321f;
    --chip: #33353c;
    --dir-clients: #9cbf74;
    --dir-product: #8fa9e0;
    --dir-agency: #e0a64a;
    --shadow: none;
    --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20'%3E%3Cg fill='%2317181c' stroke='%23e0604a' stroke-opacity='.14'%3E%3Ccircle cx='0' cy='10' r='18'/%3E%3Ccircle cx='0' cy='10' r='13'/%3E%3Ccircle cx='0' cy='10' r='8'/%3E%3Ccircle cx='40' cy='10' r='18'/%3E%3Ccircle cx='40' cy='10' r='13'/%3E%3Ccircle cx='40' cy='10' r='8'/%3E%3Ccircle cx='20' cy='20' r='18'/%3E%3Ccircle cx='20' cy='20' r='13'/%3E%3Ccircle cx='20' cy='20' r='8'/%3E%3C/g%3E%3C/svg%3E");
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- логотип ---------- */
.brand { display: flex; align-items: center; gap: 10px; margin: 0; }
.brand img { width: 40px; height: 40px; display: block; }
.brand span { font-family: var(--serif); font-size: 20px; font-weight: 700; letter-spacing: .02em; }

/* ---------- вход ---------- */
.login {
  min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: var(--wave) repeat;
}
.login-box {
  width: 100%; max-width: 340px; background: var(--card); padding: 26px 24px;
  border-radius: 16px; box-shadow: 0 6px 30px rgba(60, 40, 20, .15); display: grid; gap: 14px;
  border-top: 4px solid var(--accent);
}
.login-box .brand { justify-content: center; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.login-box .brand img { width: 72px; height: 72px; }
.login-box .brand span { font-size: 24px; }
.login-err { color: var(--danger); margin: 0; }

label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); font-size: 16px; /* 16px — iOS не увеличивает страницу при фокусе */
}
textarea { min-height: 64px; max-height: 60vh; resize: vertical; overflow-wrap: break-word; }
/* Раскрывающиеся поля (14.10.2026): высота по содержимому; без поддержки — то же делает fitTextarea() в app.js */
@supports (field-sizing: content) { textarea:not([readonly]) { field-sizing: content; } }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.btn {
  border: 1px solid var(--line); background: var(--card); padding: 8px 16px;
  border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .08s, box-shadow .15s;
}
.btn:hover { background: var(--panel); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .tabs button:focus-visible, .talk-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600;
  box-shadow: 0 2px 0 var(--accent-deep), 0 4px 10px rgba(200, 64, 45, .25);
}
.btn.primary:hover { background: var(--accent); filter: brightness(1.07); }
.btn.primary:active { box-shadow: 0 1px 0 var(--accent-deep); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 4px 10px; font-size: 13px; }

/* ---------- шапка ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--wave) repeat, var(--bg);
  padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  border-bottom: 2px solid var(--accent);
  padding-top: max(10px, env(safe-area-inset-top));
}
.top .brand { margin-right: 8px; }
.top .spacer { flex: 1; }
.top select { width: auto; padding: 6px 30px 6px 12px; font-size: 14px; background: var(--card); border-radius: 999px; }
.top .check {
  display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer;
}
.top .check input { width: auto; accent-color: var(--accent); }
.me { font-size: 13px; color: var(--muted); background: var(--card); padding: 3px 10px; border-radius: 999px; }

/* ---------- вкладки (телефон) ---------- */
.tabs { display: none; }

/* ---------- доска ---------- */
.board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr);
  gap: 12px; padding: 14px 16px 24px; overflow-x: auto; align-items: start;
}
.col { background: var(--panel); border-radius: 14px; padding: 8px; min-height: calc(100vh - 110px); }
.col.drop { outline: 2px dashed var(--accent); }
.col-head {
  display: flex; align-items: baseline; gap: 6px; padding: 4px 4px 8px 10px; margin-bottom: 2px;
  font-family: var(--serif); font-weight: 700; font-size: 16px; position: relative;
}
.col-head::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 11px; width: 4px;
  background: var(--accent); border-radius: 2px;
}
.col-head .count { color: var(--muted); font-weight: 400; font-size: 13px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
.col-head .wip { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
.col.over { background: var(--danger-bg); }
.col.over .wip { color: var(--danger); font-weight: 600; }
.col-cards { display: grid; gap: 8px; }
.day-group { display: grid; gap: 8px; }
.day-head { display: flex; align-items: center; gap: 6px; width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--chip); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.day-head:hover { border-color: var(--accent); }
.day-head .count { margin-left: auto; }
.day-arrow { width: 12px; color: var(--muted); }
.empty { color: var(--muted); font-size: 13px; padding: 4px 10px; font-style: italic; }

.card {
  background: var(--card); border-radius: 10px; padding: 10px 10px 10px 12px; box-shadow: var(--shadow);
  cursor: pointer; border: 1px solid transparent; border-left: 4px solid var(--line); display: grid; gap: 6px;
}
.card.d-clients { border-left-color: var(--dir-clients); }
.card.d-product { border-left-color: var(--dir-product); }
.card.d-agency { border-left-color: var(--dir-agency); }
.card:hover { border-top-color: var(--line); border-right-color: var(--line); border-bottom-color: var(--line); }
.card.dragging { opacity: .4; }
.card.archived { opacity: .6; }
.card-title { font-weight: 500; word-break: break-word; }
.card-no { color: var(--muted); font-weight: 400; font-size: 12px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; }
.chip { background: var(--chip); border-radius: 999px; padding: 1px 8px; color: var(--muted); }
.chip.dir-clients { color: var(--dir-clients); }
.chip.dir-product { color: var(--dir-product); }
.chip.dir-agency { color: var(--dir-agency); }
.chip.owner { color: var(--text); }
.chip.late { background: var(--danger-bg); color: var(--danger); font-weight: 600; }
.card-wait { font-size: 12px; background: var(--warn-bg); border-radius: 8px; padding: 4px 6px; }

/* ---------- окно карточки ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(30, 22, 15, .5); z-index: 20;
  display: flex; align-items: flex-start; justify-content: center; padding: 24px 16px; overflow-y: auto;
}
.modal {
  background: var(--card); width: 100%; max-width: 640px; border-radius: 16px; padding: 18px;
  display: grid; gap: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); border-top: 4px solid var(--accent);
}
.modal { position: relative; }
.modal-x {
  position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 22px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0 0 2px;
}
.modal-x:hover { color: var(--text); border-color: var(--muted); }
.modal h2 { padding-right: 44px; }
.grab { display: none; }
.modal h2 { margin: 0; font-size: 19px; font-family: var(--serif); }
.quick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; background: var(--panel); border-radius: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.size-box { display: grid; gap: 6px; padding: 10px 12px; background: var(--panel); border-radius: 12px; }
.size-prop { color: var(--danger); font-size: 13px; }
.size-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip.size { font-weight: 700; }
.members { display: flex; flex-wrap: wrap; gap: 10px; }
.members label { display: flex; align-items: center; gap: 6px; color: var(--text); font-size: 14px; }
.members input { width: auto; accent-color: var(--accent); }
.hint { font-size: 12px; color: var(--muted); }
.form-err { background: var(--danger-bg); color: var(--danger); padding: 8px 12px; border-radius: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions .spacer { flex: 1; }
.section-title { font-weight: 700; font-size: 15px; margin-top: 4px; font-family: var(--serif); }
.feed { display: grid; gap: 8px; font-size: 14px; }
.feed .item { border-left: 3px solid var(--line); padding-left: 8px; }
.feed .who { color: var(--muted); font-size: 12px; }
.feed .text { white-space: pre-wrap; word-break: break-word; }
.links a { color: var(--accent); word-break: break-all; }
.comment-row { display: flex; gap: 8px; align-items: flex-end; }
.comment-row textarea { min-height: 44px; }
/* файлы задачи (хранятся неделю) */
.files { display: grid; gap: 6px; font-size: 14px; }
.file { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; border-left: 3px solid var(--line); padding-left: 8px; }
.file-name { color: var(--accent); word-break: break-all; font-weight: 600; }
.file .hint { flex: 1 1 auto; }
.file-input { display: none; }

/* ---------- кабаны ---------- */
.empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 18px 8px 10px; }
.empty div { max-width: 200px; }
.col-head .wip { display: flex; align-items: center; gap: 4px; }
@keyframes shake { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.talk { position: relative; display: inline-flex; justify-content: center; }
.talk-btn { border: 0; background: none; padding: 0; cursor: pointer; line-height: 0; }
.talk-btn img { height: auto; transition: transform .2s; }
.talk-btn:hover img { transform: rotate(-6deg) scale(1.06); }
.talk-btn.mascot img { width: 46px; }
.talk-btn.big img { width: 120px; opacity: .95; }
.talk-btn.panic img { width: 26px; animation: shake .5s ease-in-out infinite; }
.bubble {
  position: absolute; top: calc(100% + 8px); right: -6px; width: 220px; z-index: 10; text-align: left;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; font-weight: 400; font-style: normal;
  background: var(--card); color: var(--text); border: 2px solid var(--text); border-radius: 12px;
  padding: 8px 10px; font-size: 13px; box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
}
.bubble::before {
  content: ""; position: absolute; top: -9px; right: 20px; width: 14px; height: 14px; background: var(--card);
  border-left: 2px solid var(--text); border-top: 2px solid var(--text); transform: rotate(45deg);
}
.bubble.below { right: auto; left: 50%; transform: translateX(-50%); width: 210px; }
.bubble.below::before { right: auto; left: calc(50% - 7px); }
.col-head .bubble { width: 200px; }
.login-box { position: relative; margin-top: 70px; }
.login-peek { position: absolute; top: -92px; left: 50%; width: 120px; transform: translateX(-50%); pointer-events: none; }
.login-box .brand img.seal { width: 60px; height: 60px; }

/* ---------- переключатель вида ---------- */
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 5px 14px; cursor: pointer; font-size: 14px; color: var(--muted); }
.seg button.active { background: var(--accent); color: var(--accent-text); font-weight: 600; }

/* ---------- команда ---------- */
.team { padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 1400px; }
.team-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; max-width: 760px; }
.team-sum .stat { background: var(--card); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.person {
  background: var(--card); border-radius: 16px; padding: 16px; display: grid; gap: 14px; align-content: start;
  box-shadow: var(--shadow); border-top: 4px solid var(--line);
}
.person.me-card { border-top-color: var(--accent); }
.person-head { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.ava { width: 96px; height: 96px; display: block; }
.pname { font-family: var(--serif); font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pname .chip { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; font-size: 11px; font-weight: 400; }
.rank { color: var(--accent); font-weight: 600; font-size: 14px; margin: 2px 0 6px; }
.bar { height: 8px; background: var(--chip); border-radius: 999px; overflow: hidden; margin-bottom: 4px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .4s; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--panel); border-radius: 10px; padding: 8px 10px; display: grid; gap: 2px; }
.stat b { font-size: 20px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.bad { background: var(--danger-bg); }
.stat.bad b { color: var(--danger); }
.stat.good b { color: var(--dir-clients); }
.tlist { display: grid; gap: 6px; }
.tlink {
  text-align: left; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 7px 10px;
  cursor: pointer; font-size: 14px;
}
.tlink:hover { border-color: var(--muted); }
.tlink.late { border-color: var(--danger); color: var(--danger); }
.idle { font-style: italic; }
.team-note { margin: 0; }
.chip.owner { display: inline-flex; align-items: center; gap: 4px; }
.chip.owner img { width: 16px; height: 16px; margin-left: -5px; }

.ava-wrap { position: relative; }
.place {
  position: absolute; right: -4px; bottom: -2px; background: var(--text); color: var(--bg); border-radius: 999px;
  font-size: 12px; font-weight: 700; padding: 1px 7px; border: 2px solid var(--card);
}
.points { font-size: 14px; color: var(--muted); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.points b { font-size: 22px; color: var(--text); font-variant-numeric: tabular-nums; }
.delta { font-size: 12px; font-weight: 600; }
.plus { color: var(--dir-clients); }
.minus, .points b.minus { color: var(--danger); }
.person.shame { border-top-color: var(--danger); }
.person.shame .rank { color: var(--danger); }
.bar.shame i { background: var(--danger); }
.rules { background: var(--card); border-radius: 12px; padding: 10px 14px; max-width: 760px; box-shadow: var(--shadow); }
.rules summary { cursor: pointer; font-weight: 600; font-family: var(--serif); }
.rules ul { margin: 10px 0 6px; padding-left: 4px; list-style: none; display: grid; gap: 4px; font-size: 14px; }
.rules li b { display: inline-block; min-width: 34px; font-variant-numeric: tabular-nums; }
.ledger { display: grid; gap: 4px; font-size: 13px; }
.ev { display: grid; grid-template-columns: 40px 1fr; gap: 6px; }
.ev b { text-align: right; font-variant-numeric: tabular-nums; }
.ev span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.person-head { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; width: 100%; color: inherit; font: inherit; }
.person-head:hover .ava { transform: rotate(-4deg) scale(1.04); }
.ava { transition: transform .2s; }
.role { font-size: 13px; color: var(--muted); margin-top: 1px; }
.rank.shame { color: var(--danger); }
.profile-btn { justify-self: start; }
.month-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.month-nav b { font-family: var(--serif); font-size: 20px; }
.btn[disabled] { opacity: .4; cursor: default; }
.hall {
  display: flex; align-items: center; gap: 12px; background: var(--warn-bg); border-radius: 14px; padding: 10px 14px; max-width: 760px;
  border: 1px solid var(--line);
}
.hall img { width: 56px; height: 56px; }
.hall b { font-family: var(--serif); font-size: 18px; }
.profile { max-width: 720px; }
.profile-head { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; }
.ava.big { width: 120px; height: 120px; }
.profile-head h2 { font-size: 24px; }
.role-edit { display: flex; gap: 8px; margin: 6px 0; }
.role-edit input { padding: 6px 12px; font-size: 15px; }
.pbox { background: var(--bg); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.months { display: grid; gap: 4px; }
.mrow { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; font-size: 14px; align-items: baseline; }
.done-list { display: grid; gap: 6px; }
.done-row {
  display: grid; grid-template-columns: 82px 1fr auto 40px; gap: 8px; align-items: center; text-align: left;
  border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 7px 10px; cursor: pointer; font-size: 14px;
}
.done-row:hover { border-color: var(--muted); }
.done-row b { text-align: right; font-variant-numeric: tabular-nums; }
.done-row .dt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.banner {
  width: 100%; order: 9; background: var(--warn-bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 12px; font-size: 13px;
}
.notify .nrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }

/* ---------- календарь ---------- */
.cal { min-width: 0; background: var(--card); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; max-width: 760px; box-shadow: var(--shadow); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { font-size: 12px; color: var(--muted); text-align: center; padding: 2px 0; }
.cal-cell {
  min-height: 58px; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 4px; overflow: hidden;
  display: flex; flex-direction: column; align-items: stretch; gap: 2px; text-align: left; color: inherit; font: inherit;
}
.cal-cell.empty-cell { border: 0; background: none; }
.cal-cell[disabled] { cursor: default; opacity: .75; }
.cal-cell.has { cursor: pointer; background: var(--card); border-color: var(--muted); }
.cal-cell.has:hover, .cal-cell.picked { border-color: var(--accent); }
.cal-cell.picked { box-shadow: 0 0 0 2px var(--accent) inset; }
.cal-cell.today .cal-n { background: var(--accent); color: var(--accent-text); border-radius: 999px; padding: 0 6px; }
.cal-n { font-size: 12px; font-weight: 600; align-self: flex-start; }
.cal-who { display: flex; flex-wrap: wrap; gap: 2px; }
.cal-ava { position: relative; line-height: 0; }
.cal-ava img { width: 24px; height: 24px; }
.cal-ava i {
  position: absolute; right: -4px; bottom: -3px; font-style: normal; font-size: 10px; line-height: 1; font-weight: 700;
  background: var(--accent); color: var(--accent-text); border-radius: 999px; padding: 1px 4px;
}
.cal-detail { display: grid; gap: 6px; }
.cal-task {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; text-align: left;
  border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 6px 10px; cursor: pointer; font-size: 14px; color: inherit;
}
.cal-task img { width: 26px; height: 26px; }
.cal-task > span { min-width: 0; overflow-wrap: anywhere; }
a.btn { text-decoration: none; display: inline-block; }

.fresh { display: grid; gap: 8px; background: var(--warn-bg); border-radius: 12px; padding: 10px 12px; }
.setup { min-height: 150px; font: 12px/1.4 ui-monospace, Consolas, monospace; }

/* ---------- уведомление ---------- */
.toast.with-boar { display: flex; align-items: center; gap: 10px; }
.toast.with-boar img { width: 52px; height: auto; }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 30;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 14px;
  border-left: 4px solid var(--accent);
  max-width: calc(100% - 32px); box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}

/* ---------- телефон ---------- */
@media (max-width: 760px) {
  .top { padding-left: 12px; padding-right: 12px; }
  .top > * { order: 2; }
  .top .brand { order: 0; flex: 1; margin-right: 0; }
  .top .brand span { font-size: 18px; white-space: nowrap; }
  .top .brand img { width: 30px; height: 30px; }
  .top .talk, .top .btn.small { order: 1; }
  .top .spacer, .me { display: none; }
  .tabs { order: 3; }
  .seg { order: 2; }
  .team { padding: 12px; }
  .people { grid-template-columns: 1fr; }
  .cal { padding: 10px; }
  .cal-grid { gap: 3px; }
  .cal-cell { min-height: 46px; padding: 3px; border-radius: 8px; }
  .cal-ava img { width: 18px; height: 18px; }
  .person-head { grid-template-columns: 80px 1fr; }
  .ava { width: 80px; height: 80px; }
  .profile-head { grid-template-columns: 84px 1fr; }
  .ava.big { width: 84px; height: 84px; }
  .done-row { grid-template-columns: 1fr auto 36px; }
  .done-row > .hint { grid-column: 1 / -1; }
  .tabs { display: flex; gap: 6px; overflow-x: auto; width: 100%; padding-top: 4px; }
  .tabs button {
    flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); border-radius: 999px;
    padding: 6px 14px; font-size: 14px;
  }
  .tabs button.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
  .tabs button.over { border-color: var(--danger); }
  .board { display: block; padding: 10px 12px 24px; }
  .col { display: none; min-height: 0; }
  .talk-btn.mascot img { width: 38px; }
  .bubble { width: 200px; }
  .col.active { display: block; }
  .grid2 { grid-template-columns: 1fr; }
  .modal-bg { padding: 0; }
  .grab { display: block; width: 44px; height: 5px; border-radius: 999px; background: var(--line); margin: -6px auto 2px; }
  .modal-bg { overscroll-behavior: contain; }
  .modal { border-radius: 0; min-height: 100%; padding-bottom: max(18px, env(safe-area-inset-bottom)); align-content: start; }
}

/* Шут сёгуна — бегущая строка под шапкой */
.jester {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  margin: 8px 16px 0; padding: 6px 12px 6px 6px;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid #f2c14e; border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}
.jester img { width: 46px; height: auto; flex: 0 0 auto; transition: transform .2s; }
.jester:hover img { transform: rotate(-8deg) scale(1.06); }
.jester-body { display: flex; flex-direction: column; min-width: 0; }
.jester-name { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.jester-text { font-size: 14px; line-height: 1.35; min-height: 2.7em; overflow-wrap: anywhere; }
.jester-text.in { animation: jester-in .45s ease-out; }
@keyframes jester-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .jester-text.in { animation: none; } }
@media (max-width: 760px) {
  .jester { margin: 8px 12px 0; gap: 8px; box-sizing: border-box; max-width: calc(100vw - 24px); }
  .jester img { width: 38px; }
  .jester-text { font-size: 13px; min-height: 2.6em; }
}

/* ---------- заметки (22.10.2026) ---------- */
.notes { padding: 14px 16px 24px; display: grid; gap: 12px; max-width: 900px; }
.note-tools { display: grid; gap: 8px; }
.note-tools input[type="search"] { background: var(--card); border-radius: 999px; }
.note-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.note-tags button {
  border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px;
  padding: 3px 12px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.note-tags button:hover { border-color: var(--muted); }
.note-tags button.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.note-tags .n { font-size: 11px; opacity: .75; font-variant-numeric: tabular-nums; }
.note-list { display: grid; gap: 8px; }
.note-item {
  background: var(--card); border-radius: 10px; padding: 10px 10px 10px 12px; box-shadow: var(--shadow);
  cursor: pointer; border: 1px solid transparent; border-left: 4px solid var(--accent); display: grid; gap: 6px;
}
.note-item:hover { border-top-color: var(--line); border-right-color: var(--line); border-bottom-color: var(--line); }
.note-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.note-preview {
  font-size: 13px; color: var(--muted); white-space: pre-wrap; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.chip.tag { color: var(--accent); font-weight: 600; }
.note-item .chip.tag { cursor: pointer; }
.note-ro-title { font-weight: 600; font-size: 17px; word-break: break-word; }
.note-text { white-space: pre-wrap; word-break: break-word; }
.card-ref {
  border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; text-align: left;
  font: inherit; font-size: 14px; text-decoration: underline; justify-self: start;
}
@media (max-width: 760px) {
  .notes { padding: 10px 12px 24px; }
}


/* Переход в остальную систему из доски (№41) */
.seg-out { display: flex; gap: 6px; }
.seg-out .linkbtn { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; border: 1px solid #8fc1ad; color: #1b1b1d; background: #8fc1ad; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.seg-out .linkbtn:hover { filter: brightness(1.07); }
.seg-out .linkbtn:focus-visible { outline: 2px solid #1b1b1d; outline-offset: 2px; }
