/* ThomasAI dashboard */
[hidden] { display: none !important; }

#shutter {
  position: fixed;
  top: 0;
  bottom: 0;
  left: -50vh;
  z-index: 5;
  width: calc(100vw + 100vh);
  background: var(--bone);
  transform: skewX(-36deg) translateX(-112%);
}

#shutter.is-running { will-change: transform; }

.app {
  position: relative;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  height: 100%;
}

/* Rail */
.rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px 12px 14px;
  background: rgb(9 9 11 / .9);
  border-right: 1px solid rgb(233 232 228 / .1);
}

.home {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 22px;
  border: 0;
  color: var(--bone);
  background: none;
  font: inherit;
  font-size: 1.14rem;
  font-weight: 600;
  letter-spacing: -.02em;
  text-align: left;
  cursor: pointer;
}

.tabs { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }

.tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 0;
  color: var(--smoke);
  background: none;
  font: inherit;
  font-size: .96rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color .16s;
}

.tab svg {
  flex: none;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.tab:hover { color: var(--bone); }

.tab__badge {
  flex: none;
  min-width: 18px;
  height: 18px;
  margin-left: auto;
  padding: 0 5px;
  border-radius: 9px;
  color: #fff;
  background: #d83c3e;
  font-size: .72rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.tab[aria-current="page"] .tab__badge { margin-right: 26px; }

.tab[aria-current="page"] {
  color: var(--void);
  background: var(--bone);
  clip-path: polygon(0 0, 100% 0, calc(100% - 30px) 100%, 0 100%);
}

.rail__chats {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-top: 18px;
}

.newchat {
  height: 38px;
  margin: 0 2px;
  border: 1px solid rgb(233 232 228 / .2);
  color: var(--bone);
  background: none;
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  transition: background-color .16s;
}

.newchat:hover { background: rgb(233 232 228 / .1); }

.rail__title {
  margin: 18px 12px 6px;
  color: var(--smoke);
  font-size: .8rem;
  font-weight: 400;
}

#recent {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: var(--ash) transparent;
}

.chatlink {
  display: block;
  width: 100%;
  padding: 7px 12px;
  overflow: hidden;
  border: 0;
  color: var(--smoke);
  background: none;
  font: inherit;
  font-size: .88rem;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.chatlink:hover, .chatlink[aria-current] { color: var(--bone); }
.chatlink[aria-current] { background: rgb(233 232 228 / .08); }

.rail__foot { margin-top: auto; padding-top: 12px; }

/* Main area */
.stage { position: relative; min-width: 0; min-height: 0; }

.page { height: 100%; }

.page--soon {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(28px, 7vw, 76px);
}

.page--soon h2 {
  margin: 0;
  font-size: clamp(3rem, 9vw, 7rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.045em;
}

.page--soon p { margin: 14px 0 0; color: var(--smoke); font-size: 1.05rem; }

/* AI page: the composer sits mid-screen, then drops to the bottom once a chat starts. */
#page-ai {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1fr auto 1.25fr;
  min-height: 0;
  padding: 0 clamp(14px, 3vw, 32px) 18px;
}

#page-ai.has-chat { grid-template-rows: minmax(0, 1fr) auto; }

.empty { align-self: end; justify-self: center; width: min(100%, 760px); padding-bottom: 24px; }

.empty h2 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.04em;
}

#thread {
  min-height: 0;
  overflow-y: auto;
  padding: 28px 0 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--ash) transparent;
}

#page-ai:not(.has-chat) #thread { display: none; }

.msg {
  width: min(100%, 760px);
  margin: 0 auto 24px;
  font-size: 1rem;
  line-height: 1.62;
}

.msg--user { display: flex; flex-direction: column; align-items: flex-end; }

.msg__text {
  max-width: min(85%, 600px);
  margin: 0;
  padding: 11px 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #1b1b1e;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}

.msg__images { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-bottom: 6px; }
.msg__images img { display: block; max-width: 220px; max-height: 220px; }
.msg__note { margin: 0 0 6px; color: var(--smoke); font-size: .84rem; }

.msg__status { margin: 0 0 6px; color: var(--smoke); }

.think { margin-bottom: 8px; color: var(--smoke); font-size: .9rem; }
.think summary { width: fit-content; cursor: pointer; }

.think__body {
  max-height: 260px;
  margin-top: 8px;
  padding-left: 14px;
  overflow-y: auto;
  border-left: 1px solid var(--ash);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.prose { overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol, .prose pre, .prose table, .prose blockquote { margin: 0 0 .9em; }
.prose h1, .prose h2, .prose h3 { margin: 1.3em 0 .45em; font-weight: 600; line-height: 1.25; letter-spacing: -.02em; }
.prose h1 { font-size: 1.5rem; }
.prose h2 { font-size: 1.28rem; }
.prose h3 { font-size: 1.08rem; }
.prose a { color: var(--bone); text-underline-offset: 3px; }
.prose hr { border: 0; border-top: 1px solid var(--ash); }
.prose blockquote { padding-left: 14px; border-left: 2px solid var(--ash); color: var(--smoke); }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { padding: 6px 12px; border: 1px solid var(--ash); text-align: left; }

.prose code {
  padding: .1em .32em;
  font-family: Consolas, "Cascadia Mono", Menlo, monospace;
  font-size: .9em;
  background: rgb(233 232 228 / .1);
}

.prose pre {
  position: relative;
  padding: 14px 16px;
  overflow-x: auto;
  background: #101012;
  border: 1px solid rgb(233 232 228 / .1);
}

.prose pre code { padding: 0; background: none; font-size: .88rem; }

.copy {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 3px 9px;
  border: 0;
  color: var(--smoke);
  background: #232326;
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
}

.copy:hover { color: var(--bone); }

.msg__error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 10px 14px;
  border-left: 2px solid var(--bone);
  background: #18181b;
}

.msg__error p { flex: 1 1 200px; margin: 0; }

.msg__error button {
  padding: 5px 12px;
  border: 0;
  color: var(--void);
  background: var(--bone);
  font: inherit;
  font-size: .88rem;
  cursor: pointer;
}

/* Composer */
#composer {
  justify-self: center;
  width: min(100%, 760px);
  padding: 1px;
  background: rgb(233 232 228 / .22);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%);
  transition: background-color .16s;
}

#composer:focus-within, #composer.is-dropping { background: rgb(233 232 228 / .55); }

.composer__body {
  padding: 12px 12px 10px 14px;
  background: #101012;
  clip-path: inherit;
}

#tray { display: flex; gap: 8px; padding-bottom: 10px; }

.chip { position: relative; width: 62px; height: 62px; }
.chip img { display: block; width: 100%; height: 100%; object-fit: cover; }

.chip button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  color: var(--void);
  background: var(--bone);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

#prompt {
  display: block;
  width: 100%;
  min-height: 28px;
  padding: 2px;
  border: 0;
  resize: none;
  outline: none;
  color: var(--bone);
  background: none;
  font: inherit;
  font-size: 1.04rem;
  line-height: 1.5;
}

#prompt::placeholder { color: var(--smoke); }

.composer__row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }

.iconbtn {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  color: var(--bone);
  background: none;
  cursor: pointer;
}

.iconbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn:hover { background: rgb(233 232 228 / .1); }

#models {
  flex: 1 1 auto;
  display: flex;
  min-width: 0;
  color: var(--smoke);
  font-size: .86rem;
}

.model {
  flex: none;
  height: 32px;
  padding: 0 12px;
  border: 0;
  color: var(--smoke);
  background: none;
  font: inherit;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.model:hover { color: var(--bone); }

.model[aria-checked="true"] {
  color: var(--bone);
  background: rgb(233 232 228 / .13);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

#send {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 38px;
  border: 0;
  color: var(--void);
  background: var(--bone);
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}

#send svg { width: 18px; height: 18px; fill: currentColor; }
#send .icon-stop { display: none; }
#send.is-stop .icon-send { display: none; }
#send.is-stop .icon-stop { display: block; }
#send:disabled { color: var(--smoke); background: var(--ash); cursor: not-allowed; }

#notice {
  position: absolute;
  bottom: 110px;
  left: 50%;
  z-index: 2;
  padding: 8px 14px;
  background: var(--bone);
  color: var(--void);
  font-size: .9rem;
  transform: translateX(-50%);
}

/* Games: the wall stays edge to edge so the games are the page. */
.library { height: 100%; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ash) transparent; }

.library__bar {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px;
  background: var(--void);
  border-bottom: 1px solid rgb(233 232 228 / .14);
}

#game-search {
  display: block;
  width: min(100%, 460px);
  padding: 10px 14px;
  border: 1px solid rgb(233 232 228 / .24);
  color: var(--bone);
  background: var(--basalt);
  font: inherit;
  outline: 0;
}

#game-search:focus { border-color: var(--bone); }
#game-search::placeholder { color: var(--smoke); }

.wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 2px;
  background: var(--void);
}

.tile {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: var(--bone);
  background: var(--basalt);
  font: inherit;
  text-align: left;
  cursor: pointer;
  content-visibility: auto;
  contain-intrinsic-size: auto 200px;
}

.tile img { display: block; width: 100%; height: 100%; object-fit: cover; }

.tile span {
  position: absolute;
  inset: auto 0 0;
  padding: 18px 10px 8px;
  overflow: hidden;
  background: linear-gradient(rgb(6 6 7 / 0), rgb(6 6 7 / .92) 55%);
  font-size: .86rem;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tile--plain span {
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 14px;
  background: none;
  font-size: 1.32rem;
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.12;
  white-space: normal;
}

.tile--plain:hover { background: #18181b; }

.tile:hover img { filter: brightness(1.14); }
.tile:hover span { white-space: normal; }

.library__note { margin: 0; padding: 28px 16px; color: var(--smoke); }
.library__retry { margin: 0 16px 28px; }
#wall-end { height: 1px; }

.player { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; background: #000; }

.player__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--void);
  border-bottom: 1px solid rgb(233 232 228 / .14);
}

.player__bar h2 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 1rem;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.player__bar button, .library__retry {
  flex: none;
  padding: 7px 13px;
  border: 0;
  color: var(--void);
  background: var(--bone);
  font: inherit;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
}

#player-frame { display: block; width: 100%; height: 100%; border: 0; background: #000; }

/* Web: the browser lives on its own origin. */
#web-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--basalt); }

/* Context left */
.ring { flex: none; width: 22px; height: 22px; }

.ring svg { display: block; transform: rotate(-90deg); fill: none; stroke: var(--ash); stroke-width: 2.500; }
.ring__left { stroke: var(--smoke); stroke-dasharray: 100 100; transition: stroke-dasharray .4s var(--ease); }
.ring.is-low .ring__left { stroke: var(--bone); }

.compact { margin-bottom: 18px; padding: 8px 0; border-block: 1px solid rgb(233 232 228 / .14); color: var(--smoke); font-size: .9rem; }
.compact summary { width: fit-content; cursor: pointer; }
.compact .prose { margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  .ring__left { transition: none; }
}

/* Screen share */
.sharebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-self: center;
  gap: 10px 14px;
  width: min(100%, 760px);
  padding: 14px 16px;
  background: #101012;
  border: 1px solid rgb(233 232 228 / .3);
}

.sharebar p { flex: 1 1 220px; margin: 0; }

.sharebar button, .mini__stop {
  padding: 7px 13px;
  border: 0;
  color: var(--void);
  background: var(--bone);
  font: inherit;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
}

.mini {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--void);
}

.mini__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid rgb(233 232 228 / .14);
}

.mini__live { flex: none; width: 64px; height: 36px; background: #000; object-fit: cover; }
.mini__label { flex: 1 1 auto; min-width: 0; margin: 0; font-size: .86rem; }
.mini__stop { flex: none; padding: 6px 10px; font-size: .8rem; }

.mini__thread { min-height: 0; padding: 14px 12px 4px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ash) transparent; }
.mini__hint { margin: 0 0 14px; color: var(--smoke); font-size: .92rem; line-height: 1.5; }

.mini .msg { width: 100%; margin-bottom: 16px; font-size: .94rem; line-height: 1.55; }
.mini .msg__text { max-width: 92%; padding: 8px 12px; }
.mini .msg__images img { max-width: 132px; max-height: 88px; }

.mini__form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 10px 12px;
  border-top: 1px solid rgb(233 232 228 / .14);
}

.mini__form #prompt { flex: 1 1 auto; font-size: .96rem; }

.home:focus-visible, .tab:focus-visible, .newchat:focus-visible, .chatlink:focus-visible,
.iconbtn:focus-visible, .model:focus-visible, .copy:focus-visible, #send:focus-visible,
.sharebar button:focus-visible, .mini__stop:focus-visible, .compact summary:focus-visible,
.tile:focus-visible, .player__bar button:focus-visible, .library__retry:focus-visible,
.msg__error button:focus-visible, .chip button:focus-visible, .think summary:focus-visible {
  outline: 2px solid var(--bone);
  outline-offset: -2px;
}

#send:focus-visible, .msg__error button:focus-visible, .tab[aria-current="page"]:focus-visible,
.sharebar button:focus-visible, .mini__stop:focus-visible,
.player__bar button:focus-visible, .library__retry:focus-visible { outline-color: var(--void); }

/* Phones: the rail becomes a bottom bar. */
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }

  .stage { grid-row: 1; }

  .rail {
    grid-row: 2;
    flex-direction: row;
    padding: 4px;
    border-top: 1px solid rgb(233 232 228 / .1);
    border-right: 0;
  }

  .home, .rail__chats, .rail__foot .tab__label, .tabs .tab__label { display: none; }

  .composer__row { flex-wrap: wrap; }
  #models { order: 1; flex-basis: 100%; }
  .ring { margin-left: auto; }

  .rail nav { flex: 7 1 0; min-width: 0; }
  .tabs { grid-auto-flow: column; grid-auto-columns: 1fr; }
  .rail__foot { flex: 1 1 0; min-width: 0; margin: 0; padding: 0; }

  .tab { justify-content: center; height: 48px; padding: 0; }
  .tab__badge, .tab[aria-current="page"] .tab__badge { position: absolute; top: 4px; left: calc(50% + 3px); margin: 0; }
  .tab[aria-current="page"] { clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }

  .model { padding: 0 7px; font-size: .78rem; }
  .composer__row { gap: 4px; }
  #send { width: 42px; }
  .iconbtn { width: 30px; }
  #models { overflow-x: auto; scrollbar-width: none; }
  #page-ai { padding-bottom: 10px; }
}

/* Music */
#page-music { position: relative; background: var(--void); }

.music { height: 100%; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ash) transparent; }

#page-music.has-dock .music { padding-right: 292px; }

.music__bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 12px clamp(16px, 3vw, 32px);
  background: var(--void);
  border-bottom: 1px solid rgb(233 232 228 / .1);
}

#music-search {
  flex: 1 1 220px;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 0;
  outline: 0;
  color: var(--bone);
  background: rgb(233 232 228 / .08);
  font: inherit;
  font-size: 16px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}

#music-search:focus { background: rgb(233 232 228 / .14); }
#music-search::placeholder { color: var(--smoke); }

.music__views { display: flex; gap: 4px; }

.music__views button {
  height: 34px;
  padding: 0 12px;
  border: 0;
  color: var(--smoke);
  background: none;
  font: inherit;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: color .16s;
}

.music__views button:hover { color: var(--bone); }
.music__views button[aria-pressed="true"] { color: var(--void); background: var(--bone); }

.music__body { padding: clamp(20px, 3vw, 32px) clamp(16px, 3vw, 32px) 8px; }

.music__title {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}

.music__sub { margin: -8px 0 18px; color: var(--smoke); }
.music__section { margin: 30px 0 12px; font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; }
.music__note { margin: 12px 0; color: var(--smoke); }
.music__credit { margin: 0; padding: 18px clamp(16px, 3vw, 32px) 24px; color: var(--smoke); font-size: .8rem; }

.music__retry {
  height: 36px;
  padding: 0 14px;
  border: 0;
  color: var(--void);
  background: var(--bone);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.moods { display: flex; flex-wrap: wrap; gap: 8px; }

.moods button {
  height: 36px;
  padding: 0 16px;
  border: 0;
  color: var(--bone);
  background: rgb(233 232 228 / .08);
  font: inherit;
  font-size: .92rem;
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  transition: background-color .16s;
}

.moods button:hover { background: rgb(233 232 228 / .16); }
.moods button[aria-pressed="true"] { color: var(--void); background: var(--bone); }

.finder { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin-bottom: 14px; }

.finder__box {
  flex: 0 1 240px;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border: 0;
  outline: 0;
  color: var(--bone);
  background: rgb(233 232 228 / .08);
  font: inherit;
  font-size: 16px;
}

.finder__box:focus { background: rgb(233 232 228 / .14); }
.finder__box::placeholder { color: var(--smoke); }

.music__cover { display: block; width: 160px; height: 160px; margin-bottom: 18px; object-fit: cover; background: var(--basalt); }

.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 12px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; scrollbar-color: var(--ash) transparent; }

.strip button {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 0;
  border: 0;
  color: var(--bone);
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.strip--wrap { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, 132px); overflow-x: visible; }

.strip img { display: block; width: 132px; height: 132px; margin-bottom: 6px; object-fit: cover; background: var(--basalt); }
.strip span, .strip small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.strip span { font-size: .9rem; font-weight: 500; }
.strip small { color: var(--smoke); font-size: .8rem; }

.songs { margin: 0; padding: 0; list-style: none; }

.song { display: flex; align-items: center; transition: background-color .12s; }
.song:hover { background: rgb(233 232 228 / .06); }

.song__main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 7px 8px;
  border: 0;
  color: var(--bone);
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.song__rank { flex: none; width: 24px; color: var(--smoke); font-size: .86rem; text-align: right; font-variant-numeric: tabular-nums; }
.song__art { flex: none; width: 44px; height: 44px; object-fit: cover; background: var(--basalt); }
.song__letter { display: grid; place-items: center; color: var(--smoke); font-weight: 600; text-transform: uppercase; }
.song__text { flex: 2 1 0; display: grid; min-width: 0; }
.song__title, .song__artist, .song__album { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.song__title { font-size: .96rem; font-weight: 500; }
.song__artist { color: var(--smoke); font-size: .84rem; }
.song__album { flex: 1 1 0; min-width: 0; color: var(--smoke); font-size: .86rem; }
.song__time { flex: none; width: 40px; color: var(--smoke); font-size: .86rem; text-align: right; font-variant-numeric: tabular-nums; }
.song.is-current .song__title { text-decoration: underline; text-underline-offset: 3px; }

.song__like {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-right: 4px;
  border: 0;
  color: var(--smoke);
  background: none;
  cursor: pointer;
}

.song__like svg, .dock__foot svg, .dock__controls svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.song__like:hover { color: var(--bone); }
.song__like[aria-pressed="true"], #dock-like[aria-pressed="true"] { color: var(--bone); }
.song__like[aria-pressed="true"] svg, #dock-like[aria-pressed="true"] svg { fill: currentColor; }

.dock {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  display: grid;
  gap: 8px;
  width: 268px;
  padding: 10px;
  background: var(--basalt);
  border: 1px solid rgb(233 232 228 / .14);
}

.dock__screen { position: relative; height: 204px; background: #000; }
.dock__screen iframe, #music-video { display: block; width: 100%; height: 100%; border: 0; }
#dock-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.dock__tag {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 4px 8px;
  color: var(--void);
  background: var(--bone);
  font-size: .74rem;
  font-weight: 600;
}

.dock__info { min-width: 0; }
.dock__title, .dock__artist { margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dock__title { font-size: .96rem; font-weight: 600; }
.dock__artist { color: var(--smoke); font-size: .84rem; }

.dock input[type="range"] { width: 100%; height: 16px; margin: 0; accent-color: var(--bone); cursor: pointer; }
.dock__times { display: flex; justify-content: space-between; margin-top: -6px; color: var(--smoke); font-size: .74rem; font-variant-numeric: tabular-nums; }

.dock__controls { display: flex; align-items: center; justify-content: space-between; }

.dock__controls button, .dock__foot button {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  color: var(--smoke);
  background: none;
  cursor: pointer;
  transition: color .16s;
}

.dock__controls button:hover, .dock__foot button:hover { color: var(--bone); }
.dock__controls button[aria-pressed="true"], #dock-repeat:not([data-mode="off"]) { color: var(--bone); box-shadow: inset 0 -2px var(--bone); }
#dock-repeat[data-mode="one"]::after { content: "1"; position: absolute; right: 3px; bottom: 3px; font-size: .6rem; font-weight: 700; }

.dock__controls .dock__play { width: 44px; height: 44px; color: var(--void); background: var(--bone); clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 100%, 0 100%); }
.dock__controls .dock__play:hover { color: var(--void); }
.dock__play .icon-pause { display: none; }
.dock.is-playing .dock__play .icon-pause { display: block; }
.dock.is-playing .dock__play .icon-play { display: none; }
.dock__play .icon-play { fill: currentColor; }

.dock__foot { display: flex; align-items: center; gap: 6px; }
.dock__foot input[type="range"] { flex: 1 1 0; min-width: 0; }
#dock-apple { flex: none; color: var(--smoke); font-size: .74rem; }

.dock__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dock__head .dock__info { flex: 1 1 0; }
.dock__thumb { display: none; flex: none; width: 40px; height: 40px; object-fit: cover; }

#dock-mini {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  color: var(--smoke);
  background: none;
  cursor: pointer;
}

#dock-mini:hover { color: var(--bone); }
#dock-mini svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; transition: transform .16s; }
.dock.is-mini #dock-mini svg { transform: rotate(180deg); }

/* The screen moves away instead of hiding, so the video keeps playing. */
.dock.is-mini .dock__screen { position: fixed; top: -1000px; left: -1000px; width: 246px; }
.dock.is-mini .dock__thumb { display: block; }
.dock.is-mini .dock__times, .dock.is-mini #dock-seek { display: none; }

.song__add {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 38px;
  border: 0;
  color: var(--smoke);
  background: none;
  cursor: pointer;
}

#page-announcements { background: var(--void); }

.notices {
  box-sizing: border-box;
  height: 100%;
  overflow-y: auto;
  padding: clamp(20px, 3vw, 32px) clamp(16px, 3vw, 32px);
  scrollbar-width: thin;
  scrollbar-color: var(--ash) transparent;
}

.notices__title {
  margin: 0 0 20px;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.04em;
}

.notices__list { display: grid; gap: 22px; max-width: 760px; margin: 0; padding: 0; list-style: none; }

.notice { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 2px 12px; }

.notice__picture { grid-row: span 3; width: 44px; height: 44px; object-fit: cover; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%); }

.notice__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.notice__name { font-weight: 600; }
.notice__time { color: var(--smoke); font-size: .78rem; }

.notice__reactions { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }

.reaction, .reaction-add, .reaction-menu button {
  height: 30px;
  padding: 0 9px;
  border: 0;
  color: var(--bone);
  background: rgb(233 232 228 / .08);
  font: inherit;
  font-size: .86rem;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.reaction:hover, .reaction-add:hover, .reaction-menu button:hover:not(:disabled) { background: rgb(233 232 228 / .16); }
.reaction[aria-pressed="true"] { background: rgb(233 232 228 / .2); box-shadow: inset 0 -2px var(--bone); }
.reaction-add { color: var(--smoke); }
.reaction-add svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

.reaction-menu { display: flex; flex-wrap: wrap; gap: 4px; flex-basis: 100%; }
.reaction-menu button:disabled { opacity: .35; cursor: default; }

.notices__older, .notices__retry {
  height: 36px;
  margin-bottom: 20px;
  padding: 0 14px;
  border: 0;
  color: var(--bone);
  background: rgb(233 232 228 / .08);
  font: inherit;
  cursor: pointer;
}

.notices__older:hover, .notices__retry:hover { background: rgb(233 232 228 / .16); }
.notices__note { min-height: 1.4em; margin: 14px 0; color: var(--smoke); }

.song__add svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.song__add:hover { color: var(--bone); }

.music__body .moods + .songs { margin-top: 18px; }

.music__toast {
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 5;
  margin: 0;
  padding: 10px 14px;
  color: var(--void);
  background: var(--bone);
  font-size: .9rem;
  font-weight: 600;
  transform: translateX(-50%);
}

.ask {
  width: min(380px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid rgb(233 232 228 / .14);
  color: var(--bone);
  background: var(--basalt);
}

.ask::backdrop { background: rgb(6 6 7 / .7); }
.ask h2 { margin: 0 0 14px; font-size: 1.2rem; font-weight: 600; }
.ask ul { display: grid; gap: 2px; max-height: 240px; margin: 0 0 14px; padding: 0; overflow-y: auto; list-style: none; scrollbar-width: thin; scrollbar-color: var(--ash) transparent; }

.ask ul button {
  width: 100%;
  padding: 10px;
  border: 0;
  color: var(--bone);
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ask ul button:hover { background: rgb(233 232 228 / .08); }
#ask-form { display: flex; gap: 8px; }

#ask-name {
  flex: 1 1 0;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 0;
  outline: 0;
  color: var(--bone);
  background: rgb(233 232 228 / .08);
  font: inherit;
  font-size: 16px;
}

#ask-name:focus { background: rgb(233 232 228 / .14); }

#ask-save, #ask-close { height: 40px; padding: 0 14px; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
#ask-save { color: var(--void); background: var(--bone); }
#ask-close { margin-top: 8px; padding: 0; color: var(--smoke); background: none; font-weight: 500; }
#ask-close:hover { color: var(--bone); }

@media (max-width: 1240px) {
  #page-music.has-dock .song__album { display: none; }
}

@media (max-width: 860px) {
  .song__album { display: none; }
  .finder__box { flex-basis: 100%; }
  #page-music.has-dock .music { padding-right: 0; padding-bottom: 440px; }
}

/* Movies + TV */
#page-movies { position: relative; background: var(--void); }

.cinema { height: 100%; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ash) transparent; }

.cinema__bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 12px clamp(16px, 3vw, 32px);
  background: var(--void);
  border-bottom: 1px solid rgb(233 232 228 / .1);
}

#cinema-search {
  flex: 1 1 220px;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 0;
  outline: 0;
  color: var(--bone);
  background: rgb(233 232 228 / .08);
  font: inherit;
  font-size: 16px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}

#cinema-search:focus { background: rgb(233 232 228 / .14); }
#cinema-search::placeholder { color: var(--smoke); }

.cinema__views { display: flex; gap: 4px; }

.cinema__views button {
  height: 34px;
  padding: 0 12px;
  border: 0;
  color: var(--smoke);
  background: none;
  font: inherit;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: color .16s;
}

.cinema__views button:hover { color: var(--bone); }
.cinema__views button[aria-pressed="true"] { color: var(--void); background: var(--bone); }

.cinema__body { padding: clamp(20px, 3vw, 32px) clamp(16px, 3vw, 32px) 8px; }

.cinema__wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 2px;
}

.cinema__tile { aspect-ratio: 2 / 3; }

.cinema__tile img { display: block; width: 100%; height: 100%; object-fit: cover; }

.cinema__tile-name {
  position: absolute;
  inset: auto 0 0;
  padding: 24px 10px 8px;
  overflow: hidden;
  background: linear-gradient(rgb(6 6 7 / 0), rgb(6 6 7 / .92) 55%);
  font-size: .86rem;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cinema__tile:hover .cinema__tile-name { white-space: normal; }

.cinema__type-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 6px;
  color: var(--void);
  background: var(--bone);
  font-size: .72rem;
  font-weight: 600;
}

.cinema__section { margin-bottom: 18px; }

.cinema__strip img { width: 132px; height: 198px; }

.cinema__note { margin: 0; padding: 28px 16px; color: var(--smoke); }

/* Detail page */
.cinema__player {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ash) transparent;
}

.cinema__player-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--void);
  border-bottom: 1px solid rgb(233 232 228 / .14);
}

.cinema__player-bar h2 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 1rem;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cinema__player-bar button {
  flex: none;
  padding: 7px 13px;
  border: 0;
  color: var(--void);
  background: var(--bone);
  font: inherit;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
}

.cinema__hero { position: relative; }

.cinema__backdrop {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  mask-image: linear-gradient(to bottom, #000 40%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent);
}

.cinema__info { padding: 0 clamp(16px, 3vw, 32px) 24px; }

.cinema__detail-title {
  margin: 0 0 8px;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.04em;
}

.cinema__meta { margin-bottom: 12px; color: var(--smoke); font-size: .9rem; }

.cinema__overview {
  max-width: 760px;
  margin: 0 0 18px;
  color: var(--smoke);
  font-size: 1rem;
  line-height: 1.62;
}

.cinema__play {
  height: 36px;
  padding: 0 18px;
  border: 0;
  color: var(--void);
  background: var(--bone);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.cinema__picker { padding: 0 clamp(16px, 3vw, 32px) 18px; }
.cinema__seasons { margin-bottom: 14px; }

.cinema__detail .cinema__section { padding: 0 clamp(16px, 3vw, 32px); }

/* Video screen */
.cinema__screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  margin-bottom: 18px;
}

#cinema-frame { display: block; width: 100%; height: 100%; border: 0; background: #000; }

.cinema__sources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 8px clamp(16px, 3vw, 32px);
  border-bottom: 1px solid rgb(233 232 228 / .1);
  font-size: .84rem;
}

.cinema__sources span { margin-right: 4px; color: var(--smoke); }

.cinema__sources button {
  padding: 5px 11px;
  border: 1px solid rgb(233 232 228 / .22);
  color: var(--smoke);
  background: none;
  font: inherit;
  font-size: .84rem;
  font-weight: 500;
  cursor: pointer;
  transition: color .16s, background .16s;
}

.cinema__sources button:hover { color: var(--bone); border-color: var(--bone); }

.cinema__sources button[aria-pressed="true"] {
  color: var(--void);
  background: var(--bone);
  border-color: var(--bone);
}

/* Focus styles */
.cinema__views button:focus-visible,
.cinema__play:focus-visible,
.cinema__sources button:focus-visible,
.cinema__player-bar button:focus-visible,
#cinema-search:focus-visible,
.cinema__tile:focus-visible {
  outline: 2px solid var(--bone);
  outline-offset: -2px;
}

.cinema__play:focus-visible,
.cinema__player-bar button:focus-visible { outline-color: var(--void); }

@media (max-width: 760px) {
  .cinema__wall { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .cinema__backdrop { max-height: 240px; }
}
