.year-system-page {
  --year-frame-width: 1010px;
  --year-ink: #1c2940;
  --year-ink-soft: #50617d;
}

.year-system-page .tool-frame {
  width: 100%;
  max-width: var(--year-frame-width);
  margin-inline: auto;
}

.year-system-page .tool-shell {
  padding: 0.95rem;
  border-radius: 1.5rem;
}

.year-system-page .tool-header-block {
  max-width: 40rem;
}

.year-system-page .page-title {
  max-width: none;
  font-size: clamp(2.25rem, 3.82vw, 2.95rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.year-system-page .page-subtitle {
  max-width: 34rem;
  font-size: 1rem;
  color: #9eb2d3;
}

.year-system-tool {
  gap: 0.82rem;
}

.year-system-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 0.1rem;
}

.year-language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.24rem;
  border-radius: 999px;
  border: 1px solid rgba(100, 132, 182, 0.24);
  background:
    linear-gradient(135deg, rgba(167, 126, 82, 0.2), rgba(57, 91, 145, 0.22)),
    rgba(10, 18, 34, 0.9);
}

.year-language-button {
  border: 0;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  background: transparent;
  color: #b5c4dc;
  font: inherit;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.year-language-button:hover,
.year-language-button:focus-visible {
  outline: none;
  color: #f7fbff;
  background: rgba(94, 129, 188, 0.16);
}

.year-language-button.is-active {
  background: linear-gradient(135deg, rgba(238, 224, 200, 0.96), rgba(221, 204, 177, 0.94));
  color: var(--year-ink);
  box-shadow: 0 10px 22px rgba(11, 18, 32, 0.18);
}

.year-clear-button {
  min-width: 5.25rem;
  min-height: 2.55rem;
}

.year-system-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 0.84rem;
}

.year-source-panel,
.year-results-panel {
  min-width: 0;
  border-radius: 1.2rem;
  overflow: hidden;
  border: 1px solid rgba(109, 136, 175, 0.24);
  box-shadow: 0 16px 36px rgba(8, 14, 25, 0.2);
}

.year-source-panel {
  display: grid;
  gap: 0.66rem;
  padding: 0.78rem;
  background:
    radial-gradient(circle at top right, rgba(96, 132, 191, 0.22), transparent 44%),
    linear-gradient(180deg, rgba(19, 33, 55, 0.98), rgba(10, 17, 30, 0.98));
  color: #eef5ff;
}

.year-results-panel {
  display: grid;
  gap: 0.66rem;
  padding: 0.78rem;
  background:
    radial-gradient(circle at top left, rgba(181, 144, 98, 0.14), transparent 38%),
    linear-gradient(180deg, rgba(242, 238, 231, 0.98), rgba(233, 227, 217, 0.98));
  color: var(--year-ink);
}

.year-panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.55rem;
}

.year-panel-eyebrow {
  margin: 0 0 0.18rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7da0d2;
}

.year-results-panel .year-panel-eyebrow {
  color: #7f6c4b;
}

.year-panel-title {
  margin: 0;
  font-size: 1.16rem;
  line-height: 1.08;
}

.year-panel-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 1.56rem;
  padding: 0.1rem 0.52rem;
  border-radius: 999px;
  border: 1px solid rgba(125, 160, 210, 0.26);
  background: rgba(255, 255, 255, 0.08);
  color: #c9d8ee;
  font-size: 0.76rem;
}

.year-panel-pill--soft {
  border-color: rgba(128, 108, 75, 0.18);
  background: rgba(255, 255, 255, 0.5);
  color: #66553a;
}

.year-system-mobile-select {
  display: grid;
  gap: 0.3rem;
}

.year-source-stack {
  display: grid;
  gap: 0.58rem;
}

.year-source-card {
  display: grid;
  gap: 0.58rem;
  padding: 0.62rem;
  border-radius: 1rem;
  border: 1px solid rgba(124, 160, 215, 0.16);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.year-source-card--primary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.03);
}

.year-source-card--secondary {
  gap: 0.42rem;
}

.year-source-card--status {
  gap: 0.46rem;
}

@media (min-width: 701px) {
  .year-source-stack {
    grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
    align-items: start;
  }

  .year-source-card--primary {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }

  .year-source-card--primary .year-era-block {
    grid-column: 1 / -1;
  }

  .year-source-card--status {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

.year-input-block,
.year-era-block,
.year-source-summary {
  display: grid;
  gap: 0.34rem;
}

.year-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #f4f7fc;
}

.year-label--compact {
  font-size: 0.78rem;
  color: #cdd9ed;
}

.year-input,
.year-select {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.66rem 0.82rem;
  border-radius: 0.92rem;
  border: 1px solid rgba(125, 162, 219, 0.26);
  background: rgba(248, 251, 255, 0.98);
  color: var(--year-ink);
  font: inherit;
  font-size: 0.97rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.year-input::placeholder {
  color: #7285a4;
}

.year-input:focus-visible,
.year-select:focus-visible {
  outline: 2px solid rgba(124, 169, 235, 0.42);
  outline-offset: 2px;
  border-color: rgba(124, 169, 235, 0.48);
}

.year-inline-help {
  margin: 0;
  color: #b5c4dc;
  font-size: 0.82rem;
  line-height: 1.35;
}

.year-example-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.year-example-label {
  font-size: 0.76rem;
  color: #b5c4dc;
}

.year-example-chip {
  border: 1px solid rgba(124, 160, 215, 0.2);
  border-radius: 999px;
  padding: 0.34rem 0.66rem;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.year-example-chip:hover,
.year-example-chip:focus-visible {
  outline: none;
  border-color: rgba(185, 211, 246, 0.42);
  background: rgba(255, 255, 255, 0.08);
}

.year-summary-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9bb5d8;
}

.year-summary-value {
  margin: 0;
  min-height: 0;
  padding: 0.62rem 0.74rem;
  border-radius: 0.92rem;
  background: rgba(255, 255, 255, 0.07);
  color: #f8fbff;
  font-size: 0.94rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.year-results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.62rem;
  align-content: start;
}

.year-result-card {
  display: grid;
  gap: 0.42rem;
  min-height: 6.2rem;
  padding: 0.7rem;
  border-radius: 1rem;
  border: 1px solid rgba(124, 108, 76, 0.15);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.year-result-card.is-source {
  border-color: rgba(83, 120, 177, 0.34);
  background:
    linear-gradient(180deg, rgba(235, 244, 255, 0.94), rgba(224, 235, 252, 0.94)),
    rgba(255, 255, 255, 0.7);
}

.year-result-card.is-muted {
  background: rgba(255, 255, 255, 0.44);
}

.year-result-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.year-result-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #5c4d36;
}

.year-result-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.08rem 0.48rem;
  border-radius: 999px;
  background: rgba(68, 111, 177, 0.16);
  color: #35517b;
  font-size: 0.76rem;
  font-weight: 700;
}

.year-result-value {
  font-size: clamp(1.12rem, 1.7vw, 1.56rem);
  line-height: 1.12;
  color: var(--year-ink);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.year-result-note {
  margin: auto 0 0;
  color: var(--year-ink-soft);
  font-size: 0.82rem;
  line-height: 1.32;
}

.year-status {
  margin: 0;
  padding: 0.64rem 0.74rem;
  border-radius: 1rem;
  border: 1px solid rgba(99, 134, 188, 0.2);
  background:
    linear-gradient(135deg, rgba(163, 124, 79, 0.14), rgba(41, 74, 126, 0.18)),
    rgba(10, 18, 33, 0.92);
  color: #d8e7fc;
  font-size: 0.88rem;
  line-height: 1.35;
}

.year-status.is-error {
  border-color: rgba(177, 88, 74, 0.34);
  background:
    linear-gradient(135deg, rgba(120, 42, 36, 0.3), rgba(58, 25, 26, 0.2)),
    rgba(33, 16, 21, 0.96);
  color: #fde6df;
}

.year-status.is-success {
  border-color: rgba(80, 126, 92, 0.34);
  background:
    linear-gradient(135deg, rgba(70, 105, 73, 0.22), rgba(26, 53, 41, 0.18)),
    rgba(17, 27, 23, 0.96);
  color: #e5f5df;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 700px) {
  .year-system-layout {
    grid-template-columns: 1fr;
  }

  .year-result-card {
    min-height: 0;
  }
}

@media (max-width: 820px) {
  .year-system-layout {
    gap: 0.74rem;
  }

  .year-source-panel,
  .year-results-panel {
    padding: 0.74rem;
  }

  .year-source-card {
    padding: 0.58rem;
    border-radius: 0.9rem;
  }

  .year-result-card {
    min-height: 6rem;
    padding: 0.68rem;
  }
}

@media (min-width: 701px) and (max-width: 820px) {
  .year-example-strip {
    display: none;
  }

  .year-source-card--secondary {
    display: none;
  }

  .year-source-card--status {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .year-system-page .container {
    width: min(100% - 36px, var(--container-max));
  }

  .year-system-page .tool-shell {
    padding: 0.72rem;
  }

  .year-system-page .page-title {
    max-width: 7.4ch;
    font-size: clamp(1.82rem, 7.15vw, 2.08rem);
    line-height: 0.95;
  }

  .year-system-page .page-subtitle {
    max-width: 20rem;
    font-size: 0.9rem;
  }

  .year-system-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.54rem;
  }

  .year-language-toggle {
    margin-left: 0;
    justify-self: start;
  }

  .year-clear-button {
    width: auto;
    min-width: 4.45rem;
    min-height: 2.52rem;
    padding-inline: 0.74rem;
  }

  .year-source-panel,
  .year-results-panel {
    padding: 0.7rem;
  }

  .year-panel-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .year-source-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .year-source-card--primary {
    grid-column: 1 / -1;
  }

  .year-example-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.32rem;
  }

  .year-example-label {
    grid-column: 1 / -1;
  }

  .year-example-chip {
    justify-content: center;
    text-align: center;
  }

  .year-result-card {
    min-height: 0;
  }
}

@media (max-width: 420px) {
  .year-results-grid {
    grid-template-columns: 1fr;
  }

  .year-source-card--status .year-status {
    font-size: 0.82rem;
  }
}
