:root {
  --paper: #f7f5ef;
  --paper-strong: #fffdf7;
  --ink: #18211f;
  --muted: #65716d;
  --line: #d9ded6;
  --shadow: 0 20px 50px rgba(42, 56, 50, 0.11);
  --season: #4e8a61;
  --tide: #6075a8;
  --wildlife: #117d78;
  --protocol: #b66b2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.95), rgba(247, 245, 239, 0.98)),
    radial-gradient(circle at 15% 5%, rgba(78, 138, 97, 0.14), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(96, 117, 168, 0.16), transparent 30%),
    var(--paper);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input,
output,
select {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 36px;
}

.site-header {
  max-width: 1180px;
  margin-bottom: 22px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.module-kicker {
  color: #273733;
  font-size: clamp(1.14rem, 1.8vw, 1.38rem);
  font-weight: 800;
  line-height: 1.2;
  text-transform: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(2.8rem, 5.8vw, 3.8rem);
  line-height: 0.98;
  letter-spacing: 0;
  white-space: nowrap;
}

.subtitle {
  margin-bottom: 8px;
  color: #32403c;
  font-size: clamp(1rem, 1.8vw, 1.24rem);
  font-weight: 600;
}

.translator,
.dial-card,
.result-panel {
  border: 1px solid rgba(92, 109, 101, 0.18);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.78);
  box-shadow: var(--shadow);
}

.translator {
  border-top: 4px solid rgba(38, 59, 53, 0.78);
  border-left: 4px solid rgba(38, 59, 53, 0.62);
  padding: clamp(18px, 3vw, 28px);
}

.translator-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.dial-copy h3,
.result-panel h2 {
  margin-bottom: 0;
  font-size: clamp(1.05rem, 1.45vw, 1.28rem);
  line-height: 1.2;
  white-space: nowrap;
}

.module-description {
  max-width: 980px;
  margin: 0;
  color: #4f615b;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
  white-space: nowrap;
}

.validation {
  min-height: 1.4em;
  margin: 3px 0 0;
  color: #9a3f2d;
  font-weight: 600;
}

.time-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 0.8fr)) minmax(190px, 1.25fr) minmax(170px, 0.9fr);
  gap: 14px;
  align-items: end;
}

.prototype-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.data-source {
  margin: 8px 0 0;
  color: #52625d;
  font-size: 0.78rem;
  line-height: 1.5;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cfd7d1;
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--paper-strong);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

select {
  cursor: pointer;
}

input:focus,
select:focus {
  border-color: #73977d;
  box-shadow: 0 0 0 4px rgba(78, 138, 97, 0.16);
}

.year-display {
  min-height: 48px;
  display: flex;
  align-items: center;
  color: var(--ink);
  font-weight: 700;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #fff;
  background: #263b35;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

button:hover {
  background: #1d2e29;
  transform: translateY(-1px);
}

.time-layers {
  margin-top: 24px;
  border: 1px solid rgba(92, 109, 101, 0.16);
  border-left: 4px solid rgba(96, 117, 168, 0.55);
  border-radius: 8px;
  padding: clamp(18px, 2.5vw, 24px);
  background: rgba(255, 253, 247, 0.46);
}

.time-layers-heading {
  max-width: 720px;
  margin-bottom: 14px;
}

.dial-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 0;
}

.dial-card {
  display: grid;
  grid-template-columns: minmax(140px, 0.82fr) minmax(178px, 1fr);
  gap: clamp(12px, 1.7vw, 18px);
  align-content: start;
  align-items: stretch;
  min-height: 250px;
  padding: clamp(14px, 2vw, 18px);
  background: rgba(255, 253, 247, 0.56);
  box-shadow: 0 12px 28px rgba(42, 56, 50, 0.07);
  overflow: hidden;
}

.dial-card[data-dial-card="season"] {
  border-top: 3px solid rgba(78, 138, 97, 0.72);
}

.dial-card[data-dial-card="tide"] {
  border-top: 3px solid rgba(96, 117, 168, 0.72);
}

.dial-copy {
  align-self: stretch;
  justify-self: start;
  display: grid;
  grid-template-rows: auto 1fr;
  width: 100%;
  min-width: 0;
}

.dial-copy h3 {
  color: #22312d;
}

.dial-state-copy {
  align-self: center;
}

.layer-note {
  max-width: 360px;
  margin: 8px 0 0;
  color: #33433f;
  font-size: 0.94rem;
  font-weight: 400;
  line-height: 1.6;
  white-space: pre-line;
}

.dial-wrap {
  align-self: center;
  display: grid;
  justify-items: center;
  min-width: 0;
}

.dial-wrap .dial {
  margin: 0 auto;
}

.dial {
  position: relative;
  width: min(100%, 208px);
  aspect-ratio: 1;
  margin-left: auto;
  border-radius: 50%;
}

.dial-pointer {
  position: absolute;
  z-index: 4;
  inset: 0;
  transform: rotate(0deg);
  transform-origin: center;
  transition: transform 1280ms cubic-bezier(0.2, 0.82, 0.23, 1);
  will-change: transform;
  pointer-events: none;
}

.dial-pointer::before {
  content: "";
  position: absolute;
  bottom: 50%;
  left: 50%;
  width: 9px;
  height: 76px;
  background: #263b35;
  clip-path: polygon(50% 0, 100% 26px, 70% 26px, 70% 100%, 30% 100%, 30% 26px, 0 26px);
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  filter: drop-shadow(0 2px 3px rgba(24, 33, 31, 0.2));
}

.dial-wheel {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(24, 33, 31, 0.12);
  border-radius: 50%;
  box-shadow: inset 0 0 0 9px rgba(255, 253, 247, 0.5), 0 10px 22px rgba(40, 52, 47, 0.09);
}

.dial-wheel::after {
  content: "";
  position: absolute;
  inset: 32%;
  border-radius: 50%;
  background: var(--paper-strong);
  box-shadow: 0 0 0 1px rgba(24, 33, 31, 0.12), 0 5px 14px rgba(40, 52, 47, 0.09);
}

.dial-label-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.dial-arc-label {
  color: rgba(24, 33, 31, 0.56);
  fill: currentColor;
  font-size: 4.8px;
  font-weight: 500;
  transition: color 220ms ease;
}

.dial-arc-label.is-selected {
  color: #101817;
  font-weight: 850;
}

.dial-centre {
  position: absolute;
  inset: 33%;
  z-index: 5;
  display: grid;
  place-items: center;
  border-radius: 50%;
  padding: 7px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.96);
  font-size: clamp(0.72rem, 1.18vw, 0.84rem);
  font-weight: 800;
  line-height: 1.18;
  text-align: center;
  box-shadow: 0 0 0 1px rgba(24, 33, 31, 0.12), 0 5px 14px rgba(40, 52, 47, 0.1);
}

.results {
  margin-top: 22px;
  border: 1px solid rgba(92, 109, 101, 0.16);
  border-left: 4px solid rgba(17, 125, 120, 0.55);
  border-radius: 8px;
  padding: clamp(18px, 2.5vw, 24px);
  background: rgba(255, 253, 247, 0.5);
}

.results-heading {
  margin-bottom: 14px;
}

.translation-summary {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  border: 1px solid rgba(92, 109, 101, 0.16);
  border-radius: 8px;
  padding: clamp(16px, 2.2vw, 22px);
  background: rgba(255, 253, 247, 0.7);
}

.translation-summary h2 {
  max-width: 100%;
  margin: 0;
  color: #22312d;
  font-size: clamp(1.08rem, 1.7vw, 1.48rem);
  line-height: 1.22;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.translation-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border-top: 1px solid rgba(92, 109, 101, 0.14);
  padding-top: 12px;
}

.translation-summary .status-badge {
  display: inline-flex;
  margin-top: 0;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.62fr) minmax(0, 1fr);
  grid-template-areas:
    "wildlife why protocol";
  gap: 22px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 320ms ease, transform 320ms ease;
}

.results.is-empty .result-grid {
  display: none;
}

.results.is-empty .result-action-row {
  display: none;
}

.results.is-empty .translation-summary {
  display: none;
}

.results.is-empty .results-heading {
  display: none;
}

.result-panel {
  min-height: 210px;
  padding: clamp(20px, 3vw, 30px);
}

.result-copy-block + .result-copy-block {
  margin-top: 22px;
  border-top: 1px solid rgba(92, 109, 101, 0.16);
  padding-top: 20px;
}

.result-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.result-panel .section-kicker {
  font-weight: 800;
}

.dial-card .section-kicker,
.translation-reading > .section-kicker,
.result-copy-block > .section-kicker,
.why-panel > .section-kicker,
.result-panel-heading > .section-kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.status-badge {
  flex: 0 0 auto;
  max-width: 260px;
  border: 1px solid rgba(182, 107, 47, 0.26);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.sensitivity-badge {
  color: #6d3d20;
  background: rgba(182, 107, 47, 0.1);
}

.sensitivity-badge[data-level="very-high"] {
  border-color: rgba(154, 63, 45, 0.3);
  color: #783424;
  background: rgba(154, 63, 45, 0.1);
}

.sensitivity-badge[data-level="high"] {
  border-color: rgba(182, 107, 47, 0.3);
  color: #6d3d20;
  background: rgba(182, 107, 47, 0.1);
}

.sensitivity-badge[data-level="medium-high"],
.sensitivity-badge[data-level="medium"] {
  border-color: rgba(117, 117, 80, 0.3);
  color: #575734;
  background: rgba(117, 117, 80, 0.1);
}

.action-badge {
  border-color: rgba(38, 59, 53, 0.24);
  color: #263b35;
  background: rgba(38, 59, 53, 0.08);
}

.wildlife-panel {
  grid-area: wildlife;
  border-top: 4px solid var(--wildlife);
}

.why-panel {
  grid-area: why;
  min-height: 210px;
  border-top: 4px solid rgba(38, 59, 53, 0.56);
  background: rgba(255, 253, 247, 0.82);
}

.protocol-panel {
  grid-area: protocol;
  border-top: 4px solid var(--protocol);
}

.result-action-row {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.mudflat-view-button {
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid rgba(38, 59, 53, 0.18);
  color: #fff;
  background: #263b35;
  box-shadow: 0 10px 22px rgba(42, 56, 50, 0.1);
}

.result-text p {
  margin: 0 0 0.9rem;
  color: #33433f;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.75;
}

.result-text p + p {
  margin-top: 0.78rem;
}

.result-text p:last-child {
  margin-bottom: 0;
}

.footer-notes {
  margin-top: 24px;
  border-top: 1px solid rgba(92, 109, 101, 0.2);
  padding-top: 14px;
}

@media (max-width: 920px) {
  .time-form,
  .dial-section {
    grid-template-columns: 1fr 1fr;
  }

  .result-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "wildlife"
      "why"
      "protocol";
  }

  .time-form button {
    grid-column: 1 / -1;
  }

  .dial-card {
    grid-template-columns: 1fr;
  }

  .dial {
    margin: 0 auto;
  }

  h1 {
    font-size: 3.1rem;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 24px, 1120px);
    padding-top: 32px;
  }

  .translator-heading {
    display: block;
  }

  .time-form,
  .dial-section {
    grid-template-columns: 1fr;
  }

  .dial-card {
    min-height: auto;
  }

  .dial {
    width: min(100%, 204px);
  }

  .result-grid {
    grid-template-areas:
      "wildlife"
      "why"
      "protocol";
  }

  .translation-summary h2 {
    white-space: normal;
  }

  .module-description,
  .dial-copy h3 {
    white-space: normal;
  }

  h1 {
    font-size: 2.25rem;
    white-space: normal;
  }
}
