:root {font-family: Inter, "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif; color-scheme: light;}
[hidden] {display:none!important;}
#repair-team-panel {line-height:1.7;}
#repair-team-panel .whitespace-pre-wrap {overflow-wrap:anywhere;}
#team-upload {display:none!important;}
body {margin:0; line-height:1.6;}
button,input,textarea,select {font:inherit;}
button {min-height:44px; touch-action:manipulation;}
input:not([type=checkbox]),textarea,select {min-height:44px; min-width:0; font-size:16px!important;}
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible {outline:3px solid #60a5fa;outline-offset:2px;}
button:disabled {opacity:.5;cursor:not-allowed;}
.workspace,.workspace > div {min-height:0;min-width:0;}
.app-header {height:auto!important;min-height:72px;gap:16px;padding:12px 24px!important;flex-wrap:wrap;}
.header-actions {flex-wrap:wrap;}
.case-status {display:flex;flex-wrap:wrap;gap:8px 24px;padding:10px 24px;background:#eff6ff;border-bottom:1px solid #dbeafe;font-size:14px;color:#334155;}
.case-status strong {font-variant-numeric:tabular-nums;}
.estimate-pane > .overflow-y-auto {overflow-x:hidden;}
.estimate-pane .grid > *, .estimate-pane .flex > * {min-width:0;}
.estimate-pane .text-4xl {font-size:clamp(1.5rem,2.6vw,2.25rem);}
.estimate-pane .text-\[10px\] {font-size:12px;}
.estimate-pane .w-14 {width:76px;}
.estimate-pane .w-16 {width:96px;}
.action-bar {display:block!important;}
.action-bar > .flex {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:8px;}
.action-bar button {justify-content:center;padding:10px 8px!important;white-space:nowrap;}
.action-bar button:last-child {grid-column:1/-1;}
.action-bar button span {display:inline!important;}
.validation-errors li {margin-top:6px;}
.adjustment-line {overflow-wrap:anywhere;}
.quote-total {flex-wrap:wrap;overflow-wrap:anywhere;}
.cost-lines > li {gap:12px;}
.cost-lines > li > span:last-child {text-align:right;}
.restore-backup {display:flex;align-items:center;justify-content:center;min-height:44px;}
.training-dialog {width:min(980px,calc(100% - 24px));max-height:90dvh;max-height:min(90dvh,1000px);padding:0 24px 24px;border:1px solid #cbd5e1;border-radius:20px;background:#f8fafc;color:#1e293b;line-height:1.85;box-shadow:0 24px 80px #0f172a45;overflow:auto;scroll-padding-top:100px;}
.training-dialog::backdrop {background:#0f172a99;}
.training-header {position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#f8fafc;border-bottom:1px solid #e2e8f0;padding:16px 0;}
.training-header h2 {font-size:22px;font-weight:700;line-height:1.5;}
.training-close {flex-shrink:0;padding:8px 14px;border-radius:10px;background:#1e40af;color:white;}
.training-intro,.training-results,.training-footer {margin:16px 0;color:#475569;}
.training-search-label {display:block;font-weight:600;}
#training-search {display:block;width:100%;border:1px solid #94a3b8;border-radius:10px;padding:10px 12px;margin:8px 0;background:white;}
.training-nav {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:20px;}
.training-nav button {min-width:0;text-align:left;padding:10px 12px;border:1px solid #dbeafe;border-radius:10px;background:#eff6ff;color:#1e40af;line-height:1.6;}
.training-section {padding:16px 20px;margin:12px 0;background:white;border:1px solid #e2e8f0;border-radius:14px;overflow-wrap:anywhere;}
.training-section summary {font-size:18px;font-weight:700;cursor:pointer;min-height:44px;padding:6px 0;}
.training-section ol {list-style:decimal;padding-left:24px;margin:12px 0;}
.training-section li {padding-left:4px;margin:12px 0;}
.training-notes {margin-top:16px;padding:10px 16px;border-left:4px solid #f59e0b;border-radius:8px;background:#fffbeb;color:#78350f;}
.training-notes p {margin:8px 0;}
@media screen and (max-width:600px) {
 .training-dialog {width:calc(100% - 16px);max-height:94dvh;padding:0 16px 16px;}
 .training-header {gap:8px;align-items:flex-start;}
 .training-header h2 {font-size:18px;}
 .training-close {font-size:14px;padding:8px 10px;}
 .training-nav {grid-template-columns:1fr;}
 .training-section {padding:12px;}
 .training-section summary {font-size:17px;}
}
@media screen and (max-width:1100px) {
  html,body,#root,.app-shell {height:auto!important;min-height:100vh;overflow:visible!important;}
  .workspace {display:block!important;overflow:visible!important;}
  .selection-pane,.estimate-pane {width:100%!important;height:auto!important;overflow:visible!important;border:0!important;}
  .selection-pane > div,.estimate-pane > div {overflow:visible!important;height:auto!important;}
  .selection-pane > div {padding:20px!important;}
  .estimate-pane > .overflow-y-auto {padding:20px!important;}
  .selection-pane .pb-20 {padding-bottom:24px!important;}
  .action-bar {position:sticky;bottom:0;z-index:25;box-shadow:0 -4px 16px #0f172a12;padding-bottom:max(12px,env(safe-area-inset-bottom))!important;}
  .action-bar > .flex {grid-template-columns:repeat(2,minmax(0,1fr));}
  .action-bar button:last-child {grid-column:auto;}
  .estimate-pane .text-4xl {font-size:1.875rem;}
}
@media screen and (max-width:520px) {
  .app-header {padding:12px 16px!important;}
  .header-actions {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:8px;}
  .header-actions button {justify-content:center;}
  .case-status {padding:12px 16px;}
  .selection-pane > div,.estimate-pane > .overflow-y-auto {padding:16px!important;}
  .selection-pane .grid-cols-3 {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
  .selection-pane .p-6 {padding:16px!important;}
  .estimate-pane .p-5,.estimate-pane .p-6 {padding:16px!important;}
  .estimate-pane .sm\:flex-row {flex-wrap:wrap;}
  .action-bar button {font-size:13px;gap:4px!important;}
  .action-bar button svg {display:none;}
  .fixed > .max-w-4xl {width:100%;}
}
@media print {
  .training-dialog:not([open]) {display:none!important;}
  body:has(.training-dialog[open]) #root,body:has(.training-dialog[open]) #repair-team-panel {display:none!important;}
  .training-dialog[open] {position:static;width:100%;max-height:none;overflow:visible;border:0;box-shadow:none;}
  .training-dialog .training-close,.training-dialog .training-nav,.training-dialog #training-search,.training-dialog .training-search-label {display:none;}
  .app-shell,.workspace,.estimate-pane {display:block!important;height:auto!important;overflow:visible!important;width:100%!important;}
  .estimate-pane > div {overflow:visible!important;height:auto!important;}
  .estimate-pane .bg-white {break-inside:avoid;}
  .invalid-quote .print-container,.invalid-quote .print-only {display:none!important;}
  .invalid-quote::before {content:'報價資料有誤，請返回系統修正後再列印。';display:block;color:#b91c1c;font-size:24px;}
}

.manual-actions {display:flex;flex-wrap:wrap;gap:10px;margin:16px 0 24px;}
.manual-actions p {width:100%;line-height:1.7;color:#526173;}
.manual-actions a {display:inline-block;padding:12px 16px;border-radius:10px;background:#1e40af;color:#fff;text-decoration:none;font-weight:700;line-height:1.6;}
.manual-actions a[download] {background:#e2e8f0;color:#1e293b;}
.manual-actions a:focus-visible {outline:3px solid #60a5fa;outline-offset:3px;}
@media print {.manual-actions {display:none;}}

/* Shared quotation workspace: readable inputs, quiet surfaces, clear customer output. */
:root {--quote-ink:#172b47;--quote-muted:#52647d;--quote-line:#dce5ef;--quote-blue:#2459c4;--quote-font:"Microsoft JhengHei","PingFang TC","Noto Sans TC",system-ui,sans-serif;}
@media screen {
 body {font-family:var(--quote-font);color:var(--quote-ink);background:#f4f7fb;line-height:1.7;}
 button,input,select,textarea {font-family:var(--quote-font);}
 button {letter-spacing:0;font-weight:600;min-height:44px;border-radius:12px;transition:background-color .15s,border-color .15s;}
 input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea {border-radius:12px;border-color:#ccd8e5;background:#fff;line-height:1.6;box-shadow:none;}
 input:focus-visible,select:focus-visible,textarea:focus-visible {outline:3px solid #9bc2ff;outline-offset:2px;}
 h1,h2,h3 {letter-spacing:-.02em;line-height:1.5;}
 pre {font-family:var(--quote-font);white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.95;tab-size:2;}
 .customer-preview {margin:16px 0;padding:18px 20px;background:#fff;border:1px solid var(--quote-line);border-radius:16px;color:var(--quote-ink);min-width:0;}
 .customer-preview summary {cursor:pointer;font-weight:700;font-size:16px;min-height:44px;line-height:1.7;}
 .customer-preview p {font-size:13px;color:var(--quote-muted);margin:6px 0 14px;}
 .customer-preview pre {padding:18px;background:#f7f9fc;border:1px solid #e7edf5;border-radius:12px;font-size:15px;max-height:600px;overflow:auto;}
}
@media screen and (max-width:600px) {
 .customer-preview {padding:14px;margin:12px 0;}
 .customer-preview pre {padding:14px;font-size:14px;max-height:none;}
}

@media screen {
 .app-shell {font-family:var(--quote-font)!important;}
 .app-header {background:white;border-bottom:1px solid var(--quote-line);box-shadow:0 2px 12px #17335405;}
 .app-header h1 {font-size:22px;}
 .case-status {background:#edf3fb;font-size:13px;line-height:1.8;}
 .selection-pane {background:#f8fafd!important;}
 .selection-pane h2 {font-size:18px;}
 .selection-pane button {box-shadow:none;line-height:1.65;}
 .selection-pane .rounded-xl {border-radius:14px;}
 .estimate-pane {background:#f4f7fb!important;box-shadow:none!important;}
 .estimate-pane>.overflow-y-auto {padding:24px;}
 .estimate-pane .bg-white {border-radius:16px;box-shadow:0 3px 16px #17335405;}
 .estimate-pane label {font-size:14px!important;line-height:1.7;color:#425773;}
 .estimate-pane input:not([type=checkbox]),.estimate-pane select {padding:10px 12px;min-height:46px;}
 .estimate-pane .quote-total {font-variant-numeric:tabular-nums;letter-spacing:-.025em;}
 .estimate-pane .customer-preview {margin:0 20px 16px;flex-shrink:0;max-height:42vh;overflow:auto;}
 .action-bar {box-shadow:0 -3px 14px #17335408;}
 .action-bar>.flex {grid-template-columns:repeat(2,minmax(0,1fr));}
 .action-bar button:last-child {grid-column:auto;background:#2459c4!important;color:white;}
}
@media screen and (max-width:1100px) {
 .estimate-pane .customer-preview {max-height:none;margin:0 16px 16px;overflow:visible;}
}
@media screen {
 .estimate-pane .relative:has(>.absolute) input {padding-left:32px;}
}

/* Comfortable quotation entry: screen only; quoted prices and print layouts are unchanged. */
@media screen {
 body {font-family:"Microsoft JhengHei","PingFang TC",system-ui,sans-serif;font-size:18px;line-height:1.8;color:#17304d;}
 button,input,select,textarea {font-family:inherit;}
 button {font-size:18px!important;min-height:52px;line-height:1.6!important;white-space:normal;}
 input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea {font-size:18px!important;min-height:54px;line-height:1.7;border-color:#8da2bc!important;background-color:#fff;color:#172b47;}
 input::placeholder,textarea::placeholder {color:#52657c;opacity:1;}
 input[type=checkbox],input[type=radio] {width:24px;height:24px;flex-shrink:0;accent-color:#174eaf;}
 label {font-size:18px!important;line-height:1.75!important;}
 button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible {outline:3px solid #2459c4;outline-offset:3px;}
 .customer-preview summary {font-size:20px!important;min-height:52px;}
 .customer-preview pre {font-size:18px!important;line-height:1.9;overflow-wrap:anywhere;}
 .customer-preview p {font-size:17px!important;color:#425773;}
}
@media screen and (max-width:600px) {
 button {min-height:52px;}
 input,textarea,select {max-width:100%;}
 .customer-preview {padding:16px;}
 .customer-preview pre {padding:12px!important;font-size:18px!important;max-height:none!important;}
}

@media screen {
 .app-shell .text-xs,.app-shell .text-sm,#repair-team-panel .text-xs,#repair-team-panel .text-sm {font-size:17px!important;line-height:1.8;}
 .app-shell [class*="text-[10px]"],.app-shell [class*="text-[11px]"] {font-size:16px!important;}
 .app-shell .text-slate-400,.app-shell .text-slate-500,#repair-team-panel .text-slate-400,#repair-team-panel .text-slate-500 {color:#425773!important;}
 .estimate-pane label {font-size:18px!important;color:#17304d;}
 .selection-pane h2 {font-size:24px;}
 .selection-pane button {padding:14px;}
 .estimate-pane .w-14,.estimate-pane .w-16 {width:110px;}
 .action-bar button {white-space:normal;}
 .action-bar button:last-child {background:#174eaf!important;color:#fff;}
 .case-status {font-size:17px;}
 .cost-lines {font-size:18px;line-height:1.85;}
 .estimate-pane .customer-preview {max-height:none;}
}
@media screen and (max-width:1300px) {
 html,body,#root,.app-shell {height:auto!important;min-height:100vh;overflow:visible!important;}
 .workspace {display:block!important;overflow:visible!important;}
 .selection-pane,.estimate-pane {width:100%!important;height:auto!important;overflow:visible!important;}
 .selection-pane>div,.estimate-pane>div {height:auto!important;overflow:visible!important;}
 .action-bar {position:static;}
}
@media screen and (max-width:600px) {
 .estimate-pane .grid-cols-2,.selection-pane .grid-cols-3 {grid-template-columns:1fr!important;}
 .action-bar>.flex {grid-template-columns:1fr!important;}
 .header-actions {grid-template-columns:1fr;}
 .cost-lines>li {flex-wrap:wrap;}
}

@media screen {
 .simple-workflow #team-manager>:not(details):not(h3) {display:none!important;}
 .workspace-notices {max-width:1320px;margin:18px auto;padding:20px;background:#eef5ff;border:1px solid #b4c9e6;border-radius:18px;color:#17304d;}
 .workspace-notices h2 {font-size:22px;font-weight:700;margin-bottom:10px;}
 .workspace-notices h3 {font-size:20px;font-weight:700;}
 .workspace-notices article {background:#fff;padding:16px;border-radius:12px;margin:10px 0;}
 .workspace-notices article p {white-space:pre-wrap;overflow-wrap:anywhere;font-size:18px;line-height:1.85;}
 .workspace-notices input,.workspace-notices textarea,.workspace-notices select {display:block;width:100%;margin:12px 0;border:1px solid #94a3b8;padding:12px;border-radius:10px;}
 .workspace-notices button {background:#174eaf;color:white;padding:12px 18px;margin:6px;border-radius:10px;}
 .workspace-notices summary {font-size:18px;min-height:48px;cursor:pointer;}
 .workflow-hint {padding:14px 18px;margin:12px 0;border:1px solid #bdd2e9;border-radius:12px;background:#f0f6ff;color:#17304d;font-size:18px;}
}
@media print {.workspace-notices,.workflow-hint {display:none!important;}}

/* Use one document scroll at every width: notices must not push a fixed-height workspace off screen. */
@media screen {
 html,body,#root,.app-shell {height:auto!important;min-height:100vh;overflow:visible!important;}
 .workspace {overflow:visible!important;align-items:flex-start;}
 .selection-pane,.estimate-pane {height:auto!important;overflow:visible!important;}
 .selection-pane>div,.estimate-pane>div {height:auto!important;overflow:visible!important;}
 .action-bar {position:static;}
}

/* Match the heading card to the content gutter; keep currency outside the editable amount. */
@media screen {
 .estimate-pane>.overflow-y-auto {padding:24px!important;}
 .estimate-pane>.estimate-heading {margin:24px 24px 0;padding:20px!important;border-radius:18px;}
 .discount-input-group {display:flex;align-items:stretch;border:1px solid #b78484;border-radius:12px;background:#fff;overflow:hidden;}
 .discount-currency {display:flex;align-items:center;padding:0 14px;background:#fff1f2;color:#9f2636;font-weight:700;border-right:1px solid #ecd1d5;flex-shrink:0;}
 .estimate-pane .discount-input-group input.discount-amount {flex:1;min-width:0;width:100%;border:0!important;border-radius:0;padding:12px 14px;min-height:54px;color:#94263a;box-shadow:none;}
 .discount-input-group:focus-within {outline:3px solid #2459c4;outline-offset:3px;}
 .estimate-pane .discount-input-group input:focus-visible {outline:none;}
 .discount-hint {font-size:16px;line-height:1.7;color:#52657c;margin-top:8px;}
}
@media screen and (max-width:600px) {
 .estimate-pane>.overflow-y-auto {padding:16px!important;}
 .estimate-pane>.estimate-heading {margin:16px 16px 0;padding:16px!important;}
}

@media screen and (max-width:600px) {
 .catalogue-modal .grid-cols-2 {grid-template-columns:1fr;}
 .catalogue-modal .p-6 {padding:16px;}
 .catalogue-modal .flex.gap-2 {flex-wrap:wrap;}
 .catalogue-modal h3 {font-size:21px;line-height:1.5;}
 .catalogue-modal label {display:block;}
}

.catalogue-price-preview {padding:14px 16px;border:1px solid #b4c9e6;border-radius:12px;background:#eff6ff;color:#17304d;font-size:17px;line-height:1.8;overflow-wrap:anywhere;}

.warranty-template-link {display:inline-flex;align-items:center;justify-content:center;min-height:52px;font-size:18px;line-height:1.6;text-decoration:none;}

/* Shared prefix column: currency and delivery icons follow the input's actual height. */
@media screen {
 .estimate-pane .money-input {position:relative;width:100%;min-width:0;}
 .estimate-pane .money-prefix {position:absolute;left:1px;top:1px;bottom:1px;width:54px;display:flex;align-items:center;justify-content:center;border-right:1px solid #d5dfeb;color:#425773;font-size:16px;font-weight:600;line-height:1;pointer-events:none;}
 .estimate-pane .money-prefix svg {display:block;width:20px;height:20px;flex:none;}
 .estimate-pane .money-input>input {width:100%!important;min-width:0;height:58px;min-height:58px;padding:12px 14px 12px 70px!important;box-sizing:border-box;text-align:left;line-height:1.6;}
 .estimate-pane .discount-currency {width:54px;min-width:54px;justify-content:center;padding:0;font-size:16px;line-height:1;}
 .estimate-pane .discount-input-group {height:58px;box-sizing:border-box;}
 .estimate-pane .discount-input-group input.discount-amount {height:56px;min-height:56px;padding:12px 14px!important;text-align:left;line-height:1.6;}
 .labor-details {display:grid;gap:12px;}
 .labor-controls {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding:16px;}
 .labor-field {display:grid;grid-template-rows:auto 58px;gap:6px;min-width:0;}
 .labor-field>label {display:block;margin:0;}
 .estimate-pane .labor-field>input {width:100%!important;min-width:0;height:58px;min-height:58px;padding:12px 14px!important;box-sizing:border-box;}
}
@media screen and (max-width:420px) {
 .labor-controls {grid-template-columns:1fr;padding:12px;}
}
