:root {
  --hp-ink: #12261b;
  --hp-green: #1a4a2a;
  --hp-leaf: #2a6b3c;
  --hp-mint: #edf6f0;
  --hp-fog: #f7faf8;
  --hp-line: rgba(18, 38, 27, 0.1);
  --hp-gold: #9a7b1a;
  --hp-radius: 14px;
  --hp-radius-lg: 18px;
  --hp-shadow: 0 8px 24px rgba(18, 38, 27, 0.06);
  --hp-shadow-hover: 0 12px 28px rgba(18, 38, 27, 0.1);
  --bg-body: linear-gradient(180deg, #fbfcfb 0%, #f5f8f6 40%, #ffffff 100%);
  --bg-primary: #f7faf8;
  --bg-card: #ffffff;
  --text-primary: #12261b;
  --text-secondary: #4a6354;
  --text-muted: #6b8174;
  --border: #c6dcd0;
  --border-soft: #deece4;
  --mint-box: #e2f0e6;
  --mint-hover: #f4fcf7;
  --accent: #3b8f62;
  --danger: #dc2626;
  --font: "Segoe UI", Calibri, system-ui, -apple-system, sans-serif;
  --display: "Segoe UI", Calibri, system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

.excel-to-invoice-app {
  font-family: var(--font);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.excel-to-invoice-app h1, .excel-to-invoice-app h2, .excel-to-invoice-app h3, .excel-to-invoice-app h4 {
  font-family: var(--display);
  letter-spacing: -0.015em;
  font-weight: 600;
  color: var(--hp-ink);
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, #07140d, #123821, #1a4a2a);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(7, 20, 13, 0.18);
}

.brand { display: flex; align-items: center; gap: 0.85rem; }
.brand-mark {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  color: #b8f0c4;
  font-size: 1.1rem;
}
.brand-name { margin: 0; font-family: var(--display); font-size: 1.15rem; font-weight: 700; color: #fff; }
.brand-tag { margin: .1rem 0 0; color: rgba(255, 255, 255, 0.78); font-size: .8rem; font-weight: 400; }

/* Nested in site template: fill content column; do not fight Bootstrap ads grid */
.excel-to-invoice-app .shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 1.5rem;
}

/* Standalone page only (unused when embedded) */
.shell {
  width: min(1440px, calc(100% - 2rem));
  margin: 1.5rem auto 3.5rem;
}

.tool-page-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 0 auto 1.5rem;
  max-width: 720px;
  padding: 0 8px;
}
.tool-page-icon { margin-bottom: 10px; }
.tool-page-icon i { font-size: 2.5rem; color: #7c3aed; line-height: 1; }
.tool-page-title {
  font-size: clamp(1.45rem, 2.8vw, 2rem);
  margin: 0 0 0.55rem;
  line-height: 1.25;
}
.tool-page-lead {
  margin: 0 auto;
  max-width: 52ch;
  font-size: clamp(1.02rem, 1.5vw, 1.15rem);
  line-height: 1.55;
  font-weight: 400;
  color: var(--text-secondary);
}

.how-to {
  background: #f2f9f5;
  border: 1px solid var(--border-soft);
  border-radius: var(--hp-radius);
  padding: 14px 18px;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #1c4935;
}
.how-to i { font-size: 20px; color: var(--accent); margin-top: 1px; }
.how-to-title { margin: 0 0 .2rem; font-size: .95rem; }
#status-text { margin: 0; color: #1c4935; font-size: .9rem; }

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--hp-radius);
  box-shadow: var(--hp-shadow);
  padding: 1.2rem 1.3rem 1.35rem;
  margin-bottom: 1rem;
}
.panel.is-disabled { opacity: .55; pointer-events: none; }
.panel-head h2 { margin: 0 0 .2rem; font-size: 1.12rem; color: #0f3b2a; }
.panel-head p { margin: 0 0 .9rem; color: var(--text-muted); font-size: .9rem; font-weight: 400; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 180px;
  border: 2px dashed var(--border);
  border-radius: 14px;
  background: #fafffc;
  cursor: pointer;
  text-align: center;
  padding: 40px 20px;
  position: relative;
  transition: 0.25s;
}
.dropzone:hover,
.dropzone.is-over { border-color: var(--accent); background: var(--mint-hover); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .ico { width: 52px; height: 52px; color: #1f5a3f; margin-bottom: 6px; }
.dropzone-title { font-weight: 500; font-size: 18px; color: #0f3b2a; }
.dropzone-sub { color: #6b8879; font-size: 14px; }

/* Scoped — never override Bootstrap .row used by ad sidebars */
.excel-to-invoice-app .eti-flex-row { display: flex; gap: .7rem; align-items: center; }
.excel-to-invoice-app .eti-flex-row.wrap { flex-wrap: wrap; }
.actions { margin-top: 1rem; }

.excel-to-invoice-app .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 40px;
  padding: 12px 28px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
}
.excel-to-invoice-app .btn-primary {
  background: linear-gradient(135deg, #0f3b2a, #1f5a3f);
  color: #fff;
}
.excel-to-invoice-app .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15, 59, 42, .3); color: #fff; }
.excel-to-invoice-app .btn-secondary {
  background: #e4eee8;
  color: #0f3b2a;
  font-weight: 500;
}
.excel-to-invoice-app .btn-secondary:hover { background: var(--accent); color: #fff; }
.excel-to-invoice-app .btn-ghost {
  background: #fff;
  border: 1.5px solid var(--border);
  color: #0f3b2a;
  font-weight: 500;
}
.excel-to-invoice-app .btn-ghost:hover { background: var(--hp-mint); color: var(--hp-ink); }
.excel-to-invoice-app .btn-danger {
  background: #fef2f2;
  color: #991b1b;
  font-weight: 500;
}
.excel-to-invoice-app .btn-danger:hover { background: #fee2e2; }
.excel-to-invoice-app .btn.is-disabled,
.excel-to-invoice-app .btn:disabled { opacity: .5; pointer-events: none; transform: none; box-shadow: none; }
.excel-to-invoice-app .btn-ghost[for] { cursor: pointer; }

/* Sample download — matches excel-repair secondary button, filename only */
.excel-to-invoice-app .eti-sample-download {
  margin: 12px 0 8px;
}
.excel-to-invoice-app .eti-btn-sample {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  text-decoration: none;
  color: #0f3b2a;
  background: #e4eee8;
  border: none;
  border-radius: 40px;
  transition: 0.25s;
  cursor: pointer;
}
.excel-to-invoice-app .eti-btn-sample:hover {
  background: #3b8f62;
  color: #fff;
}

.work-area { margin-top: 8px; }

.eti-options {
  margin: 22px 0 8px;
  background: #e2f0e6;
  padding: 18px 20px;
  border-radius: 14px;
  color: #0f3b2a;
}
.eti-options-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 22px;
  align-items: start;
}
.eti-options .opt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.map-grid .lbl-row {
  min-height: 48px;
  align-items: flex-start;
}
.map-grid > .opt > .field-hint {
  min-height: 32px;
}
.map-grid .numbers-opt .stacked-lbl {
  margin-top: 10px;
  min-height: 36px;
}
.eti-options .opt > label { font-size: 13px; font-weight: 600; margin: 0; line-height: 1.2; }
.eti-options select,
.eti-options input[type="text"],
.eti-options input[type="number"],
.eti-options textarea {
  border: 1px solid #c6dcd0;
  border-radius: 10px;
  padding: 9px 12px;
  background: #fff;
  color: #0f3b2a;
  font-size: 14px;
  width: 100%;
  height: 42px;
  box-sizing: border-box;
  font-family: var(--font);
}
.eti-options textarea {
  height: auto;
  min-height: 78px;
  resize: vertical;
  line-height: 1.4;
}
.eti-options select[multiple] { height: auto; min-height: 96px; }
.eti-options .span-2 { grid-column: span 2; }
.eti-options .span-all { grid-column: 1 / -1; }

.opt-intro {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 500;
  color: #1c4935;
}
.field-hint {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 400;
  color: #5a7a68;
}
.map-caption {
  margin: 14px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #1f5a3f;
}
.section-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #cfe3d7;
}
.section-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: #0f3b2a;
}
.lbl-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.lbl-row > label,
.lbl-row > .values-label { margin: 0; }
.help {
  display: inline-flex;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #cfe3d7;
  color: #1f5a3f;
  font-size: 11px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  cursor: help;
  position: relative;
  flex-shrink: 0;
  line-height: 1;
}
.help:hover::after,
.help:focus::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 260px;
  background: #0f3b2a;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: 8px;
  z-index: 8;
  box-shadow: 0 8px 20px rgba(15, 59, 42, 0.25);
  pointer-events: none;
}
.map-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
}
.map-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}
.map-chip b { font-weight: 800; }
.map-chip.is-x { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.map-chip.is-y { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.map-chip.is-s { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.data-pick {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr minmax(200px, 240px);
  gap: 18px 22px;
  margin-top: 12px;
}
.data-pick.map-pick { padding-top: 0; border-top: 0; }
.values-label {
  font-size: 13px;
  font-weight: 600;
}
.value-toolbar { display: flex; gap: 12px; margin: 4px 0 8px; align-items: center; }
.action-select {
  width: auto !important;
  min-width: 140px;
  height: 34px !important;
  padding: 4px 10px !important;
  font-size: 13px !important;
}
.link-btn {
  border: 0;
  background: none;
  color: #1f5a3f;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.eti-options input[type="color"] {
  height: 42px;
  padding: 4px 6px;
  cursor: pointer;
  background: #fff;
}
.custom-hint { margin: 8px 0 12px; }
.palette-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.palette-row input[type="color"] {
  width: 42px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.value-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: #fff;
  border: 1px solid #c6dcd0;
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 48px;
}
.value-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f7fbf9;
  border: 1px solid #c6dcd0;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  color: #0f3b2a;
}
.value-check.is-on {
  background: #dbeafe;
  border-color: #93c5fd;
}
.value-check input { margin: 0; width: auto; accent-color: #1f5a3f; }

.guide-steps {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0 0 1rem;
  justify-content: center;
}
.guide-steps li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border-soft);
  color: #5a7a68;
  font-size: 13px;
  font-weight: 600;
}
.guide-steps li span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e4eee8;
  font-size: 12px;
}
.guide-steps li.is-active {
  background: #0f3b2a;
  border-color: #0f3b2a;
  color: #fff;
}
.guide-steps li.is-active span { background: #fff; color: #0f3b2a; }
.guide-steps li.is-done { color: #1f5a3f; border-color: #86efac; background: #ecfdf5; }
.guide-steps li.is-done span { background: #22c55e; color: #fff; }

.preview-pane.side,
.preview-pane:not(.side) {
  background: #f7fbf9;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 16px 18px;
}

.selection-panel {
  margin-top: 16px;
  background: #f7fbf9;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 16px 18px;
}
.selection-wrap {
  min-height: 180px;
  max-height: 280px;
  flex: none;
}

@media (max-width: 1000px) {
  .data-pick { grid-template-columns: 1fr; }
}

.more-opts {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #cfe3d7;
}
.more-opts summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  color: #0f3b2a;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.more-opts summary::-webkit-details-marker { display: none; }
.more-opts summary::before {
  content: "";
  width: 0.42em;
  height: 0.42em;
  border-right: 2px solid #1f5a3f;
  border-bottom: 2px solid #1f5a3f;
  transform: rotate(45deg);
  transition: transform .2s;
  margin-right: 2px;
}
.more-opts:not([open]) summary::before { transform: rotate(-45deg); }
.summary-note {
  font-weight: 500;
  font-size: 12px;
  color: #5a7a68;
}
.more-opts .more-grid { margin-top: 14px; }

.field-dropdown { position: relative; }
.field-dropdown-toggle {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #c6dcd0;
  border-radius: 10px;
  background: #fff;
  color: #0f3b2a;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  padding: 0 12px;
  cursor: pointer;
  text-align: left;
}
.field-dropdown-toggle:hover,
.field-dropdown-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 143, 98, .12);
}
.field-dropdown-toggle span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field-dropdown-toggle i { color: #5a7a68; font-size: 12px; flex-shrink: 0; }
.field-dropdown-menu {
  position: absolute;
  z-index: 16;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid #c6dcd0;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(18, 38, 27, 0.14);
  padding: 8px;
}
.field-dropdown-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 2px 8px;
  border-bottom: 1px solid #e4eee8;
}
.field-dropdown-actions button {
  border: 1px solid #c6dcd0;
  background: #f7fbf9;
  color: #0f3b2a;
  border-radius: 999px;
  padding: 4px 10px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.field-dropdown-actions button:hover {
  background: #0f3b2a;
  color: #fff;
  border-color: #0f3b2a;
}
.field-dropdown-list {
  max-height: 240px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0 0;
  min-height: 48px;
}
.field-dropdown-list .value-check {
  width: 100%;
  border-radius: 8px;
  justify-content: flex-start;
}
.field-dropdown-list .value-check.is-focus {
  outline: 2px solid #86efac;
}
.field-dropdown-list .col-meta {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: #5a7a68;
}

.preview-heading {
  margin: 1rem 0 .5rem;
  font-size: 0.95rem;
  color: #0f3b2a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.eti-action-row {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

@media (max-width: 1000px) {
  .eti-options-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eti-options .span-2 { grid-column: span 2; }
}
@media (max-width: 640px) {
  .eti-options-grid { grid-template-columns: 1fr; }
  .eti-options .span-2 { grid-column: span 1; }
  .eti-action-row { flex-direction: column; align-items: stretch; }
}

.file-list { list-style: none; padding: 0; margin: .85rem 0 0; }
.file-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #f0f8f3;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  margin-bottom: .5rem;
  font-size: .9rem;
  color: #0f3b2a;
}
.file-list li > .ico { color: #1f5a3f; width: 22px; height: 22px; flex: 0 0 auto; }
.file-list li span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-list .btn-remove-file {
  margin-left: auto;
  flex: 0 0 auto;
  color: #991b1b;
  border-color: #f1c9c9;
  background: #fff;
  font-size: 13px;
  padding: 6px 12px;
}
.file-list .btn-remove-file .ico {
  color: #991b1b;
  width: 13px;
  height: 13px;
}
.file-list .btn-remove-file:hover {
  background: #fef2f2;
}

.split { display: grid; gap: 1rem; }
.split.preview-split,
.split.guide-split {
  align-items: stretch;
}
@media (min-width: 960px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split.preview-split { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1180px) {
  .split.guide-split { grid-template-columns: 1.15fr minmax(240px, 0.9fr) 1.15fr; }
}
@media (min-width: 960px) and (max-width: 1179px) {
  .split.guide-split { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1179px) {
  .sample-pane .sample-wrap {
    height: auto;
    min-height: 160px;
    max-height: 240px;
  }
}
.guide-layout-lead {
  margin: 0 0 10px;
}
.sample-map {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sample-map li {
  font-size: 12px;
  font-weight: 500;
  color: #1c4935;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.sample-map .role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.sample-map .role-dot.is-x { background: #059669; }
.sample-map .role-dot.is-y { background: #2563eb; }
.sample-map .role-dot.is-s { background: #d97706; }
.sample-pane .sample-wrap {
  flex: 1;
}
.preview-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.preview-pane .preview-heading { margin-top: 0; }
.preview-pane:not(.sample-pane) .grid-wrap,
.preview-pane .live-box {
  height: 520px;
  min-height: 520px;
  max-height: 520px;
}
.sample-pane .sample-wrap {
  flex: 1;
  height: auto;
  min-height: 160px;
  max-height: 520px;
}
.side {
  background: #f7fbf9;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 16px 18px;
}
.side h3 { margin: 0 0 .5rem; font-size: .95rem; color: #0f3b2a; }

.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.tab {
  border: 1px solid var(--border);
  background: #fff;
  color: #5a7a68;
  border-radius: 20px;
  padding: .35rem .75rem;
  cursor: pointer;
  font-family: var(--font);
  font-size: .82rem;
  font-weight: 600;
}
.tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, #0f3b2a, #1f5a3f);
  border-color: transparent;
}

.grid-wrap {
  overflow: auto;
  flex: 1;
  min-height: 480px;
  max-height: 560px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: #fff;
}
.sheet-grid {
  border-collapse: collapse;
  min-width: 100%;
  color: #0f3b2a;
  font-size: 13px;
  background: #fff;
}
.sheet-grid th, .sheet-grid td {
  border: 1px solid #deece4;
  padding: .28rem .45rem;
  min-width: 78px;
  height: 28px;
}
.sheet-grid th { background: #1a4a2a; color: #fff; font-weight: 600; position: sticky; top: 0; z-index: 1; }
.sheet-grid tr.is-header td { background: #e8f5e9; font-weight: 600; }
.sheet-grid th.is-label, .sheet-grid td.is-label { background: #d1fae5; }
.sheet-grid th.is-value, .sheet-grid td.is-value { background: #dbeafe; }
.sheet-grid th.is-series, .sheet-grid td.is-series { background: #fef3c7; }
.sheet-grid th.is-label { background: #059669; color: #fff; }
.sheet-grid th.is-value { background: #2563eb; color: #fff; }
.sheet-grid th.is-series { background: #d97706; color: #fff; }
.sheet-grid tr.is-header td.is-label { background: #a7f3d0; }
.sheet-grid tr.is-header td.is-value { background: #bfdbfe; }
.sheet-grid tr.is-header td.is-series { background: #fde68a; }

.tree {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  background: #fafffc;
}
.tree details { margin: .2rem 0; }
.tree summary { cursor: pointer; font-weight: 600; color: #0f3b2a; }
.tree label {
  display: flex;
  gap: .45rem;
  align-items: center;
  padding: .32rem .2rem;
  cursor: pointer;
  font-size: .9rem;
  color: #0f3b2a;
}
.tree .sheet-link {
  background: none;
  border: 0;
  color: #1f5a3f;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0;
}
.tree .sheet-link:hover { text-decoration: underline; }

.field, .design-grid label, .form-grid label {
  font-size: 13px;
  font-weight: 600;
  color: #0f3b2a;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field.inline-field { max-width: 240px; margin-bottom: .6rem; }
select, input[type=text], input[type=number], textarea {
  font-family: var(--font);
  font-weight: 400;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: #0f3b2a;
  padding: 9px 12px;
  width: 100%;
  height: 42px;
}
textarea { height: auto; min-height: 72px; }
select:focus, input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 143, 98, .12);
}

.live-box {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: .75rem;
  flex: 1;
  min-height: 480px;
  max-height: 560px;
  display: flex;
  align-items: stretch;
  position: relative;
}
.live-box canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .7rem;
  margin-top: 1rem;
}
.gallery-card {
  background: #fafffc;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: .65rem;
}
.gallery-card h4 { margin: 0 0 .4rem; font-size: .85rem; color: #0f3b2a; }
.gallery-card canvas { width: 100%; background: #fff; border-radius: 8px; }
.gallery-card button { margin-top: .45rem; width: 100%; }

.chart-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-bottom: .8rem;
}
#chart-nav-label { font-size: .9rem; color: var(--text-muted); font-weight: 500; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .75rem;
  align-content: start;
  background: var(--mint-box);
  padding: 18px 20px;
  border-radius: 14px;
}
.form-grid .span-2 { grid-column: span 2; }
.check-inline {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  gap: .45rem !important;
  color: #0f3b2a;
  font-weight: 500 !important;
  margin-top: .35rem;
}

.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .75rem;
  background: var(--mint-box);
  padding: 18px 20px;
  border-radius: 14px;
}
.design-grid input[type=color] { height: 38px; padding: 0; border: 0; background: transparent; }
.palette-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.filmstrip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .8rem;
  margin-top: 1rem;
}
.thumb {
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  overflow: hidden;
  background: #fff;
  color: #0f3b2a;
  padding: .65rem;
  font-size: .75rem;
}
.thumb canvas { width: 100%; background: #fff; }
.thumb .t-title { font-weight: 700; margin-bottom: .35rem; }
.thumb .t-meta { color: #5a7a68; font-size: .72rem; }

.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #0f3b2a;
  color: #fff;
  padding: 14px 26px;
  border-radius: 50px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  z-index: 999;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(80px);
  opacity: 0;
  transition: .3s ease;
  pointer-events: none;
  margin: 0;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.is-error { background: #991b1b; }

.muted { color: var(--text-muted); font-size: .88rem; font-weight: 400; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  background: #0f3b2a;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
}
.skip-link:focus {
  left: 12px;
}
.noscript {
  margin: 0;
  padding: 12px 16px;
  background: #fef3c7;
  color: #92400e;
  text-align: center;
  font-weight: 600;
}
.ico {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.12em;
  background: currentColor;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}
.ico-invoice { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M6 2h9l5 5v15a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm8 1.5V8h4.5L14 3.5zM8 11h8v1.5H8V11zm0 3h8v1.5H8V14zm0 3h5v1.5H8V17z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M6 2h9l5 5v15a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm8 1.5V8h4.5L14 3.5zM8 11h8v1.5H8V11zm0 3h8v1.5H8V14zm0 3h5v1.5H8V17z'/></svg>"); }
.ico-excel { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M4 3h10l6 6v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm9 1.5V10h5.5L13 4.5zM7.2 12l2.3 3.2L7.1 18.5h2l1.5-2.2 1.5 2.2h2L12.4 15.2 14.8 12h-2l-1.5 2.1L9.8 12H7.2z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M4 3h10l6 6v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm9 1.5V10h5.5L13 4.5zM7.2 12l2.3 3.2L7.1 18.5h2l1.5-2.2 1.5 2.2h2L12.4 15.2 14.8 12h-2l-1.5 2.1L9.8 12H7.2z'/></svg>"); }
.ico-info { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm0 8.2a1.1 1.1 0 0 0-1.1 1.1v5.2a1.1 1.1 0 1 0 2.2 0v-5.2A1.1 1.1 0 0 0 12 10.2zm0-3.4a1.3 1.3 0 1 0 0 2.6 1.3 1.3 0 0 0 0-2.6z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm0 8.2a1.1 1.1 0 0 0-1.1 1.1v5.2a1.1 1.1 0 1 0 2.2 0v-5.2A1.1 1.1 0 0 0 12 10.2zm0-3.4a1.3 1.3 0 1 0 0 2.6 1.3 1.3 0 0 0 0-2.6z'/></svg>"); }
.ico-down { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M6.7 9.3 12 14.6l5.3-5.3 1.4 1.4L12 17.4 5.3 10.7z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M6.7 9.3 12 14.6l5.3-5.3 1.4 1.4L12 17.4 5.3 10.7z'/></svg>"); }
.ico-left { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M14.7 6.7 9.4 12l5.3 5.3-1.4 1.4L6.6 12l6.7-6.7z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M14.7 6.7 9.4 12l5.3 5.3-1.4 1.4L6.6 12l6.7-6.7z'/></svg>"); }
.ico-right { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M9.3 6.7 16 12l-6.7 5.3-1.4-1.4L12.6 12 7.9 8.1z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M9.3 6.7 16 12l-6.7 5.3-1.4-1.4L12.6 12 7.9 8.1z'/></svg>"); }
.ico-image { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm2 11 3.2-4.2 2.3 3 3.1-4.1L19 15H7zm1.5-6.2a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm2 11 3.2-4.2 2.3 3 3.1-4.1L19 15H7zm1.5-6.2a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z'/></svg>"); }
.ico-pen { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M3 17.2V21h3.8l11-11.1-3.8-3.8L3 17.2zM20.7 7a1 1 0 0 0 0-1.4l-2.3-2.3a1 1 0 0 0-1.4 0l-1.8 1.8 3.8 3.8L20.7 7z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M3 17.2V21h3.8l11-11.1-3.8-3.8L3 17.2zM20.7 7a1 1 0 0 0 0-1.4l-2.3-2.3a1 1 0 0 0-1.4 0l-1.8 1.8 3.8 3.8L20.7 7z'/></svg>"); }
.ico-columns { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M3 4h7v16H3V4zm11 0h7v16h-7V4z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M3 4h7v16H3V4zm11 0h7v16h-7V4z'/></svg>"); }
.ico-magic { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M7.5 3 9 6.5 12.5 8 9 9.5 7.5 13 6 9.5 2.5 8 6 6.5 7.5 3zm9.1 4.1 1.4 1.4-11 11-1.4-1.4 11-11zM16 13l1.2 2.8L20 17l-2.8 1.2L16 21l-1.2-2.8L12 17l2.8-1.2L16 13z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M7.5 3 9 6.5 12.5 8 9 9.5 7.5 13 6 9.5 2.5 8 6 6.5 7.5 3zm9.1 4.1 1.4 1.4-11 11-1.4-1.4 11-11zM16 13l1.2 2.8L20 17l-2.8 1.2L16 21l-1.2-2.8L12 17l2.8-1.2L16 13z'/></svg>"); }
.ico-table { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M3 5h18v14H3V5zm2 2v3h14V7H5zm0 5v5h6v-5H5zm8 0v5h6v-5h-6z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M3 5h18v14H3V5zm2 2v3h14V7H5zm0 5v5h6v-5H5zm8 0v5h6v-5h-6z'/></svg>"); }
.ico-download { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M11 3h2v10.2l3.2-3.2 1.4 1.4L12 17l-5.6-5.6 1.4-1.4L11 13.2V3zM4 19h16v2H4v-2z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M11 3h2v10.2l3.2-3.2 1.4 1.4L12 17l-5.6-5.6 1.4-1.4L11 13.2V3zM4 19h16v2H4v-2z'/></svg>"); }
.ico-expand { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M4 4h7v2H6v5H4V4zm9 0h7v7h-2V6h-5V4zM4 13h2v5h5v2H4v-7zm14 0h2v7h-7v-2h5v-5z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M4 4h7v2H6v5H4V4zm9 0h7v7h-2V6h-5V4zM4 13h2v5h5v2H4v-7zm14 0h2v7h-7v-2h5v-5z'/></svg>"); }
.ico-trash { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M9 3h6l1 2h4v2H4V5h4l1-2zm1 6h2v9h-2V9zm4 0h2v9h-2V9zM8 9h2v9H8V9z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M9 3h6l1 2h4v2H4V5h4l1-2zm1 6h2v9h-2V9zm4 0h2v9h-2V9zM8 9h2v9H8V9z'/></svg>"); }
.ico-x,
.ico-times { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M6.7 5.3 12 10.6l5.3-5.3 1.4 1.4L13.4 12l5.3 5.3-1.4 1.4L12 13.4l-5.3 5.3-1.4-1.4L10.6 12 5.3 6.7z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M6.7 5.3 12 10.6l5.3-5.3 1.4 1.4L13.4 12l5.3 5.3-1.4 1.4L12 13.4l-5.3 5.3-1.4-1.4L10.6 12 5.3 6.7z'/></svg>"); }

.eti-limits {
  margin-top: 8px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: #fafffc;
  font-size: 13px;
  color: var(--text-secondary);
}
.eti-limits h4 { margin: 0 0 8px; color: #0f3b2a; font-size: 15px; }
.eti-limits ul { margin: 0; padding-left: 18px; }

@media (max-width: 720px) {
  .topbar { position: static; }
  .excel-to-invoice-app .shell { width: 100%; }
  .grid-wrap { max-height: 360px; min-height: 280px; }
  .live-box { min-height: 280px; max-height: 360px; }
  .sample-pane .sample-wrap {
    height: auto;
    min-height: 140px;
    max-height: 220px;
  }
  .form-grid .span-2 { grid-column: span 1; }
  .dropzone { min-height: 150px; padding: 28px 14px; }
  .dropzone .ico { width: 40px; height: 40px; }
  .actions { flex-direction: column; align-items: stretch; }
  .excel-to-invoice-app .btn { width: 100%; justify-content: center; }
  .excel-to-invoice-app .file-list .btn,
  .excel-to-invoice-app .eti-btn-sample { width: auto; }
  .toast { left: 16px; right: 16px; bottom: 16px; }
  .guide-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .eti-options-grid { grid-template-columns: 1fr !important; }
  .eti-limits { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .eti-limits table { min-width: 520px; }
}

.map-filter-row { margin: 8px 0 12px; }
.map-filter-row input[type="search"] {
  width: 100%;
  max-width: 360px;
  height: 42px;
  border: 1px solid #c6dcd0;
  border-radius: 10px;
  padding: 9px 12px;
  font-family: var(--font);
}
.map-group-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #1f5a3f;
  margin-top: 6px;
}
.tree-menu { min-width: 280px; max-height: 360px; overflow: auto; }
.tree-menu .tree { border: 0; padding: 6px 4px; background: transparent; }
.tree .col-meta { margin-left: auto; font-size: 11px; color: #5a7a68; font-weight: 600; }
.tree summary label { display: inline-flex; }

.logo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.inline-add {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #0f3b2a;
}
.inline-add select { width: auto; min-width: 180px; height: 38px; }
.collage-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 10px 0 12px;
}
.collage-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.collage-item {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  background: #fff;
  border: 1px solid #c6dcd0;
  border-radius: 12px;
  padding: 8px 12px;
}
.collage-item.is-off { opacity: .55; }
.collage-item .c-title { font-weight: 700; min-width: 140px; }
.collage-item .c-vis { flex-direction: row !important; align-items: center; gap: 6px !important; font-weight: 500; font-size: 13px; }
.collage-item select, .collage-item input[type="text"] { width: auto; min-width: 110px; height: 34px; padding: 4px 8px; }

.split.invoice-split {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 1fr);
  align-items: start;
  gap: 1rem;
}
.split.invoice-split > .cols-pane,
.split.invoice-split > .preview-pane.invoice-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.split.invoice-split .col-map-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.split.invoice-split .preview-pane .live-box,
.split.invoice-split .invoice-side .live-box,
.split.invoice-split .invoice-live,
.split.invoice-split .invoice-live.is-expanded,
.split.invoice-split .invoice-side .invoice-live.is-expanded {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
}
@media (max-width: 960px) {
  .split.invoice-split { grid-template-columns: 1fr; }
  .split.invoice-split > .cols-pane,
  .split.invoice-split > .preview-pane.invoice-side {
    overflow: visible;
    height: auto !important;
  }
}
.cols-pane .compact-grid {
  height: 280px;
  min-height: 220px;
  max-height: 280px;
}
.col-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  max-height: 220px;
  overflow: auto;
}
.col-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #c6dcd0;
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: grab;
  font-family: var(--font);
  color: #0f3b2a;
}
.col-chip:active { cursor: grabbing; }
.col-chip .col-letter {
  font-weight: 800;
  font-size: 11px;
  background: #e4eee8;
  border-radius: 6px;
  padding: 2px 6px;
}
.col-chip .col-name { font-size: 13px; font-weight: 600; }
.col-chip .col-slot { font-size: 11px; font-weight: 700; color: #1f5a3f; }
.col-chip.is-mapped-x { background: #d1fae5; border-color: #6ee7b7; }
.col-chip.is-mapped-y { background: #dbeafe; border-color: #93c5fd; }
.col-chip.is-picked { outline: 2px solid #1f5a3f; box-shadow: 0 0 0 3px rgba(31, 90, 63, .15); }

.preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.preview-toolbar .preview-heading { margin: 0; }
.inv-nav { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #1c4935; }
.excel-to-invoice-app .btn-tiny { padding: 6px 12px; min-width: 0; }
.excel-to-invoice-app .eti-preview-fs-btn {
  margin-left: 4px;
  min-width: 34px;
  height: 34px;
  padding: 6px 10px;
}
.excel-to-invoice-app .eti-preview-fs-btn .ico { width: 16px; height: 16px; }

.eti-fs-preview {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
}
.eti-fs-preview[hidden] { display: none !important; }
.eti-fs-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 20, 13, 0.72);
  backdrop-filter: blur(2px);
}
.eti-fs-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1100px, calc(100vw - 24px));
  height: min(96vh, calc(100vh - 24px));
  margin: 12px auto;
  background: #f7faf8;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.eti-fs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #0f3b2a, #1f5a3f);
  color: #fff;
  flex: 0 0 auto;
}
.eti-fs-toolbar h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eti-fs-toolbar .ico { background: #b8f0c4; }
.eti-fs-toolbar .inv-nav { color: #e8f5e9; }
.eti-fs-toolbar .btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.eti-fs-toolbar .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.eti-fs-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #dce8e1;
  border-radius: 0;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.eti-fs-body .inv-a4-frame {
  box-shadow: 0 16px 40px rgba(18, 38, 27, 0.18);
}
body.eti-fs-open { overflow: hidden; }

@media (max-width: 720px) {
  .eti-fs-dialog {
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
  }
  .eti-fs-toolbar { padding: 10px 12px; }
  .eti-fs-body { padding: 12px; }
}

.invoice-live {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
  background: #e4eee8;
  border-radius: 10px;
  padding: 12px;
}
.invoice-live.is-expanded,
.invoice-side .invoice-live.is-expanded {
  min-height: 0;
}
.invoice-side .live-box {
  height: auto;
  min-height: 0;
}

.inv-a4-frame {
  width: 210mm;
  height: 297mm;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 28px rgba(18, 38, 27, 0.12);
  flex: 0 0 auto;
}
.inv-paper {
  width: 210mm;
  height: 297mm;
  min-height: 297mm;
  box-sizing: border-box;
  background: #fff;
  color: var(--inv-text, #1b1b1b);
  padding: 14mm 16mm 18mm;
  overflow: auto;
  transform-origin: top left;
  display: flex;
  flex-direction: column;
}
.inv-canvas {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px 0;
  flex: 1 1 auto;
}
.inv-sec { box-sizing: border-box; padding: 6px 10px 10px 0; }
.inv-sec.w-12 { width: 100%; flex: 0 0 100%; max-width: 100%; }
.inv-sec.w-6 { width: 50%; flex: 0 0 50%; max-width: 50%; min-height: 96px; }
.inv-sec.w-4 { width: 33.333%; flex: 0 0 33.333%; max-width: 33.333%; min-height: 96px; }
.inv-ship-reserve { min-height: 96px; }
.inv-party-body { min-height: 88px; }
.inv-notes-body { min-height: 56px; margin: 0; }
.inv-dropbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.drop-slot {
  border: 1px dashed #9cc2ad;
  background: #f7fbf9;
  color: #1c4935;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
}
.drop-slot.is-filled { background: #d1fae5; border-style: solid; border-color: #6ee7b7; }
.drop-slot.is-over { background: #fef3c7; border-color: #f59e0b; }
.inv-kicker {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--inv-primary, #0f3b2a);
}
.inv-title { font-weight: 800; color: var(--inv-primary, #0f3b2a); line-height: 1.1; }
.inv-co { margin: 4px 0 0; font-weight: 700; font-size: 16px; color: var(--inv-primary, #0f3b2a); }
.inv-muted { margin: 2px 0; color: #5a7a68; font-size: 12px; }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.inv-head-right { text-align: right; flex: 0 0 auto; min-width: 140px; }
.inv-logo { max-height: 56px; max-width: 160px; display: block; }
.inv-logo-space { height: 56px; width: 160px; margin: 0 0 8px; display: flex; align-items: center; }
.inv-logo-space.is-empty {
  border: 1px dashed #c6dcd0;
  background: #f7fbf9;
  color: #8aa896;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  justify-content: center;
}
.inv-meta { width: auto; border-collapse: collapse; font-size: 13px; table-layout: auto; }
.inv-meta td { padding: 2px 0; vertical-align: top; text-align: left; }
.inv-meta .lbl { width: 1%; text-align: left; color: #5a7a68; white-space: nowrap; padding-right: 10px; }
.inv-items { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: 13px; table-layout: fixed; }
.inv-items th {
  background: var(--inv-primary, #0f3b2a);
  color: #fff;
  text-align: left;
  padding: 8px;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.inv-items td { padding: 7px 8px; border-bottom: 1px solid #e5eee8; height: 28px; }
.inv-items th.num, .inv-items td.num { text-align: right; }
.inv-items.ts-none th {
  border-bottom: 0;
}
.inv-items.ts-none td { border-bottom: 0; background: transparent; }
.inv-items.ts-light-green th { background: #C6EFCE; color: #375623; }
.inv-items.ts-light-green tbody tr:nth-child(even) td { background: #E2F0E6; }
.inv-items.ts-light-blue th { background: #BDD7EE; color: #1F4E79; }
.inv-items.ts-light-blue tbody tr:nth-child(even) td { background: #DDEBF7; }
.inv-items.ts-light-orange th { background: #FCE4D6; color: #C65911; }
.inv-items.ts-light-orange tbody tr:nth-child(even) td { background: #FDE9D9; }
.inv-items.ts-light-gray th { background: #D9D9D9; color: #3F3F3F; }
.inv-items.ts-light-gray tbody tr:nth-child(even) td { background: #F2F2F2; }
.inv-items.ts-light-purple th { background: #E2D5F1; color: #5B2C6F; }
.inv-items.ts-light-purple tbody tr:nth-child(even) td { background: #F3E8FF; }
.inv-items.ts-light-teal th { background: #C5E8E0; color: #0D5C4D; }
.inv-items.ts-light-teal tbody tr:nth-child(even) td { background: #E6F6F3; }
.inv-items.ts-medium-green th { background: #548235; color: #fff; }
.inv-items.ts-medium-green tbody tr:nth-child(even) td { background: #C6EFCE; }
.inv-items.ts-medium-blue th { background: #5B9BD5; color: #fff; }
.inv-items.ts-medium-blue tbody tr:nth-child(even) td { background: #BDD7EE; }
.inv-items.ts-medium-orange th { background: #ED7D31; color: #fff; }
.inv-items.ts-medium-orange tbody tr:nth-child(even) td { background: #FCE4D6; }
.inv-items.ts-medium-gray th { background: #7F7F7F; color: #fff; }
.inv-items.ts-medium-gray tbody tr:nth-child(even) td { background: #D9D9D9; }
.inv-items.ts-medium-purple th { background: #7030A0; color: #fff; }
.inv-items.ts-medium-purple tbody tr:nth-child(even) td { background: #E2D5F1; }
.inv-items.ts-medium-teal th { background: #2E8B7A; color: #fff; }
.inv-items.ts-medium-teal tbody tr:nth-child(even) td { background: #C5E8E0; }
.inv-items.ts-dark-green th { background: #0F3B2A; color: #fff; }
.inv-items.ts-dark-green tbody tr:nth-child(even) td { background: #E8F3EC; }
.inv-items.ts-dark-blue th { background: #1F4E79; color: #fff; }
.inv-items.ts-dark-blue tbody tr:nth-child(even) td { background: #D6E3F0; }
.inv-items.ts-dark-orange th { background: #C65911; color: #fff; }
.inv-items.ts-dark-orange tbody tr:nth-child(even) td { background: #F8E0D0; }
.inv-items.ts-dark-gray th { background: #3F3F3F; color: #fff; }
.inv-items.ts-dark-gray tbody tr:nth-child(even) td { background: #E6E6E6; }
.inv-items.ts-dark-black th { background: #1B1B1B; color: #fff; }
.inv-items.ts-dark-black tbody tr:nth-child(even) td { background: #F2F2F2; }
.inv-items.ts-dark-teal th { background: #0D5C4D; color: #fff; }
.inv-items.ts-dark-teal tbody tr:nth-child(even) td { background: #D7EFEA; }
.inv-company-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #c6dcd0;
  font-size: 12px;
  color: #5a7a68;
  white-space: pre-line;
  width: 100%;
}
.inv-company-footer p { margin: 2px 0; }
.inv-top-banner {
  width: 100%;
  margin: 0 0 14px;
  padding: 0 0 10px;
  border-bottom: 1px solid #c6dcd0;
  font-size: 12px;
  color: #5a7a68;
  line-height: 1.4;
  white-space: pre-line;
}
.inv-top-banner p { margin: 2px 0; }
.inv-items .num, .inv-tot .num { text-align: right; }
.inv-tot { width: auto; margin-left: auto; margin-top: 8px; border-collapse: collapse; font-size: 13px; }
.inv-tot td { padding: 4px 0 4px 16px; text-align: right; white-space: nowrap; }
.inv-tot td:first-child { padding-left: 0; padding-right: 12px; }
.inv-tot .grand { font-weight: 800; color: var(--inv-primary, #0f3b2a); font-size: 15px; }
.inv-sign { margin-top: 8px; border-top: 1px solid #c6dcd0; padding-top: 6px; width: 70%; font-size: 13px; }
.inv-sign-img { max-height: 72px; max-width: 220px; display: block; margin: 4px 0 6px; background: transparent; }

.logic-card {
  margin: 10px 0 0;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #c6dcd0;
  border-radius: 10px;
  font-size: 13px;
  color: #1c4935;
}
.cols-pane .ship-to-toggle {
  margin: 8px 0 2px;
}
.cols-pane .ship-to-toggle + .field-hint {
  margin: 0 0 10px;
}
.col-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0 10px;
}
.col-map-toolbar input[type="search"] {
  flex: 1;
  min-width: 140px;
  height: 38px;
  border: 1px solid #c6dcd0;
  border-radius: 10px;
  padding: 6px 12px;
  font-family: var(--font);
}
.col-map-toolbar .excel-to-invoice-app .btn,
.excel-to-invoice-app .col-map-toolbar .btn { padding: 8px 14px; width: auto; }
.col-map-wrap {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 0;
}
.data-table-full {
  margin-top: 16px;
  background: #f7fbf9;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 16px 18px;
}
.data-table-full .preview-heading { margin-top: 0; }
.data-table-full .grid-wrap,
.data-table-wrap {
  width: 100%;
  min-height: 280px;
  max-height: 420px;
  height: auto;
  flex: none;
}

.layout-editor {
  margin-top: 8px;
  padding: 14px 14px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: #f7fbf9;
}
.layout-editor-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 10px;
}
.layout-editor-label {
  display: block;
  font-weight: 700;
  color: #0f3b2a;
  margin: 0 0 2px;
}
.layout-hint { margin: 0; max-width: 36rem; }
.layout-editor-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.layout-spacing {
  margin: 0 !important;
  font-size: 13px;
  font-weight: 600;
  color: #0f3b2a;
}
.layout-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.layout-empty {
  grid-column: 1 / -1;
  margin: 4px 0;
}
.layout-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(78px, 90px) auto;
  align-items: center;
  gap: 8px 8px;
  padding: 12px 12px;
  background: #fff;
  border: 1px solid #deece4;
  border-radius: 12px;
  min-height: 56px;
}
.layout-row.is-full {
  grid-column: 1 / -1;
}
.layout-row.is-off {
  background: #f3f6f4;
  opacity: .78;
}
.layout-show {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  min-width: 0;
  cursor: pointer;
  font-weight: 600;
  color: #0f3b2a;
}
.layout-show input {
  width: auto;
  height: auto;
  accent-color: #1f5a3f;
  flex: 0 0 auto;
}
.layout-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.layout-width {
  width: 100%;
  height: 34px;
  padding: 4px 6px;
  border: 1px solid #c6dcd0;
  border-radius: 8px;
  background: #fff;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: #0f3b2a;
}
.layout-size {
  display: none;
}
.layout-move {
  display: flex;
  align-items: center;
  gap: 4px;
}
.layout-move .btn {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  line-height: 1;
}
.layout-remove {
  color: #991b1b !important;
}
.layout-custom {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 2px;
}
.layout-custom label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #4a6354;
}
.layout-custom select,
.layout-custom input[type="text"] {
  height: 34px;
  padding: 4px 8px;
  border: 1px solid #c6dcd0;
  border-radius: 8px;
  font-family: var(--font);
  font-weight: 500;
  color: #0f3b2a;
}
.layout-add-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e4eee8;
}
.layout-add-row select {
  flex: 1;
  min-width: 160px;
  height: 38px;
  padding: 6px 10px;
  border: 1px solid #c6dcd0;
  border-radius: 10px;
  background: #fff;
  font-family: var(--font);
}
.layout-add-row .btn { width: auto; padding: 8px 16px; }

@media (max-width: 720px) {
  .layout-list { grid-template-columns: 1fr; }
  .layout-row { grid-template-columns: minmax(0, 1fr) minmax(78px, 90px) auto; }
  .layout-custom { grid-template-columns: 1fr; }
  .layout-editor-tools { width: 100%; justify-content: space-between; }
}

.col-map-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.col-map-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #1a4a2a;
  color: #fff;
  text-align: left;
  padding: 8px 10px;
  font-weight: 600;
}
.col-map-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #deece4;
  vertical-align: middle;
}
.col-map-table tr.is-header-map { background: #ecfdf5; }
.col-map-table tr.is-line { background: #eff6ff; }
.col-letter-cell { font-weight: 800; width: 42px; color: #1f5a3f; }
.col-name-cell { font-weight: 600; }
.col-sample-cell {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #5a7a68;
  font-size: 12px;
}
.col-map-table select {
  height: 36px;
  width: 100%;
  min-width: 140px;
  font-size: 13px;
}
.signature-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  border: 1px solid #c6dcd0;
  border-radius: 12px;
  padding: 12px;
}
.color-combo {
  display: flex;
  gap: 12px;
  align-items: stretch;
  background: #fff;
  border: 1px solid #c6dcd0;
  border-radius: 12px;
  padding: 12px 14px;
}
.color-combo-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: #1f5a3f;
}
.color-combo-item input[type="color"] {
  width: 100%;
  height: 40px;
  padding: 2px 4px;
  border: 1px solid #c6dcd0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.opt-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0 0 4px;
}
.opt-section-head h4,
.opt-section-head > label {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0f3b2a;
}
.opt-section-head .btn {
  flex: 0 0 auto;
  width: auto;
}
.brand-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.brand-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  border: 1px solid #c6dcd0;
  border-radius: 12px;
  padding: 12px;
  min-width: 0;
}
.brand-card h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #0f3b2a;
}
.brand-card .logo-row { margin: 0; }
.brand-card .size-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-card .size-row label {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #1f5a3f;
  white-space: nowrap;
}
.brand-card .size-row select {
  flex: 1;
  min-width: 0;
}
.ship-to-toggle {
  margin: 4px 0 0;
}
.ship-to-toggle + .field-hint { margin-bottom: 12px; }
.table-style-opt { margin: 4px 0 14px; }
.none-header-colors {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  background: #fff;
  border: 1px solid #c6dcd0;
  border-radius: 12px;
  padding: 10px 12px;
}
.none-header-colors[hidden] { display: none; }
.footer-place-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin-top: 8px;
}
.footer-place-row .check-inline { margin-top: 0; }
.table-style-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
  border: 1px solid #c6dcd0;
  border-radius: 12px;
  padding: 10px 12px;
}
.ts-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.ts-row-label {
  width: 64px;
  font-size: 12px;
  font-weight: 700;
  color: #1f5a3f;
}
.ts-chip, .ts-swatch {
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  font-family: var(--font);
}
.ts-chip {
  height: 32px;
  padding: 0 12px;
  background: #f4faf6;
  color: #0f3b2a;
  font-size: 12px;
  font-weight: 700;
}
.ts-swatch {
  width: 28px;
  height: 28px;
  box-shadow: inset 0 0 0 1px rgba(15, 59, 42, .18);
}
.ts-chip.is-on, .ts-swatch.is-on {
  border-color: #0f3b2a;
  box-shadow: 0 0 0 2px rgba(15, 59, 42, .2);
}
#logo-preview-wrap img {
  max-height: 56px;
  max-width: 160px;
  object-fit: contain;
}
.sig-preview-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.sig-preview-wrap img {
  max-height: 72px;
  max-width: 220px;
  background: repeating-conic-gradient(#e8eee9 0% 25%, #fff 0% 50%) 50% / 12px 12px;
  border: 1px solid #deece4;
  border-radius: 8px;
  padding: 6px;
}
.check-inline input[type="checkbox"] { width: auto; height: auto; accent-color: #1f5a3f; }
.brand-card .check-inline { margin: 0 0 8px; display: flex; }

@media (max-width: 720px) {
  .inv-sec.w-6, .inv-sec.w-4 { width: 100%; flex: 0 0 100%; max-width: 100%; }
  .inv-head { flex-direction: column; }
  .inv-head-right { text-align: left; }
  .cols-pane .compact-grid { height: 200px; min-height: 160px; max-height: 200px; }
  .invoice-side .live-box { min-height: 0; max-height: none; }
  .col-map-toolbar .btn { width: auto; }
  .brand-pair { grid-template-columns: 1fr; }
  .color-combo { flex-direction: column; }
}
