.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 1px 0 rgba(255,255,255,0.025) inset;
  padding: var(--space-5);
}
.card--soft { background: var(--surface-raised); box-shadow: none; }
.card--accent { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.card--danger { border-color: color-mix(in srgb, var(--danger) 44%, var(--line)); }
.card--compact { padding: var(--space-4); border-radius: var(--radius-md); }

.button {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 var(--space-5);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, opacity 150ms ease;
}
.button:active { transform: scale(0.98); }
.button[disabled] { cursor: not-allowed; opacity: 0.42; }
.button--secondary { border-color: var(--line); background: var(--surface-soft); color: var(--text); }
.button--ghost { border-color: transparent; background: transparent; color: var(--text); }
.button--danger { background: color-mix(in srgb, var(--danger) 18%, var(--surface)); color: var(--danger); }
.button--wide { width: 100%; }
.button--square { width: var(--tap); padding: 0; border-radius: 50%; }
.link-button { min-height: 44px; display: inline-flex; align-items: center; border: 0; padding: 0 var(--space-2); background: none; color: var(--accent); font-weight: 800; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.icon-button {
  width: var(--tap);
  height: var(--tap);
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-raised);
  cursor: pointer;
}

.badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
}
.badge--success { background: color-mix(in srgb, var(--success) 14%, var(--surface)); color: var(--success); }
.badge--warning { background: color-mix(in srgb, var(--warning) 14%, var(--surface)); color: var(--warning); }
.badge--danger { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); color: var(--danger); }
.badge--info { background: color-mix(in srgb, var(--info) 14%, var(--surface)); color: var(--info); }

.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.metric { min-width: 0; padding: var(--space-4); border-radius: var(--radius-md); background: var(--surface-raised); }
.metric__value { display: block; margin-bottom: 2px; font-size: 1.25rem; font-weight: 850; letter-spacing: -0.03em; }
.metric__label { color: var(--text-muted); font-size: 0.8rem; }

.notice { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-md); background: var(--surface-raised); }
.notice--warning { background: color-mix(in srgb, var(--warning) 10%, var(--surface)); }
.notice--danger { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.notice__icon { font-size: 1.2rem; }
.notice p:last-child { margin-bottom: 0; }

.field { display: grid; gap: var(--space-2); }
.field label, .field__label { font-weight: 750; }
.input, .textarea, .select {
  width: 100%;
  min-height: var(--tap);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--surface-raised);
  color: var(--text);
}
.textarea { min-height: 112px; resize: vertical; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 4px; background: var(--surface-raised); }
.segmented button { min-height: 42px; border: 0; border-radius: 999px; background: transparent; color: var(--text-muted); font-weight: 800; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface-soft); color: var(--text); }

.stepper { display: grid; grid-template-columns: var(--tap) minmax(0, 1fr) var(--tap); align-items: center; gap: var(--space-3); }
.stepper__value { min-width: 0; text-align: center; }
.stepper__value strong { display: block; font-size: clamp(1.65rem, 8vw, 2.35rem); line-height: 1; letter-spacing: -0.05em; }
.stepper__value span { color: var(--text-muted); font-size: 0.78rem; }

.media-frame {
  min-height: 180px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed color-mix(in srgb, var(--text-muted) 55%, transparent);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--surface-raised), var(--surface-soft));
  text-align: center;
}
.media-frame__empty { max-width: 260px; padding: var(--space-6); color: var(--text-muted); }
.media-frame__empty strong { display: block; margin-bottom: var(--space-2); color: var(--text); }

.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }
.progress-track > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

.list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.list-button { width: 100%; min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); background: var(--surface-raised); color: var(--text); text-align: left; cursor: pointer; }
.list-button__copy { min-width: 0; }
.list-button__copy strong { display: block; }
.list-button__copy span { display: block; color: var(--text-muted); font-size: 0.82rem; }

.skeleton { position: relative; overflow: hidden; border-radius: var(--radius-sm); background: var(--surface-soft); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,0.09), transparent); animation: shimmer 1.35s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

.toast { position: fixed; z-index: 60; top: max(var(--space-4), env(safe-area-inset-top)); left: 50%; width: min(calc(100% - 32px), 430px); transform: translateX(-50%); padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow); font-weight: 750; }

.sheet-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; align-items: end; background: rgba(1, 7, 4, 0.66); backdrop-filter: blur(4px); }
.sheet { width: 100%; max-height: min(88vh, 780px); overflow: auto; border: 1px solid var(--line); border-bottom: 0; border-radius: 28px 28px 0 0; background: var(--surface); box-shadow: var(--shadow); }
.sheet__handle { width: 42px; height: 5px; margin: 10px auto 2px; border-radius: 99px; background: var(--line); }
.sheet__header { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-5); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); }
.sheet__header h2 { margin: 0; }
.sheet__body { display: grid; gap: var(--space-4); padding: 0 var(--space-5) calc(var(--space-8) + env(safe-area-inset-bottom)); }

.plate-diagram { display: grid; grid-template-columns: minmax(0,1fr) 52px minmax(0,1fr); align-items: center; gap: var(--space-2); padding: var(--space-5) var(--space-3); border-radius: var(--radius-md); background: var(--surface-raised); }
.plate-side { display: flex; justify-content: center; align-items: center; gap: 3px; min-height: 92px; }
.plate-side--left { flex-direction: row-reverse; }
.plate { width: 11px; border: 2px solid currentColor; border-radius: 5px; background: color-mix(in srgb, currentColor 25%, var(--surface)); }
.plate[data-weight="2.5"] { height: 74px; color: var(--accent); }
.plate[data-weight="1.25"] { height: 57px; color: var(--info); }
.plate[data-weight="0.5"] { height: 42px; color: var(--warning); }
.bar { position: relative; width: 52px; height: 12px; border-radius: 999px; background: var(--text-muted); }
.bar::before { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 72px; transform: translate(-50%,-50%); border-radius: 7px; background: linear-gradient(90deg, #69756f, #d4ddd8 45%, #68736d); }
.setup-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--space-3); }
.setup-list ul { margin: 0; padding-left: 20px; color: var(--text-muted); }

.timer { text-align: center; }
.timer__value { display: block; font-size: clamp(3.5rem, 20vw, 6rem); line-height: 1; font-weight: 900; letter-spacing: -0.07em; }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--space-2); }
.choice { min-height: 64px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); color: var(--text); font-weight: 750; cursor: pointer; }
.choice[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, var(--surface)); }

.diagnostic { border: 1px dashed color-mix(in srgb, var(--info) 45%, var(--line)); }
.code-label { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; color: var(--info); }
