@font-face {
  font-family: "Times AJR";
  src: url("assets/TimesAjr-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0d1b2a;
  --muted: #5b6472;
  --panel: rgba(255, 255, 255, .72);
  --panel-strong: rgba(255, 255, 255, .88);
  --line: rgba(13, 27, 42, .14);
  --accent: #126c83;
  --accent-strong: #0e5365;
  --warm: #f0a34a;
  --ok: #2f9c69;
  --shadow: 0 24px 70px rgba(2, 15, 31, .22);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  background: #0e0e10;
  overflow-x: hidden;
}

body.is-locked {
  min-height: 100vh;
  overflow: hidden;
}

body.is-locked .site-header,
body.is-locked .portal,
body.is-locked .site-footer {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.background {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: #0e0e10;
}

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 8, 12, .2);
  backdrop-filter: blur(10px);
}

body:not(.is-locked) .access-gate {
  display: none;
}

.access-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  color: #f5fbff;
  background: rgba(9, 12, 17, .74);
  box-shadow: 0 28px 90px rgba(0,0,0,.46);
  text-align: center;
}

.access-mark {
  font-family: "Times AJR", Georgia, serif;
  font-size: 46px;
  line-height: .9;
}

.access-logo {
  display: block;
  height: 52px;
  width: auto;
  margin: 0 auto;
  filter: drop-shadow(0 2px 14px rgba(0, 38, 68, .44));
}

.access-card h1 {
  margin: 0;
  font-size: 18px;
}

.access-field {
  display: grid;
  gap: 8px;
  color: rgba(255,255,255,.76);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.access-field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 8px;
  padding: 0 14px;
  color: #fff;
  background: rgba(255,255,255,.1);
  outline: none;
}

.access-field input:focus {
  border-color: rgba(144, 220, 239, .8);
  box-shadow: 0 0 0 4px rgba(18, 108, 131, .24);
}

.access-error {
  margin: 0;
  color: #ffd0d0;
  font-size: 13px;
  font-weight: 800;
}

.access-button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  color: #052332;
  background: #dff8ff;
  font-weight: 950;
  cursor: pointer;
}

.access-button:hover {
  background: #ffffff;
}

.access-hint {
  margin: 4px 0 0;
  text-align: center;
  font-size: 13px;
  color: rgba(223, 248, 255, 0.6);
  word-break: break-all;
}

.access-hint a {
  color: #dff8ff;
  font-weight: 700;
  text-decoration: underline;
}

.access-hint a:hover {
  color: #ffffff;
}

.site-header {
  position: fixed;
  top: 24px;
  left: 28px;
  right: 28px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  pointer-events: none;
}

.brand {
  pointer-events: auto;
  color: #ffffff;
  font-family: "Times AJR", Georgia, serif;
  font-size: 48px;
  line-height: .86;
  letter-spacing: 0;
  text-decoration: none;
  text-shadow: 0 2px 18px rgba(0, 38, 68, .44);
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
  will-change: opacity, transform;
}

.brand-logo {
  display: block;
  height: 46px;
  width: auto;
  filter: drop-shadow(0 2px 12px rgba(0, 38, 68, .44));
}

body.is-content-scrolled .brand {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-14px) scale(.96);
  pointer-events: none;
}

.sync-pill {
  pointer-events: auto;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 999px;
  color: #11334b;
  background: rgba(255,255,255,.72);
  box-shadow: 0 12px 36px rgba(0, 27, 56, .13);
  backdrop-filter: blur(16px);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(47, 156, 105, .16);
}

.portal {
  width: min(1320px, calc(100vw - 40px));
  min-height: calc(100vh - 138px);
  margin: 114px auto 24px;
  display: block;
}

/* Interactive edge-swipe-back (mobile): the page follows the finger, then
   eases off / snaps back on release. */
.portal.is-swiping {
  will-change: transform;
}
.portal.is-animating {
  transition: transform .26s cubic-bezier(.2,.72,.28,1), opacity .26s ease;
  will-change: transform, opacity;
}
.portal.is-swiping::before,
.portal.is-animating::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -18px;
  width: 18px;
  background: linear-gradient(to left, rgba(0,0,0,.42), rgba(0,0,0,0));
  pointer-events: none;
}

.workspace {
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  box-shadow: none;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.queue-count {
  min-width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(240, 163, 74, .2);
  color: #7c4710;
  font-size: 13px;
  font-weight: 800;
}

.workspace {
  min-height: 640px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.toolbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 2px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.search-wrap {
  min-width: 260px;
  max-width: 460px;
  width: 42%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  color: rgba(255,255,255,.6);
  background: rgba(255,255,255,.06);
}

.search-wrap input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: #f2f2f4;
  background: transparent;
  font-weight: 700;
}

.search-wrap input::placeholder {
  color: rgba(255,255,255,.5);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: #e8e8ea;
  background: rgba(255,255,255,.06);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.tool-button:hover {
  background: rgba(255,255,255,.14);
}

.tool-button.primary {
  color: #fff;
  border-color: rgba(14, 83, 101, .3);
  background: var(--accent);
}

.tool-button.primary:hover {
  background: var(--accent-strong);
}

.tool-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.browser-shell {
  min-height: 0;
  padding: 14px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
}

.browser-topline {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.breadcrumbs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.72);
  font-size: 13px;
  font-weight: 800;
}

.crumb-button {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(255,255,255,.86);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.crumb-button:hover,
.crumb-button.is-current {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.12);
}

.crumb-separator {
  color: rgba(255,255,255,.34);
}

.item-count {
  flex: 0 0 auto;
  color: rgba(255,255,255,.5);
  font-size: 13px;
  font-weight: 800;
}

.browser-meta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.drive-source-link {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.drive-source-link:hover {
  text-decoration: underline;
}

.folder-download-button {
  min-height: 34px;
  padding-inline: 13px;
  color: #fff;
  border-color: rgba(18, 108, 131, .45);
  background: rgba(18, 108, 131, .24);
}

.folder-download-button:hover {
  background: rgba(18, 108, 131, .42);
}

.folder-download-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.folder-download-button[hidden] {
  display: none;
}
/* ── Back button (visible inside subfolders) ────────────────────────── */
.back-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 10px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  color: #e8e8ea;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.back-button:hover {
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .16);
}

.back-button:active {
  background: rgba(255, 255, 255, .14);
}

.back-button svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.back-button[hidden] {
  display: none;
}

.archive-grid {
  min-height: 520px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding: 2px;
}

.archive-item {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, auto) auto;
  gap: 10px;
  padding: 0;
  border: 0;
  color: #e8e8ea;
  background: transparent;
  cursor: default;
  text-align: left;
}

.archive-item.is-folder {
  cursor: pointer;
}

.archive-item:hover .archive-art {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0,0,0,.5);
}

.archive-art {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  border: 0;
  transition: transform .18s ease, box-shadow .18s ease;
}

.archive-art--file {
  background:
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
}

.archive-art--image {
  background: rgba(0,0,0,.3);
}

.archive-art--image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.archive-art--font {
  background:
    radial-gradient(circle at 50% 28%, rgba(255,255,255,.12), rgba(255,255,255,0) 44%),
    linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
}

.archive-font-preview {
  display: block;
  max-width: calc(100% - 28px);
  color: #f6f2ea;
  font-size: clamp(44px, 8vw, 84px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 10px 34px rgba(0,0,0,.24);
  white-space: nowrap;
}

.archive-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: rgba(18,108,131,.12);
}

.archive-icon svg {
  width: 36px;
  height: 36px;
}

.archive-icon.file {
  color: #835a12;
  background: rgba(240,163,74,.16);
}

.archive-name {
  min-width: 0;
  color: #ececee;
  font-size: 15px;
  font-weight: 840;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.archive-path {
  min-width: 0;
  color: rgba(255,255,255,.5);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.archive-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.archive-action {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: #e8e8ea;
  background: rgba(255,255,255,.06);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.archive-action:hover {
  background: rgba(255,255,255,.16);
}

.archive-action svg {
  width: 15px;
  height: 15px;
}

.archive-type-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  min-width: 44px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: #fff;
  background: rgba(9, 10, 12, .72);
  box-shadow: 0 10px 24px rgba(0,0,0,.34);
  backdrop-filter: blur(14px);
  font-family: "Times AJR", Georgia, serif;
  font-size: 23px;
  line-height: 1;
  text-shadow: 0 0 12px rgba(255,255,255,.28);
  pointer-events: none;
}

.archive-type-badge--audio {
  color: #f4fbff;
}

.archive-type-badge--font {
  min-width: 52px;
  color: #f7efe1;
  font-family: var(--font);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
}

.archive-type-badge--camera,
.archive-type-badge--video {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: 20px;
}

.archive-type-badge--folder {
  color: #e9fbff;
  font-family: "Times AJR", Georgia, serif;
  font-size: 26px;
}

.archive-type-badge--document,
.archive-type-badge--file {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .04em;
}

.site-footer {
  width: min(1320px, calc(100vw - 40px));
  margin: 6px auto 26px;
  color: rgba(255,255,255,.72);
  font-family: "Times AJR", Georgia, serif;
  font-size: 15px;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-shadow: 0 2px 14px rgba(0, 24, 46, .5);
}

.footer-mark {
  font-family: "Times AJR", Georgia, serif;
}

.preview-modal[hidden] {
  display: none;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 18, 33, .46);
  backdrop-filter: blur(7px);
}

.preview-panel {
  position: relative;
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  background: #161618;
  box-shadow: 0 28px 80px rgba(0,0,0,.6);
}

.preview-header,
.preview-footer {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.preview-footer {
  justify-content: flex-end;
  border-top: 1px solid rgba(255,255,255,.08);
  border-bottom: 0;
}

.preview-header h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #ececee;
  font-size: 16px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: #e8e8ea;
  background: rgba(255,255,255,.06);
  cursor: pointer;
}

.preview-body {
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: auto;
}

.folder-download-panel {
  width: min(620px, calc(100vw - 32px));
}

.folder-download-body {
  min-height: 300px;
}

.folder-download-content {
  width: min(500px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.folder-download-icon {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  color: #fff;
  background: rgba(18, 108, 131, .3);
  font-size: 34px;
  font-weight: 900;
}

.folder-download-status {
  margin: 0;
  color: #f4f4f5;
  font-size: 19px;
  font-weight: 900;
}

.folder-download-detail,
.folder-download-current {
  margin: 0;
  color: rgba(255,255,255,.62);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.folder-download-current {
  min-height: 20px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-download-progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
}

.folder-download-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #6ed9f2);
  transition: width .2s ease;
}

.folder-download-progress.is-indeterminate span {
  width: 34%;
  animation: folder-download-scan 1.15s ease-in-out infinite;
}

.folder-download-footer .tool-button {
  min-width: 110px;
}

@keyframes folder-download-scan {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(310%); }
}

.preview-body audio,
.preview-body video,
.preview-body iframe,
.preview-body img {
  width: 100%;
  max-width: 100%;
}

.preview-body audio {
  max-width: 680px;
}

.preview-body video {
  max-height: 68vh;
  background: #000;
  border-radius: var(--radius);
}

.preview-body iframe {
  height: min(68vh, 720px);
  border: 1px solid rgba(13,27,42,.12);
  border-radius: var(--radius);
  background: #fff;
}

/* Embedded Google Drive video player (for .ts/.mkv etc. that can't play natively) */
.preview-body iframe.drive-video-embed {
  height: min(72vh, 820px);
  background: #000;
  border-color: rgba(255,255,255,.12);
}

.preview-body .embed-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-dim, #9ba1a8);
  text-align: center;
}

.preview-body .embed-note a {
  color: inherit;
  text-decoration: underline;
}

.preview-body img {
  width: auto;
  max-height: 68vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.font-specimen {
  width: 100%;
  display: grid;
  place-items: center;
  padding: 18px 0;
}

.font-specimen-card {
  width: min(760px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  color: #f2f3f7;
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  box-shadow: 0 24px 64px rgba(0,0,0,.24);
}

.font-specimen-label {
  color: rgba(255,255,255,.58);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.font-specimen-sample {
  display: block;
  font-size: clamp(84px, 14vw, 160px);
  line-height: .9;
  color: #fffaf2;
  text-shadow: 0 16px 40px rgba(0,0,0,.18);
}

.font-specimen-name {
  font-size: 17px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.font-specimen-line {
  color: rgba(255,255,255,.9);
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.15;
}

.font-specimen-line--numeric {
  color: rgba(255,255,255,.64);
  font-size: clamp(20px, 2.2vw, 28px);
}


.preview-message {
  max-width: 520px;
  color: rgba(255,255,255,.72);
  text-align: center;
  font-weight: 800;
  line-height: 1.45;
}

.preview-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
}

/* Install instructions modal */
.install-body {
  display: block;
  align-content: start;
  padding: 22px;
  overflow: auto;
}

.install-intro {
  margin: 0 0 20px;
  color: rgba(255,255,255,.72);
  font-weight: 700;
  line-height: 1.5;
}

.install-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.install-card {
  padding: 18px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
}

.install-card h3 {
  margin: 0 0 12px;
  color: #f2f2f4;
  font-size: 16px;
}

.install-card ol {
  margin: 0;
  padding-left: 20px;
  color: rgba(255,255,255,.82);
  line-height: 1.6;
  font-weight: 600;
}

.install-card li {
  margin-bottom: 6px;
}

.install-card strong {
  color: #fff;
}

.install-now {
  margin-top: 14px;
  width: 100%;
}

@media (max-width: 560px) {
  .install-cols {
    grid-template-columns: 1fr;
  }
}

/* Spinning-record audio player */
.record-player {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  padding: 12px;
}

.record-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
}

.record-stage::before {
  content: "";
  position: absolute;
  width: 84%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: rgba(18,108,131,.2);
  filter: blur(30px);
}

/* Fixed-size clip wrapper: the disc is a square that rotates, so its bounding
   box grows up to ~1.41x at 45deg. Left unclipped, that expanding box trips the
   preview-body scrollbar and reflows the modal every rotation. The visible record
   is a symmetric circle, so clipping the sweeping transparent corners here is
   invisible while keeping the disc's footprint perfectly still. */
.record-disc-clip {
  position: relative;
  width: min(42vh, 310px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 26px 60px rgba(0,0,0,.62);
  cursor: grab;
  touch-action: none;
}

.record-disc {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background:
    repeating-radial-gradient(circle at center, #17171a 0 1px, #0c0c0d 1px 4px);
  box-shadow: inset 0 0 60px rgba(0,0,0,.55);
  animation: record-spin 6s linear infinite;
  animation-play-state: paused;
  will-change: transform;
}

.record-disc-clip:active {
  cursor: grabbing;
}

.record-disc.is-spinning {
  animation-play-state: running;
}

.record-disc.is-scratching {
  animation-play-state: paused;
}

.record-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.record-disc::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at center, rgba(0,0,0,.16) 0 1px, rgba(255,255,255,0) 1px 6px),
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.14), rgba(255,255,255,0) 42%);
  box-shadow: inset 0 0 0 5px rgba(0,0,0,.4);
  pointer-events: none;
}

.record-hole {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13%;
  height: 13%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #0b0b0c;
  box-shadow: 0 0 0 7px rgba(0,0,0,.45), 0 0 0 9px rgba(255,255,255,.08);
  z-index: 3;
}

.record-hero-toggle {
  position: absolute;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 50%;
  color: #fff;
  background: rgba(7, 10, 14, .66);
  box-shadow: 0 18px 40px rgba(0,0,0,.38);
  backdrop-filter: blur(18px);
  cursor: pointer;
  z-index: 5;
}

.record-hero-toggle svg {
  width: 30px;
  height: 30px;
}

.player-console {
  min-width: 0;
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.035)),
    rgba(10,10,12,.74);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 18px 42px rgba(0,0,0,.28);
}

.player-track {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.player-track span {
  color: rgba(255,255,255,.5);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.player-track strong {
  min-width: 0;
  color: #f7f7f8;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.player-status {
  margin: 0;
  min-height: 20px;
  color: rgba(255,255,255,.62);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .02em;
}

.record-audio {
  display: none;
}

.player-control-row {
  display: grid;
  grid-template-columns: repeat(5, 56px);
  justify-content: center;
  align-items: center;
  gap: 14px;
}

.player-control-row[hidden] {
  display: none;
}

.player-button {
  height: 56px;
  min-width: 56px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,.07);
  font-size: 20px;
  font-weight: 950;
  cursor: pointer;
}

.player-button:hover,
.record-hero-toggle:hover {
  background: rgba(255,255,255,.15);
}

.player-button:disabled {
  opacity: .36;
  cursor: not-allowed;
}

.player-toggle {
  grid-column: 1;
  grid-row: 1;
  background: var(--accent);
  border-color: rgba(255,255,255,.18);
}

.player-track-nav[data-track-nav="prev"] {
  grid-column: 2;
  grid-row: 1;
}

.player-skip[data-skip="-15"] {
  grid-column: 3;
  grid-row: 1;
}

.player-skip[data-skip="15"] {
  grid-column: 4;
  grid-row: 1;
}

.player-track-nav[data-track-nav="next"] {
  grid-column: 5;
  grid-row: 1;
}

.player-current {
  grid-column: 1 / 3;
  grid-row: 2;
  justify-self: start;
}

.player-duration {
  grid-column: 4 / 6;
  grid-row: 2;
  justify-self: end;
}

.player-seek {
  grid-column: 1 / -1;
  grid-row: 3;
}

.player-button svg {
  width: 20px;
  height: 20px;
}

.player-time {
  color: rgba(255,255,255,.62);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
}

.player-seek,
.player-volume {
  --progress: 0%;
  width: 100%;
  height: 34px;
  appearance: none;
  border-radius: 999px;
  background:
    linear-gradient(90deg, #e8f7ff 0 var(--progress), rgba(255,255,255,.16) var(--progress) 100%);
  cursor: pointer;
}

.player-seek::-webkit-slider-thumb,
.player-volume::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  appearance: none;
  border: 2px solid rgba(8, 12, 16, .9);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 5px 14px rgba(0,0,0,.32);
}

.player-seek::-moz-range-thumb,
.player-volume::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(8, 12, 16, .9);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 5px 14px rgba(0,0,0,.32);
}

.player-volume-wrap {
  min-width: 0;
  grid-column: 1 / -1;
  grid-row: 4;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  color: rgba(255,255,255,.52);
  font-size: 18px;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.player-volume-shell {
  position: relative;
  min-width: 0;
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) 56px;
  gap: 16px;
}

.player-volume-shell .player-volume {
  grid-column: 1;
  grid-row: 1;
}

.player-volume-percent {
  grid-column: 2;
  grid-row: 1;
  justify-self: stretch;
  min-width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  z-index: 2;
  color: rgba(255,255,255,.86);
  background: rgba(255,255,255,.07);
  font-size: 14px;
  font-weight: 950;
  pointer-events: none;
  text-transform: none;
  letter-spacing: 0;
}

.audio-fallback {
  grid-column: 1 / -1;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 16px;
  text-align: center;
}

.audio-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.audio-download-btn:hover {
  background: var(--accent-strong);
}

.audio-download-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

@keyframes record-spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  min-height: 360px;
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  padding: 34px;
  border: 1px dashed rgba(255,255,255,.14);
  border-radius: var(--radius);
  color: rgba(255,255,255,.56);
  background: rgba(255,255,255,.02);
  text-align: center;
  font-weight: 800;
}

@media (max-width: 900px) {
  .site-header {
    top: 18px;
    left: 18px;
    right: 18px;
  }

  .brand {
    font-size: 40px;
  }

  .brand-logo {
    height: 38px;
  }

  .portal {
    width: calc(100vw - 24px);
    margin-top: 94px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-wrap {
    width: 100%;
    max-width: none;
  }

  .toolbar-actions {
    width: 100%;
  }

  .tool-button {
    flex: 1;
  }
}

@media (max-width: 560px) {
  /* ═══════════════════════════════════════════════════════
     UNIFIED TOP BAR — brand + status dot + icon buttons
     ═══════════════════════════════════════════════════════ */
  .site-header {
    top: 0;
    left: 0;
    right: 0;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    height: 52px;
    background: rgba(14, 14, 16, 0.94);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    pointer-events: auto;
  }

  .brand {
    font-size: 24px;
    flex: 0 0 auto;
  }

  .brand-logo {
    height: 26px;
  }

  /* Compact sync pill — dot-only status indicator */
  .sync-pill {
    min-height: 0;
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 0;
    gap: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    overflow: hidden;
    margin-right: auto;
  }

  #syncStatus {
    display: none;
  }

  .sync-pill .sync-dot {
    width: 10px;
    height: 10px;
  }

  /* Action buttons — fixed into the top bar, right side */
  .toolbar-actions {
    position: fixed;
    top: 8px;
    right: 14px;
    z-index: 21;
    width: auto;
    display: flex;
    align-items: center;
    gap: 5px;
  }

  /* Icon-only circular buttons */
  .tool-button {
    position: relative;
    font-size: 0;
    line-height: 0;
    padding: 0;
    width: 36px;
    min-height: 36px;
    border-radius: 50%;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    gap: 0;
  }

  .tool-button svg {
    width: 17px;
    height: 17px;
  }

  .tool-button .queue-count {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 16px;
    height: 16px;
    font-size: 9px;
    line-height: 16px;
  }

  /* Toolbar collapses to just hold the search island */
  .toolbar {
    flex-direction: column;
    align-items: center;
    min-height: auto;
    padding: 10px 0 6px;
    border-bottom: none;
  }

  /* ═══════════════════════════════════════════════════════
     DYNAMIC ISLAND SEARCH — floating pill, expands on focus
     ═══════════════════════════════════════════════════════ */
  .search-wrap {
    width: min(72vw, 280px);
    max-width: none;
    min-width: 0;
    min-height: 44px;
    margin: 0 auto;
    background: rgba(28, 28, 32, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow:
      0 6px 24px rgba(0, 0, 0, .4),
      0 0 0 0.5px rgba(255, 255, 255, .05);
    transition:
      width 0.4s cubic-bezier(.4, 0, .2, 1),
      box-shadow 0.4s ease,
      background 0.3s ease;
  }

  .search-wrap:focus-within {
    width: min(92vw, 370px);
    background: rgba(34, 34, 40, 0.98);
    box-shadow:
      0 10px 40px rgba(0, 0, 0, .5),
      0 0 20px rgba(18, 108, 131, .1),
      0 0 0 0.5px rgba(255, 255, 255, .1);
  }

  /* Portal sits below the fixed header */
  .portal {
    margin-top: 62px;
    width: calc(100vw - 12px);
  }

  /* ═══════════════════════════════════════════════════════
     COMPACT GRID & SMALLER ART
     ═══════════════════════════════════════════════════════ */
  .browser-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .browser-shell {
    padding: 10px 20px;
  }

  .archive-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    min-height: 300px;
  }

  .archive-item {
    gap: 6px;
  }

  .archive-art {
    border-radius: 8px;
  }

  .archive-name {
    font-size: 12px;
    font-weight: 800;
  }

  .archive-path {
    font-size: 10px;
  }

  /* Hide per-tile action buttons on mobile; tapping still previews */
  .archive-actions {
    display: none;
  }

  .archive-icon {
    width: 36px;
    height: 36px;
  }

  .archive-icon svg {
    width: 20px;
    height: 20px;
  }

  /* ═══════════════════════════════════════════════════════
     MOBILE PREVIEW PLAYER
     ═══════════════════════════════════════════════════════ */
  .preview-modal {
    padding: 10px;
  }

  .preview-panel {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 16px;
    overflow: hidden;
  }

  .preview-header,
  .preview-footer {
    min-height: 48px;
    padding: 10px 14px;
    gap: 10px;
    overflow: hidden;
  }

  .preview-header h2 {
    font-size: 14px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .preview-close {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
  }

  .preview-close svg {
    width: 16px;
    height: 16px;
  }

  .preview-body {
    min-height: 200px;
    padding: 12px;
  }

  /* Compact record player for phones */
  .record-player {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 4px;
  }

  .record-disc-clip {
    width: min(42vh, 230px);
  }

  .record-hero-toggle {
    width: 58px;
    height: 58px;
  }

  .player-console {
    padding: 14px;
    border-radius: 14px;
  }

  .player-track strong {
    font-size: 15px;
  }

  .player-control-row {
    grid-template-columns: repeat(5, 44px);
    justify-content: center;
    gap: 8px;
  }

  .player-button {
    height: 44px;
    min-width: 44px;
    font-size: 15px;
  }

  .player-time {
    font-size: 14px;
  }

  .player-toggle {
    grid-column: 1;
    grid-row: 1;
  }

  .player-track-nav[data-track-nav="prev"] {
    grid-column: 2;
    grid-row: 1;
  }

  .player-skip[data-skip="-15"] {
    grid-column: 3;
    grid-row: 1;
  }

  .player-skip[data-skip="15"] {
    grid-column: 4;
    grid-row: 1;
  }

  .player-track-nav[data-track-nav="next"] {
    grid-column: 5;
    grid-row: 1;
  }

  .player-current {
    grid-column: 1 / 3;
    grid-row: 2;
    justify-self: start;
  }

  .player-duration {
    grid-column: 4 / 6;
    grid-row: 2;
    justify-self: end;
  }

  .player-seek {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .player-volume-wrap {
    display: none;
  }

  /* Download button — compact */
  .preview-footer .tool-button {
    font-size: 13px;
    width: auto;
    min-height: 38px;
    border-radius: 999px;
    padding: 0 16px;
    display: inline-flex;
    gap: 7px;
  }
}
