/* Staircase Calculator - Content Area Styles */
:root {
  --stc-bg: #ffffff;
  --stc-surface: #f8fafc;
  --stc-card: #ffffff;
  --stc-border: #e2e8f0;
  --stc-line: #cbd5e1;
  --stc-ink: #0f172a;
  --stc-ink-soft: #475569;
  --stc-ink-faint: #94a3b8;
  --stc-primary: var(--tf-accent, #ea580c);
  --stc-primary-hover: #c2410c;
  --stc-green: #15803d;
  --stc-green-bg: #f0fdf4;
  --stc-red: #b91c1c;
  --stc-red-bg: #fef2f2;
  --stc-radius: 2px;
}

.stc-main {
  width: 100%;
  color: var(--stc-ink);
}

.stc-wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Controls bar */
.stc-controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--stc-surface);
  border: 1px solid var(--stc-line);
  border-radius: var(--stc-radius);
}

.stc-control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stc-control-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--stc-ink-soft);
}

/* 2-column Grid */
.stc-editor-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 860px) {
  .stc-editor-grid {
    grid-template-columns: 1fr;
  }
}

/* Panels */
.stc-panel {
  background: var(--stc-card);
  border: 1px solid var(--stc-line);
  border-radius: var(--stc-radius);
  padding: 24px;
  margin-bottom: 24px;
}

.stc-form-panel,
.stc-preview-panel,
.stc-results-panel {
  position: relative;
}

.stc-panel-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: var(--stc-ink);
}

.stc-ad {
  overflow: hidden;
  min-height: 280px;
}

/* Inputs */
.stc-grid {
  display: grid;
  gap: 12px;
}

.stc-grid-2 {
  grid-template-columns: 1fr 1fr;
}

.stc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stc-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--stc-ink);
}

.stc-hint {
  font-size: 0.75rem;
  color: var(--stc-ink-soft);
}

.stc-input-wrap {
  display: flex;
  align-items: center;
  position: relative;
}

.stc-input,
.stc-select {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.875rem;
  color: var(--stc-ink);
  background: var(--stc-card);
  border: 1px solid var(--stc-line);
  border-radius: var(--stc-radius);
  font-family: inherit;
  box-sizing: border-box;
}

.stc-input:focus,
.stc-select:focus {
  outline: 2px solid var(--stc-primary);
  border-color: var(--stc-primary);
}

.stc-unit-sfx {
  position: absolute;
  right: 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--stc-ink-soft);
  pointer-events: none;
}

.stc-input-wrap .stc-input {
  padding-right: 36px;
}

/* Action Bar */
.stc-action-bar {
  margin-top: 20px;
}

.stc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--stc-radius);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease;
  background: var(--stc-primary);
  color: #ffffff;
}

.stc-btn:hover {
  background: var(--stc-primary-hover);
}

.stc-btn-primary {
  background: var(--stc-primary);
  color: #ffffff;
}

.stc-btn-primary:hover {
  background: var(--stc-primary-hover);
}

.stc-btn-sm {
  padding: 6px 14px;
  font-size: 0.8125rem;
}

.stc-btn-secondary {
  background: var(--stc-surface);
  color: var(--stc-ink);
  border-color: var(--stc-line);
}

.stc-btn-secondary:hover {
  background: var(--stc-card);
  border-color: var(--stc-ink);
}

/* Schematic Diagram */
.stc-diagram-container {
  width: 100%;
  height: 220px;
  background: var(--stc-surface);
  border: 1px solid var(--stc-line);
  border-radius: var(--stc-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
}

.stc-diagram-svg {
  width: 100%;
  height: 100%;
}

/* Compliance Banner */
.stc-compliance-banner {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--stc-radius);
  background: var(--stc-green-bg);
  border: 1px solid var(--stc-green);
  display: flex;
  align-items: center;
  gap: 12px;
}

.stc-compliance-banner.is-warning {
  background: var(--stc-red-bg);
  border-color: var(--stc-red);
}

.stc-compliance-icon {
  font-size: 1.25rem;
}

.stc-compliance-text strong {
  display: block;
  font-size: 0.875rem;
  color: var(--stc-ink);
}

.stc-compliance-text span {
  font-size: 0.75rem;
  color: var(--stc-ink-soft);
}

/* Hero Summary */
.stc-summary-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stc-hero-card {
  padding: 20px;
  border: 1px solid var(--stc-line);
  border-radius: var(--stc-radius);
  background: var(--stc-surface);
}

.stc-hero-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--stc-ink-soft);
  margin-bottom: 6px;
}

.stc-hero-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--stc-primary);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.stc-hero-sub {
  font-size: 0.8125rem;
  color: var(--stc-ink-soft);
}

/* Stat Grid */
.stc-stat-grid {
  margin-top: 16px;
}

.stc-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stc-stat-box {
  padding: 14px;
  background: var(--stc-card);
  border: 1px solid var(--stc-line);
  border-radius: var(--stc-radius);
}

.stc-stat-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--stc-ink-soft);
  margin-bottom: 4px;
}

.stc-stat-num {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--stc-ink);
  font-variant-numeric: tabular-nums;
}

.stc-stat-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--stc-ink-soft);
  margin-top: 2px;
}

@media (max-width: 640px) {
  .stc-controls-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .stc-control-group {
    justify-content: space-between;
  }
}

/* tf:dark-palette — generated by migrate_chrome.py */
/* Neutrals inherit the shared chrome tokens so all tools share one
   ground; brand hues are kept and lightened, never inverted. */
[data-theme="dark"] {
  --stc-bg: var(--tf-surface);
  --stc-surface: var(--tf-surface);
  --stc-card: var(--tf-surface);
  --stc-border: var(--tf-surface);
  --stc-line: #98abc3;
  --stc-ink: var(--tf-ink);
  --stc-ink-soft: var(--tf-ink-soft);
  --stc-ink-faint: var(--tf-ink-faint);
  --stc-primary-hover: #da9b81;
  --stc-green: #5ed089;
  --stc-green-bg: var(--tf-surface);
  --stc-red: #da8181;
  --stc-red-bg: var(--tf-surface);
}
