:root {
  --mist: #EEF1EF;
  --paper: #F8FAF8;
  --ink: #1C2830;
  --ink-soft: #55646C;
  --spruce: #2E5B4E;
  --spruce-soft: #DCE7E2;
  --amber: #E9A93A;
  --amber-soft: #FBEFD6;
  --alert: #B83A26;
  --rule: #D3DAD6;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --text: "Instrument Sans", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--mist);
  color: var(--ink);
  font: 400 15px/1.5 var(--text);
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--spruce); outline-offset: 2px; border-radius: 4px; }

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

/* Левая колонка разделов */
.rail {
  position: sticky; top: 0; height: 100vh;
  padding: 24px 16px;
  border-right: 1px solid var(--rule);
  background: var(--paper);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 28px;
  font: 700 20px/1 var(--display); text-decoration: none; letter-spacing: -0.01em;
}
.brand svg { width: 26px; height: 26px; }
.brand path { fill: var(--spruce); }
.brand circle { fill: var(--paper); }
.rail nav { display: flex; flex-direction: column; gap: 2px; }
.rail nav a {
  padding: 9px 12px; border-radius: 8px;
  text-decoration: none; color: var(--ink-soft); font-weight: 500;
}
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; margin-left: 8px; padding: 0 6px; border-radius: 10px; background: #D93A2F; color: #fff; font-size: 12px; font-weight: 700; line-height: 1; vertical-align: 1px; }
.nav-badge[hidden] { display: none; }
.rail nav a:hover { background: var(--mist); color: var(--ink); }
.rail nav a[aria-current="page"] { background: var(--spruce-soft); color: var(--spruce); }
.rail nav .nav-sell {
  margin-top: 16px; background: var(--spruce); color: #fff; text-align: center;
}
.rail nav .nav-sell:hover { background: #244A3F; color: #fff; }
.rail nav .nav-sell[aria-current="page"] { background: var(--ink); color: #fff; }

/* Верхняя строка с переключателем аккаунта */
.main { min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 40px; border-bottom: 1px solid var(--rule);
}
.topbar .account { display: flex; align-items: center; gap: 10px; }
.account-label { color: var(--ink-soft); font-size: 13px; }
.topbar .account select {
  font: 600 14px var(--text); color: var(--ink);
  padding: 7px 32px 7px 12px; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2355646C'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
}
.me { color: var(--ink-soft); font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.lang { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--paper); }
.lang button { border: 0; background: none; padding: 6px 10px; font: 600 12px var(--text); color: var(--ink-soft); cursor: pointer; letter-spacing: .02em; }
.lang button[aria-pressed="true"] { background: var(--spruce); color: #fff; }

#view { padding: 32px 40px 64px; max-width: 1480px; outline: none; }
h1 {
  font: 700 34px/1.1 var(--display); letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.lede { color: var(--ink-soft); margin: 0 0 28px; max-width: 62ch; }
.money, .months, .figures-wide, .url-card, .product-card { max-width: 1160px; }

/* Сводка: выплата на ярлыке-ценнике — единственный яркий элемент */
.money { display: grid; grid-template-columns: minmax(280px, 1.2fr) 2fr; gap: 20px; align-items: stretch; }
.tag {
  position: relative;
  padding: 26px 28px 24px 52px;
  background: var(--amber);
  color: var(--ink);
  clip-path: polygon(22px 0, 100% 0, 100% 100%, 22px 100%, 0 50%);
  border-radius: 6px;
}
.tag::before {
  content: ""; position: absolute; left: 22px; top: 50%;
  width: 12px; height: 12px; margin-top: -6px; border-radius: 50%;
  background: var(--mist);
}
.tag .label { font-weight: 600; font-size: 14px; }
.tag .value { font: 700 52px/1.05 var(--display); letter-spacing: -0.03em; margin: 6px 0 4px; }
.tag .note { font-size: 13px; opacity: 0.8; }

.figures {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--rule); border-radius: 10px; background: var(--paper);
}
.figures div { padding: 18px 20px; border-left: 1px solid var(--rule); }
.figures div:nth-child(3n + 1) { border-left: 0; }
.figures div:nth-child(n + 4) { border-top: 1px solid var(--rule); }
.figures dt { color: var(--ink-soft); font-size: 13px; }
.figures dd { margin: 4px 0 0; font: 600 22px/1.2 var(--display); }

/* Пустые состояния */
.empty {
  margin-top: 28px; padding: 28px; max-width: 640px;
  border: 1px dashed var(--rule); border-radius: 10px; background: var(--paper);
}
.empty h2 { font: 600 19px/1.3 var(--display); margin: 0 0 6px; }
.empty p { margin: 0 0 16px; color: var(--ink-soft); }

.btn {
  display: inline-block; padding: 10px 16px; border-radius: 8px; border: 0;
  background: var(--spruce); color: #fff; font: 600 14px var(--text);
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: #244A3F; }
.btn[aria-disabled="true"] { background: var(--rule); color: var(--ink-soft); cursor: default; }

/* Формы */
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.error { color: var(--alert); margin: 10px 0 0; }
.ok { color: var(--spruce); margin: 8px 0 0; }
.card {
  background: var(--paper); border: 1px solid var(--rule); border-radius: 10px;
  padding: 18px 20px; margin-bottom: 16px;
}
.card h2 { font: 600 20px/1.25 var(--display); margin: 0 0 4px; }
.card h3 { font: 600 16px/1.3 var(--display); margin: 22px 0 10px; }
.field-label { display: block; font-weight: 600; margin-bottom: 6px; }
label { font-size: 14px; color: var(--ink-soft); }
label.block { display: block; margin-top: 12px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 4px;
  font: 400 15px/1.4 var(--text); color: var(--ink);
  padding: 9px 11px; border: 1px solid var(--rule); border-radius: 8px; background: #fff;
}
input:disabled, textarea:disabled { background: var(--mist); }
textarea { resize: vertical; }
.url-card { max-width: 820px; }
.url-row { display: flex; gap: 10px; }
.url-row input { margin: 0; flex: 1; }
.url-row .btn { white-space: nowrap; }
details { margin-top: 12px; font-size: 14px; }
details summary { cursor: pointer; color: var(--spruce); }
details textarea { margin-top: 8px; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-big { margin-top: 18px; padding: 13px 22px; font-size: 15px; }
.btn-quiet { background: var(--spruce-soft); color: var(--spruce); margin-top: 12px; }
.btn-quiet:hover { background: #CCDDD6; }
.link-btn { background: none; border: 0; padding: 6px 0; color: var(--spruce); font: 500 14px var(--text); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn.danger { color: var(--alert); }
.icon-btn { border: 1px solid var(--rule); background: var(--paper); border-radius: 6px; width: 34px; height: 34px; cursor: pointer; color: var(--ink-soft); font-size: 18px; flex: none; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Товар и варианты */
.product-card { max-width: 820px; }
.product-head { display: flex; gap: 16px; align-items: center; }
.product-head img { width: 84px; height: 84px; object-fit: contain; background: #fff; border: 1px solid var(--rule); border-radius: 8px; flex: none; }
.opt { border: 0; padding: 0; margin: 0 0 14px; }
.opt legend { font-weight: 600; font-size: 14px; color: var(--ink); padding: 0; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-block; padding: 8px 14px; border: 1px solid var(--rule); border-radius: 8px;
  background: #fff; color: var(--ink); font-size: 14px; cursor: pointer;
}
.chip input:checked + span { border-color: var(--spruce); background: var(--spruce); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }
.custom-row, .aspect-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.custom-row input, .aspect-row input { margin: 0; }
.aspect-row .a-name { flex: 0 0 38%; }

/* Список */
.section-title { font: 600 20px/1.2 var(--display); margin: 32px 0 10px; }
.rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); }
.rows li + li { border-top: 1px solid var(--rule); }
.row-link { display: grid; grid-template-columns: 48px 1fr auto auto; gap: 14px; align-items: center; padding: 10px 14px; text-decoration: none; }
.row-link:hover { background: var(--mist); }
.row-link img, .row-link .noimg { width: 48px; height: 48px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid var(--rule); }
.row-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-price { font-weight: 600; }
.status { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--mist); color: var(--ink-soft); white-space: nowrap; }
.status-published, .status-sold { background: var(--spruce-soft); color: var(--spruce); }
.status-error { background: #F6DCD6; color: var(--alert); }
.status-publishing { background: var(--amber-soft); color: #7A5410; }
.tabs { display: inline-flex; gap: 4px; background: var(--mist); border: 1px solid var(--rule); border-radius: 9px; padding: 3px; margin-bottom: 16px; }
.tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 7px; font: 500 14px var(--text); color: var(--ink-soft); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1px var(--rule); }
.tabs.small { margin: 0; }
.tabs.small button { padding: 4px 10px; font-size: 13px; }

/* Редактор */
.editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.back { color: var(--ink-soft); font-size: 14px; }
.editor-title { font-size: 26px; max-width: 30ch; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; margin-top: 18px; align-items: start; }
#count.warn { color: #9A6510; font-weight: 600; }
.warnings { margin: 10px 0 0; padding: 10px 14px 10px 30px; background: var(--amber-soft); border-radius: 8px; font-size: 14px; }
.warnings li + li { margin-top: 4px; }
.field-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.desc { min-height: 240px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.5; max-height: 560px; overflow: auto; }
.desc h2 { font-size: 20px; } .desc h3 { font-size: 16px; }
#desc-html { font: 13px/1.45 ui-monospace, Menlo, monospace; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.photos figure { position: relative; margin: 0; aspect-ratio: 1; background: #fff; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.photos figure.main { grid-column: span 3; aspect-ratio: 4 / 3; border-color: var(--spruce); }
.photos img { width: 100%; height: 100%; object-fit: contain; }
.photo-tools { position: absolute; top: 4px; right: 4px; display: flex; gap: 4px; }
.photo-tools button { width: 28px; height: 28px; border: 0; border-radius: 6px; background: rgba(28,40,48,.75); color: #fff; cursor: pointer; }
.upload { display: inline-block; }
.actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.actions .btn { text-align: center; }
.actions .link-btn { align-self: flex-start; }

/* Публикация и аккаунты */
.ok-box, .error-box { border-radius: 10px; padding: 12px 16px; margin: 0 0 16px; font-size: 14px; }
.ok-box { background: var(--spruce-soft); color: var(--spruce); }
.ok-box.big { font-size: 16px; font-weight: 600; }
.ok-box a { color: inherit; word-break: break-all; }
.error-box { background: #F6DCD6; color: #6E1F12; }
.error-box ul { margin: 6px 0 0; padding-left: 20px; }
.error-box li + li { margin-top: 6px; }
.error-box .muted { color: #8A4A3E; }
.btn-danger { background: var(--alert); }
.btn-danger:hover { background: #9A2F1E; }
.cat-results { list-style: none; margin: 8px 0 0; padding: 0; }
.cat-results button { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 9px 12px; margin-top: 6px; cursor: pointer; font: inherit; color: var(--ink); }
.cat-results button:hover { border-color: var(--spruce); }
.aspect-row.missing .a-value { border-color: var(--amber); background: var(--amber-soft); }
.account-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grid-policies { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.new-location { margin-top: 14px; }
.new-location .url-row { margin-top: 8px; max-width: 420px; }
.account-actions { display: flex; gap: 16px; align-items: center; margin-top: 16px; }
.connect-card { max-width: 640px; }

/* Продажи */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.page-head .tabs { margin-top: 6px; }
.section-title.flush { margin-top: 0; }
.figures-wide { grid-template-columns: repeat(3, 1fr); margin-bottom: 8px; }
.months ul { list-style: none; margin: 0; padding: 0; }
.months li { display: grid; grid-template-columns: 90px 1fr 100px 32px; gap: 12px; align-items: center; padding: 5px 0; }
.m-bar { height: 10px; background: var(--mist); border-radius: 5px; overflow: hidden; }
.m-bar span { display: block; height: 100%; background: var(--spruce); border-radius: 5px; }
.m-bar span.neg { background: var(--alert); }
.m-val { text-align: right; font-weight: 600; }
.m-n { text-align: right; }
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); }
table.orders { width: 100%; border-collapse: collapse; font-size: 14px; }
table.orders th { text-align: left; font-weight: 600; color: var(--ink-soft); font-size: 13px; padding: 10px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.orders td { padding: 10px 10px; border-top: 1px solid var(--rule); vertical-align: top; }
table.orders tbody tr:first-child td { border-top: 0; }
table.orders tr[data-order] { cursor: pointer; }
table.orders tr[data-order]:hover td { background: var(--mist); }
table.orders tr.is-hidden td { opacity: .55; }
.num { text-align: right; white-space: nowrap; }
.strong { font-weight: 600; }
.minus { color: #8A4A3E; }
.label-cost { color: #9A6510; font-weight: 600; }
.nowrap { white-space: nowrap; }
.c-title { max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-check { width: 36px; }
.c-check input { width: auto; margin: 0; }
.toolbar { display: flex; align-items: center; gap: 16px; margin: 0 0 12px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.toolbar .btn { margin: 0; }
label.inline { display: inline-flex; gap: 8px; align-items: center; color: var(--ink); }
label.inline input { width: auto; margin: 0; }
.read-only { margin-top: 14px; }

dialog.drawer { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(480px, 100vw); border: 0; border-left: 1px solid var(--rule); padding: 20px 24px 40px; background: var(--paper); color: var(--ink); overflow-y: auto; }
dialog.drawer::backdrop { background: rgba(28, 40, 48, .35); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-head h2 { font: 600 20px/1.2 var(--display); margin: 0; }
dialog.drawer h3 { font: 600 15px/1.3 var(--display); margin: 22px 0 8px; }
dl.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--ink-soft); }
dl.kv dd { margin: 0; }
ul.plain { list-style: none; padding: 0; margin: 0; font-size: 14px; }
ul.plain li + li { margin-top: 8px; }

.inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.threads { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); max-height: 70vh; overflow-y: auto; }
.threads li + li { border-top: 1px solid var(--rule); }
.thread { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; background: none; border: 0; padding: 12px 14px; cursor: pointer; font: inherit; color: var(--ink); }
.thread:hover { background: var(--mist); }
.thread.active { background: var(--spruce-soft); }
.t-top { display: flex; justify-content: space-between; gap: 8px; }
.t-item, .t-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { align-self: flex-start; margin-top: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--amber); color: var(--ink); }
.t-top .dot { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #D93A2F; color: #fff; font-size: 12px; font-weight: 700; margin-right: 6px; }
.t-top .dot.quiet { background: var(--mist); color: var(--ink-soft); border: 1px solid var(--rule); }
.thread.unread strong { font-weight: 800; }
.thread.unread .t-last { color: var(--ink); }
.badge.quiet { background: var(--mist); color: var(--ink-soft); }
.chat { border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); padding: 16px 18px; min-height: 300px; }
.chat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--rule); padding-bottom: 10px; }
.chat-head h2 { font: 600 18px/1.2 var(--display); margin: 0 0 2px; }
.bubbles { list-style: none; margin: 14px 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bubbles li { display: flex; flex-direction: column; max-width: 80%; gap: 3px; }
.bubbles li.mine { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 10px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--rule); font-size: 14px; line-height: 1.45; white-space: normal; }
.mine .bubble { background: var(--spruce); color: #fff; border-color: var(--spruce); }
.reply { border-top: 1px solid var(--rule); padding-top: 12px; }
.reply .btn { margin-top: 10px; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 8px; font-size: 14px;
  transition: opacity .2s, transform .2s; pointer-events: none; z-index: 20; max-width: min(560px, calc(100vw - 32px));
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast[data-kind="error"] { background: var(--alert); }

/* Телефон: разделы внизу экрана */
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 5;
    height: auto; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--rule);
  }
  .brand { display: none; }
  .rail nav { flex-direction: row; overflow-x: auto; gap: 4px; }
  .rail nav a { white-space: nowrap; font-size: 13px; padding: 8px 10px; }
  .rail nav .nav-sell { margin-top: 0; }
  .topbar { padding: 12px 16px; }
  .account-label, .me { display: none; }
  #view { padding: 24px 16px 96px; }
  h1 { font-size: 28px; }
  .money { grid-template-columns: 1fr; }
  .tag .value { font-size: 44px; }
  .figures { grid-template-columns: repeat(2, 1fr); }
  .figures div { border-left: 0; border-top: 1px solid var(--rule); }
  .figures div:nth-child(-n + 2) { border-top: 0; }
  .figures div:nth-child(even) { border-left: 1px solid var(--rule); }
  .url-row { flex-direction: column; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .editor { grid-template-columns: 1fr; }
  .grid-policies { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 1fr; }
  .threads { max-height: 40vh; }
  .figures-wide { grid-template-columns: 1fr 1fr; }
  .months li { grid-template-columns: 70px 1fr 90px; }
  .m-n { display: none; }
  dl.kv { grid-template-columns: 1fr; }
  .row-link { grid-template-columns: 40px 1fr auto; }
  .row-link .status { display: none; }
  #toast { bottom: 84px; }
}

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

/* Предложения цены в переписке */
.offer-box { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 10px; background: var(--mist); }
.offer-box h3 { margin: 0 0 8px; font-size: 15px; }
.offer-box p { margin: 4px 0; }
.offer + .offer { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule); }
.offer-price { color: var(--spruce); }
.offer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.offer-actions .counter { display: inline-flex; gap: 6px; align-items: center; }
.money-input { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); }
.money-input input { width: 90px; border: 0; padding: 8px 0; font: inherit; background: none; }
.offer-actions .grow { flex: 1 1 220px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 8px; font: inherit; }
.btn.ghost { background: var(--paper); color: var(--spruce); border: 1px solid var(--spruce); }
.btn.ghost:hover { background: var(--spruce-soft); }

/* Формат продажи и Best Offer в редакторе */
.editor [hidden] { display: none !important; }
.format-tabs { margin: 6px 0 10px; }
.format-tabs [disabled] { opacity: .6; cursor: default; }
.best-offer { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: auto; }
.bo-fields { margin-top: 8px; }

/* Страница входа */
.auth-page { min-height: 100vh; display: grid; place-items: start center; background: var(--mist); }
.auth { width: min(440px, calc(100vw - 32px)); padding: 48px 0; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 22px; color: var(--ink); }
.auth-brand .lang { margin-left: auto; }
.auth-card h1 { font-size: 26px; margin: 0 0 8px; }
.auth-form { display: grid; gap: 12px; margin-top: 12px; }
.auth-form label { display: grid; gap: 4px; font-weight: 600; font-size: 14px; }
.auth-form input { padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; font: inherit; background: var(--paper); }
.form-error { color: #B3261E; margin: 4px 0 0; }
.qr { display: grid; place-items: center; padding: 12px; background: #fff; border-radius: 10px; margin: 8px 0; }
.secret { font-size: 15px; letter-spacing: .5px; word-break: break-all; }
.codes { columns: 2; padding-left: 20px; font-size: 16px; line-height: 1.9; }
.topbar .logout { margin-left: 8px; }

.book-chip { display: inline-block; justify-self: start; margin-top: 2px; padding: 1px 8px; border-radius: 10px; background: var(--mist); border: 1px solid var(--rule); font-size: 12px; color: var(--ink-soft); }

.users { list-style: none; padding: 0; margin: 8px 0 16px; display: grid; gap: 6px; }
.invite-accounts { display: grid; gap: 6px; margin: 8px 0 12px; }
#invite-out .url-row input { flex: 1; }

/* Приглашённый пользователь: всё только для просмотра */
.viewer .editor input, .viewer .editor select, .viewer .editor textarea, .viewer .editor [contenteditable], .viewer .editor .chip, .viewer .format-tabs button { pointer-events: none; }
.viewer .editor select { opacity: .8; }
.chat-head .buyer-link { font: inherit; padding: 0; color: inherit; text-decoration-style: dotted; }
.cash-form { display: grid; gap: 10px; margin-top: 10px; } .cash-form input { width: 100%; }
.ship-form { display: grid; gap: 10px; margin-top: 8px; } .ship-form input, .ship-form select { width: 100%; }
.ship-form [hidden] { display: none; }
.msg-media { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.msg-media img { width: 140px; height: 140px; object-fit: cover; border-radius: 8px; display: block; }
.reply-photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.reply-thumb { position: relative; }
.reply-thumb img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; display: block; }
.reply-thumb .icon-btn { position: absolute; top: 2px; right: 2px; }
.reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reply-actions .attach { cursor: pointer; }
.promo-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 0 16px; }
