:root {
  color-scheme: light dark;

  --bg-canvas-light: #f2f5f4;
  --bg-canvas-dark: #131615;
  --bg-surface-light: #ffffff;
  --bg-surface-dark: #1c201f;
  --bg-subtle-light: #e4eae8;
  --bg-subtle-dark: #252a28;
  --text-primary-light: #171b1a;
  --text-primary-dark: #f2f4f3;
  --text-muted-light: #59605d;
  --text-muted-dark: #9ea8a4;
  --border-light: #d0d7d4;
  --border-dark: #2f3533;
  --border-input-light: #76807c;
  --border-input-dark: #636e6a;
  --brand-light: #0d6b58;
  --brand-dark: #48c9ad;
  --brand-ink-light: #ffffff;
  --brand-ink-dark: #07261f;
  --star-light: #b45309;
  --star-dark: #fbbf24;
  --danger-light: #b42318;
  --danger-dark: #f97066;

  --shadow-xs-light: 0 1px 2px rgba(23, 27, 26, 0.05);
  --shadow-xs-dark: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-sm-light: 0 2px 6px rgba(23, 27, 26, 0.06), 0 1px 2px rgba(23, 27, 26, 0.04);
  --shadow-sm-dark: 0 3px 8px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-dialog-light: 0 18px 42px rgba(23, 27, 26, 0.16), 0 4px 12px rgba(23, 27, 26, 0.08);
  --shadow-dialog-dark: 0 20px 48px rgba(0, 0, 0, 0.6), 0 4px 14px rgba(0, 0, 0, 0.4);

  --bg-canvas: var(--bg-canvas-light);
  --bg-surface: var(--bg-surface-light);
  --bg-subtle: var(--bg-subtle-light);
  --text-primary: var(--text-primary-light);
  --text-muted: var(--text-muted-light);
  --border-color: var(--border-light);
  --border-input: var(--border-input-light);
  --brand: var(--brand-light);
  --brand-ink: var(--brand-ink-light);
  --star-color: var(--star-light);
  --danger: var(--danger-light);
  --shadow-xs: var(--shadow-xs-light);
  --shadow-sm: var(--shadow-sm-light);
  --shadow-dialog: var(--shadow-dialog-light);

  @media (prefers-color-scheme: dark) {
    --bg-canvas: var(--bg-canvas-dark);
    --bg-surface: var(--bg-surface-dark);
    --bg-subtle: var(--bg-subtle-dark);
    --text-primary: var(--text-primary-dark);
    --text-muted: var(--text-muted-dark);
    --border-color: var(--border-dark);
    --border-input: var(--border-input-dark);
    --brand: var(--brand-dark);
    --brand-ink: var(--brand-ink-dark);
    --star-color: var(--star-dark);
    --danger: var(--danger-dark);
    --shadow-xs: var(--shadow-xs-dark);
    --shadow-sm: var(--shadow-sm-dark);
    --shadow-dialog: var(--shadow-dialog-dark);
  }

  @supports (color: light-dark(white, black)) {
    --bg-canvas: light-dark(var(--bg-canvas-light), var(--bg-canvas-dark));
    --bg-surface: light-dark(var(--bg-surface-light), var(--bg-surface-dark));
    --bg-subtle: light-dark(var(--bg-subtle-light), var(--bg-subtle-dark));
    --text-primary: light-dark(var(--text-primary-light), var(--text-primary-dark));
    --text-muted: light-dark(var(--text-muted-light), var(--text-muted-dark));
    --border-color: light-dark(var(--border-light), var(--border-dark));
    --border-input: light-dark(var(--border-input-light), var(--border-input-dark));
    --brand: light-dark(var(--brand-light), var(--brand-dark));
    --brand-ink: light-dark(var(--brand-ink-light), var(--brand-ink-dark));
    --star-color: light-dark(var(--star-light), var(--star-dark));
    --danger: light-dark(var(--danger-light), var(--danger-dark));
  }

  accent-color: var(--brand);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100dvh;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 28;
  background-color: rgba(0, 0, 0, 0.42);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(19.5rem, 84vw);
  z-index: 30;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  box-shadow: var(--shadow-dialog);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  overflow-y: auto;
  transform: translateX(-104%);
  transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sidebar.is-open {
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .sidebar {
    transition-duration: 0.05s;
  }
}

@media (min-width: 768px) {
  .app-shell {
    grid-template-columns: 17.5rem 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    width: auto;
    z-index: 1;
    box-shadow: none;
    transform: none;
    padding: 1.25rem 1rem;
  }

  .sidebar-backdrop,
  .mobile-only,
  .mobile-tab-bar {
    display: none !important;
  }
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.6rem;
  background-color: var(--brand);
  color: var(--brand-ink);
  box-shadow: var(--shadow-xs);
  display: grid;
  place-items: center;
  font-weight: 700;
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand-status {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 0.6rem;
  background: transparent;
  box-shadow: none;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.94rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.nav-item:hover {
  background-color: var(--bg-subtle);
}

.nav-item[aria-current="page"] {
  background-color: var(--bg-subtle);
  border-color: var(--border-color);
  box-shadow: var(--shadow-xs);
  font-weight: 600;
}

.nav-label-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.nav-glyph {
  width: 1.1rem;
  text-align: center;
  color: var(--brand);
}

.nav-count,
.pill-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.sidebar-divider {
  height: 1px;
  background-color: var(--border-color);
}

.section-label {
  margin: 0 0 0.35rem;
  padding: 0 0.5rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lists-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-color);
}

.main-view {
  padding: 0.95rem 1rem calc(5.25rem + env(safe-area-inset-bottom, 0px));
  max-width: 54rem;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

@media (min-width: 768px) {
  .main-view {
    padding: 2rem 2.5rem;
    gap: 1.1rem;
  }
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.header-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.view-header h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.view-subtitle {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  max-width: 68ch;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

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

button {
  min-height: 2.75rem;
  padding: 0.5rem 0.9rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xs);
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 100ms ease,
    opacity 140ms ease;
}

.btn-compact {
  padding: 0.45rem 0.8rem;
  white-space: nowrap;
  font-size: 0.9rem;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

button:disabled,
button[data-loading="true"] {
  opacity: 0.65;
  cursor: not-allowed;
}

button[data-loading="true"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

button[data-loading="true"]::after {
  content: "";
  width: 0.9em;
  height: 0.9em;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 650ms linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  button[data-loading="true"]::after {
    animation: none;
  }
}

.btn-primary {
  background-color: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(0.95);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: var(--shadow-xs);
}

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

.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-subtle);
}

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

.btn-ghost {
  background-color: transparent;
  border-color: transparent;
  box-shadow: none;
  text-align: center;
}

.btn-ghost:hover:not(:disabled) {
  background-color: var(--bg-subtle);
}

.btn-icon {
  min-width: 2.75rem;
  padding: 0.45rem;
  background-color: var(--bg-surface);
  display: inline-grid;
  place-items: center;
}

.btn-icon[aria-pressed="true"] {
  color: var(--star-color);
  border-color: var(--star-color);
}

.btn-icon-danger:hover:not(:disabled),
.btn-icon-danger:focus-visible {
  color: var(--danger);
  border-color: var(--danger);
}

.btn-danger {
  background-color: transparent;
  color: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background-color: var(--bg-subtle);
}

input[type="text"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input[type="url"],
select,
textarea {
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-input);
  border-radius: 0.55rem;
  background-color: var(--bg-surface);
  width: 100%;
  transition: border-color 140ms ease, background-color 140ms ease;
}

input[type="text"]:hover:not(:disabled):not([readonly]),
input[type="search"]:hover:not(:disabled),
input[type="date"]:hover:not(:disabled),
input[type="datetime-local"]:hover:not(:disabled),
input[type="url"]:hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled) {
  border-color: var(--brand);
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.search-row input[type="search"] {
  flex: 1;
}

.quick-add-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 0.8rem;
  padding: 0.55rem;
  box-shadow: var(--shadow-sm);
}

.quick-add-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.quick-add-controls input[type="date"] {
  flex: 1;
  min-width: 0;
}

@media (min-width: 640px) {
  .quick-add-form {
    flex-direction: row;
    align-items: center;
  }

  .quick-add-form > input[type="text"] {
    flex: 1;
    border-color: transparent;
    background-color: transparent;
  }

  .quick-add-controls input[type="date"] {
    width: 9.75rem;
    flex: 0 0 auto;
  }
}

.inline-add-form {
  display: flex;
  gap: 0.4rem;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.task-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.task-row:hover {
  border-color: var(--border-input);
}

.task-check-btn {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  box-shadow: none;
  background-color: transparent;
  display: grid;
  place-items: center;
}

.task-check-circle {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  border: 2px solid var(--text-muted);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.task-check-btn:hover .task-check-circle {
  border-color: var(--brand);
}

.task-row.is-completed .task-check-circle {
  background-color: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
}

.task-main-btn {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0.35rem 0.15rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-height: 2.75rem;
  justify-content: center;
  min-width: 0;
}

.task-title {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.task-row.is-completed .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.task-star-btn {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  font-size: 1.15rem;
  color: var(--text-muted);
}

.task-star-btn:hover:not(:disabled) {
  background-color: var(--bg-subtle);
  color: var(--star-color);
}

.task-star-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.task-star-btn[aria-pressed="true"] {
  color: var(--star-color);
}

.suggestions-panel,
.completed-section {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 0.7rem 0.95rem;
}

.suggestions-panel summary,
.completed-section summary {
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.75rem;
}

.suggestions-panel .task-list,
.completed-section .task-list {
  margin-top: 0.75rem;
}

.empty-state {
  color: var(--text-muted);
  max-width: 65ch;
  padding: 0.5rem 0.25rem;
}

.mobile-tab-bar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.08);
  padding: 0.2rem 0.35rem calc(0.2rem + env(safe-area-inset-bottom, 0px));
}

.mobile-tab {
  min-height: 3.35rem;
  padding: 0.25rem 0.2rem;
  border: 0;
  box-shadow: none;
  background: transparent;
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.mobile-tab:hover:not(:disabled) {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
}

.mobile-tab:active:not(:disabled) {
  transform: translateY(1px);
}

.mobile-tab[aria-current="page"] {
  color: var(--brand);
  font-weight: 700;
}

.mobile-tab-icon {
  font-size: 1.05rem;
  line-height: 1;
}

/* Native <dialog> top-layer entry & exit transitions */
dialog {
  width: min(35rem, calc(100vw - 1.5rem));
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 0.9rem;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-dialog);
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.22s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;

  @media (prefers-reduced-motion: no-preference) {
    transform: scale(0.96);
  }
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0);
  transition-property: background-color, display, overlay;
  transition-duration: 0.22s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

:is(dialog[open]):where(:not([data-closing])) {
  opacity: 1;

  @starting-style {
    opacity: 0;
  }

  @media (prefers-reduced-motion: no-preference) {
    transform: scale(1);

    @starting-style {
      transform: scale(0.96);
    }
  }

  &::backdrop {
    background-color: rgba(0, 0, 0, 0.5);

    @starting-style {
      background-color: rgba(0, 0, 0, 0);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  dialog,
  dialog::backdrop {
    transition-duration: 0.1s;
  }
}

.dialog-shell {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.dialog-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.dialog-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.share-block {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.share-heading {
  margin: 0;
  font-size: 1rem;
}

.copy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.copy-row input {
  flex: 1 1 12rem;
  min-width: 0;
}

.sync-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.settings-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.25rem;
  background-color: var(--bg-subtle);
  padding: 0.2rem;
  border-radius: 0.65rem;
}

.settings-tab {
  min-height: 2.75rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.86rem;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  box-shadow: none;
  background: transparent;
  color: var(--text-muted);
}

.settings-tab:hover:not(:disabled) {
  color: var(--text-primary);
}

.settings-tab[aria-selected="true"] {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color);
  box-shadow: var(--shadow-xs);
}

.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.detail-actions-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field-label {
  margin: 0;
  font-weight: 600;
  font-size: 0.9rem;
}

.field-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

input[readonly] {
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  cursor: default;
}

.prose-note {
  margin: 0;
  color: var(--text-muted);
  max-width: 65ch;
  font-size: 0.9rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 520px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.steps-list {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.step-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
}

.step-title.is-completed {
  text-decoration: line-through;
  color: var(--text-muted);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  cursor: pointer;
}

.checkbox-row:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}

.error-text {
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
}

.toast-region {
  position: fixed;
  right: 1rem;
  bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 40;
}

@media (min-width: 768px) {
  .toast-region {
    bottom: 1rem;
  }
}

.toast {
  padding: 0.65rem 1rem;
  border-radius: 0.6rem;
  background-color: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
  box-shadow: var(--shadow-dialog);
}

/* Placed after global button styles so footer actions and inline links stay flat without box-shadow */
.sidebar-footer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
}

.sidebar-action-btn {
  min-height: 2.75rem;
  padding: 0.45rem 0.5rem;
  border: 0;
  border-radius: 0.5rem;
  box-shadow: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

.sidebar-action-btn:hover {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
}

.sidebar-legal-row,
.settings-meta-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.sidebar-legal-row {
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.1rem 0.15rem;
  white-space: nowrap;
}

button.link-inline,
a.link-inline {
  display: inline;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color 140ms ease;
}

button.link-inline:hover,
a.link-inline:hover {
  color: var(--brand);
}

.sidebar-legal-link {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  padding: 0.1rem 0;
  border: 0;
  border-radius: 0.25rem;
  box-shadow: none;
  background: transparent;
  font: inherit;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 140ms ease;
}

.sidebar-legal-link:hover {
  color: var(--brand);
}

.info-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.info-block h3 {
  margin: 0;
  font-size: 0.94rem;
}

.legal-scroll-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: min(65vh, 32rem);
  overflow-y: auto;
  padding-top: 0.25rem;
}
