/* Front-page layout adapted from frontend_v3.html; scoped to preserve other pages. */

.crate-home {
      --navy: #123b5d;
      --navy-dark: #0b2e49;
      --blue: #1d5b88;
      --blue-soft: #eaf3f9;
      --gold: #edae18;

      --text: #172b3d;
      --muted: #637282;

      --border: #ced9e3;
      --border-strong: #b8c8d7;
      --background: #f4f7f9;
      --surface: #ffffff;

      --danger: #bf3d3d;

      --radius: 12px;
      --shadow:
        0 10px 30px rgba(25, 61, 88, 0.07),
        0 2px 5px rgba(25, 61, 88, 0.04);
    }
.crate-home * {
      box-sizing: border-box;
    }
.crate-home {
      margin: 0;
      min-height: 100vh;
      color: var(--text);
      background: var(--background);
      font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    }
.crate-home button,
.crate-home input,
.crate-home select {
      font: inherit;
    }
.crate-home select,
.crate-home button {
      cursor: pointer;
    }
.crate-home {
      width: min(1040px, calc(100% - 32px));
      margin: 0 auto;
      padding: 14px 0 60px;
    }
.crate-home .intro {
      margin-bottom: 24px;
      text-align: center;
    }
.crate-home .intro h1 {
      margin: 0;
      color: var(--navy);
      font-size: clamp(34px, 5vw, 46px);
      line-height: 1.1;
      letter-spacing: -0.035em;
    }
.crate-home .intro p {
      max-width: 700px;
      margin: 12px auto 0;
      color: var(--muted);
      font-size: 17px;
      line-height: 1.55;
    }
.crate-home .calculator-card {
      overflow: hidden;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 16px;
      box-shadow: var(--shadow);
    }
.crate-home .calculator-body {
      padding: 24px 30px 30px;
    }
.crate-home .section {
      padding-bottom: 24px;
    }
.crate-home .section + .section {
      padding-top: 24px;
      border-top: 1px solid #dce4eb;
    }
.crate-home .section:last-child {
      padding-bottom: 0;
    }
.crate-home .section-title-row {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 16px;
    }
.crate-home .section-number {
      width: 26px;
      height: 26px;
      display: grid;
      place-items: center;
      flex: 0 0 auto;
      color: var(--navy);
      background: var(--blue-soft);
      border-radius: 50%;
      font-size: 13px;
      font-weight: 800;
    }
.crate-home .section-title {
      margin: 0;
      color: var(--navy-dark);
      font-size: 16px;
      font-weight: 750;
    }
.crate-home .input,
.crate-home .select {
      height: 42px;
      color: #1f2933;
      background: #fff;
      border: 1px solid var(--border-strong);
      border-radius: 7px;
      outline: none;
      transition:
        border-color 150ms ease,
        box-shadow 150ms ease;
    }
.crate-home .input {
      padding: 0 38px 0 12px;
    }
.crate-home .select {
      padding: 0 36px 0 12px;
    }
.crate-home .input:focus,
.crate-home .select:focus {
      border-color: var(--blue);
      box-shadow: 0 0 0 3px rgba(29, 91, 136, 0.12);
    }
.crate-home .input-wrapper {
      position: relative;
      flex: 0 0 auto;
    }
.crate-home .unit {
      position: absolute;
      top: 50%;
      right: 11px;
      transform: translateY(-50%);
      color: #697887;
      pointer-events: none;
      font-size: 12px;
      font-weight: 700;
    }
.crate-home .crate-type-layout {
      display: grid;
      grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
      gap: 28px;
      align-items: stretch;
    }
.crate-home .crate-type-field {
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
    }
.crate-home .inline-label {
      color: var(--navy-dark);
      font-size: 14px;
      font-weight: 700;
      white-space: nowrap;
    }
.crate-home .crate-type-control {
      display: flex;
      align-items: center;
      gap: 12px;
    }
.crate-home .crate-type-control .select {
      width: min(430px, 100%);
    }
.crate-home .field-hint {
      margin: 8px 0 0 92px;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.45;
    }
.crate-home .crate-preview {
      margin-top: -42px;
      min-height: 175px;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 14px;
      background:
        radial-gradient(
          circle at 50% 25%,
          #ffffff 0,
          #f8fbfd 54%,
          #edf3f7 100%
        );
      border: 1px solid var(--border);
      border-radius: 12px;
    }
.crate-home .preview-content {
      width: 100%;
      text-align: center;
    }
.crate-home .crate-svg {
      width: 180px;
      max-width: 80%;
      height: 115px;
      overflow: visible;
    }
.crate-home .preview-label {
      margin-top: 4px;
      color: var(--navy);
      font-size: 13px;
      font-weight: 750;
    }
.crate-home .preview-subtitle {
      margin-top: 2px;
      color: var(--muted);
      font-size: 12px;
    }
.crate-home .dimensions-row {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 20px 30px;
    }
.crate-home .dimension-control {
      display: flex;
      align-items: center;
      gap: 9px;
    }
.crate-home .dimension-control .inline-label {
      min-width: 52px;
    }
.crate-home .dimension-control .input {
      width: 116px;
    }
.crate-home .thickness-row {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 30px;
    }
.crate-home .thickness-item {
      display: flex;
      align-items: center;
      gap: 9px;
      min-width: 0;
    }
.crate-home .thickness-item .inline-label {
      min-width: 112px;
    }
.crate-home .thickness-item .select {
      width: 145px;
      flex: 0 0 145px;
    }
.crate-home .thickness-item .input {
      width: 92px;
    }
.crate-home .custom-value .input:read-only {
      color: #8895a1;
      background: #eef2f5;
      cursor: not-allowed;
    }
.crate-home .calculation-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 22px;
    }
.crate-home .calculation-copy h2 {
      margin: 0 0 5px;
      color: var(--navy-dark);
      font-size: 18px;
    }
.crate-home .calculation-copy p {
      margin: 0;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.45;
    }
.crate-home .calculate-btn {
      min-width: 210px;
      height: 50px;
      padding: 0 24px;
      color: #fff;
      background: var(--blue);
      border: 0;
      border-radius: 8px;
      box-shadow: 0 5px 12px rgba(29, 91, 136, 0.16);
      font-size: 15px;
      font-weight: 750;
      transition:
        background-color 150ms ease,
        transform 150ms ease;
    }
.crate-home .calculate-btn:hover {
      background: var(--navy);
      transform: translateY(-1px);
    }

    @media (max-width: 900px) {
.crate-home .thickness-row {
        grid-template-columns: 1fr;
        gap: 14px;
      }
    }

    @media (max-width: 760px) {
.crate-home {
        width: min(100% - 22px, 1040px);
      }
.crate-home .calculator-body {
        padding: 20px;
      }
.crate-home .crate-type-layout {
        grid-template-columns: 1fr;
      }
.crate-home .crate-preview {
        margin-top: 0;
        min-height: 160px;
      }
.crate-home .field-hint {
        margin-left: 0;
      }
.crate-home .dimensions-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
      }
.crate-home .dimension-control {
        max-width: 260px;
      }
.crate-home .calculation-bar {
        align-items: stretch;
        flex-direction: column;
      }
.crate-home .calculate-btn {
        width: 100%;
      }
    }

    @media (max-width: 520px) {
.crate-home .crate-type-control {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
      }
.crate-home .crate-type-control .select {
        width: 100%;
      }
.crate-home .thickness-item {
        display: grid;
        grid-template-columns: 1fr;
        gap: 7px;
      }
.crate-home .thickness-item .inline-label {
        min-width: 0;
      }
.crate-home .thickness-item .select {
        width: 100%;
        flex-basis: auto;
      }
.crate-home .thickness-item .input {
        width: 100%;
      }
    }

.crate-home { line-height:1.5; }
.crate-home .intro { font-size:inherit; }
.crate-home .crate-type-field { margin:0; gap:0; }
.crate-home .crate-type-control .select { min-width:0; }
.crate-home .crate-preview-image { width:165px; height:auto; max-width:100%; }
.crate-home .calculate-btn:focus-visible { outline:3px solid var(--gold); outline-offset:3px; }
.crate-home .advertisement { max-width:100%; }

/* Measurement selector and full lumber/timber size labels. */
.crate-home .unit-selector { display:grid; grid-template-columns:1fr 1fr; gap:6px; padding:6px; margin:0 0 28px; border:0; border-radius:10px; background:#e8eef2; min-width:0; }
.crate-home .unit-selector label { display:block; position:relative; cursor:pointer; min-width:0; padding:0; }
.crate-home .unit-selector input { position:absolute; opacity:0; width:1px; height:1px; }
.crate-home .unit-selector span { display:flex; flex-direction:column; justify-content:center; text-align:center; height:100%; padding:15px 8px; border-radius:8px; color:var(--navy); font-weight:750; }
.crate-home .unit-selector small { display:block; font-size:12px; font-weight:500; margin-top:3px; }
.crate-home .unit-selector input:checked + span { background:var(--blue); color:white; box-shadow:0 3px 8px #123b5d26; }
.crate-home .unit-selector input:focus-visible + span { outline:3px solid var(--gold); outline-offset:2px; }
.crate-home .thickness-item { display:grid; grid-template-columns:minmax(0, 1fr) 100px; align-content:start; align-self:start; }
.crate-home .thickness-item .inline-label { grid-column:1 / -1; white-space:normal; }
.crate-home .thickness-item .select { width:100%; min-width:0; }
.crate-home .thickness-item .input { width:100%; }
.crate-home .thickness-item .input-wrapper { min-width:0; }
.crate-home .frame-note { color:var(--muted); font-size:13px; margin:12px 0 0; }
@media (max-width:520px) {
  .crate-home .unit-selector span { font-size:13px; padding:12px 6px; }
  .crate-home .thickness-item { grid-template-columns:minmax(0, 1fr) 88px; }
}

.crate-home .thickness-item:has(#framePreset) { grid-template-columns: minmax(0, 1fr); align-content: start; }
.crate-home .frame-custom-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.crate-home .frame-custom-fields[hidden] { display: none; }
.crate-home .frame-custom-fields label { display: block; margin-bottom: 5px; font-size: 13px; }
