/* OneStop shared controls. Namespaced `.c-*` is the single control vocabulary. */

:root {
  --c-control-min-height: 44px;
  --c-control-radius: var(--r-md);
}

.c-btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--c-control-min-height);
  padding: 0 15px;
  border: 1px solid var(--c-line);
  border-radius: var(--c-control-radius);
  background: var(--c-panel);
  color: var(--c-ink);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
  box-shadow: var(--shadow-out);
  transition: transform var(--motion-dur) var(--motion-ease), box-shadow var(--motion-dur) var(--motion-ease), background-color var(--motion-dur) var(--motion-ease), color var(--motion-dur) var(--motion-ease);
}

.c-btn:hover,
button:hover {
  transform: translateY(-1px);
  box-shadow: 7px 7px 14px rgba(45, 60, 55, .10), -5px -5px 10px rgba(255, 255, 255, .95);
}

.c-btn:active,
button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-in);
}

.c-btn--primary {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #ffffff;
  box-shadow: inset 2px 2px 4px rgba(255, 255, 255, .25), inset -3px -3px 6px rgba(0, 0, 0, .25), 5px 5px 12px rgba(15, 111, 113, .22);
}

.c-btn--primary:hover {
  background: var(--c-accent-strong);
  box-shadow: inset 2px 2px 4px rgba(255, 255, 255, .25), inset -3px -3px 6px rgba(0, 0, 0, .25), 6px 6px 14px rgba(15, 111, 113, .20);
}

.c-btn--danger {
  background: var(--c-red);
  border-color: var(--c-red);
  color: #ffffff;
}

.c-btn--ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.c-btn:disabled,
button:disabled {
  opacity: .45;
  cursor: not-allowed;
  font-weight: 600;
  transform: none;
  box-shadow: none;
}

.c-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 12px;
  border: 1px solid var(--c-line);
  border-radius: 16px;
  background: var(--c-panel);
  color: var(--c-muted);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-out);
}

.c-pill--success {
  border-color: rgba(46, 139, 102, .24);
  background: #eef7f2;
  color: var(--c-success);
}

.c-pill--warn {
  border-color: rgba(213, 140, 50, .28);
  background: #fff8ec;
  color: #8b5b1e;
}

.c-pill--error {
  border-color: rgba(168, 68, 61, .28);
  background: #fff7f5;
  color: var(--c-red);
}

.c-pill--active {
  border-color: var(--c-accent);
  background: #edf7f5;
  color: var(--c-accent-strong);
}

.c-input,
input,
select,
textarea {
  width: 100%;
  min-height: var(--c-control-min-height);
  border: 1px solid var(--c-line);
  border-radius: var(--c-control-radius);
  padding: 10px 12px;
  background: #eef2f0;
  color: var(--c-ink);
  box-shadow: var(--shadow-in);
  font: inherit;
}

textarea {
  min-height: 108px;
  resize: vertical;
}

.c-input::placeholder,
input::placeholder,
select::placeholder,
textarea::placeholder {
  color: #8b9a95;
}

.c-segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-md);
  background: var(--c-panel-dark);
  box-shadow: var(--shadow-in);
}

.c-segmented__item {
  min-height: 32px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--c-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.c-segmented__item.active,
.c-segmented__item[aria-selected="true"] {
  background: var(--c-panel);
  color: var(--c-ink);
  box-shadow: 2px 2px 5px rgba(45, 60, 55, .08), -2px -2px 5px rgba(255, 255, 255, .9);
}

.c-led {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--c-muted);
  font-size: 12px;
}

.c-led::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-success);
  box-shadow: 0 0 0 4px rgba(46, 139, 102, .14), 0 0 8px var(--c-success);
}

.c-led--warn::before {
  background: var(--c-amber);
  box-shadow: 0 0 0 4px rgba(213, 140, 50, .16), 0 0 8px var(--c-amber);
}

.c-led--error::before {
  background: var(--c-red);
  box-shadow: 0 0 0 4px rgba(168, 68, 61, .14), 0 0 8px var(--c-red);
}

.c-card {
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: var(--r-lg);
  background: var(--c-panel);
  color: var(--c-ink);
  box-shadow: var(--shadow-out);
}

.c-card--mini {
  border-radius: var(--r-md);
  padding: 14px;
}

.c-card--metric {
  display: grid;
  min-height: 90px;
  align-content: start;
  gap: 6px;
  padding: 12px;
}

.c-card--stack {
  display: grid;
  align-content: start;
  gap: 6px;
}

.c-card strong {
  color: var(--c-ink);
  font-size: 18px;
}

.c-card span {
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.5;
}

.c-card p {
  margin: 0;
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.55;
}

.c-card--success {
  border-color: rgba(46, 139, 102, .24);
  background: #eef7f2;
}

.c-card--warn {
  border-color: rgba(213, 140, 50, .28);
  background: #fff8ec;
}

.c-card--error,
.c-card--danger {
  border-color: rgba(168, 68, 61, .28);
  background: #fff7f5;
}

.c-card--active {
  border-color: var(--c-accent);
  background: #edf7f5;
}

.c-stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

.c-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.c-note-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 10px;
}

.c-note {
  display: grid;
  gap: 2px;
  border: 0;
  background: transparent;
  padding: 0;
}

.c-note strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-ink);
}

.c-note span {
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.55;
}

.c-callout {
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  background: var(--c-panel);
  color: var(--c-ink);
  box-shadow: var(--shadow-in);
}

.c-callout:empty {
  display: none;
}

.c-callout--error {
  border-color: rgba(168, 68, 61, .28);
  background: #fff7f5;
  color: var(--c-red);
}

.c-callout--success {
  border-color: rgba(46, 139, 102, .24);
  background: #eef7f2;
  color: var(--c-success);
}

.c-callout--warn {
  border-color: rgba(213, 140, 50, .28);
  background: #fff8ec;
  color: #8b5b1e;
}

.c-eyebrow {
  margin: 0 0 5px;
  color: var(--c-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.c-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 20px;
  background: var(--c-panel);
  color: var(--c-muted);
  box-shadow: var(--shadow-out);
  font-size: 12px;
}

.c-row {
  display: flex;
  width: 100%;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  background: var(--c-panel);
  color: var(--c-ink);
  text-align: start;
  cursor: pointer;
  box-shadow: var(--shadow-out);
  transition: transform var(--motion-dur) var(--motion-ease), box-shadow var(--motion-dur) var(--motion-ease), background-color var(--motion-dur) var(--motion-ease);
}

.c-row:hover {
  transform: translateY(-1px);
  background: var(--c-panel-dark);
}

.c-row:active {
  transform: translateY(0);
  box-shadow: var(--shadow-in);
}

.c-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  color: var(--c-ink);
}

.c-switch::before {
  content: '';
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 13px;
  background: var(--c-panel-dark);
  box-shadow: var(--shadow-in);
}

.c-switch::after {
  content: '';
  position: absolute;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--c-panel);
  box-shadow: 2px 2px 5px rgba(45, 60, 55, .2);
}

.c-switch[aria-checked="true"]::before {
  background: var(--c-accent-strong);
}

.c-switch[aria-checked="true"]::after {
  left: 23px;
  background: var(--c-accent-soft);
}

.c-dial {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 50%;
  background: #eef2f0;
  box-shadow: var(--shadow-in);
  color: var(--c-accent);
  font-size: 15px;
  font-weight: 800;
}

.c-knob {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--c-panel);
  box-shadow: var(--shadow-out);
}

.c-knob::before {
  content: '';
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--c-panel-dark);
  box-shadow: var(--shadow-in);
}

.c-knob::after {
  content: '';
  position: absolute;
  top: 10px;
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--c-accent);
}

.c-fader {
  position: relative;
  width: 100%;
  height: 34px;
  border-radius: var(--r-md);
  background: var(--c-panel-dark);
  box-shadow: var(--shadow-in);
}

.c-fader::before {
  content: '';
  position: absolute;
  inset: 15px 14px auto;
  height: 4px;
  border-radius: 2px;
  background: #9fb0aa;
}

.c-fader::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 62%;
  width: 22px;
  height: 24px;
  border-radius: 6px;
  background: var(--c-panel);
  box-shadow: 3px 3px 7px rgba(45, 60, 55, .22);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.c-btn:focus-visible,
.c-input:focus-visible,
.c-segmented__item:focus-visible,
.c-switch:focus-visible {
  outline: 3px solid var(--c-amber);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .c-btn,
  button,
  .c-row,
  .c-switch,
  .c-btn--primary {
    transition: none;
  }

  .c-btn:hover,
  button:hover,
  .c-row:hover {
    transform: none;
  }
}
