.stable-setup {
  max-width: 1160px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.stable-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stable-eyebrow {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stable-page-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
}

.stable-page-header p {
  margin: 0;
}


.stable-primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: auto;
  padding: 0.8rem 1.25rem;
  box-sizing: border-box;
}

.stable-count {
  font-size: 0.875rem;
}

.stable-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
}


.stable-card, .stable-empty-state, .stable-form {
  background: var(--color-background-secondary);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.stable-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.stable-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.stable-card-icon {
  padding: 0.65rem;
  border-radius: 12px;
  background: var(--color-background-tertiary);
  color: var(--color-foreground-secondary);
}

.stable-card h2 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1.65rem;
}

.stable-location {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.9rem;
}

.stable-location .material-icons {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.stable-contact {
  margin: 1.5rem 0;
}

.stable-contact h3 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}

.stable-contact p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.stable-contact a, .stable-edit-link, .stable-back-link {
  color: var(--color-foreground);
  text-underline-offset: 0.2em;
}

.stable-edit-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
}

.stable-capacity {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: auto 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}

.stable-capacity dt {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.stable-capacity dd {
  margin: 0.4rem 0 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.stable-empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
}

.stable-empty-state > .material-icons {
  font-size: 3rem;
  color: var(--color-text-muted);
}

.stable-empty-state h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.stable-empty-state p {
  max-width: 30rem;
  margin: 0 auto 1.5rem;
}

.stable-editor {
  max-width: 820px;
}

.stable-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
}

.stable-editor > .stable-back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
}

.stable-form {
  padding: 2rem;
}

.stable-form fieldset {
  min-width: 0;
  margin: 0 0 1.75rem;
  padding: 0 0 1rem;
  border: 0;
  border-bottom: 1px solid var(--color-border);
}

.stable-form legend {
  margin-bottom: 0.5rem;
  padding: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.stable-form-hint {
  font-size: 0.875rem;
  margin: 0.5rem 0 1.25rem;
}

.stable-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.stable-form .form-group {
  min-width: 0;
  margin-bottom: 0.75rem;
}

.stable-form .form-group label {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.stable-form .form-group input {
  width: 100%;
  color: var(--color-foreground);
}

.stable-form small {
  display: block;
  margin-top: 0.5rem;
  color: var(--color-text-muted);
}

.stable-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.5rem;
}

.stable-errors {
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--color-red);
  border-radius: 8px;
}

.stable-errors h2 {
  margin: 0;
  font-size: 1.25rem;
}

.stable-errors ul {
  margin-bottom: 0;
  padding-left: 1.25rem;
}

.stable-errors > p {
  margin: 0;
}

.stable-setup a:focus-visible, .stable-setup input:focus-visible {
  outline: 2px solid var(--color-foreground);
  outline-offset: 3px;
}


@media (max-width: 600px) {
  .stable-setup {
    padding: 1.25rem 1rem;
  }

  .stable-page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .stable-form {
    padding: 1.25rem;
  }

  .stable-form-grid {
    grid-template-columns: 1fr;
  }

  .stable-form-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .stable-form-actions > :is(a, button, input) {
    width: 100%;
    text-align: center;
  }

}
