/* The header clock (owner, 2026-10-17; reshaped 2026-11-12, "Go with A for the clock"; docs/violet_clock.md): a quiet glass card on the dark panel - the time, AM/PM and the zone, the day and date, and the state of the stock market. Plain HTML (templates/_clock.html) filled in by violet-clock.js.
   The look is set by custom properties on .vclock: the accent (it changes every minute), the width (its height follows) and the text size (a fixed share of the width, never under 11px). Nothing here needs a font, an image, a library or an inline style (the content-security policy allows none). */
@property --vc-violet { syntax: "<color>"; inherits: true; initial-value: #8000ff; }
@property --vc-violet-hi { syntax: "<color>"; inherits: true; initial-value: #a238ff; }
.vclock {
  --vc-violet: #8000ff;                 /* the accent, the darker of the pair (the colour names and the palette tests read it) */
  --vc-violet-hi: #a238ff;              /* the accent the card wears: its rim, its glow and its small text */
  --vc-width: 250px;                    /* the clock's width on the page; its height follows */
  --vc-fs: max(11px, calc(var(--vc-width) / 19.7));                     /* the text size: 12px on a 236px card, never under 11px */
  position: relative; display: block; width: var(--vc-width); max-width: 100%; margin: 0; box-sizing: border-box;
  font-size: var(--vc-fs); line-height: 1.2; color: #fff;
  transition: --vc-violet 1.4s ease, --vc-violet-hi 1.4s ease;            /* the new colour fades in */
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* The accent colour changes by itself every minute (owner, 2026-10-17: "make the text color inside watch area change in each minute" - "auto change"; the colours were left to me). violet-clock.js puts one of these classes on the clock - the minute of the day modulo 12 - and the card's rim, its glow and its small text follow the two variables (the time itself stays white).
   Neighbours are far apart on purpose, so that a change is seen, and the small text - a pastel of the accent - is light enough to read on the dark panel: tests/test_violet_clock.py holds both rules (contrast 4.5 : 1 or more, a clear distance to the next one). The first is the owner's violet, which is also what the clock wears without script. */
.vclock.vc-c0  { --vc-violet: #8000ff; --vc-violet-hi: #a238ff; }      /* violet */
.vclock.vc-c1  { --vc-violet: #067d75; --vc-violet-hi: #2fc7ba; }      /* teal */
.vclock.vc-c2  { --vc-violet: #c83e07; --vc-violet-hi: #ff8a3d; }      /* orange */
.vclock.vc-c3  { --vc-violet: #1c5bff; --vc-violet-hi: #5b8dff; }      /* blue */
.vclock.vc-c4  { --vc-violet: #d6205f; --vc-violet-hi: #ff5c93; }      /* rose */
.vclock.vc-c5  { --vc-violet: #0e7d42; --vc-violet-hi: #3fce7a; }      /* green */
.vclock.vc-c6  { --vc-violet: #a45a00; --vc-violet-hi: #f0a41a; }      /* amber */
.vclock.vc-c7  { --vc-violet: #4a35d8; --vc-violet-hi: #7b6cff; }      /* indigo */
.vclock.vc-c8  { --vc-violet: #d1283a; --vc-violet-hi: #ff6272; }      /* red */
.vclock.vc-c9  { --vc-violet: #006f9c; --vc-violet-hi: #33b5e6; }      /* cyan */
.vclock.vc-c10 { --vc-violet: #ae1fbd; --vc-violet-hi: #e064f0; }      /* magenta */
.vclock.vc-c11 { --vc-violet: #42760a; --vc-violet-hi: #86cc1c; }      /* lime */

/* the glass: a soft white tint on the dark panel, a thin rim and a quiet glow in the accent (the owner's mock-up A) */
.vclock .vc-glass { box-sizing: border-box; padding: .75em 1.17em .8em; border-radius: 1em; background: rgba(255, 255, 255, .10); border: 1px solid color-mix(in srgb, var(--vc-violet-hi) 42%, rgba(255, 255, 255, .22)); box-shadow: 0 6px 20px -8px color-mix(in srgb, var(--vc-violet-hi) 65%, transparent), inset 0 1px 0 rgba(255, 255, 255, .12); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.vclock .vc-top { display: flex; align-items: center; gap: .5em; min-width: 0; }
.vclock .vc-time { flex: none; font-size: 2.5em; font-weight: 500; line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: #fff; }
.vclock .vc-side { flex: none; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; line-height: 1.15; }
.vclock .vc-ap, .vclock .vc-tz, .vclock .vc-date { color: color-mix(in srgb, var(--vc-violet-hi) 38%, #fff); }
.vclock .vc-ap { font-size: 1.08em; font-weight: 600; letter-spacing: .04em; }
.vclock .vc-ap:empty { display: none; }                                                      /* (24-hour time has no AM/PM: the zone sits alone beside the time) */
.vclock .vc-tz { font-size: .85em; font-weight: 500; letter-spacing: .04em; opacity: .92; }
.vclock .vc-tz.vc-long { font-size: .72em; }                                                 /* a long zone name ("GMT+5:30") stays inside the glass */
.vclock .vc-date { flex: 1 1 auto; min-width: 0; margin-left: auto; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the market line under the time: a pill, green while the market is open and amber while it is closed (a holiday included); the words are fitted to the card by violet-clock.js, the whole sentence is the tooltip */
.vclock .vc-foot { margin-top: .55em; min-height: 1.65em; }
.vclock .vc-market { display: inline-flex; align-items: center; gap: .5em; max-width: 100%; box-sizing: border-box; padding: .17em .83em; border-radius: 999px; background: rgba(251, 191, 36, .16); color: #fde68a; line-height: 1.3; }
.vclock .vc-market[hidden] { display: none; }
.vclock .vc-market.is-open { background: rgba(74, 222, 128, .16); color: #bbf7d0; }
.vclock .vc-dot { flex: none; width: .58em; height: .58em; border-radius: 50%; background: #fbbf24; }
.vclock .vc-market.is-open .vc-dot { background: #4ade80; }
.vclock .vc-mtext { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .vclock { transition: none; }
}

/* the time as text for screen readers (the card is hidden from them); it is not announced when it changes */
.vclock .vc-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---- in the page header (owner, 2026-10-17: "move the digital watch to middle top of that panel" - "make sure it should be top middle of that panel" - "make bit bigger") ----
   The clock is the last item of the top row (.banner-top, app.css), after the brand. The row is as wide as it takes to put the clock's CENTRE on the panel's middle line (50% of the panel + half the clock + 24px: so the clock is at the top middle), but never narrower than the brand and the clock side by side (a window too narrow for the middle line puts the clock right after the brand). What follows the row - the moving drawing - starts after the row, so the clock is never over it.
   The panel is a size container (container-type) so that its own width can be used (cqw); a browser that cannot do that leaves the clock right after the brand. */
.banner { container-type: inline-size; --clock-w: clamp(232px, calc(12vw + 130px), 304px); }
.banner.compact { --clock-w: clamp(200px, calc(8vw + 100px), 240px); }
.banner-top > .vclock { --vc-width: var(--clock-w); margin-left: auto; margin-right: 24px; }
.banner-top { min-width: calc(50cqw + var(--clock-w) / 2 + 24px); }
.banner:not(.has-pills) > .banner-top { min-width: 0; width: min(100%, calc(50cqw + var(--clock-w) / 2 + 24px)); }           /* (a panel without the row of product buttons: the drawing is the panel's own right side) */
.banner:not(.has-pills) > .banner-art { width: calc(50% - var(--clock-w) / 2 - 24px); }
/* (owner, 2026-10-22: "I think the clock is not center panel now. Please make it center". The cause: the Super Admin's fourth product button (SignalEdgeSurge) made the row of buttons wider than the top row, so the panel's first grid column grew with it and the clock - pushed to the end of its row by the auto margin above - slid to the right of the middle line.
   In a window wide enough for the middle line the top row of a panel with the row of buttons is now a grid whose first track ends exactly where the clock begins - half the panel less half the clock, or the brand's own width when the brand is wider - so the clock's CENTRE stays on the middle line however wide the column is; the third track is what is left of the row.) */
@media (min-width: 961px) {
  .banner.has-pills > .banner-top { display: grid; grid-template-columns: minmax(max-content, calc(50cqw - var(--clock-w) / 2)) var(--clock-w) minmax(0, 1fr); column-gap: 0; align-items: center; }
  .banner.has-pills > .banner-top > .banner-brand { grid-column: 1; justify-self: start; margin-right: 20px; }          /* (the 20 px the row's gap was: in a window too narrow for the middle line the clock still keeps its distance from the brand) */
  .banner.has-pills > .banner-top > .vclock { grid-column: 2; margin: 0; }
}
@media (min-width: 961px) and (max-width: 1360px) {                                          /* a medium window: the brand's quote takes two lines, so that the brand ends sooner and the clock can still be on the middle line */
  .banner:not(.compact) .banner-quote { max-width: 19em; }
}
@media (max-width: 960px) {                                                                    /* not room for the middle line beside the brand: the clock is centred in what is left, or on its own line under the brand */
  .banner-top { min-width: 0; }
  .banner:not(.has-pills) > .banner-top { width: auto; }
  .banner-top > .vclock { margin: 0 auto; }
  .banner:not(.has-pills) > .banner-art { width: 52%; }
}
@media (max-width: 700px) { .banner { --clock-w: 248px; } .banner.compact { --clock-w: 248px; } }                  /* a phone: the clock is the first thing, centred (app.css .banner-top) */
