:root{color-scheme:light;--ink:#3e332a;--muted:#887b6f;--accent:#806047;--line:#e6ddd1;--paper:#fffcf7}
*{box-sizing:border-box}body{margin:0;background:#f6f2eb;color:var(--ink);font-family:Tahoma,"Leelawadee UI",Arial,sans-serif;line-height:1.55}main{max-width:680px;margin:auto;padding:20px 18px 36px}.brand-header{display:flex;align-items:center;justify-content:space-between;padding:0 0 16px;border-bottom:1px solid var(--line)}.brand{display:flex}.brand img{object-fit:contain}.socials{display:flex;gap:12px;align-items:center}.socials a{display:flex;align-items:center;justify-content:center;width:44px;height:44px;background:white;border:1px solid var(--line);border-radius:12px;overflow:hidden}.socials img{object-fit:contain;width:32px;height:32px}.intro{padding:26px 0 22px}.eyebrow{font-size:13px;letter-spacing:.15em;text-transform:uppercase;color:var(--accent);font-weight:700}h1{font-size:clamp(22px,4.5vw,28px);line-height:1.45;margin:7px 0 0;font-weight:700}.card{background:var(--paper);border:1px solid var(--line);border-radius:22px;box-shadow:0 8px 30px #69503b06}.input-card{padding:24px}.field{display:block;font-size:15px;font-weight:700}.unit{color:var(--muted);font-size:12px;font-weight:400;margin-left:5px}input[type=text],select{display:block;width:100%;min-width:0;border:1px solid #d7cabb;border-radius:11px;background:white;color:var(--ink);font:inherit;font-size:19px;font-weight:400;padding:13px 14px;margin-top:9px;min-height:54px}input::placeholder{color:#b1a79b;font-size:15px}select{font-size:16px;padding-right:28px}.mode-switch{display:grid;grid-template-columns:1fr 1fr;padding:4px;margin:24px 0 26px;border:0;border-radius:12px;background:#eee7dd;gap:4px}.mode-switch label{position:relative;cursor:pointer}.mode-switch input{position:absolute;opacity:0;width:1px;height:1px}.mode-switch span{display:block;text-align:center;padding:12px 4px;font-size:14px;border-radius:9px;color:#7e6c5b}.mode-switch input:checked+span{background:var(--paper);color:var(--ink);box-shadow:0 2px 6px #5c483311;font-weight:700}.mode-switch input:focus-visible+span{outline:3px solid #bd9c70}.dimensions{display:grid;grid-template-columns:minmax(0,1fr) 18px minmax(0,1fr);gap:10px;align-items:end}.multiply{align-self:end;text-align:center;margin-bottom:14px;color:var(--muted);font-size:22px}.area-field{margin-top:23px}.zones{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:23px 16px}.primary{display:flex;align-items:center;justify-content:space-between;gap:15px;width:100%;min-height:56px;border:0;border-radius:12px;padding:15px 19px;background:var(--accent);color:#fffaf4;font:inherit;font-size:16px;font-weight:700;text-decoration:none;cursor:pointer;margin-top:30px}.primary:hover{background:#694b35}.primary span{font-size:23px;line-height:1}.error{padding:14px;border:1px solid #d9ad97;border-radius:10px;background:#fff1e8;color:#8b402c;font-size:14px;margin:0 0 20px}.error ul{padding-left:20px;margin:7px 0 0}input[aria-invalid=true]{border-color:#b35739}a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #bd9c70;outline-offset:3px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}[hidden]{display:none!important}.result-heading{padding:25px 0 22px}.result-heading h1{font-size:clamp(20px,4.4vw,27px);margin:0}.area-summary{display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin-top:20px}.area-summary>span{font-size:14px;color:var(--muted)}.area-summary strong{font-size:30px;line-height:1.2;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.result-card{padding:8px 18px;overflow:hidden}table{width:100%;border-collapse:collapse;table-layout:fixed}thead th{font-size:12px;font-weight:400;color:var(--muted);padding:16px 0;text-align:left;white-space:nowrap}thead th:first-child{width:19%}thead th:nth-child(2){width:29%}thead th:nth-child(3){width:23%}thead th span{display:block;font-size:11px}tbody td,tbody th{padding:12px 0;font-size:15px;line-height:1.4}tbody+tbody{border-top:1px solid var(--line)}tbody tr:first-child td,tbody tr:first-child th{padding-top:19px}tbody tr:last-child td{padding-bottom:19px}.width{vertical-align:top;text-align:left;font-size:20px;font-weight:700;color:var(--accent)}.number{text-align:right;font-variant-numeric:tabular-nums}.after{font-size:18px;font-weight:700;color:#6e4c32}.restart{margin-top:22px}@media(min-width:760px){main{padding-top:35px;padding-bottom:50px}.intro{padding-top:34px}.input-card{padding:34px 40px}.result-card{padding:10px 28px}tbody td{font-size:16px}.after{font-size:20px}.brand-header{padding-bottom:22px}}@media(max-width:360px){main{padding:15px 12px 28px}.input-card{padding:20px 17px}.socials{gap:7px}.socials a{width:38px;height:38px}.brand img{width:94px;height:53px}.result-card{padding:7px 12px}thead th{font-size:11px}.zones{gap:20px 12px}.mode-switch span{font-size:13px}}
/* Database variants may include a short size name alongside the usable width. */
.variant-name { display: block; font-size: 11px; font-weight: 400; margin-top: 4px; overflow-wrap: anywhere; }
.simple-results thead th:first-child{width:40%}
.simple-results thead th:nth-child(2){width:27%}
.simple-results thead th:nth-child(3){width:33%}
input:focus-visible,select:focus-visible{outline:1px solid #bd9c70;outline-offset:1px}

/* Native select fallback remains available on browsers without base-select. */
@supports (appearance:base-select){
    @media(max-width:759px){
        #product,#product::picker(select){appearance:base-select}
        #product{display:flex;align-items:center;justify-content:space-between}
        #product::picker(select){font:16px/1.55 Tahoma,"Leelawadee UI",Arial,sans-serif;color:var(--ink);background:var(--paper);border:1px solid var(--line);border-radius:10px;padding:4px;max-inline-size:calc(100vw - 28px);box-shadow:0 6px 18px #69503b18}
        #product option{font-size:16px;min-height:44px;padding:10px 12px;white-space:normal;overflow-wrap:anywhere}
        #product option:checked{background:#eee7dd}
    }
}

/* Compact mobile spacing while retaining the original type sizes. */
@media(max-width:759px){
    main{padding:12px 14px 20px}
    .brand-header{padding-bottom:8px}
    .brand img{width:84px;height:48px}
    .socials{gap:8px}
    .socials a{width:44px;height:44px}
    .socials img{width:28px;height:28px}
    .intro{padding:12px 0 14px}
    h1{margin-top:3px}
    .input-card{padding:16px}
    input[type=text],select{min-height:48px;padding:10px 12px;margin-top:6px}
    .mode-switch{margin:14px 0 16px}
    .mode-switch span{min-height:44px;padding:11px 4px}
    .dimensions{gap:8px}
    .multiply{margin-bottom:10px}
    .area-field{margin-top:14px}
    .zones{gap:12px}
    .primary{min-height:48px;padding:11px 14px;margin-top:18px}
    .result-heading{padding:14px 0 12px}
    .result-heading p{margin:6px 0}
    .area-summary{margin-top:12px}
    .result-card{padding:6px 12px}
    thead th{padding:10px 0}
    tbody td,tbody th{padding:8px 0}
    tbody tr:first-child td,tbody tr:first-child th{padding-top:10px}
    tbody tr:last-child td{padding-bottom:10px}
    .restart{margin-top:14px}
}
@media(max-width:759px) and (max-height:650px){
    main{padding:8px 12px 12px}
    .brand img{width:70px;height:40px}
    .brand-header{padding-bottom:6px}
    .intro{padding:8px 0 10px}
    .eyebrow{display:none}
    .mode-switch{margin:12px 0}
    .area-field{margin-top:12px}
    .primary{margin-top:14px}
}
