/* ============================================================
   Dashboard - reskin to Figma "Dashboard / Redesign" (184-1121)
   Built on css/tokens.css (marketing design tokens).
   ============================================================ */

body {
  background: var(--color-surface);
  color: var(--color-body);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Figma dashboard uses flat brand-blue primaries (not the app's blue→violet
   gradient). Scope the flatten to the dashboard so extract.html is untouched. */
.db-main .btn--primary {
  background: var(--color-brand);
  box-shadow: none;
}

.db-main .btn--primary:hover {
  background: var(--color-brand-hover);
  filter: none;
}

.db-container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 32px;
}

@keyframes dbCardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.db-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border-cool);
  position: sticky;
  top: 0;
  z-index: 100;
}

.db-header__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}

.db-header__brand {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-ink);
  letter-spacing: var(--tracking-tight);
  white-space: nowrap;
  text-decoration: none;
}

.db-header__brand:hover { color: var(--color-brand); }

.db-header__nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.db-navlink {
  position: relative;
  background: none;
  border: none;
  padding: 20px 0;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-muted);
  cursor: pointer;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.db-navlink:hover { color: var(--color-ink); }
.db-navlink:focus-visible,
.db-header__logout:focus-visible,
.db-download__opt:focus-visible,
.db-settings-item__link:focus-visible,
.db-modal-card .btn:focus-visible,
.db-main .btn:focus-visible {
  outline: 3px solid var(--color-brand-tint);
  outline-offset: 3px;
}

.db-navlink--active {
  color: var(--color-brand);
  font-weight: var(--weight-semibold);
}

.db-navlink--active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--color-brand);
  border-radius: 2px 2px 0 0;
}

.db-header__meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.db-header__logout {
  background: none;
  border: none;
  font-family: inherit;
  font-size: var(--text-sm);
  color: var(--color-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.db-header__logout:hover { color: var(--color-ink); }

/* ── Main ────────────────────────────────────────────────────────────────── */
.db-main {
  flex: 1;
  padding: 40px 32px 80px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ── Greeting row ────────────────────────────────────────────────────────── */
.db-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.db-welcome__title {
  font-size: var(--text-3xl);
  line-height: var(--leading-3xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--color-ink);
}

.db-welcome__sub {
  margin-top: 4px;
  font-size: var(--text-base);
  color: var(--color-body);
}

.db-welcome__cta { flex-shrink: 0; }

/* ── Erste Schritte checklist ────────────────────────────────────────────── */
.db-onboarding {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  background: var(--color-brand-tint);
  border: 1px solid #dce4fb;
  border-radius: var(--radius-2xl);
  padding: 20px 24px;
  animation: dbCardIn var(--transition-base) both;
}

.db-onboarding[hidden] { display: none; }

.db-onboarding__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--color-brand);
  margin-bottom: 12px;
}

.db-onboarding__steps {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  padding: 0;
  margin: 0;
}

.db-onboarding__step {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.db-onboarding__mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #c9d3ef;
  background: transparent;
  flex-shrink: 0;
}

.db-onboarding__step--done { color: var(--color-ink); font-weight: var(--weight-medium); }

.db-onboarding__step--done .db-onboarding__mark {
  border-color: var(--color-success);
  background: var(--color-success)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 6.2l2.2 2.3L9.5 3.5' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 12px no-repeat;
}

.db-onboarding__cta { flex-shrink: 0; }

/* ── Stats row ───────────────────────────────────────────────────────────── */
.db-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.db-stat-card {
  background: var(--color-white);
  border: 1px solid var(--color-border-cool);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card-sm);
  padding: 24px 26px;
  animation: dbCardIn var(--transition-base) both;
}

.db-stat-card__value {
  font-size: var(--text-4xl);
  line-height: 1;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--color-ink);
}

.db-stat-card__value--brand { color: var(--color-brand); }

.db-stat-card__label {
  margin-top: 12px;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-ink);
}

.db-stat-card__hint {
  margin-top: 3px;
  font-size: var(--text-xs);
  color: var(--color-subtle);
}

/* ── Order card (running / finished current job) ─────────────────────────── */
.db-order-card {
  background: var(--color-white);
  border: 1px solid var(--color-border-cool);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card);
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: dbCardIn var(--transition-base) both;
}

.db-order-card--running { border-color: #dce4fb; }

.db-order-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.db-order-card__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-ink);
}

.db-order-card__sub {
  margin-top: 3px;
  font-size: var(--text-sm);
  color: var(--color-body);
}

.db-order-card__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.db-order-card__status--running { background: var(--color-brand-tint); color: var(--color-brand); }
.db-order-card__status--done    { background: var(--color-success-bg); color: var(--color-success); }
.db-order-card__status--error   { background: var(--color-error-bg); color: var(--color-error); }

.db-order-card__spinner {
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: dbSpin 0.8s linear infinite;
}

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

.db-progress {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-brand-tint);
  overflow: hidden;
}

.db-progress__bar {
  height: 100%;
  width: 0;
  border-radius: var(--radius-pill);
  background: var(--color-brand);
  transition: width var(--transition-base);
}

.db-progress__bar--indeterminate {
  width: 40% !important;
  animation: dbIndeterminate 1.3s ease-in-out infinite;
}

@keyframes dbIndeterminate {
  0%   { margin-left: -40%; }
  100% { margin-left: 100%; }
}

.db-order-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Download split button */
.db-download {
  position: relative;
  display: inline-flex;
}

.db-download__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 160px;
  background: var(--color-white);
  border: 1px solid var(--color-border-cool);
  border-radius: var(--radius-md, 10px);
  box-shadow: var(--shadow-card);
  padding: 6px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.db-download__menu[hidden] { display: none; }

.db-download__opt {
  background: none;
  border: none;
  font-family: inherit;
  font-size: var(--text-sm);
  color: var(--color-ink);
  text-align: left;
  padding: 8px 12px;
  border-radius: 7px;
  cursor: pointer;
}

.db-download__opt:hover { background: var(--color-brand-tint); color: var(--color-brand); }

.btn--danger-ghost {
  color: var(--color-error);
  border-color: rgba(185, 28, 28, 0.28);
}

.btn--danger-ghost:hover {
  background: var(--color-error-bg);
  border-color: rgba(185, 28, 28, 0.4);
}

/* ── Section ─────────────────────────────────────────────────────────────── */
.db-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.db-section__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.db-section__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--color-ink);
}

.db-section__sub {
  margin-top: 4px;
  font-size: var(--text-sm);
  color: var(--color-body);
}

/* ── History list ────────────────────────────────────────────────────────── */
.db-history-list {
  display: grid;
  gap: 12px;
}

.db-history-list--expanded {
  max-height: min(78vh, 960px);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.db-history-item {
  background: var(--color-white);
  border: 1px solid var(--color-border-cool);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card-sm);
  padding: 18px 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  animation: dbCardIn var(--transition-base) both;
}

.db-history-item:hover {
  border-color: rgba(28, 82, 214, 0.3);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.db-history-item--current {
  cursor: default;
  border-color: #dce4fb;
}

.db-history-item--current:hover {
  border-color: #dce4fb;
  box-shadow: var(--shadow-card-sm);
  transform: none;
}

.db-history-item--current-done {
  cursor: pointer;
}

.db-history-item--current-done:hover {
  border-color: rgba(28, 82, 214, 0.3);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.db-history-item__title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-ink);
}

.db-history-item__date {
  font-size: var(--text-sm);
  color: var(--color-subtle);
  text-align: right;
  white-space: nowrap;
}

.db-history-item__meta {
  font-size: var(--text-sm);
  color: var(--color-body);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.db-history-item__count {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  background: var(--color-brand-tint);
  color: var(--color-brand);
  padding: 2px 9px;
  border-radius: var(--radius-pill);
}

.db-history-item__units { font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-body); }

.db-history-item__fields {
  font-size: var(--text-xs);
  color: var(--color-subtle);
  grid-column: 1 / -1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-history-item__progress,
.db-history-item__actions {
  grid-column: 1 / -1;
}

.db-history-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.db-history-toggle {
  align-self: flex-start;
}

/* Big empty state (no extractions yet) */
.db-empty {
  background: var(--color-white);
  border: 1px solid var(--color-border-cool);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card-sm);
  padding: 56px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: dbCardIn var(--transition-base) both;
}

.db-empty__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-brand-tint);
  color: var(--color-brand);
  display: flex;
  align-items: center;
  justify-content: center;
}

.db-empty__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-ink);
}

.db-empty__text {
  font-size: var(--text-base);
  color: var(--color-body);
  max-width: 380px;
}

.db-empty__cta { margin-top: 6px; }

.db-loading {
  padding: 28px;
  text-align: center;
  color: var(--color-body);
  font-size: var(--text-sm);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.db-footer {
  border-top: 1px solid var(--color-border-cool);
  background: var(--color-white);
}

.db-footer__inner {
  padding: 20px 32px;
  font-size: var(--text-sm);
  color: var(--color-subtle);
  text-align: center;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

.db-footer__inner a {
  color: inherit;
  text-decoration: none;
}

.db-footer__inner a:hover {
  color: var(--color-ink);
}

/* ── Settings modal ──────────────────────────────────────────────────────── */
.db-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, 0.45);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: dbFade 0.18s ease both;
}

.db-modal-overlay[hidden] { display: none !important; }

@keyframes dbFade { from { opacity: 0; } to { opacity: 1; } }

.db-modal-card {
  background: var(--color-white);
  border: 1px solid var(--color-border-cool);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card);
  padding: 28px;
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: dbModalIn 0.2s ease both;
}

@keyframes dbModalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.db-modal-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.db-modal-card__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-ink);
}

.db-settings-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border-cool);
  border-radius: 10px;
  overflow: hidden;
}

.db-settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border-cool);
  gap: 12px;
}

.db-settings-item:last-child { border-bottom: none; }

.db-settings-item__label { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-ink); }
.db-settings-item__value { font-size: var(--text-sm); color: var(--color-body); }
.db-settings-item__link  { font-size: var(--text-sm); color: var(--color-brand); text-decoration: underline; text-underline-offset: 2px; }

.db-settings-note { font-size: var(--text-xs); color: var(--color-subtle); text-align: center; }

/* ── Settings page ──────────────────────────────────────────────────────── */
.db-settings-page {
  gap: 24px;
}

.db-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.db-settings-panel {
  background: var(--color-white);
  border: 1px solid var(--color-border-cool);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card-sm);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  animation: dbCardIn var(--transition-base) both;
}

.db-settings-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.db-settings-panel__header h2 {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--color-ink);
}

.db-settings-panel__note,
.db-settings-placeholder {
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--color-body);
}

.db-settings-placeholder {
  min-height: 96px;
  border: 1px dashed var(--color-border-cool);
  border-radius: 10px;
  display: flex;
  align-items: center;
  padding: 16px;
  background: #fbfcff;
}

.db-settings-badge {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-success);
  background: var(--color-success-bg);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  white-space: nowrap;
}

.db-settings-badge--muted {
  color: var(--color-body);
  background: var(--color-surface);
}

.db-settings-fields {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border-cool);
  border-radius: 10px;
  overflow: hidden;
}

.db-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--color-border-cool);
  font-size: var(--text-sm);
}

.db-settings-row:last-child { border-bottom: none; }
.db-settings-row span { color: var(--color-body); }
.db-settings-row strong {
  color: var(--color-ink);
  font-weight: var(--weight-semibold);
  text-align: right;
  word-break: break-word;
}

.db-settings-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.db-settings-form__line {
  display: flex;
  gap: 10px;
}

.db-settings-form__line .db-input {
  flex: 1;
  min-width: 0;
}

.db-settings-message {
  border-radius: 10px;
  padding: 12px 14px;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border: 1px solid var(--color-border-cool);
  background: var(--color-white);
}

.db-settings-message--success {
  color: var(--color-success);
  background: var(--color-success-bg);
  border-color: rgba(22, 163, 74, 0.25);
}

.db-settings-message--error {
  color: var(--color-error);
  background: var(--color-error-bg);
  border-color: rgba(185, 28, 28, 0.25);
}

/* ── Voreinstellungen (presets) ──────────────────────────────────────────── */
.db-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.db-preset-card {
  background: var(--color-white);
  border: 1px solid var(--color-border-cool);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card-sm);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: dbCardIn var(--transition-base) both;
}

.db-preset-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.db-preset-card__name {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-ink);
  word-break: break-word;
}

.db-preset-card__doc-type {
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  background: var(--color-brand-tint);
  color: var(--color-brand);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-preset-card__count {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-body);
}

.db-preset-card__fields {
  font-size: var(--text-xs);
  color: var(--color-subtle);
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.db-preset-card__date {
  font-size: var(--text-xs);
  color: var(--color-subtle);
  margin-top: auto;
  padding-top: 4px;
}

.db-preset-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.db-preset-card__launch { flex: 1; min-width: 140px; }

.db-preset-card__delete {
  width: 36px;
  padding: 0;
  flex-shrink: 0;
}

.db-presets-empty {
  grid-column: 1 / -1;
  background: var(--color-white);
  border: 1px dashed var(--color-border-cool);
  border-radius: var(--radius-2xl);
  padding: 40px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.db-presets-empty__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-brand-tint);
  color: var(--color-brand);
  display: flex;
  align-items: center;
  justify-content: center;
}

.db-presets-empty__title { font-size: var(--text-base); font-weight: var(--weight-bold); color: var(--color-ink); }
.db-presets-empty__text { font-size: var(--text-sm); color: var(--color-body); max-width: 360px; }

/* ── Preset edit modal ───────────────────────────────────────────────────── */
.db-modal-card--wide { max-width: 560px; }

.db-preset-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 60vh;
  overflow-y: auto;
}

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

.db-field__label { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-ink); }

.db-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--color-border-cool);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--text-sm);
  color: var(--color-ink);
  background: var(--color-white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.db-input:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--color-brand-tint);
}

.db-field-rows { display: flex; flex-direction: column; gap: 8px; }

.db-field-row { display: flex; align-items: center; gap: 8px; }
.db-field-row .db-input { flex: 1; }

.db-field-row__remove {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border-cool);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-subtle);
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.db-field-row__remove:hover {
  color: var(--color-error);
  border-color: rgba(185, 28, 28, 0.3);
  background: var(--color-error-bg);
}

.db-field-add { display: flex; gap: 8px; }
.db-field-add .db-input { flex: 1; }

.db-preset-empty-hint { font-size: var(--text-sm); color: var(--color-subtle); }

.db-modal-card__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .db-header__inner { gap: 18px; }
  .db-header__nav { gap: 18px; }
  .db-navlink { padding: 12px 0; }
  .db-stats { grid-template-columns: 1fr; }
  .db-settings-grid { grid-template-columns: 1fr; }
  .db-container { padding: 0 18px; }
  .db-main { padding: 28px 18px 60px; gap: 22px; }
  .db-welcome__title { font-size: var(--text-2xl); }
  .db-history-item {
    grid-template-columns: 1fr;
  }
  .db-history-item__date {
    text-align: left;
    white-space: normal;
  }
}

@media (max-width: 520px) {
  .db-header__brand { font-size: var(--text-base); }
  .db-settings-form__line { flex-direction: column; }
  .db-settings-form__line .btn { width: 100%; }
}
