/* Phone-first controls, with tablet and desktop layouts below. */
:root{color-scheme:light}html{background:#dfe7de;min-height:100%;-webkit-text-size-adjust:100%}body{max-width:480px;margin:0 auto;min-height:100dvh;box-shadow:0 0 80px #163d3912;overflow-x:hidden;padding-top:env(safe-area-inset-top)}aside{position:sticky;top:0;inset:auto;z-index:20;width:100%;padding:14px 18px;background:#fff;display:block;border:0;border-bottom:1px solid var(--line)}.brand{font-size:20px;min-height:36px}.brand .dot{margin-left:auto}aside>small,.aside-bottom{display:none}nav{position:fixed;z-index:40;bottom:0;left:50%;transform:translateX(-50%);width:min(100%,480px);display:grid;grid-template-columns:repeat(5,1fr);gap:0;margin:0;padding:7px 5px calc(8px + env(safe-area-inset-bottom));background:#fff;border-top:1px solid var(--line);box-shadow:0 -5px 20px #173e3907;overflow:visible}nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;text-align:center;padding:7px 2px;min-height:51px;font-size:10px;border-radius:9px;white-space:normal}nav button .navicon{font-size:22px;line-height:24px}main{margin:0;padding-bottom:calc(90px + env(safe-area-inset-bottom))}header{height:auto;min-height:49px;padding:10px 19px;font-size:10px;gap:8px}header .badge{font-size:9px;padding:5px 8px}#app{padding:25px 18px;max-width:none}h1{font-size:28px;line-height:1.2;letter-spacing:-.8px;overflow-wrap:anywhere}h2{font-size:21px}h3{font-size:17px}p{overflow-wrap:anywhere}.muted{font-size:14px}.row{flex-wrap:wrap;align-items:center;gap:12px}.row>div{min-width:0}.row>button{font-size:13px}.hero{display:block;min-height:0;margin:22px 0}.hero-copy{padding:26px}.hero h2{font-size:27px}.hero p{font-size:14px}.blueprint{display:none}.stats{grid-template-columns:1fr;gap:10px;margin:20px 0}.stat{padding:17px 19px;display:grid;grid-template-columns:1fr auto;align-items:center}.stat strong{grid-column:2;grid-row:1/3;font-size:25px;margin:0}.stat small{margin-top:7px;font-size:11px}.cards,.steps,.formgrid,.split{grid-template-columns:1fr;gap:15px}.card-top{height:100px}.card-body{padding:20px}.card p{font-size:13px}.card button{font-size:14px}.steps{gap:0}.step{font-size:14px}.step span{font-size:12px}.panel,.stat{border-radius:14px}.panel{padding:20px 17px}.wide{max-width:none}button{min-height:46px;touch-action:manipulation;font-size:14px}button:disabled{opacity:.45;cursor:not-allowed}.link{min-height:44px;font-size:13px}input,textarea,select{font-size:16px;min-height:48px;max-width:100%}input[type=checkbox]{min-height:24px;min-width:24px;vertical-align:middle}input[type=file]{font-size:13px}label{font-size:14px;line-height:1.5}select{padding-right:20px}textarea{min-height:125px}.actions{flex-wrap:wrap;gap:10px}.actions button{flex:1;min-width:120px}.map{height:250px}.supplier{padding:16px}.supplier .row h3{max-width:75%;margin:6px 0}.notice{font-size:13px}.plan{padding:25px}.plan ul{font-size:14px}.total{font-size:26px;overflow-wrap:anywhere}dialog{position:fixed;inset:auto 0 0;margin:0 auto;max-width:480px;width:100%;max-height:90dvh;border-radius:20px 20px 0 0;padding:26px 19px calc(24px + env(safe-area-inset-bottom));overflow:auto}#toast{left:50%;right:auto;transform:translateX(-50%);bottom:calc(88px + env(safe-area-inset-bottom));width:calc(100% - 30px);max-width:440px;font-size:13px;z-index:100}.phone-tools{display:flex;flex-wrap:wrap;gap:8px;margin:0 18px 5px}.phone-tools button{font-size:12px;padding:8px 12px;background:#fff}.phone-tools .install{background:#eaf0dd}.phone-table,.phone-table tbody,.phone-table tr,.phone-table td{display:block;width:100%}.phone-table thead{display:none}.phone-table tr{padding:13px;margin:12px 0;border:1px solid var(--line);border-radius:12px;background:#f9faf6}.phone-table td{border:0;padding:6px 0}.phone-table td:before{content:attr(data-label);display:block;color:var(--muted);font-size:11px;font-weight:600;margin-bottom:5px}.phone-table td input,.phone-table td select{min-width:0;width:100%}.phone-table td:empty{display:none}.phone-table td:last-child button{width:100%}.phone-table td:last-child button:after{content:' Remove item';font-size:12px}@media print{html,body{max-width:none;background:white;box-shadow:none;padding:0}.phone-tools,nav{display:none!important}main{padding:0}dialog{position:static;max-width:none;max-height:none;overflow:visible;padding:0}.phone-table{display:table}.phone-table tbody{display:table-row-group}.phone-table tr{display:table-row}.phone-table td{display:table-cell}.phone-table td:before{display:none}.phone-table thead{display:table-header-group}}

/* Keep the large-control phone experience, then expand into a workspace. */
@media screen and (min-width:700px){
  html{background:var(--bg)}
  body{max-width:none;box-shadow:none}
  aside{padding:16px 28px}
  nav{width:100%;padding-left:24px;padding-right:24px}
  nav button{font-size:12px}
  header{min-height:64px;padding:14px 28px;font-size:12px}
  header .badge{font-size:11px;padding:7px 11px}
  .phone-tools{margin:16px 28px 0;flex-wrap:wrap}
  #app{max-width:1400px;padding:30px 28px}
  h1{font-size:34px;letter-spacing:-1.1px}
  h2{font-size:22px}
  .hero{margin:28px 0}
  .hero-copy{padding:32px}
  .hero h2{font-size:30px}
  .hero p{font-size:15px}
  .stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:24px 0 30px}
  .stat{display:block;padding:21px}
  .stat strong{display:block;font-size:30px;margin:12px 0 7px}
  .stat small{display:block;line-height:1.5}
  .cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
  .card{display:flex;flex-direction:column}
  .card-top{height:112px}
  .card-body{display:flex;flex:1;flex-direction:column;padding:22px}
  .card-body button{margin-top:auto}
  .card-body p:last-of-type{margin-bottom:20px}
  .steps{grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
  .formgrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
  .formgrid>*,.split>*{min-width:0}
  .panel{padding:26px}
  .wide{max-width:960px;margin:0 auto}
  .actions button{flex:0 1 auto}
  .row>button{flex-shrink:0}
  .row>input{flex:1;min-width:180px}
  .map{height:320px}
  .supplier{padding:20px}
  .plan{padding:28px}
  .phone-table{display:table;table-layout:auto}
  .phone-table thead{display:table-header-group}
  .phone-table tbody{display:table-row-group}
  .phone-table tr{display:table-row;width:auto;margin:0;padding:0;border:0;border-radius:0;background:transparent}
  .phone-table td,.phone-table td:empty{display:table-cell;width:auto;border-bottom:1px solid var(--line);padding:12px 6px;vertical-align:middle}
  .phone-table th{padding:12px 6px;line-height:1.5}
  .phone-table td:before,.phone-table td:last-child button:after{display:none;content:none}
  .phone-table td input,.phone-table td select{min-width:64px}
  .phone-table td:last-child button{width:auto;min-width:44px}
  /* The seven-column materials editor already has its own scroll container. */
  .phone-table:has(th:nth-child(7)){min-width:860px}
  .phone-table:has(th:nth-child(7)) th:first-child{width:25%}
  dialog{inset:0;margin:auto;width:min(720px,calc(100vw - 64px));max-width:720px;max-height:calc(100dvh - 64px);border-radius:18px;padding:32px}
  #toast{max-width:520px}
}

@media screen and (min-width:1000px){
  body{padding-top:0}
  aside{position:fixed;inset:0 auto 0 0;width:224px;height:100dvh;display:flex;flex-direction:column;padding:30px 18px;border-right:1px solid var(--line);border-bottom:0;overflow-y:auto}
  .brand{font-size:20px;gap:8px;flex-shrink:0}
  .brand .dot{margin-left:0}
  aside>small{display:block;margin:36px 12px 14px}
  nav{position:static;left:auto;bottom:auto;transform:none;width:100%;display:grid;grid-template-columns:1fr;gap:7px;margin:0;padding:0;border:0;box-shadow:none;background:transparent}
  nav button{flex-direction:row;justify-content:flex-start;text-align:left;gap:13px;padding:12px 14px;min-height:50px;font-size:14px}
  nav button .navicon{width:24px;flex-shrink:0;text-align:center;font-size:23px}
  .aside-bottom{display:block;margin-top:auto;padding-top:32px}
  .aside-bottom .helper button{min-height:44px}
  main{margin-left:224px;min-height:100dvh;padding-bottom:32px}
  header{min-height:74px;padding:16px 32px}
  .phone-tools{margin:18px 32px 0}
  #app{padding:32px}
  #toast{left:auto;right:28px;bottom:26px;transform:none;width:auto;max-width:min(520px,calc(100vw - 280px))}
}

@media screen and (min-width:1200px){
  .hero{display:grid;grid-template-columns:1.2fr 1fr;min-height:244px}
  .blueprint{display:flex}
  .split{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:24px;align-items:start}
}

@media screen and (min-width:1280px){
  .cards{grid-template-columns:repeat(3,minmax(0,1fr))}
  header{padding-left:40px;padding-right:40px}
  .phone-tools{margin-left:40px;margin-right:40px}
  #app{padding:36px 40px}
}
