/* Bluconta landing: the portal on a computer, as the product demos draw it (partials/landing/_portal.html
   app_window): the icon rail, the top bar and the page pieces every screen shares (tabs, totals, rows,
   status chips), plus the pointer, the toast and the success dialog (toast.css, components.css
   .success-overlay). Sizes follow the portal at roughly 0.85. Each demo is a .win: a well on its sky card
   (05-showroom.css), as tall as the card lets it be, that shows the window's top and crops the rest;
   --app-inset is the gap between the well's edges and the window. In a well under 520px wide (a phone, or
   the narrow card of each pair) the window takes the portal's phone layout: no rail, stacked rows.
   Colours come from .ui (03-phone.css). */

.win { --app-inset: 18px; container-type: inline-size; position: relative; overflow: hidden; min-height: 404px; font-size: 12px; }
.app {
  position: absolute; inset: var(--app-inset) var(--app-inset) 0; display: grid; grid-template-columns: 46px minmax(0, 1fr); grid-template-rows: 42px minmax(0, 1fr);
  overflow: hidden; background: var(--white); border: 1px solid var(--pw-line); border-bottom: 0;
  border-radius: 14px 14px 0 0; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 24px 48px -28px rgba(16, 24, 40, 0.35);
}
.win svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-rail { grid-row: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0; border-right: 1px solid var(--pw-line); }
.app-logo { margin-bottom: 7px; }
.app-logo svg { border-radius: 7px; stroke: none; }
.app-ri { position: relative; display: grid; place-items: center; width: 30px; height: 28px; border-radius: 8px; color: var(--pw-body); }
.app-ri svg { width: 15px; height: 15px; }
.app-ri--new { margin-bottom: 4px; border: 1px dashed #BFD3F2; color: var(--pw-brand); }
.app-ri.is-on { background: var(--pw-brand-soft); color: var(--pw-brand-dark); }
.app-ri.is-on::before { content: ""; position: absolute; left: -8px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--pw-brand-dark); }
.app-ri--new.is-on { border-style: solid; border-color: transparent; }
.app-top { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 0 12px 0 14px; border-bottom: 1px solid var(--pw-line); }
.app-title { margin-right: auto; font-size: 14px; letter-spacing: -0.01em; white-space: nowrap; }
.app-search { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px 0 8px; border: 1px solid var(--pw-line); border-radius: 8px; color: var(--pw-muted); font-size: 11px; }
.app-search svg { width: 12px; height: 12px; }
.app-search kbd { padding: 0 4px; border: 1px solid var(--pw-line); border-radius: 4px; font: inherit; font-size: 9.5px; }
.app-ib, .ap-tool { position: relative; display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; border: 1px solid var(--pw-line); border-radius: 8px; color: var(--pw-body); }
.app-ib svg, .ap-tool svg { width: 13px; height: 13px; }
.app-bell > span { position: absolute; top: -5px; right: -5px; min-width: 13px; height: 13px; padding: 0 3px; border-radius: 7px; background: #EF4444; color: var(--white); font-size: 8px; font-weight: 700; line-height: 13px; text-align: center; }
.app-av { display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--pw-brand); color: var(--white); font-size: 11px; font-weight: 600; }
.app-body { position: relative; min-width: 0; padding: 12px 16px 0; }

/* Page pieces: the tab bar with its tools, the small totals, the list. */
.ap-bar { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; border-bottom: 1px solid var(--pw-line); }
.ap-bar > :not(.ap-tabs) { margin-bottom: 6px; }
.ap-tabs { display: flex; flex: 1; gap: 14px; min-width: 0; overflow: hidden; color: var(--pw-body); white-space: nowrap; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent); }
.ap-tabs span { padding: 6px 0 9px; }
.ap-tabs .on { color: var(--pw-ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--pw-ink); }
.ap-month { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; height: 26px; padding: 0 9px; border: 1px solid var(--pw-line); border-radius: 8px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.ap-cta { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; height: 28px; padding: 0 12px; border-radius: 999px; background: #0F1B33; color: var(--white); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.ap-kpis { display: flex; justify-content: center; gap: 8px; margin-bottom: 10px; }
.ap-kpi { display: grid; justify-items: center; gap: 1px; min-width: 132px; padding: 6px 14px 7px; border: 1px solid var(--pw-line); border-radius: 10px; white-space: nowrap; }
.ap-kpi span { font-size: 10.5px; color: var(--pw-body); }
.ap-kpi b { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ap-th, .ap-row { display: grid; grid-template-columns: var(--cols); align-items: center; gap: 12px; }
.ap-th { padding: 0 13px 6px; font-size: 9.5px; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase; color: var(--pw-muted); }
.ap-list { overflow: hidden; border: 1px solid var(--pw-line); border-radius: 12px; }
.ap-row { padding: 9px 13px; border-top: 1px solid var(--pw-line); }
.ap-row:first-child { border-top: 0; }
.ap-date { display: grid; gap: 2px; white-space: nowrap; }
.ap-date b { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.ap-date b::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #22C55E; }
.ap-date small, .ap-tot small { font-size: 10.5px; color: var(--pw-muted); }
.ap-name { display: grid; gap: 2px; min-width: 0; }
.ap-name b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ap-name small { display: flex; align-items: center; gap: 6px; overflow: hidden; font-size: 10.5px; color: var(--pw-body); white-space: nowrap; }
.ap-tot { display: grid; gap: 2px; white-space: nowrap; }
.ap-tot b { font-weight: 700; font-variant-numeric: tabular-nums; }
.ap-acts { display: flex; justify-content: flex-end; gap: 10px; color: var(--pw-body); }
.ap-acts svg { width: 14px; height: 14px; }
.st { justify-self: start; padding: 2px 7px; border-radius: 6px; background: var(--pw-soft); color: var(--pw-body); font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.st--ok { background: #EDF8F1; color: #0F7A38; }
.st--bill { background: var(--pw-brand-soft); color: var(--pw-brand-dark); }
/* Rows that have not arrived wait above the list's top edge: landing-demos.js sets --shift to their
   height, the list is that much shorter and each arrival slides the rest down. The rows move by transform,
   so the page registers no layout shift. The new row flashes, as the list does after a sync. */
.ap-rows { position: relative; }
.is-armed .ap-rows { margin-bottom: calc(var(--shift, 0px) * -1); transform: translateY(calc(var(--shift, 0px) * -1)); transition: transform 460ms var(--ease), margin-bottom 460ms var(--ease); }
.is-armed [data-new].is-in { animation: row-new 1500ms ease; }
@keyframes row-new { 0%, 45% { background: var(--pw-brand-soft); } }

/* The pointer: an arrow on the computer layout, a fingertip on the phone one. landing-demos.js moves it
   with the `translate` property, so the click's `scale` shrinks it in place. */
.app-cursor {
  position: absolute; z-index: 40; left: 0; top: 0; width: 17px; height: 22px; pointer-events: none; opacity: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 22'%3E%3Cpath d='M1.5 1.5v16.2l4.3-3.9 2.9 6.6 2.6-1.2-2.9-6.4h5.9z' fill='%23101828' stroke='%23fff' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat;
  filter: drop-shadow(0 2px 3px rgba(16, 24, 40, 0.28)); transition: translate 560ms var(--ease), opacity 200ms ease;
}
.app-cursor.is-on { opacity: 1; }
.app-cursor.is-click { animation: cursor-click 320ms ease; }
/* A ring opens where it pressed. */
.app-cursor::after { content: ""; position: absolute; left: -10px; top: -10px; width: 22px; height: 22px; border: 2px solid var(--pw-brand); border-radius: 50%; opacity: 0; }
.app-cursor.is-click::after { animation: cursor-ring 460ms ease-out; }
@keyframes cursor-click { 40% { scale: 0.82; } }
@keyframes cursor-ring { from { opacity: 0.9; transform: scale(0.4); } to { opacity: 0; transform: scale(1.5); } }

/* The portal's toast, top right of what is on screen. It only shows while its story is playing. */
.app-toast {
  position: absolute; z-index: 30; top: 14px; right: 14px; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 1px 9px; width: min(250px, calc(100% - 28px)); padding: 10px 12px;
  border: 1px solid var(--pw-line); border-radius: 12px; background: rgba(255, 255, 255, 0.94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 14px 40px rgba(16, 24, 40, 0.14); font-size: 11.5px; line-height: 1.35; transition: opacity 240ms ease, transform 420ms var(--ease);
}
.app-toast svg { grid-row: 1 / span 2; width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: var(--pw-brand-soft); color: var(--pw-brand-dark); stroke-width: 2.6; }
.app-toast--ok svg { background: #EDF8F1; color: #0F7A38; }
.app-toast b { font-size: 12px; }
.app-toast small { grid-column: 2; font-size: 11px; color: var(--pw-body); }
.app-toast { opacity: 0; transform: translateX(16px); }
.is-armed.s-toast:not(.s-toast-out) .app-toast { opacity: 1; transform: none; }

/* The portal's success dialog over the dimmed screen (the window, not the card around it): the tick draws itself. */
.app-ok { position: absolute; z-index: 35; inset: var(--app-inset) var(--app-inset) 0; display: grid; place-items: center; border-radius: 14px 14px 0 0; background: rgba(16, 24, 40, 0.3); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); transition: opacity 240ms ease; }
.app-ok-card { display: grid; justify-items: center; gap: 6px; width: min(290px, calc(100% - 32px)); padding: 24px 20px 20px; border-radius: 18px; background: var(--white); box-shadow: 0 32px 64px rgba(16, 24, 40, 0.24); text-align: center; transition: transform 320ms var(--ease), opacity 240ms ease; }
.app-ok-card svg { width: 46px; height: 46px; margin-bottom: 4px; color: #16A34A; stroke-width: 2.2; }
.app-ok-card b { font-size: 15.5px; letter-spacing: -0.015em; }
.app-ok-card p { margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--pw-body); }
.app-ok-btn { margin-top: 10px; padding: 8px 14px; border-radius: 10px; background: var(--pw-brand); color: var(--white); font-size: 11.5px; font-weight: 600; }
.is-armed:not(.s-done) .app-ok { opacity: 0; visibility: hidden; }
.is-armed:not(.s-done) .app-ok-card { opacity: 0; transform: scale(0.92) translateY(8px); }
.is-armed.s-done .app-ok-card path { stroke-dasharray: 60; animation: ok-draw 520ms ease 160ms both; }
@keyframes ok-draw { from { stroke-dashoffset: 60; } }

@container (max-width: 519px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .app-rail, .app-search, .app-sun, .ap-tool, .ap-month, .ap-th, .ap-acts { display: none; }
  .app-body { padding: 10px 12px 0; }
  .ap-tabs { gap: 12px; }
  .ap-cta { height: 26px; padding: 0 10px; font-size: 11px; }
  .ap-kpis { gap: 6px; }
  .ap-kpi { flex: 1; min-width: 0; padding: 6px 4px 7px; }
  .ap-kpi span { max-width: 100%; overflow: hidden; font-size: 10px; text-overflow: ellipsis; }
  .ap-kpi b { font-size: 13px; }
  /* Rows stack as on the portal's phone list: name and total, then the date line. */
  .ap-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 9px 11px; }
  .ap-date { grid-row: 2; grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; }
  .ap-date b { font-weight: 400; font-size: 10.5px; color: var(--pw-muted); }
  .ap-tot { text-align: right; }
  .app-cursor { width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: rgba(16, 24, 40, 0.18); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 4px 12px rgba(16, 24, 40, 0.25); filter: none; }
  .app-cursor::after { left: -5px; top: -5px; width: 38px; height: 38px; }
  .app-toast { top: 10px; right: 10px; }
}
/* Narrow phones: three totals side by side need every pixel. */
@container (max-width: 330px) {
  .ap-kpis { gap: 4px; }
  .ap-kpi { padding-inline: 2px; }
  .ap-kpi b { font-size: 12px; }
}
@container (max-width: 279px) {
  .ap-kpi b { font-size: 11px; letter-spacing: -0.03em; }
}
@media (max-width: 640px) {
  .win { --app-inset: 14px; min-height: 330px; }
}
