:root {
  --ink: #18202b;
  --paper: #f4f1e9;
  --panel: #fffdf8;
  --line: #d8d2c4;
  --muted: #77736a;
  --red: #c93f32;
  --red-dark: #9f2d24;
  --navy: #172b3d;
  --green: #32705b;
  --yellow: #e3b13a;
  --shadow: 0 18px 50px rgb(34 38 42 / 10%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgb(24 32 43 / 3%) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 32px;
  font-family: Aptos, Calibri, "Trebuchet MS", sans-serif;
  font-size: 15px;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.muted { color: var(--muted); }
.ledger-panel { scroll-margin-top: 80px; }
.attribution-details { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.attribution-details summary { cursor: pointer; font-weight: 700; }
.original-answers { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 2fr); gap: 10px 20px; font-size: 13px; line-height: 1.5; }
.original-answers dt { color: var(--muted); }
.original-answers dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.attribution-details > p { margin-top: 12px; font-size: 12px; }
.phone-link { color: inherit; text-underline-offset: 3px; }
input[readonly] { background: #f4f1e9; color: var(--muted); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

h1, h2, p { margin-top: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
h1 { margin-bottom: 0; font-size: clamp(32px, 4vw, 54px); line-height: 1; }
h2 { margin-bottom: 0; font-size: 25px; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(380px, 1.2fr);
}

.login-mark {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(32px, 7vw, 96px);
  overflow: hidden;
  color: #fff;
  background: var(--navy);
}

.login-mark::before {
  content: "";
  position: absolute;
  top: -15vw;
  right: -15vw;
  width: 45vw;
  height: 45vw;
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: 50%;
  box-shadow: 0 0 0 6vw rgb(255 255 255 / 3%), 0 0 0 12vw rgb(255 255 255 / 3%);
}

.login-mark span { font-size: clamp(42px, 7vw, 92px); letter-spacing: -.06em; }
.login-mark strong { color: #ec6b5f; font-size: clamp(18px, 2vw, 30px); letter-spacing: .42em; }

.login-card {
  width: min(420px, calc(100% - 48px));
  margin: auto;
  padding: 38px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card h1 { margin-bottom: 16px; font-size: 40px; line-height: 1.05; }
.login-card .button { width: 100%; margin-top: 8px; }

label { display: grid; gap: 7px; margin: 16px 0; }
label > span { color: #5d5a53; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }

input, select, textarea {
  width: 100%;
  border: 1px solid #c8c1b4;
  border-radius: 2px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgb(23 43 61 / 10%);
}

textarea { resize: vertical; }

.button, .quiet-button, .icon-button {
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 2px;
  font-weight: 800;
  transition: transform .15s, background .15s;
}

.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--red); }
.button-primary:hover { background: var(--red-dark); }
.button-secondary { border: 1px solid var(--line); color: var(--ink); background: var(--panel); }

.quiet-button {
  padding: 8px 5px;
  border-bottom: 1px solid transparent;
  color: inherit;
  background: transparent;
}
.quiet-button:hover { border-bottom-color: currentcolor; }

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 clamp(18px, 4vw, 56px);
  color: #fff;
  background: var(--navy);
  box-shadow: 0 5px 30px rgb(12 24 34 / 16%);
}

.brand { display: flex; align-items: baseline; gap: 10px; color: inherit; text-decoration: none; }
.brand span { font-size: 21px; letter-spacing: -.04em; }
.brand strong { color: #ec6b5f; font-size: 10px; letter-spacing: .28em; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.user-pill { padding: 7px 10px; border: 1px solid rgb(255 255 255 / 22%); border-radius: 99px; font-size: 12px; }

.app-shell { display: flex; flex-direction: column; height: auto; min-height: 100dvh; }
.app-shell > .topbar { flex-shrink: 0; }
main { display: block; flex: none; min-height: 0; width: min(1480px, calc(100% - clamp(28px, 6vw, 88px))); margin: 0 auto; padding: 16px 0; }
.page-heading { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.page-heading h1 { margin: 0; font-size: 30px; line-height: 1.1; }
.heading-actions { display: flex; gap: 10px; }
.heading-actions > .button { min-height: 36px; padding-inline: 12px; font-size: 13px; }

.ledger-panel { --kanban-column-width: 274px; --kanban-gutter: 14px; container-type: inline-size; display: block; min-height: 0; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.filters { display: grid; grid-template-columns: minmax(190px, 1.2fr) repeat(3, minmax(125px, .7fr)) auto; gap: 8px; padding: 14px; border-bottom: 1px solid var(--line); }
.filters label { margin: 0; }
.filters input, .filters select { min-height: 40px; padding: 8px 10px; }
.filter-reset { align-self: center; color: var(--red); }
.contact-queue-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px; border-bottom: 1px solid var(--line); }
.contact-queue-label { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.contact-queue { display: flex; flex-wrap: wrap; gap: 8px; }
.contact-queue-chip { min-height: 36px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 2px; color: var(--ink); background: transparent; cursor: pointer; font-size: 12px; }
.contact-queue-chip strong { margin-left: 7px; font-variant-numeric: tabular-nums; }
.contact-queue-chip:hover { border-color: var(--navy); }
.contact-queue-chip[aria-pressed="true"] { border-color: var(--navy); color: #fff; background: var(--navy); }

.board-sticky { position: sticky; z-index: 2; top: 64px; background: var(--panel); }
.board-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.board-help { flex: 1 1 540px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.board-feedback { margin: 12px 14px 0; padding: 11px 13px; border-left: 3px solid var(--navy); background: #eef1f3; font-size: 13px; line-height: 1.5; }
.board-feedback[data-kind="error"], .board-feedback[data-kind="warning"] { border-left-color: var(--red); color: var(--red-dark); background: #fbefeb; }
.kanban-headings { display: flex; gap: 12px; margin-inline: var(--kanban-gutter); padding: 0 0 12px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-color: #aaa291 var(--paper); transform: scaleY(-1); }
.kanban-board { display: flex; flex: none; align-items: stretch; gap: 12px; height: 300dvh; min-height: 0; margin-inline: var(--kanban-gutter); padding: 0 0 16px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; }
.kanban-board::-webkit-scrollbar { display: none; }
.board-end { height: 1px; }
.kanban-column { display: flex; flex: 0 0 var(--kanban-column-width); flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--line); border-top: 0; background: var(--paper); transition: border-color .12s, background .12s; }
.kanban-column-heading[data-board-status="Договор"] { border-top-color: var(--green); }
.kanban-column-heading[data-board-status="Отказ"], .kanban-column-heading[data-board-status="Дубль"] { border-top-color: #7c7770; }
.kanban-column.is-drop-target { border-color: var(--red); background: #f6e8df; box-shadow: inset 0 0 0 1px var(--red); }
.kanban-column-heading { display: flex; flex: 0 0 var(--kanban-column-width); min-width: 0; align-items: baseline; justify-content: space-between; gap: 8px; padding: 10px; border: 1px solid var(--line); border-top: 3px solid var(--navy); background: var(--paper); transform: scaleY(-1); }
.kanban-column-heading h2 { font-family: inherit; font-size: 14px; font-weight: 800; }
.kanban-column-heading strong { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
@media (min-width: 1100px) {
  .kanban-column, .kanban-column-heading { --kanban-column-width: calc((100cqw - 2 * var(--kanban-gutter) - 4 * 12px) / 5); }
}
.kanban-column-heading.is-drop-target { border-color: var(--red); background: #f6e8df; box-shadow: inset 0 0 0 1px var(--red); }
.kanban-cards { display: grid; flex: 1; align-content: start; gap: 8px; min-height: 0; padding: 8px; overflow-y: hidden; scrollbar-gutter: stable; }
.kanban-board[data-column-scrolling="true"] .kanban-cards { overflow-y: auto; }
.kanban-card { min-width: 0; padding: 10px; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 3px 9px rgb(34 38 42 / 4%); overflow-wrap: anywhere; }
.kanban-card[draggable="true"] { cursor: grab; }
.kanban-card:hover { border-color: #a9a18f; }
.kanban-card.is-dragging { opacity: .55; }
.kanban-card[aria-busy="true"] { border-color: var(--navy); }
.kanban-card-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.kanban-name { display: block; min-width: 0; margin: 0; padding: 0; border: 0; color: var(--ink); background: transparent; text-align: left; font-size: 15px; font-weight: 800; line-height: 1.3; cursor: pointer; }
.kanban-name:hover { color: var(--red-dark); }
.kanban-card .phone-link { display: inline-block; margin-bottom: 6px; font-size: 13px; }
.kanban-object { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 0 0 5px; font-size: 12px; line-height: 1.35; }
.kanban-kind { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 7px; color: var(--navy); font-size: 12px; line-height: 1.35; }
.lead-type-tag { display: inline-block; padding: 2px 6px; border-radius: 2px; color: #625d52; background: #efede7; font-size: 11px; font-weight: 800; }
.lead-type-tag[data-lead-type="Продавец"] { color: #1d4f91; background: #e8f0fc; }
.lead-type-tag[data-lead-type="Покупатель"] { color: #1c6546; background: #e7f3eb; }
.lead-type-tag[data-lead-type="Обмен"] { color: #80500d; background: #fff0d3; }
.kanban-card[data-lead-type] { border-left-width: 3px; border-left-color: #aa9f88; }
.kanban-card[data-lead-type="Продавец"] { border-left-color: #3972b2; }
.kanban-card[data-lead-type="Покупатель"] { border-left-color: #398663; }
.kanban-card[data-lead-type="Обмен"] { border-left-color: #ad761d; }
.kanban-contact { margin: 0 0 6px; font-size: 11px; line-height: 1.35; }
.kanban-contact span { margin-right: 5px; color: var(--muted); }
.kanban-contact strong { margin-left: 5px; }
.kanban-stage { position: relative; margin: 0; gap: 0; }
.kanban-stage > span { font-size: 10px; }
.kanban-stage select { min-height: 32px; padding: 4px 8px; font-size: 12px; }
.kanban-stage select:disabled { color: var(--muted); background: var(--paper); cursor: wait; }
.kanban-saving { margin: 10px 0 0; color: var(--navy); font-size: 11px; font-weight: 800; }
.kanban-empty { margin: 0; padding: 20px 5px; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }

.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 980px; border-collapse: collapse; }
th { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
td { padding: 13px 14px; border-bottom: 1px solid #ebe6dc; vertical-align: middle; }
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:hover { background: #f7f1e5; }
.contact-name { display: block; margin-bottom: 3px; font-weight: 800; }
.subline { color: var(--muted); font-size: 12px; }
.source-tag { display: inline-block; padding: 4px 7px; border: 1px solid var(--line); background: #f7f4ec; font-size: 11px; }
.status-tag { display: inline-block; min-width: 118px; padding: 6px 9px; border-left: 3px solid var(--yellow); background: #f8f2de; font-size: 12px; font-weight: 800; }
.status-contract { border-color: var(--green); background: #e9f3ee; }
.status-reject { border-color: #7c7770; background: #eceae6; }
.contact-overdue { color: var(--red); font-weight: 800; }

.empty-state { padding: 70px 20px; text-align: center; }
.empty-state > span { display: block; color: #d6cec0; font-family: Georgia, serif; font-size: 70px; }
.empty-state h2 { margin-bottom: 8px; }
.empty-state p { color: var(--muted); }
.ledger-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0; color: var(--muted); font-size: 11px; }

dialog { width: min(820px, calc(100% - 28px)); max-height: calc(100vh - 28px); padding: 0; border: 0; border-radius: 2px; background: var(--panel); box-shadow: 0 25px 90px rgb(0 0 0 / 35%); }
dialog::backdrop { background: rgb(12 24 34 / 70%); backdrop-filter: blur(3px); }
dialog form { padding: 26px; }
.small-dialog { width: min(460px, calc(100% - 28px)); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.icon-button { width: 36px; height: 36px; color: var(--muted); background: transparent; font-size: 29px; line-height: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.wide { grid-column: 1 / -1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-error { min-height: 20px; margin: 10px 0 0; color: var(--red); font-weight: 700; }
#lead-dialog { width: min(820px, calc(100% - 28px)); max-height: calc(100dvh - 28px); }
#lead-dialog form { padding: 16px; }
#lead-dialog .dialog-header { padding-bottom: 8px; }
#lead-dialog .dialog-header h2 { font-size: 26px; line-height: 1.15; overflow-wrap: anywhere; }
#lead-dialog .dialog-header > div { min-width: 0; }
.contact-again, .lead-related button { width: fit-content; padding: 4px 0; border: 0; color: var(--navy); background: transparent; text-decoration: underline; font: inherit; font-size: 12px; text-align: left; }
.contact-again:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.kanban-no-answer-action { min-height: 36px; padding: 7px 10px; border: 1px solid var(--navy); border-radius: 2px; color: #fffdf8; background: var(--navy); font-weight: 800; text-decoration: none; cursor: pointer; }
.kanban-no-answer-action:disabled { color: #fffdf8; opacity: .6; }
.kanban-card .kanban-no-answer-action { width: 100%; margin-top: 8px; }
.no-answer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; margin: 2px 0 6px; }
.kanban-no-answer { margin: 0 0 6px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.kanban-no-answer strong, #no-answer-summary strong { display: block; color: var(--ink); font-size: 13px; font-weight: 800; }
.lead-related { margin: 8px 0; }
#lead-related-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
#lead-dialog .eyebrow { margin-bottom: 4px; font-size: 10px; }
#lead-dialog label { min-width: 0; gap: 4px; margin: 6px 0; }
#lead-dialog input, #lead-dialog select, #lead-dialog textarea { min-width: 0; min-height: 38px; padding: 7px 9px; }
#lead-object-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#lead-object-fields .object-address { grid-column: span 2; }
#lead-dialog .form-error:empty { display: none; }
#lead-dialog .field-hint { color: var(--muted); font-size: 12px; line-height: 1.3; }
#lead-dialog .dialog-actions { position: sticky; bottom: 0; margin-top: 8px; padding-top: 10px; background: var(--panel); }
#lead-dialog .dialog-actions .button { min-height: 38px; padding: 9px 14px; }
.lead-extra { margin-top: 8px; border-top: 1px solid var(--line); }
.lead-extra > summary { padding: 10px 0; font-size: 13px; font-weight: 700; cursor: pointer; }
.record-meta { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.lead-history { padding-top: 0; }
.history-caption, .history-state { margin: 8px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.history-list { max-height: 320px; margin: 0; padding: 0 6px 0 4px; overflow-y: auto; list-style: none; }
.history-event { position: relative; padding: 0 0 20px 18px; border-left: 1px solid var(--line); }
.history-event:last-child { padding-bottom: 2px; }
.history-event::before { content: ""; position: absolute; top: 4px; left: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--navy); }
.history-event-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; font-size: 12px; }
.history-event-heading time, .history-actor { color: var(--muted); font-size: 11px; }
.history-actor { margin: 5px 0 10px; overflow-wrap: anywhere; }
.history-changes { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 3fr); gap: 7px 14px; margin: 0; font-size: 12px; line-height: 1.5; }
.history-changes dt { color: var(--muted); }
.history-changes dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.toast { position: fixed; z-index: 30; right: 24px; bottom: 24px; max-width: 380px; padding: 13px 16px; color: #fff; background: var(--navy); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translateY(0); }
.mobile-only { display: none; }

@media (max-width: 1000px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-mark { min-height: 180px; padding: 28px; }
  .login-card { margin: 28px auto; padding: 28px; }
  .topbar { padding: 0 15px; }
  .brand strong, .user-pill { display: none; }
  main { width: calc(100% - 24px); padding-top: 16px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; }
  .heading-actions { flex-wrap: wrap; }
  .heading-actions > * { flex: 1; }
  .heading-actions > .button { min-height: 44px; }
  .ledger-panel { --kanban-column-width: min(290px, calc(100vw - 62px)); --kanban-gutter: 10px; }
  .kanban-stage select { min-height: 44px; }
  #lead-dialog input, #lead-dialog select, #lead-dialog textarea { min-height: 44px; font-size: 16px; }
  #lead-primary-fields, #lead-object-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #lead-primary-fields .wide, #lead-primary-fields .contact-date-field, #manager-field-wrap { grid-column: 1 / -1; }
  #lead-dialog .dialog-actions .button { min-height: 44px; }
  .contact-again, .lead-related button { min-height: 44px; }
  .filters { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .contact-queue-bar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .contact-queue { gap: 6px; }
  .contact-queue-chip { padding-inline: 9px; }
  .history-changes { grid-template-columns: 1fr; gap: 2px; }
  .history-changes dd { margin-bottom: 7px; }
  .wide { grid-column: auto; }
  .ledger-footer { width: 100%; gap: 8px; }
}

@media (max-width: 380px) {
  #lead-primary-fields, #lead-object-fields { grid-template-columns: 1fr; }
  #lead-object-fields .object-address { grid-column: auto; }
}

/* Touch-only refinements: desktop, including narrow mouse windows, is unchanged. */
@media (hover: none) and (pointer: coarse) and (max-width: 1099px) {
  body { --muted: #6b675f; }
  .button, .quiet-button, .contact-queue-chip, .filter-reset,
  .heading-actions > .button, .mobile-only, .kanban-no-answer-action, .contact-again, .lead-related button {
    min-width: 44px;
    min-height: 44px;
  }
  .mobile-only { display: inline-flex; align-items: center; justify-content: center; }
  .filters { grid-template-columns: minmax(0, 1fr) auto; padding: 10px; }
  .filters .search-field { grid-column: 1; grid-row: 1; min-width: 0; }
  .mobile-filter-toggle { grid-column: 2; grid-row: 1; padding-inline: 10px; white-space: nowrap; }
  .filters .filter-option { grid-column: 1 / -1; }
  .filters:not([data-expanded="true"]) .filter-option { display: none; }
  .filters .filter-reset { justify-self: stretch; }
  .filters input, .filters select, .kanban-stage select,
  #login-form input, #password-form input,
  #lead-dialog input, #lead-dialog select, #lead-dialog textarea {
    min-height: 44px;
    font-size: 16px;
  }
  .contact-queue-bar { display: block; padding: 8px 10px; }
  .contact-queue-label { display: none; }
  .contact-queue { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .contact-queue-chip { flex-shrink: 0; white-space: nowrap; }
  .board-sticky { display: contents; }
  #board-headings { position: sticky; z-index: 2; top: 64px; background: var(--panel); }
  .board-toolbar { flex-wrap: wrap; gap: 6px 10px; padding: 4px 10px; }
  .board-toolbar .ledger-footer { flex: 1; min-width: 0; width: auto; }
  #toggle-rules { order: 1; }
  #board-help { order: 2; flex-basis: 100%; }
  #board-help:not([data-expanded="true"]) { display: none; }
  #last-refresh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .ledger-panel[data-empty="true"] #lead-board,
  .ledger-panel[data-empty="true"] #board-headings { display: none; }
  .ledger-panel .empty-state { padding: 24px 14px; }
  .ledger-panel .empty-state > span { display: none; }
  .ledger-panel .empty-state h2 { font-size: 24px; }
  .icon-button { flex-shrink: 0; width: 44px; height: 44px; }
  #lead-dialog .dialog-actions .button, #password-dialog .dialog-actions .button { min-height: 44px; }
  .kanban-cards { scroll-padding-top: 12px; }
  .kanban-card { scroll-margin-top: 150px; }
}

@media (hover: none) and (pointer: coarse) and (min-width: 500px) and (max-width: 1099px) and (max-height: 500px) {
  .page-heading { flex-direction: row; align-items: center; }
  .heading-actions { width: auto; }
  .heading-actions > * { flex: initial; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
