/* The online barcode generator (TEC-IT's web app) in a browser window, for the hub's hero
   (Pages/Shared/Sections/HeroApps/_WebAppWindow.cshtml). Laid out like the app: rail, toolbar, Data / Preview /
   Properties. Builds on app-window.css (frame, typing, keyframes); loaded only by the partial. No Tailwind, no site
   tokens. */

.tec-appwin--web {
  --wa-red: #ce191f;             /* the app's tokens (new-app Styles/app.tailwind.css, light theme) */
  --wa-red-subtle: #fff5f5;
  --wa-ink: #07101f;
  --wa-muted: #64728a;
  --wa-line: #dfe6f1;
  --wa-shell: #f7f9fd;           /* app shell: behind header and rail */
  --wa-editor: #f6f8fc;          /* the code editor behind the cards */
  --wa-blue: #2563eb;
  --aw-rate: 60ms;               /* the sample text is long: type it faster */

  border-radius: 12px 12px 0 0;
  background: var(--wa-shell);
  color: var(--wa-ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 11px;
}

/* ---- app header ---- */
.tec-appwin__web-header { flex: none; height: 38px; display: flex; align-items: center; gap: 12px; padding: 0 12px; }
.tec-appwin__web-logo { display: flex; align-items: center; gap: 8px; margin-right: auto; font-size: 12.5px; font-weight: 700; }
.tec-appwin__web-logo svg { width: 22px; height: 22px; }
.tec-appwin__web-help { display: grid; place-items: center; width: 16px; height: 16px; border: 1.3px solid #4b5060; border-radius: 50%; font-size: 10px; font-weight: 700; color: #4b5060; }
.tec-appwin__web-avatar { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--wa-red-subtle); font-size: 10.5px; font-weight: 700; color: var(--wa-red); }

/* ---- body: rail and the code's workspace ---- */
.tec-appwin__web-body { flex: 1; min-height: 0; display: flex; }
.tec-appwin__web-rail { flex: none; width: 52px; padding-top: 4px; }
.tec-appwin__web-rail li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; margin: 0 5px 6px; padding: 6px 0 5px; border-radius: 8px; font-size: 9px; color: var(--wa-muted); }
.tec-appwin__web-rail svg { width: 20px; height: 20px; }
.tec-appwin__web-rail li.is-active { background: var(--wa-red-subtle); color: var(--wa-red); }
.tec-appwin__web-rail li.is-active::before { content: ""; position: absolute; left: -5px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--wa-red); }

/* The app's inner window: white, rounded, a soft shadow, 8px off the shell's edge. */
.tec-appwin__web-main { flex: 1; min-width: 0; display: flex; flex-direction: column; margin-right: 8px; overflow: hidden; border-radius: 12px 12px 0 0; background: #fff; box-shadow: 0 0 0 1px rgba(7, 16, 31, .04), 0 8px 24px rgba(7, 16, 31, .07); }
.tec-appwin__web-toolbar { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--wa-line); font-size: 12px; }
.tec-appwin__web-back { width: 14px; height: 14px; margin-right: 6px; color: var(--wa-muted); }
.tec-appwin__web-type { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; color: var(--wa-blue); }
.tec-appwin__web-toolbar { white-space: nowrap; }
.tec-appwin__web-toolbar strong { flex: none; }
.tec-appwin__web-type { min-width: 0; }
.tec-appwin__web-type > span { overflow: hidden; text-overflow: ellipsis; }
.tec-appwin__web-type svg, .tec-appwin__web-export { flex: none; }
.tec-appwin__web-type svg { width: 11px; height: 11px; }
.tec-appwin__web-export { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 6px 12px; border-radius: 6px; background: var(--wa-red); font-weight: 600; color: #fff; }
.tec-appwin__web-export svg { width: 12px; height: 12px; }

.tec-appwin__web-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: 30% minmax(0, 1fr) 30%; gap: 6px; padding: 6px 6px 0; background: var(--wa-editor); }
.tec-appwin__web-card { min-height: 0; overflow: hidden; border: 1px solid var(--wa-line); border-radius: 10px; background: #fff; }
.tec-appwin__web-block { padding: 10px 12px; border-bottom: 1px solid var(--wa-line); }
.tec-appwin__web-h { font-size: 14px; font-weight: 700; }
.tec-appwin__web-h2 { position: relative; font-size: 12px; font-weight: 700; }
.tec-appwin__web-sub { margin-top: 1px; font-size: 10px; color: var(--wa-muted); }
.tec-appwin__web-link { display: inline-block; margin-top: 3px; font-size: 10px; color: var(--wa-blue); text-decoration: none; }
.tec-appwin__web-input { height: 52px; margin-top: 5px; padding: 6px 8px; border: 1px solid #cfd3da; border-radius: 6px; font-size: 11px; white-space: nowrap; overflow: hidden; }
.tec-appwin__web-check { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 10.5px; }
.tec-appwin__web-check i { width: 11px; height: 11px; border: 1px solid #9aa0aa; border-radius: 3px; }
.tec-appwin__web-seg { display: flex; margin-top: 6px; padding: 3px; border-radius: 7px; background: var(--wa-editor); }
.tec-appwin__web-seg li { flex: 1; padding: 4px 0; border-radius: 5px; text-align: center; font-size: 10.5px; color: var(--wa-muted); }
.tec-appwin__web-seg li.is-on { background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); font-weight: 600; color: var(--wa-ink); }
.tec-appwin__web-bridge { margin: 10px 12px; padding: 10px; border: 1px dashed #cfd3da; border-radius: 9px; }
.tec-appwin__web-bridge-icon { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-bottom: 6px; border-radius: 6px; background: var(--wa-red-subtle); color: var(--wa-red); }
.tec-appwin__web-bridge-icon svg { width: 14px; height: 14px; }
.tec-appwin__web-bridge-text { margin-top: 3px; font-size: 9.5px; line-height: 1.4; color: var(--wa-muted); }
.tec-appwin__web-bridge-btn { display: block; margin-top: 7px; padding: 5px; border: 1px solid #cfd3da; border-radius: 6px; text-align: center; font-size: 10.5px; font-weight: 600; }
.tec-appwin__web-bridge-link { display: block; margin-top: 5px; text-align: center; font-size: 10px; font-weight: 600; color: var(--wa-red); }

.tec-appwin__web-preview { min-width: 0; display: flex; flex-direction: column; padding: 10px 8px 6px; }
.tec-appwin__web-preview-head { display: flex; align-items: center; justify-content: space-between; }
.tec-appwin__web-chip { padding: 3px 8px; border-radius: 999px; background: #e3f4e8; font-size: 9.5px; font-weight: 600; color: #1a7f37; }
.tec-appwin__web-canvas { flex: 1; min-height: 0; display: grid; place-items: center; }
.tec-appwin__web-frame {
  position: relative;
  width: min(86%, 210px);
  aspect-ratio: 1;
  padding: 13%;
  border-radius: 10px;
  background:
    linear-gradient(#222, #222) 6px 6px / 9px 1px, linear-gradient(#222, #222) 6px 6px / 1px 9px,
    linear-gradient(#222, #222) calc(100% - 6px) 6px / 9px 1px, linear-gradient(#222, #222) calc(100% - 6px) 6px / 1px 9px,
    linear-gradient(#222, #222) 6px calc(100% - 6px) / 9px 1px, linear-gradient(#222, #222) 6px calc(100% - 6px) / 1px 9px,
    linear-gradient(#222, #222) calc(100% - 6px) calc(100% - 6px) / 9px 1px, linear-gradient(#222, #222) calc(100% - 6px) calc(100% - 6px) / 1px 9px,
    #fff;
  background-repeat: no-repeat;
  box-shadow: 0 0 0 1px var(--wa-line), 0 8px 20px -12px rgba(0, 0, 0, .25);
}
.tec-appwin__web-frame img { display: block; width: 100%; height: 100%; }
.tec-appwin__web-status { display: flex; gap: 14px; padding-top: 6px; font-size: 10px; color: var(--wa-muted); }
.tec-appwin__web-status b { font-weight: 600; color: var(--wa-ink); }

.tec-appwin__web-props-title { padding: 10px 12px; border-bottom: 1px solid var(--wa-line); }
.tec-appwin__web-open::after, .tec-appwin__web-closed::after { content: ""; position: absolute; right: 2px; top: 4px; width: 5px; height: 5px; border: solid var(--wa-muted); border-width: 1.3px 0 0 1.3px; transform: rotate(45deg); }
.tec-appwin__web-closed::after { top: 1px; transform: rotate(225deg); }
.tec-appwin__web-field { margin: 8px 0 3px; font-size: 10px; font-weight: 600; color: #3a4150; }
.tec-appwin__web-group { display: flex; border: 1px solid #cfd3da; border-radius: 6px; font-size: 10.5px; }
.tec-appwin__web-group span { flex: 1; min-width: 0; padding: 5px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tec-appwin__web-group i { margin-right: 8px; font-style: normal; color: var(--wa-muted); }
.tec-appwin__web-group .tec-appwin__web-dd { position: relative; flex: none; padding-right: 18px; border-left: 1px solid #cfd3da; font-weight: 600; }
.tec-appwin__web-dd::after { content: ""; position: absolute; right: 7px; top: 50%; border: 3px solid transparent; border-top: 4px solid var(--wa-ink); transform: translateY(-25%); }
.tec-appwin__web-swatch { display: inline-block; width: 18px; height: 10px; margin-right: 8px; vertical-align: -1px; background: #000; }
.tec-appwin__web-swatch--white { background: #fff; box-shadow: inset 0 0 0 1px #9aa0aa; }

/* ---- the label generator (HeroApps/_WebLabelWindow): Data with the template's fields, and the label preview ---- */
.tec-appwin__web-cols--labels { grid-template-columns: 31% minmax(0, 1fr); }
.tec-appwin__web-fields { border-bottom: 0; }
.tec-appwin__web-field-caption { margin: 8px 0 3px; font-size: 10px; font-weight: 600; color: var(--wa-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tec-appwin__web-text { min-height: 25px; padding: 5px 8px; border: 1px solid #cfd3da; border-radius: 6px; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tec-appwin__web-records { font-size: 10px; font-weight: 600; color: var(--wa-muted); }
.tec-appwin__web-frame--label { width: min(96%, 460px); aspect-ratio: auto; padding: 8%; }
.tec-appwin__web-frame--label img { height: auto; }

/* ---- medium windows: Data and Preview ---- */
@container (max-width: 680px) {
  .tec-appwin__web-cols { grid-template-columns: 42% minmax(0, 1fr); }
  .tec-appwin__web-cols--labels { grid-template-columns: 38% minmax(0, 1fr); }
  .tec-appwin__web-props { display: none; }
}

/* ---- phones: the toolbar and the preview ---- */
@container (max-width: 520px) {
  .tec-appwin__web-rail, .tec-appwin__web-data, .tec-appwin__web-help { display: none; }
  .tec-appwin__web-cols { grid-template-columns: minmax(0, 1fr); }
  .tec-appwin__web-main { margin-left: 8px; }
  .tec-appwin__web-frame { width: min(70%, 200px); }
}

/* ---- animation: type the data, then the preview draws the code row by row ---- */
.tec-appwin__web-frame img {
  animation: tec-appwin-rows .7s steps(var(--aw-steps), end) calc(var(--aw-start) + var(--aw-chars) * var(--aw-rate) + .2s) both;
}
@keyframes tec-appwin-rows { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
/* The label prints in from the top. */
.tec-appwin__web-frame--label img {
  animation: tec-appwin-rows 1.2s ease-in-out calc(var(--aw-start) + .2s) both;
}
