.site-nav .nav-demo { color: #ffd24c; }
.site-nav .nav-demo:hover { text-decoration: underline; text-underline-offset: 4px; }

.demo-section {
  padding-block: clamp(48px, 6vw, 88px);
  background: var(--section);
  border-top: 1px solid var(--rule);
}
.demo-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(0, .84fr);
  align-items: end;
  gap: 24px 52px;
  margin-bottom: clamp(27px, 4vw, 45px);
}
.demo-intro h2 {
  margin-top: 13px;
  font: 600 clamp(48px, 6.3vw, 84px)/.88 "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  letter-spacing: -.009em;
  text-wrap: initial;
}
.demo-intro .section-lead { margin: 0; }
.demo-section noscript a { text-decoration: underline; }

.demo-app {
  --desktop: #f0f0f0;
  --desktop-text: #161616;
  --desktop-rule: #b5b5b5;
  --window-border: #7694a2;
  --grid-blue: #d4e4f1;
  --grid-selection: #b8d7f1;
  --desktop-font: Tahoma, "Segoe UI", sans-serif;
  --focus: #245a93;
  min-width: 0;
  border: 1px solid var(--window-border);
  background: var(--desktop);
  color: var(--desktop-text);
  color-scheme: light;
  font: 400 13px/1.3 var(--desktop-font);
}
.demo-app h3, .demo-app h4 { font: inherit; letter-spacing: 0; }
.demo-app :focus-visible { outline-offset: 1px; }
.demo-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.demo-titlebar {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 23px;
  margin: 0;
  padding: 2px 6px;
  border-top: 1px solid #e5f2ff;
  border-bottom: 1px solid #9eb8d1;
  background: linear-gradient(#b3cce6 0%, #c4d9ee 55%, #e1edf8 100%);
  color: #152a3d;
  font: 400 12px/1.25 var(--desktop-font);
}
.demo-titlebar img { width: 14px; height: 14px; flex: none; }
.demo-app-title { min-height: 25px; }
.demo-app-title img { width: 15px; height: 15px; }
.demo-titlebar h3 { flex: 1; }
.demo-window-close {
  margin-left: auto;
  width: 27px;
  min-height: 17px;
  padding: 0;
  border: 1px solid #9a5b51;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(#efa898 15%, #cf6857 48%, #b44d3f 51%, #cf7964);
  color: #fff;
  font: bold 14px/1 var(--desktop-font);
  cursor: pointer;
}
.demo-window-close:hover { filter: brightness(1.12); }

.demo-tabs {
  display: flex;
  min-height: 31px;
  border-bottom: 1px solid #d2d2d2;
  background: #f4f4f4;
}
.demo-tabs button {
  min-width: clamp(75px, 9vw, 102px);
  padding: 4px 10px;
  border: 0;
  border-right: 1px solid #a9a9a9;
  background: transparent;
  color: var(--desktop-text);
  font: inherit;
  cursor: pointer;
}
.demo-tabs button:hover { background: #e6eef5; }
.demo-tabs button[aria-selected="true"] { background: linear-gradient(#fff, #e4edf6); box-shadow: inset 0 -1px #9cbbd6; }
.demo-pane:focus-visible { outline-offset: -3px; }

.demo-workspace {
  position: relative;
  min-height: 430px;
  padding: 8px 16px 28px clamp(60px, 8vw, 132px);
}
.demo-desktop-icon {
  position: absolute;
  top: 17px;
  left: 12px;
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 53px;
  font-size: 11px;
}
.demo-desktop-icon svg, .demo-pdv-commands svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}
.demo-window {
  position: relative;
  max-width: 795px;
  border: 1px solid var(--window-border);
  background: var(--desktop);
  box-shadow: 1px 1px 0 #8399a74f;
}
.demo-window-body { padding: 7px 6px 5px; }
.demo-registry-fields {
  display: grid;
  grid-template-columns: minmax(64px, .23fr) minmax(0, 1fr);
  gap: 10px;
  max-width: 660px;
  padding: 0 2px 7px;
}
.demo-app label {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 3px;
  font: inherit;
  font-size: 12px;
}
.demo-app input, .demo-app select {
  min-width: 0;
  width: 100%;
  min-height: 25px;
  padding: 2px 5px;
  border: 1px solid #aeaeae;
  border-radius: 0;
  background: #fff;
  color: var(--desktop-text);
  font: inherit;
  box-shadow: inset 1px 1px #0000000b;
}
.demo-app input[readonly], .demo-app input:disabled, .demo-app select:disabled { background: #f4f4f4; color: #3d3d3d; }
.demo-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 5px;
  margin-bottom: 6px;
}
.demo-filter-actions { display: flex; gap: 5px; margin-left: auto; }
.demo-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 31px;
  padding: 4px 9px;
  border: 1px solid #a8a8a8;
  border-radius: 2px;
  background: linear-gradient(#fbfbfb 0%, #eeeeee 43%, #dedede 70%, #d2d2d2 100%);
  box-shadow: inset 1px 1px #fff;
  color: var(--desktop-text);
  font: 400 12px/1.15 var(--desktop-font);
  cursor: pointer;
}
.demo-toolbar .demo-button { min-width: 66px; min-height: 44px; }
.demo-button:hover:not(:disabled) { border-color: #6f9cc2; background: linear-gradient(#f5fcff, #d4e7f6); }
.demo-button:active:not(:disabled) { box-shadow: inset 1px 1px 2px #909ca6; }
.demo-button:disabled { color: #777; cursor: default; }
.demo-row-button { min-height: 22px; padding: 1px 5px; font-size: 11px; white-space: nowrap; }
.demo-save > span { color: #247a2d; font-size: 16px; }
.demo-back > span { color: #ad3a30; font-size: 15px; }

.demo-table-area {
  min-width: 0;
  max-height: 285px;
  overflow: auto;
  border: 1px solid #bcbcbc;
  background: #fff;
}
.demo-window .demo-table-area { min-height: 238px; }
.demo-table {
  width: 100%;
  min-width: max-content;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.demo-table th, .demo-table td {
  padding: 3px 6px;
  border-right: 1px solid #e5e5e5;
  border-bottom: 1px solid #ededed;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
.demo-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: linear-gradient(#fcfcfc, #e2e2e2);
  color: #202020;
  font-size: 11px;
  font-weight: 400;
  box-shadow: inset 0 -1px #c4c4c4;
}
.demo-table td { font-size: 12px; }
.demo-table td:last-child, .demo-table th:last-child { border-right: 0; }
.demo-table tr[data-record-id] { cursor: pointer; }
.demo-table tr[data-record-id]:hover td { background: #e6eff9; }
.demo-table tr.is-selected td { background: var(--grid-selection); }
.demo-table tr.is-selected:hover td { background: var(--grid-selection); }
.demo-record-select {
  position: relative;
  display: block;
  padding: 0 3px 0 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.demo-record-select[aria-pressed="true"]::before {
  position: absolute;
  top: 50%;
  left: 1px;
  width: 0;
  height: 0;
  border-block: 4px solid transparent;
  border-left: 5px solid #172938;
  transform: translateY(-50%);
  content: "";
}
.demo-empty-row td { height: 29px; color: #4a4a4a; white-space: normal; }
.demo-window-status {
  margin-top: 4px;
  min-height: 18px;
  padding: 2px 5px;
  border: 1px solid #d0d0d0;
  background: #fafafa;
  color: #303030;
  font-size: 11px;
}

.demo-pdv { border-top: 1px solid #c8d0d7; }
.demo-pdv-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 94px;
  gap: clamp(20px, 12vw, 184px);
  padding: 8px 18px 12px clamp(14px, 13vw, 174px);
}
.demo-pdv-main { min-width: 0; }
.demo-pdv-main input { min-height: 29px; font-size: 15px; }
.demo-pdv-grid {
  min-height: 290px;
  max-height: 330px;
  margin-top: 5px;
  background: var(--grid-blue);
}
.demo-pdv-grid td { border-bottom-color: #bbcfe1; border-right-color: #c3d6e5; }
.demo-pdv-grid tr.is-selected:not(.demo-empty-row) td { background: linear-gradient(#9bcaef, #74acdf); }
.demo-pdv-grid th:nth-child(n+3), .demo-pdv-grid td:nth-child(n+3) { text-align: right; }
.demo-pdv-grid th:nth-child(3), .demo-pdv-grid td:nth-child(3) { text-align: center; }
.demo-quantity { display: inline-flex; align-items: center; gap: 6px; }
.demo-quantity > span { min-width: 13px; }
.demo-quantity .demo-button { width: 23px; min-height: 22px; padding: 0; font-size: 14px; }
.demo-pdv-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, .65fr); align-items: start; gap: 9px; margin-top: 9px; }
.demo-pdv-customer { display: grid; gap: 4px; padding: 3px 2px; min-width: 0; }
.demo-pdv-customer > span { font-size: 11px; color: #444; }
.demo-pdv-customer > strong { font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
.demo-total { display: grid; gap: 1px; padding: 4px 6px 1px; background: var(--grid-blue); }
.demo-total > span { font-size: 11px; color: #46586a; }
.demo-total > strong { text-align: right; font-size: clamp(25px, 3.2vw, 43px); line-height: 1.05; font-weight: 400; overflow-wrap: anywhere; }
.demo-pdv-commands { display: grid; grid-template-rows: auto repeat(5, minmax(54px, 1fr)); align-content: stretch; }
.demo-pdv-commands > p { padding: 0 2px; text-align: center; font-size: 11px; }
.demo-pdv-commands > button {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  padding: 4px 2px;
  border: 1px solid transparent;
  background: transparent;
  color: #080808;
  font: 400 11px/1.15 var(--desktop-font);
  text-align: center;
  cursor: pointer;
}
.demo-pdv-commands > button:hover:not(:disabled) { border-color: #9ab1c8; background: #e1ebf4; }
.demo-pdv-commands > button:disabled { color: #767676; cursor: default; }
.demo-pdv-status { display: flex; gap: 0; border-top: 1px solid #bbb; padding: 2px; font-size: 11px; }
.demo-pdv-status > span { min-width: min(24%, 124px); padding: 2px 6px; border: 1px inset #ddd; }
.demo-pdv-status b { font-weight: 400; }

.demo-notice {
  padding: 4px 9px;
  border-top: 1px solid #b9ccdd;
  background: #e9f2fb;
  color: #1a3d5a;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.demo-notice:empty { border: 0; padding: 0; }
.demo-app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px 12px;
  padding: 5px 9px;
  border-top: 1px solid #bbb;
  background: #f5f5f5;
  color: #404040;
  font-size: 11px;
}
.demo-app-footer a, .demo-reset { color: #16497a; text-decoration: underline; text-underline-offset: 2px; }
.demo-reset {
  min-height: 25px;
  padding: 0 3px;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.demo-dialog {
  width: min(570px, calc(100% - 22px));
  max-height: calc(100% - 22px);
  padding: 0;
  border: 1px solid var(--window-border);
  border-radius: 0;
  background: var(--desktop);
  color: var(--desktop-text);
  box-shadow: 1px 2px 6px #28435648;
}
.demo-wide-dialog { width: min(720px, calc(100% - 22px)); }
.demo-dialog::backdrop { background: #50687b18; }
.demo-dialog-body { display: grid; gap: 8px; padding: 8px; }
.demo-form-tab {
  justify-self: start;
  z-index: 1;
  margin-bottom: -9px;
  padding: 3px 12px;
  border: 1px solid #bbb;
  border-bottom: 0;
  background: #fff;
  font-size: 12px;
}
.demo-form-fields {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 172px;
  padding: 9px;
  border: 1px solid #bbb;
  background: #fff;
}
.demo-editor-code { width: min(110px, 100%); }
.demo-editor-type { width: min(205px, 100%); }
.demo-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.demo-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
.demo-dialog-actions .demo-button { min-width: 68px; min-height: 37px; }
.demo-error { color: #8c2423; font-size: 12px; }
.demo-error:empty { display: none; }
.demo-receive-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 13px; }
.demo-receive-fields > div { display: grid; align-content: start; gap: 8px; min-width: 0; }
.demo-readout { display: grid; gap: 3px; font-size: 12px; }
.demo-readout output, .demo-receive-fields input {
  display: block;
  min-width: 0;
  padding: 3px 5px;
  background: #fff;
  color: #161616;
  font: 400 16px/1.2 var(--desktop-font);
  text-align: right;
  overflow-wrap: anywhere;
}
.demo-receive-fields input { min-height: 28px; }
#demo-receive-total { color: #23397d; font-weight: 700; }
#demo-receive-change { color: #a22929; }
.demo-credit-customer { max-width: 245px; }
.demo-receive-actions [aria-pressed="true"] { background: linear-gradient(#e3eef8, #bed5ec); border-color: #759ab9; }
.demo-receive-actions { justify-content: stretch; }
.demo-receive-actions .demo-save { flex: 1; }
.demo-sale-record { border-top: 1px solid #c4c4c4; }
.demo-sale-record summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 10px; padding-block: 7px; cursor: pointer; }
.demo-sale-record summary::before { content: "▸"; }
.demo-sale-record[open] summary::before { content: "▾"; }
.demo-sale-record summary > span { overflow-wrap: anywhere; }
.demo-sale-record summary > :last-child { margin-left: auto; }
.demo-sale-record ul { padding: 0 0 8px 14px; }

@media (max-width: 800px) {
  .demo-intro { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .demo-pdv-body { gap: 12px; padding-inline: 10px; }
}
@media (max-width: 540px) {
  .demo-workspace { min-height: 0; padding: 5px; }
  .demo-desktop-icon { display: none; }
  .demo-toolbar .demo-button { min-width: 53px; min-height: 33px; padding-inline: 5px; }
  .demo-pdv-body { grid-template-columns: minmax(0, 1fr) 64px; gap: 6px; padding-inline: 6px; }
  .demo-pdv-grid { min-height: 230px; }
  .demo-pdv-commands > button { font-size: 10px; }
  .demo-pdv-commands svg { width: 24px; height: 24px; }
  .demo-pdv-bottom { grid-template-columns: minmax(0, 1fr); }
  .demo-receive-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-receive-totals { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 355px) {
  .demo-editor-grid { grid-template-columns: minmax(0, 1fr); }
  .demo-filter-actions { margin-left: 0; }
}
