:root {
  --bg: #edf3ee;
  --bg-deep: #d7e5da;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: #ffffff;
  --card: rgba(255, 255, 255, 0.92);
  --glass: rgba(255, 255, 255, 0.52);
  --border: rgba(25, 42, 33, 0.12);
  --border-strong: rgba(25, 42, 33, 0.18);
  --text: #13211b;
  --muted: #5c7066;
  --muted-soft: #7e8f86;
  --accent: #1f6f52;
  --accent-strong: #165942;
  --accent-soft: #dcebe2;
  --accent-wash: rgba(31, 111, 82, 0.1);
  --accent-2: #8ea67c;
  --danger: #b24a50;
  --success: #1f8c5b;
  --shadow: 0 24px 70px rgba(17, 29, 23, 0.1);
  --shadow-sm: 0 12px 30px rgba(17, 29, 23, 0.08);
  --radius: 24px;
  --radius-sm: 16px;
  --radius-xs: 12px;
  --layout-gap: 22px;
  --result-card-height: 360px;
  --shap-card-height: 620px;
  --base-card-height: 390px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 12%, rgba(31, 111, 82, 0.12), transparent 24%),
    radial-gradient(circle at 88% 8%, rgba(142, 166, 124, 0.18), transparent 20%),
    radial-gradient(circle at 76% 82%, rgba(31, 111, 82, 0.08), transparent 24%),
    linear-gradient(180deg, #f6faf7 0%, var(--bg) 40%, #e7efe9 100%);
  overflow-x: hidden;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
  filter: blur(10px);
}

body::before {
  top: -18vh;
  left: -12vw;
  width: 40vw;
  height: 55vh;
  background: radial-gradient(circle, rgba(31, 111, 82, 0.12), transparent 68%);
}

body::after {
  right: -14vw;
  bottom: -22vh;
  width: 44vw;
  height: 60vh;
  background: radial-gradient(circle, rgba(142, 166, 124, 0.16), transparent 66%);
}

::selection {
  background: rgba(31, 111, 82, 0.18);
}

button,
input,
select {
  font: inherit;
}

img {
  max-width: 100%;
}

h1,
h2,
h3,
.brand__name {
  font-family: "Fraunces", serif;
  letter-spacing: 0.02em;
}

h3 {
  margin: 0;
}

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 22px 48px;
}

.topbar {
  position: sticky;
  top: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0;
  color: var(--text);
  font-weight: 700;
  flex: 0 0 auto;
}

.brand__logo {
  display: block;
  width: min(420px, 48vw);
  height: auto;
  max-height: 64px;
  object-fit: contain;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.brand__name {
  font-size: 1.05rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-left: 2px;
}

.lang-toggle {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.34);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.lang-toggle:hover,
.lang-switch.is-open .lang-toggle {
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--border);
  box-shadow: 0 10px 20px rgba(17, 29, 23, 0.06);
  transform: translateY(-1px);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 132px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 28px rgba(17, 29, 23, 0.12);
  backdrop-filter: blur(8px);
  display: grid;
  gap: 6px;
  z-index: 25;
}

.lang-menu__item {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
  padding: 0 10px;
  cursor: pointer;
}

.lang-menu__item:hover {
  background: rgba(31, 111, 82, 0.1);
  color: var(--accent-strong);
}

.lang-menu__item.is-active {
  border-color: rgba(31, 111, 82, 0.22);
  background: rgba(31, 111, 82, 0.12);
  color: var(--accent-strong);
}

.lang-toggle:focus-visible,
.lang-menu__item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 111, 82, 0.14);
}

#lang-select,
#lang-label {
  display: none;
}

#lang-select {
  min-height: 40px;
  min-width: 108px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background-color: rgba(255, 255, 255, 0.9);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 3px),
    calc(100% - 11px) calc(50% - 3px);
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
  padding: 0 28px 0 12px;
  box-shadow: none;
  font-size: 0.9rem;
  font-weight: 700;
}

#lang-select:focus {
  box-shadow: 0 0 0 3px rgba(31, 111, 82, 0.14);
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.34);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.nav-links a:hover {
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--border);
  box-shadow: 0 10px 20px rgba(17, 29, 23, 0.06);
  transform: translateY(-1px);
}

.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero__text h1 {
  margin: 6px 0;
  font-size: 2.5rem;
}

.hero__text .lede {
  color: var(--muted);
  max-width: 720px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero__badges {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.92fr);
  grid-template-areas:
    "panel result"
    "panel shap"
    "panel base";
  align-items: start;
  gap: var(--layout-gap);
}

.panel,
.card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(249, 252, 250, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel::before,
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 120px;
  background: linear-gradient(180deg, rgba(31, 111, 82, 0.07), transparent 72%);
  pointer-events: none;
}

.panel {
  padding: 22px 22px 18px;
}

.panel--input {
  grid-area: panel;
  display: flex;
  flex-direction: column;
  height: calc(
    var(--result-card-height) +
    var(--shap-card-height) +
    var(--base-card-height) +
    (var(--layout-gap) * 2)
  );
  min-height: 0;
}

.panel--input::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -70px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(31, 111, 82, 0.14), transparent 68%);
  pointer-events: none;
}

.panel__header,
.panel__footer,
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.panel--input .panel__header {
  align-items: flex-start;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(25, 42, 33, 0.1);
}

.panel--input .panel__header::before {
  content: attr(data-title);
  display: block;
  color: var(--text);
  font-family: "Fraunces", serif;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.panel--input .panel__header > div:first-child {
  display: none;
}

.panel__footer {
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(25, 42, 33, 0.1);
}

.panel__footer > .form-error {
  flex: 1 0 100%;
}

.panel__header h2 {
  margin: 4px 0;
}

.card {
  padding: 18px 18px 20px;
}

.card__header {
  align-items: flex-start;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(25, 42, 33, 0.08);
}

.card__header h3 {
  font-size: 1.16rem;
}

.card--result {
  grid-area: result;
  display: flex;
  flex-direction: column;
  height: var(--result-card-height);
  min-height: var(--result-card-height);
  background: linear-gradient(145deg, rgba(242, 249, 245, 0.96), rgba(255, 255, 255, 0.96));
}

.card--result::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -36px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(70, 165, 126, 0.2), transparent 68%);
  pointer-events: none;
}

.card--shap {
  grid-area: shap;
  display: flex;
  flex-direction: column;
  height: var(--shap-card-height);
  min-height: var(--shap-card-height);
}

.card--shap .image-hole {
  flex: 1 1 auto;
  min-height: 0;
}

.card--base {
  grid-area: base;
  display: flex;
  flex-direction: column;
  height: var(--base-card-height);
  min-height: var(--base-card-height);
}

.actions {
  display: flex;
  gap: 12px;
  margin-left: auto;
}

.ghost,
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease;
  box-shadow: 0 6px 14px rgba(17, 29, 23, 0.06);
}

.ghost:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 111, 82, 0.24);
  box-shadow: 0 12px 24px rgba(17, 29, 23, 0.08);
}

.ghost:active,
.primary:active {
  transform: translateY(0);
}

.ghost--file {
  position: relative;
  overflow: hidden;
}

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  border-color: rgba(22, 89, 66, 0.72);
  box-shadow: 0 18px 32px rgba(31, 111, 82, 0.22);
}

.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 38px rgba(31, 111, 82, 0.26);
}

.ghost:disabled,
.primary:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.form-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(31, 111, 82, 0.32) transparent;
}

.form-scroll::-webkit-scrollbar {
  width: 10px;
}

.form-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.form-scroll::-webkit-scrollbar-thumb {
  background: rgba(31, 111, 82, 0.24);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.field-group {
  background: linear-gradient(180deg, #ffffff, #f7faf7);
  border: 1px solid rgba(25, 42, 33, 0.08);
  border-radius: 20px;
  padding: 16px 16px 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 24px rgba(17, 29, 23, 0.04);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.field-group:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 111, 82, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 28px rgba(17, 29, 23, 0.06);
}

.field-group__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(25, 42, 33, 0.08);
}

.field-group__title strong {
  font-family: "Fraunces", serif;
  font-size: 1.12rem;
  font-weight: 600;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.field-grid > .field {
  grid-column: span 2;
  min-width: 0;
}

/* If the last row has 1 item, stretch it to full row */
.field-grid > .field:last-child:nth-child(3n + 1) {
  grid-column: 1 / -1;
}

/* If the last row has 2 items, stretch both so no right-side blank area */
.field-grid > .field:nth-last-child(2):nth-child(3n + 1),
.field-grid > .field:last-child:nth-child(3n + 2) {
  grid-column: span 3;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  display: flex;
  align-items: flex-end;
  min-height: 48px;
  color: #17241d;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.35;
}

.field small {
  color: var(--muted);
  font-size: 0.8rem;
}

input[type="number"],
select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(25, 42, 33, 0.12);
  background: linear-gradient(180deg, #fcfefd, #f3f8f4);
  color: var(--text);
  font-size: 0.96rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 1px 2px rgba(17, 29, 23, 0.04);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%),
    linear-gradient(180deg, #fcfefd, #f3f8f4);
  background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 14px) calc(50% - 3px),
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
  padding-right: 40px;
}

input[type="number"]:hover,
select:hover {
  border-color: rgba(31, 111, 82, 0.24);
}

input[type="number"]:focus,
select:focus {
  outline: none;
  background: #ffffff;
  border-color: rgba(31, 111, 82, 0.44);
  box-shadow:
    0 0 0 4px rgba(31, 111, 82, 0.12),
    0 12px 22px rgba(17, 29, 23, 0.08);
}

input.is-invalid,
select.is-invalid {
  border-color: rgba(178, 74, 80, 0.74);
  background: #fffafb;
  box-shadow:
    0 0 0 4px rgba(178, 74, 80, 0.12),
    0 10px 18px rgba(178, 74, 80, 0.12);
}

.age-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.age-split input {
  min-width: 0;
}

.age-sep {
  color: var(--muted-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hint {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(31, 111, 82, 0.12);
  background: var(--accent-wash);
  color: var(--muted);
  font-size: 0.88rem;
}

.form-error {
  min-height: 0;
  color: var(--danger);
  font-weight: 700;
  margin-bottom: 0;
}

.form-error:not(:empty) {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(178, 74, 80, 0.18);
  background: rgba(255, 244, 245, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.btn-row {
  display: flex;
  gap: 12px;
  margin-left: auto;
}

.prob-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
  position: relative;
  z-index: 1;
}

.prob-value {
  color: var(--accent-strong);
  font-size: clamp(3rem, 5vw, 4.3rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
  text-align: center;
}

.prob-meter {
  position: relative;
  width: 100%;
  height: 14px;
  margin: 0;
  border: 1px solid rgba(25, 42, 33, 0.08);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(31, 111, 82, 0.1), rgba(17, 24, 39, 0.04));
  box-shadow: inset 0 1px 2px rgba(17, 29, 23, 0.05);
  overflow: hidden;
}

.prob-meter::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0, transparent 24%, rgba(255, 255, 255, 0.45) 24%, transparent 25%),
    linear-gradient(90deg, transparent 0, transparent 49%, rgba(255, 255, 255, 0.45) 49%, transparent 50%),
    linear-gradient(90deg, transparent 0, transparent 74%, rgba(255, 255, 255, 0.45) 74%, transparent 75%);
  pointer-events: none;
}

.prob-meter__fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #2b7557 0%, #46a57e 55%, #89c4a1 100%);
  border-radius: inherit;
  box-shadow: 0 0 24px rgba(31, 111, 82, 0.28);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.card--result.is-high-risk .prob-value {
  color: var(--danger);
}

.card--result.is-high-risk .prob-meter {
  background: linear-gradient(90deg, rgba(178, 74, 80, 0.12), rgba(17, 24, 39, 0.04));
  border-color: rgba(178, 74, 80, 0.16);
}

.card--result.is-high-risk .prob-meter__fill {
  background: linear-gradient(90deg, #b24a50 0%, #de6a72 55%, #f3a4aa 100%);
  box-shadow: 0 0 24px rgba(178, 74, 80, 0.24);
}

.subtle {
  min-height: 1.5em;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  position: relative;
  z-index: 1;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(31, 111, 82, 0.1);
  border: 1px solid rgba(31, 111, 82, 0.2);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

#label-chip {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--accent-strong);
  font-size: clamp(3rem, 5vw, 4.3rem);
  line-height: 0.95;
  text-align: center;
}

.card--result #label-chip.is-danger {
  color: var(--danger);
}

.pill--amber {
  background: rgba(142, 166, 124, 0.14);
  border-color: rgba(142, 166, 124, 0.25);
}

.pill--ghost {
  background: rgba(255, 255, 255, 0.88);
  border-color: var(--border);
}

.is-danger {
  color: var(--danger);
  border-color: rgba(178, 74, 80, 0.4) !important;
  background: rgba(255, 244, 245, 0.88);
}

.bars {
  display: grid;
  align-content: start;
  gap: 12px;
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
  padding-right: 0;
}

.bar {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(25, 42, 33, 0.08);
  background: linear-gradient(180deg, rgba(244, 248, 245, 0.96), rgba(255, 255, 255, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.bar__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.95rem;
}

.bar__label span:first-child {
  font-weight: 700;
}

.bar__label span:last-child {
  color: var(--muted);
  font-weight: 700;
}

.bar__track {
  width: 100%;
  height: 10px;
  margin-top: 8px;
  background: rgba(17, 24, 39, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.bar__fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8ea67c, #1f6f52);
  box-shadow: 0 0 18px rgba(31, 111, 82, 0.18);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
}

.status-dot--pos {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(178, 74, 80, 0.14);
}

.status-dot--neg {
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(31, 140, 91, 0.14);
}

.glass {
  background: var(--glass);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--muted);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.image-hole {
  width: 100%;
  min-height: 220px;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  border-radius: 20px;
  border: 1px solid rgba(31, 111, 82, 0.1);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(244, 248, 245, 0.72)),
    radial-gradient(circle at top left, rgba(31, 111, 82, 0.12), transparent 32%);
}

.image-hole::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(31, 111, 82, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 111, 82, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.24), transparent 70%);
  pointer-events: none;
}

.image-hole > * {
  position: relative;
  z-index: 1;
}

.shap-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  min-height: 56px;
  min-width: 220px;
  max-width: calc(100% - 36px);
  padding: 0 18px;
  text-align: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(31, 111, 82, 0.2);
  color: var(--accent-strong);
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 20px rgba(17, 29, 23, 0.08);
}

.hero__img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  display: block;
  padding: 12px;
}

.card--shap .hero__img {
  transform: scale(0.98);
  transform-origin: center;
}

.is-hidden {
  display: none;
}

.image-caption {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.image-hole--small {
  min-height: 140px;
}

.image-hole--large {
  min-height: 560px;
}

@media (max-width: 1280px) {
  .layout {
    grid-template-columns: minmax(0, 1.28fr) minmax(300px, 0.96fr);
  }
}

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "panel"
      "result"
      "shap"
      "base";
  }

  .panel--input {
    height: auto;
    min-height: 0;
  }

  .form-scroll {
    overflow: visible;
    padding-right: 0;
  }

  .card--shap {
    height: auto;
    min-height: 520px;
  }

  .card--result,
  .card--base {
    height: auto;
  }

  .bars {
    overflow: visible;
    padding-right: 0;
  }

  .image-hole--large {
    min-height: 500px;
  }

  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .page {
    padding: 16px 14px 28px;
  }

  .topbar {
    position: static;
    flex-direction: column;
    align-items: stretch;
    border-radius: 24px;
    padding: 16px;
  }

  .brand {
    justify-content: center;
  }

  .brand__logo {
    width: min(360px, 100%);
    max-height: none;
  }

  .nav-links {
    justify-content: center;
  }

  .lang-switch {
    justify-content: center;
    padding-left: 0;
  }

  .panel,
  .card {
    padding: 16px;
    border-radius: 20px;
  }

  .panel--input .panel__header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .actions,
  .btn-row {
    width: 100%;
    margin-left: 0;
  }

  .actions > *,
  .btn-row > * {
    flex: 1 1 0;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .field-grid > .field {
    grid-column: 1 / -1;
  }

  .field label {
    min-height: 0;
  }

  .panel__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .hint {
    width: 100%;
    justify-content: center;
    border-radius: 16px;
  }

  .card--shap {
    min-height: 420px;
  }

  .image-hole--large {
    min-height: 400px;
  }
}

@media (max-width: 560px) {
  .nav-links a {
    flex: 1 1 calc(50% - 8px);
  }

  .lang-switch {
    flex: 1 1 calc(50% - 8px);
  }

  .lang-toggle {
    width: 100%;
  }

  .brand__name {
    text-align: center;
  }

  .prob-value {
    font-size: 2.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
