.demo-body { background: var(--ground); }
.muted { color: var(--muted); }
.orange { color: var(--orange); }

.demo-banner { background: var(--orange-tint); color: var(--orange-ink); font-size: 14px; padding: 8px 20px; display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; }
.demo-banner-links { display: flex; gap: 16px; align-items: center; }
.demo-banner-links a:not(.btn) { color: var(--orange-ink); }
.demo-banner .btn { min-height: 38px; padding: 0 14px; font-size: 14px; }

.app { display: flex; flex-wrap: wrap; min-height: calc(100vh - 54px); }
.app-side { flex: 1 1 240px; max-width: 100%; background: var(--ink); color: #e8eaee; padding: 24px 18px; display: flex; flex-direction: column; gap: 28px; }
.app-side .brand { color: #fff; padding: 0 6px; }
.side-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.side-steps li { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; color: #9aa1ae; font-size: 15px; }
.side-steps li span { flex: none; width: 26px; height: 26px; border-radius: 8px; background: #23262d; color: #b4bac5; display: flex; align-items: center; justify-content: center; font: 600 13px/1 var(--mono); }
.side-steps li.is-current { background: #1b3b38; color: #fff; font-weight: 600; }
.side-steps li.is-current span { background: var(--mint); color: var(--ink); }
.side-steps li.is-done span { background: var(--teal); color: #fff; }
.side-note { font-size: 13px; color: #9aa1ae; padding: 0 8px; }

.app-main { flex: 999 1 720px; min-width: 0; padding: 32px; max-width: 1240px; }
.step-panel { display: flex; flex-direction: column; gap: 18px; animation: rise 0.35s ease both; }
.step-panel[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.panel-title { font: 700 32px/1.1 var(--display); letter-spacing: -0.025em; }
.panel-title:focus { outline: none; }
.panel-sub { color: var(--muted); font-size: 16px; }

.btn-wide { width: 100%; }
.link-btn { background: none; border: 0; color: #b4bac5; font: 500 14px/1 var(--sans); text-decoration: underline; cursor: pointer; padding: 12px 0; align-self: flex-start; }
.link-btn:hover { color: #fff; }

/* inbox */
.inbox { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.mail-list { flex: 1 1 280px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mail { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.mail:last-child { border-bottom: 0; }
.mail.is-open { background: var(--teal-tint); }
.mail-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mail-text strong { font-size: 15px; }
.mail-text span { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-time { font-size: 13px; color: var(--muted); white-space: nowrap; }
.vendor-tile.alt { background: #eceef2; color: var(--ink-3); }
.vendor-tile.big { width: 56px; height: 56px; border-radius: 16px; font-size: 20px; }

.mail-view { flex: 2 1 420px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.mail-head { display: flex; gap: 12px; align-items: center; }
.mail-head small { display: block; color: var(--muted); font-size: 13px; }
.mail-subject { font: 700 24px/1.2 var(--display); }
.mail-view p { color: var(--ink-3); }
.attachment { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; align-self: flex-start; }
.attachment small { display: block; color: var(--muted); font-size: 13px; }

/* processing */
.proc-list { list-style: none; margin: 0; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 4px; max-width: 720px; }
.proc-list li { display: flex; gap: 14px; align-items: center; padding: 12px 0; font-size: 17px; color: #9aa1ae; transition: color 0.3s; }
.proc-list li.is-done { color: var(--ink); }
.proc-list li.is-active { color: var(--ink-3); }
.tick { flex: none; width: 26px; height: 26px; border-radius: 13px; border: 2px solid #d3d7de; display: flex; align-items: center; justify-content: center; }
.proc-list li.is-active .tick { border-color: var(--teal); border-right-color: transparent; animation: spin 0.8s linear infinite; }
.proc-list li.is-done .tick { background: var(--teal); border-color: var(--teal); }
.proc-list li.is-done .tick::after { content: ""; width: 10px; height: 6px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: translateY(-1px) rotate(-45deg); }
@keyframes spin { to { transform: rotate(360deg); } }

/* review */
.review-id { display: flex; gap: 16px; align-items: center; }
.review-id small { color: var(--muted); font-size: 14px; }
.impact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; display: flex; flex-wrap: wrap; gap: 28px 48px; align-items: flex-end; }
.impact-copy { flex: 1 1 300px; display: flex; flex-direction: column; gap: 14px; }
.impact .big-stat .n { font-size: 84px; }
.impact-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--muted); }
.impact-facts strong { color: var(--ink); }
.impact-facts strong.orange { color: var(--orange); }
.hist { flex: 1 1 380px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.hist figcaption { font-size: 13px; color: var(--muted); }
.hist-bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; border-bottom: 1px solid #d3d7de; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar span { font: 500 12px/1 var(--mono); }
.bar::after { content: ""; width: 100%; height: var(--h); border-radius: 4px 4px 0 0; background: var(--bar-ok); animation: grow 0.6s ease both; transform-origin: bottom; }
.bar.under::after { background: var(--bar-under); }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.floor { flex: none; align-self: stretch; width: 2px; border-left: 2px dashed var(--ink); position: relative; }
.floor span { position: absolute; top: -2px; left: 8px; white-space: nowrap; font-size: 12px; font-weight: 600; }
.hist-labels { display: flex; gap: 8px; font-size: 12px; color: var(--muted); }
.hist-labels span { flex: 1; text-align: center; }
.hist-labels .gap { flex: none; width: 2px; }

.review-grid { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.items { flex: 999 1 600px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.items-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; padding: 16px 20px 10px; }
.items-head h2 { font: 700 18px/1.2 var(--display); }
.items-head .muted { font-size: 14px; }
.ok-head { border-top: 1px solid var(--line); margin-top: 6px; }
.items-scroll { overflow-x: auto; }
.items-table { min-width: 720px; }
.item-row { display: grid; grid-template-columns: minmax(220px, 2.2fr) minmax(120px, 1fr) 180px 170px; gap: 16px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line-soft); }
.item-row .desc { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.item-row .desc strong { font-size: 15px; font-weight: 500; }
.item-row .desc small { font: 400 12px/1.3 var(--mono); color: var(--muted); }
.item-row .desc .note { font: 400 12px/1.3 var(--sans); color: var(--orange); }
.item-row .cost { display: flex; flex-direction: column; gap: 3px; font: 400 13px/1.3 var(--mono); }
.item-row .cost small { font: 400 12px/1.3 var(--sans); color: var(--muted); }
.margin-cell { display: flex; flex-direction: column; gap: 2px; }
.margin-cell .vals { font: 400 12px/1.3 var(--mono); color: var(--muted); }
.margin-cell .vals b { color: var(--orange); }
.price-cell { display: flex; flex-direction: column; gap: 4px; }
.price-input { display: flex; align-items: center; border: 1.5px solid var(--teal); border-radius: 10px; padding: 0 10px; min-height: 44px; background: #fff; max-width: 150px; }
.price-input span { font: 600 15px/1 var(--mono); color: var(--muted); }
.price-input input { border: 0; width: 100%; min-width: 0; font: 600 15px/1 var(--mono); color: var(--ink); padding: 0 0 0 2px; background: transparent; }
.price-input input:focus { outline: none; }
.price-input:focus-within { outline: 3px solid var(--mint); outline-offset: 2px; }
.price-cell .after { font-size: 12px; }
.price-cell .after.good { color: var(--teal); font-weight: 600; }
.price-cell .after.bad { color: var(--orange); font-weight: 600; }
.keep { font-size: 14px; color: var(--muted); }
.match-btn { min-height: 44px; padding: 0 12px; background: var(--orange-tint); color: var(--orange-ink); border: 0; border-radius: 10px; font: 600 14px/1 var(--sans); cursor: pointer; }
.match-btn:hover { background: #ffe3d1; }
.items-foot { font-size: 14px; color: var(--muted); padding: 14px 20px; border-top: 1px solid var(--line); margin: 0; }

.approve-card { flex: 1 1 280px; min-width: 0; background: var(--ink); color: #e8eaee; border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.approve-card h2 { font: 700 20px/1.2 var(--display); color: #fff; margin-bottom: 6px; }
.approve-card .choice { font-size: 14px; border-bottom: 1px solid #2a2e36; padding: 6px 0; }
.approve-card .choice input { accent-color: var(--mint); }
.approve-card .btn { margin-top: 12px; }
.approve-card p { font-size: 13px; color: #b4bac5; }

/* done */
.erp-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.erp-pick button { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid #d3d7de; background: var(--surface); font: 600 14px/1 var(--sans); color: var(--ink); cursor: pointer; }
.erp-pick button[aria-checked="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.file-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.file-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.file-head strong { display: block; font-size: 15px; }
.file-head small { color: var(--muted); font-size: 13px; }
.csv-table { border-collapse: collapse; width: 100%; min-width: 640px; font: 400 13px/1.4 var(--mono); }
.csv-table th { text-align: left; font: 600 12px/1.3 var(--sans); color: var(--muted); background: #fafbfc; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.csv-table td { padding: 9px 14px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.csv-table td.changed { color: var(--teal-dark); font-weight: 600; }

.done-grid { display: flex; flex-wrap: wrap; gap: 24px; align-items: stretch; }
.reps { flex: 1 1 300px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.reps h2 { font: 700 18px/1.2 var(--display); margin-bottom: 8px; }
.reps ul { list-style: none; margin: 0; padding: 0; }
.reps li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.reps small { display: block; color: var(--muted); font-size: 13px; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 18px; background: var(--teal-tint); color: var(--teal); font: 700 13px/1 var(--sans); display: flex; align-items: center; justify-content: center; }
.cta-card { flex: 2 1 400px; background: var(--ink); color: #e8eaee; border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.cta-card h2 { font: 800 28px/1.1 var(--display); color: #fff; }
.cta-card p { color: #b4bac5; }

/* When the sidebar stacks above the content, lay the steps out in a row. */
@media (max-width: 980px) {
  .app-side { padding: 16px; gap: 14px; }
  .side-steps { flex-direction: row; overflow-x: auto; }
  .side-steps li { white-space: nowrap; font-size: 13px; }
  .side-note { display: none; }
}

@media (max-width: 640px) {
  .app-main { padding: 20px 16px; }
  .panel-title { font-size: 26px; }
  .impact .big-stat .n { font-size: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  .step-panel, .bar::after { animation: none; }
  .proc-list li.is-active .tick { animation: none; }
}

/* email capture at the end of the demo */
.mini-form { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid #2a2e36; padding-top: 16px; }
.mini-form label { font-size: 14px; color: #b4bac5; }
.mini-form-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-form-row input { flex: 1 1 220px; min-width: 0; min-height: 48px; border-radius: 12px; border: 1px solid #3a3f49; background: #1b1e24; color: #fff; padding: 0 14px; font: 400 16px/1 var(--sans); }
.mini-form .form-msg.ok { color: var(--mint); }
.mini-form .form-msg.error { color: #fdba74; }
.mini-fine { font-size: 12px; color: #9aa1ae; }
.mini-fine a { color: #b4bac5; }

/* import-file template editor */
.file-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tpl { border-bottom: 1px solid var(--line); background: #fafbfc; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.tpl-top { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.tpl-top small { display: block; color: var(--muted); font-size: 13px; max-width: 560px; }
.tpl-upload { cursor: pointer; min-height: 44px; font-size: 14px; }
.tpl-upload:focus-within { outline: 3px solid var(--mint); outline-offset: 2px; }
.tpl-cols { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tpl-cols li { display: grid; grid-template-columns: 24px minmax(140px, 1fr) minmax(140px, 1fr) auto; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.tpl-cols li.off { opacity: 0.55; }
.tpl-cols input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--teal); margin: 0; }
.tpl-header, .tpl-value { font: 500 14px/1.2 var(--mono); border: 1px solid #d3d7de; border-radius: 8px; padding: 0 10px; min-height: 38px; width: 100%; min-width: 0; }
.tpl-field { font-size: 13px; color: var(--muted); }
.tpl-move { display: flex; gap: 4px; }
.tpl-move button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid #d3d7de; background: #fff; cursor: pointer; font: 600 15px/1 var(--sans); color: var(--ink); }
.tpl-move button:disabled { opacity: 0.35; cursor: default; }
.tpl-bar { display: flex; gap: 18px; flex-wrap: wrap; }
.link-dark { background: none; border: 0; padding: 8px 0; font: 600 14px/1 var(--sans); color: var(--teal); cursor: pointer; }
.link-dark:hover { color: var(--teal-dark); text-decoration: underline; }
.tpl-opts { display: flex; flex-wrap: wrap; gap: 14px 22px; }
.tpl-opts label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.tpl-opts select { font: 400 14px/1 var(--sans); min-height: 40px; border: 1px solid #c9ced6; border-radius: 8px; padding: 0 10px; background: #fff; }
.tpl-note { font-size: 14px; color: var(--teal-dark); min-height: 20px; }
@media (max-width: 640px) {
  .tpl-cols li { grid-template-columns: 24px 1fr; }
  .tpl-cols li > .tpl-field, .tpl-cols li > .tpl-value, .tpl-cols li > .tpl-move { grid-column: 2; }
}
