.btn {
  align-items: center;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  gap: 8px;
  justify-content: center;
  line-height: 1;
  min-height: 44px;
  padding: 0 20px;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease, color .15s ease;
  white-space: nowrap;
}

.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hi); }
.btn-primary:active:not(:disabled) { opacity: .85; }

.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover:not(:disabled) {
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border-color: color-mix(in srgb, var(--text) 22%, var(--border));
}

.btn:disabled { cursor: not-allowed; opacity: .4; }
.btn--sm { font-size: 0.875rem; min-height: 36px; padding: 0 14px; }

.btn-link {
  background: none;
  border: none;
  color: var(--accent-hi);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-underline-offset: 2px;
}
.btn-link:hover { text-decoration-color: currentColor; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.card h3 { margin-bottom: 6px; }
.card p { color: var(--muted); font-size: 0.9375rem; }

a.card, .card--link { color: inherit; text-decoration: none; transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
a.card:hover, .card--link:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.field input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  padding: 12px 14px;
  transition: border-color .15s ease;
  width: 100%;
}
.field input::placeholder { color: var(--muted); }
.field input:focus { border-color: var(--accent); outline: none; }
.field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.stat-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.stat-value { font-size: 1.2rem; font-weight: 700; }

.list-row {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px 2px;
}
.list-row:last-child { border-bottom: none; }

.empty-state {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 48px 16px;
  text-align: center;
}
.empty-state-title { color: var(--text); font-size: 1rem; font-weight: 600; }

.notice {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  padding: 12px 14px;
}
.notice--ok   { background: color-mix(in srgb, var(--success) 10%, transparent); border-color: color-mix(in srgb, var(--success) 25%, transparent); color: var(--success); }
.notice--err  { background: color-mix(in srgb, var(--danger) 10%, transparent);  border-color: color-mix(in srgb, var(--danger) 25%, transparent);  color: var(--danger); }

.accordion { border-top: 1px solid var(--border); }
.accordion details { border-bottom: 1px solid var(--border); }
.accordion details:last-child { border-bottom: none; }
.accordion summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 1rem;
  font-weight: 600;
  gap: 16px;
  justify-content: space-between;
  list-style: none;
  padding: 18px 0;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  border-bottom: 2px solid var(--muted);
  border-right: 2px solid var(--muted);
  content: '';
  flex-shrink: 0;
  height: 8px;
  margin-right: 4px;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .18s ease;
  width: 8px;
}
.accordion details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.accordion .accordion-body { color: var(--muted); padding: 0 0 20px; }
.accordion .accordion-body p { font-size: 0.9375rem; }

.spinner {
  animation: spin .8s linear infinite;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-radius: 50%;
  border-top-color: currentColor;
  height: 18px;
  width: 18px;
}
@keyframes spin { to { transform: rotate(360deg); } }
