/* Original green reference styles; no homepage styles are imported. */
:root{
  --g:#008b26;
  --dg:#005d30;
  --ink:#12263a;
  --line:#dbe8e6;
  --mint:#e8fce9;
  --shadow:0 5px 18px #064c3719
}
*{
  box-sizing:border-box
}
body{
  margin:0;
  font:15px/1.45 system-ui,Segoe UI,Arial,sans-serif;
  color:#172633;
  background:linear-gradient(135deg,#e7fff0,#f4fbff 55%,#e4f7f1)
}
button,input,select{
  font:inherit
}
button{
  cursor:pointer
}
button:disabled{
  cursor:not-allowed;
  opacity:.55
}
header{
  background:linear-gradient(115deg,#9cefb5 0%,#00943b 25%,#005d32 63%,#00ae30 83%,#005331);
  color:white;
  padding:11px clamp(14px,3vw,42px)
}
.head{
  max-width:1580px;
  margin:auto;
  display:flex;
  align-items:center;
  gap:25px
}
.brand{
  display:flex;
  align-items:center;
  gap:13px;
  color:#071e12
}
.excel{
  width:49px;
  height:52px;
  border-radius:7px;
  background:linear-gradient(90deg,#00622b 48%,#19bd59 48%);
  color:white;
  font-size:28px;
  font-weight:900;
  display:grid;
  place-items:center;
  box-shadow:0 3px 8px #0003;
  flex-shrink:0
}
.brand b{
  display:block;
  font-size:30px;
  line-height:1
}
.brand small{
  font-weight:750
}
.slogan{
  border-left:2px solid #fff9;
  padding-left:22px;
  font-size:clamp(14px,1.6vw,23px);
  font-weight:650
}
.headright{
  margin-left:auto;
  white-space:nowrap;
  font-size:17px
}
.wrap{
  max-width:1580px;
  margin:auto;
  padding:0 clamp(10px,1.5vw,24px) 24px
}
.steps{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  background:white;
  border-radius:18px;
  box-shadow:var(--shadow);
  padding:9px;
  gap:8px;
  margin-bottom:16px
}
.step{
  border:0;
  background:transparent;
  border-radius:32px;
  padding:9px 4px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  font-weight:800;
  color:#111
}
.step.active{
  background:linear-gradient(#00aa2d,#00680f);
  color:white
}
.step .num{
  display:grid;
  place-items:center;
  width:36px;
  height:36px;
  border-radius:50%;
  background:#dfe7ec;
  font-size:20px
}
.step.active .num{
  background:transparent;
  border:2px solid white
}
.step.done .num{
  background:#009725;
  color:white
}
.screen{
  display:none
}
.screen.active{
  display:block
}
.cols{
  display:grid;
  grid-template-columns:minmax(230px,21%) minmax(400px,1fr) minmax(255px,23%);
  gap:14px
}
.panel,.filebar,.card{
  background:white;
  border:1px solid var(--line);
  border-radius:17px;
  box-shadow:var(--shadow);
  overflow:hidden
}
.panel{
  padding:14px
}
.panel.nopad{
  padding:0
}
.bar{
  background:linear-gradient(100deg,#00622c,#00a52e);
  color:white;
  padding:11px 16px;
  font-size:19px;
  font-weight:800;
  border-radius:10px
}
.panel.nopad>.bar{
  border-radius:0
}
.panelbody{
  padding:15px
}
.menu{
  display:grid;
  gap:7px
}
.menu button{
  background:#fff;
  border:0;
  text-align:left;
  padding:12px 13px;
  border-radius:10px;
  font-weight:650
}
.menu button.selected{
  background:#ddfce2
}
.soft{
  background:#e9ffec;
  border-radius:12px;
  padding:14px
}
.listcheck{
  list-style:none;
  padding:0;
  margin:12px 0
}
.listcheck li{
  margin:11px 0;
  display:flex;
  align-items:flex-start;
  gap:9px
}
.tick{
  color:#009b2b;
  font-weight:900
}
.hero{
  text-align:center;
  padding:20px 12px 14px;
  background:radial-gradient(ellipse at top,#d7fbe4,transparent 60%)
}
.hero .bigexcel{
  font-size:70px;
  color:#009a35
}
.hero h1{
  font-size:clamp(25px,2.4vw,38px);
  margin:0
}
.hero p{
  margin:3px 0 18px;
  color:#42566a
}
.drop{
  border:2px dashed #38a950;
  border-radius:20px;
  background:#edfff0;
  min-height:195px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:16px;
  gap:7px;
  text-align:center
}
.drop.drag{
  background:#d5f9dd
}
.drop strong{
  font-size:24px
}
.btn{
  background:linear-gradient(#00b62d,#006c10);
  border:0;
  border-radius:30px;
  color:white;
  font-weight:800;
  padding:13px 26px;
  box-shadow:0 4px 8px #006d1d26
}
.btn.secondary{
  background:white;
  border:1px solid #b8d8c5;
  color:#173a30;
  box-shadow:var(--shadow)
}
.btn.wide{
  width:100%;
  margin-top:14px;
  font-size:18px
}
.filebar{
  display:flex;
  align-items:center;
  gap:12px;
  padding:11px 18px;
  margin-bottom:14px
}
.muted{
  color:#48617c;
  font-size:13px
}
.filebar strong,.filebar span{
  display:block
}
.filebar .right{
  margin-left:auto
}
.opts{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:12px
}
.opts label{
  background:#f1f7f9;
  border-radius:11px;
  padding:10px;
  font-weight:650
}
.opts select{
  display:block;
  width:100%;
  padding:8px;
  border:1px solid #cbdadf;
  border-radius:9px;
  background:white
}
.actions{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  margin-top:14px;
  padding:10px 0
}
.tools{
  max-height:480px;
  overflow:auto
}
.tool{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  padding:5px 0
}
.tool input{
  accent-color:#009a2d
}
.tablewrap{
  overflow:auto;
  max-height:410px;
  border:1px solid var(--line);
  border-radius:9px;
  margin-top:12px
}
table{
  border-collapse:collapse;
  min-width:100%;
  width:max-content;
  font-size:13px
}
th{
  background:#d7f8df;
  position:sticky;
  top:0
}
td,th{
  border:1px solid #e1e9ea;
  padding:8px 11px;
  text-align:left;
  white-space:nowrap
}
td.issue{
  background:#fff1c6
}
.kpis{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px;
  margin-top:13px
}
.kpi{
  border-radius:10px;
  padding:13px;
  background:#e8f7ff
}
.kpi:nth-child(2){
  background:#fff4d4
}
.kpi:nth-child(3){
  background:#ffe8e8
}
.kpi:nth-child(4){
  background:#e1ffe8
}
.kpi b{
  display:block;
  font-size:24px;
  color:#00772c
}
.info{
  background:#e6ffe8;
  padding:14px;
  border-radius:12px;
  margin-top:16px
}
.status{
  color:#4c6272;
  font-size:13px;
  margin-top:12px
}
.review{
  display:grid;
  grid-template-columns:minmax(0,1.7fr) minmax(280px,1fr);
  gap:14px
}
.review .stats{
  display:grid;
  grid-template-columns:1fr auto;
  gap:7px;
  padding:12px
}
.review .stats span:nth-child(even){
  font-weight:800;
  color:#006d2b
}
.success{
  text-align:center;
  background:#e8ffeb;
  border-radius:14px;
  padding:22px
}
.success .mark{
  font-size:50px;
  color:#008e22
}
.paylayout{
  display:grid;
  grid-template-columns:minmax(0,1.7fr) minmax(310px,1fr);
  gap:14px
}
.paybox{
  padding:13px;
  background:white;
  border:1px solid var(--line);
  border-radius:13px;
  margin:12px 0
}
.payment{
  border:2px solid #009a2b;
  background:#e8ffeb;
  border-radius:11px;
  padding:13px;
  font-size:22px;
  font-weight:850;
  color:#0649a0
}
.detail{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:8px 0;
  border-bottom:1px solid #e2e8eb
}
.total{
  background:#dfffdf;
  border-radius:9px;
  padding:12px;
  font-size:22px;
  font-weight:850
}
.price{
  font-size:29px;
  font-weight:900;
  color:#005c1a
}
.checkouthead{
  display:flex;
  justify-content:space-between;
  gap:10px
}
.bottom{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-top:13px
}
.notice{
  padding:12px;
  border:1px solid #f1d6a4;
  background:#fff8e6;
  border-radius:10px
}
.hidden{
  display:none!important
}
@media(max-width:1050px){
  .cols{
    grid-template-columns:220px minmax(0,1fr)
  }
  .cols>.panel:last-child{
    grid-column:1/-1
  }
  .headright{
    display:none
  }
  .paylayout{
    grid-template-columns:1fr 330px
  }
}
@media(max-width:740px){
  .slogan{
    display:none
  }
  .brand b{
    font-size:23px
  }
  .steps{
    gap:2px;
    padding:6px
  }
  .step{
    font-size:10px;
    flex-direction:column;
    gap:3px
  }
  .step .num{
    width:29px;
    height:29px;
    font-size:15px
  }
  .cols,.review,.paylayout{
    grid-template-columns:1fr
  }
  .cols>.panel:last-child{
    grid-column:auto
  }
  .opts{
    grid-template-columns:1fr
  }
  .panel{
    padding:10px
  }
  .head{
    gap:6px
  }
  .actions{
    flex-wrap:wrap
  }
  .btn{
    padding:11px 18px
  }
  .hero .bigexcel{
    font-size:52px
  }
}
.reference-inline-1{
  font-size:44px;
  color:#008b28
}
.reference-inline-2{
  margin-top:12px
}
.reference-inline-3{
  margin-top:12px
}
.reference-inline-4{
  margin-top:10px
}
.reference-inline-5{
  text-align:center
}
/* Integration rules are scoped to the green page; homepage CSS is untouched. */
.brand { text-decoration: none; }
.headright a { color: white; text-decoration: none; }
h2.bar { margin: 0; line-height: 1.4; }
.tool-fieldset, .policy-box { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-top: 12px; }
.policy-box p { margin: 8px 0; }
.policy-box label { display: block; font-size: 12px; font-weight: 650; }
.policy-box input { accent-color: var(--g); }
.tool { align-items: flex-start; padding: 7px 0; }
.tool input { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; }
.tool strong { display: block; font-size: 12px; }
#tools .tool-copy { min-width: 0; flex: 1; overflow-wrap: anywhere; }
#tools .tool-name { display: block; visibility: visible; color: #162f24; }
.worksheet-tabs:not([hidden]) { display: flex; }
.worksheet-tabs { flex-shrink: 0; gap: 4px; overflow-x: auto; padding: 2px 0 4px; }
.worksheet-tabs button {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid #bdd4c6;
  border-radius: 6px;
  background: white;
  color: #183d2b;
  font: inherit;
  font-size: 12px;
}
.worksheet-tabs button[aria-pressed="true"] { background: #e2f5e9; border-color: #347750; font-weight: 700; }
.tool small { display: block; font-size: 11px; color: #466455; }
.tool:has(input:disabled) { opacity: .63; }
.field-label { display: block; margin-top: 12px; font-weight: 700; }
#source-sheet, #candidate-sheet { width: 100%; max-width: 100%; border: 1px solid #bdd4c6; background: white; border-radius: 8px; padding: 8px; }
.hash, .binding-box, .changes-box, #audit-history { overflow-wrap: anywhere; min-width: 0; }
.hash { font: 11px/1.6 ui-monospace, monospace; white-space: pre-wrap; }
dl.hash { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 7px; }
dl.hash dd { margin: 0; }
.error { border-color: #d77869; background: #fff1ee; color: #8b231c; }
.status { min-height: 1.4em; }
.tablewrap { max-width: 100%; }
.tablewrap td, .tablewrap th { max-width: 280px; }
.tablewrap caption { text-align: left; padding: 7px; color: #48617c; white-space: normal; }

#cleantable td, #change-list li { white-space: break-spaces; overflow-wrap: anywhere; }
.before-change { background: #fff0c6; box-shadow: inset 0 0 0 1px #dfbb64; }
.after-change { background: #d9f8e3; box-shadow: inset 0 0 0 1px #56b873; }
.findings { max-height: 280px; overflow: auto; padding-left: 20px; font-size: 12px; overflow-wrap: anywhere; }
.findings li, #change-list li { margin: 8px 0; }
#change-list { max-height: 360px; overflow: auto; overflow-wrap: anywhere; }
#tool-results, #coverage { padding-left: 20px; font-size: 12px; overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; padding: 12px; }
.stats span:nth-child(even) { font-weight: 800; color: #006d2b; }
.audit-panel { margin-top: 18px; }
#audit-history { padding-left: 20px; }
#audit-history li { margin-bottom: 16px; }
#audit-history pre { white-space: pre-wrap; font-size: 11px; overflow-wrap: anywhere; }
.build-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 0; font-size: 12px; color: #42604f; }
#s4 .checkouthead { flex-wrap: wrap; }
#s4 .detail b { overflow-wrap: anywhere; min-width: 0; }
#pay, #recent, #cloud { cursor: not-allowed; }
:focus-visible { outline: 3px solid #1969bb; outline-offset: 3px; }
@media (max-width: 740px) {
  dl.hash { grid-template-columns: 1fr; }
  .tools { max-height: 420px; }
  .tablewrap { max-height: 350px; }
  .bottom > .btn { flex: 1 1 auto; }
}

/* Build 003 iteration 002: keep complete hashes readable at 390px. */
#cleanNotice { overflow-wrap: anywhere; word-break: break-word; }

/* Build 004: viewport-fit application shell. Homepage CSS is unchanged. */
html, body { height: 100%; overflow: hidden; }
body { height: 100dvh; display: flex; flex-direction: column; font-size: 13px; }
[hidden] { display: none !important; }
header { flex: 0 0 52px; padding: 6px 16px; z-index: 10; }
.head { max-width: none; height: 40px; gap: 18px; }
.brand { gap: 9px; }
.brand b { font-size: 23px; }
.brand small { font-size: 10px; }
.excel { width: 34px; height: 37px; font-size: 22px; }
.slogan { font-size: 16px; }
.headright { font-size: 12px; }
.wrap { width: 100%; max-width: none; margin: 0; padding: 6px 10px; flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.steps { flex: 0 0 42px; min-height: 0; margin: 0; padding: 4px; border-radius: 10px; }
.step { padding: 3px 6px; font-size: 12px; gap: 7px; }
.step .num { width: 25px; height: 25px; font-size: 13px; }
#global-status { flex-shrink: 0; margin: 0; min-height: 18px; max-height: 36px; overflow: auto; font-size: 12px; }
#error { flex-shrink: 0; margin: 0; padding: 7px 10px; max-height: 68px; overflow: auto; }
.screen { min-height: 0; min-width: 0; overflow: hidden; }
.screen.active { display: flex; flex: 1; flex-direction: column; gap: 6px; }
.cols { flex: 1; min-height: 0; min-width: 0; grid-template-columns: minmax(0,22fr) minmax(0,53fr) minmax(0,25fr); grid-template-rows: minmax(0,1fr); gap: 8px; }
.cols > .panel { grid-column: auto; min-height: 0; min-width: 0; display: flex; flex-direction: column; padding: 10px; overflow: auto; border-radius: 10px; }
.cols > .panel.nopad { padding: 0; overflow: hidden; }
.bar { flex-shrink: 0; padding: 8px 10px; font-size: 15px; border-radius: 7px; }
.panelbody { flex: 1; min-height: 0; min-width: 0; overflow: auto; padding: 10px; scrollbar-gutter: stable; }
.tools { max-height: none; overflow: visible; }
.tool-fieldset, .policy-box { margin-top: 8px; padding: 8px; }
.tool { padding: 8px 0; }
.tool strong { font-size: 12px; }
.tool small { font-size: 11px; }
.policy-box p { margin: 6px 0; }
.btn { padding: 9px 14px; font-size: 12px; border-radius: 9px; line-height: 1.35; }
#selectall, #deselect { margin: 2px 0; }
.filebar { flex-shrink: 0; margin: 0; padding: 5px 10px; gap: 8px; border-radius: 9px; }
.filebar .excel { width: 27px; height: 30px; font-size: 18px; }
.filebar strong { font-size: 12px; overflow-wrap: anywhere; }
.filebar .fmeta { font-size: 10px; }
.filebar .right { font-size: 11px; }
.field-label { margin-top: 6px; font-size: 12px; }
#source-sheet, #candidate-sheet { flex-shrink: 0; padding: 6px; font-size: 12px; }
#source-info { flex-shrink: 0; font-size: 11px; margin: 5px 0; }
.tablewrap { flex: 1; min-height: 0; min-width: 0; max-height: none; max-width: 100%; overflow: auto; overscroll-behavior: contain; margin-top: 4px; scrollbar-gutter: stable; }
.tablewrap td, .tablewrap th { max-width: none; padding: 7px 10px; }
.tablewrap thead th { position: sticky; top: 0; z-index: 2; background: #d7f8df; }
.tablewrap tbody th { position: static; }
.tablewrap caption { font-size: 11px; }
#s2 > #analysis-status, #uploadstatus { display: none; }
#s2 [data-panel=workbook], #s3 [data-panel=workbook] { overflow: hidden; }
#s2 [data-panel=workbook] > .actions, #s3 [data-panel=workbook] > .actions { display: none; }
#candidate-state { flex-shrink: 0; font-size: 11px; margin: 4px 0; }
#cleanNotice { flex-shrink: 0; margin: 6px 0 0; padding: 6px 8px; font-size: 10px; max-height: 65px; overflow: auto; }
.cols > [data-panel=analysis] { overflow: hidden; padding: 0; }
.analysis-tabs { display: flex; flex-shrink: 0; padding: 5px; gap: 4px; border-bottom: 1px solid var(--line); }
.analysis-tabs button, .workspace-tabs button { flex: 1; border: 0; background: #f0f7f3; color: #193b2b; padding: 9px 6px; border-radius: 6px; font-weight: 700; font-size: 12px; }
[role=tab][aria-selected=true] { color: white; background: #00782e; }
.analysis-content { flex: 1; min-height: 0; min-width: 0; padding: 10px; overflow: auto; overflow-wrap: anywhere; scrollbar-gutter: stable; }
.analysis-content .findings, .analysis-content #change-list { max-height: none; overflow: visible; }
.kpis { gap: 6px; margin-top: 8px; }
.kpi { padding: 9px; font-size: 11px; }
.kpi b { font-size: 20px; }
.info { padding: 10px; margin-top: 9px; }
.info p { margin: 7px 0; }
.success { padding: 12px; }
.success .mark { font-size: 28px; }
.success h2 { font-size: 17px; }
.analysis-content .stats { padding: 8px 0; }
#workspace-actions { flex-shrink: 0; position: sticky; bottom: 0; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 6px; box-shadow: 0 -3px 12px #064c3710; }
.stage-actions { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.stage-actions > span { margin-left: auto; font-size: 11px; }
.stage-actions .wide { width: auto; margin: 0; font-size: 12px; }
#to3, #to4 { margin-left: auto; }
.workspace-tabs { display: none; }
.build-footer { flex-shrink: 0; padding: 0 2px; gap: 12px; font-size: 10px; min-height: 20px; align-items: center; }
#open-audit { border: 0; background: transparent; color: #006c2e; font-weight: 750; text-decoration: underline; padding: 2px 0; }
.build-footer span { margin-left: auto; }
#audit-dialog { width: min(850px,94vw); max-height: 85dvh; border: 1px solid var(--line); border-radius: 12px; overflow: auto; }
#audit-dialog::backdrop { background: #052b2066; }
#audit-dialog .audit-panel { box-shadow: none; border: 0; padding: 5px; margin: 0; }
.hero { padding: 8px; }
.hero .bigexcel { font-size: 35px; }
.hero h1 { font-size: 26px; }
.hero p { font-size: 12px; margin: 4px 0; }
.drop { min-height: 160px; padding: 12px; gap: 5px; }
.drop strong { font-size: 20px; }
.reference-inline-1 { font-size: 28px; }
.opts { gap: 6px; margin-top: 8px; }
.opts label { font-size: 11px; padding: 6px; min-width: 0; }
.opts select { max-width: 100%; font-size: 11px; }
.menu button { padding: 9px; font-size: 12px; }
.soft { padding: 10px; }
.listcheck li { margin: 9px 0; }
.paylayout { flex: 1; min-height: 0; min-width: 0; overflow: auto; grid-template-columns: minmax(0,1.7fr) minmax(0,1fr); }
.paylayout > * { min-width: 0; overflow: auto; }
.paylayout .review { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.paylayout .tablewrap { max-height: 220px; }
@media (max-width: 900px) {
  header { flex-basis: 46px; padding: 4px 10px; }
  .head { height: 38px; }
  .brand b { font-size: 21px; }
  .brand .excel { width: 29px; height: 32px; }
  .headright { display: block; font-size: 10px; }
  .headright { max-width: 35%; white-space: normal; text-align: right; }
  .slogan { display: none; }
  .wrap { padding: 5px 6px; gap: 5px; }
  .steps { flex-basis: 47px; gap: 2px; padding: 3px; }
  .step { flex-direction: column; gap: 2px; font-size: 9px; padding: 2px; line-height: 1.2; }
  .step .num { width: 20px; height: 20px; font-size: 11px; }
  .workspace-tabs { flex-shrink: 0; display: flex; gap: 4px; }
  .workspace-tabs button { min-height: 36px; padding: 7px; }
  .cols { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr); }
  .cols > .panel { grid-column: 1; grid-row: 1; }
  .filebar { padding: 4px 7px; }
  .filebar .right { display: none; }
  .filebar .fmeta { font-size: 9px; }
  .cols > .panel { padding: 8px; }
  .cols > [data-panel=analysis] { padding: 0; }
  .bar { font-size: 13px; padding: 7px 8px; }
  .stage-actions { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 5px; }
  .stage-actions > .btn { width: 100%; min-width: 0; min-height: 36px; padding: 7px 6px; font-size: 10px; margin: 0 !important; }
  .stage-actions > span { display: none; }
  #to3, #to4 { grid-column: 1 / -1; }
  .build-footer span { display: none; }
  .build-footer { min-height: 20px; }
  .build-footer a { margin-left: auto; }
  #cleanNotice { max-height: 45px; }
  .paylayout { display: flex; flex-direction: column; }
  .paylayout > * { flex-shrink: 0; overflow: visible; }
  .paylayout .review { grid-template-columns: minmax(0,1fr); }
  .opts { grid-template-columns: minmax(0,1fr); }
}

/* In-place Web-Fit repair: retain desktop columns through native browser zoom. */
.cols > .panel:last-child { grid-column: auto; grid-row: 1; }
.headright { display: block; }
.step { min-width: 0; }
.step .num { flex-shrink: 0; }
.stage-actions { flex-wrap: wrap; }
.stage-actions > .btn { min-width: 0; max-width: 100%; white-space: normal; }
/* A short viewport scrolls this panel, rather than crushing its grids to zero. */
#s2 [data-panel=workbook], #s3 [data-panel=workbook] {
  overflow: auto;
  overscroll-behavior: contain;
}
#s2 [data-panel=workbook] > .tablewrap { min-height: 120px; flex-shrink: 0; }
#s3 .cleaned-toolbar { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
#s3 .cleaned-toolbar select { min-width: 0; flex: 1 1 auto; }
#s3 .cleaned-toolbar button { flex: 0 0 auto; max-width: 68%; white-space: normal; }
#s3 #candidate-sheet-tabs { flex-shrink: 0; margin-block: 3px; }
#s3 [data-panel=workbook] > .cleaned-viewport { flex: 1 1 0; min-height: 180px; }
#cleantable thead th:first-child { left: 0; z-index: 3; }
#cleantable tbody th { position: sticky; left: 0; z-index: 1; }

#analysis-coverage { padding: 0 12px; }
.finding-link, .workbook-cell {
  border: 0;
  background: transparent;
  color: #154b77;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#full-workbook {
  width: min(1440px, 96vw);
  max-width: 96vw;
  max-height: 90dvh;
  padding: 16px;
  border: 1px solid #9bb8cc;
  border-radius: 10px;
}
#full-workbook-open {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  margin-block: .35rem;
  background: #0b583b;
  color: #fff;
  font-weight: 700;
}
#full-workbook-open span { font-size: 1.2em; }
#full-workbook-open:hover { background: #08452f; }
#full-cell-details { margin-block: .5rem; }
#full-cell-value {
  max-height: 18dvh;
  margin: .25rem 0;
  overflow: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
#full-workbook td .workbook-cell { display: block; width: 100%; text-align: left; }
#full-workbook td:not(.issue) .workbook-cell { color: inherit; text-decoration: none; }
#full-workbook td .workbook-cell:hover { text-decoration: underline; }
#full-workbook::backdrop { background: #182c43aa; }
#full-workbook header, .workbook-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
#full-workbook header { justify-content: space-between; }
#full-workbook h2 { margin: 0; }
#full-workbook .tablewrap { max-height: 62dvh; overflow: auto; }
#full-workbook-legend { margin-block: 8px; font-size: .875rem; }
#full-workbook-finding-count { display: block; }
.workbook-issue-swatch {
  display: inline-block;
  inline-size: .85em;
  block-size: .85em;
  background: #fff0bb;
  border: 1px solid #745914;
}
#full-workbook :focus-visible, .workbook-cell:focus-visible, .finding-link:focus-visible {
  outline: 2px solid #154b77;
  outline-offset: 2px;
}
#full-workbook .workbook-merged-title { font-weight: 700; }
@media (max-width: 600px) {
  #full-workbook { padding: 10px; }
  #full-workbook .tablewrap { max-height: 55dvh; }
}
#full-workbook td, #full-workbook th { white-space: pre; }
#cell-findings, #full-cell-findings { max-height: 125px; overflow: auto; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .cols > .panel:last-child { grid-column: 1; }
  .head { gap: 10px; }
  .headright { min-width: 0; }
}
/* Explicit placement prevents definite-row auto-placement reordering at zoom. */
.cols > .panel[data-panel=tools] { grid-column: 1; grid-row: 1; }
.cols > .panel[data-panel=workbook] { grid-column: 2; grid-row: 1; }
.cols > .panel[data-panel=analysis] { grid-column: 3; grid-row: 1; }
@media (max-width: 900px) {
  .cols > .panel[data-panel] { grid-column: 1; grid-row: 1; }
}
@media (max-height: 600px) {
  .wrap { gap: 4px; }
  .filebar { padding-block: 3px; }
  .bar, h2.bar { padding: 5px 7px; font-size: 12px; }
  .field-label { margin-top: 3px; }
  #workspace-actions { padding: 4px; }
}

/* All-stage correction: native-zoom labels determine mobile progress height. */
@media (max-width: 900px) {
  .steps { flex: 0 0 auto; min-height: 47px; }
  .step { min-height: 41px; }
}

/* CASSIA_TOOL_COLOR_MAP_V1 */
td.cassia-tool-highlight,
th.cassia-tool-highlight {
  background-color: var(--cassia-tool-color) !important;
  box-shadow: inset 0 0 0 2px rgba(15,23,42,.35);
  color: #111827;
}

td.cassia-tool-highlight .workbook-cell,
th.cassia-tool-highlight .workbook-cell {
  color: #111827;
  font-weight: 600;
}
.tool-highlight-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 0;
  margin: 6px 0;
  max-height: 5rem;
  overflow: auto;
  list-style: none;
  font-size: .75rem;
}
.tool-highlight-legend:empty { display: none; }
.tool-highlight-legend li::before {
  content: '';
  display: inline-block;
  width: .75em;
  height: .75em;
  margin-inline-end: .35em;
  background: var(--cassia-tool-color);
  border: 1px solid currentColor;
  border-radius: 2px;
}

.cassia-review-highlight { outline: 2px dashed #1f2937; outline-offset: -3px; }
.review-finding { text-decoration-style: dashed; }

:is(#smart-review-controls, #smart-finding-review) form { display: flex; flex-wrap: wrap; gap: 6px; padding-block: 6px; }
:is(#smart-review-controls, #smart-finding-review) :is(input, select) { min-width: 0; max-width: 100%; }
:is(#smart-review-controls, #smart-finding-review) input { width: 8em; }
:is(#smart-review-controls, #smart-finding-review) [role="status"] { overflow-wrap: anywhere; }

#smart-finding-review form > div { display: flex; flex-wrap: wrap; gap: 6px; }

#guided-cleaning fieldset { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 10px; }
#guided-cleaning label { display: flex; flex-direction: column; gap: 3px; max-width: 100%; }
#guided-cleaning :is(select,input) { max-width: 100%; min-width: 0; }
#guided-cleaning form { overflow-wrap: anywhere; }
.candidate-tool-color { box-shadow: inset 0 0 0 2px var(--candidate-color); }

#full-workbook.cleaned-full-view[open] {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-sizing: border-box;
}
#full-workbook.cleaned-full-view > :not(.tablewrap) { flex: 0 0 auto; }
#full-workbook.cleaned-full-view .tablewrap { flex: 1 1 auto; min-height: 0; max-height: none; }
#full-workbook.cleaned-full-view .workbook-pages { gap: 4px; }
#full-workbook.cleaned-full-view #full-workbook-status { margin: 0; }
#full-workbook.cleaned-full-view #full-workbook-table { margin: 0; }
#full-workbook.cleaned-full-view thead th:first-child { left: 0; z-index: 3; }
#full-workbook.cleaned-full-view tbody th { position: sticky; left: 0; z-index: 1; }
body:has(#full-workbook.cleaned-full-view[open]) #s3 [data-panel="tools"],
body:has(#full-workbook.cleaned-full-view[open]) #s3 [data-panel="analysis"] { visibility: hidden; }
@media (max-width: 600px) {
  #full-workbook.cleaned-full-view h2 { font-size: 1.125rem; }
  #full-workbook.cleaned-full-view #full-workbook-close { white-space: nowrap; }
}
