.tangent-calculator-page {
  --tool-author-footer-max: 1120px;
}

.tangent-shell {
  width: min(1120px, calc(100% - 32px));
  max-width: none;
  margin: 24px auto 60px;
  padding: 0;
  color: #101828;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.tangent-shell .calc-page-head {
  margin-bottom: 20px;
}

.tangent-shell .calc-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #667085;
  font-size: 12px;
}

.tangent-shell .calc-breadcrumbs a {
  color: #667085;
  text-decoration: none;
}

.tangent-shell .calc-breadcrumbs a:hover,
.tangent-shell .calc-breadcrumbs a:focus-visible {
  color: #2364d2;
  text-decoration: underline;
}

.tangent-shell .calc-card {
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid rgba(20, 24, 30, 0.08);
  border-radius: 8px;
  background: #ffffff;
  padding: 20px;
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.7);
}

.tan-hero {
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 55%, #f6fbff 100%);
}

.tan-kicker {
  margin: 0 0 8px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tan-hero h1 {
  margin: 0 0 12px;
  color: #101828;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: 0;
}

.tangent-shell .calc-page-intro {
  margin: 0;
  max-width: 820px;
  color: #475467;
  font-size: 15px;
  line-height: 1.6;
}

.tan-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 1.05fr);
  gap: 16px;
  align-items: start;
}

.tan-panel,
.tan-result-card,
.tan-visual-card {
  display: grid;
  gap: 16px;
}

.tan-visual-card,
.tan-table-card,
.tan-action-section {
  grid-column: 1 / -1;
}

.tan-panel-head {
  display: grid;
  gap: 4px;
}

.tan-panel h2,
.tan-result-card h2,
.tan-visual-card h2,
.tan-reference h2 {
  margin: 0;
  color: #101828;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.tan-panel-head p,
.tan-result-card p,
.tan-reference p {
  margin: 0;
}

.tan-panel-head p {
  color: #667085;
  font-size: 14px;
  line-height: 1.55;
}

.tan-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tan-mode-tab {
  min-height: 38px;
  border: 1px solid #bfd1ef;
  border-radius: 999px;
  background: #ffffff;
  color: #1f3f82;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 0 14px;
  cursor: pointer;
}

.tan-mode-tab.is-active {
  border-color: #1b56c0;
  background: #1b56c0;
  color: #ffffff;
}

.tan-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 14px;
  align-items: end;
}

.tan-options-grid {
  padding-top: 4px;
  border-top: 1px solid #eef2f6;
}

.tan-field {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.tan-field input,
.tan-field select {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #ffffff;
  color: #101828;
  font: inherit;
  font-size: 15px;
  padding: 0 12px;
}

.tan-field input:focus,
.tan-field select:focus {
  border-color: #1d4ed8;
  outline: none;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}

[data-tan-section][hidden] {
  display: none;
}

.tan-validation {
  margin: 0;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
}

.tan-result-label {
  margin: 0;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tan-result-value {
  margin: 0;
  color: #101828;
  font-size: clamp(42px, 5vw, 64px);
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.tan-result-value[hidden] {
  display: none;
}

.tan-result-card .tan-result-equation {
  color: #101828;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 850;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.tan-result-card p {
  color: #475467;
  font-size: 15px;
  line-height: 1.6;
}

.tan-result-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tan-result-stats article {
  display: grid;
  gap: 4px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #f9fafb;
  padding: 12px;
}

.tan-result-stats span {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.tan-result-stats strong {
  color: #101828;
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.tan-visual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  gap: 16px;
  align-items: stretch;
}

.tan-chart-wrap,
.tan-unit-wrap {
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #f9fafb;
  padding: 12px;
}

.tan-chart,
.tan-unit-circle {
  display: block;
  width: 100%;
  height: auto;
}

.tan-grid-lines line {
  stroke: #dbe5f4;
  stroke-width: 1;
}

.tan-grid-lines .tan-zero-line {
  stroke: #94a3b8;
  stroke-width: 1.3;
}

.tan-grid-lines .tan-asymptote-line {
  stroke: #f59e0b;
  stroke-dasharray: 4 4;
}

.tan-wave-path {
  fill: none;
  stroke: #1d4ed8;
  stroke-width: 3;
  stroke-linecap: round;
}

.tan-marker-line {
  stroke: #be185d;
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
}

.tan-marker-dot {
  fill: #be185d;
  stroke: #ffffff;
  stroke-width: 2;
}

.tan-unit-ring {
  fill: #ffffff;
  stroke: #c8d3e7;
  stroke-width: 2;
}

.tan-axis {
  stroke: #94a3b8;
  stroke-width: 1.5;
}

.tan-radius {
  stroke: #1d4ed8;
  stroke-width: 3;
  stroke-linecap: round;
}

.tan-projection {
  stroke: #0f766e;
  stroke-width: 2;
  stroke-dasharray: 4 4;
}

.tan-axis-label {
  fill: #667085;
  font-size: 12px;
  font-weight: 800;
}

.tan-unit-copy {
  margin: 10px 0 0;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.tan-table-wrap {
  overflow-x: auto;
}

.tan-common-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.tan-common-table th,
.tan-common-table td {
  border-bottom: 1px solid #e4e7ec;
  padding: 10px 8px;
  text-align: left;
}

.tan-common-table th {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tan-common-table td {
  color: #101828;
  font-size: 14px;
}

.tan-common-table tr.is-current td {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
}

.tan-action-section {
  display: block;
}

.tan-reference {
  margin-top: 16px;
}

.tan-reference h2 {
  margin-bottom: 8px;
}

.tan-reference p {
  color: #344054;
  font-size: 15px;
  line-height: 1.65;
}

.tan-reference p + p {
  margin-top: 12px;
}

.tan-reference a {
  color: #101828;
  font-weight: 600;
  text-decoration: none;
}

.tan-reference a:hover,
.tan-reference a:focus-visible {
  color: #2364d2;
}

.tan-reference .calc-faq {
  display: grid;
  gap: 10px;
}

.tan-reference .calc-faq-item {
  overflow: hidden;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #ffffff;
}

.tan-reference .calc-faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  color: #101828;
  font-size: 17px;
  font-weight: 700;
}

.tan-reference .calc-faq-item summary::-webkit-details-marker {
  display: none;
}

.tan-reference .calc-faq-item > p {
  margin: 0;
  padding: 0 14px 14px;
}

@media (max-width: 900px) {
  .tan-layout,
  .tan-visual-grid {
    grid-template-columns: 1fr;
  }

  .tan-visual-card,
  .tan-table-card,
  .tan-action-section {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .tangent-shell {
    width: calc(100% - 20px);
    margin-top: 20px;
    margin-bottom: 42px;
  }

  .tangent-shell .calc-card {
    padding: 16px;
  }

  .tan-field-grid,
  .tan-result-stats {
    grid-template-columns: 1fr;
  }
}
