:root{--ink:#16324b;--accent:#245a81;--bg:#f4f6f8;--line:#d5dce3;--paper:#fff;--muted:#536678}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.65 Arial,"Microsoft JhengHei",sans-serif}header{padding:18px 4%;background:var(--ink);color:white;display:flex;justify-content:space-between;gap:20px}header b{font-size:21px}header span{margin-left:24px;font-size:14px}main{max-width:1320px;margin:auto;padding:25px}h1{font-size:30px;margin:5px 0}h2{font-size:21px}h3{font-size:17px}.intro,.hint,footer{color:var(--muted)}.hint{font-size:13px}.notice{background:#fff5dc;border-left:4px solid #cb9a32;padding:12px;margin:20px 0}nav{display:flex;gap:10px;flex-wrap:wrap;margin:24px 0}button{cursor:pointer;background:white;color:var(--ink);border:1px solid #aabbc9;border-radius:4px;padding:10px 15px;font:inherit;font-size:14px}button:hover{background:#e9eff5}button:disabled{opacity:.5;cursor:default}.primary,nav button[aria-pressed=true]{background:var(--accent);color:white}label{display:block;margin:12px 0;font-size:14px}input,select,textarea{width:100%;padding:9px;border:1px solid #abbac8;border-radius:3px;background:white;font:inherit;color:var(--ink)}input[type=checkbox]{width:auto}input[type=file]{font-size:13px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:22px}article,#page-templates,#page-parameters,#page-prompts,#result{background:white;padding:22px;border:1px solid var(--line);border-radius:5px}.fields{display:grid;grid-template-columns:1fr 1fr;gap:0 16px}.buttons{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:15px 0}.scroll{overflow:auto;max-height:500px;border:1px solid var(--line);margin:15px 0}table{border-collapse:collapse;min-width:100%;font-size:13px}th,td{padding:9px 12px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top;white-space:nowrap}th{background:#edf2f6;position:sticky;top:0;z-index:1}td input,td select{min-width:150px}td input[type=checkbox]{min-width:0}td.long{white-space:normal;min-width:260px}.metrics{display:flex;gap:15px;flex-wrap:wrap}.metric{padding:12px 20px;background:#edf3f8}.metric b{font-size:25px;display:block}.error{color:#a62121}.success{color:#246545}#status{padding:12px;font-weight:600}summary{cursor:pointer;padding:9px}footer{font-size:13px;margin:30px 0}#prompt{font-size:14px}[hidden]{display:none!important}:focus-visible{outline:3px solid #d6a331;outline-offset:2px}@media(max-width:780px){.grid{grid-template-columns:1fr}header span{display:none}main{padding:15px}h1{font-size:25px}.fields{grid-template-columns:1fr}}

[hidden]{display:none!important;}

.practice{padding:12px 15px;margin:16px 0;border-left:5px solid}.c1{background:#eaf2fb;border-color:#24649a;color:#163f66}.c2{background:#fff3d7;border-color:#b67b12;color:#664809}.practice h3{margin:0 0 10px}.template-badge{padding:14px;font-weight:bold;font-size:20px;border-left:5px solid #9caab7}.fields small{display:block;color:var(--muted);font-size:12px;margin-top:6px}
.template-badge.c1{border-color:#24649a}.template-badge.c2{border-color:#b67b12}

.workflow{display:flex;gap:24px;flex-wrap:wrap;padding:16px 20px 16px 40px;background:#eaf1f6;border-radius:5px}.workflow li{padding-right:16px}.practice-area{margin:20px 0;padding:12px;background:white;border:1px solid var(--line);border-radius:5px}.demo-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.demo-grid>p{grid-column:1/-1}.ai-step{border-top:1px solid var(--line);padding:16px 0}.advanced-nav{margin-left:auto}#status:empty{display:none}@media(max-width:780px){.demo-grid{grid-template-columns:1fr}.advanced-nav{margin-left:0}.workflow{gap:8px}}

.secondary-options{border-top:1px solid var(--line);padding:10px 0;margin-top:10px}.secondary-options[open]{padding-bottom:16px}

#sample-rules select{min-width:105px}#sample-rules input[type=number]{width:95px;min-width:95px}#sample-rules td:has(input[type=checkbox]){text-align:center}#page-sampling-ai,#page-sampling-agent{background:white;padding:22px;border:1px solid var(--line)}#gemini-preview,#agent-prompt{font-size:13px}#workspace-nav details details{margin-left:12px;border-left:2px solid #b8cbd9}#sample-rows button{white-space:nowrap}
.percent-adjust{display:flex;align-items:center;gap:8px}.percent-adjust input{min-width:90px!important;max-width:140px}.percent-adjust button{white-space:nowrap;padding:8px 12px}
.platform-parameter{background:#fff4cf!important;border-left:3px solid #c39629;padding:10px}#page-platform{background:white;padding:24px}#page-rules .platform-parameter select{width:auto;max-width:280px}footer strong{color:var(--ink)}
.replay-code{display:inline;font-size:14px;font-weight:600;overflow-wrap:anywhere}.replay-summary{margin:8px 0}

.template-status-note{color:#B42318;font-weight:700;line-height:1.7;margin:12px 0;padding:12px 16px;border-left:4px solid #B42318;background:#FFF4F2;}

.wp-layout{display:grid;grid-template-columns:minmax(300px,1fr) minmax(480px,2fr);gap:20px}.wp-column{display:flex;gap:8px;align-items:center;margin:8px 0}.wp-column input[type=text],.wp-column input:not([type]){min-width:90px;flex:1}.wp-column input[type=checkbox]{width:auto}.wp-column button{padding:6px 10px;white-space:nowrap}.wp-number{text-align:right;font-variant-numeric:tabular-nums}.wp-summary{background:#edf3f6;padding:12px}.wp-layout article{min-width:0}.wp-layout table{width:100%;font-size:13px}

/* Full Excel workpaper preview */
.wp-toolbar{display:flex;align-items:end;gap:12px;flex-wrap:wrap}.wp-toolbar label{min-width:160px;margin:0}.wp-paper-caption{background:#e4ebf0;padding:10px 18px;font-weight:600;border:1px solid #cdd7df}.wp-paper-stage{overflow:auto;background:#e8edf1;padding:24px;margin-bottom:20px;max-height:75vh}#wp-preview{width:max-content;margin:auto;background:white;padding:30px;box-shadow:0 3px 14px #18384922}.wp-excel{border-collapse:collapse;table-layout:fixed;margin:0}.wp-excel td{border:none;padding:2px 6px;vertical-align:middle;line-height:1.25;font-variant-numeric:tabular-nums}.wp-excel tr:hover{background:transparent}

/* excel-preview-styles:start */
#wp-preview .wpx0{width:1092.0px}#wp-preview .wpx1{width:126.0px}#wp-preview .wpx2{width:140.0px}#wp-preview .wpx3{width:154.0px}#wp-preview .wpx4{width:392.0px}#wp-preview .wpx5{height:33.333333333333336px}#wp-preview .wpx6{font-family:Microsoft JhengHei,sans-serif;font-size:11.0pt;color:#183849;text-align:left;font-weight:700;background:#E9EFF3;white-space:nowrap}#wp-preview .wpx7{font-family:Microsoft JhengHei,sans-serif;font-size:11.0pt;color:#183849;text-align:left;white-space:nowrap}#wp-preview .wpx8{font-family:Microsoft JhengHei,sans-serif;font-size:11.0pt;color:#183849;text-align:right;white-space:nowrap}#wp-preview .wpx9{height:40.0px}#wp-preview .wpx10{font-family:Microsoft JhengHei,sans-serif;font-size:11.0pt;color:#FFFFFF;text-align:left;font-weight:700;background:#183849;border-top:1px solid #CBD5DC;border-bottom:1px solid #CBD5DC;border-left:1px solid #CBD5DC;border-right:1px solid #CBD5DC;white-space:nowrap}#wp-preview .wpx11{height:42.666666666666664px}#wp-preview .wpx12{font-family:Microsoft JhengHei,sans-serif;font-size:11.0pt;color:#183849;text-align:left;border-top:1px solid #CBD5DC;border-bottom:1px solid #CBD5DC;border-left:1px solid #CBD5DC;border-right:1px solid #CBD5DC;white-space:nowrap}#wp-preview .wpx13{font-family:Microsoft JhengHei,sans-serif;font-size:11.0pt;color:#183849;text-align:center;border-top:1px solid #CBD5DC;border-bottom:1px solid #CBD5DC;border-left:1px solid #CBD5DC;border-right:1px solid #CBD5DC;white-space:nowrap}#wp-preview .wpx14{font-family:Microsoft JhengHei,sans-serif;font-size:11.0pt;color:#183849;text-align:left;border-top:1px solid #CBD5DC;border-bottom:1px solid #CBD5DC;border-left:1px solid #CBD5DC;border-right:1px solid #CBD5DC;white-space:normal}#wp-preview .wpx15{font-family:Microsoft JhengHei,sans-serif;font-size:11.0pt;color:#183849;text-align:right;border-top:1px solid #CBD5DC;border-bottom:1px solid #CBD5DC;border-left:1px solid #CBD5DC;border-right:1px solid #CBD5DC;white-space:nowrap}
#wp-preview .wp-excel td{padding:2px 6px}#wp-preview .wp-excel tr{background:transparent}#wp-preview{zoom:.8}
/* excel-preview-styles:end */

#wp-preview .wp-excel tr:nth-child(3) td:first-child{white-space:normal;overflow-wrap:anywhere}

.download-choice{display:flex;flex-direction:column;gap:5px}.download-choice small{font-size:12px;color:var(--muted)}#exports{align-items:flex-start}

#exports{align-items:center}#exports .download-choice{flex-direction:row;align-items:center;gap:12px}#exports .download-choice small{white-space:nowrap}

.page-jump{display:flex;align-items:center;gap:7px;margin:0}.page-jump input{width:85px}.sort-header{padding:3px 5px;border:0;background:transparent;font-weight:600;white-space:nowrap}

/* Gentle next-action cue; disabled and navigation controls remain still. */
@keyframes action-breathe{0%,100%{background-color:#245a81;box-shadow:0 0 0 0 #245a8100}50%{background-color:#4586ae;box-shadow:0 0 0 4px #245a8128}}
button.primary:not(:disabled),#sampling-primary>button:not(:disabled),#step-next:not(:disabled){animation:action-breathe 2.8s ease-in-out infinite;color:white;border-color:#245a81}button.primary:hover,#sampling-primary>button:hover,#step-next:hover{animation-play-state:paused}button:disabled{animation:none!important}@media(prefers-reduced-motion:reduce){button.primary:not(:disabled),#sampling-primary>button:not(:disabled),#step-next:not(:disabled){animation:none}}

/* Source choice: blue continuation and green external import, then sampling takes over. */
#sample-resume{background:#245a81;border-color:#245a81;color:#fff}
#sample-import-open{background:#237047;border-color:#237047;color:#fff}
#sample-source-note{color:#21683f}
@keyframes source-green-breathe{0%,100%{background-color:#237047;box-shadow:0 0 0 0 #23704700}50%{background-color:#38955e;box-shadow:0 0 0 4px #23704728}}
#sample-resume.source-pulse:not(:disabled){animation:action-breathe 2.8s ease-in-out infinite}
#sample-import-open.source-pulse:not(:disabled){animation:source-green-breathe 2.8s ease-in-out infinite}
#page-sampling.awaiting-source #sample-run{animation:none;background:#fff;color:#245a81;border-color:#a8b9c8;box-shadow:none}
@media(prefers-reduced-motion:reduce){#sample-resume.source-pulse,#sample-import-open.source-pulse{animation:none}}

#rc-list{display:grid;gap:8px;margin-top:16px}#rc-editor{padding:20px;border-radius:6px}#rc-list button{text-align:left}.rule-existing{background:#edf4fa;border:1px solid #bed1e0;color:#183849}.rule-advanced{background:#fff6df;border:1px solid #ddc998;color:#59451a}

#rc-list{max-height:520px;overflow-y:auto;padding-right:6px}#rc-original{overflow-wrap:anywhere}

.bi-choice,.bi-output{border:1px solid #d5dce3;border-radius:8px;padding:16px;margin:16px 0;background:white}.bi-choice button{margin-right:8px}.bi-table-wrap{max-width:100%;overflow:auto}.bi-table-wrap td{text-align:right}.bi-table-wrap td:first-child{text-align:left}#bi-demand>.buttons label{background:#edf3f6;border-radius:5px;padding:8px 12px}#bi-output-list:empty{display:none}

/* Subtle shared background for the three primary workflow modules. */
#workspace-nav > .module-nav{background:#edf5fc;border-radius:6px;padding-top:8px;padding-bottom:8px;}

#workspace-nav > .other-tools-nav{background:#f8f4fc;border-radius:6px;padding:8px 9px;}
