/* Shared UI roles. Component files own layout; this file owns visual vocabulary. */
:root {
  --font-text: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: var(--font-text);
  --type-caption: 0.8125rem;
  --type-secondary: 0.875rem;
  --type-body: 0.9375rem;
  --type-section: 1.375rem;
  --type-page: 1.75rem;
  --bg: #f5f5f7;
  --sidebar: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f2f2f4;
  --text: #1d1d1f;
  --muted: #68686e;
  --line: #e3e3e7;
  --hover: #eeeef2;
  --blue: #0964cc;
  --blue-bg: #e8f1ff;
  --action: #0869e8;
  --action-hover: #0058ca;
  --on-action: #ffffff;
  --register-list-surface: #f8f8f9;
  --register-tools-surface: #f8f8f9;
  --register-selected-surface: #fff;
  --register-detail-surface: #ffffff;
  --selection: #edf3fc;
  --selection-border: #c5d8f0;
  --radius: 24px;
  --radius-control: 12px;
  --shadow: 0 3px 14px #1c335007;
  --chart-bar: #303036;
  --metric-surface: #f2f2f4;
  --ease-ui: cubic-bezier(0.2, 0.75, 0.25, 1);
  --ease-response: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-fast: 140ms;
  --motion-feedback: 220ms;
  --motion-arrive: 380ms;
  font-family: var(--font-text);
  color: var(--text);
  background: var(--bg);
  font-optical-sizing: auto;
}
:root[data-theme='dark'] {
  --bg: #111113;
  --sidebar: #171719;
  --surface: #1c1c1e;
  --surface-alt: #2c2c2e;
  --text: #f5f5f7;
  --muted: #adadb4;
  --line: #38383c;
  --hover: #30343e;
  --blue: #7eb2ff;
  --blue-bg: #263b57;
  --register-list-surface: #1b1b1e;
  --register-tools-surface: #1b1b1e;
  --register-selected-surface: #2c2c30;
  --register-detail-surface: #24272e;
  --selection: #2c3e56;
  --selection-border: #486687;
  --shadow: 0 8px 24px #00000014;
  --chart-bar: #b5b5bc;
  --metric-surface: #2c2c2e;
}
body {
  font-family: var(--font-text);
  font-size: var(--type-body);
}
button,
input,
textarea,
select {
  font-family: inherit;
}
.app-shell h1,
.app-shell h2,
.app-shell h3 {
  font-family: var(--font-display);
}
.app-shell .button {
  font-size: var(--type-body);
  font-weight: 500;
  border-radius: var(--radius-control);
  min-height: 42px;
  transition:
    background 160ms var(--ease-ui),
    border-color 160ms var(--ease-ui),
    color 160ms var(--ease-ui);
}
.app-shell .button.primary {
  color: var(--on-action);
  background: var(--action);
  border-color: var(--action);
  box-shadow: none;
}
.app-shell .button.primary:hover {
  background: var(--action-hover);
}
.app-shell .button.secondary {
  background: var(--surface);
  border-color: var(--line);
}
.app-shell .button:active:not(:disabled),
.app-shell .icon-button:active:not(:disabled) {
  filter: brightness(0.94);
}
.app-shell .pick {
  font-size: var(--type-body);
  min-height: 42px;
  border-radius: var(--radius-control);
}
.native-select-data[hidden] {
  display: none !important;
}
.pick.select-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  font: inherit;
  font-size: 14px;
}
.select-control > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.select-control > svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--muted);
}
.select-control:hover:not(:disabled),
.select-control[aria-expanded='true'] {
  border-color: var(--blue);
}
.select-control:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.app-shell .eyebrow {
  font-size: var(--type-caption);
  letter-spacing: 0.04em;
  font-weight: 500;
}
.app-shell .page-heading h1 {
  font-size: var(--type-page);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
}
.app-shell .page-heading p {
  font-size: var(--type-body);
  line-height: 1.5;
}
.app-shell :is(button, a, summary, input, textarea, select):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.app-shell :is(input, textarea, select):focus {
  box-shadow: none;
}
.app-shell .search-field {
  transition:
    border-color 160ms var(--ease-ui),
    box-shadow 160ms var(--ease-ui);
}
.app-shell .search-field:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 10%, transparent);
}
.app-shell .search-field input:focus,
.app-shell .search-field input:focus-visible {
  outline: none;
  border: 0;
  box-shadow: none;
}
.app-shell .search-field input {
  background: transparent;
}
.app-shell .search-field.list-filter {
  gap: 10px;
  padding: 0 0 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.app-shell .search-field.list-filter:focus-within {
  border-bottom-color: var(--blue);
  box-shadow: 0 1px 0 var(--blue);
}
.app-shell .list-filter > svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.app-shell .list-filter input {
  height: 36px;
  min-width: 0;
  border-radius: 0;
  font-size: 14px;
}
.app-shell input::placeholder,
.app-shell textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
@media (max-width: 760px), (pointer: coarse) {
  .app-shell :is(.button, .pick, .icon-button) {
    min-height: 44px;
  }
  .app-shell .button,
  .app-shell .pick {
    font-size: 0.9375rem;
  }
  .app-shell .icon-button {
    min-width: 44px;
  }
  .app-shell
    :is(input:not([type='checkbox']):not([type='radio']):not([type='hidden']), textarea, select) {
    font-size: 1rem;
  }
  .app-shell .page-heading h1 {
    font-size: 1.625rem;
  }
}
@media (prefers-contrast: more) {
  :root {
    --muted: #494e58;
    --line: #81858f;
    --selection-border: #0964cc;
  }
  :root[data-theme='dark'] {
    --muted: #d3d6df;
    --line: #9298a5;
    --selection-border: #98c2ff;
  }
  .app-shell .topbar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: var(--bg) !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell *,
  .app-shell *::before,
  .app-shell *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
