/* The workspace home (views/home.mjs): the hero, four cards, and the welcome gate laid over them. */
.hm { flex: 1; min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; background: radial-gradient(900px 360px at 50% -90px, rgba(59, 130, 246, 0.11), rgba(11, 14, 20, 0) 70%); }
.hm-in { min-height: 100%; display: flex; flex-direction: column; align-items: center; padding: clamp(18px, 4vh, 40px) 32px clamp(14px, 2.4vh, 22px); }
.hm-hero { max-width: min(1100px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.hm-hero h1 { font-size: clamp(30px, min(3.4vw, 6vh), 64px); line-height: 1.08; font-weight: 600; letter-spacing: -0.025em; text-wrap: balance; }
.hm-hero p { max-width: 46em; font-size: clamp(14.5px, 1.05vw, 18px); line-height: 1.55; color: var(--mut); text-wrap: pretty; }
.hm-grid { width: 100%; max-width: 1560px; flex: 1 1 auto; min-height: 430px; max-height: 760px; margin-top: clamp(18px, 3.5vh, 36px); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 14px; }
.hm-foot { margin-top: 12px; text-align: center; }

/* the showcase in motion (rulings 175 and 175(g)): the cards come in once, one after another; then a slow, seamless wave
   of light moves across the bars and the heat maps and the newest close keeps a soft pulse, without a stop or a restart
   (175(h)). A card off the screen is paused. Hover and focus answer; nothing changes size; with reduced motion all of it stands
   still and complete. */
.hm-card { transition: border-color 180ms ease, box-shadow 180ms ease; }
.hm-card:hover, .hm-card:focus-within { border-color: var(--line-hover); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28); }
.hm-si:hover, .hm-si:focus-within { border-color: var(--si-bd); }
.hm-go { transition: transform 180ms ease, color 180ms ease; }
.hm-card:hover .hm-go, .hm-card:focus-within .hm-go { color: var(--tx); transform: translate(2px, -2px); }
.hm-row, .hm-grow, .hm-news { border-radius: 6px; transition: background-color 140ms ease, color 140ms ease; }
.hm-row:hover, .hm-grow:hover, .hm-news:hover, .hm-row:focus-visible, .hm-grow:focus-visible, .hm-news:focus-visible { background: rgba(148, 163, 184, 0.07); }
@media (prefers-reduced-motion: no-preference) {
  .hm-card { animation: hmUp 900ms cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: calc(var(--i, 0) * 120ms); }
  .hm-card.hm-wait, .hm-card.hm-wait * { animation: none; }
  .hm-card.hm-wait { opacity: 0; }
  .hm-card.hm-enter { animation-delay: 0ms; }
  .hm-card.hm-off, .hm-card.hm-off * { animation-play-state: paused !important; } /* over every shorthand below */
  /* ruling 175(h): one entrance, then a slow wave of light that never stops and never restarts */
  .hm-bars span { transform-origin: 50% 100%; animation: hmGrow 1400ms cubic-bezier(0.16, 1, 0.3, 1) both, hmSheen 7s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 120ms + 300ms + var(--b, 0) * 80ms), calc(2s + var(--b, 0) * 350ms); }
  .hm-card.hm-enter .hm-bars span { animation-delay: calc(200ms + var(--b, 0) * 80ms), calc(1.8s + var(--b, 0) * 350ms); }
  /* the line and its shaded area come in together, left to right, by one clip (a dash measured in the chart's units
     stopped partway on a stretched chart) */
  .hm-line { animation: hmDraw 2400ms cubic-bezier(0.33, 0, 0.2, 1) 200ms both; }
  .hm-heat i { animation: hmFill 900ms ease both, hmSheen 8s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 120ms + 350ms + var(--d, 0) * 50ms), calc(2.2s + var(--d, 0) * 180ms); }
  .hm-card.hm-enter .hm-heat i { animation-delay: calc(200ms + var(--d, 0) * 50ms), calc(2s + var(--d, 0) * 180ms); }
  .hm-fcells i { animation: hmFill 800ms ease both, hmSheen 8s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 120ms + 400ms + var(--d, 0) * 30ms), calc(2.2s + var(--d, 0) * 120ms); }
  .hm-card.hm-enter .hm-fcells i { animation-delay: calc(200ms + var(--d, 0) * 30ms), calc(2s + var(--d, 0) * 120ms); }
  .hm-live i { animation: hmBeat 3s ease-in-out infinite; }
  .hm-now { animation: hmPop 500ms ease 2.6s both, hmHalo 4.8s ease-in-out 3.1s infinite; }
}
@keyframes hmUp { from { opacity: 0; transform: translateY(14px); } }
@keyframes hmGrow { from { transform: scaleY(0); } }
@keyframes hmDraw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes hmFill { from { opacity: 0; transform: scale(0.6); } }
@keyframes hmSheen { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.13); } }
@keyframes hmPop { from { opacity: 0; transform: scale(0); } }
@keyframes hmHalo { 0%, 100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 22%, transparent); } 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 12%, transparent); } }
@keyframes hmBeat { 50% { box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14); } }

.hm-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; padding: 16px; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.hm-own, .hm-si { grid-column: span 5; }
.hm-charts, .hm-pulse { grid-column: span 7; }
.hm-si { border-color: rgba(59, 130, 246, 0.34); }
.hm-hd { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hm-ic { flex: none; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--tx-3); }
.hm-si .hm-ic { border-color: rgba(59, 130, 246, 0.4); background: var(--si-bg); color: var(--si-tx); font-size: 10.5px; font-weight: 600; }
.hm-hdw { flex: 1; min-width: 0; }
.hm-t { font-size: 13.5px; font-weight: 600; }
.hm-t a:hover { text-decoration: underline; text-underline-offset: 3px; }
.hm-s { font-size: 12px; color: var(--mut); }
.hm-go { flex: none; color: var(--dim); }
.hm-mood { flex: none; }

.hm-well { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 9px; padding: 12px; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.hm-cap { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--mut); white-space: nowrap; min-width: 0; }
.hm-cap > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hm-src { flex: none; font-size: 10.5px; line-height: 1.45; color: var(--dim); }
.tx { color: var(--tx); }

/* ownership */
.hm-figs { display: flex; gap: 10px; flex: none; }
.hm-figs > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); }
.hm-figs b { font-size: 16px; font-weight: 600; }
.hm-figs span { font-size: 10.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-rows { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; border-top: 1px solid var(--line); padding-top: 4px; }
.hm-row { flex: none; height: 25px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--tx-2); }
.hm-row:hover { color: var(--tx); }
.hm-row .mono { flex: none; font-size: 11.5px; }

/* charts */
.hm-two { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hm-grades { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.hm-grow { flex: none; height: 25px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--tx-2); }
.hm-grow:hover { color: var(--tx); }
.hm-grow .tk { flex: none; width: 44px; font-weight: 600; font-size: 11.5px; }
.hm-grow .nm { flex: 1; min-width: 0; color: var(--tx-3); }
.hm-heat { flex: none; display: flex; gap: 3px; }
.hm-heat i { width: 16px; height: 14px; border-radius: 3px; background: var(--rec); opacity: calc(0.12 + var(--h, 0) * 0.88); }
.hm-heat i.na { background: transparent; border: 1px dashed var(--line-2); opacity: 1; }
.hm-grow b { flex: none; width: 34px; text-align: right; font-size: 11.5px; font-weight: 600; }
.hm-barsw { flex: 1; min-height: 60px; position: relative; display: flex; }
.hm-bars { flex: 1; min-height: 60px; display: flex; align-items: flex-end; gap: 8px; }
.hm-bars span { flex: 1; border-radius: 2px 2px 0 0; background: var(--slate-bar); background: color-mix(in srgb, var(--rec) 55%, var(--bg)); }
.hm-bars span.on { background: var(--up); }
.hm-bars span.dv { opacity: 0.5; }
.hm-axis { flex: none; display: flex; justify-content: space-between; gap: 8px; font-size: 10.5px; color: var(--mut); white-space: nowrap; }
.hm-line { flex: 1; min-height: 60px; width: 100%; display: block; }
.hm-linew { position: relative; flex: 1; min-height: 60px; display: flex; }
.hm-linew .hm-line { height: auto; }
.hm-now { position: absolute; right: 0; width: 7px; height: 7px; margin: -3.5px -3.5px 0 0; border-radius: 50%; background: var(--c); pointer-events: none; }

/* market pulse */
.hm-pl { flex: 1; min-height: 0; display: flex; gap: 10px; }
.hm-nw { flex: 1.6; gap: 5px; padding: 10px 12px; }
.hm-live { display: inline-flex; align-items: center; gap: 6px; }
.hm-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--rec); }
.hm-newsl { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.hm-news { flex: none; height: 25px; display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--tx-2); min-width: 0; }
.hm-news:hover { color: var(--tx); }
.hm-news .d { flex: none; width: 46px; font-size: 11px; color: var(--mut); }
.hm-tools { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.hm-tool { flex: 1; min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--mut); }
.hm-tool { transition: border-color 160ms ease, background-color 160ms ease; }
.hm-tool:hover, .hm-tool:focus-visible { border-color: var(--si-bd); background: var(--panel); }
.hm-tool .si-lk { margin-left: auto; }
.hm-fheat { flex: none; display: flex; flex-direction: column; gap: 4px; padding: 9px 12px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.hm-frow { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--mut); }
.hm-frow > span:first-child { flex: none; width: 48px; }
.hm-fcells { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(var(--n, 14), minmax(0, 1fr)); gap: 3px; }
.hm-fcells i { height: 10px; border-radius: 2px; background: var(--si); opacity: calc(0.1 + var(--h, 0) * 0.9); }
.hm-tool > span { min-width: 0; display: flex; flex-direction: column; }
.hm-tool b { font-size: 12.5px; font-weight: 600; color: var(--tx); }
.hm-tool span span { font-size: 11.5px; }

/* the SI card */
.hm-chat { gap: 7px; padding: 9px 10px; }
.hm-thread { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 7px; overflow: hidden; }
.hm-ex { font-size: 9.5px; }
.hm-q { flex: none; align-self: flex-end; max-width: 88%; padding: 6px 10px; border-radius: 10px 10px 2px 10px; background: var(--line); font-size: 12.5px; }
.hm-a { flex: none; display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.5; color: var(--tx-2); }
.hm-a .si-mark { margin-top: 1px; }
.hm-a .chip:hover { color: var(--tx); border-color: var(--line-hover); }
.hm-ask { flex: none; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 5px 0 12px; border-radius: 9px; border: 1px solid rgba(59, 130, 246, 0.3); background: var(--panel); }
.hm-ask input { flex: 1; min-width: 0; height: 30px; border: 0; outline: 0; background: transparent; color: var(--tx); font-size: 12.5px; }
.hm-ask input::placeholder { color: var(--mut); }
.hm-ask .si-send { width: 26px; height: 26px; border-radius: 7px; }

/* below the desk widths the cards stack and the page scrolls */
@media (max-width: 1100px), (max-height: 680px) {
  .hm-grid { flex: none; max-height: none; min-height: 0; grid-template-rows: none; }
  .hm-card { min-height: 300px; }
}
@media (max-width: 1100px) {
  .hm-own, .hm-si, .hm-charts, .hm-pulse { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .hm-in { padding: 18px 14px 18px; }
  .hm-hero h1 { font-size: 28px; }
  .hm-two, .hm-pl { grid-template-columns: minmax(0, 1fr); flex-direction: column; display: flex; }
  .hm-two > .hm-well { min-height: 180px; flex: none; }
  .hm-nw { min-height: 230px; flex: none; }
  .hm-card { min-height: 0; }
  .hm-hd { flex-wrap: wrap; }
  .hm-pulse .hm-hdw { flex-basis: calc(100% - 38px); } /* the title keeps the first line; the pill goes under it */
  .hm-mood { order: 3; margin-left: 38px; }
  .hm-figs { gap: 6px; }
}

/* ------------------------------------------------------------------ the welcome gate */
.hm-gate { position: fixed; inset: 0; z-index: 60; opacity: 0; transform: scale(1); transition: opacity 400ms ease, transform 400ms ease; }
.hm-gate[hidden] { display: none; }
.hm-gate.now, .hm-gate.now * { transition: none !important; }
.hm-gate.in { opacity: 1; }
.hm-gate.leaving { opacity: 0; transform: scale(1.02); }
.hm-veil { position: absolute; inset: 0; background: rgba(11, 14, 20, 0.65); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.hm-orb { position: absolute; border-radius: 50%; pointer-events: none; }
.hm-orb.a { left: 22%; top: 10%; width: 620px; height: 620px; background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.07) 42%, rgba(59, 130, 246, 0) 70%); animation: hmDriftA 26s ease-in-out infinite; }
.hm-orb.b { right: 16%; bottom: 4%; width: 680px; height: 680px; background: radial-gradient(circle, rgba(20, 184, 166, 0.15) 0%, rgba(20, 184, 166, 0.07) 42%, rgba(20, 184, 166, 0) 70%); animation: hmDriftB 34s ease-in-out infinite; }
@keyframes hmDriftA { 50% { transform: translate(110px, 70px); } }
@keyframes hmDriftB { 50% { transform: translate(-120px, -60px); } }
.hm-gwrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; }
.hm-glass { width: 100%; max-width: 460px; padding: 32px; border-radius: 20px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.04); backdrop-filter: blur(32px); -webkit-backdrop-filter: blur(32px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 30px 80px rgba(0, 0, 0, 0.45); display: flex; flex-direction: column; align-items: center; text-align: center; }
.hm-emb { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border-radius: 13px; border: 0; background: none; box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.06), 0 0 34px rgba(59, 130, 246, 0.28); font-family: var(--mono); font-size: 18px; font-weight: 600; letter-spacing: 0.04em; opacity: 0; transform: scale(0.6); transition: transform 900ms cubic-bezier(0.16, 1, 0.3, 1), opacity 500ms ease; }
/* the logo's mark as the welcome's emblem (ruling 170), its own tile under the glow */
.hm-emb-logo { display: block; width: 56px; height: 56px; }
.hm-glass h2 { margin-top: 20px; font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
.hm-gp { margin-top: 10px; font-size: 14px; line-height: 1.6; color: var(--tx-3); text-wrap: pretty; }
.hm-glass h2, .hm-gp { opacity: 0; transform: translateY(10px); transition: opacity 600ms ease 250ms, transform 700ms cubic-bezier(0.16, 1, 0.3, 1) 250ms; }
.hm-gate.in .hm-emb { opacity: 1; transform: scale(1); }
.hm-gate.in h2, .hm-gate.in .hm-gp { opacity: 1; transform: translateY(0); }
.hm-auth { width: 100%; max-height: 0; opacity: 0; overflow: hidden; transition: max-height 800ms cubic-bezier(0.16, 1, 0.3, 1), opacity 500ms ease 200ms; }
.hm-gate.step2 .hm-auth { max-height: 680px; opacity: 1; }
.hm-auth form { display: flex; flex-direction: column; gap: 10px; padding: 24px 2px 2px; text-align: left; }
.hm-auth label { font-size: 12px; font-weight: 500; color: var(--tx-3); }
.hm-auth input { height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(11, 14, 20, 0.55); color: var(--tx); font-size: 14px; }
.hm-auth input::placeholder { color: var(--mut); }
.hm-auth input:disabled, .hm-auth .gt-pri:disabled { opacity: 0.5; cursor: not-allowed; }
.hm-auth .gt-note { font-size: 12.5px; line-height: 1.5; color: var(--mut); }
.hm-auth .gt-note a { color: var(--si-tx); text-decoration: underline; }
.hm-auth .gt-pri { height: 46px; margin-top: 2px; border: 0; border-radius: 12px; background: var(--tx); color: var(--bg); font-size: 14px; font-weight: 600; }
.hm-auth .gt-said { font-size: 12.5px; line-height: 1.5; color: var(--tx-3); }
.hm-auth .gt-said:empty { display: none; }
.hm-auth .gt-said.err { color: var(--amber); }
.hm-auth .gt-ok { font-size: 13.5px; line-height: 1.6; color: var(--tx-2); }
.hm-grule { height: 1px; margin-top: 14px; background: rgba(255, 255, 255, 0.1); }
.hm-guest { display: block; margin: 8px auto 0; min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--mut); font-size: 14px; font-weight: 500; transition: color 150ms ease; }
.hm-guest:hover { color: var(--tx); }
@media (max-width: 640px) { .hm-glass { padding: 24px 20px; } .hm-orb { display: none; } }
@media (prefers-reduced-motion: reduce) { .hm-orb { animation: none; } }
/* ruling 179: the tick and Continue with Google in the welcome window (the window's input rule must not size the box) */
.hm-auth .gt-tick input { width: 17px; height: 17px; padding: 0; border-radius: 4px; }
.hm-auth label.gt-tick { font-weight: 400; font-size: 12.5px; }
.hm-auth .gsi-btn { height: 46px; width: 100%; }
