@layer reset, base, components, responsive;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html, body { width: 100%; height: 100%; overflow: hidden; }
  html { background: #08090b; }
  body { margin: 0; }
  button, input, select { font: inherit; }
  button { color: inherit; }
  img, svg { display: block; }
  [hidden] { display: none !important; }
}

@layer base {
  :root {
    color-scheme: dark;
    --canvas: #08090b;
    --canvas-soft: #101216;
    --ink: #f7f7f5;
    --ink-soft: rgba(247, 247, 245, .72);
    --ink-muted: rgba(247, 247, 245, .48);
    --hairline: rgba(255, 255, 255, .13);
    --hairline-strong: rgba(255, 255, 255, .25);
    --glass: rgba(20, 21, 25, .68);
    --glass-solid: #17181c;
    --accent: #ff5d3d;
    --accent-light: #ff8a70;
    --mint: #80e5c0;
    --danger: #ff7c85;
    --chrome-height: 92px;
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --ease-spring: cubic-bezier(.22, 1.15, .3, 1);
    --shadow: 0 30px 90px rgba(0, 0, 0, .5);
    --focus-ring: 0 0 0 3px #08090b, 0 0 0 6px rgba(255, 138, 112, .9);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
  }

  body {
    background: var(--canvas);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
  }

  ::selection { background: rgba(255, 93, 61, .34); color: #fff; }
  :focus-visible { outline: none; }
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .skip-link {
    position: fixed;
    z-index: 1000;
    top: 12px;
    left: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #fff;
    color: #08090b;
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-180%);
    transition: transform .2s var(--ease-out);
  }
  .skip-link:focus { transform: none; }

  .eyebrow {
    margin: 0;
    color: var(--accent-light);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .15em;
    text-transform: uppercase;
  }
}

@layer components {
  .app {
    position: fixed;
    inset: 0;
    isolation: isolate;
    background:
      radial-gradient(circle at 13% 80%, rgba(87, 43, 112, .16), transparent 26%),
      radial-gradient(circle at 78% 19%, rgba(119, 57, 36, .13), transparent 24%),
      var(--canvas);
  }

  .chrome {
    position: fixed;
    z-index: 80;
    inset: 0 0 auto;
    height: var(--chrome-height);
    display: grid;
    grid-template-columns: minmax(170px, 1fr) minmax(180px, .8fr) minmax(450px, 1.45fr);
    align-items: center;
    gap: 24px;
    padding: 18px 28px;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(8, 9, 11, .91), rgba(8, 9, 11, .57) 64%, transparent);
  }
  .chrome > * { pointer-events: auto; }

  .brand {
    width: max-content;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
  }
  .brand:focus-visible { border-radius: 12px; box-shadow: var(--focus-ring); }
  .brand-orbit {
    position: relative;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
    box-shadow: inset 0 1px rgba(255, 255, 255, .11), 0 8px 24px rgba(0, 0, 0, .18);
  }
  .brand-orbit::before,
  .brand-orbit::after,
  .brand-orbit span {
    content: "";
    position: absolute;
    border-radius: 50%;
  }
  .brand-orbit::before {
    width: 19px;
    height: 27px;
    border: 1.5px solid var(--accent-light);
    transform: rotate(42deg);
  }
  .brand-orbit::after {
    width: 27px;
    height: 15px;
    border: 1.5px solid rgba(255, 255, 255, .7);
    transform: rotate(-35deg);
  }
  .brand-orbit span { width: 7px; height: 7px; background: #fff; box-shadow: 0 0 16px #fff; }
  .brand-name { font-size: 17px; font-weight: 760; letter-spacing: -.035em; }

  .chrome-status { min-width: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
  .chrome-kicker { color: var(--ink-muted); font-size: 10px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
  .chrome-title { max-width: 100%; margin-top: 4px; overflow: hidden; color: var(--ink-soft); font-size: 13px; font-weight: 590; text-overflow: ellipsis; white-space: nowrap; }

  .chrome-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
  .room-control {
    min-width: 150px;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 13px;
    border: 1px solid var(--hairline);
    border-radius: 16px;
    background: rgba(22, 23, 27, .72);
    box-shadow: inset 0 1px rgba(255, 255, 255, .06), 0 12px 35px rgba(0, 0, 0, .18);
    backdrop-filter: blur(22px) saturate(125%);
    cursor: pointer;
    transition: background .2s, border-color .2s, transform .2s var(--ease-out);
  }
  .room-control:hover { background: rgba(34, 35, 40, .84); border-color: var(--hairline-strong); }
  .room-control:active { transform: scale(.98); }
  .room-control:focus-visible { box-shadow: var(--focus-ring); }
  .room-control-icon { position: relative; width: 26px; height: 26px; flex: 0 0 auto; }
  .room-control-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .connection-dot {
    position: absolute;
    right: -1px;
    bottom: 0;
    width: 8px;
    height: 8px;
    border: 2px solid #17181c;
    border-radius: 50%;
    background: #7a7b80;
  }
  .connection-dot.online { background: var(--mint); box-shadow: 0 0 10px rgba(128, 229, 192, .75); }
  .room-control-copy { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; }
  .room-control-copy small { color: var(--ink-muted); font-size: 9px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
  .room-control-copy strong { max-width: 95px; margin-top: 2px; overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }

  .search-shell { position: relative; z-index: 3; width: min(330px, 32vw); }
  .search {
    height: 52px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid var(--hairline);
    border-radius: 17px;
    background: rgba(22, 23, 27, .76);
    box-shadow: inset 0 1px rgba(255, 255, 255, .06), 0 12px 35px rgba(0, 0, 0, .2);
    backdrop-filter: blur(24px) saturate(125%);
    transition: width .35s var(--ease-out), background .2s, border-color .2s, box-shadow .2s;
  }
  .search:focus-within {
    border-color: rgba(255, 138, 112, .56);
    background: rgba(28, 29, 33, .94);
    box-shadow: 0 0 0 4px rgba(255, 93, 61, .1), 0 18px 48px rgba(0, 0, 0, .35);
  }
  .search svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: var(--ink-muted); stroke-width: 1.7; stroke-linecap: round; }
  .search input { min-width: 0; height: 100%; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
  .search input::placeholder { color: var(--ink-muted); }
  .search kbd { padding: 3px 6px; border: 1px solid var(--hairline); border-radius: 6px; color: var(--ink-muted); background: rgba(255, 255, 255, .04); font: 10px/1.2 inherit; }
  .search-clear { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: var(--ink-soft); font-size: 19px; cursor: pointer; }
  .search-clear:focus-visible { box-shadow: var(--focus-ring); }

  .search-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(420px, calc(100vw - 32px));
    max-height: min(450px, calc(100dvh - 112px));
    padding: 7px;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--hairline);
    border-radius: 20px;
    background: rgba(24, 25, 29, .96);
    box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, .06);
    backdrop-filter: blur(28px) saturate(130%);
    transform-origin: top right;
    animation: menu-in .22s var(--ease-out);
  }
  @keyframes menu-in { from { opacity: 0; transform: translateY(-5px) scale(.98); } }
  .search-result {
    width: 100%;
    min-height: 67px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    text-align: left;
    cursor: pointer;
  }
  .search-result:hover,
  .search-result[aria-selected="true"],
  .search-result:focus-visible { background: rgba(255, 255, 255, .09); }
  .search-result:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-light); }
  .search-result-poster { width: 42px; height: 54px; object-fit: cover; border-radius: 8px; background: #25262b; }
  .search-result-fallback { display: grid; place-items: center; color: var(--ink-muted); font-size: 16px; }
  .search-result-copy { min-width: 0; }
  .search-result-copy strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
  .search-result-copy small { display: block; margin-top: 4px; color: var(--ink-muted); font-size: 11px; }
  .search-result-action { color: var(--accent-light); font-size: 11px; font-weight: 700; }
  .search-message { padding: 22px 18px; color: var(--ink-muted); font-size: 13px; line-height: 1.5; text-align: center; }

  .avatar {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    background: linear-gradient(145deg, #ff947d, #b83e28);
    box-shadow: inset 0 1px rgba(255, 255, 255, .3), 0 10px 28px rgba(0, 0, 0, .3);
    color: #190904;
    font-size: 13px;
    font-weight: 800;
  }

  .universe, .spatial-surface { position: absolute; inset: 0; }
  .spatial-surface {
    overflow: hidden;
    background:
      linear-gradient(rgba(255, 255, 255, .012) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, .012) 1px, transparent 1px);
    background-size: 80px 80px;
    cursor: grab;
    touch-action: pan-x pan-y;
  }
  .spatial-surface:active { cursor: grabbing; }
  .spatial-surface:focus-visible { box-shadow: inset 0 0 0 3px rgba(255, 138, 112, .75); }
  .spatial-surface::before,
  .spatial-surface::after {
    content: "";
    position: absolute;
    z-index: 10;
    inset: 0;
    pointer-events: none;
  }
  .spatial-surface::before { background: radial-gradient(circle at 50% 50%, transparent 36%, rgba(8, 9, 11, .2) 75%, rgba(8, 9, 11, .65)); }
  .spatial-surface::after { background: linear-gradient(180deg, rgba(8, 9, 11, .12), transparent 18%, transparent 78%, rgba(8, 9, 11, .48)); }

  .ambient { position: absolute; z-index: 0; width: 46vw; aspect-ratio: 1; border-radius: 50%; filter: blur(100px); opacity: .13; pointer-events: none; }
  .ambient-one { left: -12vw; bottom: -22vw; background: #8f45b2; }
  .ambient-two { right: -12vw; top: -20vw; background: #dc6548; }

  .spatial-world {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    will-change: transform;
  }
  .cell-lines, .cell-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
  .cell-lines { overflow: visible; opacity: .25; }
  .cell-line { fill: none; stroke: rgba(255, 255, 255, .2); stroke-width: 1; vector-effect: non-scaling-stroke; }

  .media-cell {
    --drift-x: 0px;
    --drift-y: 0px;
    position: absolute;
    display: block;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: #17181c;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
    text-align: left;
    cursor: pointer;
    transform: translate3d(var(--drift-x), var(--drift-y), 0) scale(var(--cell-scale, 1));
    transition: transform .6s var(--ease-out), filter .45s var(--ease-out), opacity .45s;
    will-change: transform;
  }
  .media-cell::before {
    content: "";
    position: absolute;
    z-index: 2;
    inset: 0;
    background:
      linear-gradient(180deg, rgba(0, 0, 0, .08) 20%, transparent 46%, rgba(0, 0, 0, .86) 100%),
      linear-gradient(135deg, rgba(255, 255, 255, .12), transparent 35%);
    pointer-events: none;
  }
  .media-cell::after {
    content: "";
    position: absolute;
    z-index: 5;
    inset: 8px;
    border: 1px solid transparent;
    clip-path: inherit;
    pointer-events: none;
    transition: border-color .2s, box-shadow .2s;
  }
  .media-cell:hover,
  .media-cell.is-focused,
  .media-cell:focus-visible {
    --cell-scale: 1.025;
    z-index: 4;
    filter: saturate(1.12) brightness(1.08) drop-shadow(0 18px 28px rgba(0, 0, 0, .35));
  }
  .media-cell.is-muted { opacity: .32; filter: grayscale(.35) brightness(.6); }
  .media-cell.is-match { z-index: 5; }
  .media-cell.is-match::after { border-color: rgba(255, 255, 255, .82); box-shadow: inset 0 0 22px rgba(255, 255, 255, .14); }
  .media-cell:focus-visible::after { border-color: var(--accent-light); box-shadow: inset 0 0 0 2px #08090b, inset 0 0 0 4px var(--accent-light); }

  .cell-image, .cell-fallback {
    position: absolute;
    inset: -4%;
    width: 108%;
    height: 108%;
    object-fit: cover;
    pointer-events: none;
    transform: scale(1.02);
    transition: transform 1.1s var(--ease-out), filter .6s;
  }
  .media-cell:hover .cell-image,
  .media-cell.is-focused .cell-image { transform: scale(1.075); }
  .cell-fallback {
    display: grid;
    place-items: center;
    padding: 15%;
    background:
      radial-gradient(circle at 67% 24%, hsla(var(--cell-hue), 78%, 62%, .32), transparent 30%),
      linear-gradient(145deg, hsl(var(--cell-hue), 25%, 24%), #101115 65%);
    color: rgba(255, 255, 255, .55);
    font-size: clamp(13px, 1.1vw, 19px);
    font-weight: 700;
    text-align: center;
  }
  .cell-copy {
    position: absolute;
    z-index: 3;
    right: clamp(20px, 8%, 42px);
    bottom: clamp(22px, 10%, 48px);
    left: clamp(20px, 8%, 42px);
    pointer-events: none;
    text-shadow: 0 2px 16px rgba(0, 0, 0, .9);
    transform: translateY(7px);
    transition: transform .35s var(--ease-out);
  }
  .media-cell:hover .cell-copy,
  .media-cell.is-focused .cell-copy,
  .media-cell:focus-visible .cell-copy { transform: none; }
  .cell-title { display: block; font-size: clamp(15px, 1.25vw, 22px); font-weight: 760; letter-spacing: -.035em; line-height: 1.03; text-wrap: balance; }
  .cell-meta { display: block; margin-top: 6px; color: rgba(255, 255, 255, .72); font-size: 10px; font-weight: 620; letter-spacing: .08em; text-transform: uppercase; }
  .cell-progress { position: absolute; z-index: 4; right: 12%; bottom: 13px; left: 12%; height: 3px; overflow: hidden; border-radius: 9px; background: rgba(255, 255, 255, .26); }
  .cell-progress span { display: block; height: 100%; border-radius: inherit; background: var(--accent-light); }

  .loading-state {
    position: absolute;
    z-index: 40;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(8, 9, 11, .82);
    text-align: center;
    transition: opacity .45s;
  }
  .loading-state.is-leaving { opacity: 0; pointer-events: none; }
  .loading-state h1 { max-width: 700px; margin: 12px 0 8px; font-size: clamp(32px, 5vw, 68px); letter-spacing: -.06em; line-height: .96; text-wrap: balance; }
  .loading-state > p:not(.eyebrow) { max-width: 480px; margin: 0; color: var(--ink-muted); line-height: 1.55; }
  .loading-orbit { position: relative; width: 64px; height: 64px; margin-bottom: 24px; }
  .loading-orbit::before, .loading-orbit::after, .loading-orbit span { content: ""; position: absolute; inset: 0; border-radius: 50%; }
  .loading-orbit::before { border: 1px solid rgba(255, 255, 255, .16); }
  .loading-orbit::after { border: 2px solid transparent; border-top-color: var(--accent-light); animation: orbit 1.4s linear infinite; }
  .loading-orbit span { inset: 18px; background: var(--accent); box-shadow: 0 0 28px rgba(255, 93, 61, .65); animation: breathe 1.4s ease-in-out infinite alternate; }
  .loading-orbit.small { width: 38px; height: 38px; margin: 0; }
  .loading-orbit.small span { inset: 12px; }
  @keyframes orbit { to { transform: rotate(360deg); } }
  @keyframes breathe { to { transform: scale(.72); opacity: .65; } }

  .focus-card {
    position: absolute;
    z-index: 30;
    left: clamp(24px, 4vw, 64px);
    bottom: clamp(70px, 9vh, 108px);
    width: min(430px, calc(100vw - 48px));
    padding: 24px;
    border: 1px solid var(--hairline);
    border-radius: 24px;
    background: rgba(17, 18, 21, .74);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .36), inset 0 1px rgba(255, 255, 255, .08);
    backdrop-filter: blur(28px) saturate(125%);
    pointer-events: auto;
    animation: focus-in .45s var(--ease-out);
  }
  @keyframes focus-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
  .focus-card.is-right { right: clamp(24px, 4vw, 64px); left: auto; }
  .focus-card h1 { margin: 8px 0 6px; font-size: clamp(28px, 3.2vw, 48px); letter-spacing: -.055em; line-height: .98; text-wrap: balance; }
  .focus-meta { margin: 0; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
  .focus-overview { display: -webkit-box; max-width: 390px; margin: 13px 0 0; overflow: hidden; color: var(--ink-soft); font-size: 13px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
  .focus-actions { display: flex; gap: 9px; margin-top: 18px; }

  .button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -.01em;
    cursor: pointer;
    transition: transform .18s var(--ease-out), background .18s, border-color .18s, box-shadow .18s;
  }
  .button:hover { transform: translateY(-1px); }
  .button:active { transform: scale(.98); }
  .button:focus-visible { box-shadow: var(--focus-ring); }
  .button.primary { background: #fff; color: #0c0d0f; box-shadow: 0 10px 25px rgba(0, 0, 0, .24); }
  .button.primary:hover { background: #f1f1ed; }
  .button.glass { border-color: var(--hairline); background: rgba(255, 255, 255, .09); backdrop-filter: blur(16px); }
  .button.glass:hover { background: rgba(255, 255, 255, .15); }
  .button.danger { border-color: rgba(255, 124, 133, .3); background: rgba(255, 124, 133, .1); color: #ffacb2; }
  .button.large { min-height: 52px; padding: 0 22px; font-size: 14px; }

  .map {
    position: absolute;
    z-index: 26;
    right: 28px;
    bottom: 31px;
    width: 112px;
    height: 62px;
    overflow: hidden;
    border: 1px solid var(--hairline);
    border-radius: 12px;
    background: rgba(20, 21, 24, .66);
    box-shadow: inset 0 1px rgba(255, 255, 255, .05);
    backdrop-filter: blur(18px);
  }
  .map::before { content: ""; position: absolute; inset: 7px; opacity: .35; background: radial-gradient(circle, #fff 1px, transparent 1.5px); background-size: 11px 9px; }
  .map span { position: absolute; border: 1px solid var(--accent-light); border-radius: 4px; background: rgba(255, 93, 61, .1); transform: translate(-50%, -50%); }

  .interaction-hint {
    position: absolute;
    z-index: 25;
    left: 50%;
    bottom: 29px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--ink-muted);
    font-size: 11px;
    letter-spacing: .01em;
    transform: translateX(-50%);
    pointer-events: none;
  }
  .interaction-hint strong { color: var(--ink-soft); font-weight: 650; }
  .pointer-glyph { width: 19px; height: 26px; border: 1.5px solid var(--ink-muted); border-radius: 10px; }
  .pointer-glyph::after { content: ""; display: block; width: 2px; height: 6px; margin: 5px auto 0; border-radius: 2px; background: var(--accent-light); animation: scroll-hint 1.8s ease-in-out infinite; }
  @keyframes scroll-hint { 50% { transform: translateY(6px); opacity: .25; } }

  .zoom-controls {
    position: absolute;
    z-index: 27;
    right: 154px;
    bottom: 31px;
    display: flex;
    overflow: hidden;
    border: 1px solid var(--hairline);
    border-radius: 12px;
    background: rgba(20, 21, 24, .68);
    backdrop-filter: blur(18px);
  }
  .zoom-controls button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-right: 1px solid var(--hairline); background: transparent; color: var(--ink-soft); font-size: 18px; cursor: pointer; }
  .zoom-controls button:last-child { border-right: 0; }
  .zoom-controls button:hover { background: rgba(255, 255, 255, .09); }
  .zoom-controls button:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-light); }
  .zoom-controls svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

  .modal {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
  }
  .modal[open] { display: grid; place-items: center; animation: modal-in .3s var(--ease-out); }
  .modal::backdrop { background: rgba(4, 5, 7, .72); backdrop-filter: blur(14px) saturate(80%); }
  @keyframes modal-in { from { opacity: 0; } }
  .circle-button {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--hairline);
    border-radius: 50%;
    background: rgba(20, 21, 24, .74);
    box-shadow: inset 0 1px rgba(255, 255, 255, .09);
    backdrop-filter: blur(18px);
    color: var(--ink);
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
  }
  .circle-button:hover { background: rgba(47, 48, 53, .86); }
  .circle-button:focus-visible { box-shadow: var(--focus-ring); }

  .detail-sheet {
    position: relative;
    width: min(1080px, calc(100% - 28px));
    height: min(720px, calc(100dvh - 28px));
    overflow: hidden;
    border: 1px solid var(--hairline);
    border-radius: 32px;
    background: #111216;
    box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, .08);
    animation: sheet-in .48s var(--ease-spring);
  }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
  .detail-sheet .modal-close { position: absolute; z-index: 5; top: 20px; right: 20px; }
  .detail-art { position: absolute; inset: 0; background-position: center 24%; background-size: cover; filter: saturate(.9); }
  .detail-gradient { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12, 13, 16, .98) 0%, rgba(12, 13, 16, .79) 45%, rgba(12, 13, 16, .08) 85%), linear-gradient(0deg, #111216 0%, transparent 45%); }
  .detail-content { position: relative; z-index: 2; height: 100%; display: grid; grid-template-columns: 190px minmax(0, 550px); align-items: end; gap: 30px; padding: 60px; }
  .detail-poster { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 18px; background: #24252a; box-shadow: 0 25px 55px rgba(0, 0, 0, .45); }
  .detail-copy { padding-bottom: 4px; }
  .detail-copy h2 { max-width: 620px; margin: 9px 0 9px; font-size: clamp(38px, 5vw, 68px); letter-spacing: -.065em; line-height: .94; text-wrap: balance; }
  .detail-meta { margin: 0; color: var(--ink-soft); font-size: 13px; font-weight: 620; }
  .detail-overview { max-width: 570px; margin: 17px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.65; }
  .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 15px; }
  .chip { padding: 6px 9px; border: 1px solid var(--hairline); border-radius: 999px; color: var(--ink-soft); background: rgba(255, 255, 255, .04); font-size: 10px; font-weight: 620; }
  .detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

  .player-modal { background: #030405; }
  .player-shell { width: 100%; height: 100%; display: flex; flex-direction: column; background: #030405; }
  .player-header { position: absolute; z-index: 3; inset: 0 0 auto; height: 84px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; background: linear-gradient(180deg, rgba(0, 0, 0, .86), transparent); pointer-events: none; }
  .player-header > * { pointer-events: auto; }
  .player-title-group h2 { margin: 3px 0 0; font-size: 16px; letter-spacing: -.025em; }
  .player-header-actions { display: flex; align-items: center; gap: 12px; }
  .sync-pill { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid rgba(128, 229, 192, .18); border-radius: 999px; background: rgba(15, 25, 22, .7); color: #a2eed3; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; backdrop-filter: blur(16px); }
  .sync-pill span { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 9px var(--mint); }
  .video-wrap { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; }
  .video-wrap video { width: 100%; height: 100%; object-fit: contain; background: #000; }
  .video-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 15px; background: rgba(0, 0, 0, .72); color: var(--ink-soft); font-size: 13px; }
  .track-controls { position: absolute; z-index: 3; right: 24px; bottom: 24px; display: flex; gap: 8px; padding: 8px; border: 1px solid var(--hairline); border-radius: 14px; background: rgba(18, 19, 22, .82); backdrop-filter: blur(20px); }
  .track-controls label { display: flex; align-items: center; gap: 8px; color: var(--ink-muted); font-size: 10px; font-weight: 650; text-transform: uppercase; }
  .track-controls select { min-height: 36px; max-width: 180px; border: 0; border-radius: 9px; outline: 0; background: rgba(255, 255, 255, .08); color: var(--ink); font-size: 12px; text-transform: none; }
  .track-controls select:focus-visible { box-shadow: var(--focus-ring); }

  .room-sheet {
    position: relative;
    width: min(480px, calc(100% - 28px));
    max-height: calc(100dvh - 28px);
    padding: 42px;
    overflow: auto;
    border: 1px solid var(--hairline);
    border-radius: 30px;
    background: rgba(20, 21, 25, .94);
    box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, .08);
    backdrop-filter: blur(28px) saturate(120%);
    animation: sheet-in .42s var(--ease-spring);
  }
  .room-sheet .modal-close { position: absolute; top: 18px; right: 18px; }
  .room-symbol { position: relative; width: 64px; height: 64px; margin-bottom: 24px; border: 1px solid var(--hairline); border-radius: 21px; background: radial-gradient(circle, rgba(255, 93, 61, .22), rgba(255, 255, 255, .04)); }
  .room-symbol span { position: absolute; width: 16px; height: 16px; border: 2px solid var(--accent-light); border-radius: 50%; }
  .room-symbol span:nth-child(1) { top: 14px; left: 13px; }
  .room-symbol span:nth-child(2) { top: 14px; right: 13px; }
  .room-symbol span:nth-child(3) { right: 0; bottom: 10px; left: 0; margin: auto; }
  .room-sheet h2 { margin: 8px 0 9px; font-size: 34px; letter-spacing: -.05em; line-height: 1; }
  .muted { margin: 0; color: var(--ink-muted); font-size: 13px; line-height: 1.55; }
  .room-sheet label { display: block; margin: 26px 0 8px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
  .room-sheet input { width: 100%; height: 50px; padding: 0 14px; border: 1px solid var(--hairline); border-radius: 14px; outline: 0; background: rgba(255, 255, 255, .065); color: var(--ink); }
  .room-sheet input:focus { border-color: var(--accent-light); box-shadow: 0 0 0 4px rgba(255, 93, 61, .1); }
  .room-sheet input:disabled { color: var(--ink-muted); opacity: 1; }
  .field-error { min-height: 18px; margin: 7px 0 0; color: var(--danger); font-size: 11px; }
  .room-actions { display: flex; flex-wrap: wrap; gap: 9px; }
  .room-share { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--hairline); color: var(--ink-muted); font-size: 12px; }
  .text-button { min-height: 44px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--accent-light); font-size: 12px; font-weight: 700; cursor: pointer; }
  .text-button:focus-visible { box-shadow: var(--focus-ring); }

  .toast-region { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 9px; }
  .toast { max-width: min(390px, calc(100vw - 40px)); padding: 14px 16px; border: 1px solid var(--hairline); border-radius: 14px; background: rgba(29, 30, 34, .94); box-shadow: 0 20px 50px rgba(0, 0, 0, .4); color: var(--ink-soft); font-size: 13px; backdrop-filter: blur(18px); animation: toast-in .32s var(--ease-spring); }
  .toast.error { border-color: rgba(255, 124, 133, .36); color: #ffc0c4; }
  @keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }
  .noscript { position: fixed; z-index: 500; inset: auto 0 0; padding: 15px; background: var(--danger); color: #210508; text-align: center; font-weight: 750; }
}

@layer responsive {
  @media (max-width: 1080px) {
    .chrome { grid-template-columns: auto 1fr; gap: 12px; padding-inline: 20px; }
    .chrome-status { display: none; }
    .chrome-actions { min-width: 0; }
    .search-shell { width: min(330px, 40vw); }
    .room-control { min-width: 52px; width: 52px; padding: 0; justify-content: center; }
    .room-control-copy { display: none; }
    .detail-content { padding: 44px; }
    .interaction-hint { left: 24px; transform: none; }
  }

  @media (max-width: 720px) {
    :root { --chrome-height: 76px; }
    .chrome { grid-template-columns: auto 1fr; height: var(--chrome-height); padding: 12px 14px; background: linear-gradient(180deg, rgba(8, 9, 11, .94), rgba(8, 9, 11, .4), transparent); }
    .brand { min-height: 48px; }
    .brand-name { display: none; }
    .brand-orbit { width: 42px; height: 42px; }
    .chrome-actions { gap: 7px; }
    .avatar { display: none; }
    .room-control { width: 46px; min-width: 46px; height: 46px; border-radius: 15px; }
    .search-shell { width: min(100%, 310px); }
    .search { height: 46px; border-radius: 15px; }
    .search kbd { display: none; }
    .search-results { position: fixed; top: 68px; right: 12px; left: 12px; width: auto; max-height: min(58dvh, 430px); }
    .spatial-surface { touch-action: pinch-zoom; }
    .focus-card, .focus-card.is-right { left: 14px; right: 14px; bottom: 70px; width: auto; padding: 18px; border-radius: 20px; }
    .focus-card h1 { font-size: clamp(25px, 8vw, 36px); }
    .focus-overview { display: none; }
    .focus-actions { margin-top: 14px; }
    .interaction-hint { display: none; }
    .map { right: 14px; bottom: 14px; width: 84px; height: 48px; }
    .zoom-controls { left: 14px; right: auto; bottom: 14px; }

    .detail-sheet { width: 100%; height: 100dvh; border: 0; border-radius: 0; overflow-y: auto; }
    .detail-art { height: 55dvh; bottom: auto; background-position: center top; }
    .detail-gradient { position: fixed; background: linear-gradient(0deg, #111216 30%, rgba(17, 18, 22, .52) 64%, rgba(17, 18, 22, .05)); }
    .detail-content { min-height: 100%; height: auto; grid-template-columns: 90px 1fr; gap: 18px; align-items: end; padding: max(220px, 42dvh) 20px 28px; }
    .detail-poster-wrap { align-self: start; }
    .detail-copy h2 { font-size: clamp(32px, 11vw, 48px); }
    .detail-overview, .chips, .detail-actions { grid-column: 1 / -1; }
    .detail-copy { display: contents; }
    .detail-copy > .eyebrow, .detail-copy > h2, .detail-copy > .detail-meta { grid-column: 2; }
    .detail-copy > .eyebrow { align-self: end; }
    .detail-copy > h2 { margin: 5px 0; align-self: end; }
    .detail-copy > .detail-meta { align-self: start; }
    .detail-overview { margin-top: 4px; }
    .detail-actions { position: sticky; z-index: 4; bottom: 0; margin: 0 -20px -28px; padding: 16px 20px max(20px, env(safe-area-inset-bottom)); background: linear-gradient(0deg, #111216 72%, transparent); }
    .detail-actions .button { flex: 1; }
    .room-sheet { padding: 34px 22px max(24px, env(safe-area-inset-bottom)); border-radius: 26px; }
    .room-symbol { width: 54px; height: 54px; }
    .room-sheet h2 { font-size: 30px; }
    .player-header { height: 70px; padding: 0 14px; }
    .sync-pill { font-size: 0; padding: 10px; }
    .track-controls { right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); left: 10px; justify-content: center; flex-wrap: wrap; }
  }

  @media (max-width: 470px) {
    .search-shell { width: 46px; transition: width .3s var(--ease-out); }
    .search-shell:focus-within, .search-shell.is-open { position: fixed; z-index: 90; top: 12px; right: 14px; left: 64px; width: auto; }
    .search-shell:not(:focus-within):not(.is-open) .search { position: relative; justify-content: center; padding: 0; }
    .search-shell:not(:focus-within):not(.is-open) .search input { position: absolute; inset: 0; width: 100%; height: 100%; flex: none; opacity: 0; cursor: text; }
    .search-shell:not(:focus-within):not(.is-open) .search svg { width: 20px; pointer-events: none; }
    .search-shell:not(:focus-within):not(.is-open) .search-clear { display: none !important; }
    .focus-actions .button { flex: 1; }
    .map { display: none; }
    .detail-content { grid-template-columns: 76px 1fr; gap: 14px; padding-inline: 16px; }
    .detail-actions { margin-inline: -16px; padding-inline: 16px; }
    .detail-actions .button { width: 100%; flex-basis: 100%; }
    .room-actions .button { width: 100%; }
  }

  @media (max-height: 590px) and (min-width: 721px) {
    :root { --chrome-height: 72px; }
    .chrome { height: 72px; padding-block: 10px; }
    .focus-card { bottom: 20px; max-width: 370px; padding: 18px; }
    .focus-card h1 { font-size: 30px; }
    .focus-overview { -webkit-line-clamp: 2; line-clamp: 2; }
    .map, .zoom-controls { bottom: 18px; }
    .interaction-hint { display: none; }
    .detail-sheet { height: calc(100dvh - 16px); }
    .detail-content { padding: 36px 46px; grid-template-columns: 150px minmax(0, 520px); }
    .detail-copy h2 { font-size: clamp(35px, 6vw, 52px); }
    .detail-overview { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .media-cell { --drift-x: 0px !important; --drift-y: 0px !important; }
  }

  @media (prefers-contrast: more) {
    :root { --ink-soft: rgba(255, 255, 255, .9); --ink-muted: rgba(255, 255, 255, .72); --hairline: rgba(255, 255, 255, .34); }
    .media-cell::before { background: linear-gradient(180deg, transparent 25%, rgba(0, 0, 0, .94)); }
  }

  @media (forced-colors: active) {
    .ambient, .cell-lines, .map { display: none; }
    .media-cell, .focus-card, .search, .room-control, .room-sheet, .detail-sheet { border: 2px solid CanvasText; background: Canvas; forced-color-adjust: auto; }
    .media-cell { clip-path: none !important; }
  }
}
