:root {
  --color-bg: #f4f6f8;
  --color-surface: #ffffff;
  --color-surface-subtle: #f8fafb;
  --color-text: #17202a;
  --color-text-secondary: #667085;
  --color-text-muted: #98a2b3;
  --color-border: #e4e7ec;
  --color-border-strong: #d0d5dd;
  --color-primary: #168c5b;
  --color-primary-dark: #106b46;
  --color-primary-soft: #eaf6f0;
  --color-danger: #c0392b;
  --color-danger-soft: #fbefed;
  --color-warning: #d99000;
  --color-warning-soft: #fff7e6;
  --color-info: #2878b5;
  --color-info-soft: #edf5fb;
  --color-neutral-soft: #f2f4f7;
  --color-sidebar: #14271f;
  --color-sidebar-raised: #1c342a;
  --color-sidebar-text: #d7e3dd;
  --color-sidebar-muted: #9fb3aa;
  --color-sidebar-accent: #44bd87;
  --color-sidebar-line: rgb(255 255 255 / 9%);
  --color-sidebar-line-strong: rgb(255 255 255 / 18%);
  --color-sidebar-hover: rgb(255 255 255 / 6%);
  --color-sidebar-chip: rgb(255 255 255 / 10%);
  --color-sidebar-control-hover: rgb(255 255 255 / 7%);
  --color-topbar-glass: rgb(255 255 255 / 94%);
  --color-primary-ring: rgb(22 140 91 / 12%);
  --color-overlay: rgb(15 23 42 / 48%);
  --color-shadow: rgb(16 24 40 / 8%);
  --color-shadow-light: rgb(16 24 40 / 4%);
  --color-shadow-medium: rgb(16 24 40 / 9%);
  --color-focus: #2878b5;
  --sidebar-width: 248px;
  --sidebar-collapsed-width: 76px;
  --topbar-height: 76px;
  --content-max: 1540px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px var(--color-shadow), 0 1px 4px var(--color-shadow-light);
  --shadow-md: 0 8px 24px var(--color-shadow-medium);
  --transition-fast: 160ms ease;
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html { min-width: 320px; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:not(:disabled) { cursor: pointer; }
button:disabled,
[aria-disabled="true"] { cursor: not-allowed; }

input,
select,
textarea {
  max-width: 100%;
}

[aria-busy="true"] { cursor: progress; }

.interface-panel[role="status"],
.form-message,
.field-error {
  overflow-wrap: anywhere;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--color-text); line-height: 1.2; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-primary-dark);
  font-weight: 700;
  transform: translateY(-140%);
  transition: transform var(--transition-fast);
}

.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--color-focus) 38%, transparent);
  outline-offset: 2px;
}

.ui-icon {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ui-icon path:first-child:last-child[d^="M4 4h6"] { fill: currentColor; stroke: none; }

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.primary-button,
.secondary-button,
.text-button,
.details-toggle {
  min-height: 38px;
  border-radius: var(--radius-sm);
  font-weight: 650;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--color-primary);
  background: var(--color-primary);
  color: var(--color-surface);
}

.primary-button:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }
.primary-button:disabled { opacity: .62; }
.primary-button .ui-icon { width: 16px; height: 16px; }

.secondary-button {
  padding: 7px 12px;
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
}

.secondary-button:hover { border-color: var(--color-primary); color: var(--color-primary-dark); }

.text-button,
.details-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 2px;
  border: 0;
  background: transparent;
  color: var(--color-primary-dark);
}

.text-button:hover, .details-toggle:hover { color: var(--color-primary); }

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

@media (max-width: 760px) {
  body main .primary-button,
  body main .secondary-button,
  body main .text-button,
  body main button,
  body .mobile-menu-button,
  body .icon-button,
  main a[role="button"] {
    min-height: 44px;
  }

  input,
  select {
    min-height: 44px;
  }

  textarea { min-height: 96px; }
}
