/* Loop Solar — Rooftop Plant Design Tool
   Inherits Helvetica Neue / Bootstrap sizes from ../static/assets/style.css
   No Tailwind CDN — utilities below cover classes used by the app markup.
*/

.plant-tool {
  --orange: #F75900;
  --orange-dark: #d44a00;
  --orange-soft: #fff3eb;
  --theme-orange: #F75900;
  --theme-orange-darker: #d44a00;
  --theme-orange-lighter: #fff3eb;
  --theme-orange-border: #fdba74;
  --theme-orange-text-info: #a34a00;
  --ink: #333;
  --muted: #666;
  --line: #ddd;
  --radius: 4px;
  background: #fff;
  padding: 0 0 24px;
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
}

.plant-tool *,
.plant-tool *::before,
.plant-tool *::after {
  box-sizing: border-box;
}

.plant-tool .content-body {
  margin-bottom: 0;
  width: 100%;
  padding: 0;
}

.plant-tool .content-body > h1 {
  max-width: none;
}

.plant-tool-body {
  margin-top: 16px;
  width: 100%;
}

/* Step chips (decorative — pages still driven by app buttons) */
.plant-tool .stepper {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  flex-wrap: wrap;
  width: 100%;
}
.plant-tool .stepper button {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  cursor: default;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.plant-tool .stepper button .n {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f5f5f5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.plant-tool .stepper button.active {
  border-color: var(--orange);
  color: var(--orange-dark);
  background: var(--orange-soft);
}
.plant-tool .stepper button.active .n {
  background: var(--orange);
  color: #fff;
}
.plant-tool .stepper button.done {
  border-color: #cde8d6;
  color: #1b7a3d;
}
.plant-tool .stepper button.done .n {
  background: #1b7a3d;
  color: #fff;
}

/* ---- Minimal utilities used by app HTML (Tailwind-compatible names) ---- */
.plant-tool .hidden { display: none !important; }
.plant-tool .block { display: block; }
.plant-tool .flex { display: flex; }
.plant-tool .inline-flex { display: inline-flex; }
.plant-tool .flex-col { flex-direction: column; }
.plant-tool .flex-wrap { flex-wrap: wrap; }
.plant-tool .items-center { align-items: center; }
.plant-tool .items-start { align-items: flex-start; }
.plant-tool .justify-center { justify-content: center; }
.plant-tool .gap-4 { gap: 1rem; }
.plant-tool .gap-8 { gap: 2rem; }
.plant-tool .space-y-1 > * + * { margin-top: 0.25rem; }
.plant-tool .space-y-2 > * + * { margin-top: 0.5rem; }
.plant-tool .space-y-3 > * + * { margin-top: 0.75rem; }
.plant-tool .space-y-4 > * + * { margin-top: 1rem; }
.plant-tool .space-y-6 > * + * { margin-top: 1.5rem; }
.plant-tool .space-x-4 > * + * { margin-left: 1rem; }
.plant-tool .grid { display: grid; }
.plant-tool .grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.plant-tool .gap-x-8 { column-gap: 2rem; }
.plant-tool .gap-y-6 { row-gap: 1.5rem; }
.plant-tool .w-full { width: 100%; }
.plant-tool .w-4 { width: 1rem; }
.plant-tool .w-5 { width: 1.25rem; }
.plant-tool .h-4 { height: 1rem; }
.plant-tool .h-5 { height: 1.25rem; }
.plant-tool .text-center { text-align: center; }
.plant-tool .text-left { text-align: left; }
.plant-tool .text-xs { font-size: 0.75rem; }
.plant-tool .text-sm { font-size: 0.875rem; }
.plant-tool .text-base { font-size: 1rem; }
.plant-tool .text-lg { font-size: 1.125rem; }
.plant-tool .text-xl { font-size: 1.25rem; }
.plant-tool .text-2xl { font-size: 1.5rem; }
.plant-tool .font-medium { font-weight: 500; }
.plant-tool .font-semibold { font-weight: 600; }
.plant-tool .font-bold { font-weight: 700; }
.plant-tool .text-gray-400 { color: #9ca3af; }
.plant-tool .text-gray-500 { color: #6b7280; }
.plant-tool .text-gray-600 { color: #4b5563; }
.plant-tool .text-gray-700 { color: #374151; }
.plant-tool .text-gray-800 { color: #1f2937; }
.plant-tool .text-theme-orange { color: var(--orange) !important; }
.plant-tool .text-orange-700 { color: #c2410c; }
.plant-tool .text-red-500 { color: #ef4444; }
.plant-tool .text-red-600 { color: #dc2626; }
.plant-tool .text-red-700 { color: #b91c1c; }
.plant-tool .text-yellow-700 { color: #a16207; }
.plant-tool .text-blue-600 { color: #2563eb; }
.plant-tool .text-green-600 { color: #059669; }
.plant-tool .hover\:text-green-700:hover { color: #047857; }
.plant-tool .bg-white { background: #fff; }
.plant-tool .bg-gray-50 { background: #fafafa; }
.plant-tool .bg-gray-100 { background: #f5f5f5; }
.plant-tool .bg-orange-50 { background: var(--orange-soft); }
.plant-tool .bg-red-100 { background: #fef2f2; }
.plant-tool .bg-yellow-100 { background: #fefce8; }
.plant-tool .border { border: 1px solid var(--line); }
.plant-tool .border-l-4 { border-left-width: 4px; border-left-style: solid; }
.plant-tool .border-orange-200,
.plant-tool .border-orange-300 { border-color: var(--theme-orange-border); }
.plant-tool .border-red-500 { border-color: #ef4444; }
.plant-tool .border-yellow-500 { border-color: #eab308; }
.plant-tool .rounded-md { border-radius: var(--radius); }
.plant-tool .rounded-lg { border-radius: var(--radius); }
.plant-tool .shadow { box-shadow: none; }
.plant-tool .overflow-x-auto { overflow-x: auto; }
.plant-tool .list-disc { list-style-type: disc; }
.plant-tool .ml-5 { margin-left: 1.25rem; }
.plant-tool .p-3 { padding: 0.75rem; }
.plant-tool .p-4 { padding: 1rem; }
.plant-tool .p-6 { padding: 1.5rem; }
.plant-tool .px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.plant-tool .py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.plant-tool .mb-1 { margin-bottom: 0.25rem; }
.plant-tool .mb-2 { margin-bottom: 0.5rem; }
.plant-tool .mb-3 { margin-bottom: 0.75rem; }
.plant-tool .mb-4 { margin-bottom: 1rem; }
.plant-tool .mb-6 { margin-bottom: 1.5rem; }
.plant-tool .mb-8 { margin-bottom: 2rem; }
.plant-tool .mt-4 { margin-top: 1rem; }
.plant-tool .mt-6 { margin-top: 1.5rem; }
.plant-tool .mt-8 { margin-top: 2rem; }
.plant-tool .my-6 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.plant-tool .my-8 { margin-top: 2rem; margin-bottom: 2rem; }

@media (min-width: 640px) {
  .plant-tool .sm\:flex-row { flex-direction: row; }
  .plant-tool .sm\:space-y-0 > * + * { margin-top: 0; }
  .plant-tool .sm\:space-x-4 > * + * { margin-left: 1rem; }
  .plant-tool .sm\:justify-center { justify-content: center; }
  .plant-tool .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  .plant-tool .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plant-tool .md\:col-span-2 { grid-column: span 2 / span 2; }
  .plant-tool .md\:gap-6 { gap: 1.5rem; }
  .plant-tool .md\:text-2xl { font-size: 1.5rem; }
}
@media (min-width: 1024px) {
  .plant-tool .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plant-tool .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plant-tool .lg\:text-lg { font-size: 1.125rem; }
}

/* ---- App chrome (Loop-aligned, not Tailwind cards) ---- */
.plant-tool .page-section { display: none; }
.plant-tool .page-section.active { display: block; }

.plant-tool .main-card {
  background: transparent;
  padding: 20px 0 0;
  margin: 16px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.plant-tool .section-title {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 700;
}

.plant-tool .subsection-title {
  margin: 20px 0 12px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
}

.plant-tool .input-label-prominent {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.plant-tool .input-field-prominent {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  font: inherit;
  color: var(--ink);
  box-shadow: none;
}
.plant-tool .input-field-prominent:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(247, 89, 0, 0.15);
}

.plant-tool .btn-primary,
.plant-tool .btn-secondary {
  display: inline-block;
  text-transform: uppercase;
  border-radius: 0;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 10px 20px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.3;
  box-shadow: none;
  transform: none;
}
.plant-tool .btn-primary {
  background: var(--orange);
  color: #fff;
}
.plant-tool .btn-primary:hover {
  background: #f3764d;
  color: #fff;
}
.plant-tool .btn-primary:disabled {
  background: #fbd1bd;
  cursor: not-allowed;
  opacity: 1;
}
.plant-tool .btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.plant-tool .btn-secondary:hover {
  background: #f5f5f5;
  border-color: #bbb;
}

.plant-tool .results-summary-card {
  background: var(--orange-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--orange);
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.plant-tool .results-summary-card p { margin: 0 0 6px; }
.plant-tool .results-summary-card strong { color: var(--orange-dark); }

.plant-tool .optimization-meter-container {
  width: 100%;
  background: #f0f0f0;
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 12px;
}
.plant-tool .optimization-meter-bar {
  height: 28px;
  border-radius: 2px;
  text-align: center;
  line-height: 28px;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  transition: width 0.4s ease, background-color 0.4s ease;
}

.plant-tool .sld-canvas,
.plant-tool .panel-layout-canvas,
.plant-tool .structure-canvas {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 100%;
  height: auto;
  background: #fff;
  display: block;
}

.plant-tool .bos-details ul,
.plant-tool .quantified-bos-list ul {
  list-style-type: disc;
  margin-left: 1.25rem;
}
.plant-tool .bos-details strong,
.plant-tool .quantified-bos-list strong {
  color: var(--orange-dark);
}

.plant-tool .bom-table {
  min-width: 100%;
  background: #fff;
  border-collapse: collapse;
}
.plant-tool .bom-table th,
.plant-tool .bom-table td {
  padding: 10px 12px;
  text-align: left;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--line);
}
.plant-tool .bom-table thead th {
  background: #fafafa;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
}

.plant-tool .info-icon {
  display: inline-block;
  margin-left: 6px;
  color: var(--muted);
  cursor: help;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  text-align: center;
  line-height: 16px;
  font-size: 12px;
  font-style: italic;
  user-select: none;
  vertical-align: middle;
}

.plant-tool .interactive-layout-area {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafafa;
  margin-bottom: 16px;
}
.plant-tool .canvas-wrapper {
  position: relative;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--orange);
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 16px;
  overflow: auto;
  min-height: 200px;
}
.plant-tool .south-indicator {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 0.75rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 6px;
  border-radius: 3px;
  display: flex;
  align-items: center;
}
.plant-tool .south-indicator svg {
  width: 0.8em;
  height: 0.8em;
  margin-right: 2px;
}

.plant-tool .canvas-row-item {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--line);
}
.plant-tool .canvas-row-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.plant-tool .visual-table-container {
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: flex;
  align-items: flex-start;
  min-height: 90px;
  min-width: 40px;
  overflow-x: auto;
  margin-right: 1rem;
}
.plant-tool .visual-table-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 1px;
}
.plant-tool .visual-panel {
  background: #ffe4cc;
  border: 1px solid var(--theme-orange-border);
  margin: 1px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.plant-tool .remove-panel-btn {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 14px;
  height: 14px;
  background: rgba(220, 38, 38, 0.75);
  color: #fff;
  border-radius: 50%;
  font-size: 0.5rem;
  line-height: 14px;
  text-align: center;
  cursor: pointer;
  border: 0;
  z-index: 10;
}

.plant-tool .action-link {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
}
.plant-tool .action-link:hover { text-decoration: underline; }
.plant-tool .action-link.text-green-600 { color: #059669; }
.plant-tool .action-link.text-blue-600 { color: #2563eb; }
.plant-tool .action-link svg {
  margin-right: 0.25rem;
  flex-shrink: 0;
}
.plant-tool .extend-button-text {
  display: inline-block;
  text-align: left;
  line-height: 1.1;
}
.plant-tool .extend-plus {
  font-size: 1.25em !important;
  font-weight: 700 !important;
  display: block !important;
}
.plant-tool .extend-panel-count {
  font-size: 0.8em !important;
  display: block !important;
}
.plant-tool .row-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}
.plant-tool .row-info {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.plant-tool .guidance-message {
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.plant-tool .guidance-info {
  background: var(--orange-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--orange);
  color: var(--theme-orange-text-info);
}
.plant-tool .guidance-success {
  background: #eaf7ef;
  border: 1px solid #cde8d6;
  border-left: 3px solid #1b7a3d;
  color: #1b7a3d;
}
.plant-tool .guidance-error {
  background: #fdf2f2;
  border: 1px solid #e8b4b4;
  border-left: 3px solid #c0392b;
  color: #922;
}

.plant-tool .remove-row-btn {
  background: #c0392b;
  color: #fff;
  padding: 6px 10px;
  font-size: 0.75rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.plant-tool .add-row-btn {
  background: var(--orange);
  color: #fff;
  padding: 8px 12px;
  font-size: 0.8rem;
  border-radius: 0;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plant-tool .modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.plant-tool .modal.active {
  opacity: 1;
  visibility: visible;
}
.plant-tool .modal-content {
  background: #fff;
  padding: 24px;
  border-radius: var(--radius);
  text-align: center;
  max-width: 90%;
  width: 420px;
  border: 1px solid var(--line);
}
.plant-tool .modal-content h3 {
  margin: 0 0 10px;
  color: var(--orange);
}
.plant-tool .modal-content p {
  margin: 0 0 16px;
  color: var(--muted);
}

#quoteStructuralBOM p {
  padding-bottom: 0.25rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px dotted var(--line);
}
#quoteStructuralBOM p:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
