:root{--ink:#111316;--muted:#6a6f76;--line:#d8dce1;--gray:#f2f2f2;--white:#ffffff;--green:#164b3c;--gutter:clamp(22px,4.5vw,72px);--space:clamp(76px,10vw,150px);color:var(--ink);font-family:Inter,"Helvetica Neue",Arial,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;font-synthesis:none}
*{box-sizing:border-box}
body{margin:0;background:var(--gray);font-size:14px;line-height:1.6;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit}
button,select{cursor:pointer}
button:disabled{cursor:not-allowed;color:#858a90;background:#e4e7e9;border-color:var(--line)}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,.table-shell:focus-visible,summary:focus-visible{outline:2px solid var(--green);outline-offset:2px}
.app-shell{min-height:100dvh;display:flex;flex-direction:column}
.tool-header{display:flex;min-height:80px;align-items:center;justify-content:space-between;gap:32px;padding:0 var(--gutter);border-bottom:1px solid var(--line);background:#fff}
.tool-header__brand,.tool-header__project{color:var(--ink);font-size:18px;font-weight:600}
.tool-header__brand{flex:0 0 auto}
.tool-header__project{min-width:0;overflow:hidden;text-align:right;text-overflow:ellipsis;white-space:nowrap}
.tool-main{width:100%;flex:1;min-width:0;padding:24px var(--gutter);display:flex}
.workspace{width:100%;height:max(480px,calc(100dvh - 240px));display:grid;grid-template-columns:minmax(0,3fr) minmax(260px,1fr);border:1px solid var(--line);border-radius:12px;background:var(--white);overflow:hidden}
.results-pane{min-width:0;min-height:0;display:flex;flex-direction:column}
.summary-section{padding:20px 24px;border-bottom:1px solid var(--line)}
.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
.panel-heading>button{flex-shrink:0}
h2{margin:0;font-size:18px;line-height:1.4;font-weight:600}
.unit-note,.row-count{font-size:14px;color:var(--muted);font-weight:400}
.row-count{margin-left:8px}
.summary-grid{display:grid;grid-template-columns:1fr 1fr 1.15fr;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.summary-grid>div{min-width:0;padding:12px 18px;display:flex;flex-direction:column;gap:4px;border-right:1px solid var(--line)}
.summary-grid>div:last-child{border-right:0}
.summary-grid span,.summary-grid label{font-size:14px;color:var(--muted)}
.summary-grid strong{font-size:clamp(25px,2.5vw,38px);font-weight:600;line-height:1.3;font-variant-numeric:tabular-nums}
.summary-grid small{font-size:14px;font-weight:400}
.summary-grid .standard-time{background:var(--gray)}
.allowance-control{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.allowance-control input{width:80px;max-width:100%;border:0;border-bottom:1px solid var(--line);background:transparent;color:#976426;font-size:clamp(25px,2.5vw,38px);font-weight:600;line-height:1.3;padding:0}
.analysis-section{min-width:0;min-height:0;flex:1;display:flex;flex-direction:column;padding:20px 24px}
.table-shell{position:relative;min-width:0;min-height:0;flex:1;overflow:auto;border:1px solid var(--line);border-radius:8px}
table{width:100%;min-width:740px;border-collapse:collapse;table-layout:fixed;font-size:14px}
th{position:sticky;top:0;z-index:1;padding:10px 6px;text-align:left;background:var(--gray);font-weight:600}
th:nth-child(1){width:40px}
th:nth-child(2){width:29%}
th:nth-child(3){width:78px}
th:nth-child(4),th:nth-child(5){width:64px}
th:nth-child(6){width:58px}
th:nth-child(7){width:66px}
th:nth-child(8){width:94px}
th:nth-child(9){width:36px}
td{border-top:1px solid var(--line);padding:6px}
td input,td select{width:100%;min-width:0;height:32px;padding:2px 4px;border:1px solid transparent;border-radius:4px;color:var(--ink);background:transparent}
td input:hover,td select:hover,td input:focus,td select:focus{background:var(--gray);border-color:var(--line)}
.step-cell{color:var(--muted)}
.time-cell{font-variant-numeric:tabular-nums;font-weight:600}
.status{font-size:14px}
.estimated{color:#976426}
.reviewed{color:#2f6b4f}
.review-button{display:inline-flex;align-items:center;justify-content:center;min-height:32px;padding:2px 8px;border:1px solid var(--line);border-radius:8px;background:var(--white);font-size:14px;font-weight:500}
.review-button:not(:disabled):hover{border-color:var(--ink)}
.summary-label{display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap}
.summary-grid .result-status{font-size:14px}
.summary-grid .result-status.estimated{color:#976426}
.summary-grid .result-status.reviewed{color:#2f6b4f}
.empty-state{flex:1;min-height:0;display:grid;place-content:center;text-align:center;padding:24px;border:1px dashed var(--line);border-radius:8px;color:var(--muted)}
.empty-state p{margin:0 0 6px;color:var(--ink);font-weight:600}
.table-toolbar{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-top:16px}
.toolbar-actions{display:flex;align-items:center;gap:16px;flex-shrink:0}
.analysis-notes{margin-top:8px;color:var(--muted);font-size:14px}
.analysis-notes summary{cursor:pointer}
.analysis-notes ul{margin:8px 0 0;padding-left:18px}
.input-section{min-width:0;min-height:0;display:flex;flex-direction:column;padding:20px;border-left:1px solid var(--line);background:var(--gray)}
.input-section .panel-heading{align-items:baseline}
textarea{width:100%;flex:1;min-height:120px;resize:none;padding:14px;border:1px solid var(--line);border-radius:8px;background:var(--white);color:var(--ink);line-height:1.8}
textarea::placeholder{color:var(--muted)}
.input-meta{display:flex;justify-content:space-between;gap:8px;margin-top:8px;color:var(--muted)}
.primary-button,.secondary-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;border-radius:8px;padding:0 14px;font-size:14px;font-weight:600}
.primary-button{border:1px solid var(--ink);color:#fff;background:var(--ink)}
.primary-button:not(:disabled):hover{background:#2e3135;border-color:#2e3135}
.secondary-button{color:var(--ink);border:1px solid var(--line);background:var(--white)}
.secondary-button:not(:disabled):hover{border-color:var(--ink)}
.icon-button{width:28px;height:32px;padding:0;color:var(--muted);background:transparent;border:0;font-size:18px}
.icon-button:hover{color:#a63a3a}
.analyze-button{width:100%;margin-top:16px;min-height:44px;font-size:16px}
.error-message{margin:10px 0 0;color:#a63a3a}
.tool-spinner{width:14px;height:14px;border:2px solid var(--line);border-top-color:var(--green);border-radius:50%;animation:spin 800ms linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.site-footer{min-height:112px;display:flex;align-items:center;justify-content:flex-end;padding:0 var(--gutter);border-top:1px solid var(--line);background:var(--white)}
.site-footer small{font-size:14px;color:var(--muted)}
.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);border:0;white-space:nowrap}
@media(max-width:800px){
  .tool-header{min-height:68px;gap:20px}
  .tool-header__brand,.tool-header__project{font-size:14px}
  .site-footer{min-height:96px}
  .tool-main{padding:16px var(--gutter)}
  .workspace{height:auto;grid-template-columns:minmax(0,1fr)}
  .input-section{border-left:0;border-top:1px solid var(--line)}
  .summary-section,.analysis-section{padding:16px}
  .table-shell{flex:none;max-height:340px}
  textarea{min-height:180px}
  .table-toolbar{flex-wrap:wrap}
}
@media(max-width:520px){
  .summary-grid>div{padding:10px 8px}
  .allowance-control input{width:52px}
  .allowance-control{gap:4px}
  .allowance-confirm{min-height:28px;padding:2px 6px}
  .summary-grid strong,.allowance-control input{font-size:25px}
  .summary-grid small{display:none}
  .panel-heading{gap:8px}
  .empty-state{min-height:180px}
}
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *{transition-duration:.01ms !important}
  .tool-spinner{animation:none !important}
}
