@font-face{font-family:SPTThai;src:url("fonts/NotoSansThai-Regular.ttf") format("truetype");font-weight:400;font-display:swap}
@font-face{font-family:SPTThai;src:url("fonts/NotoSansThai-Bold.ttf") format("truetype");font-weight:700;font-display:swap}
body,button,input,select,textarea{font-family:SPTThai,Tahoma,sans-serif}
@media screen{
  :root{--green:#123d32;--gold:#b99758;--ink:#233b34;--line:#dce5de;--muted:#68786f;--bg:#f5f6f2}
  #sidebar{width:238px;padding:30px 22px 18px;background:white;color:var(--ink);border-right:1px solid var(--line);box-shadow:none}
  .main{margin-left:238px;width:calc(100% - 238px)}
  .brand{padding:0;margin-bottom:32px;display:block}
  .brand img{display:block;width:148px;max-width:100%;height:auto}
  #menu{display:none}
  nav.work-tabs{display:grid;gap:5px;flex:none;overflow:visible;margin:0;padding:0}
  .work-tabs button{display:flex;gap:12px;align-items:center;padding:12px;color:var(--ink);border-radius:9px;min-height:48px}
  .work-tabs button span{font-size:21px;line-height:1;color:var(--green)}
  .work-tabs button.active{background:#e9f0e9;color:var(--green)}
  #sidebar-install{margin-top:auto;background:#fff;color:var(--green);border:1px solid var(--line);font-size:.78rem}
  #connection-state,.sidebar-bottom,.sidebar-bottom small{color:var(--muted)}
  header{height:58px;background:white}
  .installed-app header{height:calc(58px + env(safe-area-inset-top))}
  main{max-width:1064px;padding:18px 26px 28px;min-width:0}
  .flow-header{position:sticky;top:58px;z-index:8;background:var(--bg);padding:8px 0;margin-bottom:16px;border-bottom:1px solid var(--line)}
  .installed-app .flow-header{top:calc(58px + env(safe-area-inset-top))}
  .flow-header h1{font-size:1.38rem;margin:0 0 6px}
  .flow-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;flex:none;overflow:visible;margin:0;padding:0}
  .flow-steps button{display:flex;justify-content:flex-start;align-items:center;gap:7px;min-width:0;border:0;border-bottom:3px solid #dfe6df;border-radius:0;background:transparent;color:#586b60;padding:8px 4px}
  .flow-steps button span{display:grid;place-items:center;min-width:26px;height:26px;border-radius:50%;font-size:.75rem;background:#e9eeea}
  .flow-steps button small{font-size:.78rem}
  .flow-steps button.active{border-color:var(--gold);color:var(--green);font-weight:700}
  .flow-steps button.active span{background:var(--green);color:white}
  .flow-steps button.done{border-color:#92ae9c}
  .flow-actions{position:sticky;bottom:0;z-index:7;display:flex;gap:8px;margin-top:14px;border:1px solid var(--line);border-radius:12px 12px 0 0;padding:9px 12px;background:white}
  .flow-actions .primary{margin-left:auto}
  .panel{border-radius:14px;padding:20px 22px}
  .panel h2{font-size:1.1rem}
  .sheet-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:12px}
  .sheet-choice{text-align:left;display:flex;flex-direction:column;gap:3px;padding:11px 12px;font-size:.86rem;overflow-wrap:anywhere}
  .sheet-choice small{font-size:.74rem;color:var(--muted)}
  .sheet-choice.chosen{border-color:var(--gold);background:#fbf7eb}
  .review-head,.material-tabs{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:0 0 14px}
  .review-head h2{margin:0}
  .material-tabs{justify-content:flex-start}
  .summary-sheets{padding-left:25px;columns:2;line-height:1.9}
  .export-total{display:flex;justify-content:space-between;align-items:center;padding:15px 12px;background:#edf3ec;border-radius:8px}
  .input-panel{scroll-margin-top:180px}
  .live-results[hidden]{display:none}
  #content .report-title h2{overflow-wrap:anywhere}
  #sheet-menu{
    inset:0;width:100%;height:100%;max-width:none;max-height:none;
    margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;overflow:hidden
  }
  #sheet-menu::backdrop{background:#0b28266b;backdrop-filter:none}
  .sheet-menu-panel{
    display:flex;flex-direction:column;width:min(82vw,320px);height:100%;min-height:0;
    padding:calc(12px + env(safe-area-inset-top)) 16px calc(12px + env(safe-area-inset-bottom));
    background:var(--green);color:white
  }
  .sheet-menu-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:10px}
  .sheet-menu-head h2{font-size:1rem;margin:0}
  #close-sheet-menu{min-width:44px;min-height:44px;padding:0;font-size:1.5rem;color:white;background:#ffffff15;border:1px solid #ffffff40}
  #sheet-menu #home{margin:0 0 12px;min-height:44px}
  #sheet-menu .search{width:100%;min-height:44px;font-size:1rem}
  #sheet-menu nav{min-height:0;overscroll-behavior:contain}
  #sheet-menu nav button{min-height:44px;font-size:.92rem}
  body:has(#sheet-menu[open]){overflow:hidden}
  @media(max-width:1000px){.sheet-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
  @media(max-width:760px){
    #sidebar,.installed-app #sidebar{position:fixed;inset:auto 0 0;height:calc(62px + env(safe-area-inset-bottom));width:100%;transform:none;z-index:21;padding:4px 8px env(safe-area-inset-bottom);border:0;border-top:1px solid var(--line);background:#fff}
    #sidebar .brand,#sidebar .sidebar-bottom,#sidebar-install{display:none}
    nav.work-tabs{display:flex;justify-content:space-around;gap:4px}
    .work-tabs button{flex:1;flex-direction:column;justify-content:center;gap:3px;font-size:.73rem;min-height:49px;padding:4px}
    .work-tabs button span{font-size:18px}
    .main{width:100%;margin-left:0}
    header{padding:0 14px}
    #menu{display:grid;place-items:center;min-width:44px;min-height:44px;padding:0;color:var(--green)}
    main{padding:10px 12px 14px}
    footer{padding-bottom:calc(70px + env(safe-area-inset-bottom))}
    .flow-header{margin-bottom:10px}
    .flow-header h1{font-size:1.12rem}
    .flow-steps button{flex-direction:column;justify-content:center;gap:3px;padding:4px 0}
    .flow-steps button small{font-size:.66rem}
    .flow-steps button span{min-width:21px;height:21px;font-size:.65rem}
    .flow-actions{bottom:calc(62px + env(safe-area-inset-bottom));padding:6px 9px}
    .flow-actions button{font-size:.85rem}
    .panel{padding:16px 14px}
    .summary-sheets{columns:1}
    #toast{bottom:calc(76px + env(safe-area-inset-bottom))}
  }
}

@media screen {
 .selection-check{border:1px solid var(--line);border-left:4px solid #287859;border-radius:10px;padding:14px;margin:12px 0;background:#f6faf7}
 .selection-check.fail{border-left-color:#b73535;background:#fff5f5}
 .selection-check.pending{border-left-color:#b99758;background:#fffaf0}
 .selection-check>div{display:flex;justify-content:space-between;gap:12px}
 .selection-check b{color:#246247;white-space:nowrap}
 .selection-check.fail b{color:#a82626}
 .selection-check p{font-size:1.15rem;margin:8px 0;overflow-wrap:anywhere}
 .selection-check small{display:block;margin:6px 0}
 .selection-check button{font-size:.85rem}
 .input-advanced{margin-top:14px}
 .input-advanced summary{cursor:pointer;padding:10px 0;color:var(--muted)}
 .input-panel .field>span>small{display:none}
 .selection-feedback .section-panel{box-shadow:none;margin-top:20px}
}

.member-item{display:flex;gap:8px;align-items:center;border-top:1px solid var(--line);padding:12px 0}.member-item>button:first-child{flex:1;text-align:left}.member-list .panel-heading{gap:10px;flex-wrap:wrap}.member-item button{min-height:44px}

@media screen {
  .steel-fields{display:flex;flex-direction:column;gap:16px}
  .input-pair{display:grid;grid-template-columns:1fr;gap:12px}
  .input-pair.paired{grid-template-columns:repeat(2,minmax(0,1fr));align-items:end}
  .input-pair .field{min-width:0}
  .input-pair.paired .field>span{min-height:3.2em;display:flex;align-items:center}
  .flow-actions{position:fixed;left:238px;right:0;max-width:1012px;margin:0 auto;bottom:0;box-shadow:0 -3px 18px #123d3208}
  main{padding-bottom:100px}
  @media(max-width:760px){
    .flow-actions{left:0;bottom:calc(62px + env(safe-area-inset-bottom));border-radius:0;border-width:1px 0 0;padding:8px 12px}
    .flow-actions button{min-height:44px}
    main{padding-bottom:80px}
  }
}

@media screen {
  .beam-load-editor{margin:18px 0 0;border:1px solid var(--line)}
  .load-row{border:1px solid var(--line);border-radius:10px;padding:12px;margin:10px 0}
  .load-row-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px}
  .load-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
  .load-fields .field{min-width:0;font-size:.875rem}
  .load-fields input{min-width:0;width:100%;font-size:16px}
  .load-fields input[readonly]{background:#edf1ee;color:#526b60}
  .beam-diagram-scroll{width:100%;min-width:0;overflow:hidden;border:1px solid var(--line);border-radius:10px;background:white}
  .beam-diagram-scroll svg{display:block;width:100%;min-width:0;max-width:100%;height:auto}
  .beam-load-editor small{font-size:.875rem}
  @media(max-width:760px){.load-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.load-fields .field:last-child:nth-child(3){grid-column:1/-1}.beam-load-editor{padding:10px}.load-row{padding:10px}}
}
@media print {.beam-diagram-scroll svg{width:100%;height:auto}.beam-load-diagram{break-inside:avoid}.load-row button{display:none}}

@media screen {
  .rc-section-panel{background:white;border:1px solid var(--line);border-radius:14px;padding:18px;margin:18px 0;grid-column:1/-1}
  .rc-section-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
  .rc-section-heading h3{margin:0;font-size:1.05rem}
  .rc-section-heading>span{font-size:.875rem;color:var(--muted)}
  .rc-section-svg{display:block;width:100%;max-height:580px;margin:0 auto}
  .rc-rebar-legend{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 16px;font-size:.875rem;margin:0}
  .rc-rebar-legend div{border-bottom:1px solid var(--line);padding:8px 0}
  .rc-rebar-legend dt{color:var(--muted)}
  .rc-rebar-legend dd{margin:4px 0 0;color:var(--ink);font-weight:700}
  @media(max-width:760px){.rc-section-panel{padding:12px}.rc-section-heading h3{font-size:1rem}}
}
@media print {
  .rc-section-panel{break-inside:avoid;grid-column:1/-1;border:1px solid #dce5de;padding:12px;margin:12px 0}
  .rc-section-svg{display:block;width:100%;max-height:400px}
  .rc-rebar-legend{display:grid;grid-template-columns:1fr 1fr;gap:6px 12px;font-size:10pt}
  .rc-rebar-legend dd{margin:0}
  .rc-section-heading h3{font-size:12pt}
}

@media screen {
  .beam-workspace{padding:0!important;border:0;background:none}
  .beam-workspace .beam-load-editor{margin-top:0}
  .beam-primary-load-fields,.beam-dimension-fields{margin:14px 0}
  .beam-editor-charts{display:grid;grid-template-columns:1fr;gap:12px;margin-top:18px}
  .beam-editor-charts .chart{margin:0;min-width:0}
  .beam-rebar-editor{display:grid;grid-template-columns:minmax(0,42fr) minmax(0,58fr);gap:8px;align-items:stretch;margin-top:12px}
  .beam-section-preview{height:550px;min-width:0}
  .beam-section-preview .rc-section-svg{height:550px;width:100%;max-height:none}
  .beam-layer-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.75fr);gap:8px;height:110px;align-content:center;border-bottom:1px solid var(--line)}
  .beam-layer-row .field{min-width:0;font-size:.875rem;line-height:1.35}
  .beam-layer-row .field>span{min-height:2.7em;margin-bottom:4px;display:flex;align-items:center}
  .beam-layer-row input,.beam-layer-row select{width:100%;min-width:0;font-size:16px;padding:8px;min-height:44px}
  .beam-layer-row select{padding-right:24px;background-position:right 8px center}
  .beam-detail-settings{margin-top:16px}
  .beam-detail-settings summary{padding:10px 0;cursor:pointer}
  .beam-detail-settings .fields{margin-top:12px}
  .beam-workspace .beam-diagram-scroll{overflow-x:hidden}
  .beam-workspace .beam-diagram-scroll svg{min-width:0;width:100%}
  @media(max-width:760px) {
    .beam-workspace .beam-load-diagram svg text{font-size:28px}
    .beam-rebar-editor{grid-template-columns:minmax(0,38fr) minmax(0,62fr);gap:4px}
    .beam-layer-row{gap:5px}
    .beam-design-editor{padding:10px}
    .beam-editor-charts .chart{padding:10px}
  }
}

/* Compact result rows while retaining readable values and touch targets. */
@media screen {
 .selection-feedback{padding:12px}
 .selection-feedback h2{font-size:1.125rem;margin:0 0 10px}
 .selection-feedback .selection-check{padding:9px 12px;margin:8px 0;border-radius:8px}
 .selection-feedback .selection-check>div{align-items:center;font-size:1rem;line-height:1.4}
 .selection-feedback .selection-check p{font-size:1rem;line-height:1.45;margin:4px 0}
 .selection-feedback .selection-check small{font-size:.875rem;line-height:1.4;margin:4px 0;overflow-wrap:anywhere}
 .selection-feedback .selection-check button{font-size:.875rem;min-height:44px;padding:6px 10px;margin-top:4px}
}

@media screen {
 .beam-dimension-fields{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px}
 .beam-dimension-fields .field{min-width:0}
 .beam-dimension-fields input{width:100%;min-width:0}
 .beam-section-preview,.beam-section-preview .rc-section-svg{height:420px}
 .beam-layer-row{height:84px;gap:5px}
 .beam-layer-row .field>span{font-size:14px;min-height:2.7em;margin-bottom:2px}
 .beam-layer-row select{height:44px;min-height:44px;padding:5px 22px 5px 6px}
 .work-tabs [data-work-view] span{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:8px;background:linear-gradient(145deg,#fff,#dfe9e4);box-shadow:2px 3px 5px #123d3225,inset 1px 1px 1px #fff;border:1px solid #d4dfd8;color:#153f36;transform:perspective(100px) rotateX(7deg);font-size:21px}
}

@media screen{.beam-self-weight{border:1px solid #cbdcd1;border-radius:10px;background:#edf5ef;padding:10px 12px;margin:12px 0}.beam-self-weight p{margin:4px 0}.beam-self-weight small{font-size:.875rem}}

@media screen {
 .beam-self-weight{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px}
 .beam-self-weight p{margin:0;white-space:nowrap}
 .load-swipe{position:relative;overflow:hidden;border-radius:10px;margin:8px 0;background:#b73535;touch-action:pan-y}
 .load-swipe .load-row{position:relative;z-index:1;display:grid;grid-template-columns:40px minmax(0,1fr);align-items:center;gap:6px;margin:0;padding:8px;background:white;transition:transform .18s ease;touch-action:pan-y}
 .load-swipe.open .load-row{transform:translateX(-72px)}
 .load-swipe-delete{position:absolute;right:0;top:0;bottom:0;width:72px;border:0;border-radius:0;background:#b73535;color:white;visibility:hidden}
 .load-swipe.open .load-swipe-delete{visibility:visible}
 .load-row-name{font-size:1rem;padding-top:23px;white-space:nowrap}
 .load-row .load-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;min-width:0}
 .load-row.distributed-load-row .load-fields{grid-template-columns:repeat(3,minmax(0,1fr))}
 .load-row .load-fields .field:last-child{grid-column:auto}
 .load-row .field>span{display:block;font-size:14px;line-height:1.35;min-height:19px;margin-bottom:4px;white-space:nowrap}
 .load-row input{padding:8px 6px;height:44px;min-height:44px;font-size:16px}
 .beam-section-preview{overflow:visible}
 @media(prefers-reduced-motion:reduce){.load-swipe .load-row{transition:none}}
 @media(max-width:380px){.load-swipe .load-row{grid-template-columns:32px minmax(0,1fr);gap:4px;padding:7px}.load-row .load-fields{gap:4px}.load-row .field>span{font-size:14px;white-space:normal;min-height:38px}.load-row-name{padding-top:42px}}
}

@media screen{
 .member-swipe{position:relative;overflow:hidden;background:#b73535;border-radius:10px;margin:10px 0;touch-action:pan-y}
 .member-swipe .member-item{position:relative;z-index:1;background:white;margin:0;border:0;padding:0;transition:transform .18s ease;touch-action:pan-y}
 .member-swipe.open .member-item{transform:translateX(-72px)}
 .member-swipe-delete{position:absolute;right:0;top:0;bottom:0;width:72px;border:0;border-radius:0;background:#b73535;color:white;visibility:hidden}
 .member-swipe.open .member-swipe-delete{visibility:visible}
 @media(prefers-reduced-motion:reduce){.member-swipe .member-item{transition:none}}
}

@media screen{.member-name-input{flex:1;min-width:0;width:100%;height:48px;border:1px solid var(--line);border-radius:9px;padding:10px 14px;font-size:16px;background:white;color:var(--ink)}.member-name-input:focus{outline:2px solid #b99758;outline-offset:-2px}.member-item>button{flex:none;white-space:nowrap}.member-name-input::selection{background:#e7eddf}}
#sheet-menu #nav{display:flex;flex-direction:column;gap:6px;flex:1;min-height:0;overflow-y:auto;padding-block:12px;touch-action:pan-y}#sheet-menu #nav button{display:flex;flex-direction:column;align-items:flex-start;text-align:left;width:100%;border:1px solid #ffffff20;background:#ffffff0b;color:white;padding:10px 12px;border-radius:10px;flex-shrink:0}#sheet-menu #nav button.active{background:#ffffff26;border-color:#c3ac77}#sheet-menu #nav small{color:#c6d8cf;font-size:.8rem}#sheet-menu .sheet-menu-empty{color:#d7e5dd}header #export[hidden]{display:none!important}.header-actions #save-status,.header-actions [data-cloud-header]{display:none!important}.header-actions{margin-left:auto;flex-shrink:0}
.project-item{padding:0}.project-item>button{display:flex;flex-direction:column;gap:4px;width:100%;text-align:left;background:white;border:0;padding:14px}.project-item.active{border-color:#a6bdac}.project-item small{font-size:13px;color:#61766a}.project-trash{margin-top:16px}.project-trash>div{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0}.project-list-panel .panel-heading{align-items:center}.project-list-panel h1{margin:0}html,body{overscroll-behavior-y:none}body.spt-pulling,body.spt-pull-settling{position:relative;overflow-anchor:none}body.spt-pull-settling{transition:top 240ms cubic-bezier(.2,.7,.3,1)}

.project-library-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin:0 0 22px}.project-library h1{font-size:1.5rem;margin:0 0 8px}.project-library-heading p,.project-count{color:#6e8075;font-size:.9rem;margin:0}.project-library-heading button{flex-shrink:0}.project-library input[type=search]{width:100%;margin:0 0 12px}.project-count{margin-bottom:14px}.project-cards .project-swipe{border:1px solid #dce5de;border-radius:10px;margin:0 0 10px}.project-cards .project-item>button{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;padding:12px 16px;min-height:92px}.project-type{grid-column:1/-1;color:#74867a;font-size:.875rem}.project-item strong{min-width:0;overflow-wrap:anywhere;font-size:1rem}.project-open-cue{grid-column:2;grid-row:2;color:#466b57;font-size:.875rem}.project-cards .project-item small{grid-column:1/-1;font-size:.875rem}.project-empty{padding:28px 16px;text-align:center;color:#6e8075;background:#fff;border:1px solid #dce5de;border-radius:10px}.project-editor-heading{display:flex;align-items:center;gap:16px;margin-bottom:18px}.project-editor-heading h1{font-size:1.4rem;margin:0}.project-swipe[hidden]{display:none!important}@media(max-width:600px){.project-library-heading{align-items:flex-start;gap:10px}.project-library h1{font-size:1.2rem}.project-library-heading p{font-size:.875rem}.project-library-heading button{padding:10px;min-height:44px}}

/* Project cards follow the quotation library: overview above, actions below. */
.project-cards .project-swipe{border-radius:12px;margin-bottom:12px}.project-cards .project-item>button.project-card-main{grid-template-columns:minmax(0,1fr) auto;gap:6px 14px;min-height:106px;padding:14px 16px;border-radius:0}.project-card-main .project-type{color:#b49357;font-size:.875rem;grid-column:1/-1}.project-card-main strong{font-size:1.05rem;grid-column:1;grid-row:2}.project-card-total{grid-column:2;grid-row:2;font-weight:600;font-size:1rem;color:#253b32;white-space:nowrap}.project-card-main .project-open-cue{grid-row:3;align-self:center;color:#7d8981}.project-card-main small{grid-column:1!important;grid-row:3;color:#7d8981}.project-item.active .project-card-main{background:#eef2ed}.project-card-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;padding:12px 16px;border-top:1px solid #e5eae3;background:#fff}.project-card-actions button{min-height:40px;padding:8px 12px;font-size:.875rem}.project-state{padding:7px 12px;border-radius:24px;background:#f5f0e1;color:#8b7139;font-weight:600;font-size:.875rem}.project-state.is-current{background:#e6f0e8;color:#335e43}.project-card-foot{padding:0 16px 12px;text-align:right;color:#74867a;background:#fff;font-size:.875rem}.project-card-actions button:hover{background:#eef2ed}@media(max-width:400px){.project-cards .project-item>button.project-card-main{padding:12px;gap:6px 8px}.project-card-main strong{font-size:1rem}.project-card-total{font-size:.9rem}.project-card-actions{padding:10px 12px}.project-card-foot{padding:0 12px 12px}}

/* Project cards stack vertically; member editor rows remain horizontal. */
.project-cards .member-item.project-item{display:block;width:100%;min-width:0;overflow:hidden}.project-cards .project-item>button.project-card-main{width:100%;max-width:100%;min-width:0;white-space:normal;box-sizing:border-box}.project-cards .project-card-main strong,.project-cards .project-card-main small,.project-cards .project-type{overflow-wrap:anywhere;white-space:normal;min-width:0}.project-cards .project-card-actions,.project-cards .project-card-foot{width:100%;box-sizing:border-box}.project-cards .project-card-foot{white-space:normal}.project-cards .project-card-total{font-size:.9rem}.project-cards .project-type{line-height:1.5}.project-cards .project-card-main small{line-height:1.5}#app-install-bar{display:none!important}#content:has(.project-editor-heading) .panel-heading{align-items:flex-start;gap:10px;flex-wrap:wrap}#content:has(.project-editor-heading) .panel-heading>div{flex:1;min-width:200px}#content:has(.project-editor-heading) .panel-heading .tag{flex:none;width:auto;max-width:100%;min-width:0;white-space:nowrap;font-size:.75rem;line-height:1.4;padding:5px 9px;border-radius:16px}

.project-card-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch;gap:8px}.project-card-actions button{min-width:0;white-space:normal;line-height:1.45;padding:8px 6px;font-size:.875rem}#content:has(.project-editor-heading) .panel-heading .tag.project-autosave{font-size:.65rem;padding:3px 7px;line-height:1.3}#project-saved-dialog{width:min(540px,calc(100vw - 24px));max-height:85dvh;overflow:auto;border:1px solid #dce5de;border-radius:14px;padding:18px}.saved-sheet-list{display:grid;gap:10px}.saved-sheet-list button{text-align:left;display:grid;gap:6px;padding:14px}.saved-sheet-list small{color:#6e8075;font-size:.875rem}

#project-saved-dialog .modal-head{gap:10px}#project-saved-dialog h2{font-size:1.15rem;margin:0;min-width:0}.saved-sheet-actions{display:flex;gap:6px;flex-shrink:0}.saved-sheet-actions button{padding:9px 10px;font-size:.875rem;white-space:nowrap}.saved-sheet-selection{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:14px 0;font-size:.875rem}.saved-sheet-selection label{display:flex;align-items:center;gap:8px;font-weight:700}.saved-sheet-selection input,.saved-sheet-row>input{width:22px;height:22px;accent-color:#153f36;flex-shrink:0}.saved-sheet-selection span{color:#6e8075}.saved-sheet-row{display:flex;align-items:center;border:1px solid #dce5de;border-radius:9px;overflow:hidden;padding-right:14px}.saved-sheet-list .saved-sheet-row button{flex:1;min-width:0;border:0;background:transparent;border-radius:0;box-shadow:none}.saved-sheet-row strong,.saved-sheet-row small{overflow-wrap:anywhere}.saved-sheet-row:has(input:checked){border-color:#153f36;background:#f1f7f4}.saved-sheet-row>input{margin:12px;cursor:pointer}@media(max-width:360px){#project-saved-dialog{padding:12px}#project-saved-dialog h2{font-size:1rem}.saved-sheet-actions button{padding:8px;font-size:.8rem}}

/* Keep a real desktop drag surface outside editable names. */
@media screen{
 .member-list .member-swipe .member-item{padding:6px 8px;cursor:grab;border:1px solid var(--line);border-radius:10px}
 .member-list .member-name-input{cursor:text}
 .member-swipe.swiping .member-item{transform:translateX(var(--swipe-offset,0px));transition:none;cursor:grabbing;user-select:none}
 .member-swipe.swiping .member-swipe-delete{visibility:visible}
}

.truss-image-editor img{display:block;max-width:100%;max-height:320px;object-fit:contain;margin:12px auto}.truss-image-editor input[type=file]{width:100%;max-width:100%}.truss-report-image{break-inside:avoid;margin:12px 0}.truss-report-image img{display:block;max-width:100%;width:auto;height:auto;max-height:100mm;object-fit:contain;margin:0 auto}

.roof-material-control{width:100%;min-height:48px;text-align:left;white-space:normal;display:flex;flex-direction:column;gap:4px;background:#fff}.roof-material-control small{font-size:.8rem;color:#52665b}#roof-material-dialog{width:min(660px,calc(100vw - 24px));max-height:90dvh;overflow:auto;padding:20px}#roof-material-dialog h2{margin:0;font-size:1.2rem}#roof-material-dialog .modal-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.roof-material-list{max-height:34dvh;overflow:auto;margin:12px 0;border:1px solid var(--line);border-radius:10px}.roof-material-option{display:flex;gap:10px;padding:12px;border-bottom:1px solid var(--line);cursor:pointer}.roof-material-option:last-child{border-bottom:0}.roof-material-option:has(input:checked){background:#e9efeb}.roof-material-option input{width:20px;height:20px;min-height:20px;flex:none;accent-color:#153f36}.roof-material-option span{display:flex;flex-direction:column;gap:5px}.roof-material-option small{color:#52665b;font-size:.85rem}.roof-load-details{margin:12px 0}.roof-load-details summary{cursor:pointer;font-weight:600}#roof-material-dialog [type=submit]{width:100%;min-height:44px}.roof-material-control strong{font-variant-numeric:tabular-nums}#roof-material-dialog [hidden]{display:none!important}
.saved-sheet-extras{border:1px solid #dce6df;border-radius:12px;margin:16px 0 0;padding:12px;display:grid;gap:10px}.saved-sheet-extras legend{font-weight:700;padding:0 6px}.saved-sheet-extras label,.saved-sheet-extras [data-saved-files] label{display:flex;align-items:center;gap:8px}.saved-sheet-extras [data-saved-files]{display:grid;gap:10px}.saved-sheet-extras select{max-width:100%;min-height:40px}

#project-saved-dialog .saved-sheet-extras {display:flex;flex-direction:column;align-items:stretch;gap:4px}
#project-saved-dialog .saved-sheet-extras > label:not(.saved-certification),#project-saved-dialog .saved-sheet-extras [data-saved-files] label {display:flex;justify-content:flex-start;align-items:center;gap:10px;width:100%;padding:8px 4px;text-align:left;line-height:1.4}
#project-saved-dialog .saved-sheet-extras input[type=checkbox] {width:20px;height:20px;flex:0 0 20px;margin:0;accent-color:#153f36}
#project-saved-dialog .saved-sheet-extras .saved-certification {display:flex;flex-direction:column;align-items:stretch;gap:6px;margin:8px 0;text-align:left}
#project-saved-dialog .saved-sheet-extras select {width:100%}
#project-saved-dialog .saved-sheet-extras [data-saved-files] {display:grid;gap:0;border-top:1px solid #dce6df;padding-top:6px}
/* Keep sidebar labels legible against the pale hover background. */
@media (hover:hover){#sidebar nav button[data-work-view]:hover,#sidebar nav button[data-work-view]:hover .nav-label,#sidebar nav button[data-work-view]:hover .nav-icon{color:#806020}#sidebar nav button[data-work-view]:hover{background:#f6f1e5}}

/* Automatic rafter transfer is the effective value, not a generic empty-field hint. */
.field input[data-rafter-load]::placeholder{color:#153f36;opacity:1}
.field [data-rafter-load-hint]{display:block;font-size:.75rem;line-height:1.4;color:#647974;margin-top:4px}
/* Continuous-beam editor shares standard beam fields and collapsible panels. */
.cb-span{margin:10px 0;padding:12px;border:1px solid #dce5de;border-radius:10px;background:white;min-width:0}
.cb-span>summary{cursor:pointer;color:#153f36;font-weight:600;min-height:35px;line-height:1.5;padding:5px 0}
.cb-span fieldset{min-width:0;margin:10px 0}
.cb-span .cb-load-type{grid-column:1/-1;min-width:0}
.cb-span .beam-section-preview .rc-section-svg{width:100%;height:auto;max-height:400px}
.cb-span .beam-rebar-editor{min-width:0}

.cb-span .beam-detail-settings .fields{grid-template-columns:repeat(2,minmax(0,1fr))}

/* The exposed swipe action owns a full-width, centered label; all editor fields slide together. */
@media screen{
 .load-swipe-delete,.member-swipe-delete,.cb-span-delete{position:absolute;right:0;top:0;bottom:0;width:72px;box-sizing:border-box;display:flex;align-items:center;justify-content:center;z-index:0;padding:0!important;margin:0!important;min-width:0;max-width:72px;white-space:nowrap;font-size:16px;line-height:1.25;color:#fff!important;background:#b73535!important;border:0;border-radius:0;visibility:hidden}
 .load-swipe.open .load-swipe-delete,.load-swipe.swiping .load-swipe-delete,.member-swipe.open .member-swipe-delete,.member-swipe.swiping .member-swipe-delete,.cb-span-swipe.open .cb-span-delete,.cb-span-swipe.swiping .cb-span-delete{visibility:visible}
 .cb-span .cb-span-header{position:relative;display:block;overflow:hidden;list-style:none;padding:0;margin:0;border-radius:8px;touch-action:pan-y;background:white}
 .cb-span-header::-webkit-details-marker{display:none}
 .cb-span-swipe{background:#b73535!important}
 .cb-span-title{position:relative;z-index:1;display:flex;gap:7px;align-items:center;min-height:44px;padding:5px 2px;background:white;transition:transform .16s ease-out;transform:translate3d(var(--swipe-offset,0px),0,0);touch-action:pan-y}
 .cb-span-title::before{content:'▶';font-size:.85em}
 .cb-span[open]>.cb-span-header .cb-span-title::before{content:'▼'}
 .cb-span-swipe.open .cb-span-title{transform:translate3d(var(--swipe-offset,-72px),0,0)}
 .cb-span-swipe.swiping .cb-span-title{transition:none;user-select:none;-webkit-user-select:none}
 @media(prefers-reduced-motion:reduce){.cb-span-title{transition:none}}
}

/* Archived projects reuse the same swipe gesture as active project cards. */
@media screen{
 .project-trash>.trash-project-swipe{display:block;padding:0;margin:8px 0;border-radius:9px}
 .project-trash .trash-project-front{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:62px;padding:8px 0;background:var(--bg,#f5f6f2)}
 .project-trash .trash-project-front>span{min-width:0;overflow-wrap:anywhere}
 .project-trash .trash-project-front>button{flex-shrink:0}
 .project-trash .trash-project-swipe .member-swipe-delete{font-size:12px;padding:0 4px;white-space:nowrap}
}
/* On small touch screens the whole picker is one native scroll area. */
@media (max-width:760px){
 #roof-material-dialog{max-height:min(90vh,90dvh);overflow-y:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y}
 #roof-material-dialog .roof-material-list{max-height:none;overflow:visible;touch-action:pan-y}
 #roof-material-dialog .roof-material-option{touch-action:pan-y}
}

/* Ridge beam fields follow the numbered reading order in pairs. */
.input-panel .ridge-paired-fields{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}

.ridge-extra-load{display:flex;flex-direction:column;align-items:flex-start;gap:.5rem;min-width:0}.ridge-extra-load button{max-width:100%;white-space:normal}.ridge-extra-load small{color:#657770;line-height:1.4}.ridge-extra-load .field{width:100%}

/* Keep certificate edit actions aligned without nesting buttons inside labels. */
#project-saved-dialog .saved-cert-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;padding:4px}
#project-saved-dialog .saved-cert-row label{display:flex;align-items:center;gap:10px;min-width:0;line-height:1.4}
#project-saved-dialog .saved-cert-row button{min-height:38px;min-width:64px;padding:6px 10px;white-space:nowrap}

/* The section icon occupies only the revealed gap, then is covered by the returning page. */
.spt-pull-indicator{position:fixed;top:env(safe-area-inset-top,0px);left:0;right:0;height:0;z-index:9;overflow:hidden;pointer-events:none;background:#f3f6f5;color:var(--gold,#b99758)}
.spt-pull-indicator[hidden]{display:none!important}
.spt-pull-indicator svg{position:absolute;left:50%;top:6px;transform:translateX(-50%);width:42px;height:42px;overflow:visible;fill:none;stroke-linecap:round;stroke-linejoin:round}
.spt-refresh-outline{stroke:#b99758;opacity:.45;stroke-width:3.5}
.spt-refresh-trace{stroke:#d8b65e;stroke-width:4.55;stroke-dasharray:24 76;stroke-dashoffset:0;animation:spt-refresh-trace 2.2s linear infinite}
.spt-pull-indicator[data-state="armed"] .spt-refresh-outline,.spt-pull-indicator[data-state="refreshing"] .spt-refresh-outline{opacity:1}
.spt-pull-indicator[data-state="armed"] .spt-refresh-trace,.spt-pull-indicator[data-state="refreshing"] .spt-refresh-trace{stroke:#ffdf89}
.spt-pull-indicator.is-settling{transition:height 240ms cubic-bezier(.2,.7,.3,1)}
@keyframes spt-refresh-trace{to{stroke-dashoffset:-100}}
@media(prefers-reduced-motion:reduce){.spt-refresh-trace{animation:none;stroke-dasharray:none}.spt-pull-indicator.is-settling{transition:none}}

/* The viewport revealed by the pull must match the selected appearance, even
   when a calculation screen overrides --bg on the body. */
@media screen{
 html[data-theme="light"]{background-color:#f3f6f5}
 html[data-theme="light"] .spt-pull-indicator{background:#f3f6f5}
 html[data-theme="dark"]{background-color:#101d19}
 html[data-theme="dark"] .spt-pull-indicator{background:#101d19}
}
