/* 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; }

.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-grow .mt { flex: none; width: 54px; height: 5px; border-radius: 3px; background: var(--line); }
.hm-grow .mt i { display: block; height: 5px; border-radius: 3px; background: var(--rec); }
.hm-grow b { flex: none; width: 34px; text-align: right; font-size: 11.5px; font-weight: 600; }
.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; }

/* 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:hover { border-color: var(--line-hover); }
.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-mood { order: 3; }
  .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: 480px; 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-gpri:disabled { opacity: 0.5; cursor: not-allowed; }
.hm-gnote { font-size: 12.5px; line-height: 1.5; color: var(--mut); }
.hm-gnote a { color: var(--si-tx); text-decoration: underline; }
.hm-gpri { height: 46px; margin-top: 2px; border: 0; border-radius: 12px; background: var(--tx); color: var(--bg); font-size: 14px; font-weight: 600; }
.hm-gsaid { font-size: 12.5px; line-height: 1.5; color: var(--tx-3); }
.hm-gsaid:empty { display: none; }
.hm-gsaid.err { color: var(--amber); }
.hm-gok { 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; } }
