/* PULSE on a wide screen (js/desktop.js, docs/13-desktop.md).

   From 1024 px the app takes the whole window: a rail on the left with the
   mark, «Create», the sections, where one is tuned and one's own profile;
   the section in the middle; and from 1360 px the walkie in the dock on the
   right. html.desk and html.docked are set by desktop.js, #app[data-tab] by
   app.js. Overlays open in the middle, or in the right pane of «Inbox» and
   the walkie; sheets become dialogs in the middle of the window.

   Written in the app's green and its tokens: the interface colour (theme.js)
   turns these rules as it turns the others. Nothing here applies to a phone:
   every rule is under html.desk (or a class only the wide screen draws). */

/* Drawn on a wide screen only. */
.mechip, .dock, .authhero, .tabplus-l { display: none; }

/* ---------- the window ---------- */
html.desk {
  --rail-w: 232px;
  --dock-w: 360px;
  --split-w: 0px;
  --dock-cur: 0px;
  --rail-bg: #0c0f0d;
  --pane-pad: max(36px, calc((100% - 1080px) / 2));
  --read-pad: max(28px, calc((100% - 820px) / 2)); /* a page to read: a wave */
}
@media (min-width: 1600px) { html.desk { --dock-w: 392px; --rail-w: 248px; } }

html.desk, html.desk * { scrollbar-width: thin; scrollbar-color: #29312c transparent; }
html.desk ::-webkit-scrollbar { width: 10px; height: 10px; }
html.desk ::-webkit-scrollbar-thumb { background-color: #232a25; background-clip: padding-box; border-radius: 6px; border: 2px solid transparent; }
html.desk ::-webkit-scrollbar-thumb:hover { background-color: #2f3832; }
html.desk ::-webkit-scrollbar-track { background: transparent; }

html.desk .app.shell {
  max-width: none; margin: 0; border: 0;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--dock-cur);
  grid-template-rows: minmax(0, 1fr) auto auto;
  grid-template-areas: "nav main dock" "sbar main dock" "me main dock";
  background: linear-gradient(90deg, var(--rail-bg) 0 calc(var(--rail-w) - 1px), #1b211d calc(var(--rail-w) - 1px) var(--rail-w), var(--bg) var(--rail-w));
}
html.docked .app.shell:not([data-tab=radio]) { --dock-cur: var(--dock-w); }
html.desk .app.shell[data-tab=inbox] { --split-w: 320px; }
html.desk .app.shell[data-tab=radio] { --split-w: 400px; }
@media (min-width: 1440px) { html.desk .app.shell[data-tab=radio] { --split-w: 440px; } }
@media (min-width: 1600px) { html.desk .app.shell[data-tab=inbox] { --split-w: 380px; } }

html.desk .app.shell > .main { grid-area: main; min-width: 0; position: relative; }

/* ---------- the rail ---------- */
html.desk .app.shell > .tabs {
  grid-area: nav; height: auto; min-height: 0; overflow-y: auto; padding: 20px 14px 12px;
  flex-direction: column; gap: 2px;
}
html.desk .tabs-shape { display: none; }
.rbrand { order: -2; display: flex; align-items: center; gap: 11px; padding: 2px 6px 22px; }
.rbmark { width: 36px; height: 36px; flex: none; border-radius: 11px; display: grid; place-items: center; color: var(--accent-ink);
  background: var(--grad-primary); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 22px -10px var(--accent-glow); }
.rbname { min-width: 0; display: flex; flex-direction: column; }
.rbname b { font: 600 16px/1 var(--mono); letter-spacing: .34em; color: var(--accent); text-shadow: 0 0 18px rgba(159, 232, 112, .3); }
.rbname small { margin-top: 6px; font-size: 8px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: clip; }

html.desk .tabplus { order: -1; width: auto; flex: none; padding: 0 0 16px; display: block; }
html.desk .tabplus > span { width: 100%; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center; gap: 8px; }
html.desk .tabplus > span .icon svg { width: 20px; height: 20px; }
html.desk .tabplus:hover > span { filter: brightness(1.06); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 10px 26px -10px var(--accent-glow); }
html.desk .tabplus-l { display: inline; font-size: 14.5px; font-weight: 700; letter-spacing: .01em; }

html.desk .tab { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; height: 44px; padding: 0 12px; border-radius: 12px;
  font-size: 14.5px; color: var(--text-2); transition: color .15s, background-color .15s; }
html.desk .tab > .icon svg { width: 21px; height: 21px; }
html.desk .tab:not(.active):hover { background: rgba(255, 255, 255, .035); color: var(--text); }
html.desk .tab.active { color: var(--accent); background: linear-gradient(90deg, rgba(159, 232, 112, .15), rgba(159, 232, 112, .035)); box-shadow: inset 0 0 0 1px rgba(159, 232, 112, .16); }
html.desk .tab.active::before { content: ""; position: absolute; left: -14px; top: 11px; bottom: 11px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
html.desk .tab .badge { position: static; margin-left: auto; box-shadow: none; }
html.desk .tab .geodot { position: static; margin-left: auto; }
html.desk .tab .geodot + .badge { margin-left: 4px; }
/* One's own profile is the card at the foot of the rail. */
html.desk .tab[data-tab=profile] { display: none; }

html.desk .app.shell > .sbar { grid-area: sbar; margin: 8px 12px 10px; }
html.desk .mechip { grid-area: me; display: flex; align-items: center; gap: 10px; margin: 0 12px 14px; padding: 8px 10px; border-radius: 14px; text-align: left;
  border: 1px solid var(--line); background: var(--sheen), var(--surface); transition: border-color .15s, background-color .15s; }
html.desk .mechip:hover { border-color: var(--line-2); }
html.desk .mechip.active { border-color: var(--accent-line); background: linear-gradient(90deg, rgba(159, 232, 112, .1), var(--surface)); }
html.desk .mechip .avatar .dot { border-color: var(--surface); }
.mctext { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.mctext b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mctext small { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcgear { color: var(--text-3); flex: none; transition: color .15s, transform .3s var(--ease); }
.mechip:hover .mcgear { color: var(--text-2); transform: rotate(30deg); }

/* ---------- the dock: the walkie beside the other sections ---------- */
html.docked .app.shell:not([data-tab=radio]) > .dock {
  grid-area: dock; display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative;
  border-left: 1px solid #1b211d;
  background: radial-gradient(120% 50% at 50% 0%, rgba(62, 130, 44, .1), transparent 70%), linear-gradient(180deg, #0d110e, var(--bg) 50%);
}
html.docked .dock::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(159, 232, 112, .35), transparent); }
html.desk .dock .radio .head { padding-top: 14px; }
/* A computer has no pocket: the walkie's «In pocket» (a phone with its
   screen off) is left out where the pointer is a mouse. */
@media (hover: hover) and (pointer: fine) {
  html.desk .radio .tipcard, html.desk .radio .actions > .action[data-pocket] { display: none !important; }
}

/* ---------- the middle: one section ---------- */
html.desk .main .topbar { min-height: 72px; padding: 22px var(--pane-pad) 10px; }
html.desk .main .topbar h1 { font-size: 30px; letter-spacing: -.015em; }
html.desk .main .screen { padding: 6px var(--pane-pad) 48px; }
html.desk .main .inboxseg { margin: 0 var(--pane-pad) 6px; }

/* Explore: the cards side by side. */
html.desk .main .xnow { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
html.desk .main .xnow > .xempty { grid-column: 1 / -1; }
html.desk .main .xempty { padding: 22px 24px; }
html.desk .main .rdstrip { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); margin: 0; padding: 2px 0 6px; overflow: visible; }
html.desk .main .rdtile { width: auto; min-height: 150px; transition: transform .15s var(--ease), border-color .15s; }
html.desk .main .rdtile:hover { transform: translateY(-2px); border-color: var(--line-2); }
html.desk .main .rdtile.make:hover { border-color: var(--accent-line); }
html.desk .main .list.wmine, html.desk .main .list.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); column-gap: 28px; }
html.desk .main .list.wmine > .row:last-child, html.desk .main .list.wall > .row:last-child { border-bottom: 1px solid var(--line); }
html.desk .main .list.wmine > :not(.row), html.desk .main .list.wall > :not(.row) { grid-column: 1 / -1; }
html.desk .main .search { max-width: 560px; }
html.desk .main button.row, html.desk .overlay button.row { border-radius: 10px; }
html.desk .main button.row:hover, html.desk .overlay button.row:hover { background-color: rgba(255, 255, 255, .025); }

/* Profile: two columns under the head. The section scrolls as a whole, so
   the columns take the height they need (a screen of fixed height would
   run its content on into columns off to the side). */
html.desk .app.shell[data-tab=profile] > .main { display: block; overflow-y: auto; }
html.desk .app.shell[data-tab=profile] > .main > .topbar { position: sticky; top: 0; z-index: 3; background: var(--bg); box-shadow: 0 10px 18px -12px var(--bg); }
html.desk .main .screen.profile { overflow: visible; columns: 2 360px; column-gap: 32px; }
html.desk .main .screen.profile > * { break-inside: avoid; }
html.desk .main .screen.profile > .profile-head { column-span: all; margin-bottom: 18px; }
html.desk .main .screen.profile > .section-title { break-after: avoid; }
html.desk .main .screen.profile > .section-title:first-of-type, html.desk .main .screen.profile > .precent .section-title { margin-top: 4px; }

/* ---------- two panes: Inbox and the walkie ---------- */
html.desk .main .split { flex: 1; min-height: 0; display: flex; }
html.desk .split > .spl { width: var(--split-w); flex: none; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid #1b211d; }
html.desk .split > .spr { flex: 1; min-width: 0; min-height: 0; overflow-y: auto; container-type: inline-size; }
html.desk .split[data-split=inbox] > .spl { background: linear-gradient(180deg, #0d100e, var(--bg) 40%); }
html.desk .split .topbar { padding: 22px 20px 10px; min-height: 72px; }
html.desk .split .topbar h1 { font-size: 26px; }
html.desk .split .screen { padding: 4px 12px 24px; }
html.desk .split .inboxseg { margin: 0 16px 6px; }
html.desk .split[data-split=radio] > .spl { background: radial-gradient(120% 45% at 50% 0%, rgba(62, 130, 44, .09), transparent 70%), linear-gradient(180deg, #0d110e, var(--bg) 50%); }
html.desk .split[data-split=radio] .radio .head { padding-top: 16px; }

/* What opens from a section: over the middle, or over the right pane. */
html.desk .app.shell > .overlay { left: calc(var(--rail-w) + var(--split-w)); right: var(--dock-cur); }
html.desk .app.shell[data-tab=inbox] > .overlay, html.desk .app.shell[data-tab=radio] > .overlay { animation: paneIn .18s ease-out; }
@keyframes paneIn { from { opacity: 0; transform: translateX(10px); } }
/* The studio is a console of its own: the whole window but the rail. A
   first-run guide takes the whole window. */
html.desk .app.shell > .overlay.studiox { left: var(--rail-w); right: 0; }
html.desk .app.shell > .overlay.onb { left: 0; right: 0; }
html.desk .overlay.onb .screen { padding-top: 32px; }
html.desk .app.shell > .overlay:not(.chatx):not(.mapx):not(.studiox):not(.callx) > .topbar { padding-left: var(--pane-pad); padding-right: var(--pane-pad); min-height: 64px; }
html.desk .app.shell > .overlay:not(.chatx):not(.mapx):not(.studiox) > .screen { padding-left: var(--pane-pad); padding-right: var(--pane-pad); }

/* The studio as a console: the player on the left (the show, the decks,
   the transport, the crossfade), the pads, board, queue, library and the
   listeners' chat on the right; the microphone along the foot. */
html.desk .app.shell > .studiox { container: studio / inline-size; }
@container studio (min-width: 920px) {
  .studiox .sxscroll { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(0, 1.4fr); grid-template-rows: repeat(6, auto) 1fr;
    column-gap: 22px; align-content: start; padding: 4px 20px 24px; }
  .studiox .sxscroll > :not(.sxtabs):not(.sxbody) { grid-column: 1; }
  .studiox .sxscroll > .sxtabs { grid-column: 2; grid-row: 1; }
  .studiox .sxscroll > .sxbody { grid-column: 2; grid-row: 2 / -1; min-width: 0; }
  .studiox .sxhead, .studiox .sxboard { padding-left: 20px; padding-right: 20px; }
  .studiox .sxmsgs { max-height: 46vh; }
}

/* A wave: its page in a column one reads, the head and the foot along it. */
html.desk .app.shell > .wavex > .whead { padding-left: calc(var(--read-pad) - 8px); padding-right: calc(var(--read-pad) - 8px); }
html.desk .app.shell > .wavex > .wscroll { padding-left: var(--read-pad); padding-right: var(--read-pad); }
html.desk .app.shell > .wavex > .wdock { padding-left: var(--read-pad); padding-right: var(--read-pad); }

/* The resting view of a right pane. */
.deskrest { height: 100%; min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 32px; text-align: center; color: var(--text-2); }
.deskrest-ico { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 10px; color: var(--accent);
  background: radial-gradient(circle, rgba(159, 232, 112, .12), rgba(159, 232, 112, .02) 70%); border: 1px solid rgba(159, 232, 112, .18);
  box-shadow: 0 0 0 12px rgba(159, 232, 112, .03), 0 0 0 26px rgba(159, 232, 112, .015); }
.deskrest b { font-size: 17px; color: var(--text); }
.deskrest p { margin: 0; max-width: 320px; font-size: 13.5px; line-height: 1.5; color: var(--text-3); }

/* The walkie's desk. */
.deskp { padding: 28px 32px 40px; max-width: 920px; }
.deskkick { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.deskhead h2 { margin: 8px 0 6px; font-size: 28px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.deskhead p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.5; max-width: 560px; }
.desktiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 22px 0 18px; }
.desktile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 14px 13px; border-radius: 16px; text-align: left; min-width: 0;
  border: 1px solid var(--line); background: var(--sheen), var(--surface); transition: transform .15s var(--ease), border-color .15s, box-shadow .15s; }
.desktile:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--accent-line); box-shadow: 0 12px 28px -18px var(--accent-glow); }
.desktile:active:not(:disabled) { transform: var(--press); }
.desktile:disabled { opacity: .42; cursor: default; }
.dtico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 6px; background: var(--accent-dim); color: var(--accent); }
.desktile b { font-size: 15px; font-weight: 600; }
.desktile small { font-size: 12.5px; color: var(--text-3); line-height: 1.35; }
.deskcols { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.deskcard { padding: 4px 16px 10px; border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(180deg, #141916, var(--surface) 60px); min-width: 0; }
.deskcard > .section-title { margin: 14px 0 2px; }
.deskcard .setgroup:first-of-type { padding-top: 8px; }
.deskcard .empty { padding: 18px 4px; }
.keyrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); }
.keyrow:last-child { border-bottom: 0; }
.keycaps { display: flex; gap: 4px; flex: none; min-width: 84px; }
.deskcard kbd { font: 600 11.5px/1 var(--mono); padding: 5px 7px 4px; border-radius: 7px; background: var(--surface-3); border: 1px solid var(--line-2); border-bottom-width: 2px; color: var(--text); }
@container (max-width: 620px) {
  .desktiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deskcols { grid-template-columns: minmax(0, 1fr); }
  .deskp { padding: 24px 20px 32px; }
}

/* ---------- sheets, keypads and alerts: dialogs in the window ---------- */
html.desk .scrim { align-items: center; justify-content: center; padding: 40px; background: rgba(2, 4, 3, .62); }
html.desk .sheet { width: min(540px, 100%); max-height: min(100%, 860px); border: 1px solid var(--line-2); border-radius: 22px; padding: 22px 24px 22px;
  animation: dlgin .2s var(--ease); box-shadow: 0 34px 90px -24px rgba(0, 0, 0, .85), 0 0 60px -30px var(--accent-glow); }
html.desk .sheet .grip { display: none; }
html.desk .sheet .shead { margin-top: -8px; }
html.desk .sfoot { bottom: -22px; margin: 14px -24px -22px; padding: 14px 24px 20px; border-radius: 0 0 22px 22px; }
@keyframes dlgin { from { transform: translateY(12px) scale(.985); opacity: 0; } }
html.desk .kpscrim { align-items: center; justify-content: center; padding: 40px; }
html.desk .kpad { width: min(420px, 100%); border-radius: 24px; border: 1px solid var(--line-2); animation: dlgin .2s var(--ease); box-shadow: 0 34px 90px -24px rgba(0, 0, 0, .85); }

/* The call screen and the file viewer take the window; a call keeps to a
   column in its middle. */
html.desk .callx { padding-left: max(24px, calc((100% - 520px) / 2)); padding-right: max(24px, calc((100% - 520px) / 2)); }

/* Toasts and the on-air pill over the middle, not over the rail. */
html.desk .toasts { left: calc(50% + var(--rail-w) / 2); }
html.desk .onairpill { left: calc(50% + var(--rail-w) / 2); }

/* ---------- sign-in: the form beside what PULSE is ---------- */
html.desk .app:not(.shell) { max-width: none; margin: 0; border: 0; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(460px, 1fr); }
html.desk .app:not(.shell) > .auth:only-child { grid-column: 1 / -1; }
html.desk .app:not(.shell) > .auth { width: 100%; max-width: 500px; justify-self: center; min-height: 0; height: 100%; padding: 36px 32px 36px; }
html.desk .app:not(.shell) > .auth.authstep { padding-top: 48px; }
html.desk .app:not(.shell) > .auth > .planet { margin: 0 -32px; }

html.desk .authhero { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 0; padding: 40px 56px 36px;
  border-right: 1px solid #1b211d;
  background: radial-gradient(90% 70% at 0% 100%, rgba(62, 130, 44, .16), transparent 70%), radial-gradient(70% 60% at 78% 40%, #141a16, var(--bg) 75%); }
.authhero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(159, 232, 112, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(159, 232, 112, .05) 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: radial-gradient(circle at 70% 45%, #000, transparent 72%); mask-image: radial-gradient(circle at 70% 45%, #000, transparent 72%); }
.ahrings { position: absolute; right: -220px; top: 46%; width: 680px; height: 680px; transform: translateY(-50%); pointer-events: none; }
.ahrings::before { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 24px 6px var(--accent-glow); }
.ahrings i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(159, 232, 112, .26); opacity: 0; animation: ahring 8s cubic-bezier(.2, .6, .4, 1) infinite; }
.ahrings i:nth-child(2) { animation-delay: 2s; }
.ahrings i:nth-child(3) { animation-delay: 4s; }
.ahrings i:nth-child(4) { animation-delay: 6s; }
@keyframes ahring { 0% { transform: scale(.06); opacity: 0; } 12% { opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .ahrings i { animation: none; opacity: .5; }
  .ahrings i:nth-child(1) { transform: scale(.25); } .ahrings i:nth-child(2) { transform: scale(.5); } .ahrings i:nth-child(3) { transform: scale(.75); } .ahrings i:nth-child(4) { transform: scale(1); opacity: .25; }
}
:where(:root.eco) .ahrings i { animation: none; opacity: .5; }
:where(:root.eco) .ahrings i:nth-child(1) { transform: scale(.25); }
:where(:root.eco) .ahrings i:nth-child(2) { transform: scale(.5); }
:where(:root.eco) .ahrings i:nth-child(3) { transform: scale(.75); }
:where(:root.eco) .ahrings i:nth-child(4) { transform: scale(1); opacity: .25; }
.ahmark { position: relative; display: flex; align-items: center; gap: 12px; }
.ahdot { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--accent-ink); background: var(--grad-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 24px -10px var(--accent-glow); }
.ahmark b { font: 600 18px/1 var(--mono); letter-spacing: .38em; color: var(--accent); text-shadow: 0 0 18px rgba(159, 232, 112, .3); }
.ahbody { position: relative; margin: auto 0; padding: 32px 0; max-width: 560px; }
.ahbody h1 { margin: 0 0 30px; font-size: clamp(34px, 3.4vw, 50px); line-height: 1.06; font-weight: 700; letter-spacing: -.025em; }
.ahbody h1 span { color: var(--accent); text-shadow: 0 0 32px rgba(159, 232, 112, .25); }
.ahpoints { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ahpoints li { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 16px; border: 1px solid var(--line);
  background: rgba(18, 22, 20, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.ahico { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--accent-dim); color: var(--accent); }
.ahpoints b { display: block; font-size: 14.5px; margin: 1px 0 3px; }
.ahpoints span { display: block; font-size: 12.5px; line-height: 1.4; color: var(--text-2); }
.ahfoot { position: relative; font-size: 10px; letter-spacing: .4em; text-transform: uppercase; color: var(--text-3); }
@media (max-width: 1180px) { .ahpoints { grid-template-columns: minmax(0, 1fr); } html.desk .authhero { padding: 36px 40px 32px; } }
