.page-cubagem {
  --cubage-bg: #090a0c;
  --cubage-panel: #111317;
  --cubage-panel-2: #171a1f;
  --cubage-copy: #b4b7bd;
  --cubage-muted: #777c84;
  --cubage-line: rgba(255, 255, 255, .11);
  --cubage-line-soft: rgba(255, 255, 255, .065);
  min-height: 100vh;
  background: var(--cubage-bg);
}

.page-cubagem::before {
  background:
    radial-gradient(circle at 12% 3%, rgba(247, 198, 23, .1), transparent 28rem),
    radial-gradient(circle at 86% 26%, rgba(247, 198, 23, .04), transparent 30rem),
    var(--cubage-bg);
}

.page-cubagem button { color: inherit; }
.cubage-shell { width: min(1360px, calc(100vw - 48px)); margin-inline: auto; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cubage-sitebar {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid var(--cubage-line);
  background: rgba(9, 10, 12, .86);
  backdrop-filter: blur(22px);
}

.cubage-sitebar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
}

.cubage-brand {
  position: relative;
  width: 205px;
  padding-left: 23px;
}

.cubage-brand::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 5px rgba(247, 198, 23, .1), 0 0 18px rgba(247, 198, 23, .75);
  content: "";
  transform: translateY(-50%);
}

.cubage-brand img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 9px 24px rgba(0, 0, 0, .42));
}

.cubage-system-status {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--cubage-line);
  color: var(--cubage-copy);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.cubage-system-status i {
  width: 6px;
  height: 6px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(247, 198, 23, .1), 0 0 14px rgba(247, 198, 23, .7);
  animation: pulse 2s ease-in-out infinite;
}

.cubage-system-status b {
  margin-left: 18px;
  padding-left: 18px;
  border-left: 1px solid var(--cubage-line);
  color: var(--yellow);
}

.cubage-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--cubage-line);
  background:
    linear-gradient(90deg, transparent 49.92%, rgba(255, 255, 255, .035) 50%, transparent 50.08%),
    linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
  background-size: 100% 100%, 72px 72px, 72px 72px;
}

.cubage-hero::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(9, 10, 12, .98), rgba(9, 10, 12, .76) 54%, rgba(9, 10, 12, .18));
  content: "";
}

.cubage-hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr .72fr;
  align-items: center;
  min-height: 440px;
  gap: 76px;
  padding-block: 38px;
}

.cubage-hero-copy h1 {
  font-family: var(--display);
  font-size: clamp(57px, 6vw, 88px);
  font-weight: 720;
  letter-spacing: -.065em;
  line-height: .88;
}

.cubage-hero-copy h1 span { color: var(--yellow); }
.cubage-hero-copy > p:not(.eyebrow) {
  max-width: 670px;
  margin-top: 27px;
  color: var(--cubage-copy);
  font-size: clamp(15px, 1.35vw, 18px);
  line-height: 1.7;
}

.cubage-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 34px;
  border-top: 1px solid var(--cubage-line);
}

.cubage-specs span {
  padding: 16px 20px 0 0;
  color: var(--cubage-muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.cubage-specs span + span {
  margin-left: 20px;
  padding-left: 20px;
  border-left: 1px solid var(--cubage-line);
}

.cargo-volume {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 1 / .83;
  justify-self: end;
  overflow: hidden;
  border: 1px solid var(--cubage-line);
  background:
    radial-gradient(circle at 50% 45%, rgba(247, 198, 23, .12), transparent 36%),
    linear-gradient(135deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01));
  box-shadow: inset 0 0 90px rgba(0, 0, 0, .5), 0 28px 80px rgba(0, 0, 0, .25);
}

.cargo-volume::before {
  position: absolute;
  inset: 0;
  opacity: .35;
  background-image: linear-gradient(var(--cubage-line) 1px, transparent 1px), linear-gradient(90deg, var(--cubage-line) 1px, transparent 1px);
  background-size: 38px 38px;
  content: "";
  mask-image: linear-gradient(to bottom, #000, transparent 94%);
}

.volume-head {
  position: absolute;
  inset: 18px 18px auto;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  color: var(--cubage-muted);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.volume-head span { display: flex; align-items: center; gap: 9px; color: var(--cubage-copy); }
.volume-head i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 13px var(--yellow);
}

.volume-stage {
  position: absolute;
  inset: 56px 24px 82px;
  perspective: 760px;
  perspective-origin: 50% 44%;
}
.cargo-box {
  position: absolute;
  top: 46%;
  left: 50%;
  width: 112px;
  height: 112px;
  transform-style: preserve-3d;
  animation: cubage-cube-rotate 10s linear infinite;
}

.cargo-box span {
  position: absolute;
  inset: 0;
  display: block;
  border: 1px solid rgba(247, 198, 23, .68);
  backface-visibility: visible;
  background:
    linear-gradient(rgba(247, 198, 23, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247, 198, 23, .12) 1px, transparent 1px),
    rgba(247, 198, 23, .045);
  background-size: 28px 28px;
  box-shadow: inset 0 0 34px rgba(247, 198, 23, .09), 0 0 18px rgba(247, 198, 23, .035);
}

.box-front {
  transform: translateZ(56px);
}
.box-back { transform: rotateY(180deg) translateZ(56px); }
.box-side {
  transform: rotateY(90deg) translateZ(56px);
  background-color: rgba(247, 198, 23, .055) !important;
}
.box-left { transform: rotateY(-90deg) translateZ(56px); }
.box-top {
  transform: rotateX(90deg) translateZ(56px);
  background-color: rgba(247, 198, 23, .07) !important;
}
.box-bottom { transform: rotateX(-90deg) translateZ(56px); }

.cube-shadow {
  position: absolute;
  top: calc(46% + 78px);
  left: 50%;
  width: 128px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(247, 198, 23, .2), rgba(247, 198, 23, .05) 48%, transparent 72%);
  filter: blur(5px);
  transform: translateX(-50%);
  animation: cubage-cube-shadow 5s ease-in-out infinite;
}

.volume-data {
  position: absolute;
  right: 16px;
  bottom: 42px;
  left: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--cubage-line);
  background: rgba(9, 10, 12, .82);
  backdrop-filter: blur(10px);
}

.volume-data > div { padding: 9px 10px; }
.volume-data > div + div { border-left: 1px solid var(--cubage-line); }
.volume-data small, .volume-data strong { display: block; line-height: 1.2; }
.volume-data small { color: var(--cubage-muted); font-size: 7px; font-weight: 850; letter-spacing: .1em; }
.volume-data strong { margin-top: 4px; color: var(--yellow); font-size: 11px; }
.volume-formula {
  position: absolute;
  right: 17px;
  bottom: 15px;
  left: 17px;
  color: var(--cubage-muted);
  font-size: 7px;
  font-weight: 850;
  letter-spacing: .13em;
  text-align: center;
}

.cubage-calculator {
  margin-block: 18px 72px;
  border: 1px solid var(--cubage-line);
  background: linear-gradient(135deg, var(--cubage-panel), rgba(23, 26, 31, .82));
  box-shadow: 0 30px 90px rgba(0, 0, 0, .28);
}

.calculator-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 36px;
  padding: 30px 34px 26px;
  border-bottom: 1px solid var(--cubage-line);
}

.calculator-head h2 {
  font-family: var(--display);
  font-size: clamp(35px, 4vw, 54px);
  font-weight: 720;
  letter-spacing: -.052em;
  line-height: .95;
}

.calculator-readout {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  min-width: 370px;
  border: 1px solid var(--cubage-line);
}

.calculator-readout > span { padding: 10px 12px; }
.calculator-readout > span + span { border-left: 1px solid var(--cubage-line); }
.calculator-readout small, .calculator-readout strong { display: block; line-height: 1.25; }
.calculator-readout small { color: var(--cubage-muted); font-size: 7px; font-weight: 850; letter-spacing: .12em; }
.calculator-readout strong { margin-top: 4px; color: var(--yellow); font-size: 10px; }

.calculator-controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 20px 34px;
  border-bottom: 1px solid var(--cubage-line);
  background: rgba(255, 255, 255, .018);
}

.control-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.control-group legend {
  margin-bottom: 9px;
  color: var(--cubage-muted);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.control-group > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.option-button {
  min-height: 40px;
  padding-inline: 12px;
  border: 1px solid var(--cubage-line);
  background: transparent;
  color: var(--cubage-copy) !important;
  cursor: pointer;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
  transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease;
}
.option-button:hover { border-color: rgba(247, 198, 23, .48); color: var(--yellow) !important; }
.option-button.active {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #090a0c !important;
  box-shadow: 0 10px 30px rgba(247, 198, 23, .1);
}

.table-scroll { overflow-x: auto; scrollbar-color: var(--yellow) rgba(255, 255, 255, .06); scrollbar-width: thin; }
.table-scroll:focus-visible { outline-offset: -2px; }
.table-scroll::-webkit-scrollbar { height: 6px; }
.table-scroll::-webkit-scrollbar-track { background: rgba(255, 255, 255, .05); }
.table-scroll::-webkit-scrollbar-thumb { background: var(--yellow); }

.page-cubagem table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  table-layout: fixed;
}

.page-cubagem .col-index { width: 58px; }
.page-cubagem .col-volume { width: 96px; }
.page-cubagem .col-dimension { width: 112px; }
.page-cubagem .col-weight { width: 132px; }
.page-cubagem .col-result { width: 140px; }
.page-cubagem .col-result-wide { width: 165px; }
.page-cubagem .col-action { width: 54px; }

.page-cubagem th,
.page-cubagem td {
  height: 62px;
  padding: 9px;
  border-right: 1px solid var(--cubage-line-soft);
  border-bottom: 1px solid var(--cubage-line-soft);
  text-align: left;
  vertical-align: middle;
}

.page-cubagem thead th {
  height: 54px;
  background: #0d0f12;
  color: #c8cbd0;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .09em;
  line-height: 1.3;
  text-transform: uppercase;
}

.page-cubagem thead th small { display: block; margin-top: 3px; color: var(--cubage-muted); font-size: 7px; }
.page-cubagem thead .calculated-head { background: #15181c; color: var(--yellow); }
.page-cubagem tbody th { color: var(--cubage-muted); font-size: 9px; font-weight: 850; text-align: center; }
.page-cubagem tbody tr { transition: background .2s ease; }
.page-cubagem tbody tr:hover { background: rgba(247, 198, 23, .018); }
.page-cubagem td.result-cell { background: rgba(255, 255, 255, .018); }

.page-cubagem input {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid rgba(247, 198, 23, .2);
  border-radius: 0;
  background: rgba(247, 198, 23, .035);
  color: var(--white);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.page-cubagem input:hover { border-color: rgba(247, 198, 23, .4); }
.page-cubagem input:focus {
  border-color: var(--yellow);
  outline: 0;
  background: rgba(247, 198, 23, .07);
  box-shadow: 0 0 0 3px rgba(247, 198, 23, .07);
}
.page-cubagem input[readonly] {
  border-color: transparent;
  background: transparent;
  color: #c5c8cd;
  font-weight: 750;
  cursor: default;
}

.remove-row {
  display: grid;
  width: 28px;
  height: 28px;
  margin-inline: auto;
  place-items: center;
  border: 1px solid rgba(255, 106, 92, .35);
  background: transparent;
  color: #ff8c82 !important;
  cursor: pointer;
  font-size: 17px;
  transition: border-color .2s ease, background .2s ease;
}
.remove-row:hover { border-color: #ff766a; background: rgba(255, 106, 92, .08); }

.page-cubagem tfoot th,
.page-cubagem tfoot td {
  height: 58px;
  border-bottom: 0;
  background: #0d0f12;
  color: var(--yellow);
  font-size: 11px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}
.page-cubagem tfoot th { font-size: 8px; letter-spacing: .1em; text-align: center; text-transform: uppercase; }

.calculator-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 20px 34px;
}

.add-volume {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 20px 0 0;
  border: 1px solid var(--yellow);
  background: transparent;
  color: var(--yellow) !important;
  cursor: pointer;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.add-volume span {
  display: grid;
  width: 48px;
  align-self: stretch;
  margin-right: 16px;
  place-items: center;
  background: var(--yellow);
  color: #090a0c;
  font-size: 22px;
}
.add-volume:hover { background: var(--yellow); color: #090a0c !important; }
.calculator-actions p { max-width: 580px; color: var(--cubage-muted); font-size: 10px; text-align: right; }

.cubage-footer { border-top: 1px solid var(--cubage-line); background: rgba(17, 19, 23, .72); }
.cubage-footer > div {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 88px;
  gap: 34px;
  color: var(--cubage-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .06em;
}
.cubage-footer p { justify-self: center; }
.cubage-footer .back-top {
  width: 42px;
  height: 42px;
  border: 1px solid var(--cubage-line);
  background: transparent;
  color: var(--yellow);
  cursor: pointer;
}

@keyframes cubage-cube-rotate {
  0% { transform: translate(-50%, -50%) rotateX(-18deg) rotateY(26deg) rotateZ(0deg); }
  50% { transform: translate(-50%, -52%) rotateX(22deg) rotateY(206deg) rotateZ(2deg); }
  100% { transform: translate(-50%, -50%) rotateX(-18deg) rotateY(386deg) rotateZ(0deg); }
}

@keyframes cubage-cube-shadow {
  0%, 100% { opacity: .48; transform: translateX(-50%) scale(.86); }
  50% { opacity: .85; transform: translateX(-50%) scale(1.06); }
}

@media (max-width: 980px) {
  .cubage-hero-grid { grid-template-columns: 1fr; padding-block: 60px; }
  .cargo-volume { width: min(100%, 500px); justify-self: start; }
  .calculator-head { align-items: flex-start; flex-direction: column; }
  .calculator-readout { width: 100%; min-width: 0; }
}

@media (max-width: 700px) {
  .cubage-shell { width: calc(100vw - 28px); }
  .cubage-sitebar-row { min-height: 72px; }
  .cubage-brand { width: 158px; padding-left: 16px; }
  .cubage-system-status span, .cubage-system-status b { display: none; }
  .cubage-system-status { width: 40px; padding: 0; justify-content: center; }
  .cubage-system-status i { margin: 0; }
  .cubage-hero-grid { gap: 42px; padding-block: 46px; }
  .cubage-hero-copy h1 { font-size: clamp(49px, 14.5vw, 68px); }
  .cubage-specs { align-items: flex-start; flex-direction: column; }
  .cubage-specs span { padding-top: 10px; }
  .cubage-specs span + span { margin-left: 0; padding-left: 0; border-left: 0; }
  .cargo-volume { aspect-ratio: .95; }
  .cubage-calculator { margin-block: 22px 48px; }
  .calculator-head { padding: 24px 20px; }
  .calculator-readout { grid-template-columns: 1fr; }
  .calculator-readout > span { display: flex; justify-content: space-between; gap: 12px; }
  .calculator-readout > span + span { border-top: 1px solid var(--cubage-line); border-left: 0; }
  .calculator-readout strong { margin-top: 0; }
  .calculator-controls { grid-template-columns: 1fr; padding: 20px; }
  .control-group > div { gap: 5px; }
  .option-button { padding-inline: 7px; font-size: 8px; }
  .calculator-actions { align-items: stretch; flex-direction: column; padding: 20px; }
  .add-volume { justify-content: flex-start; }
  .calculator-actions p { text-align: left; }
  .cubage-footer > div { grid-template-columns: 1fr auto; padding-block: 22px; }
  .cubage-footer p { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .cargo-box {
    animation: none;
    transform: translate(-50%, -50%) rotateX(-18deg) rotateY(26deg);
  }
  .cube-shadow { animation: none; }
}
