

/* =========================================================================
   EVA - Engineering Vector Automation
   Design tokens, layout, and components.
   ========================================================================= */

/* ---------- Design tokens ---------- */
:root {
  color-scheme: light;

  /* Type */
  --font-sans: "Inter", "Noto Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Symbols", sans-serif;

  /* Surfaces */
  --bg-page: #FFFFFF;
  --bg-panel: #FFFFFF;
  --bg-panel-2: #FAFAFA;
  --bg-card: #FFFFFF;
  --bg-card-2: #FAFAFA;
  --bg-input: #FFFFFF;
  --bg-glass: rgba(255, 255, 255, 0.92);

  /* Borders */
  --border: #DFDFDF;
  --border-strong: #C7C7C7;
  --border-soft: rgba(23, 23, 23, 0.08);

  /* Text */
  --text-primary: #141414;
  --text-secondary: #333333;
  --text-muted: #606060;
  --text-faint: #B3B3B3;

  /* Brand & semantics */
  --brand: #3ECF8E;
  --brand-soft: rgba(62, 207, 142, 0.16);
  --brand-soft-2: rgba(62, 207, 142, 0.08);
  --brand-strong: #24B47E;
  --accent: #4ADE80;
  --accent-strong: #24B47E;
  --info: #054CFF;
  --info-soft: rgba(5, 76, 255, 0.09);
  --warning: #8A6700;
  --warning-soft: rgba(255, 219, 19, 0.18);
  --danger: #FF2201;
  --danger-soft: rgba(255, 34, 1, 0.08);
  --neutral-soft: rgba(23, 23, 23, 0.06);

  /* Effects */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.10);
  --ring-focus: 0 0 0 3px rgba(62, 207, 142, 0.28);

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-pill: 999px;

  /* Easing */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================================
   UI/UX Polish
   ========================================================================= */

body {
  font-feature-settings: "cv11", "ss01", "cv01";
  font-weight: 400;
}

:where(h1, h2, h3, h4) {
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.brand-heading {
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  letter-spacing: -0.01em;
}

.brand-description {
  font-size: clamp(0.78rem, 0.74rem + 0.2vw, 0.92rem);
  line-height: 1.45;
}

.icon-button {
  border-radius: var(--r-md);
}

.ui-input,
.ui-select,
.ui-textarea {
  border-radius: var(--r-md);
}

.card,
.monitor,
.result-card,
.panel,
.drawer-panel,
.popover,
.modal {
  border-radius: var(--r-xl);
}


/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  background: var(--bg-page);
  color: var(--text-primary);
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  line-height: 1.45;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
  border-radius: var(--r-md);
}

/* ---------- Scrollbar ---------- */
.right-workspace,
.kml-folder-list,
.boq-table-shell,
.console-log-shell,
.warning-list,
.drawer-body,
.activity-detail {
  scrollbar-color: rgba(93, 187, 154, 0.38) transparent;
  scrollbar-width: thin;
}

.right-workspace::-webkit-scrollbar,
.kml-folder-list::-webkit-scrollbar,
.boq-table-shell::-webkit-scrollbar,
.console-log-shell::-webkit-scrollbar,
.warning-list::-webkit-scrollbar,
.drawer-body::-webkit-scrollbar,
.activity-detail::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.right-workspace::-webkit-scrollbar-thumb,
.kml-folder-list::-webkit-scrollbar-thumb,
.boq-table-shell::-webkit-scrollbar-thumb,
.console-log-shell::-webkit-scrollbar-thumb,
.warning-list::-webkit-scrollbar-thumb,
.drawer-body::-webkit-scrollbar-thumb,
.activity-detail::-webkit-scrollbar-thumb {
  background: rgba(93, 187, 154, 0.25);
  border-radius: var(--r-pill);
}

.right-workspace::-webkit-scrollbar-thumb:hover,
.kml-folder-list::-webkit-scrollbar-thumb:hover,
.boq-table-shell::-webkit-scrollbar-thumb:hover,
.console-log-shell::-webkit-scrollbar-thumb:hover,
.warning-list::-webkit-scrollbar-thumb:hover,
.drawer-body::-webkit-scrollbar-thumb:hover,
.activity-detail::-webkit-scrollbar-thumb:hover {
  background: rgba(93, 187, 154, 0.45);
}

/* =========================================================================
   App shell & layout
   ========================================================================= */
.app-shell {
  background:
    radial-gradient(circle at 18% -8%, rgba(93, 187, 154, 0.18), transparent 34rem),
    radial-gradient(circle at 92% 4%, rgba(122, 216, 180, 0.16), transparent 30rem),
    linear-gradient(180deg, #FFFFFF 0%, var(--bg-page) 18rem),
    var(--bg-page);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px) saturate(140%);
}

.app-layout {
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  min-width: 0;
}

.left-workspace,
.right-workspace,
.app-panel {
  min-width: 0;
}

@media (min-width: 1181px) {
  .app-layout {
    align-items: start;
  }

  .right-workspace {
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
  }
}

@media (max-width: 1180px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
  .right-workspace {
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
  }
}

/* ---------- Panels ---------- */
.app-panel {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-panel);
  box-shadow: var(--shadow-md);
}

.upload-card {
  overflow: hidden;
  min-width: 0;
}

.upload-card > div {
  min-width: 0;
  overflow: hidden;
}

/* =========================================================================
   Buttons & inputs
   ========================================================================= */
.primary-button,
.download-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 0.78rem 1.1rem;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.005em;
  transition: background-color 160ms var(--ease), transform 160ms var(--ease), box-shadow 160ms var(--ease), opacity 160ms var(--ease);
}

.primary-button {
  background: var(--brand);
  color: #083127;
  box-shadow: 0 10px 22px rgba(93, 187, 154, 0.24);
}

.primary-button:hover:not(:disabled) {
  background: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(93, 187, 154, 0.3);
}

.primary-button:active:not(:disabled) {
  transform: translateY(0);
}

.primary-button:disabled {
  background: #E8F2EE;
  color: var(--text-muted);
  box-shadow: none;
}

.download-primary {
  min-width: 12.5rem;
  background: #18332B;
  color: #FFFFFF;
  box-shadow: 0 12px 28px rgba(24, 51, 43, 0.2);
}

.download-primary:hover {
  background: #2F8E6E;
  transform: translateY(-1px);
}

.secondary-button,
.console-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: #FFFFFF;
  padding: 0.5rem 0.78rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease), color 160ms var(--ease);
}

.secondary-button:hover:not(:disabled),
.console-action-button:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--brand-soft-2);
  color: var(--text-primary);
}

.secondary-button:disabled,
.console-action-button:disabled {
  opacity: 0.5;
}

.result-status-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.cancel-job-button {
  border-color: rgba(220, 38, 38, 0.28);
  color: #B42318;
}

.cancel-job-button:hover:not(:disabled) {
  border-color: rgba(220, 38, 38, 0.42);
  background: rgba(254, 226, 226, 0.72);
  color: #991B1B;
}

.ui-input,
.boq-filter-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-input);
  padding: 0.6rem 0.78rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  outline: none;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.ui-input::placeholder {
  color: var(--text-muted);
}

.ui-input:focus,
.boq-filter-select:focus {
  border-color: rgba(93, 187, 154, 0.65);
  box-shadow: 0 0 0 3px rgba(93, 187, 154, 0.16);
}

.boq-filter-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235F7A70' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.78rem center;
  padding-right: 2rem;
}

/* =========================================================================
   Workflow stepper
   ========================================================================= */
.workflow-stepper {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-panel);
  box-shadow: var(--shadow-sm);
}

.workflow-step {
  position: relative;
  flex: 1 1 0;
  min-width: 9rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  transition: background-color 160ms var(--ease);
}

.workflow-step + .workflow-step {
  border-left: 1px solid var(--border);
}

.workflow-step::after {
  content: "";
  position: absolute;
  left: 2.7rem;
  right: 0.5rem;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background-color 200ms var(--ease);
}

.workflow-step-index {
  position: relative;
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  background: var(--bg-card-2);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  transition: background-color 200ms var(--ease), color 200ms var(--ease), border-color 200ms var(--ease);
}

.workflow-step-index svg {
  width: 0.95rem;
  height: 0.95rem;
}

.workflow-step-label,
.workflow-step-status {
  display: block;
  line-height: 1.25;
}

.workflow-step-label {
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
}

.workflow-step-status {
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* States */
.workflow-step[data-status="complete"] .workflow-step-index {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-color: rgba(93, 187, 154, 0.45);
}
.workflow-step[data-status="complete"] .workflow-step-status {
  color: var(--brand-strong);
}
.workflow-step[data-status="complete"]::after {
  background: var(--brand);
}

.workflow-step[data-status="ready"] .workflow-step-index {
  background: var(--brand-soft-2);
  color: var(--brand-strong);
  border-color: rgba(93, 187, 154, 0.35);
}
.workflow-step[data-status="ready"] .workflow-step-status {
  color: var(--brand-strong);
}

.workflow-step[data-status="processing"] .workflow-step-index {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-color: rgba(93, 187, 154, 0.6);
  animation: step-pulse 1.6s ease-in-out infinite;
}
.workflow-step[data-status="processing"] .workflow-step-status {
  color: var(--brand-strong);
}

.workflow-step[data-status="warning"] .workflow-step-index {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: rgba(251, 191, 36, 0.45);
}
.workflow-step[data-status="warning"] .workflow-step-status {
  color: var(--warning);
}

.workflow-step[data-status="error"] .workflow-step-index {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.5);
}
.workflow-step[data-status="error"] .workflow-step-status {
  color: var(--danger);
}

@keyframes step-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(93, 187, 154, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(93, 187, 154, 0); }
}

/* =========================================================================
   Status pills (generic)
   ========================================================================= */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-card-2);
  padding: 0.32rem 0.7rem;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-pill::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: var(--r-pill);
  background: currentColor;
  opacity: 0.85;
}

.status-pill[data-tone="processing"] {
  border-color: rgba(56, 189, 248, 0.34);
  background: var(--info-soft);
  color: var(--info);
}

.status-pill[data-tone="done"] {
  border-color: rgba(52, 211, 153, 0.34);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.status-pill[data-tone="error"] {
  border-color: rgba(248, 113, 113, 0.4);
  background: var(--danger-soft);
  color: var(--danger);
}

.status-pill[data-tone="warning"] {
  border-color: rgba(251, 191, 36, 0.4);
  background: var(--warning-soft);
  color: var(--warning);
}

#statusBadge {
  border: 1px solid var(--border);
  background: var(--bg-card-2);
  color: var(--text-secondary);
  border-radius: var(--r-pill);
  padding: 0.3rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* =========================================================================
   Drop zones
   ========================================================================= */
.drop-zone {
  display: flex;
  min-height: 8.5rem;
  cursor: pointer;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.85rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg-card);
  padding: 1.1rem 0.9rem;
  text-align: left;
  color: var(--text-primary);
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease), transform 160ms var(--ease);
}

.drop-zone[data-state="selected"] {
  border: none;
  background: transparent;
  padding: 0;
  min-height: 0;
  gap: 0;
}

/* When a file is selected, hide the entire dropzone hint (icon + copy + helper)
   so only the file summary card is visible. Avoids the "card-in-card" look. */
.drop-zone[data-state="selected"] .drop-zone-main {
  display: none;
}

.drop-zone-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--brand);
  border-radius: var(--r-pill);
  background: var(--brand-soft-2);
  color: var(--brand-strong);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms var(--ease), border-color 160ms var(--ease);
}

.drop-zone-add-btn:hover {
  background: var(--brand);
  color: #083127;
}

.drop-zone-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-width: 0;
}

.drop-zone-texts {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.drop-zone:hover,
.drag-active {
  border-color: rgba(56, 189, 248, 0.55) !important;
  background: rgba(56, 189, 248, 0.05) !important;
  transform: translateY(-1px);
}

.drop-zone-icon {
  display: inline-flex;
  width: 2.6rem;
  height: 2.6rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card-2);
  margin-bottom: 0.65rem;
  transition: transform 160ms var(--ease), border-color 160ms var(--ease);
}

.drop-zone-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.drop-zone-title {
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 800;
}

.drop-zone-copy,
.drop-zone-helper {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.45;
}

.drop-zone-helper {
  color: var(--text-muted);
}

.drop-zone:hover .drop-zone-icon {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}

.upload-file-summary {
  display: grid;
  gap: 0.55rem;
  border: 1px solid rgba(93, 187, 154, 0.28);
  border-radius: var(--r-md);
  background: rgba(223, 247, 236, 0.72);
  padding: 0.7rem;
  color: var(--text-primary);
  min-width: 0;
  overflow: hidden;
}

.upload-summary-head,
.upload-summary-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.upload-summary-head strong {
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 800;
}

.upload-summary-action {
  border: 1px solid rgba(93, 187, 154, 0.35);
  border-radius: var(--r-pill);
  background: #FFFFFF;
  padding: 0.28rem 0.55rem;
  color: var(--brand-strong);
  font-size: 0.68rem;
  font-weight: 800;
}

.upload-summary-action:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.upload-summary-action.danger {
  border-color: rgba(226, 109, 109, 0.32);
  color: var(--danger);
}

.mini-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-card);
  padding: 0.18rem 0.48rem;
  color: var(--text-muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.mini-status-badge::before {
  content: "";
  width: 0.38rem;
  height: 0.38rem;
  border-radius: var(--r-pill);
  background: currentColor;
}

.mini-status-badge[data-tone="ready"] {
  border-color: rgba(53, 182, 122, 0.34);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.mini-status-badge[data-tone="warning"] {
  border-color: rgba(242, 185, 75, 0.36);
  background: var(--warning-soft);
  color: #9A6A12;
}

.mini-status-badge[data-tone="error"] {
  border-color: rgba(226, 109, 109, 0.38);
  background: var(--danger-soft);
  color: var(--danger);
}

/* =========================================================================
   Mode card / output mode
   ========================================================================= */
.mode-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  padding: 1rem;
}

.flow-section-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.018));
  padding: 1rem;
}

.flow-section-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.flow-section-head strong,
.flow-section-head h3 {
  display: block;
  color: var(--text-primary);
  font-size: 0.94rem;
  font-weight: 750;
  line-height: 1.25;
}

.flow-section-head small,
.flow-section-head p {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
  margin-top: 0.16rem;
}

.flow-step {
  display: inline-flex;
  width: 1.55rem;
  height: 1.55rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(93, 187, 154, 0.42);
  background: rgba(93, 187, 154, 0.12);
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.standardizer-summary {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  padding: 0.95rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.55;
}

.standardizer-summary strong {
  color: var(--text-primary);
  font-weight: 700;
}

.standardizer-source {
  display: grid;
  gap: 0.45rem;
}

.standardizer-source-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.standardizer-source p {
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.5;
}

.standardizer-details summary {
  display: flex;
  cursor: pointer;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  list-style: none;
}

.standardizer-details summary::-webkit-details-marker,
.standardizer-details summary::marker {
  display: none;
  content: "";
}

.standardizer-details summary small {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.45;
}

.standardizer-summary-status {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-card-2);
  padding: 0.22rem 0.55rem;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 700;
}

.standardizer-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.standardizer-summary-grid .summary-tile strong {
  font-size: 1.12rem;
}

.validation-result-card {
  margin-top: 1rem;
  border: 1px solid rgba(93, 187, 154, 0.35);
  border-radius: var(--r-lg);
  background: var(--bg-card);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}
.validation-result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}
.validation-result-header h2 { color: var(--text-primary); font-size: 1rem; font-weight: 800; }
.validation-result-header p { margin-top: 0.25rem; color: var(--text-secondary); font-size: 0.76rem; }
.validation-result-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; }
.validation-result-toggle { min-height: 34px; padding: 0.35rem 0.7rem; }
.validation-result-badge {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-card-2);
  padding: 0.28rem 0.65rem;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 800;
}
.validation-result-badge[data-tone="success"] { border-color: rgba(93,187,154,.5); color: #14805a; background: rgba(241,250,246,.9); }
.validation-result-badge[data-tone="warning"] { border-color: rgba(242,185,75,.5); color: #8a641a; background: rgba(255,249,232,.9); }
.validation-result-badge[data-tone="error"] { border-color: rgba(226,109,109,.5); color: var(--danger); background: rgba(255,240,240,.9); }
.validation-result-content { padding-top: 0.75rem; }

.standardizer-validation {
  margin-bottom: 0.75rem;
  border: 1px solid rgba(93, 187, 154, 0.35);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(241, 250, 246, 0.9), var(--bg-card));
  padding: 0.75rem;
}

.standardizer-validation .standardizer-summary-status[data-tone="success"] { color: #14805a; }
.standardizer-validation .standardizer-summary-status[data-tone="warning"] { color: #9b6a0b; }
.standardizer-validation .standardizer-summary-status[data-tone="error"] { color: #b33b3b; }
.validation-group-block { margin-top: 0.7rem; }
.validation-group-block > strong { display: block; margin-bottom: 0.35rem; font-size: 0.72rem; }
.validation-chip-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.validation-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-card);
  padding: 0.22rem 0.5rem;
  color: var(--text-secondary);
  font-size: 0.68rem;
}
.validation-chip[data-tone="warning"] { border-color: rgba(242,185,75,.45); color: #8a641a; }
.validation-chip[data-tone="error"] { border-color: rgba(226,109,109,.45); color: var(--danger); }
.validation-chip[data-tone="success"] { border-color: rgba(93,187,154,.45); color: #14805a; }
.validation-chip b { font-weight: 800; }
.validation-issue-list em { color: inherit; opacity: .75; font-style: normal; }

.legacy-validation-report-stack { display: grid; gap: 0.85rem; }
.legacy-validation-file-card { overflow: hidden; border: 1px solid var(--border); border-left: 5px solid #35b67a; border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow-sm); }
.legacy-validation-file-card[data-tone="error"] { border-left-color: #e26d6d; }
.legacy-validation-file-card[data-tone="warning"] { border-left-color: #e9ad3d; }
.legacy-validation-file-header { display: flex; align-items: center; gap: .65rem; padding: .7rem .8rem; }
.legacy-validation-file-state { display: grid; width: 2rem; height: 2rem; flex: 0 0 auto; place-items: center; border-radius: .55rem; background: #eaf8f0; color: #14805a; font-size: 1.25rem; font-weight: 900; }
.legacy-validation-file-state[data-tone="error"] { background: #fff0f0; color: #c43e3e; }
.legacy-validation-file-state[data-tone="warning"] { background: #fff8e8; color: #9b6a0b; }
.legacy-validation-file-title { min-width: 0; flex: 1; }
.legacy-validation-file-title strong { display: block; overflow: hidden; color: var(--text-primary); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.legacy-validation-file-title small { display: block; margin-top: .15rem; color: var(--text-muted); font-size: .67rem; }
.legacy-validation-file-badge, .legacy-validation-counts b { border-radius: 999px; padding: .2rem .45rem; font-size: .62rem; font-weight: 900; }
.legacy-validation-file-badge[data-tone="success"], .legacy-validation-counts b[data-tone="success"] { background: #eaf8f0; color: #14805a; }
.legacy-validation-file-badge[data-tone="error"], .legacy-validation-counts b[data-tone="error"] { background: #fff0f0; color: #c43e3e; }
.legacy-validation-file-badge[data-tone="warning"], .legacy-validation-counts b[data-tone="warning"] { background: #fff8e8; color: #9b6a0b; }
.legacy-validation-auto-notice { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .7rem; margin: 0 .8rem .7rem; border: 1px solid #f1d58a; border-radius: .55rem; background: #fff9e9; padding: .5rem .6rem; color: #735719; font-size: .66rem; }
.legacy-validation-auto-notice b { color: #a56f00; font-size: .6rem; letter-spacing: .04em; }
.legacy-validation-auto-notice small { width: 100%; color: #8a6b2a; }
.legacy-validation-summary { margin: 0 .8rem .8rem; border: 1px solid var(--border); border-radius: .6rem; padding: .65rem; }
.legacy-validation-summary-title { display: flex; align-items: center; gap: .4rem; color: var(--text-primary); font-size: .72rem; font-weight: 900; }
.legacy-validation-counts { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-left: auto; }
.legacy-validation-counts small { color: var(--text-muted); font-size: .62rem; font-weight: 600; }
.legacy-validation-group { margin-top: .6rem; border-top: 1px solid var(--border); padding-top: .55rem; }
.legacy-validation-group-title { display: flex; justify-content: space-between; color: var(--text-primary); font-size: .68rem; font-weight: 900; }
.legacy-validation-group-title small { color: var(--text-muted); font-size: .62rem; font-weight: 700; }
.legacy-validation-group-title b { color: var(--danger); }
.legacy-validation-group-summary { margin: .2rem 0; color: var(--text-secondary); font-size: .66rem; line-height: 1.4; }
.legacy-validation-group details summary, .legacy-validation-more-groups > summary { cursor: pointer; color: #4774a8; font-size: .64rem; font-weight: 800; }
.legacy-validation-more-groups { margin-top: .65rem; border-top: 1px solid var(--border); padding-top: .55rem; }
.legacy-validation-more-groups[open] > summary { margin-bottom: .2rem; }
.legacy-validation-group .validation-issue-list { max-height: 12rem; margin-top: .35rem; overflow: auto; }
.legacy-validation-group .validation-issue-list li { margin-top: .25rem; color: var(--text-secondary); font-size: .64rem; line-height: 1.4; }
.legacy-validation-group .validation-issue-list li[data-tone="error"] { color: #b33b3b; }
.legacy-validation-group .validation-issue-list li[data-tone="warning"] { color: #8a641a; }
.legacy-validation-group .validation-issue-list small { display: block; color: var(--text-muted); }
.legacy-validation-clean { margin-top: .65rem; color: #14805a; font-size: .68rem; font-weight: 800; }

.validation-summary-alert[data-tone="error"] .validation-issue-list,
.validation-summary-note[data-tone="warning"] .validation-issue-list { max-height: 14rem; overflow: auto; }

.standardizer-change-list {
  margin-top: 0.8rem;
}

.standardizer-summary ul {
  margin-top: 0.55rem;
  display: grid;
  gap: 0.3rem;
}

.standardizer-summary li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.3rem;
}

.output-mode-option,
.network-type-option {
  position: relative;
  display: flex;
  min-height: 2.85rem;
  cursor: pointer;
  align-items: center;
  justify-content: flex-start;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card-2);
  padding: 0.7rem 0.8rem 0.7rem 2.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease), color 160ms var(--ease);
}

.output-mode-option:hover,
.network-type-option:hover {
  border-color: var(--border-strong);
  background: var(--bg-card);
  color: var(--text-primary);
}

.output-mode-option > span::before,
.network-type-option > span::before {
  content: "";
  position: absolute;
  left: 0.78rem;
  top: 50%;
  width: 1rem;
  height: 1rem;
  transform: translateY(-50%);
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  background: var(--bg-input);
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}

.network-type-option {
  padding-left: 0.8rem;
}

.network-type-option > span {
  display: flex;
  min-width: 0;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.network-type-option > span::before {
  display: none;
}

.network-type-option strong {
  font-size: 0.88rem;
  color: inherit;
}

.network-type-option small {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.output-mode-option:has(.output-mode-input:checked),
.network-type-option:has(.network-type-input:checked),
.network-type-option:has(.scope-type-input:checked) {
  border-color: rgba(52, 211, 153, 0.55);
  background: var(--brand-soft);
  color: var(--text-primary);
}

.output-mode-option:has(.output-mode-input:checked) > span::before {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow:
    inset 0 0 0 2px var(--bg-input),
    inset 0 0 0 5px var(--brand);
}

.network-type-option:has(.network-type-input:checked) small,
.network-type-option:has(.scope-type-input:checked) small {
  color: var(--brand);
}

.network-type-option:not(:has(.network-type-input:checked)):not(:has(.scope-type-input:checked)) {
  border-color: var(--border-strong);
  background: var(--bg-card);
  color: var(--text-primary);
}

.network-type-option:not(:has(.network-type-input:checked)):not(:has(.scope-type-input:checked)):hover {
  border-color: var(--info);
  background: var(--bg-card-2);
}

.boundary-toggle {
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card-2);
  padding: 0.85rem 0.95rem;
  color: var(--text-primary);
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}

.boundary-toggle:hover {
  border-color: var(--border-strong);
}

.boundary-toggle input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--brand);
}

.validation-summary-card {
  border: 1px solid rgba(93, 187, 154, 0.28);
  border-radius: var(--r-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 250, 246, 0.88));
  overflow: hidden;
  padding: 0;
  box-shadow: var(--shadow-sm);
}

.validation-summary-details {
  padding: 0.85rem 0.95rem;
}

.validation-summary-details > summary {
  cursor: pointer;
  list-style: none;
}

.validation-summary-details > summary::-webkit-details-marker,
.validation-summary-details > summary::marker {
  display: none;
  content: "";
}

.validation-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.validation-summary-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.45rem;
}

.validation-summary-chevron {
  display: inline-flex;
  width: 1.65rem;
  height: 1.65rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: transform 160ms var(--ease), border-color 160ms var(--ease), background-color 160ms var(--ease);
}

.validation-summary-chevron svg {
  width: 0.95rem;
  height: 0.95rem;
}

.validation-summary-details[open] .validation-summary-chevron {
  transform: rotate(180deg);
}

.validation-summary-details > summary:hover .validation-summary-chevron {
  border-color: var(--border-strong);
  background: var(--brand-soft-2);
  color: var(--brand-strong);
}

.validation-summary-head strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 800;
}

.validation-summary-head small {
  display: block;
  margin-top: 0.18rem;
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
}

.validation-summary-preview {
  margin-top: 0.55rem;
  color: var(--text-secondary);
  font-size: 0.73rem;
  font-weight: 600;
  line-height: 1.45;
}

.validation-summary-content {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.validation-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.validation-summary-grid div {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: #FFFFFF;
  padding: 0.48rem 0.58rem;
}

.validation-summary-grid span {
  display: block;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.validation-summary-grid strong {
  display: block;
  min-width: 0;
  margin-top: 0.2rem;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.validation-summary-alert,
.validation-summary-note {
  display: grid;
  gap: 0.28rem;
  border-radius: var(--r-md);
  padding: 0.65rem 0.75rem;
  font-size: 0.76rem;
  line-height: 1.45;
}

.validation-summary-alert {
  border: 1px solid rgba(242, 185, 75, 0.34);
  background: var(--warning-soft);
  color: #8A641A;
}

.validation-summary-alert[data-tone="error"] {
  border-color: rgba(226, 109, 109, 0.38);
  background: var(--danger-soft);
  color: var(--danger);
}

.validation-summary-note {
  border: 1px solid rgba(79, 159, 200, 0.24);
  background: var(--info-soft);
  color: var(--text-secondary);
}

.validation-summary-alert p,
.validation-summary-note p {
  margin: 0;
}

/* Sticky convert action */
.sticky-action-bar {
  position: sticky;
  bottom: 1rem;
  z-index: 30;
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
  padding: 0.6rem;
  border-radius: var(--r-lg);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}

.generate-button-reason {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.45;
  text-align: center;
}

.generate-button-reason[data-tone="ready"] {
  color: var(--brand-strong);
}

.generate-button-reason[data-tone="warning"] {
  color: #f6d58b;
}

/* =========================================================================
   Folder panel (KML/KMZ)
   ========================================================================= */
.folder-panel {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  overflow: hidden;
}

.folder-panel-details[open] .folder-panel-summary {
  border-bottom: 1px solid var(--border);
}

.folder-panel-summary {
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  list-style: none;
  padding: 0.95rem 1rem;
  transition: background-color 160ms var(--ease);
}

.folder-panel-summary:hover {
  background: var(--bg-card-2);
}

.folder-panel-summary::-webkit-details-marker,
.folder-panel-summary::marker {
  display: none;
  content: "";
}

.folder-panel-title,
.folder-panel-subtitle {
  display: block;
}

.folder-panel-title {
  color: var(--text-primary);
  font-size: 0.86rem;
  font-weight: 700;
}

.folder-panel-subtitle {
  margin-top: 0.22rem;
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 500;
}

.folder-panel-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 500;
}

.folder-panel-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-card-2);
  padding: 0.22rem 0.5rem;
}

.folder-panel-metrics strong {
  color: var(--text-primary);
  font-weight: 700;
}

.folder-panel-body {
  padding: 0.9rem 1rem 1rem;
}

.folder-filter-chips {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.1rem;
}

.folder-filter-chip {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-card-2);
  padding: 0.34rem 0.7rem;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  transition: all 160ms var(--ease);
}

.folder-filter-chip:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.folder-filter-chip.active {
  border-color: rgba(56, 189, 248, 0.4);
  background: var(--info-soft);
  color: var(--info);
}

.kml-folder-list {
  display: grid;
  max-height: 320px;
  gap: 0.45rem;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.kml-folder-group,
.kml-folder-row {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card-2);
}

.kml-folder-group[open] {
  border-color: rgba(56, 189, 248, 0.28);
  background: var(--bg-card);
}

.kml-folder-group-summary,
.kml-folder-row {
  display: flex;
  min-height: 2.55rem;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.78rem;
  color: var(--text-primary);
  transition: background-color 160ms var(--ease);
}

.kml-folder-group-summary {
  list-style: none;
}

.kml-folder-group-summary::-webkit-details-marker {
  display: none;
}

.kml-folder-group-summary:hover,
.kml-folder-row:hover {
  background: rgba(56, 189, 248, 0.05);
}

.kml-folder-row[data-empty="true"] {
  color: var(--text-muted);
  background: var(--bg-card);
}

.kml-folder-row input:disabled {
  opacity: 0.45;
}

.kml-folder-caret {
  display: inline-flex;
  width: 0.85rem;
  justify-content: center;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  transition: transform 160ms var(--ease), color 160ms var(--ease);
}

.kml-folder-group[open] .kml-folder-caret {
  color: var(--info);
  transform: rotate(90deg);
}

.kml-folder-children {
  display: grid;
  gap: 0.4rem;
  padding: 0 0.6rem 0.6rem 1.95rem;
}

.kml-folder-children .kml-folder-row {
  min-height: 2.25rem;
  border-radius: var(--r-sm);
  background: var(--bg-card);
  padding: 0.42rem 0.65rem;
}

.folder-warning-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(251, 191, 36, 0.32);
  border-radius: var(--r-pill);
  background: var(--warning-soft);
  padding: 0.14rem 0.46rem;
  color: var(--warning);
  font-size: 0.65rem;
  font-weight: 700;
}

.folder-warning-badge[data-tone="ok"] {
  border-color: rgba(52, 211, 153, 0.34);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.folder-warning-badge[data-tone="info"] {
  border-color: rgba(56, 189, 248, 0.32);
  background: var(--info-soft);
  color: var(--info);
}

/* =========================================================================
   Result / download card
   ========================================================================= */
.result-card {
  position: relative;
  margin-bottom: 1rem;
  border: 1px solid rgba(251, 191, 36, 0.34);
  border-radius: var(--r-md);
  background:
    linear-gradient(135deg, rgba(251, 191, 36, 0.10), rgba(52, 211, 153, 0.06)),
    var(--bg-card);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.result-card-dismiss {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: inline-flex;
  width: 1.55rem;
  height: 1.55rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(95, 122, 112, 0.18);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-secondary);
  line-height: 1;
  transition: all 160ms var(--ease);
}

.result-card-dismiss:hover {
  border-color: var(--border-strong);
  background: var(--bg-card);
  color: var(--text-primary);
}

.output-file-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.output-file-row .ui-input {
  min-width: 0;
  flex: 1 1 auto;
}

/* =========================================================================
   Progress bar
   ========================================================================= */
.progress-heading-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
}

.progress-track {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--bg-card-2);
  overflow: hidden;
}

#progressBar {
  background: linear-gradient(90deg, var(--brand), var(--info));
  border-radius: var(--r-pill);
}

/* =========================================================================
   Dashboard sections
   ========================================================================= */
.dashboard-empty-state {
  margin-bottom: 0.9rem;
  padding: 1.1rem;
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.55;
  text-align: left;
}

.dashboard-empty-state > strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 800;
}

.dashboard-empty-state > p {
  margin-top: 0.35rem;
  color: var(--text-secondary);
}

.empty-step-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.9rem;
  counter-reset: empty-step;
}

.empty-step-list li {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--brand-soft-2);
  padding: 0.42rem 0.5rem;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 700;
}

.empty-step-list li::before {
  counter-increment: empty-step;
  content: counter(empty-step);
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  background: var(--brand);
  color: #FFFFFF;
  font-size: 0.6rem;
  font-weight: 800;
}

.dashboard-sections {
  display: grid;
  gap: 0.85rem;
}

.dashboard-section {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-panel-2);
  padding: 0.95rem 1rem;
}

.dashboard-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.dashboard-section-header h3 {
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.005em;
}

/* Output Status — per-row icon + pill */
.output-status-panel {
  padding: 0;
  overflow: hidden;
}

.output-status-details {
  display: block;
}

.output-status-summary {
  cursor: pointer;
  flex-wrap: wrap;
  margin-bottom: 0;
  padding: 0.95rem 1rem;
  list-style: none;
  user-select: none;
}

.output-status-summary::-webkit-details-marker {
  display: none;
}

.output-status-details[open] .output-status-summary {
  border-bottom: 1px solid var(--border);
}

.output-status-summary-title {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.18rem;
}

.output-status-summary-title small {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
}

.output-status-summary-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.5rem;
}

.output-status-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 0.26rem 0.62rem;
  background: var(--bg-card-2);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.output-status-summary-pill::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: var(--r-pill);
  background: currentColor;
}

.output-status-summary-pill[data-tone="ready"] {
  border-color: rgba(52, 211, 153, 0.36);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.output-status-summary-pill[data-tone="waiting"] {
  border-color: rgba(251, 191, 36, 0.34);
  background: var(--warning-soft);
  color: var(--warning);
}

.output-status-chevron {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition:
    transform 160ms var(--ease),
    border-color 160ms var(--ease),
    color 160ms var(--ease);
}

.output-status-chevron svg {
  width: 1rem;
  height: 1rem;
}

.output-status-summary:hover .output-status-chevron {
  border-color: var(--border-strong);
  color: var(--brand-strong);
}

.output-status-details[open] .output-status-chevron {
  transform: rotate(180deg);
}

.output-status-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  padding: 0.85rem 1rem 1rem;
}

.output-status-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  padding: 0.55rem 0.72rem;
  color: var(--text-primary);
  font-size: 0.8rem;
  transition: border-color 160ms var(--ease);
}

.output-status-row:hover {
  border-color: var(--border-strong);
}

.output-status-row .out-icon {
  display: inline-flex;
  width: 1.85rem;
  height: 1.85rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-card-2);
  color: var(--text-secondary);
}

.output-status-row .out-icon svg {
  width: 0.95rem;
  height: 0.95rem;
}

.output-status-row .out-label {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.output-status-row .out-label strong {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.output-status-row .out-label span {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.output-status-row .out-state {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 0.22rem 0.6rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-card-2);
}

.output-status-row .out-state::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: var(--r-pill);
  background: currentColor;
}

.output-status-row[data-state="ready"] .out-icon {
  background: var(--brand-soft);
  border-color: rgba(52, 211, 153, 0.36);
  color: var(--brand-strong);
}

.output-status-row[data-state="ready"] .out-state {
  border-color: rgba(52, 211, 153, 0.36);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.issue-center-header[data-tone="ok"] strong,
.output-status-row[data-state="ready"] .out-icon,
.output-status-row[data-state="ready"] .out-state {
  color: var(--brand-strong);
}

.output-status-row[data-state="waiting"] .out-icon {
  background: var(--warning-soft);
  border-color: rgba(251, 191, 36, 0.34);
  color: var(--warning);
}

.output-status-row[data-state="waiting"] .out-state {
  border-color: rgba(251, 191, 36, 0.34);
  background: var(--warning-soft);
  color: var(--warning);
}

.output-status-row[data-state="neutral"] {
  opacity: 0.72;
}

.output-status-row[data-state="neutral"] .out-state {
  border-color: var(--border);
  background: var(--bg-card-2);
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .output-status-summary {
    align-items: flex-start;
  }

  .output-status-summary-actions {
    width: 100%;
    justify-content: space-between;
  }

  .output-status-row {
    align-items: flex-start;
  }

  .output-status-row .out-state {
    margin-left: auto;
  }
}

/* Global glassmorphism button pass: keep every app action in one visual system. */
:where(button, .button, .btn, .primary-button, .secondary-button, .download-primary, .console-action-button, .icon-button, .link-button, .folder-filter-chip, .preview-tab, .map-legend-toggle, .map-lock-toggle, .modal-close, .result-card-dismiss, .gdr-tab, .add-mat-btn, .remove-btn, .copy-btn, .fdt-page-button, .sheet-tab, .view-filter-tab, .cx-rm) {
  border: 1px solid rgba(186, 230, 253, 0.72) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(240, 253, 250, 0.50)) !important;
  color: #047857 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82), 0 10px 28px rgba(14,165,233,0.10) !important;
  backdrop-filter: blur(16px) saturate(135%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(135%) !important;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, color 160ms ease !important;
}

:where(button, .button, .btn, .primary-button, .secondary-button, .download-primary, .console-action-button, .icon-button, .link-button, .folder-filter-chip, .preview-tab, .map-legend-toggle, .map-lock-toggle, .modal-close, .result-card-dismiss, .gdr-tab, .add-mat-btn, .remove-btn, .copy-btn, .fdt-page-button, .sheet-tab, .view-filter-tab, .cx-rm):hover:not(:disabled) {
  transform: translateY(-1px) !important;
  border-color: rgba(52, 211, 153, 0.78) !important;
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.86), rgba(224, 242, 254, 0.58)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 14px 34px rgba(16,185,129,0.16) !important;
}

:where(button, .button, .btn, .primary-button, .secondary-button, .download-primary, .console-action-button, .icon-button, .link-button, .folder-filter-chip, .preview-tab, .map-legend-toggle, .map-lock-toggle, .modal-close, .result-card-dismiss, .gdr-tab, .add-mat-btn, .remove-btn, .copy-btn, .fdt-page-button, .sheet-tab, .view-filter-tab, .cx-rm):active:not(:disabled) {
  transform: translateY(0) scale(0.99) !important;
}

:where(.primary-button, .download-primary, .btn-primary, .button.primary, .add-mat-btn) {
  border-color: rgba(52, 211, 153, 0.62) !important;
  background: linear-gradient(180deg, rgba(62,207,142,0.88), rgba(36,180,126,0.82)) !important;
  color: #ffffff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.44), 0 16px 34px rgba(36,180,126,0.24) !important;
}

:where(.primary-button, .download-primary, .btn-primary, .button.primary, .add-mat-btn):hover:not(:disabled) {
  border-color: rgba(110, 231, 183, 0.86) !important;
  background: linear-gradient(180deg, rgba(74,222,128,0.94), rgba(16,185,129,0.88)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), 0 20px 42px rgba(16,185,129,0.30) !important;
}

:where(.cancel-job-button, .remove-btn, .cx-rm, [class*="danger"], [class*="delete"]):not(:disabled) {
  border-color: rgba(254, 202, 202, 0.78) !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.76), rgba(254,242,242,0.62)) !important;
  color: #dc2626 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.86), 0 10px 28px rgba(248,113,113,0.12) !important;
}

:where(.output-mode-option, .network-type-option):has(input:checked),
:where(.folder-filter-chip.active, .preview-tab.active, .gdr-tab.active, .sheet-tab.active, .view-filter-tab.active, .fdt-page-button.active) {
  border-color: rgba(52, 211, 153, 0.76) !important;
  background: linear-gradient(180deg, rgba(209,250,229,0.80), rgba(240,253,250,0.64)) !important;
  color: #047857 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.88), 0 14px 34px rgba(16,185,129,0.14) !important;
}

:where(button, .button, .btn, .primary-button, .secondary-button, .download-primary, .console-action-button, .icon-button):disabled,
:where(.output-mode-option.is-disabled, .output-mode-option[data-output-disabled="true"]) {
  border-color: rgba(203, 213, 225, 0.70) !important;
  background: rgba(248, 250, 252, 0.58) !important;
  color: rgba(100, 116, 139, 0.72) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72) !important;
  transform: none !important;
}

#astriIntegrationPanel[data-astri-mode="cluster"] {
  border-color: rgba(165, 180, 252, 0.78) !important;
  box-shadow: 0 18px 60px rgba(99, 102, 241, 0.14), inset 0 1px 0 rgba(255,255,255,0.75) !important;
}

#astriIntegrationPanel[data-astri-mode="subfeeder"] {
  border-color: rgba(110, 231, 183, 0.78) !important;
  box-shadow: 0 18px 60px rgba(16, 185, 129, 0.14), inset 0 1px 0 rgba(255,255,255,0.75) !important;
}

#astriIntegrationPanel[data-astri-mode="feeder"] {
  border-color: rgba(253, 164, 175, 0.88) !important;
  box-shadow: 0 18px 60px rgba(244, 63, 94, 0.16), inset 0 1px 0 rgba(255,255,255,0.75) !important;
}

#astriIntegrationPanel[data-astri-mode="cluster"] :where(#astriMatchButton, #astriApdConvertButton, #astriUploadButton, #astriVerifyButton, #astriUnverifyButton, #astriDownloadLatestButton, #astriScheduleButton, #astriAddBoqButton, #astriOpenLink):not(:disabled) {
  border-color: rgba(165, 180, 252, 0.78) !important;
  background: linear-gradient(180deg, rgba(238, 242, 255, 0.86), rgba(224, 231, 255, 0.64)) !important;
  color: #3730a3 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.86), 0 12px 30px rgba(99,102,241,0.14) !important;
}

#astriIntegrationPanel[data-astri-mode="subfeeder"] :where(#astriMatchButton, #astriApdConvertButton, #astriUploadButton, #astriVerifyButton, #astriUnverifyButton, #astriDownloadLatestButton, #astriScheduleButton, #astriAddBoqButton, #astriOpenLink):not(:disabled) {
  border-color: rgba(110, 231, 183, 0.78) !important;
  background: linear-gradient(180deg, rgba(209, 250, 229, 0.86), rgba(236, 253, 245, 0.64)) !important;
  color: #047857 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.86), 0 12px 30px rgba(16,185,129,0.14) !important;
}

#astriIntegrationPanel[data-astri-mode="cluster"] #astriTargetTypeSelect {
  border-color: rgba(129, 140, 248, 0.85) !important;
  color: #3730a3 !important;
}

#astriIntegrationPanel[data-astri-mode="subfeeder"] #astriTargetTypeSelect {
  border-color: rgba(52, 211, 153, 0.85) !important;
  color: #047857 !important;
}

/* Summary tiles */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

@media (min-width: 900px) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.dashboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.dashboard-metric,
.summary-tile,
.map-stat,
.warning-summary-grid article,
.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  padding: 0.75rem 0.85rem;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}

.dashboard-metric:hover,
.summary-tile:hover,
.map-stat:hover,
.stat-card:hover {
  border-color: var(--border-strong);
}

.dashboard-metric span,
.summary-tile span,
.map-stat span,
.warning-summary-grid span,
.stat-card span {
  display: block;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dashboard-metric strong,
.summary-tile strong,
.map-stat strong,
.warning-summary-grid strong,
.stat-card strong {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  font-feature-settings: "tnum";
}

.summary-meta strong {
  font-size: 0.85rem;
  font-weight: 700;
}

.dashboard-metric[data-tone="warning"] strong { color: var(--warning); }
.dashboard-metric[data-tone="error"] strong { color: var(--danger); }
.dashboard-metric[data-tone="ok"] strong { color: var(--brand-strong); }

/* Template pill (BOQ/HPDB ready/missing) */
.template-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-card-2);
  padding: 0.24rem 0.6rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
}

.template-status-pill::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: var(--r-pill);
  background: currentColor;
}

.template-status-pill.template-ready {
  border-color: rgba(52, 211, 153, 0.34);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.template-status-pill.template-missing {
  border-color: rgba(248, 113, 113, 0.4);
  background: var(--danger-soft);
  color: var(--danger);
}

/* Issue Center */
.issue-center {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  overflow: hidden;
}

.issue-center-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--bg-card-2);
}

.issue-center-header[data-tone="ok"] strong { color: var(--brand-strong); }
.issue-center-header[data-tone="warning"] strong { color: var(--warning); }
.issue-center-header[data-tone="error"] strong { color: var(--danger); }

.issue-center-body {
  display: grid;
}

.issue-center-hero {
  display: grid;
  gap: 0.35rem;
  margin: 0.8rem 0.8rem 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card-2);
  padding: 0.9rem;
}

.issue-center-hero span,
.issue-center-grid span {
  display: block;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.issue-center-hero strong {
  display: block;
  color: var(--text-primary);
  font-size: 1.6rem;
  line-height: 1;
  font-weight: 800;
  font-feature-settings: "tnum";
}

.issue-center-hero[data-tone="ok"] strong { color: var(--brand-strong); }
.issue-center-hero[data-tone="warning"] strong { color: var(--warning); }
.issue-center-hero[data-tone="error"] strong { color: var(--danger); }

.issue-center-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 0.8rem;
}

@media (min-width: 900px) {
  .issue-center-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.issue-center-grid div {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-card-2);
  padding: 0.55rem 0.65rem;
  min-width: 0;
}

.issue-center-grid strong {
  display: block;
  margin-top: 0.18rem;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 700;
}

.issue-empty {
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.84rem;
  text-align: center;
}

.summary-empty {
  grid-column: 1 / -1;
  padding: 0.85rem;
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.82rem;
  text-align: center;
}

/* =========================================================================
   Preview tabs
   ========================================================================= */
.preview-tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.preview-tab {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-card);
  padding: 0.5rem 0.9rem;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  transition: all 160ms var(--ease);
}

.preview-tab:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.preview-tab.active {
  border-color: rgba(56, 189, 248, 0.4);
  background: var(--info-soft);
  color: var(--info);
}

.preview-sub-tabs {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.65rem;
  overflow-x: auto;
}

.preview-sub-tabs.hidden {
  display: none;
}

.preview-sub-tab {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  padding: 0.42rem 0.78rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 160ms var(--ease);
}

.preview-sub-tab:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.preview-sub-tab.active {
  border-color: rgba(56, 189, 248, 0.4);
  background: var(--info-soft);
  color: var(--info);
}

/* =========================================================================
   Map
   ========================================================================= */
.map-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.map-lock-shell {
  position: relative;
}

#map {
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.leaflet-container {
  background: var(--bg-card-2);
  font-family: inherit;
}

.leaflet-control-attribution,
.leaflet-control-zoom a {
  background: rgba(255, 255, 255, 0.94) !important;
  color: var(--text-secondary) !important;
  border-color: var(--border) !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--bg-card-2);
  color: var(--text-primary);
}

.map-lock-toggle {
  position: absolute;
  right: 0.75rem;
  top: 0.75rem;
  z-index: 620;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.15rem;
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.94);
  padding: 0 0.85rem;
  color: var(--warning);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(6px);
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease), color 160ms var(--ease);
}

.map-lock-toggle:hover {
  border-color: rgba(252, 211, 77, 0.8);
  color: #FCD34D;
}

.map-lock-toggle[data-locked="false"] {
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(6, 78, 59, 0.85);
  color: var(--brand-strong);
}

.map-legend {
  position: absolute;
  right: 0.75rem;
  bottom: 1.9rem;
  z-index: 620;
  width: min(15rem, calc(100% - 1.5rem));
  color: var(--text-primary);
}

.map-legend-toggle {
  display: inline-flex;
  min-height: 2.15rem;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.94);
  padding: 0 0.75rem;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
}

.map-legend-toggle:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.map-legend-toggle svg {
  width: 0.95rem;
  height: 0.95rem;
}

.map-legend-toggle span {
  min-width: 1.15rem;
  border-radius: var(--r-pill);
  background: var(--bg-card-2);
  padding: 0.05rem 0.35rem;
  text-align: center;
  color: var(--text-primary);
  font-size: 0.68rem;
}

.map-legend-body {
  margin-top: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.map-legend-body ul {
  display: grid;
  max-height: 12rem;
  overflow-y: auto;
}

.map-legend-row label {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.map-legend-row:last-child label {
  border-bottom: 0;
}

.map-legend-row input {
  width: 0.9rem;
  height: 0.9rem;
}

.map-legend-swatch {
  width: 0.68rem;
  height: 0.68rem;
  border-radius: var(--r-pill);
  box-shadow: 0 0 0 1px rgba(24, 51, 43, 0.12);
}

.map-legend-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-legend-row strong {
  color: var(--text-primary);
  font-size: 0.7rem;
  font-weight: 700;
  font-feature-settings: "tnum";
}

.map-lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 610;
  display: grid;
  place-items: center;
  padding-bottom: 3rem;
  border-radius: var(--r-md);
  background: rgba(247, 251, 249, 0.58);
  backdrop-filter: blur(2px);
  color: var(--text-primary);
  text-align: center;
  cursor: pointer;
}

.map-lock-overlay span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: var(--r-md);
  background: #FFFFFF;
  padding: 0.55rem 0.95rem;
  color: var(--warning);
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

.map-lock-overlay small {
  display: block;
  margin-top: 0.55rem;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 500;
}

.map-lock-overlay.hidden {
  display: none;
}

.map-lock-shell:has(.map-lock-overlay:not(.hidden)) .leaflet-tile {
  filter: brightness(0.85) saturate(0.9);
}

/* =========================================================================
   Tables (BOQ / HPDB)
   ========================================================================= */
.boq-table-shell {
  max-height: 430px;
  overflow: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
}

.boq-nro-table-shell {
  max-height: 390px;
}

.boq-preview-table {
  min-width: 1080px;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.74rem;
}

.boq-nro-preview-table { min-width: 780px; }
.hpdb-preview-table { min-width: 980px; }
.hpdb-table-shell { max-height: 430px; }

.boq-preview-table th,
.boq-preview-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.62rem 0.78rem;
  text-align: left;
  vertical-align: top;
}

.boq-preview-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-card-2);
  color: var(--text-secondary);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-strong);
}

.boq-preview-table td {
  color: var(--text-primary);
}

.boq-preview-table tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.012);
}

.boq-preview-table tbody tr:hover td {
  background: rgba(56, 189, 248, 0.06);
}

.boq-reason-cell {
  min-width: 16rem;
  color: var(--text-secondary) !important;
}

.boq-empty-cell {
  height: 6rem;
  text-align: center !important;
  vertical-align: middle !important;
  color: var(--text-muted) !important;
}

.empty-state {
  display: flex;
  min-height: 5.5rem;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  font-size: 0.84rem;
  color: var(--text-secondary);
}

/* Status pill — used in BOQ rows & warnings */
.boq-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  padding: 0.18rem 0.5rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.boq-status-pill[data-status="Mapped"] {
  border-color: rgba(52, 211, 153, 0.36);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.boq-status-pill[data-status="Warning"],
.boq-status-pill[data-status="Unmapped"],
.boq-status-pill[data-status="Skipped"] {
  border-color: rgba(251, 191, 36, 0.36);
  background: var(--warning-soft);
  color: var(--warning);
}

.boq-status-pill[data-status="Info"] {
  border-color: rgba(56, 189, 248, 0.36);
  background: var(--info-soft);
  color: var(--info);
}

.boq-status-pill[data-status="Error"] {
  border-color: rgba(248, 113, 113, 0.4);
  background: var(--danger-soft);
  color: var(--danger);
}

/* =========================================================================
   Stats grid (DXF tab)
   ========================================================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (min-width: 768px) {
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* =========================================================================
   Warnings panels
   ========================================================================= */
.warning-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.warning-action-note {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  align-items: center;
  margin-top: 0.7rem;
  border: 1px solid rgba(242, 185, 75, 0.28);
  border-radius: var(--r-md);
  background: rgba(242, 185, 75, 0.08);
  padding: 0.72rem 0.85rem;
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.45;
}

.warning-action-note strong {
  color: #f6d58b;
  font-weight: 750;
}

.warning-group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.7rem;
}

.warning-group-grid > div {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  padding: 0.85rem;
}

.warning-group-grid h4 {
  margin-bottom: 0.55rem;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 700;
}

.warning-group-grid p {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  padding: 0.42rem 0;
  color: var(--text-secondary);
  font-size: 0.74rem;
}

.warning-group-grid p:first-of-type {
  border-top: 0;
}

.warning-group-grid p strong {
  color: var(--text-primary);
  font-weight: 600;
}

.warning-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  padding: 0.85rem;
}

.warning-row strong {
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 600;
}

.warning-row p {
  margin-top: 0.35rem;
  color: var(--warning);
  font-size: 0.76rem;
  line-height: 1.45;
}

.warning-row small,
.warning-row > span {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
}

.warning-list {
  display: grid;
  gap: 0.55rem;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

/* =========================================================================
   Console / log
   ========================================================================= */
#consolePanel {
  background: var(--bg-panel);
}

.console-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.console-header-main {
  min-width: 0;
}

.console-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.console-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.console-live,
.console-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border-radius: var(--r-pill);
  border: 1px solid rgba(56, 189, 248, 0.3);
  background: var(--info-soft);
  padding: 0.16rem 0.52rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--info);
}

.console-live {
  position: relative;
  padding-left: 1rem;
}

.console-live::before {
  content: "";
  position: absolute;
  left: 0.42rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.4rem;
  height: 0.4rem;
  border-radius: var(--r-pill);
  background: var(--info);
  box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.6);
  animation: console-live-pulse 1.4s ease-out infinite;
}

@keyframes console-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(56, 189, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

.console-live.hidden {
  display: none;
}

.console-meta-badge[data-tone="warning"] {
  border-color: rgba(251, 191, 36, 0.32);
  background: var(--warning-soft);
  color: var(--warning);
}

.console-meta-badge[data-tone="error"] {
  border-color: rgba(248, 113, 113, 0.36);
  background: var(--danger-soft);
  color: var(--danger);
}

.console-log-shell {
  height: 200px;
  overflow-y: auto;
  scroll-behavior: smooth;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: #F8FCFA;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition: height 220ms var(--ease);
}

.console-log-shell.collapsed {
  height: 76px;
}

.console-log-body {
  min-height: 100%;
  padding: 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.5;
}

.console-log-empty {
  display: flex;
  min-height: 100%;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-style: italic;
}

.console-log-entry {
  display: grid;
  grid-template-columns: 4.6rem 4.9rem 1.45rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: start;
  padding: 0.16rem 0.1rem;
  color: var(--text-secondary);
}

.console-log-entry-new {
  animation: console-log-fade-in 280ms ease-out both;
}

.console-log-time {
  color: var(--text-muted);
}

.console-log-severity {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.console-log-icon {
  display: inline-flex;
  width: 1.1rem;
  min-width: 1.1rem;
  height: 1.1rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  font-size: 0.55rem;
  font-weight: 800;
  line-height: 1;
}

.console-log-message {
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text-primary);
}

.console-log-entry[data-severity="INFO"] .console-log-severity,
.console-log-entry[data-severity="INFO"] .console-log-message {
  color: var(--info);
}
.console-log-entry[data-severity="INFO"] .console-log-icon {
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: var(--info-soft);
  color: var(--info);
}

.console-log-entry[data-severity="SUCCESS"] .console-log-severity,
.console-log-entry[data-severity="SUCCESS"] .console-log-message {
  color: var(--brand-strong);
}
.console-log-entry[data-severity="SUCCESS"] .console-log-icon {
  border: 1px solid rgba(52, 211, 153, 0.4);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.console-log-entry[data-severity="WARNING"] .console-log-severity,
.console-log-entry[data-severity="WARNING"] .console-log-message {
  color: var(--warning);
}
.console-log-entry[data-severity="WARNING"] .console-log-icon {
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: var(--warning-soft);
  color: var(--warning);
}

.console-log-entry[data-severity="ERROR"] .console-log-severity,
.console-log-entry[data-severity="ERROR"] .console-log-message {
  color: var(--danger);
}
.console-log-entry[data-severity="ERROR"] .console-log-icon {
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: var(--danger-soft);
  color: var(--danger);
}

@keyframes console-log-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   Misc helpers
   ========================================================================= */
.app-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card-2);
  padding: 0.42rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.right-workspace {
  scrollbar-gutter: stable;
}

/* =========================================================================
   EVA light-theme polish
   ========================================================================= */
.app-shell .text-white,
.app-shell .text-zinc-100,
.app-shell .text-zinc-200 {
  color: var(--text-primary) !important;
}

.app-shell .text-zinc-300,
.app-shell .text-zinc-400 {
  color: var(--text-secondary) !important;
}

.app-shell .text-zinc-500,
.app-shell .text-zinc-600 {
  color: var(--text-muted) !important;
}

.app-shell .text-emerald-200,
.app-shell .text-emerald-300,
.app-shell .text-cyan-200 {
  color: var(--brand-strong) !important;
}

.app-shell .text-amber-100 {
  color: #8A641A !important;
}

.brand-mark {
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}

.brand-logo {
  display: block;
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
}

.brand-heading {
  color: var(--brand-strong) !important;
  line-height: 1.15;
}

.brand-title-row {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
}

.brand-subtitle {
  color: var(--brand-strong) !important;
}

.brand-description {
  max-width: 44rem;
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  min-width: 0;
}

.supported-files-menu {
  position: relative;
  flex: 0 0 auto;
}

.supported-files-trigger {
  position: relative;
  display: inline-flex;
  min-height: 2.25rem;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.72);
  padding: 0.46rem 0.78rem;
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 700;
  list-style: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease), color 160ms var(--ease);
}

.supported-files-trigger::-webkit-details-marker,
.supported-files-trigger::marker {
  display: none;
  content: "";
}

.supported-files-trigger svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.supported-files-trigger .supported-files-label {
  font-weight: 700;
}

.supported-files-trigger .supported-files-desc {
  display: none;
  font-weight: 400;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-left: 0.15rem;
}

@media (min-width: 768px) {
  .supported-files-trigger .supported-files-desc {
    display: inline;
  }
}

.supported-files-trigger:hover,
.supported-files-menu:hover .supported-files-trigger,
.supported-files-menu[open] .supported-files-trigger {
  border-color: var(--border-strong);
  background: var(--brand-soft-2);
  color: var(--brand-strong);
}

.supported-files-popover {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 70;
  display: grid;
  min-width: 11rem;
  gap: 0.32rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-panel);
  box-shadow: var(--shadow-md);
  padding: 0.55rem;
}

.supported-files-menu:hover .supported-files-popover {
  display: grid;
}

.supported-files-popover span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: var(--r-sm);
  background: var(--brand-soft-2);
  padding: 0.32rem 0.52rem;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
}

.app-chip {
  background: var(--brand-soft-2);
  color: var(--brand-strong);
}

.app-panel {
  box-shadow: var(--shadow-md);
}

.app-panel h2,
.app-panel h3 {
  letter-spacing: -0.01em;
}

.drop-zone {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 250, 246, 0.92));
  border-color: #C8E7DA;
}

.drop-zone:hover,
.drag-active {
  border-color: rgba(93, 187, 154, 0.7) !important;
  background: var(--brand-soft-2) !important;
}

.drop-zone-icon {
  border-color: #CDEBDF;
  background: var(--brand-soft);
  color: var(--brand-strong) !important;
}

#osmFileName,
#kmlFileName {
  border-color: rgba(93, 187, 154, 0.32) !important;
  background: var(--brand-soft) !important;
  color: var(--text-primary) !important;
}

#errorAlert {
  border-color: rgba(226, 109, 109, 0.42) !important;
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
}

.inline-feedback.hidden { display: none; }

.inline-feedback {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.45;
}

.inline-feedback[data-tone="success"] { color: var(--brand-strong); }
.inline-feedback[data-tone="info"] { color: var(--info); }
.inline-feedback[data-tone="warning"] { color: var(--warning); }
.inline-feedback[data-tone="error"] { color: var(--danger); }
.inline-feedback [data-inline-title] { font-weight: 800; }
.inline-feedback [data-inline-message] { flex: 1 1 16rem; white-space: pre-line; }

.folder-filter-chip.active,
.preview-tab.active,
.preview-sub-tab.active {
  border-color: rgba(93, 187, 154, 0.42);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.mode-card,
.folder-panel,
.dashboard-section {
  background: linear-gradient(180deg, #FFFFFF, #FBFEFC);
}

.output-mode-option,
.network-type-option,
.boundary-toggle,
.kml-folder-group,
.kml-folder-row {
  background: #FFFFFF;
}

.output-mode-option:hover,
.network-type-option:hover,
.boundary-toggle:hover,
.kml-folder-group-summary:hover,
.kml-folder-row:hover {
  background: var(--brand-soft-2);
}

.output-mode-option:has(.output-mode-input:checked),
.network-type-option:has(.network-type-input:checked),
.network-type-option:has(.scope-type-input:checked) {
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(93, 187, 154, 0.18);
}

.output-mode-option > span::before,
.network-type-option > span::before {
  background: #FFFFFF;
}

.output-mode-option:has(.output-mode-input:checked) > span::before {
  box-shadow:
    inset 0 0 0 2px #FFFFFF,
    inset 0 0 0 5px var(--brand);
}

.output-mode-option.is-disabled,
.output-mode-option[data-output-disabled="true"] {
  cursor: not-allowed;
  border-color: rgba(95, 122, 112, 0.18);
  background: #F7FBF9;
  color: rgba(95, 122, 112, 0.66);
}

.output-mode-option.is-disabled:hover,
.output-mode-option[data-output-disabled="true"]:hover {
  border-color: rgba(226, 109, 109, 0.34);
  background: rgba(226, 109, 109, 0.08);
  color: var(--danger);
}

.output-mode-option.is-disabled > span,
.output-mode-option[data-output-disabled="true"] > span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.42rem;
}

.output-mode-option.is-disabled small,
.output-mode-option[data-output-disabled="true"] small {
  border-radius: 999px;
  background: rgba(226, 109, 109, 0.12);
  padding: 0.14rem 0.42rem;
  color: var(--danger);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0;
}

.output-mode-option.is-disabled > span::before,
.output-mode-option[data-output-disabled="true"] > span::before {
  border-color: rgba(226, 109, 109, 0.45);
  background: rgba(226, 109, 109, 0.1);
  box-shadow: none;
}

.folder-panel-metrics span,
.status-pill,
#statusBadge,
.template-status-pill,
.standardizer-summary-status,
.console-meta-badge,
.console-live {
  background: #FFFFFF;
}

.result-card {
  border-color: rgba(93, 187, 154, 0.34);
  background:
    linear-gradient(135deg, rgba(223, 247, 236, 0.95), rgba(255, 255, 255, 0.96));
}

.progress-track {
  background: #E6F4EE;
}

#progressBar {
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.output-status-row[data-state="ready"] .out-icon,
.output-status-row[data-state="ready"] .out-state,
.template-status-pill.template-ready {
  border-color: rgba(93, 187, 154, 0.4);
}

.dashboard-metric,
.summary-tile,
.map-stat,
.warning-summary-grid article,
.stat-card,
.issue-center-grid div,
.issue-center-hero {
  background: #FFFFFF;
}

.leaflet-control-attribution,
.leaflet-control-zoom a {
  background: rgba(255, 255, 255, 0.94) !important;
  color: var(--text-secondary) !important;
}

.map-lock-toggle {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-md);
}

.map-lock-toggle[data-locked="false"] {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.map-lock-overlay {
  background: rgba(247, 251, 249, 0.58);
}

.map-lock-overlay span {
  background: #FFFFFF;
}

.boq-table-shell {
  background: #FFFFFF;
}

.boq-preview-table tbody tr:nth-child(odd) td {
  background: #FBFEFC;
}

.boq-preview-table tbody tr:hover td {
  background: var(--brand-soft-2);
}

#consolePanel {
  background: #FFFFFF;
}

.console-log-shell {
  background: #F8FCFA;
  box-shadow: inset 0 1px 0 rgba(93, 187, 154, 0.09);
}

.console-log-entry {
  border-bottom: 1px solid rgba(217, 237, 228, 0.6);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--brand);
}

.hidden {
  display: none !important;
}

/* =========================================================================
   Responsive tweaks
   ========================================================================= */
@media (max-width: 1024px) {
  .header-right {
    justify-content: flex-start;
  }
  .workflow-stepper {
    flex-wrap: wrap;
  }
  .workflow-step {
    flex-basis: calc(50% - 0px);
    min-width: 0;
  }
  .workflow-step:nth-child(even) {
    border-left: 1px solid var(--border);
  }
  .map-stats-grid,
  .warning-summary-grid,
  .warning-group-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .progress-heading-row {
    grid-template-columns: auto auto;
  }
  .stage-progress {
    grid-column: 1 / -1;
  }
  .folder-panel-summary,
  .dashboard-section-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .folder-panel-metrics { justify-content: flex-start; }
  .empty-step-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .validation-summary-grid {
    grid-template-columns: 1fr;
  }
  .summary-grid,
  .dashboard-summary-grid,
  .issue-center-grid {
    grid-template-columns: 1fr;
  }
  .workflow-step {
    flex-basis: 100%;
  }
  .console-header-row {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  main,
  section,
  .app-shell,
  .app-layout,
  .left-workspace,
  .right-workspace,
  .app-panel,
  .mode-card,
  .folder-panel,
  .dashboard-section {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .app-panel,
  .mode-card,
  .drop-zone,
  .network-type-option,
  .output-mode-option {
    overflow: visible;
  }

  .brand-lockup {
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
  }
  .brand-lockup > .min-w-0 {
    flex: 1 1 auto;
  }
  .brand-description {
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .header-right {
    width: 100%;
    max-width: 100%;
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.45rem;
  }
  .header-actions {
    flex: 0 1 auto;
    gap: 0.35rem;
  }
  .supported-files-trigger span {
    display: none;
  }
  .supported-files-trigger {
    width: 2.15rem;
    min-height: 2.15rem;
    justify-content: center;
    padding-inline: 0;
    border-radius: var(--r-md);
  }
  .icon-button {
    width: 2.15rem;
    height: 2.15rem;
  }
  .supported-files-popover {
    right: auto;
    left: 0;
  }
  .empty-step-list {
    grid-template-columns: 1fr;
  }

  .drop-zone,
  .network-type-option,
  .output-mode-option {
    width: 100%;
  }

  .network-type-option > span,
  .output-mode-option > span {
    min-width: 0;
    flex-wrap: wrap;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .network-type-option small {
    margin-left: 0;
  }
  .upload-summary-head,
  .upload-summary-actions {
    align-items: flex-start;
    flex-direction: column;
  }
  .console-actions { width: 100%; }
  .console-action-button { flex: 1 1 auto; }
  .output-file-row { flex-direction: column; }
  .console-log-entry {
    grid-template-columns: 3.8rem 4.1rem 1.2rem minmax(0, 1fr);
    gap: 0.32rem;
  }
  .download-primary { width: 100%; }
  .warning-row { flex-direction: column; }
}


/* =========================================================================
   v2 features — theme toggle, toast, stage progress, tooltips, drawer, modal
   ========================================================================= */

/* Dark mode disabled */

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(217, 237, 228, 0.82);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-secondary);
  transition: all 160ms var(--ease);
}

.icon-button:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--bg-card-2);
}

.icon-button svg { width: 1.05rem; height: 1.05rem; }

/* ---------- Stage progress (sub-stepper inside dashboard) ---------- */
.stage-progress {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  flex-wrap: wrap;
  min-width: 0;
}

.stage-progress-item {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.22rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 200ms var(--ease);
}

.stage-progress-item .stage-dot {
  width: 0.36rem;
  height: 0.36rem;
  border-radius: var(--r-pill);
  background: currentColor;
  opacity: 0.7;
}

.stage-progress-item[data-state="done"] {
  border-color: rgba(93, 187, 154, 0.36);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.stage-progress-item[data-state="active"] {
  border-color: rgba(79, 159, 200, 0.4);
  background: var(--info-soft);
  color: var(--info);
  animation: stage-pulse 1.6s ease-in-out infinite;
}

.stage-progress-item[data-state="error"] {
  border-color: rgba(226, 109, 109, 0.4);
  background: var(--danger-soft);
  color: var(--danger);
}

.stage-progress-item[data-state="pending"] {
  opacity: 0.65;
}

@keyframes stage-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79, 159, 200, 0.32); }
  50% { box-shadow: 0 0 0 4px rgba(79, 159, 200, 0); }
}

/* ---------- Tooltips ---------- */
.tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: help;
  border-bottom: 1px dotted var(--text-muted);
}

.tip-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  background: var(--bg-card-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: help;
  flex: 0 0 auto;
  vertical-align: middle;
  transition: all 160ms var(--ease);
}

.tip-icon:hover,
.tip:hover .tip-icon {
  border-color: var(--info);
  color: var(--info);
  background: var(--info-soft);
}

.icon-button[data-tooltip],
.supported-files-trigger[data-tooltip] {
  position: relative;
}

.tip-icon[data-tooltip]::after,
.tip[data-tooltip]::after,
.icon-button[data-tooltip]::after,
.supported-files-trigger[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 0.45rem);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  white-space: normal;
  width: max-content;
  max-width: 18rem;
  border-radius: var(--r-md);
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  padding: 0.55rem 0.7rem;
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.45;
  text-transform: none;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  z-index: 80;
  transition: opacity 160ms var(--ease), transform 160ms var(--ease);
}

.tip-icon[data-tooltip]:hover::after,
.tip[data-tooltip]:hover::after,
.tip-icon[data-tooltip]:focus::after,
.tip[data-tooltip]:focus-within::after,
.icon-button[data-tooltip]:hover::after,
.supported-files-trigger[data-tooltip]:hover::after,
.icon-button[data-tooltip]:focus-visible::after,
.supported-files-trigger[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tip-icon[data-tooltip-side="right"]::after,
.tip[data-tooltip-side="right"]::after {
  bottom: auto;
  top: 50%;
  left: calc(100% + 0.45rem);
  transform: translateY(-50%) translateX(4px);
}

.tip-icon[data-tooltip-side="right"]:hover::after,
.tip[data-tooltip-side="right"]:hover::after {
  transform: translateY(-50%) translateX(0);
}

.tip-icon[data-tooltip-side="bottom"]::after,
.tip[data-tooltip-side="bottom"]::after,
.icon-button[data-tooltip-side="bottom"]::after,
.supported-files-trigger[data-tooltip-side="bottom"]::after {
  bottom: auto;
  top: calc(100% + 0.45rem);
  transform: translateX(-50%) translateY(-4px);
}

.tip-icon[data-tooltip-side="bottom"]:hover::after,
.tip[data-tooltip-side="bottom"]:hover::after,
.icon-button[data-tooltip-side="bottom"]:hover::after,
.supported-files-trigger[data-tooltip-side="bottom"]:hover::after,
.icon-button[data-tooltip-side="bottom"]:focus-visible::after,
.supported-files-trigger[data-tooltip-side="bottom"]:focus-visible::after {
  transform: translateX(-50%) translateY(0);
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(11, 17, 16, 0.55);
  backdrop-filter: blur(4px);
  padding: 1rem;
  animation: backdrop-in 180ms var(--ease);
}

.modal-backdrop.hidden { display: none; }

.modal-card {
  width: 100%;
  max-width: 36rem;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  animation: modal-in 200ms var(--ease);
}

.modal-card-wide { max-width: 48rem; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
}

.modal-header p {
  margin-top: 0.18rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1;
}

.modal-close:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--bg-card-2);
}

.modal-body {
  display: grid;
  gap: 0.75rem;
  padding: 1.1rem;
}

.modal-body section + section {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.help-panel {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  overflow: hidden;
}

.help-panel summary {
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 1rem;
  color: var(--text-primary);
  font-size: 0.86rem;
  font-weight: 750;
}

.help-panel summary::-webkit-details-marker,
.help-panel summary::marker {
  display: none;
  content: "";
}

.help-panel-body {
  border-top: 1px solid var(--border);
  padding: 0.9rem 1rem 1rem;
}

.modal-body h3 {
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.modal-body p {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.55;
}

.modal-body ul,
.modal-body ol {
  margin-top: 0.4rem;
  padding-left: 1.1rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.6;
}

.modal-body code,
.modal-body kbd {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--bg-card-2);
  border-radius: var(--r-sm);
  padding: 0.1rem 0.42rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--text-primary);
}

.kbd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.42rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.kbd-row:last-child { border-bottom: 0; }

.kbd-row span:first-child {
  color: var(--text-primary);
  font-weight: 500;
}

.kbd-row .kbd-keys {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
}

.folder-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

@media (max-width: 640px) {
  .folder-checklist { grid-template-columns: 1fr; }
}

.folder-checklist span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-card);
  font-size: 0.74rem;
  color: var(--text-primary);
  font-weight: 500;
}

.folder-checklist span::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: var(--r-pill);
  background: var(--brand);
}

.folder-checklist span.optional::before { background: var(--info); }
.folder-checklist span.optional { color: var(--text-secondary); }

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Drawer (recent jobs) ---------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  grid-template-columns: 1fr min(68rem, 94vw);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.drawer.hidden { display: none; }

.drawer-backdrop {
  background: rgba(11, 17, 16, 0.45);
  cursor: pointer;
  animation: backdrop-in 180ms var(--ease);
}

.drawer-panel {
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  animation: drawer-in 220ms var(--ease);
}

@keyframes drawer-in {
  from { transform: translateX(8%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border);
}

.drawer-header h2 {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 700;
}

.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.85rem 1rem 1rem;
}

.drawer-empty {
  text-align: center;
  padding: 1.5rem 0.6rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.history-item {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  padding: 0.75rem 0.85rem;
}

.history-item + .history-item {
  margin-top: 0.55rem;
}

.history-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.4rem;
}

.history-item-title {
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 600;
  word-break: break-word;
}

.history-item-time {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
}

.history-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.history-item-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-card-2);
  padding: 0.18rem 0.48rem;
  color: var(--text-secondary);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.history-item-actions {
  display: flex;
  gap: 0.4rem;
}

/* ---------- Activity monitor ---------- */
.activity-overview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

.activity-stat {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  padding: 0.7rem 0.75rem;
}

.activity-stat span {
  display: block;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.activity-stat strong {
  display: block;
  margin-top: 0.22rem;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 800;
}

.activity-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.activity-search {
  flex: 1 1 18rem;
}

.activity-filter {
  flex: 0 0 9rem;
}

#activityAutoRefreshButton[data-active="true"] {
  border-color: var(--border-strong);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.activity-last-updated {
  margin-bottom: 0.7rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.activity-grid {
  display: grid;
  grid-template-columns: minmax(18rem, 0.9fr) minmax(19rem, 1.1fr);
  gap: 0.8rem;
  align-items: start;
}

.activity-list,
.activity-detail {
  min-width: 0;
}

.activity-list {
  display: grid;
  gap: 0.55rem;
}

.activity-job {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  padding: 0.75rem;
  text-align: left;
  width: 100%;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), transform 160ms var(--ease);
}

.activity-job:hover,
.activity-job.is-selected {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.activity-job:hover {
  transform: translateY(-1px);
}

.activity-job-head,
.activity-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.activity-job-title {
  color: var(--text-primary);
  font-size: 0.83rem;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.activity-job-meta,
.activity-detail-meta,
.activity-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.activity-pill,
.activity-status {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  padding: 0.18rem 0.48rem;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-card-2);
}

.activity-status::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: var(--r-pill);
  background: currentColor;
}

.activity-status[data-status="done"] {
  color: var(--brand-strong);
  border-color: rgba(53, 182, 122, 0.26);
  background: var(--brand-soft);
}

.activity-status[data-status="processing"],
.activity-status[data-status="queued"],
.activity-status[data-status="retrying"] {
  color: #2f7d9e;
  border-color: rgba(79, 159, 200, 0.25);
  background: var(--info-soft);
}

.activity-status[data-status="cancelled"] {
  color: #A16207;
  border-color: rgba(217, 119, 6, 0.25);
  background: rgba(254, 243, 199, 0.68);
}

.activity-status[data-status="error"] {
  color: var(--danger);
  border-color: rgba(226, 109, 109, 0.25);
  background: var(--danger-soft);
}

.activity-progress {
  margin-top: 0.65rem;
  height: 0.42rem;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--neutral-soft);
}

.activity-progress span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.activity-detail {
  position: sticky;
  top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.85rem;
}

.activity-detail h3 {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.35;
  word-break: break-word;
}

.activity-detail p {
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.5;
}

.activity-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.activity-detail-cell {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-card-2);
  padding: 0.55rem;
}

.activity-detail-cell span {
  display: block;
  color: var(--text-muted);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.activity-detail-cell strong {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 700;
  word-break: break-word;
}

.activity-log {
  margin-top: 0.75rem;
  max-height: 15rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: #0f1f1a;
  padding: 0.65rem;
  color: #dff7ec;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
  line-height: 1.55;
}

.activity-log-row {
  display: grid;
  grid-template-columns: 4.6rem 4.8rem minmax(0, 1fr);
  gap: 0.45rem;
}

.activity-log-row + .activity-log-row {
  margin-top: 0.2rem;
}

.activity-log-row[data-severity="ERROR"] { color: #ffd6d6; }
.activity-log-row[data-severity="WARNING"] { color: #ffe5a8; }
.activity-log-row[data-severity="SUCCESS"] { color: #b9f3d8; }

.activity-empty {
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card-2);
  padding: 1.2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.83rem;
}

.activity-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

@media (max-width: 900px) {
  .activity-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activity-grid {
    grid-template-columns: 1fr;
  }

  .activity-detail {
    position: static;
  }
}

@media (max-width: 560px) {
  .activity-overview,
  .activity-detail-grid {
    grid-template-columns: 1fr;
  }

  .activity-filter,
  .activity-toolbar .secondary-button {
    flex: 1 1 auto;
  }
}

/* ---------- Drag-anywhere overlay ---------- */
.drag-shield {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: rgba(11, 17, 16, 0.55);
  backdrop-filter: blur(3px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms var(--ease);
}

.drag-shield.active {
  opacity: 1;
  pointer-events: auto;
}

.drag-shield-card {
  width: 100%;
  max-width: 28rem;
  border: 2px dashed var(--brand);
  background: var(--bg-panel);
  border-radius: var(--r-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.drag-shield-card svg {
  width: 3rem;
  height: 3rem;
  color: var(--brand-strong);
  margin: 0 auto 0.85rem;
  display: block;
}

.drag-shield-card h2 {
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.drag-shield-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
}


/* ---------- Quick stats banner (after upload) ---------- */
.quick-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card-2);
}

.quick-stats-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.quick-stats-item strong {
  color: var(--text-primary);
  font-weight: 700;
  font-feature-settings: "tnum";
}

.quick-stats-item + .quick-stats-item::before {
  content: "—";
  margin-right: 0.35rem;
  color: var(--text-faint);
}

/* ---------- Empty preview state ---------- */
.preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  color: var(--text-secondary);
}

.preview-empty svg {
  width: 2.6rem;
  height: 2.6rem;
  color: var(--text-faint);
  margin-bottom: 0.85rem;
}

.preview-empty h4 {
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.32rem;
}

.preview-empty p {
  font-size: 0.82rem;
  line-height: 1.5;
  max-width: 28rem;
}

/* ---------- Sample / retry button ---------- */
.link-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 0;
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(47, 142, 110, 0.4);
  padding: 0;
  cursor: pointer;
  transition: text-decoration-color 160ms var(--ease);
}

.link-button:hover {
  text-decoration-color: var(--brand-strong);
}

.filter-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(79, 159, 200, 0.3);
  border-radius: var(--r-pill);
  background: var(--info-soft);
  padding: 0.2rem 0.5rem;
  color: var(--info);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.filter-active-badge button {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 0.66rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.retry-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.65rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid rgba(226, 109, 109, 0.34);
  border-radius: var(--r-md);
  background: var(--danger-soft);
  font-size: 0.78rem;
  color: var(--danger);
}

/* ---------- Folder row inline status icon ---------- */
.kml-folder-status {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: var(--brand-strong);
}

.kml-folder-status svg {
  width: 1rem;
  height: 1rem;
}

.kml-folder-row[data-state="ok"] .kml-folder-status {
  color: var(--brand-strong);
}

.kml-folder-row[data-state="empty"] .kml-folder-status {
  color: var(--text-muted);
}

.kml-folder-row[data-state="missing"] .kml-folder-status {
  color: var(--danger);
}

.kml-folder-row[data-state="missing"] .kml-folder-status,
.kml-folder-row[data-state="warning"] .kml-folder-status {
  color: var(--warning);
}

.kml-folder-row[data-state="missing"] .kml-folder-status {
  color: var(--danger);
}

.kml-folder-row[data-state="ok"] .kml-folder-status {
  color: var(--brand-strong);
}

.kml-folder-row[data-state="empty"] .kml-folder-status {
  color: var(--text-muted);
}

/* ---------- Print sources hidden when not active ---------- */
@media print {
  .drawer,
  .modal-backdrop,
  .drag-shield {
    display: none !important;
  }
}


/* Dark mode disabled — placeholder */

/* Dark mode disabled */

/* =========================================================================
   EVA result workspace refinement
   ========================================================================= */
.result-summary-panel.hidden {
  display: none;
}

.result-summary-panel .dashboard-section-header {
  align-items: flex-start;
}

.result-summary-panel .dashboard-section-header small {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.result-workspace-summary {
  display: grid;
  gap: 0.9rem;
}

.result-workspace-header-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
}

.result-workspace-header-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  border: 1px solid rgba(93, 187, 154, 0.35);
  border-radius: 999px;
  background: rgba(93, 187, 154, 0.12);
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  padding: 0.35rem 0.6rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.result-workspace-hero,
.result-empty-state {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  padding: 1rem;
}

.result-workspace-hero {
  display: grid;
  gap: 0.25rem;
  background:
    linear-gradient(135deg, rgba(93, 187, 154, 0.12), rgba(122, 216, 180, 0.04)),
    var(--bg-card);
}

.result-workspace-hero span,
.result-detail-grid span {
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.result-workspace-hero strong {
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 800;
}

.result-workspace-hero small {
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.45;
}

.result-workspace-hero[data-tone="ready"] {
  border-color: rgba(93, 187, 154, 0.36);
}

.result-workspace-hero[data-tone="error"] {
  border-color: rgba(226, 109, 109, 0.38);
  background: var(--danger-soft);
}

.result-detail-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.result-detail-grid article {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-panel-2);
  padding: 0.7rem 0.75rem;
}

.result-detail-grid strong {
  display: block;
  margin-top: 0.22rem;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.result-empty-state {
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.55;
}

.result-empty-state strong {
  display: block;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 800;
}

.result-empty-state p {
  margin-top: 0.28rem;
}

.result-empty-state ul {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.result-empty-state li {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--brand-soft-2);
  padding: 0.45rem 0.55rem;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 700;
}

.preview-tab[hidden] {
  display: none;
}

.output-status-empty {
  padding: 0.9rem 1rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.output-status-note {
  margin: 0;
  border-top: 1px solid var(--border);
  padding: 0.72rem 1rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.output-status-row[data-state="processing"] .out-state {
  border-color: rgba(79, 159, 200, 0.32);
  background: var(--info-soft);
  color: var(--info);
}

.output-status-row[data-state="error"] .out-state {
  border-color: rgba(226, 109, 109, 0.36);
  background: var(--danger-soft);
  color: var(--danger);
}

.warning-empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  padding: 1.1rem;
  text-align: center;
}

.warning-empty-state strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 800;
}

.warning-empty-state p {
  margin-top: 0.28rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.console-panel-embedded {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  padding: 1rem;
}

@media (max-width: 760px) {
  .app-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .app-panel {
    overflow: hidden;
  }

  .brand-description,
  .drop-zone-copy,
  .drop-zone-helper,
  .result-detail-grid strong {
    overflow-wrap: anywhere;
  }

  .result-detail-grid,
  .result-empty-state ul {
    grid-template-columns: 1fr;
  }

  .console-header-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* =========================================================================
   Supabase visual overlay ??? token-only, no layout changes.
   Each batch from redesign-prompts/ APPENDS rules to this file.
   Do NOT modify rules from earlier batches. Do NOT add layout properties.
   ========================================================================= */

/* ---------- Batch 2 ??? Typography ---------- */

body {
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, ui-sans-serif, system-ui, sans-serif;
  color: var(--text-primary);
  background: var(--bg-page);
}

code,
pre,
kbd,
samp,
.console-log,
.console-log-line {
  font-family: "JetBrains Mono", "SF Mono", Menlo, Monaco, "Courier New", monospace;
}

h1,
h2,
h3,
h4,
.brand-heading,
.app-panel h2,
.app-panel h3,
.right-workspace h2,
.right-workspace h3 {
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

p,
.brand-description,
.drop-zone-copy,
.drop-zone-helper,
.folder-panel-subtitle {
  color: var(--text-secondary);
}

small,
.text-faint,
.drop-zone-helper {
  color: var(--text-muted);
}

/* ---------- Batch 3 ??? Cards & Panels ---------- */

.app-panel,
.mode-card,
.dashboard-section,
.result-card,
.validation-summary-card,
.folder-panel,
.modal-card,
.drawer-panel,
.activity-list,
.activity-detail,
.issue-center {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: none;
  color: var(--text-primary);
}

/* Slightly elevated cards (modals, drawers) get a soft shadow */
.modal-card,
.drawer-panel {
  box-shadow: var(--shadow-md);
}

/* Inner panel-2 surfaces (e.g., quick stats grid) */
.quick-stats,
.stats-grid,
.app-panel .app-panel,
.dashboard-section .dashboard-section {
  background: var(--bg-panel-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
}

/* Folder panel header subtitle / metrics */
.folder-panel-title {
  color: var(--text-primary);
}

.folder-panel-subtitle {
  color: var(--text-muted);
}

.folder-panel-metrics {
  color: var(--text-secondary);
}

.folder-panel-metrics strong {
  color: var(--text-primary);
}

/* ---------- Batch 4 ??? Buttons ---------- */

.primary-button,
.download-primary {
  background: var(--brand);
  color: #171717;
  border: 1px solid var(--brand);
  border-radius: var(--r-sm);
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: none;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
}

.primary-button:hover:not(:disabled),
.download-primary:hover:not(:disabled) {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #171717;
}

.primary-button:focus-visible,
.download-primary:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

.primary-button:disabled,
.download-primary:disabled {
  background: var(--bg-card-2);
  color: var(--text-faint);
  border-color: var(--border);
  box-shadow: none;
}

.secondary-button {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-weight: 500;
  box-shadow: none;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
}

.secondary-button:hover:not(:disabled) {
  background: var(--neutral-soft);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.secondary-button:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

.secondary-button:disabled {
  color: var(--text-faint);
  border-color: var(--border);
}

.icon-button {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  box-shadow: none;
  transition: background 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease);
}

.icon-button:hover {
  background: var(--neutral-soft);
  color: var(--text-primary);
  border-color: var(--border);
}

.icon-button:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

/* Danger / cancel button variant ??? applies if the codebase uses these classes */
.danger-button,
.cancel-button,
button.danger,
button.cancel {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--r-sm);
  font-weight: 500;
  box-shadow: none;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}

.danger-button:hover:not(:disabled),
.cancel-button:hover:not(:disabled),
button.danger:hover:not(:disabled),
button.cancel:hover:not(:disabled) {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ---------- Batch 5 ??? Inputs ---------- */

.ui-input,
input[type="text"],
input[type="search"],
input[type="email"],
input[type="number"],
input[type="url"],
input[type="tel"],
input[type="password"],
textarea,
select {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: inherit;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
}

.ui-input::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

.ui-input:hover:not(:disabled):not(:focus),
input:hover:not(:disabled):not(:focus),
textarea:hover:not(:disabled):not(:focus),
select:hover:not(:disabled):not(:focus) {
  border-color: var(--border-strong);
}

.ui-input:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: var(--ring-focus);
  outline: none;
  background: var(--bg-input);
}

.ui-input:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  background: var(--bg-card-2);
  color: var(--text-faint);
  border-color: var(--border);
}

/* Native search clear button keeps default in light theme */
input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
  opacity: 0.6;
}

input[type="search"]::-webkit-search-cancel-button:hover {
  opacity: 1;
}

/* ---------- Batch 6 ??? Drop Zones & Upload Summary ---------- */

.drop-zone {
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  color: var(--text-primary);
  box-shadow: none;
  transition: border-color 160ms var(--ease), background 160ms var(--ease);
}

.drop-zone:hover {
  border-color: var(--brand);
  background: var(--brand-soft-2);
}

.drop-zone.drag-active,
.drag-active.drop-zone {
  border-style: solid;
  border-color: var(--brand);
  background: var(--brand-soft);
}

.drop-zone[data-state="selected"] {
  border: none;
  background: transparent;
  padding: 0;
  min-height: 0;
  gap: 0;
}

.drop-zone[data-state="selected"] .drop-zone-main {
  display: none;
}

.drop-zone-icon {
  background: var(--brand-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--brand-strong);
}

.drop-zone-title {
  color: var(--text-primary);
  font-weight: 600;
}

.drop-zone-copy {
  color: var(--text-secondary);
}

.drop-zone-helper {
  color: var(--text-muted);
}

/* Upload summary chip shown after file is selected */
.upload-file-summary {
  background: var(--brand-soft-2);
  border: 1px solid var(--brand);
  border-radius: var(--r-md);
  color: var(--text-primary);
  box-shadow: none;
}

.upload-summary-head {
  color: var(--text-primary);
}

.upload-summary-head strong {
  color: var(--text-primary);
}

.upload-summary-head small {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.upload-summary-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.upload-summary-list {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.upload-summary-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid rgba(15, 17, 21, 0.08);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.72);
  padding: 0.5rem 0.65rem;
  color: var(--text-primary);
  font-size: 0.78rem;
  min-width: 0;
  overflow: hidden;
}

.upload-summary-file span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-summary-file small {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.upload-summary-action {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-weight: 500;
  box-shadow: none;
  transition: background 160ms var(--ease), border-color 160ms var(--ease);
}

.upload-summary-action:hover:not(:disabled) {
  background: var(--neutral-soft);
  border-color: var(--border-strong);
}

.upload-summary-action.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}

.upload-summary-action.danger:hover:not(:disabled) {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
}

/* ---------- Batch 7 ??? Status Pills & Result Workspace Badges ---------- */

.status-pill {
  border-radius: var(--r-pill);
  font-weight: 500;
  letter-spacing: 0;
  box-shadow: none;
  border: 1px solid transparent;
}

.status-pill[data-tone="idle"] {
  background: var(--neutral-soft);
  color: var(--text-muted);
  border-color: var(--border);
}

.status-pill[data-tone="processing"] {
  background: var(--info-soft);
  color: var(--info);
}

.status-pill[data-tone="ready"],
.status-pill[data-tone="success"] {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.status-pill[data-tone="warning"] {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill[data-tone="error"] {
  background: var(--danger-soft);
  color: var(--danger);
}

/* Header right-side badges (network type, scope type) */
.result-workspace-header-badges {
  color: var(--text-secondary);
}

.result-workspace-header-badge {
  background: var(--neutral-soft);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-weight: 500;
  box-shadow: none;
}

#resultNetworkTypeBadge,
#resultScopeTypeBadge {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-color: transparent;
}

#dashboardStatusPill[data-tone="idle"] {
  background: var(--neutral-soft);
  color: var(--text-muted);
  border-color: var(--border);
}

#dashboardStatusPill[data-tone="processing"] {
  background: var(--info-soft);
  color: var(--info);
}

#dashboardStatusPill[data-tone="ready"],
#dashboardStatusPill[data-tone="success"] {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

#dashboardStatusPill[data-tone="warning"] {
  background: var(--warning-soft);
  color: var(--warning);
}

#dashboardStatusPill[data-tone="error"] {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ---------- Batch 8 ??? Tabs ---------- */

.preview-tab,
.preview-sub-tab {
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-weight: 500;
  letter-spacing: 0;
  box-shadow: none;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

.preview-tab:hover:not(.active):not([aria-selected="true"]),
.preview-sub-tab:hover:not(.active):not([aria-selected="true"]) {
  color: var(--text-secondary);
}

.preview-tab.active,
.preview-tab[aria-selected="true"],
.preview-sub-tab.active,
.preview-sub-tab[aria-selected="true"] {
  color: var(--text-primary);
  border-bottom-color: var(--brand);
  background: transparent;
}

.preview-tab:focus-visible,
.preview-sub-tab:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
  border-radius: var(--r-sm);
}

/* The tab strip container ??? keep its layout but ensure no leftover bg */
#previewTabs,
#boqSubTabs,
#hpdbSubTabs {
  background: transparent;
}

/* Optional bottom hairline below the tab strip ??? only if existing CSS already
   provides one. If it doesn't, this is a no-op. */
#previewTabs {
  border-bottom: 1px solid var(--border);
}

#boqSubTabs,
#hpdbSubTabs {
  border-bottom: 1px solid var(--border-soft);
}

/* ---------- Batch 9 ??? Filter Chips & Option Cards ---------- */

.folder-filter-chip {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-weight: 500;
  letter-spacing: 0;
  box-shadow: none;
  transition: background 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease);
}

.folder-filter-chip:hover:not(.active) {
  background: var(--neutral-soft);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.folder-filter-chip.active,
.folder-filter-chip[aria-pressed="true"] {
  background: var(--brand-soft-2);
  color: var(--brand-strong);
  border-color: var(--brand);
}

/* Option cards (network type / scope type / output mode radios) */
.network-type-option {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-weight: 500;
  box-shadow: none;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
  cursor: pointer;
}

.network-type-option:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-2);
}

/* Selected state ??? match what JS toggles. Two patterns covered:
   1. Native :has() with the checked input
   2. Class-based (some apps add .checked / .selected on the label) */
.network-type-option:has(.network-type-input:checked),
.network-type-option:has(.scope-type-input:checked),
.network-type-option:has(.output-mode-input:checked),
.network-type-option.checked,
.network-type-option.selected,
.network-type-option[aria-checked="true"] {
  background: var(--brand-soft-2);
  border-color: var(--brand);
  color: var(--text-primary);
}

.network-type-option:has(.network-type-input:checked) strong,
.network-type-option:has(.scope-type-input:checked) strong,
.network-type-option:has(.output-mode-input:checked) strong {
  color: var(--brand-strong);
}

.network-type-option:focus-within {
  border-color: var(--brand);
  box-shadow: var(--ring-focus);
}

/* Hint text shown below the option group */
#scopeTypeHint,
#networkTypeHint {
  color: var(--text-muted);
}

/* ---------- Batch 10 ??? Workflow Stepper & App Header ---------- */

.app-header {
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.brand-heading {
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.brand-description {
  color: var(--text-muted);
}

.workflow-stepper {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: none;
  color: var(--text-secondary);
}

.workflow-step {
  color: var(--text-muted);
  border: none;
  background: transparent;
}

/* Active step highlighted in primary ink */
.workflow-step[data-status="active"],
.workflow-step.active,
.workflow-step[aria-current="step"] {
  color: var(--text-primary);
}

/* Completed step uses emerald accent */
.workflow-step[data-status="complete"],
.workflow-step[data-status="completed"],
.workflow-step.complete,
.workflow-step.completed {
  color: var(--brand-strong);
}

/* Errored step uses danger color */
.workflow-step[data-status="error"],
.workflow-step.error {
  color: var(--danger);
}

/* Step number/dot circles ??? try common selectors used by such steppers */
.workflow-step .step-number,
.workflow-step .step-dot,
.workflow-step .step-index {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-weight: 500;
}

.workflow-step[data-status="active"] .step-number,
.workflow-step[data-status="active"] .step-dot,
.workflow-step[data-status="active"] .step-index,
.workflow-step.active .step-number,
.workflow-step.active .step-dot,
.workflow-step.active .step-index {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-color: var(--brand);
}

.workflow-step[data-status="complete"] .step-number,
.workflow-step[data-status="complete"] .step-dot,
.workflow-step[data-status="complete"] .step-index,
.workflow-step[data-status="completed"] .step-number,
.workflow-step.complete .step-number,
.workflow-step.completed .step-number {
  background: var(--brand);
  color: #171717;
  border-color: var(--brand);
}

.workflow-step[data-status="error"] .step-number,
.workflow-step.error .step-number {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
}

/* Step caption (Ready / Waiting / Completed) */
.workflow-step .step-caption {
  color: var(--text-muted);
}

.workflow-step[data-status="complete"] .step-caption,
.workflow-step.complete .step-caption {
  color: var(--brand-strong);
}

.workflow-step[data-status="active"] .step-caption,
.workflow-step.active .step-caption {
  color: var(--text-secondary);
}

/* ---------- Batch 11 ??? Console Log, Alerts, Tooltips ---------- */

.console-log {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  box-shadow: none;
}

.console-log-line {
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-soft);
}

.console-log-line:last-child {
  border-bottom: none;
}

.console-log-line.info,
.console-log-line[data-level="info"] {
  color: var(--text-secondary);
}

.console-log-line.warn,
.console-log-line.warning,
.console-log-line[data-level="warn"],
.console-log-line[data-level="warning"] {
  color: var(--warning);
}

.console-log-line.error,
.console-log-line[data-level="error"] {
  color: var(--danger);
}

.console-log-line.success,
.console-log-line[data-level="success"] {
  color: var(--brand-strong);
}

.console-log-line.debug,
.console-log-line[data-level="debug"] {
  color: var(--text-muted);
}

/* Error alert + retry bar */
.retry-bar,
#errorAlert {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  box-shadow: none;
}

.retry-bar .secondary-button,
#errorAlert .secondary-button {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.retry-bar .secondary-button:hover,
#errorAlert .secondary-button:hover {
  background: var(--danger);
  color: #FFFFFF;
}

/* Tooltip */
.tooltip,
[role="tooltip"] {
  background: #171717;
  color: #FFFFFF;
  border-radius: var(--r-sm);
  font-weight: 400;
  letter-spacing: 0;
  box-shadow: var(--shadow-md);
}

/* Tip icon (the small ? next to labels) */
.tip-icon {
  background: var(--neutral-soft);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-weight: 500;
  cursor: help;
  transition: background 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease);
}

.tip-icon:hover {
  background: var(--brand-soft-2);
  color: var(--brand-strong);
  border-color: var(--brand);
}


/* Final mobile guard: keep narrow screens from clipping option cards. */
@media (max-width: 640px) {
  html,
  body,
  .app-shell {
    width: 100%;
    max-width: 100vw;
  }

  .app-header > div {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .brand-lockup,
  .header-right {
    min-width: 0;
    max-width: 100%;
  }

  .brand-lockup > :last-child,
  .upload-card > div:first-child > div,
  .mode-card {
    min-width: 0;
  }

  .brand-mark {
    flex: 0 0 auto;
  }

  .brand-heading,
  .brand-description {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .brand-description,
  .upload-card p,
  .mode-card p {
    white-space: normal !important;
    word-break: normal;
    overflow-wrap: anywhere;
  }

  .app-layout {
    width: 100% !important;
    max-width: 100vw !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .app-layout,
  .app-panel {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .left-workspace,
  .right-workspace,
  .app-panel,
  .mode-card,
  .drop-zone,
  .network-type-option,
  .output-mode-option {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .mode-card p,
  .drop-zone-copy,
  .drop-zone-helper,
  .network-type-option strong,
  .network-type-option small,
  .output-mode-option > span {
    overflow-wrap: anywhere;
  }

  .network-type-option > span,
  .output-mode-option > span {
    min-width: 0 !important;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .network-type-option > span {
    justify-content: flex-start;
    gap: 0.35rem 0.75rem;
  }

  .network-type-option small {
    margin-left: 0;
  }
}


.upload-card-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.fdt-coding-shortcut {
  min-height: 2.1rem;
  padding: 0.48rem 0.7rem;
  font-size: 0.75rem;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .upload-card-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .fdt-coding-shortcut {
    width: 100%;
  }
}


.modal-card-fdt {
  width: calc(100vw - 1rem);
  max-width: none;
  height: calc(100vh - 1rem);
  max-height: none;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.modal-card-fdt .modal-header {
  align-items: center;
  background: #f7bf8d;
  border: 1px solid #202020;
  border-radius: 0;
  margin: 0;
}

.modal-card-fdt .modal-header h2 {
  color: #111827;
  font-size: clamp(1.65rem, 2vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.modal-card-fdt .modal-header p {
  color: #263238;
}

.modal-card-fdt .modal-close {
  color: #111827;
  font-size: 0.95rem;
  font-weight: 900;
}

.modal-card-coreman {
  position: relative;
  overflow: hidden;
  border: 0;
  background: #667eea;
}

.modal-card-coreman .fdt-coding-frame {
  border-radius: var(--r-md);
  background: #667eea;
}

.coreman-modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 2;
  border-color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.94);
  color: #1f2937;
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.18);
}

.coreman-modal-close:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: #111827;
}

.fdt-coding-frame {
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  border: 0;
  border-top: 0;
  border-radius: 0 0 var(--r-md) var(--r-md);
  background: var(--bg-page);
}

@media (max-width: 640px) {
  .modal-card-fdt {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
}


.fdt-coding-header-button {
  min-height: 2.15rem;
  padding: 0.48rem 0.78rem;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.fdt-coding-header-button svg {
  width: 1rem;
  height: 1rem;
}

@media (max-width: 640px) {
  .fdt-coding-header-button {
    width: 100%;
    justify-content: center;
  }
}


.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
}

@media (max-width: 1180px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.fdt-coding-panel {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: stretch;
  flex-wrap: nowrap;
  gap: 0.55rem;
  border: 1px solid #e5e7eb;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  min-height: 5.25rem;
  padding: 0.72rem 0.8rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(62, 207, 142, 0.07), inset 0 1px 0 rgba(255,255,255,0.6);
}

.fdt-coding-panel:hover {
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border-color: #d1d5db;
}

/* Soft pastel per card */
.fdt-card-coding { background: rgba(62, 207, 142, 0.12); backdrop-filter: blur(18px) saturate(1.8); -webkit-backdrop-filter: blur(18px) saturate(1.8); box-shadow: 0 6px 28px rgba(62, 207, 142, 0.10), inset 0 1px 0 rgba(255,255,255,0.65); border-color: rgba(62, 207, 142, 0.22); }
.fdt-card-coding:hover { background: rgba(62, 207, 142, 0.18); border-color: rgba(62, 207, 142, 0.35); box-shadow: 0 8px 36px rgba(62, 207, 142, 0.15), inset 0 1px 0 rgba(255,255,255,0.7); transform: translateY(-1px); }

.fdt-card-core { background: rgba(59, 130, 246, 0.10); backdrop-filter: blur(18px) saturate(1.8); -webkit-backdrop-filter: blur(18px) saturate(1.8); box-shadow: 0 6px 28px rgba(59, 130, 246, 0.08), inset 0 1px 0 rgba(255,255,255,0.65); border-color: rgba(59, 130, 246, 0.18); }
.fdt-card-core:hover { background: rgba(59, 130, 246, 0.16); border-color: rgba(59, 130, 246, 0.30); box-shadow: 0 8px 36px rgba(59, 130, 246, 0.13), inset 0 1px 0 rgba(255,255,255,0.7); transform: translateY(-1px); }

.fdt-card-rfs { background: rgba(245, 158, 11, 0.10); backdrop-filter: blur(18px) saturate(1.8); -webkit-backdrop-filter: blur(18px) saturate(1.8); box-shadow: 0 6px 28px rgba(245, 158, 11, 0.08), inset 0 1px 0 rgba(255,255,255,0.65); border-color: rgba(245, 158, 11, 0.18); }
.fdt-card-rfs:hover { background: rgba(245, 158, 11, 0.16); border-color: rgba(245, 158, 11, 0.30); box-shadow: 0 8px 36px rgba(245, 158, 11, 0.13), inset 0 1px 0 rgba(255,255,255,0.7); transform: translateY(-1px); }

.fdt-card-gdr { background: rgba(139, 92, 246, 0.10); backdrop-filter: blur(18px) saturate(1.8); -webkit-backdrop-filter: blur(18px) saturate(1.8); box-shadow: 0 6px 28px rgba(139, 92, 246, 0.08), inset 0 1px 0 rgba(255,255,255,0.65); border-color: rgba(139, 92, 246, 0.18); }
.fdt-card-gdr:hover { background: rgba(139, 92, 246, 0.16); border-color: rgba(139, 92, 246, 0.30); box-shadow: 0 8px 36px rgba(139, 92, 246, 0.13), inset 0 1px 0 rgba(255,255,255,0.7); transform: translateY(-1px); }

.fdt-card-kmz { background: rgba(20, 184, 166, 0.10); backdrop-filter: blur(18px) saturate(1.8); -webkit-backdrop-filter: blur(18px) saturate(1.8); box-shadow: 0 6px 28px rgba(20, 184, 166, 0.08), inset 0 1px 0 rgba(255,255,255,0.65); border-color: rgba(20, 184, 166, 0.18); }
.fdt-card-kmz:hover { background: rgba(20, 184, 166, 0.16); border-color: rgba(20, 184, 166, 0.30); box-shadow: 0 8px 36px rgba(20, 184, 166, 0.13), inset 0 1px 0 rgba(255,255,255,0.7); transform: translateY(-1px); }

.fdt-coding-panel h3 {
  margin: 0;
  color: var(--text-primary);
  width: 100%;
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.2;
  text-align: left;
  overflow-wrap: anywhere;
}

.fdt-coding-panel p {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.fdt-coding-panel > div {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
}

.fdt-coding-panel-button,
.glass-button {
  flex: 0 0 auto;
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
  background: rgba(59, 130, 246, 0.1) !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
  color: #1d4ed8 !important;
  border-radius: 999px;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: none;
}

.fdt-coding-panel > .fdt-coding-panel-button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  grid-row: 2;
  width: 100%;
  height: 1.9rem;
  min-height: 1.9rem;
  min-width: 0;
  max-width: 100%;
  margin: 0 !important;
  padding: 0.25rem 0.45rem !important;
  font-size: 0.72rem !important;
  line-height: 1 !important;
  transform: none !important;
}

.fdt-coding-panel-button:hover,
.glass-button:hover {
  background: rgba(59, 130, 246, 0.18) !important;
  border-color: rgba(59, 130, 246, 0.45) !important;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

@media (max-width: 640px) {
  .fdt-coding-panel-button {
    margin-left: 0;
  }
}

.geofabrik-panel {
  border: 1px solid var(--info);
  border-radius: var(--r-md);
  background: var(--info-soft);
  padding: 0;
  overflow: hidden;
}

.road-source-panel {
  margin: 0;
  padding: 0.6rem 0.9rem 0.5rem;
}

.road-source-panel strong {
  color: var(--text-primary);
  font-size: 0.78rem;
}

.road-source-body {
  padding: 0.15rem 0 0.35rem;
}

.road-source-body label {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.road-source-panel > p {
  padding: 0;
}

.geofabrik-panel .flex {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.geofabrik-select {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-input);
  color: var(--text-primary);
}

.geofabrik-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring-focus);
}

@media (max-width: 640px) {
  .geofabrik-panel .flex {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .geofabrik-select {
    width: 100%;
  }

  .road-source-body {
    grid-template-columns: 1fr !important;
  }

  .road-source-body label {
    text-align: left !important;
  }

  .road-source-body #osmKecamatanSize {
    grid-column: auto !important;
  }
}

.quick-stats-item + .quick-stats-item::before {
  content: "|" !important;
}

.modal-backdrop {
  padding: clamp(1rem, 3vw, 2.25rem);
}

.modal-card {
  max-height: min(86vh, 52rem);
}

.modal-card-wide {
  width: min(46rem, calc(100vw - 3rem));
}

.modal-card-fdt {
  width: min(84rem, calc(100vw - 4.5rem));
  max-width: 84rem;
  height: min(44rem, calc(100vh - 4.5rem));
  max-height: calc(100vh - 4.5rem);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.modal-card-fdt .modal-header {
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.modal-card-coreman {
  width: min(78rem, calc(100vw - 5rem));
  height: min(43rem, calc(100vh - 5rem));
  max-width: 78rem;
  max-height: calc(100vh - 5rem);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--r-lg);
  background: #f8fafc;
}

.modal-card-coreman .fdt-coding-frame {
  border-radius: var(--r-lg);
}

.fdt-coding-frame {
  min-height: 24rem;
}

.drawer {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: clamp(1rem, 3vw, 2.25rem);
  background: rgba(11, 17, 16, 0.55);
  backdrop-filter: blur(4px);
}

.drawer.hidden {
  display: none;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
}

.drawer-panel {
  position: relative;
  z-index: 1;
  width: min(72rem, calc(100vw - 4.5rem));
  max-width: 72rem;
  height: min(42rem, calc(100vh - 4.5rem));
  max-height: calc(100vh - 4.5rem);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  animation: modal-in 200ms var(--ease);
}

@media (max-width: 640px) {
  .modal-backdrop,
  .drawer {
    padding: 0.75rem;
  }

  .modal-card,
  .modal-card-wide,
  .modal-card-fdt,
  .modal-card-coreman,
  .drawer-panel {
    width: calc(100vw - 1.5rem);
    max-width: none;
    height: calc(100dvh - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
    border-radius: var(--r-lg);
  }
}

/* Feeder rose - final override */
#astriIntegrationPanel[data-astri-mode="feeder"] {
  border-color: rgba(253, 164, 175, 0.88) !important;
  box-shadow: 0 18px 60px rgba(244, 63, 94, 0.16), inset 0 1px 0 rgba(255,255,255,0.75) !important;
}

#astriIntegrationPanel[data-astri-mode="feeder"] :where(#astriMatchButton, #astriApdConvertButton, #astriUploadButton, #astriVerifyButton, #astriUnverifyButton, #astriDownloadLatestButton, #astriScheduleButton, #astriAddBoqButton, #astriOpenLink):not(:disabled) {
  border-color: rgba(253, 164, 175, 0.88) !important;
  background: linear-gradient(180deg, rgba(255, 228, 230, 0.95), rgba(255, 241, 242, 0.76)) !important;
  color: #9f1239 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.86), 0 12px 30px rgba(244,63,94,0.16) !important;
  backdrop-filter: blur(16px) saturate(135%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(135%) !important;
}

/* GDR workspace: quiet document-control shell; no decorative glass or gradients. */
.gdr-modal-backdrop {
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  padding: clamp(0.75rem, 2.5vw, 2rem);
}

.modal-card-gdr {
  width: min(76rem, calc(100vw - 2rem));
  height: min(48rem, calc(100dvh - 2rem));
  max-width: 76rem;
  max-height: calc(100dvh - 2rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #cbded4;
  border-radius: 1rem;
  background: #f7fbf8;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.20);
}

.gdr-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.6rem;
  padding: 0.65rem 1.1rem 0.65rem 1.25rem;
  border-bottom: 1px solid #d8e6df;
  background: #ffffff;
}

.gdr-modal-heading {
  min-width: 0;
}

.gdr-modal-heading h2 {
  margin: 0;
  color: #17352a;
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.gdr-modal-heading p {
  margin: 0.18rem 0 0;
  color: #60776e;
  font-size: 0.76rem;
}

.gdr-modal-close {
  display: inline-grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  border: 1px solid #c9dbd2 !important;
  border-radius: 0.55rem !important;
  background: #ffffff !important;
  color: #31564a !important;
  cursor: pointer;
  box-shadow: none !important;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.gdr-modal-close svg {
  display: block;
}

.gdr-modal-close:hover,
.gdr-modal-close:focus-visible {
  border-color: #1f9d68 !important;
  background: #f0faf4 !important;
  color: #17352a !important;
  transform: none !important;
}

.gdr-modal-rail {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.42rem 1.25rem;
  border-bottom: 1px solid #d8e6df;
  background: #f1f7f3;
  font-size: 0.59rem;
  letter-spacing: 0.08em;
}

.gdr-modal-frame {
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 0;
  background: #f7fbf8;
}

@media (max-width: 640px) {
  .gdr-modal-backdrop { padding: 0; }
  .modal-card-gdr {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .gdr-modal-header { min-height: 4.1rem; padding: 0.75rem 0.8rem 0.7rem 1rem; }
  .gdr-modal-heading { padding-left: 0.65rem; }
  .gdr-modal-heading p { display: none; }
  .gdr-modal-close { width: 44px !important; min-width: 44px !important; height: 44px !important; min-height: 44px !important; }
  .gdr-modal-rail { padding: 0.38rem 1rem; }
}

#astriIntegrationPanel[data-astri-mode="feeder"] #astriTargetTypeSelect {
  border-color: rgba(253, 164, 175, 0.88) !important;
  color: #9f1239 !important;
}

/* GDR ASTRI login gate */
.gdr-astri-card {
  width: min(92vw, 430px);
  padding: 28px;
  border-radius: 26px;
  border: 1px solid rgba(20,184,166,.24);
  background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(236,253,245,.96));
  box-shadow: 0 26px 80px rgba(15,23,42,.24), 0 0 0 1px rgba(255,255,255,.7) inset;
}
.gdr-astri-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  margin-bottom: 14px;
  color: #fff;
  font-weight: 900;
  letter-spacing: .08em;
  background: linear-gradient(135deg, #14b8a6, #22c55e);
  box-shadow: 0 14px 34px rgba(20,184,166,.28);
}
.gdr-astri-login-form {
  display: grid;
  gap: 10px;
}
.gdr-astri-status {
  min-height: 18px;
  font-size: 12px;
  font-weight: 700;
  color: #dc2626;
}
.gdr-astri-status[data-ok="true"] {
  color: #059669;
}
.gdr-astri-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}
.gdr-astri-link {
  margin-top: 14px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #0284c7;
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
}
@media (max-width: 520px) {
  .gdr-astri-card { padding: 22px; border-radius: 22px; }
  .gdr-astri-actions { flex-direction: column; }
}

/* Centered application notification popup. */
.notification-stack {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  pointer-events: none;
}
.notification {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: min(460px, calc(100vw - 40px));
  padding: 18px 18px 18px 16px;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 18px;
  background: rgba(255, 255, 255, .98);
  color: #0f172a;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
  pointer-events: auto;
}
.notification-copy { min-width: 0; flex: 1; }
.notification strong { display: block; font-weight: 800; }
.notification span { display: block; margin-top: 4px; color: #475569; line-height: 1.45; white-space: pre-line; }
/* Semua popup notifikasi netral; severity dibedakan lewat isi pesan, bukan warna. */
.notification-success,
.notification-warning,
.notification-error { border-color: rgba(148, 163, 184, .35); }
.notification-close {
  border: 0 !important;
  background: transparent !important;
  color: #64748b !important;
  box-shadow: none !important;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.2;
  padding: .2rem .35rem;
  white-space: nowrap;
  cursor: pointer;
}
.notification-close:hover,
.notification-close:focus-visible {
  border: 0 !important;
  background: transparent !important;
  color: #334155 !important;
  box-shadow: none !important;
  outline: 2px solid rgba(100, 116, 139, .35);
  outline-offset: 2px;
}
@media (max-width: 520px) {
  .notification-stack { padding: 16px; }
  .notification { width: 100%; }
}
.alert-error{color:#991b1b;background:#fee2e2;border:1px solid #fecaca}.alert-warning{color:#92400e;background:#fef3c7;border:1px solid #fde68a}.alert-success{color:#166534;background:#dcfce7;border:1px solid #bbf7d0}.alert-info{color:#1e40af;background:#dbeafe;border:1px solid #bfdbfe}

/* Agent stability patch: ROAD selector must remain readable on all viewports. */
#roadSourcePanel{display:block!important;visibility:visible!important;opacity:1!important;position:relative!important;clip:auto!important;clip-path:none!important;height:auto!important;min-height:1px!important;overflow:visible!important}
#roadSourceHelper{display:block!important;visibility:visible!important;opacity:1!important}
#geofabrikPanel{display:block!important;visibility:visible!important;opacity:1!important;height:auto!important;overflow:visible!important}
#geofabrikPanel.hidden{display:block!important}

/* UI audit 2026-08-29: scoped readability and layout corrections. */
#astriMatchButton {
  display: none !important;
}

:root {
  --border: #C4CDD4;
  --border-strong: #8C9AA6;
  --text-faint: #64748B;
  --brand-strong: #08704F;
}

@media (min-width: 641px) {
  .supported-files-trigger .supported-files-desc {
    display: none !important;
  }
}

.app-shell :where(h1, h2, h3, h4) {
  color: var(--text-primary) !important;
}

.app-panel,
.mode-card,
.flow-section-card,
.folder-panel,
.dashboard-section {
  border-radius: var(--r-lg);
}

#astriActionButtons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 0.5rem;
}

#astriActionButtons > button,
#astriActionButtons > a {
  width: 100%;
  min-height: 2.5rem;
}

.stella-status-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
  color: #64748b;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.stella-status-badge[data-tone="online"] { border-color: #86efac; background: #f0fdf4; color: #15803d; }
.stella-status-badge[data-tone="pending"] { border-color: #fcd34d; background: #fffbeb; color: #a16207; }
.stella-status-badge[data-tone="offline"] { border-color: #cbd5e1; background: #f8fafc; color: #64748b; }
#stellaIntegrationPanel { border-color: rgba(196, 181, 253, 0.7) !important; }
#stellaIntegrationPanel .secondary-button { border-color: rgba(196, 181, 253, 0.75) !important; color: #6d28d9 !important; }
#stellaIntegrationPanel .secondary-button:hover { border-color: #a78bfa !important; background: #f5f3ff !important; }

.drop-zone-add-btn,
.network-type-option:has(input:checked) small,
.output-mode-option:has(input:checked) {
  color: #08704F;
}

.primary-button:disabled,
.download-primary:disabled {
  border: 1px solid #94A3B8 !important;
  background: #E2E8F0 !important;
  color: #475569 !important;
  opacity: 1;
}


@media (max-width: 720px) {
  #astriActionButtons {
    grid-template-columns: 1fr;
  }
}
