.fedsac-app {
  --fedsac-bg: #f4f6f8;
  --fedsac-surface: #ffffff;
  --fedsac-surface-2: #eef1f5;
  --fedsac-text: #17202a;
  --fedsac-muted: #5f6b7a;
  --fedsac-border: #d9e0e8;
  --fedsac-accent: #424b57;
  --fedsac-accent-2: #111827;
  --fedsac-danger: #b42318;
  --fedsac-success: #087443;
  --fedsac-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  color: var(--fedsac-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  margin: 0 auto;
  max-width: 1180px;
}

.fedsac-app[data-theme="dark"] {
  --fedsac-bg: #0d1117;
  --fedsac-surface: #161b22;
  --fedsac-surface-2: #212832;
  --fedsac-text: #f4f7fb;
  --fedsac-muted: #b7c0cc;
  --fedsac-border: #303846;
  --fedsac-accent: #c9d1d9;
  --fedsac-accent-2: #f4f7fb;
  --fedsac-danger: #ff938a;
  --fedsac-success: #7ee2a8;
  --fedsac-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

.fedsac-app *,
.fedsac-app *::before,
.fedsac-app *::after {
  box-sizing: border-box;
}

.fedsac-shell {
  background: linear-gradient(135deg, var(--fedsac-bg), var(--fedsac-surface-2));
  border: 1px solid var(--fedsac-border);
  border-radius: 28px;
  box-shadow: var(--fedsac-shadow);
  padding: 18px;
  width: 100%;
}

.fedsac-header {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.fedsac-kicker {
  color: var(--fedsac-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.fedsac-header h2,
.fedsac-section-head h3 {
  color: var(--fedsac-text);
  line-height: 1.15;
  margin: 0;
}

.fedsac-header h2 {
  font-size: clamp(1.55rem, 4vw, 2.6rem);
  font-weight: 900;
}

.fedsac-theme-toggle,
.fedsac-btn {
  align-items: center;
  background: var(--fedsac-accent-2);
  border: 1px solid var(--fedsac-accent-2);
  border-radius: 999px;
  color: var(--fedsac-surface);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  gap: 8px;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.fedsac-theme-toggle:hover,
.fedsac-btn:hover {
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
  transform: translateY(-1px);
}

.fedsac-theme-toggle:focus-visible,
.fedsac-btn:focus-visible,
.fedsac-app input:focus-visible,
.fedsac-app select:focus-visible {
  outline: 3px solid #8ab4ff;
  outline-offset: 3px;
}

.fedsac-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}

.fedsac-panel {
  background: var(--fedsac-surface);
  border: 1px solid var(--fedsac-border);
  border-radius: 24px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  padding: 18px;
}

.fedsac-section-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.fedsac-section-head h3 {
  font-size: 1.08rem;
  font-weight: 900;
}

.fedsac-section-head p {
  color: var(--fedsac-muted);
  font-size: 0.92rem;
  margin: 4px 0 0;
}

.fedsac-icon {
  align-items: center;
  background: var(--fedsac-surface-2);
  border: 1px solid var(--fedsac-border);
  border-radius: 14px;
  color: var(--fedsac-accent-2);
  display: inline-flex;
  flex: 0 0 40px;
  font-weight: 900;
  height: 40px;
  justify-content: center;
}

.fedsac-space-top {
  margin-top: 24px;
}

.fedsac-field-row {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.fedsac-field-row label,
.fedsac-switch {
  color: var(--fedsac-text);
  font-size: 0.92rem;
  font-weight: 800;
}

.fedsac-app input,
.fedsac-app select {
  background: var(--fedsac-surface);
  border: 1px solid var(--fedsac-border);
  border-radius: 14px;
  color: var(--fedsac-text);
  font: inherit;
  min-height: 46px;
  padding: 10px 12px;
  width: 100%;
}

.fedsac-money-input {
  align-items: center;
  background: var(--fedsac-surface);
  border: 1px solid var(--fedsac-border);
  border-radius: 14px;
  display: flex;
  overflow: hidden;
}

.fedsac-money-input span {
  color: var(--fedsac-muted);
  font-weight: 900;
  padding-left: 14px;
}

.fedsac-money-input input {
  border: 0;
  border-radius: 0;
}

.fedsac-switch {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 10px;
  margin: 8px 0 14px;
}

.fedsac-switch input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.fedsac-switch-ui {
  background: var(--fedsac-border);
  border-radius: 999px;
  display: inline-flex;
  height: 28px;
  position: relative;
  transition: background 160ms ease;
  width: 52px;
}

.fedsac-switch-ui::after {
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
  content: "";
  height: 22px;
  left: 3px;
  position: absolute;
  top: 3px;
  transition: transform 160ms ease;
  width: 22px;
}

.fedsac-switch input:checked + .fedsac-switch-ui {
  background: var(--fedsac-accent-2);
}

.fedsac-switch input:checked + .fedsac-switch-ui::after {
  transform: translateX(24px);
}

.fedsac-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.fedsac-btn-secondary {
  background: transparent;
  color: var(--fedsac-accent-2);
}

.fedsac-card-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  margin: 18px 0;
}

.fedsac-result-card {
  background: var(--fedsac-surface-2);
  border: 1px solid var(--fedsac-border);
  border-radius: 18px;
  padding: 16px;
}

.fedsac-result-card span {
  color: var(--fedsac-muted);
  display: block;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fedsac-result-card strong {
  color: var(--fedsac-text);
  display: block;
  font-size: clamp(1.35rem, 4vw, 2rem);
  line-height: 1.15;
  margin-top: 6px;
  word-break: break-word;
}

.fedsac-alert {
  background: rgba(180, 35, 24, 0.11);
  border: 1px solid rgba(180, 35, 24, 0.3);
  border-radius: 14px;
  color: var(--fedsac-danger);
  font-weight: 800;
  margin: 12px 0;
  padding: 12px;
}

.fedsac-chart-wrap {
  background: var(--fedsac-surface-2);
  border: 1px solid var(--fedsac-border);
  border-radius: 18px;
  margin: 16px 0;
  overflow: hidden;
  padding: 10px;
}

.fedsac-chart-wrap canvas {
  display: block;
  height: auto;
  max-width: 100%;
  width: 100%;
}

.fedsac-table-wrap {
  border: 1px solid var(--fedsac-border);
  border-radius: 18px;
  overflow-x: auto;
}

.fedsac-table {
  border-collapse: collapse;
  min-width: 440px;
  width: 100%;
}

.fedsac-table caption {
  height: 1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.fedsac-table th,
.fedsac-table td {
  border-bottom: 1px solid var(--fedsac-border);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.fedsac-table th {
  background: var(--fedsac-surface-2);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.fedsac-table tr:last-child td {
  border-bottom: 0;
}

.fedsac-result-actions .fedsac-btn {
  flex: 1 1 150px;
}

@media (min-width: 640px) {
  .fedsac-shell {
    padding: 24px;
  }

  .fedsac-header {
    align-items: center;
    flex-direction: row;
  }

  .fedsac-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .fedsac-grid {
    align-items: start;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  }

  .fedsac-panel {
    padding: 24px;
  }
}

@media print {
  .fedsac-theme-toggle,
  .fedsac-actions {
    display: none !important;
  }

  .fedsac-shell,
  .fedsac-panel {
    box-shadow: none;
  }
}
