/**
 * Tons & Yards — Project Workspace & Estimator Stylesheet
 * Conforms 100% to Brand Kit (09-project-workspace.svg & 10-export.svg)
 * Brand Tokens: #0F172A (Slate Ink), #D97706 (Amber), #FDE68A (Gold), #FFFFFF
 */

:root {
  --ty-ws-ink: #0F172A;
  --ty-ws-amber: #D97706;
  --ty-ws-amber-hover: #B45309;
  --ty-ws-gold: #FDE68A;
  --ty-ws-bg: #F4F3EF;
  --ty-ws-surface: #FFFFFF;
  --ty-ws-sidebar-bg: #F8FAFC;
  --ty-ws-border: #D9DDD9;
  --ty-ws-border-subtle: #E2E8F0;
  --ty-ws-muted: #64748B;
  --ty-ws-radius-card: 12px;
  --ty-ws-radius-btn: 8px;
}

/* Page Outer Container */
.ty-pe-page-wrapper {
  background: var(--ty-ws-bg);
  min-height: 80vh;
  padding-bottom: 4rem;
}

/* Context Top Bar */
.ty-pe-top-banner {
  background: #FFFFFF;
  border-bottom: 1px solid var(--ty-ws-border-subtle);
  padding: 12px 16px;
}

.ty-pe-top-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.ty-pe-breadcrumb {
  font-size: 13px;
  color: var(--ty-ws-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ty-pe-breadcrumb a {
  color: var(--ty-ws-muted);
  text-decoration: none;
}
.ty-pe-breadcrumb a:hover {
  color: var(--ty-ws-amber);
}
.ty-pe-breadcrumb .active {
  color: var(--ty-ws-ink);
  font-weight: 600;
}

.ty-pe-privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FEF3C7;
  border: 1px solid var(--ty-ws-gold);
  border-radius: 9999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #92400E;
}

.ty-pe-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #D97706;
}

/* Main Workspace Box */
.ty-workspace-container {
  max-width: 1240px;
  margin: 28px auto 0;
  padding: 0 16px;
}

.ty-workspace-frame {
  display: grid;
  grid-template-columns: 240px 1fr;
  background: #FFFFFF;
  border: 1px solid var(--ty-ws-border);
  border-radius: var(--ty-ws-radius-card);
  overflow: hidden;
  min-height: 620px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

/* ==========================================================================
   LEFT SIDEBAR (09-project-workspace.svg)
   ========================================================================== */
.ty-workspace-sidebar {
  background: var(--ty-ws-sidebar-bg);
  border-right: 1px solid var(--ty-ws-border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.ty-sidebar-eyebrow {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--ty-ws-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.ty-sidebar-project-title {
  margin: 0 0 10px 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ty-ws-ink);
  line-height: 1.3;
  margin-bottom: 10px;
  word-break: break-word;
}

.ty-sidebar-device-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  border: 1px solid var(--ty-ws-border-subtle);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--ty-ws-muted);
}

.ty-sidebar-divider {
  height: 1px;
  background: var(--ty-ws-border);
  margin: 18px 0;
}

.ty-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ty-sidebar-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ty-ws-muted);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  position: relative;
}

.ty-sidebar-nav-btn:hover {
  background: #F1F5F9;
  color: var(--ty-ws-ink);
}

.ty-sidebar-nav-btn.is-active {
  background: #FFFFFF;
  color: var(--ty-ws-ink);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.ty-nav-indicator {
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--ty-ws-amber);
  display: none;
}

.ty-sidebar-nav-btn.is-active .ty-nav-indicator {
  display: block;
}

.ty-sidebar-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--ty-ws-border);
}

.ty-sidebar-storage-badge {
  font-size: 12px;
  color: var(--ty-ws-muted);
  margin-bottom: 8px;
}

.ty-sidebar-actions-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ty-sidebar-text-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--ty-ws-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.ty-sidebar-text-link:hover {
  text-decoration: underline;
  color: var(--ty-ws-amber);
}

/* ==========================================================================
   RIGHT MAIN WORKSPACE (09-project-workspace.svg)
   ========================================================================== */
.ty-workspace-main {
  padding: 32px 36px;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ty-main-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--ty-ws-border);
  gap: 16px;
  flex-wrap: wrap;
}

.ty-project-name-h1 {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--ty-ws-ink);
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  outline: none;
  padding: 2px 6px;
  width: 100%;
  max-width: 520px;
  line-height: 1.2;
  transition: all 0.15s ease;
}

.ty-project-name-h1:focus {
  border-color: var(--ty-ws-amber);
  background: #FFFBEB;
}

.ty-project-meta-line {
  font-size: 14px;
  color: var(--ty-ws-muted);
  margin-top: 4px;
  padding-left: 6px;
}

.ty-btn-add-material-primary {
  background: var(--ty-ws-ink);
  color: #FFFFFF;
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--ty-ws-radius-btn);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.ty-btn-add-material-primary:hover {
  background: var(--ty-ws-amber);
  color: var(--ty-ws-ink);
}

/* ==========================================================================
   TAB 1: QUANTITIES TABLE (Exact 09-project-workspace.svg)
   ========================================================================== */
.ty-table-container {
  overflow-x: auto;
  margin-bottom: 24px;
}

.ty-quantities-table {
  width: 100%;
  border-collapse: collapse;
}

.ty-quantities-table thead th {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--ty-ws-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ty-ws-border);
  text-align: left;
}

.ty-quantities-table thead th.ty-col-total {
  text-align: right;
}

.ty-quantities-table tbody tr {
  border-bottom: 1px solid var(--ty-ws-border-subtle);
  transition: background 0.15s ease;
}

.ty-quantities-table tbody tr:hover {
  background: #F8FAFC;
}

.ty-quantities-table tbody td {
  padding: 18px 14px;
  vertical-align: middle;
}

.ty-item-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--ty-ws-ink);
  line-height: 1.3;
}

.ty-item-specs-sub {
  font-size: 12px;
  color: var(--ty-ws-muted);
  margin-top: 4px;
}

.ty-item-qty-cell {
  font-size: 16px;
  font-weight: 600;
  color: var(--ty-ws-ink);
  white-space: nowrap;
}

.ty-item-price-input {
  width: 85px;
  padding: 6px 8px;
  border: 1px solid var(--ty-ws-border-subtle);
  border-radius: 6px;
  font-size: 15px;
  color: var(--ty-ws-ink);
  font-family: 'JetBrains Mono', monospace;
  text-align: right;
  transition: border-color 0.15s ease;
}
.ty-item-price-input:focus {
  border-color: var(--ty-ws-amber);
  outline: none;
  background: #FFFBEB;
}

.ty-item-total-cell {
  font-size: 16px;
  font-weight: 800;
  color: var(--ty-ws-ink);
  font-family: 'JetBrains Mono', monospace;
  text-align: right;
  white-space: nowrap;
}

.ty-btn-delete-row {
  background: none;
  border: none;
  color: #94A3B8;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.ty-btn-delete-row:hover {
  color: #EF4444;
  background: #FEE2E2;
}

/* Empty State */
.ty-empty-takeoff-state {
  text-align: center;
  padding: 48px 20px;
  background: #F8FAFC;
  border: 2px dashed var(--ty-ws-border-subtle);
  border-radius: var(--ty-ws-radius-card);
  margin: 16px 0 24px;
}
.ty-empty-box-icon {
  font-size: 40px;
  margin-bottom: 12px;
}
.ty-empty-takeoff-state h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ty-ws-ink);
  margin-bottom: 8px;
}
.ty-empty-takeoff-state p {
  font-size: 14px;
  color: var(--ty-ws-muted);
  max-width: 500px;
  margin: 0 auto;
}

/* Materials Subtotal Banner (Exact 09-project-workspace.svg) */
.ty-materials-subtotal-banner {
  background: var(--ty-ws-ink);
  border-radius: 10px;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #FFFFFF;
  margin-top: 24px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.15);
  flex-wrap: wrap;
  gap: 16px;
}

.ty-subtotal-banner-label {
  font-size: 14px;
  font-weight: 600;
  color: #CAD5D0;
  margin-bottom: 4px;
}

.ty-subtotal-banner-note {
  font-size: 12px;
  color: #94A3B8;
}

.ty-subtotal-banner-amount {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 36px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   TAB 2: COSTS & ALLOWANCES
   ========================================================================== */
.ty-costs-section-title {
  margin-bottom: 24px;
}
.ty-costs-section-title h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--ty-ws-ink);
  margin: 0 0 4px 0;
}
.ty-costs-section-title p {
  font-size: 14px;
  color: var(--ty-ws-muted);
  margin: 0;
}

.ty-costs-grid-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.ty-costing-card {
  background: #F8FAFC;
  border: 1px solid var(--ty-ws-border);
  border-radius: 10px;
  padding: 22px 20px;
}

.ty-costing-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ty-ws-ink);
  margin: 0 0 16px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ty-ws-border);
}

.ty-costing-field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--ty-ws-ink);
}

.ty-costing-input {
  width: 100px;
  padding: 6px 10px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-size: 14px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
}

.ty-costing-divider {
  height: 1px;
  background: var(--ty-ws-border);
  margin: 16px 0;
}

.ty-costing-total-row {
  font-size: 16px;
  font-weight: 700;
}

.ty-client-total-box {
  background: var(--ty-ws-ink);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  color: #FFFFFF;
}

.ty-client-total-label {
  font-size: 12px;
  color: #CBD5E1;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ty-client-total-amount {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--ty-ws-gold);
}

/* ==========================================================================
   TAB 3: EXPORT ESTIMATE (Exact 10-export.svg)
   ========================================================================== */
.ty-export-container-layout {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 32px;
  align-items: start;
}

.ty-export-paper-card {
  background: #FFFFFF;
  border: 1px solid var(--ty-ws-border);
  border-radius: var(--ty-ws-radius-card);
  padding: 32px 28px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.ty-paper-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ty-paper-brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ty-paper-badge-right {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--ty-ws-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ty-paper-hairline {
  height: 1px;
  background: var(--ty-ws-border);
  margin: 16px 0;
}

.ty-paper-project-h2 {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--ty-ws-ink);
  margin: 0 0 4px 0;
}

.ty-paper-date-line {
  font-size: 13px;
  color: var(--ty-ws-muted);
  margin-bottom: 24px;
}

.ty-paper-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--ty-ws-border);
}

.ty-paper-item-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ty-ws-ink);
}

.ty-paper-item-qty {
  font-size: 16px;
  font-weight: 700;
  color: var(--ty-ws-ink);
}

.ty-paper-notes-box {
  margin-top: 24px;
  padding-top: 16px;
}

.ty-paper-assumptions-text {
  font-size: 13px;
  color: var(--ty-ws-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.ty-paper-footer-source {
  font-size: 11px;
  color: #94A3B8;
  font-family: monospace;
}

/* Export Choices Column */
.ty-export-choices-title {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--ty-ws-ink);
  margin: 0 0 20px 0;
}

.ty-export-card-button {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--ty-ws-border);
  border-radius: 10px;
  background: #FFFFFF;
  cursor: pointer;
  text-align: left;
  width: 100%;
  margin-bottom: 14px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.ty-export-card-button:hover {
  border-color: var(--ty-ws-amber);
  background: #FFFBEB;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.12);
}

.ty-export-card-icon {
  background: #FEF3C7;
  padding: 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ty-export-card-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--ty-ws-ink);
  margin-bottom: 4px;
}

.ty-export-card-desc {
  font-size: 13px;
  color: var(--ty-ws-muted);
  line-height: 1.4;
}

.ty-export-subactions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

/* ==========================================================================
   RESPONSIVE LAYOUT
   ========================================================================== */
@media (max-width: 900px) {
  .ty-workspace-frame {
    grid-template-columns: 1fr;
  }
  .ty-workspace-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--ty-ws-border);
    padding: 18px 16px;
  }
  .ty-sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .ty-sidebar-nav-btn {
    white-space: nowrap;
    width: auto;
  }
  .ty-sidebar-footer {
    display: none;
  }
  .ty-workspace-main {
    padding: 20px 16px;
  }
  .ty-costs-grid-layout {
    grid-template-columns: 1fr;
  }
  .ty-export-container-layout {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   PRICING CELL & CLOSE/DELETE BUTTON ENHANCEMENTS (UI POLISH)
   ========================================================================== */
.ty-col-price {
  width: 170px;
  vertical-align: middle;
}

.ty-table-price-wrap {
  display: inline-flex;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  height: 38px;
  padding: 0 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
  max-width: 180px;
}

.ty-table-price-wrap:focus-within {
  border-color: #D97706;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.15);
}

.ty-price-currency {
  font-size: 14px;
  font-weight: 700;
  color: #64748B;
  user-select: none;
  margin-right: 2px;
}

.ty-table-price-input {
  width: 65px;
  height: 100%;
  border: none !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
  font-family: inherit;
  padding: 0 4px;
  text-align: right;
  -moz-appearance: textfield;
}

.ty-table-price-input::-webkit-outer-spin-button,
.ty-table-price-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ty-price-unit-sub {
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  margin-left: 4px;
  user-select: none;
  white-space: nowrap;
}

.ty-col-total {
  text-align: right;
  vertical-align: middle;
  width: 120px;
}

.ty-cell-total {
  font-size: 16px;
  font-weight: 800;
  color: #0F172A;
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  white-space: nowrap;
}

.ty-col-action {
  text-align: center;
  width: 48px;
  padding: 8px !important;
  vertical-align: middle;
}

.ty-btn-delete-item {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #64748B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin: 0 auto;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  line-height: 1;
}

.ty-btn-delete-item:hover {
  background: #FEE2E2;
  border-color: #FCA5A5;
  color: #DC2626;
  transform: scale(1.06);
}

.ty-btn-delete-item svg {
  pointer-events: none;
  display: block;
}

/* Modal Close Icon Buttons */
.ty-pe-btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #64748B;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s ease;
}
.ty-pe-btn-icon:hover {
  background: #F1F5F9;
  color: #0F172A;
  border-color: #CBD5E1;
}


/* ==========================================================================
   PROJECT ESTIMATOR PRINT STYLESHEET (@media print)
   Guaranteed 1-Page Output for Single Item Projects
   ========================================================================== */
/* ==========================================================================
   TRADE SCOPE SUB-CALCULATOR MODAL DIALOG (SCREEN OVERLAY)
   ========================================================================== */
.ty-pe-modal-overlay {
  display: none; /* STRICT DEFAULT: Hidden until activated */
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  background: rgba(15, 23, 42, 0.75) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  box-sizing: border-box !important;
}

.ty-pe-modal-overlay.is-active,
.ty-pe-modal-overlay.is-open {
  display: flex !important;
  animation: tyModalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ty-pe-modal-card {
  background: #FFFFFF !important;
  border-radius: 12px !important;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.45), 0 0 0 1px rgba(15, 23, 42, 0.08) !important;
  max-width: 680px !important;
  width: 100% !important;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  animation: tyModalSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative !important;
}

.ty-pe-modal-card-lg {
  max-width: 700px !important;
}

/* Modal Header */
.ty-pe-modal-header {
  padding: 1.125rem 1.5rem !important;
  background: #FFFFFF !important;
  border-bottom: 1px solid #E2E8F0 !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 1rem !important;
  flex-shrink: 0 !important;
}

.ty-pe-modal-header h3 {
  font-family: 'Space Grotesk', -apple-system, sans-serif !important;
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  color: #0F172A !important;
  letter-spacing: -0.02em !important;
  margin: 0.25rem 0 0 0 !important;
  line-height: 1.25 !important;
}

/* Modal Close Icon Buttons */
.ty-pe-btn-icon {
  width: 34px !important;
  height: 34px !important;
  border-radius: 6px !important;
  border: 1px solid #E2E8F0 !important;
  background: #FFFFFF !important;
  color: #64748B !important;
  font-size: 20px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  line-height: 1 !important;
  transition: all 0.15s ease !important;
}
.ty-pe-btn-icon:hover {
  background: #F1F5F9 !important;
  color: #0F172A !important;
  border-color: #CBD5E1 !important;
}

/* Modal Category Tabs */
.ty-pe-trade-nav {
  display: flex !important;
  background: #0F172A !important;
  padding: 8px 12px !important;
  gap: 6px !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  border-bottom: 1px solid #1E293B !important;
  scrollbar-width: none !important;
  flex-shrink: 0 !important;
}

.ty-pe-trade-nav::-webkit-scrollbar {
  display: none !important;
}

.ty-pe-trade-nav-btn {
  background: transparent !important;
  border: none !important;
  border-radius: 6px !important;
  color: #94A3B8 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  padding: 6px 12px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  font-family: inherit !important;
  transition: all 0.15s ease !important;
  line-height: 1.4 !important;
  outline: none !important;
}

.ty-pe-trade-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #F8FAFC !important;
}

.ty-pe-trade-nav-btn.is-active {
  background: #D97706 !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* Modal Interactive Form */
.ty-pe-trade-form-body {
  padding: 1.25rem 1.5rem !important;
  overflow-y: auto !important;
  background: #FFFFFF !important;
  flex: 1 1 auto !important;
  max-height: calc(90vh - 300px) !important;
}

.ty-pe-trade-form-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 1rem !important;
}

@media (max-width: 580px) {
  .ty-pe-trade-form-grid {
    grid-template-columns: 1fr !important;
  }
}

.ty-pe-field {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

.ty-pe-field label {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #334155 !important;
  line-height: 1.25 !important;
  display: block !important;
}

.ty-pe-field input[type="number"],
.ty-pe-field input[type="text"],
.ty-pe-field select {
  width: 100% !important;
  height: 40px !important;
  padding: 0 12px !important;
  border: 1px solid #CBD5E1 !important;
  border-radius: 6px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #0F172A !important;
  background: #FFFFFF !important;
  box-sizing: border-box !important;
  font-family: inherit !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.ty-pe-field input[type="number"]:focus,
.ty-pe-field input[type="text"]:focus,
.ty-pe-field select:focus {
  border-color: #D97706 !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.18) !important;
}

/* Preview Card */
.ty-pe-trade-preview-box {
  margin: 0 1.5rem 1rem 1.5rem !important;
  padding: 1rem 1.25rem !important;
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%) !important;
  border-radius: 8px !important;
  border: 1px solid #334155 !important;
  color: #FFFFFF !important;
  flex-shrink: 0 !important;
}

.ty-pe-preview-main-num {
  font-family: 'Space Grotesk', -apple-system, sans-serif !important;
  font-size: 1.75rem !important;
  font-weight: 800 !important;
  color: #FFFFFF !important;
  margin: 4px 0 2px 0 !important;
  line-height: 1.2 !important;
}

.ty-pe-preview-sub-metrics {
  font-size: 13px !important;
  color: #94A3B8 !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
}

/* Unit Pricing Entry Row */
.ty-pe-modal-unit-row {
  padding: 0.875rem 1.5rem !important;
  background: #F8FAFC !important;
  border-top: 1px solid #E2E8F0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex-shrink: 0 !important;
}

.ty-pe-modal-unit-row label {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #0F172A !important;
  margin: 0 !important;
}

.ty-pe-modal-unit-row input[type="number"] {
  width: 120px !important;
  height: 38px !important;
  padding: 0 10px !important;
  border: 1px solid #CBD5E1 !important;
  border-radius: 6px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #0F172A !important;
  background: #FFFFFF !important;
  font-family: inherit !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.ty-pe-modal-unit-row input[type="number"]:focus {
  border-color: #D97706 !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.18) !important;
}

/* Modal Action Footer */
.ty-pe-modal-footer {
  padding: 1rem 1.5rem !important;
  background: #FFFFFF !important;
  border-top: 1px solid #E2E8F0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 12px !important;
  flex-shrink: 0 !important;
}

.ty-pe-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 42px !important;
  padding: 0 1.25rem !important;
  border-radius: 6px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  border: 1px solid transparent !important;
  text-decoration: none !important;
  line-height: 1 !important;
}

.ty-pe-btn-secondary {
  background: #F1F5F9 !important;
  color: #334155 !important;
  border-color: #CBD5E1 !important;
}

.ty-pe-btn-secondary:hover {
  background: #E2E8F0 !important;
  color: #0F172A !important;
  border-color: #94A3B8 !important;
}

.ty-pe-btn-primary {
  background: #D97706 !important;
  color: #FFFFFF !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1) !important;
}

.ty-pe-btn-primary:hover {
  background: #B45309 !important;
  box-shadow: 0 4px 6px -1px rgba(217, 119, 6, 0.3) !important;
  transform: translateY(-1px) !important;
}

.ty-pe-btn-primary:active {
  transform: translateY(0) !important;
}

/* Modal Animations */
@keyframes tyModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes tyModalSlideUp {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}


@page {
  size: portrait;
  margin: 10mm 12mm;
}

@media print {
  /* Hide all web chrome, navigation, headers, footers, toolbars */
  header, footer, nav, aside,
  .site-header, .site-footer, .ty-site-header, .ty-site-footer,
  #site-navigation, #mobile-header, .main-navigation, #colophon,
  .ty-pe-top-banner, .ty-workspace-sidebar, .ty-main-top-row,
  .ty-col-action, .no-print, [class*="no-print"],
  .ty-pe-modal-overlay, .ty-export-choices-pane,
  .ty-empty-takeoff-state, .ty-sidebar-actions-compact,
  button, input[type="button"], input[type="submit"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  html, body {
    background: #FFFFFF !important;
    color: #0F172A !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
  }

  .site, .site-content, .content-area, .site-main, .entry-content,
  .ty-pe-page-wrapper {
    background: #FFFFFF !important;
    min-height: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .ty-workspace-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .ty-workspace-frame {
    display: block !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
  }

  .ty-workspace-main {
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Branded Print Header for Estimator */
  .ty-pe-print-header {
    display: block !important;
    border-bottom: 2px solid #0F172A !important;
    padding-bottom: 8px !important;
    margin-bottom: 12px !important;
  }

  /* Line Items Table in Print */
  .ty-table-container {
    margin-bottom: 12px !important;
    overflow: visible !important;
  }

  .ty-quantities-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 11px !important;
  }

  .ty-quantities-table thead th {
    background: #F1F5F9 !important;
    color: #0F172A !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    padding: 6px 8px !important;
    border: 1px solid #CBD5E1 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .ty-quantities-table tbody td {
    padding: 6px 8px !important;
    border: 1px solid #E2E8F0 !important;
    vertical-align: middle !important;
  }

  .ty-quantities-table tbody tr {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .ty-item-name {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #0F172A !important;
  }

  .ty-item-subspecs {
    font-size: 10px !important;
    color: #475569 !important;
  }

  .ty-qty-num {
    font-size: 12px !important;
    font-weight: 700 !important;
  }

  .ty-qty-unit {
    font-size: 10px !important;
    color: #475569 !important;
  }

  .ty-table-price-wrap {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    height: auto !important;
    padding: 0 !important;
  }

  .ty-table-price-input {
    border: none !important;
    background: transparent !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #0F172A !important;
    width: auto !important;
    padding: 0 !important;
  }

  .ty-cell-total {
    font-size: 12px !important;
    font-weight: 800 !important;
    color: #0F172A !important;
  }

  /* Subtotal / Financial Summary Banner */
  .ty-materials-subtotal-banner {
    background: #0F172A !important;
    color: #FFFFFF !important;
    border-radius: 6px !important;
    padding: 10px 14px !important;
    margin-top: 8px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .ty-subtotal-banner-label {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #FFFFFF !important;
  }

  .ty-subtotal-banner-note {
    font-size: 9px !important;
    color: #94A3B8 !important;
  }

  .ty-subtotal-banner-amount {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #FDE68A !important;
  }

  /* Material Summary Document (Tab 3 Print) */
  .ty-export-paper-card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}
