/* Заявки ИТ — оформление в духе Atlassian Jira. Две темы: светлая и тёмная (переключатель в шапке). */
:root {
  color-scheme: light;
  --bg: #f1f3f6;
  --sunken: #e8ebf0;
  --raised: #ffffff;
  --overlay: #ffffff;
  --text: #172b4d;
  --subtle: #44546f;
  --muted: #626f86;
  --line: #091e4224;
  --line-strong: #091e4241;
  --hover: #091e420f;
  --pressed: #091e4224;
  --selected: #e9f2ff;
  --selected-text: #0c66e4;
  --brand: #0c66e4;
  --brand-hover: #0055cc;
  --input: #ffffff;
  --input-line: #a5adba;
  --focus: #388bff;
  --shadow: 0 1px 1px #091e4240, 0 0 1px #091e424f;
  --shadow-overlay: 0 8px 12px #091e4226, 0 0 1px #091e424f;
  --grey-bg: #dcdfe4; --grey: #44546f;
  --blue-bg: #cce0ff; --blue: #0055cc;
  --green-bg: #baf3db; --green: #216e4e;
  --yellow-bg: #f8e6a0; --yellow: #7f5f01;
  --red-bg: #ffd5d2; --red: #ae2e24;
  --purple-bg: #dfd8fd; --purple: #5e4db2;
  --column: #e4e7ec;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #2b3036;
  --sunken: #24292e;
  --raised: #353b42;
  --overlay: #3a4148;
  --text: #d3dbe4;
  --subtle: #b3bfcc;
  --muted: #9aa7b5;
  --line: #a6c5e229;
  --line-strong: #a6c5e245;
  --hover: #a1bdd914;
  --pressed: #a6c5e229;
  --selected: #1c2b41;
  --selected-text: #579dff;
  --brand: #579dff;
  --brand-hover: #85b8ff;
  --input: #30363c;
  --input-line: #6c7a89;
  --focus: #85b8ff;
  --shadow: 0 1px 1px #03040480, 0 0 1px #03040480;
  --shadow-overlay: 0 8px 12px #0304045c, 0 0 1px #03040480;
  --grey-bg: #454f59; --grey: #dee4ea;
  --blue-bg: #09326c; --blue: #85b8ff;
  --green-bg: #164b35; --green: #7ee2b8;
  --yellow-bg: #533f04; --yellow: #f5cd47;
  --red-bg: #5d1f1a; --red: #fd9891;
  --purple-bg: #352c63; --purple: #b8acf6;
  --column: #24292e;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/20px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--text); }
h1 { font-size: 24px; line-height: 28px; font-weight: 500; margin: 0 0 16px; }
h2 { font-size: 20px; line-height: 24px; font-weight: 500; margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 16px; }
.spacer { flex: 1; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.red { color: var(--red); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 6px; }

/* ---------- элементы управления ---------- */
input, select, textarea {
  font: inherit; color: var(--text); background: var(--input);
  border: 1px solid var(--input-line); border-radius: 3px; padding: 5px 8px; min-height: 32px;
}
textarea { width: 100%; min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: inset 0 0 0 1px var(--focus); }
input[type="checkbox"] { min-height: 0; }
button, a.button {
  font: inherit; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 3px; border: none; cursor: pointer;
  background: var(--hover); color: var(--subtle); text-decoration: none; white-space: nowrap;
}
button:hover:not([disabled]), a.button:hover { background: var(--pressed); text-decoration: none; }
button[disabled] { opacity: .5; cursor: default; }
button.primary { background: var(--brand); color: #fff; }
:root[data-theme="dark"] button.primary { color: #1b1f23; }
button.primary:hover:not([disabled]) { background: var(--brand-hover); }
button.subtle { background: transparent; }
button.subtle:hover:not([disabled]) { background: var(--hover); }
button.danger { color: var(--red); }
button.icon { width: 32px; padding: 0; }
button.active { background: var(--selected); color: var(--selected-text); }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.field > input, .field > select, .field > textarea { font-size: 14px; font-weight: 400; }
.error { color: var(--red); background: var(--red-bg); border-radius: 3px; padding: 8px 12px; }
.check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }

/* ---------- каркас: шапка, боковое меню, содержимое ---------- */
#app { display: grid; grid-template-rows: 56px 1fr; grid-template-columns: 240px 1fr; height: 100vh; }
.top { grid-column: 1 / 3; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--line); background: var(--raised); }
.logo { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; font-size: 16px; margin-right: 12px; }
.logo:hover { text-decoration: none; }
.logo i { width: 24px; height: 24px; border-radius: 4px; background: var(--brand); display: grid; place-items: center;
  color: #fff; font-style: normal; font-size: 13px; font-weight: 700; }
.top .search { width: 260px; position: relative; }
.top .search input { width: 100%; padding-left: 30px; background: var(--input); }
.top .search::before { content: "⌕"; position: absolute; left: 10px; top: 5px; color: var(--muted); font-size: 16px; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 40px; min-width: 220px; background: var(--overlay); box-shadow: var(--shadow-overlay);
  border-radius: 3px; padding: 6px 0; z-index: 30; }
.menu > div { padding: 8px 16px; }
.menu a, .menu button { display: flex; width: 100%; justify-content: flex-start; border-radius: 0; background: none;
  color: var(--text); padding: 8px 16px; height: auto; font-weight: 400; }
.menu a:hover, .menu button:hover:not([disabled]) { background: var(--hover); text-decoration: none; }
.menu hr { border: none; border-top: 1px solid var(--line); margin: 6px 0; }

.side { background: var(--sunken); border-right: 1px solid var(--line); padding: 16px 8px; overflow-y: auto; }
.project { display: flex; gap: 10px; align-items: center; padding: 4px 8px 16px; }
.project i { width: 32px; height: 32px; border-radius: 4px; background: linear-gradient(135deg, #0c66e4, #6e5dc6);
  display: grid; place-items: center; color: #fff; font-style: normal; font-weight: 700; }
.project b { display: block; }
.side h4 { margin: 16px 8px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.side a { display: flex; align-items: center; gap: 10px; padding: 0 8px; height: 36px; border-radius: 3px; color: var(--subtle); font-weight: 500; }
.side a:hover { background: var(--hover); text-decoration: none; }
.side a.active { background: var(--selected); color: var(--selected-text); position: relative; }
.side a.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 2px 2px 0; background: var(--selected-text); }
.side a .ic { width: 20px; text-align: center; }
.side .count { margin-left: auto; background: var(--grey-bg); color: var(--grey); border-radius: 8px; font-size: 11px; padding: 0 6px; line-height: 16px; }

main { overflow: auto; padding: 24px 32px 48px; min-width: 0; }
.crumbs { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.page-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }

/* ---------- значки: тип, приоритет, статус, аватар, метки ---------- */
.type { width: 16px; height: 16px; border-radius: 2px; display: inline-grid; place-items: center; flex: none;
  color: #fff; font-size: 10px; font-weight: 700; line-height: 1; vertical-align: -3px; }
.type.request { background: #8f7ee7; }
.type.task { background: #4bade8; }
.type.bug { background: #e2483d; }
.type.subtask { background: #4bade8; border-radius: 50% 2px 2px 2px; }
.prio { display: inline-block; width: 16px; text-align: center; font-weight: 700; font-size: 13px; flex: none; }
.prio.critical { color: #c9372c; }
.prio.high { color: #e56910; }
.prio.normal { color: #b38600; }
.prio.low { color: #1d7afc; }
.lozenge { display: inline-block; padding: 0 4px; border-radius: 3px; font-size: 11px; font-weight: 700; line-height: 16px;
  text-transform: uppercase; white-space: nowrap; background: var(--grey-bg); color: var(--grey); }
.lozenge.new { background: var(--grey-bg); color: var(--grey); }
.lozenge.in_progress { background: var(--blue-bg); color: var(--blue); }
.lozenge.waiting { background: var(--yellow-bg); color: var(--yellow); }
.lozenge.resolved, .lozenge.closed { background: var(--green-bg); color: var(--green); }
.lozenge.red { background: var(--red-bg); color: var(--red); }
.lozenge.purple { background: var(--purple-bg); color: var(--purple); }
.label { display: inline-block; padding: 0 6px; border-radius: 3px; font-size: 12px; line-height: 18px;
  background: var(--sunken); border: 1px solid var(--line-strong); color: var(--subtle); }
.avatar { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .02em; }
.avatar.big { width: 32px; height: 32px; font-size: 12px; }
.avatar.none { background: var(--grey-bg) !important; color: var(--muted); }
.who { display: inline-flex; align-items: center; gap: 8px; }
.key { color: var(--muted); font-size: 12px; font-weight: 500; }
.key.done { text-decoration: line-through; }

/* ---------- фильтры ---------- */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filters input[type="search"] { width: 200px; }
.avatars { display: flex; }
.avatars button { padding: 0; width: 32px; height: 32px; border-radius: 50%; background: none; margin-right: -4px; border: 2px solid var(--bg); }
.avatars button .avatar { width: 28px; height: 28px; }
.avatars button.active { border-color: var(--brand); z-index: 1; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs .count { margin-left: 4px; color: var(--muted); font-weight: 400; }

/* ---------- доска ---------- */
.board { display: flex; gap: 8px; align-items: flex-start; min-height: 60vh; }
.column { flex: 1 1 0; min-width: 230px; background: var(--column); border-radius: 6px; padding: 8px; min-height: 300px; }
.column.drop { box-shadow: inset 0 0 0 2px var(--focus); }
.column h3 { font-size: 12px; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 4px 6px 10px; display: flex; gap: 8px; }
.card { background: var(--raised); border-radius: 3px; box-shadow: var(--shadow); padding: 10px 12px; margin-bottom: 6px; cursor: pointer; }
.card:hover { background: var(--sunken); }
:root[data-theme="dark"] .card:hover { background: #3d444c; }
.card.overdue { box-shadow: var(--shadow), inset 3px 0 0 #e2483d; }
.card .t { margin-bottom: 8px; word-break: break-word; }
.card .labels { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.card .foot { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.card .foot .spacer { min-width: 4px; }
.card .foot > *:not(.spacer) { white-space: nowrap; flex: none; }
.card .foot { flex-wrap: wrap; row-gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); }
.chip.late { color: var(--red); font-weight: 600; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

/* ---------- бэклог ---------- */
.sprint { background: var(--column); border-radius: 6px; margin-bottom: 16px; padding: 8px; }
.sprint.drop { box-shadow: inset 0 0 0 2px var(--focus); }
.sprint-head { display: flex; align-items: center; gap: 10px; padding: 4px 8px 8px; flex-wrap: wrap; }
.sprint-head b { font-size: 14px; }
.sprint-goal { padding: 0 8px 8px; color: var(--muted); }
.issues { background: var(--raised); border-radius: 3px; box-shadow: var(--shadow); }
.issue-row { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-bottom: 1px solid var(--line); cursor: pointer; min-height: 40px; }
.issue-row:last-child { border-bottom: none; }
.issue-row:hover { background: var(--hover); }
.issue-row .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.issue-row .labels { display: flex; gap: 4px; }
.issue-row .est { min-width: 28px; text-align: center; background: var(--grey-bg); color: var(--grey); border-radius: 8px; font-size: 12px; padding: 0 6px; }
.issues .empty { padding: 16px; }

/* ---------- список ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px; border-bottom: 2px solid var(--line); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.link { cursor: pointer; }
tr.link:hover td { background: var(--hover); }
td .title { font-weight: 500; }

/* ---------- задача ---------- */
.issue { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; max-width: 1400px; }
.issue h1.title { font-size: 24px; padding: 4px 6px; margin: 0 -6px 12px; border-radius: 3px; }
.issue h1.title.editable:hover { background: var(--hover); cursor: text; }
.issue .actions { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.section { margin-bottom: 28px; }
.section h3 { display: flex; align-items: center; gap: 8px; }
.description { white-space: pre-wrap; word-break: break-word; padding: 6px; margin: 0 -6px; border-radius: 3px; min-height: 32px; }
.description.editable:hover { background: var(--hover); cursor: text; }
.description.placeholder { color: var(--muted); }
.files { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.files a { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line-strong); border-radius: 3px; padding: 4px 10px; color: var(--text); }
.progress { height: 6px; background: var(--grey-bg); border-radius: 3px; overflow: hidden; margin: 4px 0 8px; }
.progress i { display: block; height: 100%; background: #22a06b; }
.subtask-add { display: flex; gap: 6px; margin-top: 8px; }
.subtask-add input { flex: 1; }
.comment-box { display: flex; gap: 12px; margin-bottom: 20px; }
.comment-box .body { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.comment { display: flex; gap: 12px; margin-bottom: 20px; }
.comment .body { flex: 1; min-width: 0; }
.comment .meta { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.comment .text { white-space: pre-wrap; word-break: break-word; }
.comment.internal .text { background: var(--yellow-bg); color: var(--text); border-radius: 3px; padding: 6px 10px; }
.history div { padding: 6px 0; border-bottom: 1px solid var(--line); }
.banner { background: var(--blue-bg); color: var(--text); border-radius: 3px; padding: 12px 16px; margin-bottom: 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.status-select { font-weight: 700; text-transform: uppercase; font-size: 12px; border: none; height: 32px; cursor: pointer; }
.status-select.new { background: var(--grey-bg); color: var(--grey); }
.status-select.in_progress { background: var(--blue); color: #fff; }
.status-select.waiting { background: var(--yellow-bg); color: var(--yellow); }
.status-select.resolved, .status-select.closed { background: #1f845a; color: #fff; }
.details { border: 1px solid var(--line-strong); border-radius: 3px; margin-top: 16px; }
.details > h3 { padding: 12px 16px; margin: 0; border-bottom: 1px solid var(--line-strong); }
.details dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 4px 12px; margin: 0; padding: 12px 16px; align-items: center; }
.details dt { color: var(--muted); font-weight: 600; font-size: 12px; }
.details dd { margin: 0; min-height: 32px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.details dd select { min-width: 0; }
.details dd select, .details dd input { width: 100%; border-color: transparent; background: transparent; }
.details dd select:hover, .details dd input:hover { background: var(--hover); }
.details dd select:focus, .details dd input:focus { background: var(--input); }
.labels-edit { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; width: 100%; }
.labels-edit .label button { height: auto; padding: 0 0 0 4px; background: none; color: var(--muted); }
.labels-edit input { flex: 1; min-width: 80px; }
.dates { padding: 0 16px 12px; color: var(--muted); font-size: 12px; }

/* ---------- окно (создание задачи и т.п.) ---------- */
.modal-back { position: fixed; inset: 0; background: #091e427d; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; overflow: auto; }
.modal { background: var(--overlay); border-radius: 3px; box-shadow: var(--shadow-overlay); width: 640px; max-width: 100%; }
.modal header { padding: 20px 24px 8px; display: flex; align-items: center; }
.modal header h2 { margin: 0; }
.modal .content { padding: 8px 24px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 220px); overflow: auto; }
.modal footer { padding: 16px 24px 20px; display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- всплывающее сообщение ---------- */
.flags { position: fixed; left: 24px; bottom: 24px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.flag { background: var(--overlay); box-shadow: var(--shadow-overlay); border-radius: 3px; padding: 14px 18px; min-width: 300px;
  border-left: 4px solid #22a06b; }

/* ---------- вход ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; background: var(--sunken); }
.login { width: 400px; background: var(--raised); box-shadow: var(--shadow-overlay); border-radius: 3px; padding: 32px 40px;
  display: flex; flex-direction: column; gap: 14px; }
.login h2 { text-align: center; margin: 0; }
.login .logo { justify-content: center; margin: 0 0 8px; font-size: 20px; }
.login button { height: 40px; }

/* ---------- отчёты, пользователи ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { border: 1px solid var(--line-strong); border-radius: 3px; padding: 14px 16px; }
.stat .label-text { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 24px; font-weight: 600; margin-top: 4px; }
.stat.bad .value { color: var(--red); }
.reports { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.box { border: 1px solid var(--line-strong); border-radius: 3px; padding: 16px; }
.notice { background: var(--green-bg); color: var(--text); border-radius: 3px; padding: 10px 14px; margin-bottom: 12px; }
details.box summary { cursor: pointer; font-weight: 500; }
code { background: var(--sunken); border-radius: 3px; padding: 1px 4px; font-size: 13px; }

.bottom-nav { display: none; }
.board-tabs, .fx-toggle, .mobile-only { display: none; }
.fx { display: contents; }
.users-table .c-meta { display: none; }
.users-table .c-act .row { flex-wrap: nowrap; }
.users-table .c-act button { white-space: nowrap; }
.mobile-summary { display: none !important; flex-wrap: wrap; gap: 8px; align-items: center; margin: -4px 0 14px; }
.ios-hint { display: none; }

/* ---------- планшет ---------- */
@media (max-width: 1000px) {
  #app { grid-template-columns: 200px 1fr; }
  .issue { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- телефон ---------- */
@media (max-width: 760px) {
  body { font-size: 15px; -webkit-text-size-adjust: 100%; }
  #app { grid-template-columns: 1fr; grid-template-rows: 52px 1fr 0; height: 100dvh; }
  .side { display: none; }
  .top { grid-column: 1; height: 52px; padding: 0 8px 0 12px; padding-top: env(safe-area-inset-top); }
  .top .search, .top #create, #announce { display: none; }
  .logo { font-size: 15px; margin-right: 0; }
  main { padding: 14px 12px calc(84px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
  h1 { font-size: 21px; }
  .crumbs { display: none; }
  .page-head { margin-bottom: 12px; }
  input, select, textarea { font-size: 16px; min-height: 40px; }   /* 16px — iPhone не увеличивает страницу при вводе */
  button, a.button { height: 40px; }

  /* нижнее меню */
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--raised);
    border-top: 1px solid var(--line-strong); padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    height: 58px; color: var(--muted); font-size: 11px; position: relative; text-decoration: none; }
  .bottom-nav a .ic { font-size: 20px; line-height: 22px; }
  .bottom-nav a.active { color: var(--brand); }
  .bottom-nav a.create .ic { background: var(--brand); color: #fff; width: 40px; height: 30px; border-radius: 15px;
    display: grid; place-items: center; font-size: 22px; }
  .bottom-nav .badge { position: absolute; top: 6px; left: 54%; background: var(--red); color: #fff; font-size: 10px;
    border-radius: 8px; padding: 0 5px; line-height: 15px; }

  /* списки — карточками */
  .issue-row { flex-wrap: wrap; padding: 10px 12px; }
  .issue-row .labels { display: none; }
  .issue-row.mobile { display: block; }
  .issue-row.mobile .line { display: flex; align-items: center; gap: 8px; }
  .issue-row.mobile .title { display: block; white-space: normal; margin: 6px 0; font-weight: 500; }
  /* фильтры: строка поиска + кнопка «Фильтры», остальное раскрывается по нажатию */
  .filters { gap: 6px; margin-bottom: 12px; }
  .filters input[type="search"] { width: auto; flex: 1 1 55%; min-width: 0; }
  .filters > select { flex: 1 1 40%; min-width: 0; }
  .fx-toggle { display: inline-flex; align-items: center; gap: 6px; flex: none; }
  .fx-toggle .n { background: var(--brand); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; line-height: 17px; }
  .fx { display: none; width: 100%; flex-wrap: wrap; gap: 6px; }
  .filters.open .fx { display: flex; }
  .fx select { flex: 1 1 45%; min-width: 0; }
  .fx > button, .fx .avatars { flex: none; }
  .tabs { flex-wrap: wrap; gap: 4px; }
  .tabs button { height: 34px; padding: 0 10px; font-size: 14px; }
  .mobile-only { display: revert; }
  .desktop-cell { display: none !important; }

  /* доска — одна колонка на экран, переключение вкладками или свайпом */
  .board-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 10px;
    position: sticky; top: -14px; z-index: 5; background: var(--bg); padding: 4px 0; }
  .board-tabs button { height: 46px; padding: 0 2px; display: flex; flex-direction: column; justify-content: center;
    align-items: center; line-height: 1.15; font-size: 12px; white-space: nowrap; overflow: hidden; }
  .board-tabs button b { font-size: 16px; }
  .board-tabs button.active { background: var(--selected); color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
  .board { display: block; min-height: 0; }
  .column { display: none; min-width: 0; min-height: 0; padding: 6px; }
  .column.on { display: block; }
  .column h3 { display: none; }
  .column .card { margin-bottom: 8px; }
  .column .empty-col { color: var(--muted); text-align: center; padding: 30px 0; }

  /* таблицы — строки превращаются в карточки, ничего не уезжает вправо */
  .table-wrap { overflow: visible; border: none; }
  .table-wrap table, .table-wrap tbody { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 2px;
    border-bottom: 1px solid var(--line); }
  .table-wrap td { display: block; padding: 0; border: none; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .table-wrap td:empty { display: none; }
  .table-wrap td.grow { flex: 1 1 100%; }
  .table-wrap tr.link:active { background: var(--hover); }

  /* пользователи — компактная карточка */
  .users-table tr { display: grid; grid-template-columns: 26px 128px minmax(0, 1fr) auto; gap: 6px 8px; }
  .users-table .c-cb { grid-column: 1; grid-row: 1 / span 2; align-self: start; padding-top: 4px; }
  .users-table .c-name { grid-column: 2 / span 2; grid-row: 1; }
  .users-table .c-badge { grid-column: 4; grid-row: 1; }
  .users-table .c-meta { display: block; grid-column: 2 / span 3; grid-row: 2; font-size: 13px; color: var(--muted); }
  .users-table .c-dept, .users-table .c-login, .users-table .c-last { display: none; }
  .users-table .c-role { grid-column: 1 / span 2; }
  .users-table .c-email { grid-column: 3 / span 2; }
  .users-table .c-role select, .users-table .c-email input { width: 100% !important; }
  .users-table .c-act { grid-column: 1 / span 4; }
  .users-table .c-act .row { flex-wrap: wrap; gap: 6px; }
  .users-table .c-act button { flex: 1; }

  input[type="file"] { width: 100%; min-width: 0; max-width: 100%; font-size: 14px; }
  .comment-box .row { flex-wrap: wrap; }
  .subtask-add { flex-wrap: wrap; }
  .subtask-add input { flex: 1 1 100%; }
  .subtask-add select, .subtask-add button { flex: 1; }
  .issue .actions { margin-bottom: 14px; }
  .issue .actions button { flex: 1 1 auto; padding: 0 10px; }
  .issue .actions .lbl { display: none; }
  .subtask-add { display: none; }                 /* на телефоне — кнопка «↳ Подзадача» вверху */
  .subtask-add.open { display: flex; }
  .scope-select { flex: 0 1 auto; width: auto; max-width: 55%; }
  .box { padding: 12px; }
  .box table { font-size: 13px; width: 100%; }
  .box th, .box td { padding: 6px 4px; overflow-wrap: anywhere; }
  .mobile-summary .status-select { width: auto; height: 34px; min-height: 34px; font-size: 14px; }
  .page-head { flex-wrap: wrap; gap: 8px; }
  pre, .code-block { white-space: pre-wrap; overflow-wrap: anywhere; }

  /* задача */
  .issue { gap: 16px; }
  .mobile-summary { display: flex !important; }
  .desktop-only { display: none; }
  .issue h1.title { font-size: 20px; }
  .details dl { grid-template-columns: 100px minmax(0, 1fr); }
  .comment-box .avatar, .comment > .avatar { display: none; }

  /* окна — на весь экран */
  .modal-back { padding: 0; align-items: stretch; }
  .modal { width: 100%; max-width: none; border-radius: 0; display: flex; flex-direction: column; min-height: 100dvh; }
  .modal .content { flex: 1; max-height: none; padding: 8px 16px; }
  .modal header { padding: 14px 16px 6px; padding-top: calc(14px + env(safe-area-inset-top)); }
  .modal footer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
  .two { grid-template-columns: 1fr; }
  .pick-list { grid-template-columns: 1fr; }
  .qr-wrap { flex-direction: column; }

  .login-page { padding: 16px; align-items: start; padding-top: 12vh; }
  .login { width: 100%; padding: 24px 20px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .flags { left: 12px; right: 12px; top: calc(60px + env(safe-area-inset-top)); bottom: auto; }
  .flag { min-width: 0; }
  .menu { position: fixed; right: 8px; top: 56px; }

  .ios-hint { display: block; position: fixed; left: 12px; right: 12px; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 45;
    background: var(--overlay); box-shadow: var(--shadow-overlay); border-radius: 10px; padding: 14px 16px; }
  .ios-hint div { margin: 6px 0 8px; }
  .ios-hint .share { display: inline-block; border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; }
}
.nowrap { white-space: nowrap; }
.code-block { background: var(--sunken); border: 1px solid var(--line-strong); border-radius: 3px; padding: 10px 12px;
  font: 13px/18px Consolas, "Courier New", monospace; white-space: pre-wrap; margin: 0; user-select: all; }
.announcement { display: flex; align-items: center; gap: 10px; background: var(--yellow-bg); color: var(--text);
  border-radius: 3px; padding: 10px 14px; margin-bottom: 12px; }
.card.soon { box-shadow: var(--shadow), inset 3px 0 0 #e2a03d; }
.chip.soon { color: #c25100; font-weight: 600; }
:root[data-theme="dark"] .chip.soon { color: #f5a85b; }
.pick-list { max-height: 260px; overflow: auto; border: 1px solid var(--line-strong); border-radius: 3px; padding: 6px 10px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; }
.pick-list .pick { padding: 3px 0; }
.pick-list .pick[hidden] { display: none !important; }

.qr-wrap { display: flex; gap: 20px; align-items: flex-start; }
.qr { width: 220px; flex: none; background: #fff; padding: 6px; border-radius: 6px; transition: opacity .3s; }
.qr svg { display: block; width: 100%; height: auto; }
.steps { margin: 0 0 10px; padding-left: 20px; }
.steps li { margin-bottom: 6px; }
.photo-btn { cursor: pointer; }

/* ---------- система остановлена / обслуживание ---------- */
.down { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: grid; place-items: center; padding: 20px; }
.down-card { max-width: 440px; text-align: center; background: var(--raised); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 32px 28px; box-shadow: var(--shadow-overlay); }
.down-icon { font-size: 44px; line-height: 1; margin-bottom: 12px; }
.down-card h2 { margin: 0 0 10px; font-size: 22px; }
.down-card p { margin: 0 0 10px; line-height: 1.5; }
.down-wait { margin-top: 16px; color: var(--muted); font-size: 13px; display: flex; gap: 8px; justify-content: center; align-items: center; }
.down-wait .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: down-pulse 1.4s infinite; }
@keyframes down-pulse { 50% { opacity: .2; } }
