#tab-takeoff.tg-simple > .tg-legacy { display: none !important; }
#takeoff-guide [hidden] { display: none !important; }
#takeoff-guide { background: #fff; color: #172033; border-radius: 20px; padding: 24px; border: 1px solid #d7deea; font-family: system-ui, sans-serif; font-size: 17px; line-height: 1.5; }
#takeoff-guide button, #takeoff-guide input, #takeoff-guide select { font: inherit; }
#takeoff-guide button { min-height: 46px; border-radius: 10px; padding: 10px 17px; font-weight: 700; cursor: pointer; }
#takeoff-guide button:disabled { opacity: .55; cursor: wait; }
#takeoff-guide .tg-primary { background: #f59e0b; border: 1px solid #d97706; color: #172033; }
#takeoff-guide .tg-secondary { background: #fff; border: 1px solid #a7b3c5; color: #172033; }
#takeoff-guide .tg-text-button { background: transparent; border: 0; padding: 6px 0; min-height: 40px; text-decoration: underline; font-size: 14px; }
#takeoff-guide .tg-header, #takeoff-guide .tg-actions, #takeoff-guide .tg-zoom { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#takeoff-guide .tg-header { justify-content: space-between; margin-bottom: 20px; }
#takeoff-guide .tg-header strong { font-size: 21px; }
#takeoff-guide .tg-steps { display: flex; gap: 8px; padding: 0; margin: 0 0 22px; list-style: none; font-size: 14px; }
#takeoff-guide .tg-steps li { padding: 6px 12px; background: #edf1f6; border-radius: 8px; }
#takeoff-guide .tg-steps li[aria-current=step] { background: #172033; color: #fff; font-weight: 700; }
#takeoff-guide h2 { font-size: clamp(23px, 2.5vw, 30px); font-weight: 800; line-height: 1.25; margin: 0 0 10px; }
#takeoff-guide p { margin: 10px 0; }
#takeoff-guide .tg-prompt { padding-bottom: 18px; }
#takeoff-guide .tg-fields { display: flex; gap: 14px; flex-wrap: wrap; margin: 18px 0; }
#takeoff-guide label { display: block; font-weight: 700; }
#takeoff-guide input, #takeoff-guide select { display: block; box-sizing: border-box; padding: 12px; min-height: 48px; border: 1px solid #8190a6; border-radius: 9px; background: #fff; color: #172033; }
#takeoff-guide input { width: 160px; max-width: 100%; margin-top: 6px; }
#takeoff-guide select { width: 100%; margin: 8px 0 15px; }
#takeoff-guide input:focus, #takeoff-guide select:focus { outline: 3px solid #b7d2ff; outline-offset: 2px; }
#takeoff-guide .tg-plan-preview { display: block; max-height: 38vh; max-width: 100%; margin: 14px auto; border: 1px solid #cbd5e1; }
#takeoff-guide .tg-file { font-size: 14px; color: #41516b; overflow-wrap: anywhere; }
#takeoff-guide .tg-error { color: #9b1c11; font-weight: 700; }
#takeoff-guide .tg-actions { margin-top: 18px; min-height: 48px; }
#takeoff-guide .tg-zoom { justify-content: flex-end; margin: 0 0 10px; }
#takeoff-guide .tg-zoom button { min-width: 46px; padding: 7px 12px; }
#takeoff-guide { max-width: 1800px; margin-inline: auto; }
#takeoff-guide .tg-zoom { justify-content: flex-start; gap: 8px; background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 12px; padding: 10px; }
#takeoff-guide .tg-zoom output { min-width: 58px; text-align: center; font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; }
#takeoff-guide .tg-zoom button[aria-pressed=true] { background: #172033; color: white; }
#takeoff-guide #tg-viewer-hint { margin: 4px 0 10px; color: #334155; font-size: 15px; }
#takeoff-guide #tg-scale-status { font-size: 15px; color: #14532d; font-weight: 650; }
#takeoff-blueprint-svg.cce-panning { cursor: grabbing; }
#takeoff-guide button:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
body.tg-plan-expanded { overflow: hidden; }
#takeoff-guide.tg-expanded { position: fixed; inset: 10px; z-index: 85; max-width: none; margin: 0; padding: 16px; display: flex; flex-direction: column; border-radius: 14px; }
#takeoff-guide.tg-expanded .tg-header { margin: 0 0 8px; flex: none; }
#takeoff-guide.tg-expanded .tg-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#takeoff-guide.tg-expanded .tg-steps { display: none; }
#takeoff-guide.tg-expanded .tg-prompt { flex: none; max-height: 34dvh; overflow: auto; padding: 0 0 10px; }
#takeoff-guide.tg-expanded .tg-file { margin: 0; }
#takeoff-guide.tg-expanded h2 { font-size: 24px; margin: 4px 0; }
#takeoff-guide.tg-expanded .tg-fields { margin: 6px 0; }
#takeoff-guide.tg-expanded .tg-actions { margin-top: 8px; }
#takeoff-guide.tg-expanded #tg-drawing { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#takeoff-guide.tg-expanded .tg-zoom { flex: none; margin-bottom: 4px; }
#takeoff-guide.tg-expanded .tg-canvas-slot { flex: 1; min-height: 0; }
#takeoff-guide.tg-expanded #takeoff-drawing-stage,
#takeoff-guide.tg-expanded #takeoff-canvas-container { height: 100% !important; min-height: 0 !important; }
#takeoff-guide .tg-canvas-slot #takeoff-drawing-stage { margin: 0 !important; background: #e8edf4; border: 1px solid #9aa9bd; border-radius: 12px; }
#takeoff-guide .tg-canvas-slot #takeoff-drawing-stage > div:not(#takeoff-canvas-container):not(#takeoff-calibrate-modal) { display: none !important; }
#takeoff-guide #takeoff-canvas-container { height: clamp(440px, 66vh, 850px) !important; }
#takeoff-guide #takeoff-blueprint-svg { display: block; width: 100%; height: 100%; }
#takeoff-guide .tg-price-row { display: grid; grid-template-columns: minmax(160px, 1fr) 170px 150px; gap: 18px; align-items: center; padding: 16px 0; border-bottom: 1px solid #d7deea; }
#takeoff-guide .tg-price-row strong { display: block; }
#takeoff-guide .tg-price-row input { width: 100%; margin: 0; }
#takeoff-guide .tg-price-row label { font-size: 14px; }
#takeoff-guide .tg-total { font-size: 25px; font-weight: 800; margin-top: 20px; }
#takeoff-guide .tg-quantity { font-size: 24px; font-weight: 800; margin: 15px 0; }
#takeoff-guide details { margin: 15px 0; }
#takeoff-guide .tg-ai-label { color: #475569; font-weight: 700; }
#takeoff-guide .tg-ai-item { display: grid; grid-template-columns: minmax(0,1fr) 170px; gap: 20px; padding: 18px 0; border-bottom: 1px solid #d7deea; }
#takeoff-guide .tg-ai-totals { display:flex;flex-wrap:wrap;gap:12px 28px;background:#edf4ff;border:1px solid #bed3f3;border-radius:12px;padding:12px 18px;margin:16px 0; }
#takeoff-guide .tg-ai-totals>p:last-child { flex-basis:100%;margin:0;color:#41516b;font-size:14px; }
#takeoff-guide .tg-allowance { display:inline-block;padding:4px 8px;border:1px solid #d6961c;border-radius:6px;background:#fff4ce;color:#533700;font-size:13px;font-weight:700;margin:5px 0; }
.tg-source-modal { width:min(96vw,1600px);max-height:94vh;overflow:auto;border:1px solid #8190a6;border-radius:14px;padding:16px;background:white;color:#172033; }
.tg-source-modal::backdrop { background:#000b; }.tg-source-modal svg { display:block;width:100%;height:auto;background:white; }
.tg-source-modal button { padding:12px 18px;background:#172033;color:white;border-radius:9px;cursor:pointer; }
#takeoff-guide .tg-ai-item > div > strong { font-size: 19px; }
#takeoff-guide .tg-ai-item details { margin: 6px 0; color: #41516a; font-size: 14px; }
#takeoff-guide .tg-ai-item input { width: 100%; }
#takeoff-guide .tg-ai-missing { white-space: pre-line; padding: 15px; border-radius: 10px; background: #fff5df; border: 1px solid #e4a83b; color: #583b00; }
#takeoff-guide .tg-ai-ack { display: flex; align-items: flex-start; gap: 12px; margin: 15px 0; }
#takeoff-guide .tg-ai-ack input { width: 22px; height: 22px; min-height: 22px; margin: 4px 0 0; flex: none; }
#takeoff-guide summary { cursor: pointer; font-size: 15px; }
#takeoff-guide[data-advanced=true] .tg-body { display: none; }
body:has(#tab-takeoff.tg-simple:not(.hidden)) #member-app-view main > header { display: none; }
@media (max-width: 800px) {
  #takeoff-guide { padding: 16px; border-radius: 12px; }
  #takeoff-guide .tg-steps { gap: 4px; font-size: 12px; }
  #takeoff-guide .tg-steps li { flex: 1; padding: 6px; text-align: center; }
  #takeoff-guide .tg-price-row { grid-template-columns: 1fr 140px; gap: 12px; }
  #takeoff-guide .tg-price-row > .tg-line-total { display: none; }
  #takeoff-guide #takeoff-canvas-container { height: 55vh !important; min-height: 350px; }
  #takeoff-guide .tg-zoom button { font-size: 14px; padding: 8px 10px; }
  #takeoff-guide.tg-expanded { inset: 0; border-radius: 0; padding: 10px; }
  #takeoff-guide.tg-expanded .tg-header { display: none; }
  #takeoff-guide.tg-expanded .tg-prompt { max-height: 31dvh; }
  #takeoff-guide.tg-expanded #tg-file { display: none; }
  #takeoff-guide.tg-expanded h2 { font-size: 21px; }
  #takeoff-guide.tg-expanded #tg-instruction { font-size: 14px; margin: 4px 0; }
  #takeoff-guide.tg-expanded #tg-viewer-hint, #takeoff-guide.tg-expanded #tg-scale-status { font-size: 12px; margin: 2px 0; }
  #takeoff-guide.tg-expanded .tg-fields input { width: 105px; min-height: 40px; padding: 6px; margin: 0; }
}
