:root {
  color-scheme: dark;

  --bg-1: #090b10;
  --bg-2: #10141d;

  --card: rgba(18, 23, 33, 0.92);
  --card-border: rgba(255, 255, 255, 0.08);

  --text: #edf1f7;
  --muted: #9aa5b5;

  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(255, 255, 255, 0.09);
  --surface-strong-hover: rgba(255, 255, 255, 0.14);

  --border-soft: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.14);

  --input-bg: rgba(255, 255, 255, 0.06);
  --input-border: rgba(255, 255, 255, 0.12);

  --selected-border: rgba(125, 211, 252, 0.65);
  --selected-bg: rgba(125, 211, 252, 0.08);

  --danger-border: rgba(244, 63, 94, 0.35);
  --danger-text: #fda4af;
  --danger-hover: rgba(244, 63, 94, 0.12);

  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

[data-theme="light"] {
  color-scheme: light;

  --bg-1: #f5f8fd;
  --bg-2: #e9eef7;

  --card: rgba(255, 255, 255, 0.92);
  --card-border: rgba(15, 23, 42, 0.08);

  --text: #101828;
  --muted: #5d6778;

  --surface: rgba(15, 23, 42, 0.04);
  --surface-hover: rgba(15, 23, 42, 0.07);
  --surface-strong: rgba(15, 23, 42, 0.08);
  --surface-strong-hover: rgba(15, 23, 42, 0.12);

  --border-soft: rgba(15, 23, 42, 0.08);
  --border-medium: rgba(15, 23, 42, 0.18);

  --input-bg: #ffffff;
  --input-border: rgba(15, 23, 42, 0.16);

  --selected-border: rgba(2, 132, 199, 0.55);
  --selected-bg: rgba(2, 132, 199, 0.08);

  --danger-border: rgba(220, 38, 38, 0.4);
  --danger-text: #b91c1c;
  --danger-hover: rgba(220, 38, 38, 0.08);

  --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;

  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;

  color: var(--text);

  background:
    radial-gradient(
      circle at top left,
      rgba(56, 189, 248, 0.12),
      transparent 30%
    ),
    radial-gradient(
      circle at top right,
      rgba(244, 63, 94, 0.1),
      transparent 28%
    ),
    linear-gradient(
      160deg,
      var(--bg-1),
      var(--bg-2)
    );

  padding: 12px;
}

.app {
  width: 100%;

  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 24px;

  backdrop-filter: blur(16px);
}

.sidebar {
  position: sticky;
  top: 12px;

  min-height: calc(100vh - 24px);

  display: grid;
  gap: 18px;
  align-content: start;
}

.brand {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.sidebar-note {
  margin: 0;

  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.tabs {
  display: grid;
  gap: 10px;
}

.theme-toggle {
  margin-top: auto;
}

.tab-button {
  width: 100%;
  padding: 14px 16px;

  border: 1px solid transparent;
  border-radius: 16px;

  background: transparent;
  color: var(--text);

  font-size: 15px;
  font-weight: 600;
  text-align: left;

  cursor: pointer;

  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

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

.tab-button.active {
  background: var(--surface-strong);
  border-color: var(--card-border);
}

.content {
  min-width: 0;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  gap: 16px;
}

.split-layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.section-title {
  margin: 0 0 18px;

  font-size: 24px;
  font-weight: 700;
}

.timer {
  margin-bottom: 22px;

  text-align: center;
  font-size: clamp(42px, 7vw, 64px);
  font-weight: 800;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.timer.active {
  color: #f43f5e;
  text-shadow: 0 0 24px rgba(244, 63, 94, 0.35);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.72;
  }

  100% {
    opacity: 1;
  }
}

.controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.name-field {
  margin-top: 18px;

  display: grid;
  gap: 8px;
}

.name-label {
  color: var(--muted);
  font-size: 13px;
}

.name-input,
.rename-input {
  width: 100%;

  padding: 12px 14px;

  border: 1px solid var(--input-border);
  border-radius: 14px;

  background: var(--input-bg);

  color: var(--text);
  font-size: 14px;

  outline: none;
}

.name-input:focus,
.rename-input:focus {
  border-color: var(--selected-border);
}

.name-input::placeholder,
.rename-input::placeholder {
  color: var(--muted);
}

.btn {
  border: none;
  outline: none;

  border-radius: 14px;
  padding: 13px 18px;

  font-size: 15px;
  font-weight: 600;
  color: var(--text);

  cursor: pointer;

  transition:
    transform 0.16s ease,
    opacity 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline: 2px solid var(--selected-border);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.btn-record {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #04150a;
  box-shadow: 0 12px 30px rgba(34, 197, 94, 0.18);
}

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

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-strong-hover);
}

.btn-danger {
  background: linear-gradient(135deg, #f43f5e, #dc2626);
  color: white;
  box-shadow: 0 12px 30px rgba(244, 63, 94, 0.18);
}

.status {
  margin-top: 18px;

  min-height: 22px;

  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.recordings-list {
  display: grid;
  gap: 12px;
}

.recording,
.list-item {
  width: 100%;

  display: grid;
  gap: 6px;

  padding: 16px;

  border: 1px solid var(--border-soft);
  border-radius: 18px;

  background: var(--surface);

  color: var(--text);
  text-align: left;

  cursor: pointer;
}

.recording {
  grid-template-columns: auto 1fr auto auto;
  grid-template-areas: "play info rename delete";
  align-items: center;
  gap: 12px;

  cursor: default;
}

.btn-play {
  grid-area: play;
}

.recording-info {
  grid-area: info;
  min-width: 0;
}

.btn-rename {
  grid-area: rename;
}

.btn-delete {
  grid-area: delete;
}

.list-item:hover,
.recording:hover {
  background: var(--surface-hover);
}

.list-item.selected {
  border-color: var(--selected-border);
  background: var(--selected-bg);
}

.list-title,
.recording-title {
  font-weight: 600;
  font-size: 15px;
}

.list-meta,
.recording-meta {
  color: var(--muted);
  font-size: 13px;
}

.list-state {
  color: var(--muted);
  font-size: 13px;
}

.btn-play {
  width: 46px;
  height: 46px;
  padding: 0;

  border-radius: 50%;

  background: var(--surface-strong);
  font-size: 16px;
}

.btn-play:hover:not(:disabled) {
  background: var(--surface-strong-hover);
}

.btn-rename {
  background: transparent;
  border: 1px solid var(--border-medium);
  color: var(--muted);

  border-radius: 12px;
  padding: 10px 12px;
}

.btn-rename:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text);
}

.btn-delete {
  background: transparent;
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}

.btn-delete:hover:not(:disabled) {
  background: var(--danger-hover);
}

.empty {
  padding: 20px 0;

  text-align: center;
  color: var(--muted);
}

.detail-card {
  min-height: 420px;
}

.detail-title {
  margin: 0 0 18px;

  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;

  margin-bottom: 12px;
}

.text-output {
  min-height: 220px;

  padding: 18px;

  border-radius: 18px;
  border: 1px solid var(--border-soft);

  background: var(--surface);

  white-space: pre-wrap;
  line-height: 1.6;
}

.text-output:empty::before {
  content: "Текст пока не распознан";
  color: var(--muted);
}

@media (max-width: 1000px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

  .theme-toggle {
    margin-top: 0;
  }

  .split-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .card {
    padding: 20px;
    border-radius: 22px;
  }

  .recording {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "play info info"
      "rename rename delete";
  }

  .btn-delete {
    width: 100%;
  }
}

.theme-row {
  margin-top: auto;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.theme-row-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.switch {
  position: relative;

  display: inline-block;

  width: 52px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;

  border-radius: 999px;

  background: var(--surface-strong);
  border: 1px solid var(--border-medium);

  cursor: pointer;

  transition: background 0.2s ease;
}

.slider::before {
  content: "";

  position: absolute;

  width: 22px;
  height: 22px;
  left: 3px;
  top: 50%;

  transform: translateY(-50%);

  border-radius: 50%;
  background: #ffffff;

  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);

  transition: transform 0.2s ease;
}

[data-theme="light"] .slider::before {
  background: #101828;
}

.switch input:checked + .slider::before {
  transform: translate(24px, -50%);
}

.text-editor {
  width: 100%;
  min-height: 220px;

  padding: 18px;

  border: 1px solid var(--input-border);
  border-radius: 18px;

  background: var(--input-bg);

  color: var(--text);

  font: inherit;
  line-height: 1.6;

  resize: vertical;
  outline: none;
}

.text-editor:focus {
  border-color: var(--selected-border);
}

#notesOutput:empty::before {
  content: "Конспекта пока нет";
}

.spinner {
  display: inline-block;

  width: 12px;
  height: 12px;
  margin-right: 8px;

  vertical-align: -2px;

  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;

  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.list-state.processing {
  color: var(--muted);
}

.select {
  padding: 10px 12px;

  border: 1px solid var(--input-border);
  border-radius: 12px;

  background: var(--input-bg);

  color: var(--text);
  font-size: 14px;

  outline: none;
  cursor: pointer;
}

.select:focus {
  border-color: var(--selected-border);
}

.summary-content {
  white-space: normal;
}

.summary-content h2,
.summary-content h3,
.summary-content h4 {
  margin: 18px 0 10px;

  line-height: 1.3;
}

.summary-content h2 {
  font-size: 20px;
}

.summary-content h3 {
  font-size: 17px;
}

.summary-content h4 {
  font-size: 15px;
}

.summary-content p {
  margin: 0 0 10px;
}

.summary-content ul,
.summary-content ol {
  margin: 0 0 12px;
  padding-left: 22px;
}

.summary-content li {
  margin: 4px 0;
}

.summary-content strong {
  color: var(--text);
}

.drop-zone {
  display: grid;
  gap: 10px;
  justify-items: center;

  padding: 40px 20px;

  border: 2px dashed var(--border-medium);
  border-radius: 20px;

  text-align: center;

  transition: border-color 0.2s ease, background 0.2s ease;
}

.drop-zone.dragover {
  border-color: var(--selected-border);
  background: var(--selected-bg);
}

.drop-zone.success {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

.drop-zone-icon {
  font-size: 40px;
}

.drop-zone-text {
  margin: 0;

  font-weight: 600;
}

.drop-zone-hint,
.drop-zone-limit {
  margin: 0;

  color: var(--muted);
  font-size: 13px;
}

.drop-zone-limit {
  font-size: 12px;
}

.upload-queue {
  display: grid;
  gap: 12px;

  margin-top: 16px;
}

.upload-item {
  display: grid;
  gap: 10px;

  padding: 14px;

  border: 1px solid var(--border-soft);
  border-radius: 16px;

  background: var(--surface);
}

.upload-item.done {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.08);
}

.upload-item.error {
  border-color: var(--danger-border);
  background: var(--danger-hover);
}

.upload-item-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-name-input {
  flex: 1;
}

.upload-size {
  color: var(--muted);
  font-size: 12px;

  white-space: nowrap;
}

.upload-progress {
  height: 6px;

  border-radius: 999px;

  background: var(--surface-strong);

  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  width: 0%;

  background: linear-gradient(90deg, #38bdf8, #6366f1);

  transition: width 0.15s ease;
}

.upload-item.done .upload-progress-bar {
  background: #22c55e;
}

.upload-status {
  min-height: 16px;

  color: var(--muted);
  font-size: 12px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  margin-bottom: 14px;
}

.filter-button {
  padding: 8px 14px;

  border: 1px solid var(--border-medium);
  border-radius: 999px;

  background: transparent;

  color: var(--muted);

  font-size: 13px;
  font-weight: 600;

  cursor: pointer;
}

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

.filter-button.active {
  background: var(--surface-strong);
  border-color: var(--card-border);
  color: var(--text);
}

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;

  width: fit-content;

  margin-top: 6px;
  padding: 2px 8px;

  border: 1px solid var(--border-soft);
  border-radius: 999px;

  color: var(--muted);
  font-size: 11px;
}

.processing-row {
  margin-top: 16px;
}

.notifications {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notification {
  padding: 12px 20px;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: var(--text);
  font-size: 14px;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

[hidden] {
  display: none !important;
}

.app-menu {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
}

.app-menu-details {
  position: relative;
}

.app-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 10px 16px;

  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--shadow);

  color: var(--text);
  font-size: 14px;
  font-weight: 600;

  cursor: pointer;

  list-style: none;
}

.app-menu-button::-webkit-details-marker {
  display: none;
}

.app-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;

  display: grid;
  gap: 4px;

  min-width: 180px;
  padding: 8px;

  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.app-menu-item {
  padding: 10px 12px;

  border-radius: 10px;

  color: var(--text);
  font-size: 14px;
  font-weight: 600;

  text-decoration: none;
}

.app-menu-item:hover {
  background: var(--surface-hover);
}

.app-menu-item.active {
  background: var(--surface-strong);
}

.notifications {
  top: 70px;
}

.create-note-button {
  width: 100%;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 16px;

  background: rgba(0, 0, 0, 0.55);
}

.modal {
  width: 100%;
  max-width: 420px;

  display: grid;
  gap: 14px;
}

.modal-field {
  display: grid;
  gap: 6px;
}

.field-error {
  min-height: 16px;

  color: #fda4af;
  font-size: 12px;
}

.input-invalid {
  border-color: rgba(244, 63, 94, 0.65) !important;
  background: rgba(244, 63, 94, 0.08) !important;
}

.saved-indicator {
  margin: 0 0 12px;

  min-height: 16px;

  color: var(--muted);
  font-size: 12px;
}

.notes-content {
  min-height: 320px;
}

.note-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;

  padding: 14px;

  border: 1px solid var(--border-soft);
  border-radius: 16px;

  background: var(--surface);
}

.note-item.selected {
  border-color: var(--selected-border);
  background: var(--selected-bg);
}

.note-select {
  display: grid;
  gap: 4px;

  min-width: 0;

  border: none;
  background: transparent;

  color: inherit;
  text-align: left;

  cursor: pointer;
}

.note-item .btn-rename,
.note-item .btn-delete {
  grid-area: auto;
}

.wallet-action-button {
  width: 100%;
}

.wallet-accounts {
  display: grid;
  gap: 8px;
}

.wallet-account {
  display: flex;
  align-items: center;
  gap: 10px;

  width: 100%;
  padding: 12px 14px;

  border: 1px solid var(--border-soft);
  border-radius: 14px;

  background: var(--surface);

  color: var(--text);
  text-align: left;

  cursor: pointer;
}

.wallet-account.active {
  border-color: var(--selected-border);
  background: var(--selected-bg);
}

.wallet-account-icon {
  font-size: 18px;
}

.wallet-account-name {
  flex: 1;
  min-width: 0;

  font-weight: 600;
  font-size: 14px;
}

.wallet-account-balance {
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.wallet-summary-card {
  display: grid;
  gap: 14px;
}

.wallet-total {
  font-size: 34px;
  font-weight: 800;
}

.wallet-month-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.wallet-stat {
  flex: 1;
  min-width: 160px;

  display: grid;
  gap: 4px;

  padding: 12px 14px;

  border: 1px solid var(--border-soft);
  border-radius: 14px;

  background: var(--surface);

  color: var(--muted);
  font-size: 13px;
}

.wallet-stat strong {
  font-size: 16px;
  color: var(--text);
}

.wallet-stat.income strong {
  color: #34d399;
}

.wallet-stat.expense strong {
  color: #fda4af;
}

.wallet-month-nav {
  display: flex;
  align-items: center;
  gap: 12px;

  margin-bottom: 16px;
}

.wallet-month-label {
  min-width: 140px;

  text-align: center;

  font-weight: 700;
  font-size: 16px;
}

.wallet-analytics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.wallet-donut-wrap {
  width: 160px;
  height: 160px;
}

.donut-center {
  fill: var(--text);
  font-size: 5px;
  font-weight: 700;
}

.wallet-top {
  flex: 1;
  min-width: 220px;

  display: grid;
  gap: 8px;
}

.wallet-top-item {
  display: flex;
  align-items: center;
  gap: 10px;

  font-size: 14px;
}

.wallet-top-item .dot {
  width: 10px;
  height: 10px;

  border-radius: 50%;
}

.wallet-top-item .name {
  flex: 1;
}

.wallet-top-item .sum {
  font-weight: 700;
}

.wallet-top-item .percent {
  width: 48px;

  text-align: right;

  color: var(--muted);
}

.wallet-tx-list {
  display: grid;
  gap: 10px;
}

.wallet-tx-group-title {
  margin: 6px 0 2px;

  color: var(--muted);
  font-size: 13px;
}

.wallet-tx {
  display: flex;
  align-items: center;
  gap: 12px;

  width: 100%;
  padding: 12px 14px;

  border: 1px solid var(--border-soft);
  border-radius: 14px;

  background: var(--surface);

  color: var(--text);
  text-align: left;

  cursor: pointer;
}

.wallet-tx:hover {
  background: var(--surface-hover);
}

.wallet-tx-icon {
  font-size: 20px;
}

.wallet-tx-info {
  flex: 1;
  min-width: 0;

  display: grid;
  gap: 2px;
}

.wallet-tx-title {
  font-weight: 600;
  font-size: 14px;
}

.wallet-tx-sub {
  color: var(--muted);
  font-size: 12px;
}

.wallet-tx-amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.wallet-tx-amount.income {
  color: #34d399;
}

.wallet-tx-amount.expense {
  color: #fda4af;
}

.wallet-tx-amount.neutral {
  color: var(--muted);
}

.wallet-detail-body {
  display: grid;
  gap: 8px;

  margin-bottom: 16px;

  font-size: 14px;
}

.wallet-detail-body p {
  margin: 0;
}

.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-dot {
  width: 26px;
  height: 26px;

  border: 2px solid transparent;
  border-radius: 50%;

  cursor: pointer;
}

.color-dot.selected {
  border-color: var(--text);
}

.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.icon-picker button {
  padding: 6px 8px;

  border: 1px solid var(--border-soft);
  border-radius: 10px;

  background: var(--surface);

  font-size: 18px;

  cursor: pointer;
}

.icon-picker button.selected {
  border-color: var(--selected-border);
  background: var(--selected-bg);
}

.type-switch {
  display: flex;
  gap: 8px;
}

.type-switch button {
  flex: 1;

  padding: 10px;

  border: 1px solid var(--border-medium);
  border-radius: 12px;

  background: transparent;

  color: var(--muted);

  font-weight: 600;

  cursor: pointer;
}

.type-switch button.active {
  background: var(--surface-strong);
  border-color: var(--card-border);
  color: var(--text);
}

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  max-width: 400px;
  width: 100%;
}

.login-title {
  text-align: center;
  font-size: 28px;
  margin-bottom: 24px;
}

.login-switch {
  text-align: center;
  margin-top: 16px;
  color: var(--muted);
}

.login-switch a {
  color: var(--accent);
  text-decoration: none;
}

.login-switch a:hover {
  text-decoration: underline;
}

.search-row {
  margin-bottom: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.stat-card {
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: var(--surface);
  display: grid;
  gap: 6px;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.stats-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 160px;
}

.stats-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 6px;
}

.stats-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 8px;
  background: linear-gradient(180deg, #38bdf8, #6366f1);
}

.stats-col-label {
  color: var(--muted);
  font-size: 11px;
}

.hotkeys-hint {
  margin-top: 12px;
  text-align: center;
}

.player-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  z-index: 1500;
  width: min(720px, calc(100% - 24px));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.player-title {
  font-weight: 600;
  font-size: 14px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.player-controls .btn {
  padding: 8px 12px;
}

.player-progress-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-time {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: center;
}

.player-seek {
  flex: 1;
  accent-color: #38bdf8;
}

.text-paragraph {
  margin: 0 0 10px;
}

.text-sentence {
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.12s ease;
}

.text-sentence:hover {
  background: var(--surface-strong-hover);
}

/* ===== Мобильная версия ===== */
@media (max-width: 900px) {
  /* всё в одну колонку */
  .app, .app-layout, .main, main,
  .tab-panel, .panel-grid, .split, .layout, .detail-grid {
    grid-template-columns: 1fr !important;
    grid-template-areas: none !important;
    gap: 12px !important;
  }

  .sidebar {
    width: auto !important;
    max-width: none !important;
    position: static !important;
  }

  .tabs {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
  }

  .tab-button {
    flex: 1 1 auto;
  }

  .controls {
    flex-wrap: wrap;
  }

  .controls .btn {
    flex: 1 1 45%;
  }

  .detail-actions {
    flex-wrap: wrap;
  }

  .detail-actions .btn,
  .detail-actions .select {
    flex: 1 1 45%;
  }

  .filter-row {
    flex-wrap: wrap;
  }

  .timer {
    font-size: 56px;
  }

  .player-bar {
    width: calc(100% - 16px);
    bottom: 8px;
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .recordings-list {
    max-height: 60vh;
  }

  .brand {
    font-size: 24px;
  }

  .detail-title,
  .section-title {
    font-size: 20px;
  }
}