:root {
  --navy-deep: #0F1E35;
  --navy: #1B2E4A;
  --navy-hover: #27405F;
  --gold: #C9A84C;
  --gold-soft: rgba(201, 168, 76, .12);
  --gold-line: rgba(201, 168, 76, .25);
  --text: #1F2937;
  --body: #475569;
  --muted: #64748B;
  --faint: #94A3B8;
  --border: #E2E8F0;
  --surface: #F8F9FB;
  --bg: #FFFFFF;
  --col: 45rem;
  --sidebar-w: 240px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--sans);
}

body { display: flex; }

button { font: inherit; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--navy-deep);
  border-right: 1px solid var(--gold-line);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform .2s ease-out;
}

.sidebar-head { padding: 1rem 1rem .45rem; }

.brand {
  display: flex; flex-direction: column; align-items: center; gap: .45rem;
  margin: .05rem 0 .65rem; padding: 0 .35rem;
}
.brand-logo {
  display: block; width: 100%; max-width: 196px; height: auto;
  aspect-ratio: 1920 / 460;
}
.brand-product {
  display: block; width: 100%; color: rgba(255, 255, 255, .86);
  font-size: .88rem; font-weight: 600; line-height: 1.3;
  letter-spacing: .025em; text-align: center;
}

.btn-new {
  display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid rgba(255, 255, 255, .15); border-radius: .4rem;
  background: rgba(255, 255, 255, .025); color: rgba(255, 255, 255, .72);
  font-size: .8rem; line-height: 1.25; padding: .3rem .48rem; cursor: pointer;
  white-space: nowrap; transition: border-color .15s, color .15s, background-color .15s;
}
.btn-new:hover { border-color: var(--gold); background: var(--gold-soft); color: var(--gold); }

.sidebar-body { flex: 1; overflow-y: auto; padding: .35rem 1rem .5rem; }
.dialog-section-head {
  display: flex; align-items: center; justify-content: space-between; gap: .55rem;
  margin: .35rem 0 .5rem; padding-bottom: .5rem;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.sidebar-caption {
  font-size: .8rem; line-height: 1.25; font-weight: 700;
  letter-spacing: .075em; text-transform: uppercase;
  color: rgba(255, 255, 255, .78); margin: 0;
}
.dialog-list { list-style: none; margin: 0 -.4rem; padding: 0; }
.dialog-item {
  display: flex; align-items: center;
  border-radius: .45rem;
  transition: background-color .15s;
}
.dialog-item:hover { background: rgba(255, 255, 255, .06); }
.dialog-item.active { background: var(--gold-soft); }
.dialog-open {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: .1rem;
  color: inherit; text-decoration: none;
  padding: .42rem .5rem .42rem .6rem;
}
/* Класс задаёт display:flex, поэтому hidden нужно усилить явно. */
.dialog-open[hidden] { display: none; }
.dialog-title {
  max-width: 100%;
  color: rgba(255, 255, 255, .75); font-size: .88rem; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dialog-item.active .dialog-title { color: var(--gold); }
.dialog-date { color: rgba(255, 255, 255, .3); font-size: .74rem; }
.dialog-delete {
  flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  color: rgba(255, 255, 255, .3); padding: .3rem .45rem;
  border-radius: .35rem; display: flex;
  opacity: 0; transition: opacity .15s, color .15s;
}
.dialog-item:hover .dialog-delete, .dialog-delete:focus { opacity: 1; }
.dialog-delete:hover { color: #E8927C; }
.dialog-rename {
  flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  color: rgba(255, 255, 255, .3); padding: .3rem .35rem;
  border-radius: .35rem; display: flex;
  opacity: 0; transition: opacity .15s, color .15s;
}
.dialog-item:hover .dialog-rename, .dialog-rename:focus { opacity: 1; }
.dialog-rename:hover { color: var(--gold); }
.rename-input {
  flex: 1; min-width: 0; margin: .3rem .1rem;
  font: inherit; font-size: .88rem; color: #fff;
  background: rgba(255, 255, 255, .1);
  border: 1px solid var(--gold); border-radius: .35rem; padding: .25rem .4rem;
  outline: none;
}

.sidebar-note {
  color: rgba(255, 255, 255, .35); font-size: .8rem; line-height: 1.55;
  margin-top: 1.1rem;
}

.politics-box {
  border-top: 1px solid var(--gold-line);
  padding: .8rem 1rem;
  display: flex; flex-direction: column; gap: .55rem;
}
/* Без этого display класса перекрывает стандартное правило [hidden]. */
.politics-box[hidden] { display: none; }
.politics-label {
  color: rgba(255, 255, 255, .55); font-size: .8rem; font-weight: 600;
}
.politics-toggle {
  width: 100%; min-height: 44px; padding: .65rem 1rem;
  border: 1px solid rgba(255, 255, 255, .2); border-radius: .5rem;
  background: rgba(255, 255, 255, .06); color: #fff;
  font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer;
  transition: border-color .15s, color .15s, background-color .15s;
}
.politics-toggle:hover { border-color: var(--gold); color: var(--gold); }
.politics-toggle:disabled { cursor: wait; opacity: .65; }
.politics-box.is-enabled { background: rgba(217, 119, 6, .14); }
.politics-box.is-enabled .politics-label { color: #F5B14C; }
.politics-box.is-enabled .politics-toggle {
  border-color: #D97706; background: #D97706; color: #fff;
}
.politics-box.is-enabled .politics-toggle:hover { background: #B45309; }

.sidebar-foot {
  border-top: 1px solid var(--gold-line);
  padding: .8rem 1rem;
  display: flex; flex-direction: column; gap: .25rem;
}
.sidebar-foot a {
  color: rgba(255, 255, 255, .35); font-size: .8rem; text-decoration: none;
  transition: color .15s;
}
.sidebar-foot a:hover { color: var(--gold); }

.backdrop {
  position: fixed; inset: 0; z-index: 35;
  background: rgba(27, 46, 74, .45);
}
.backdrop[hidden] { display: none; }

.workspace {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-width: 0;
}

.mobile-bar {
  display: none;
  align-items: center; gap: .6rem;
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.mobile-title { font-weight: 600; font-size: .9rem; color: var(--navy); }
.btn-icon {
  background: none; border: none; cursor: pointer; color: var(--faint);
  padding: .3rem; border-radius: .4rem; display: flex;
}
.btn-icon:hover { color: var(--navy); }

.chat {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 0 1.25rem;
}
.messages { max-width: var(--col); width: 100%; margin: 0 auto; padding: 1.25rem 0 .75rem; }

.hero { margin: auto; text-align: center; padding: 2.5rem 0; max-width: 34rem; }
.hero[hidden] { display: none; }
.hero-kicker {
  color: var(--gold); font-size: .72rem; letter-spacing: .08em;
  font-weight: 600; margin: 0 0 1rem;
}
.hero-title {
  font-family: var(--serif); font-weight: 600; font-size: 2.3rem;
  color: var(--navy); letter-spacing: -.01em; line-height: 1.15;
  margin: 0 0 .6rem;
}
.hero-sub { color: var(--muted); font-size: .92rem; margin: 0 0 1.6rem; }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.chip {
  border: 1px solid var(--border); border-radius: .45rem;
  background: var(--bg); color: var(--body);
  font-size: .82rem; padding: .42rem .9rem; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.chip:hover { border-color: var(--gold); color: var(--navy); }

.msg { padding: .55rem 0; }

.msg.user {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: .25rem;
}
.user-content { display: flex; justify-content: flex-end; align-items: flex-end; gap: .5rem; }
.msg.user .msg-time {
  font-size: .68rem; color: var(--faint); padding-bottom: .15rem;
  opacity: 0; transition: opacity .15s; white-space: nowrap;
}
.msg.user:hover .msg-time { opacity: 1; }
.msg.user .bubble {
  background: var(--navy); color: #fff;
  border-radius: 1.15rem; padding: .62rem 1rem;
  max-width: 85%; white-space: pre-wrap; overflow-wrap: break-word;
  font-size: .9rem;
}

.msg.assistant { padding: .8rem 0; }
.msg-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .55rem; }
.avatar {
  width: 1.9rem; height: 1.9rem; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold); color: var(--navy);
  font-size: .58rem; font-weight: 700; letter-spacing: .04em;
  border-radius: .28rem;
}
.msg-author { font-size: .78rem; color: var(--muted); }
.msg.assistant .msg-time {
  font-size: .68rem; color: var(--faint);
  opacity: 0; transition: opacity .15s;
}
.msg.assistant:hover .msg-time { opacity: 1; }

.msg-body {
  padding-left: 2.4rem;
  color: var(--body); font-size: .9rem;
  overflow-wrap: break-word;
}

.msg-body p { margin: .35rem 0; }
.msg-body p:first-child { margin-top: 0; }
.msg-body p:last-child { margin-bottom: 0; }
.msg-body ul, .msg-body ol { margin: .4rem 0; padding-left: 1.3rem; }
.msg-body li { margin: .15rem 0; }
.msg-body li::marker { color: var(--gold); font-weight: 600; }
.msg-body h3 {
  margin: .7rem 0 .3rem; font-size: .95rem; color: var(--navy); font-weight: 600;
}
.msg-body strong { color: var(--navy); }
.msg-body code {
  background: var(--surface); border-radius: .3rem; padding: .08rem .35rem;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .86em;
}
.msg-body pre {
  background: var(--surface); border: 1px solid var(--border); border-radius: .5rem;
  padding: .6rem .8rem; overflow-x: auto;
}
.msg-body pre code { background: none; padding: 0; }
.msg-body a { color: var(--navy); text-decoration-color: var(--gold); }
.msg-body a:hover { color: var(--gold); }
/* Широкая таблица прокручивается внутри ответа, не растягивая страницу. */
.msg-body .table-scroll { overflow-x: auto; margin: .5rem 0; }
.msg-body table { border-collapse: collapse; font-size: .88rem; min-width: 100%; }
.msg-body th, .msg-body td {
  border: 1px solid var(--border); padding: .3rem .55rem;
  text-align: left; vertical-align: top;
}
.msg-body th { background: var(--surface); color: var(--navy); font-weight: 600; }
.msg-body blockquote {
  margin: .5rem 0; padding: .1rem 0 .1rem .7rem;
  border-left: 2px solid var(--gold-line); color: var(--muted);
}
.msg-body hr {
  border: 0; border-top: 1px solid var(--border); margin: .8rem 0;
}

.msg-actions {
  display: flex; align-items: center; gap: .12rem;
  padding-left: 2.4rem; margin-top: .35rem; min-height: 1.8rem;
}
.user-actions {
  justify-content: flex-end; padding-left: 0; padding-right: .25rem;
  margin-top: 0;
}
.msg-action {
  width: 2rem; height: 2rem; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: .55rem;
  color: var(--faint); cursor: pointer;
  opacity: .68; transition: opacity .15s, color .15s, background-color .15s;
}
.msg:hover .msg-action, .msg-action:focus-visible { opacity: 1; }
.msg-action:hover { color: var(--navy); background: var(--surface); }
/* The flag keeps the row's grey; on hover or keyboard focus its cloth fills red. */
.msg-action .flag-cloth { fill: transparent; transition: fill .15s; }
.msg-action.btn-report:hover .flag-cloth,
.msg-action.btn-report:focus-visible:not(.quiet-focus) .flag-cloth { fill: #DC2626; }
.msg-action.copied { color: #16a34a; opacity: 1; }
.msg-action.copy-failed { color: #b91c1c; opacity: 1; }
.msg.failed .bubble {
  color: #713b3b; background: #fff1f1;
  border: 1px solid #e8bdbd; box-shadow: none;
}
.msg.failed-blocked .bubble { background: #fff1f1; border-color: #e6b6b6; color: #693535; }
.msg.failed-temporary .bubble {
  background: #fff8e6; border-color: #e6c979; color: #67480d;
}
.send-failed {
  width: min(85%, 34rem); display: flex; flex-direction: column;
  align-items: flex-end; gap: .35rem; color: #8a3434;
  font-size: .75rem; line-height: 1.4; margin-top: .35rem;
}
.send-failed-copy { display: flex; flex-direction: column; align-items: flex-end; }
.send-failed-title { color: #873838; font-size: .78rem; font-weight: 650; }
.send-failed-detail { color: #8e5050; text-align: right; }
.failed-blocked .send-failed-title { color: #7d3030; }
.failed-blocked .send-failed-detail { color: #8a4a4a; }
.failed-temporary .send-failed-title { color: #75520d; }
.failed-temporary .send-failed-detail { color: #806224; }
.failed-control-row {
  display: flex; align-items: center; justify-content: flex-end; gap: .2rem;
}
.failed-control-row .send-failed { width: auto; margin: 0; }
.failed-control-row .user-actions { margin: 0; padding: 0; }
.send-failed-actions { display: flex; justify-content: flex-end; gap: .4rem; }
.msg.failed.editing .send-failed { display: none; }
.msg.failed.editing .failed-control-row { display: none; }
.msg.failed.editing + .msg.assistant.unsaved { display: none; }
.msg.failed.editing .edit-box { margin-left: auto; }
.send-failed button {
  border: 1px solid #d9a3a3; background: #fff; color: #8e2424;
  border-radius: 999px; padding: .28rem .7rem; cursor: pointer;
}
.send-failed button:hover { background: #fff1f1; }

.msg.assistant.unsaved {
  margin-top: .25rem; padding: .85rem .95rem;
  background: #fff7f7; border: 1px solid #efd2d2; border-radius: 1rem;
}
.msg.assistant.unsaved.temporary {
  background: #fffbf0; border-color: #ead69a;
}
.msg.assistant.unsaved .msg-head { margin-bottom: .45rem; }
.unsaved-caption {
  margin-top: .75rem; padding-top: .6rem;
  border-top: 1px solid #efd7d7;
  color: #8a4d4d; font-size: .74rem; line-height: 1.45;
}

.msg.user.editing { width: 100%; }
.user-content[hidden], .user-actions[hidden] { display: none; }
.edit-box {
  width: 100%; max-width: 85%; display: flex; flex-direction: column; gap: .65rem;
  background: #FFFCF3; border: 1px solid rgba(201, 168, 76, .78);
  border-radius: 1.2rem; padding: .8rem;
  box-shadow: 0 0 0 3px var(--gold-soft), 0 .5rem 1.5rem rgba(15, 30, 53, .08);
  transition: border-color .15s, box-shadow .15s;
}
.edit-box:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 168, 76, .16), 0 .65rem 1.7rem rgba(15, 30, 53, .1);
}
.edit-box textarea {
  width: 100%; min-height: 0; overflow-y: hidden; overflow-anchor: none;
  resize: none; font: inherit; font-size: .9rem; line-height: 1.55;
  color: var(--text); background: transparent;
  border: 0; border-radius: .55rem; padding: .25rem .35rem; outline: none;
}
.edit-actions { display: flex; gap: .5rem; justify-content: flex-end; }
.btn-sm { font-size: .8rem; padding: .45rem 1rem; border-radius: 999px; }
.btn-ghost {
  background: none; border: 1px solid var(--border); color: var(--body);
  border-radius: .5rem; cursor: pointer; transition: border-color .15s, color .15s;
}
.btn-ghost:hover { border-color: var(--muted); color: var(--navy); }

.btn-send.stop { background: var(--gold); color: var(--navy); }
.btn-send.stop svg { display: none; }
.btn-send.stop::before {
  content: ""; width: .8rem; height: .8rem; border-radius: .15rem; background: currentColor;
}
.btn-send.stop:disabled { background: var(--gold); color: var(--navy); opacity: .65; }

.sources {
  margin-top: .8rem; padding-top: .7rem;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: .45rem;
}
.sources-label {
  font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint);
}
.source-item { display: flex; gap: .55rem; align-items: baseline; font-size: .78rem; }
.source-num { color: var(--gold); font-weight: 600; flex-shrink: 0; }
.source-item a {
  color: var(--navy); text-decoration: none; word-break: break-word;
  transition: color .15s;
}
.source-item a:hover { color: var(--gold); }

.msg.system .notice {
  background: #FDF6E7; border: 1px solid var(--gold-line); color: #6B5316;
  border-radius: .55rem; padding: .55rem .9rem; font-size: .84rem;
  max-width: 85%;
}
.notice-action {
  border: 1px solid var(--gold-line); background: transparent; color: #6B5316;
  border-radius: 999px; padding: .2rem .65rem; margin-left: .6rem;
  font-size: .78rem; cursor: pointer; transition: background-color .15s;
}
.notice-action:hover { background: var(--gold-soft); }

body.busy .btn-new, body.busy .dialog-open, body.busy .dialog-rename,
body.busy .dialog-delete, body.busy .chip,
body.dialog-switching .btn-new, body.dialog-switching .dialog-open,
body.dialog-switching .dialog-rename, body.dialog-switching .dialog-delete {
  opacity: .45; cursor: not-allowed;
}

.typing { display: flex; align-items: center; gap: .6rem; padding: .2rem 0; }
.typing-dots { display: flex; gap: .3rem; }
.typing-dots span {
  width: .38rem; height: .38rem; border-radius: 50%; background: var(--gold);
  animation: typingPulse 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .16s; }
.typing-dots span:nth-child(3) { animation-delay: .32s; }
@keyframes typingPulse {
  0%, 100% { opacity: .25; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1); }
}
.typing-status { color: var(--muted); font-size: .8rem; }

.scroll-bottom {
  position: fixed; right: 1.9rem; bottom: 8.2rem; z-index: 30;
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--gold); color: var(--navy); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(201, 168, 76, .4);
  opacity: .9; transition: transform .15s, opacity .15s;
}
.scroll-bottom:hover { transform: scale(1.08); opacity: 1; }
.scroll-bottom[hidden] { display: none; }

.composer-area { padding: .5rem 1.25rem calc(.8rem + env(safe-area-inset-bottom)); }
.composer {
  max-width: var(--col); margin: 0 auto;
  display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto;
  align-items: end; gap: .45rem;
  background: var(--bg);
  border: 1.5px solid var(--border); border-radius: 1.5rem;
  padding: .45rem .5rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .03);
  transition: border-color .15s, box-shadow .15s, border-radius .15s;
}
.composer:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft), 0 6px 24px rgba(0, 0, 0, .08);
}

.info-wrap {
  position: relative; display: flex; align-self: center; justify-self: center;
  grid-column: 1;
}
.btn-info {
  background: none; border: none; cursor: default; padding: .25rem;
  color: #CBD5E1; display: flex; border-radius: 50%; transition: color .15s;
}
.info-wrap:hover .btn-info, .btn-info:focus { color: var(--faint); }
.tooltip {
  position: absolute; bottom: calc(100% + .55rem); left: -.3rem;
  width: 16rem; background: var(--navy); color: rgba(255, 255, 255, .85);
  font-size: .74rem; line-height: 1.5; padding: .6rem .75rem;
  border-radius: .5rem; box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
  visibility: hidden; opacity: 0; transition: opacity .15s; z-index: 50;
}
.tooltip::after {
  content: ""; position: absolute; top: 100%; left: 1rem;
  border: .35rem solid transparent; border-top-color: var(--navy);
}
.info-wrap:hover .tooltip, .btn-info:focus + .tooltip {
  visibility: visible; opacity: 1;
}

#input {
  grid-column: 2; display: block; min-width: 0; width: 100%;
  height: 2.2rem; min-height: 2.2rem;
  max-height: clamp(140px, 42vh, 360px);
  max-height: clamp(140px, 42dvh, 360px);
  overflow-y: hidden;
  border: none; outline: none; resize: none;
  font: inherit; font-size: .9rem; color: var(--text); background: none;
  line-height: 1.5; padding: .4rem .15rem .3rem;
}
#input::placeholder { color: var(--faint); }

.composer.multiline {
  grid-template-rows: minmax(2.2rem, auto) 2.2rem;
  border-radius: 1.15rem;
}
.composer.multiline #input {
  grid-row: 1; grid-column: 1 / -1;
  padding: .4rem .55rem .5rem;
}
.composer.multiline .info-wrap { grid-row: 2; grid-column: 1; }
.composer.multiline .btn-send { grid-row: 2; grid-column: 3; }

.btn-send {
  grid-column: 3;
  background: var(--navy); color: #fff; border: none; cursor: pointer;
  width: 2.2rem; height: 2.2rem; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background-color .15s;
}
.btn-send:hover { background: var(--gold); color: var(--navy); }
.btn-send:disabled { background: #CBD5E1; color: #fff; cursor: default; }

.footnote {
  max-width: var(--col); margin: .6rem auto 0;
  padding: 0 .5rem;
  font-size: .75rem; line-height: 1.45; color: var(--muted); text-align: center;
}
.msg.assistant.unsaved.temporary .unsaved-caption {
  border-top-color: #eadfb8; color: #755d27;
}
/* Used with .btn-sm, which sets the size. */
.btn-primary {
  background: var(--navy); color: #fff; border: none; cursor: pointer;
  font-weight: 600; transition: background-color .15s, color .15s;
}
.btn-primary:hover { background: var(--gold); color: var(--navy); }

/* «Сообщить о проблеме». */
.report-backdrop {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; overflow-y: auto;
  background: rgba(15, 30, 53, .45);
}
.report-backdrop[hidden] { display: none; }
.report-dialog {
  width: 100%; max-width: 28rem; margin: auto;
  display: flex; flex-direction: column; gap: .8rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: 1rem;
  padding: 1.15rem 1.15rem 1rem;
  box-shadow: 0 1.2rem 3rem rgba(15, 30, 53, .25);
  outline: none;
}
.report-title { margin: 0; font-size: 1.02rem; font-weight: 650; color: var(--navy); }
.report-text {
  width: 100%; min-height: 7.5rem; resize: vertical;
  font: inherit; font-size: .9rem; line-height: 1.5; color: var(--text);
  background: var(--bg); border: 1px solid #CBD5E1; border-radius: .65rem;
  padding: .55rem .7rem; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.report-text::placeholder { color: var(--faint); }
.report-text:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(27, 46, 74, .12); }
.report-text[readonly] { background: var(--surface); color: var(--muted); }
.report-error { margin: -.2rem 0 0; color: #B91C1C; font-size: .8rem; line-height: 1.4; }
.report-error[hidden] { display: none; }
.report-actions { display: flex; justify-content: space-between; gap: .75rem; }
/* Свои кнопки, а не .btn-primary/.btn-ghost: окно бело-синее, и «Отправить»
   при наведении остаётся синей, а не золотой. */
.report-cancel, .report-send {
  min-height: 2.4rem; padding: .45rem 1.15rem; border-radius: 999px;
  font-size: .86rem; font-weight: 600; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s, opacity .15s;
}
.report-cancel { background: #F1F5F9; color: var(--body); border: 1px solid var(--border); }
.report-cancel:hover { background: var(--border); color: var(--navy); }
.report-send { background: var(--navy); color: #fff; border: 1px solid var(--navy); }
.report-send:hover { background: var(--navy-hover); border-color: var(--navy-hover); }
.report-cancel:focus-visible, .report-send:focus-visible {
  outline: 2px solid var(--navy); outline-offset: 2px;
}
.report-send:disabled {
  background: #CBD5E1; border-color: #CBD5E1; color: #fff; cursor: not-allowed;
}
.report-cancel:disabled { opacity: .55; cursor: not-allowed; }
.report-dialog[aria-busy="true"] .report-send {
  background: var(--navy); border-color: var(--navy); opacity: .7; cursor: progress;
}

/* Уведомление не перехватывает щелчки по тому, что под ним. */
.toast-region {
  position: fixed; left: 50%; bottom: 6.5rem; z-index: 70;
  transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 2rem);
  pointer-events: none;
}
.toast {
  background: var(--navy); color: #fff;
  font-size: .84rem; line-height: 1.4; padding: .55rem 1rem; border-radius: .6rem;
  box-shadow: 0 6px 20px rgba(15, 30, 53, .22);
  animation: toastIn .18s ease-out;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(.4rem); }
  to { opacity: 1; transform: translateY(0); }
}

/* Тонкие полосы прокрутки в цветах страницы. Chromium и Safari рисуют их по
   ::-webkit-scrollbar; стандартные свойства только для остальных браузеров:
   в Chromium они отключают ::-webkit-scrollbar, а без него не убрать
   системные стрелки. */
.sidebar-body::-webkit-scrollbar, .chat::-webkit-scrollbar { width: 8px; }
.sidebar-body::-webkit-scrollbar-button, .chat::-webkit-scrollbar-button { display: none; }
.sidebar-body::-webkit-scrollbar-track, .chat::-webkit-scrollbar-track { background: transparent; }
.sidebar-body::-webkit-scrollbar-corner, .chat::-webkit-scrollbar-corner { background: transparent; }
.sidebar-body::-webkit-scrollbar-thumb, .chat::-webkit-scrollbar-thumb {
  border: 2px solid transparent; border-radius: 999px; background-clip: padding-box;
}
.sidebar-body::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, .16); }
.sidebar-body::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, .3); }
.chat::-webkit-scrollbar-thumb { background-color: #D5DCE5; }
.chat::-webkit-scrollbar-thumb:hover { background-color: var(--faint); }
@supports not selector(::-webkit-scrollbar) {
  .sidebar-body { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .16) transparent; }
  .sidebar-body:hover { scrollbar-color: rgba(255, 255, 255, .3) transparent; }
  .chat { scrollbar-width: thin; scrollbar-color: #D5DCE5 transparent; }
  .chat:hover { scrollbar-color: var(--faint) transparent; }
}

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  /* На сенсорном экране действия нельзя скрывать до наведения. */
  .dialog-rename, .dialog-delete { opacity: .65; }
  .workspace { margin-left: 0; }
  .mobile-bar { display: flex; }
  .hero-title { font-size: 1.8rem; }
  .scroll-bottom { right: 1.1rem; }
  /* iOS увеличивает страницу при фокусе на поле со шрифтом мельче 16px. */
  #input, .edit-box textarea, .rename-input, .report-text { font-size: 16px; }
}
