/* RadReport — сайт. Спокойный интерфейс: одна акцентная краска, много воздуха, главное действие — под большим пальцем. */

@font-face {
  font-family: "Onest";
  src: url("/fonts/onest-cyrillic.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  src: url("/fonts/onest-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #efeee9;
  --ink: #16171a;
  --ink-2: #5d5f66;
  --ink-3: #8f9198;
  --line: #e3e1da;
  --line-strong: #cfccc3;
  --accent: #0b7d72;
  --accent-ink: #ffffff;
  --accent-soft: #dcefec;
  --accent-text: #08675e;
  --rec: #d93a3f;
  --rec-soft: #fbe4e4;
  --warn-bg: #fdf3dc;
  --warn-line: #f0d9a0;
  --warn-ink: #7a5300;
  --shadow: 0 1px 2px rgb(20 20 15 / 0.05), 0 8px 24px -12px rgb(20 20 15 / 0.14);
  --shadow-lg: 0 24px 60px -20px rgb(20 20 15 / 0.3);
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 22px;
  --sidebar: 296px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0e10;
  --surface: #16181b;
  --surface-2: #1e2024;
  --ink: #edeef0;
  --ink-2: #a3a6ad;
  --ink-3: #6d7078;
  --line: #25282d;
  --line-strong: #353940;
  --accent: #35c9b6;
  --accent-ink: #04211d;
  --accent-soft: #11302c;
  --accent-text: #5fdccb;
  --rec: #f2555a;
  --rec-soft: #3a1719;
  --warn-bg: #2a2212;
  --warn-line: #4a3b18;
  --warn-ink: #f0c868;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px -12px rgb(0 0 0 / 0.6);
  --shadow-lg: 0 24px 60px -20px rgb(0 0 0 / 0.8);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Знак ── */

.logo {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background:
    linear-gradient(var(--accent-ink), var(--accent-ink)) 50% 50% / 2.5px 14px no-repeat,
    linear-gradient(var(--accent-ink), var(--accent-ink)) calc(50% - 6px) 50% / 2.5px 8px no-repeat,
    linear-gradient(var(--accent-ink), var(--accent-ink)) calc(50% + 6px) 50% / 2.5px 8px no-repeat,
    var(--accent);
}

.logo-lg {
  width: 56px;
  height: 56px;
  border-radius: 17px;
  background-size:
    4.5px 26px,
    4.5px 14px,
    4.5px 14px,
    auto;
  background-position:
    50% 50%,
    calc(50% - 11px) 50%,
    calc(50% + 11px) 50%,
    0 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-name {
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}

.boot .logo {
  animation: breathe 1.4s ease-in-out infinite;
}

@keyframes breathe {
  50% {
    transform: scale(0.92);
    opacity: 0.6;
  }
}

/* ── Кнопки ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: var(--r);
  font-weight: 550;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition:
    transform 0.15s var(--ease),
    background 0.15s,
    opacity 0.15s,
    box-shadow 0.15s;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 6px 16px -8px var(--accent);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-secondary {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.btn-secondary:hover {
  background: var(--surface-2);
}

.btn-ghost {
  color: var(--ink-2);
  padding: 0 12px;
}

.btn-ghost:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.btn-lg {
  min-height: 54px;
  padding: 0 22px;
  font-size: 17px;
  border-radius: 16px;
}

.btn-block {
  width: 100%;
}

.btn-grow {
  flex: 1;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  color: var(--ink-2);
  transition:
    background 0.15s,
    color 0.15s;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.icon-btn-solid {
  background: var(--ink);
  color: var(--bg);
  border-radius: 50%;
}

.icon-btn-solid:hover {
  background: var(--ink);
  color: var(--bg);
  opacity: 0.85;
}

.icon-btn-lg {
  width: 52px;
  height: 52px;
  border-radius: 50%;
}

.link {
  color: var(--accent-text);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 3px;
  cursor: pointer;
}

.link:hover {
  text-decoration-color: currentColor;
}

.small {
  font-size: 14px;
}

.hint {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.45;
}

.callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  text-align: left;
}

.callout > .icon {
  margin-top: 1px;
  color: var(--accent-text);
}

.callout-warn {
  background: var(--warn-bg);
  box-shadow: inset 0 0 0 1px var(--warn-line);
}

.callout-warn > .icon {
  color: var(--warn-ink);
}

.callout ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.callout .link {
  display: block;
  margin-top: 6px;
  text-align: left;
}

/* ── Вход ── */

.login {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(60% 50% at 50% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 560px;
  margin: auto 0;
  padding: 32px;
  background: var(--surface);
  border-radius: 28px;
  box-shadow:
    inset 0 0 0 1px var(--line),
    var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login h1 {
  margin-top: 10px;
  font-size: clamp(26px, 6vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 680;
  text-wrap: balance;
}

.lead {
  color: var(--ink-2);
  font-size: 17px;
  text-wrap: pretty;
}

.login-tg {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  margin-top: 6px;
  padding: 20px;
  border-radius: 20px;
  background: var(--bg);
}

.login-tg-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.login-tg-main .btn {
  width: 100%;
}

.login-tg-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 148px;
  text-align: center;
}

.login-tg-qr .hint {
  font-size: 12.5px;
}

.qr {
  width: 148px;
  height: 148px;
  padding: 6px;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.qr-lg {
  width: 232px;
  height: 232px;
  margin: 4px auto 0;
}

.code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.code {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: 0.18em;
  font-variant-numeric: tabular-nums;
}

.id-login {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  color: var(--ink-2);
  font-weight: 500;
  font-size: 15px;
  user-select: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary:hover {
  color: var(--ink);
}

summary .icon {
  transition: transform 0.2s var(--ease);
}

details[open] > summary .icon {
  transform: rotate(90deg);
}

.id-login form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
  outline: none;
  transition: box-shadow 0.15s;
}

.field textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.45;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.input-wrap {
  position: relative;
  display: block;
}

.input-wrap input {
  padding-right: 48px;
}

.input-wrap .icon-btn {
  position: absolute;
  right: 4px;
  top: 4px;
}

.form-error {
  color: var(--rec);
  font-size: 14px;
  font-weight: 500;
}

.login-foot {
  margin-top: 20px;
  color: var(--ink-2);
  font-size: 15px;
  text-align: center;
}

.bot-link.link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.bot-link.link .icon {
  width: 17px;
  height: 17px;
}

/* ── Каркас кабинета ── */

.app {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  height: 100%;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  padding: 16px 12px max(12px, env(safe-area-inset-bottom));
  border-right: 1px solid var(--line);
  background: var(--bg);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 8px 14px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border-radius: 11px;
  color: var(--ink-2);
  font-weight: 500;
  font-size: 15px;
  text-align: left;
  transition:
    background 0.12s,
    color 0.12s;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav-item[aria-current="page"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow:
    inset 0 0 0 1px var(--line),
    var(--shadow);
}

.badge {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12.5px;
  font-weight: 650;
  text-align: center;
}

.sidebar-title {
  margin: 18px 10px 6px;
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.history {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -6px;
  padding: 0 6px;
  scrollbar-width: thin;
}

.history-day {
  margin: 12px 10px 4px;
  color: var(--ink-3);
  font-size: 12.5px;
}

.history-day:first-child {
  margin-top: 2px;
}

.history-item {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border-radius: 11px;
  text-align: left;
  transition: background 0.12s;
}

.history-item:hover {
  background: var(--surface-2);
}

.history-item[aria-current="page"] {
  background: var(--surface);
  box-shadow:
    inset 0 0 0 1px var(--line),
    var(--shadow);
}

.history-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 550;
}

.history-item-top time {
  flex: none;
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.history-item-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.history-item-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.35;
}

.history-empty,
.history-note {
  padding: 0 10px;
  color: var(--ink-3);
  font-size: 13.5px;
  line-height: 1.4;
}

.history-empty {
  flex: 1;
}

.history-note {
  margin: 8px 0 4px;
  font-size: 12.5px;
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.user {
  position: relative;
  margin-top: 6px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  text-align: left;
  transition: background 0.12s;
}

.user-chip:hover,
.user-chip[aria-expanded="true"] {
  background: var(--surface-2);
}

.user-chip .icon {
  margin-left: auto;
  color: var(--ink-3);
  transform: rotate(-90deg);
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 650;
  font-size: 14px;
}

.user-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 550;
  font-size: 14.5px;
}

.menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 5;
  padding: 6px;
  border-radius: var(--r);
  background: var(--surface);
  box-shadow:
    inset 0 0 0 1px var(--line),
    var(--shadow-lg);
  animation: pop 0.16s var(--ease);
}

.menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 15px;
  text-align: left;
}

.menu button:hover {
  background: var(--surface-2);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 60px;
  padding: max(8px, env(safe-area-inset-top)) 16px 8px 24px;
  border-bottom: 1px solid var(--line);
}

.topbar-title {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 17px;
  font-weight: 620;
  letter-spacing: -0.015em;
}

.topbar-actions {
  display: flex;
  gap: 4px;
}

.only-mobile {
  display: none;
}

.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable both-edges;
}

.column {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

.scroll > .column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100%;
  padding-top: 24px;
  padding-bottom: 28px;
}

/* ── Переключатель исследования ── */

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface-2);
  overflow-x: auto;
  scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
  display: none;
}

.segmented button {
  flex: 1 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 14.5px;
  font-weight: 550;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s,
    box-shadow 0.15s;
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button[aria-checked="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

/* ── Диктовка ── */

.empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 0;
  text-align: center;
}

.empty h3 {
  font-size: clamp(24px, 5vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 660;
}

.empty > p {
  max-width: 460px;
  color: var(--ink-2);
  text-wrap: pretty;
}

.empty .callout {
  max-width: 460px;
  margin-top: 12px;
}

.fragments {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fragments:empty {
  display: none;
}

.fragment {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 14px 8px 14px 14px;
  border-radius: var(--r);
  background: var(--bg);
  animation: rise 0.28s var(--ease);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.fragment-n {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.fragment-n .icon {
  width: 15px;
  height: 15px;
}

.fragment-text {
  padding-top: 2px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.fragment-meta {
  display: block;
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 12.5px;
}

.fragment .icon-btn {
  width: 34px;
  height: 34px;
  margin-top: -3px;
  color: var(--ink-3);
}

.fragment.is-pending .fragment-text {
  color: var(--ink-2);
}

.fragment.is-error {
  background: var(--rec-soft);
}

.fragment.is-error .fragment-text {
  color: var(--rec);
}

.shimmer {
  display: inline-block;
  background: linear-gradient(90deg, var(--ink-3) 30%, var(--ink) 50%, var(--ink-3) 70%) 0 0 / 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 1.6s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.building {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--r);
  background: var(--accent-soft);
}

.spinner {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

/* ── Нижняя панель ── */

.dock {
  padding: 12px 0 max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.dock-idle {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 6px;
  border-radius: 28px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 0.15s;
}

.composer:focus-within {
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}

.composer .icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin-bottom: 4px;
}

.composer textarea {
  flex: 1;
  min-width: 0;
  max-height: 160px;
  margin: 0;
  padding: 14px 4px;
  border: 0;
  outline: none;
  background: none;
  resize: none;
  font-size: 16px;
  line-height: 1.5;
}

.composer textarea::placeholder {
  color: var(--ink-3);
}

.mic {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 20px -8px var(--accent);
  transition:
    transform 0.15s var(--ease),
    filter 0.15s;
}

.mic:hover {
  filter: brightness(1.07);
}

.mic:active {
  transform: scale(0.94);
}

.mic .icon {
  width: 24px;
  height: 24px;
  stroke-width: 1.9;
}

.mic[disabled] {
  opacity: 0.45;
  box-shadow: none;
}

/* Пустая диктовка: микрофон — герой экрана */
.dock.is-hero .composer {
  flex-wrap: wrap;
  justify-content: center;
  padding: 0;
  background: none;
  box-shadow: none;
  gap: 14px;
}

.dock.is-hero .mic {
  order: -1;
  width: 84px;
  height: 84px;
  margin: 4px calc(50% - 42px) 2px;
  box-shadow:
    0 0 0 10px color-mix(in srgb, var(--accent) 12%, transparent),
    0 16px 32px -12px var(--accent);
}

.dock.is-hero .mic .icon {
  width: 34px;
  height: 34px;
}

.dock.is-hero .composer textarea {
  padding: 13px 16px;
  border-radius: 24px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line);
}

.dock.is-hero .composer .icon-btn {
  margin-bottom: 3px;
}

.dock.is-hero {
  border-top-color: transparent;
}

.dock-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dock-rec {
  display: flex;
  align-items: center;
  gap: 12px;
  animation: rise 0.2s var(--ease);
}

.rec-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 18px;
  border-radius: 28px;
  background: var(--rec-soft);
}

.wave {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 48px;
}

.rec-time {
  flex: none;
  color: var(--rec);
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

.rec-time::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--rec);
  animation: blink 1.2s ease-in-out infinite;
}

@keyframes blink {
  50% {
    opacity: 0.25;
  }
}

.mic-stop {
  background: var(--rec);
  color: #fff;
  box-shadow: 0 8px 20px -8px var(--rec);
}

/* ── Протокол ── */

.report-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 14px;
}

.pill {
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 550;
}

.pill-accent {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.paper {
  padding: 28px 32px;
  border-radius: var(--r-lg);
  background: var(--bg);
  font-size: 16.5px;
  line-height: 1.62;
  user-select: text;
  -webkit-user-select: text;
}

.paper h4 {
  margin: 22px 0 6px;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.paper h4:first-child {
  margin-top: 0;
}

.paper p {
  margin: 0;
  overflow-wrap: anywhere;
}

.paper p + p {
  margin-top: 3px;
}

.paper .bullet {
  padding-left: 0.8em;
  text-indent: -0.8em;
}

.paper .indent {
  padding-left: 2.2em;
}

.paper b {
  font-weight: 680;
}

.paper .is-conclusion {
  font-size: 17.5px;
}

.transcript {
  padding: 14px 16px;
  border-radius: var(--r);
  box-shadow: inset 0 0 0 1px var(--line);
}

.transcript p {
  margin-top: 10px;
  color: var(--ink-2);
  white-space: pre-wrap;
  font-size: 15px;
}

/* ── Шаблоны ── */

.patterns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pattern {
  padding: 13px 16px;
  border-radius: var(--r);
  background: var(--bg);
}

.pattern summary {
  color: var(--ink);
  font-weight: 550;
}

.pattern summary span::before {
  content: attr(data-n);
  margin-right: 10px;
  color: var(--ink-3);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.pattern dl {
  margin: 12px 0 2px;
  display: grid;
  gap: 10px;
  font-size: 15px;
}

.pattern dt {
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pattern dd {
  margin: 2px 0 0;
  white-space: pre-wrap;
}

/* ── Журнал владельца ── */

.journal-stats {
  overflow-x: auto;
  padding: 6px 16px;
  border-radius: var(--r);
  background: var(--bg);
}

.journal-stats table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

.journal-stats th,
.journal-stats td {
  padding: 8px 14px 8px 0;
  text-align: left;
  white-space: nowrap;
}

.journal-stats th {
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.journal-stats tbody tr {
  box-shadow: inset 0 1px 0 var(--line);
}

.journal-stats .num {
  font-variant-numeric: tabular-nums;
}

.journal-id,
.journal-meta {
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 400;
}

.journal-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.journal-bar select {
  flex: 1;
  min-width: 0;
}

.journal-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  min-width: 0;
}

.journal-preview {
  flex-basis: 100%;
  color: var(--ink-2);
  font-size: 14.5px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journal-item[open] .journal-preview {
  display: none;
}

.pill-warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.journal-paper {
  margin-top: 12px;
  padding: 18px 20px;
  background: var(--surface);
  font-size: 15.5px;
}

.journal-part {
  display: flex;
  gap: 10px;
  white-space: pre-wrap;
}

.journal-paper .journal-meta {
  margin-top: 18px;
}

/* ── Окна и уведомления ── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(10 10 12 / 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade 0.18s;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 100%;
  overflow-y: auto;
  padding: 28px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: pop 0.22s var(--ease);
}

.modal-card h3 {
  margin: 0 36px 10px 0;
  font-size: 21px;
  letter-spacing: -0.02em;
  font-weight: 650;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

#modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#modal-body form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.steps {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-2);
  font-size: 15px;
}

.steps li + li {
  margin-top: 4px;
}

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(108px + env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 11px 18px;
  border-radius: 99px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: rise 0.25s var(--ease);
  text-align: center;
}

.toast.is-error {
  background: var(--rec);
  color: #fff;
  border-radius: 18px;
}

.scrim {
  display: none;
}

/* ── Телефон ── */

@media (max-width: 860px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .only-mobile {
    display: inline-grid;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: min(88vw, 340px);
    padding-top: max(16px, env(safe-area-inset-top));
    border-right: 0;
    transform: translateX(-104%);
    transition: transform 0.28s var(--ease);
  }

  .app.is-menu .sidebar {
    transform: none;
    box-shadow: var(--shadow-lg);
  }

  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 15;
    background: rgb(10 10 12 / 0.45);
    animation: fade 0.2s;
  }

  .topbar {
    padding-left: 8px;
    padding-right: 8px;
  }

  .column {
    padding: 0 16px;
  }

  .scroll > .column {
    padding-top: 16px;
  }

  .scroll {
    scrollbar-gutter: auto;
  }

  .paper {
    padding: 20px 18px;
    font-size: 16px;
  }

  .login-card {
    padding: 24px 20px;
    border-radius: 24px;
  }

  .login-tg {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .login-tg-qr {
    display: none;
  }

  .modal {
    place-items: end center;
    padding: 0;
  }

  .modal-card {
    max-width: none;
    padding: 24px 20px max(24px, env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
    animation: sheet 0.28s var(--ease);
  }

  @keyframes sheet {
    from {
      transform: translateY(100%);
    }
  }
}

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