:root {
  --orchard: #174735;
  --honey: #efb75d;
  --cobalt: #204ab0;
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body[data-model="madeira"] .page {
  padding-block: max(9px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-bottom));
  width: min(1000px, calc(100% - max(16px, env(safe-area-inset-left) + env(safe-area-inset-right) + 12px)));
}
.test-head, .test-head nav { display: flex; align-items: center; gap: 8px 13px; flex-wrap: wrap; }
.test-head { justify-content: space-between; margin-bottom: 5px; padding-inline: 3px; }
.test-head p { margin: 0; color: var(--orchard); font-size: .72rem; font-weight: 800; }
.test-head a { display: flex; align-items: center; min-height: 36px; font-weight: 750; font-size: .76rem; color: var(--orchard); }
.install-help { padding: 10px; margin: 0 0 6px; background: #fff7e9; border: 1px solid #d4b692; border-radius: 9px; font-size: .82rem; }
.game[data-theme="madeira"] .wood-sign { padding: 6px 7px 3px; margin: 0; background: repeating-linear-gradient(90deg, #326342 0 8%, #f1bc48 8% 16%); }
.wood-sign img { width: clamp(182px, 56%, 320px); filter: drop-shadow(0 2px 2px #532f275c); }
.game[data-theme="madeira"] .parcel-sign { display: grid; place-items: center; min-height: 48px; background: #175b51; }
.parcel-sign span { color: #fff2d6; font-size: clamp(1.55rem, 4.7vw, 2.25rem); font-weight: 900; letter-spacing: -.04em; line-height: 1.1; }
.game[data-theme="madeira"] .game-head { gap: 5px; padding-block: 1px; }
.game-head .phase-picker { min-width: 0; }
.phase-picker select {
  min-height: 40px;
  max-width: 100%;
  width: auto;
  color: var(--orchard);
  font: 750 clamp(.75rem, 3vw, .88rem) / 1.2 system-ui, sans-serif;
  background: transparent;
  border: 0;
  text-overflow: ellipsis;
}
.game-head .trip { white-space: nowrap; }
.game[data-theme="madeira"] .dispatch { min-height: 84px; }
.game[data-theme="madeira"] .complete { min-height: 84px; gap: 1px; padding: 8px 24px; }
.complete p { margin: 2px; font-size: .78rem; }
.complete .action { justify-self: center; }
.game[data-theme="madeira"] { --crate-width: clamp(43px, min(16vw, 8.3svh), 80px); }
.wood-board .cell { padding: 0; }
.wood-board .crate.top { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.wood-board .crate.top.pointer-source { opacity: .38; }
.wood-board .crate:disabled { pointer-events: none; }
.wood-board .base-target { position: relative; }
.wood-board .base-target::after { content: ""; position: absolute; inset: -14px -5px -5px; }
.touch-ghost { transition: none; }
.game[data-theme="madeira"] .controls p { min-width: 0; }
.game[data-theme="madeira"] .controls p[data-tone="warning"] { color: #a41f22; font-weight: 700; }
.controls .action, .test-head .action { min-height: 40px; }
.how p, .design p + p { margin-top: .6em; }
.how p { color: #59483e; line-height: 1.48; font-size: .84rem; }
.guide { align-content: start; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.comparison { min-width: 0; scroll-margin-top: 12px; }
.table-scroll { overflow-x: auto; margin-block: 11px; }
.comparison table { width: 100%; border-collapse: collapse; text-align: left; font-size: .8rem; }
.comparison :is(th, td) { padding: 8px 10px; border-bottom: 1px solid #e5d6bd; text-align: right; white-space: nowrap; }
.comparison :is(th, td):first-child { text-align: left; }
.comparison thead th { color: var(--orchard); background: #e7eedb; }
.comparison .phase-link { border: 0; background: none; color: var(--orchard); text-align: left; text-decoration: underline; font: inherit; font-weight: 720; cursor: pointer; padding: 6px 0; }
.catalog-controls { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-block: 10px; }
.catalog-controls label { display: grid; gap: 4px; font-size: .76rem; font-weight: 700; }
.catalog-controls select { min-height: 38px; padding: 5px 7px; border: 1px solid #d2b58f; border-radius: 6px; color: var(--orchard); background: #fff9ef; font: inherit; }
.score-badge { display: inline-block; border: 1px solid currentColor; border-radius: 7px; padding: 5px 8px; font-size: .76rem; font-weight: 750; white-space: nowrap; }
.score-badge[data-band="facil"] { color: #20533c; background: #e7f2e5; }
.score-badge[data-band="medio"] { color: #744718; background: #f8ebd2; }
.score-badge[data-band="dificil"] { color: #742d29; background: #f8e3dc; }
.rating-panel { padding: 12px; background: #fff7e9; border: 1px solid #d4b692; border-radius: 9px; }
.rating-panel h3 { margin: 0 0 8px; color: var(--orchard); font-size: 1rem; }
.rating-panel .action { margin-top: 8px; }
#catalog-rating { width: min(880px, calc(100% - 24px)); max-height: calc(100dvh - 32px); color: #352b20; overscroll-behavior: contain; }
#catalog-rating::backdrop { background: #18271eb3; }
.catalog-rating-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.catalog-rating-head :is(h3, .action) { margin: 0; }
.delivery-analysis h4 { margin: 16px 0 3px; color: var(--orchard); }
.delivery-analysis p { margin: 0; font-size: .82rem; }
.comparison .delivery-analysis :is(th, td):last-child { text-align: left; min-width: 16ch; white-space: normal; }
.comparison .delivery-analysis :is(th, td):nth-child(-n+4) { text-align: center; min-width: 56px; padding-inline: 5px; }
.delivery-analysis th img { display: block; width: 24px; height: 24px; margin: 0 auto; }
.rating-method { margin-top: 10px; font-size: .82rem; }
.rating-method summary { cursor: pointer; font-weight: 750; }
.rating-method p { margin-top: 7px; }
.rating-summary { margin-block: 9px; }
.rating-factors { margin: 0 0 8px; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); gap: 6px; }
.rating-factors li { display: flex; justify-content: space-between; align-items: start; gap: 5px; border-radius: 6px; background: #f1e8d8; padding: 7px 8px; font-size: .79rem; color: #3f3024; }
.rating-factors li small { display: block; margin-top: 3px; font-size: .73rem; }
.rating-factors li span { white-space: nowrap; font-weight: 800; color: var(--orchard); }
.comparison .score-method :is(th, td):nth-child(2) { min-width: 23ch; max-width: 42ch; white-space: normal; text-align: left; }
.comparison .score-method tfoot { background: #e7eedb; font-weight: 750; }
.lab { min-width: 0; }
.lab-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 9px; margin-block: 12px; }
.lab label { display: grid; align-content: start; gap: 4px; font-size: .76rem; font-weight: 700; }
.lab :is(input, select) { display: block; width: 100%; min-height: 40px; min-width: 0; padding: 5px; background: #fff9ef; color: #244533; border: 1px solid #d2b58f; border-radius: 6px; font: inherit; }
.lab-actions { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; margin-bottom: 11px; }
.lab .action { min-height: 40px; }
.lab .primary { background: var(--orchard); color: #fff7e6; }
.lab .primary:not(:disabled):hover { background: #266149; }
.lab details { font-size: .82rem; margin-top: 10px; }
.lab details summary { cursor: pointer; font-weight: 740; }
.lab details p { margin-top: 7px; }
.lab-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 6px; margin: 10px 0; }
.lab-results div { background: #ecf0e0; padding: 7px; border-radius: 6px; }
.lab-results dt { font-size: .72rem; }
.lab-results dd { margin: 0; color: var(--orchard); font-size: 1.1rem; font-weight: 800; }
.lab table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.lab :is(th, td) { padding: 7px; border-bottom: 1px solid #e5d6bd; text-align: left; }
.lab th { background: #ecf0e0; }
.lab .branch-details { margin-top: 4px; }
.branch-details ul { min-width: 15ch; max-width: 30ch; margin: 6px 0 0; padding-inline-start: 16px; }
.branch-details li + li { margin-top: 5px; }
@media (max-width: 410px) {
  .game[data-theme="madeira"] .dispatch { min-height: 75px; }
  .game[data-theme="madeira"] .controls { align-items: stretch; flex-direction: column; gap: 4px; }
  .controls .actions { align-self: flex-end; }
}
@media (max-width: 430px) and (max-height: 720px) and (orientation: portrait) {
  .game[data-theme="madeira"] { --crate-width: clamp(40px, min(15vw, 6.4svh), 54px); }
  .test-head { column-gap: 4px; }
  .test-head nav { column-gap: 6px; }
  .test-head nav a { white-space: nowrap; }
  .test-head p, .test-head a { font-size: .65rem; }
  .test-head p { font-size: .6rem; }
  .test-head a { min-height: 33px; }
  .test-head .action { min-height: 35px; padding-inline: 5px; font-size: .65rem; }
  .game[data-theme="madeira"] .wood-sign { padding-block: 3px 1px; }
  .game[data-theme="madeira"] .parcel-sign { min-height: 43px; }
  .phase-picker select { min-height: 37px; }
  .game[data-theme="madeira"] .dispatch .order { padding-block: 5%; }
  .game[data-theme="madeira"] .controls { align-items: center; flex-direction: row; }
  .shelf-plank { height: 12px; }
}
