:root {
  color-scheme: dark;
  --page: #07090d;
  --frame: #0e1218;
  --panel: #141922;
  --panel-2: #191f2a;
  --panel-3: #202735;
  --text: #f4f6fa;
  --muted: #aab1bf;
  --muted-2: #7d8594;
  --line: rgba(255,255,255,.075);
  --line-strong: rgba(255,255,255,.12);
  --accent: #8b5cf6;
  --accent-2: #a779ff;
  --accent-soft: rgba(139,92,246,.18);
  --accent-soft-2: rgba(139,92,246,.34);
  --ok: #8ee5a7;
  --warn: #f4d68b;
  --danger: #ff8484;
  --shadow: 0 24px 70px rgba(0,0,0,.38);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 76% 18%, rgba(139,92,246,.08), transparent 31rem),
    linear-gradient(180deg, #05070a 0%, #090c11 100%);
}
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(167,121,255,.42);
  outline-offset: 2px;
}
.hidden { display: none !important; }
.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;
}

.app-frame {
  width: min(1540px, calc(100% - 28px));
  min-height: calc(100vh - 28px);
  margin: 14px auto;
  padding: 18px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.018), transparent 26%),
    var(--frame);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: 0 28px 100px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.025);
}

.topbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 10px 14px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 25px;
  filter: grayscale(1) brightness(2.2);
}
.brand strong, .brand span { display: block; }
.brand strong { font-size: 18px; letter-spacing: -.02em; }
.brand span { margin-top: 2px; color: var(--muted-2); font-size: 11px; }
.top-actions { display: flex; gap: 8px; }
.top-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  font-size: 22px;
}
.top-icon:hover { background: var(--panel-2); border-color: var(--line); }

.workspace {
  display: grid;
  grid-template-columns: 210px minmax(280px, 330px) minmax(390px, 1fr) minmax(280px, 330px);
  gap: 10px;
  height: calc(100vh - 112px);
  min-height: 650px;
}
.panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255,255,255,.025), rgba(255,255,255,.005)),
    var(--panel);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.018);
  overflow: hidden;
}

/* Sidebar */
.sidebar { display: flex; flex-direction: column; padding: 12px 0; }
.nav-list { padding: 0 10px 12px; border-bottom: 1px solid var(--line); }
.nav-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d8dce5;
  text-align: left;
  font-size: 14px;
}
.nav-item span { width: 20px; color: #d9dce5; font-size: 21px; text-align: center; }
.nav-item:hover { background: rgba(255,255,255,.035); }
.nav-item.active {
  color: #cbb6ff;
  background: linear-gradient(90deg, rgba(139,92,246,.28), rgba(139,92,246,.14));
  box-shadow: inset 0 0 0 1px rgba(139,92,246,.12);
  font-weight: 750;
}
.nav-item.active span { color: #b99cff; }
.side-section { padding: 18px 14px; border-bottom: 1px solid var(--line); }
.side-section h2 {
  margin: 0 0 14px;
  color: #cfd4df;
  font-size: 13px;
  font-weight: 650;
}
.source-button {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  text-align: left;
  line-height: 1.25;
}
.source-button > span:first-child { width: 22px; text-align: center; font-size: 20px; }
.source-button.primary {
  border-color: rgba(167,121,255,.5);
  background: linear-gradient(135deg, #9d65f4, #7f4ce4);
  color: #fff;
  box-shadow: 0 8px 24px rgba(101,58,190,.23), inset 0 1px 0 rgba(255,255,255,.17);
  font-weight: 750;
}
.source-button.primary:hover { filter: brightness(1.06); }
.source-button.secondary { background: var(--panel-3); color: #e1e4eb; }
.source-button.secondary:hover { border-color: rgba(167,121,255,.35); }
.source-hint { margin: 12px 2px 0; color: var(--muted-2); font-size: 10px; line-height: 1.45; }
.stats-section { margin-top: auto; }
.stats-list { margin: 0; }
.stats-list div { display: flex; justify-content: space-between; gap: 10px; margin: 11px 0; color: var(--muted); font-size: 12px; }
.stats-list dt, .stats-list dd { margin: 0; }
.stats-list dd { color: #cfd4df; }
.storage-bar { height: 5px; margin: 0 14px 10px; background: #262d3a; border-radius: 99px; overflow: hidden; }
.storage-bar span { display: block; width: 58%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* Library */
.library-pane { display: flex; flex-direction: column; padding: 16px 0 0; }
.pane-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 0 14px 14px; }
.section-kicker { display: block; color: #9c7fe3; font-size: 9px; font-weight: 850; letter-spacing: .16em; }
.pane-title-row h1 { margin: 3px 0 0; font-size: 19px; letter-spacing: -.025em; }
.count-badge { color: var(--muted-2); font-size: 11px; }
.library-tools { display: grid; grid-template-columns: 1fr 38px; gap: 8px; padding: 0 14px 12px; }
.search-wrap { position: relative; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 19px; pointer-events: none; }
.search-wrap input {
  width: 100%;
  height: 38px;
  padding: 0 10px 0 34px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111620;
}
.search-wrap input::placeholder { color: #787f8e; }
.tool-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #111620;
  font-size: 22px;
}
.tool-button:hover { border-color: rgba(167,121,255,.35); }
#librarySection { min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #343b4a transparent; }
.library-list { padding: 0 10px 14px; }
.book-card {
  width: 100%;
  display: grid;
  grid-template-columns: 64px 1fr 22px;
  align-items: center;
  gap: 10px;
  min-height: 84px;
  padding: 7px;
  border: 1px solid transparent;
  border-bottom-color: var(--line);
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  text-align: left;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.book-card:hover { background: rgba(255,255,255,.025); transform: translateY(-1px); }
.book-card.active {
  border-color: rgba(139,92,246,.2);
  background: linear-gradient(90deg, rgba(139,92,246,.2), rgba(139,92,246,.11));
}
.cover {
  width: 64px;
  height: 70px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(145deg, #2d3442, #171c25);
  color: #9c84d8;
  font-size: 25px;
  box-shadow: 0 8px 18px rgba(0,0,0,.24);
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.book-info { min-width: 0; }
.book-info strong, .book-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-info strong { margin-bottom: 5px; color: #f0f2f6; font-size: 13px; }
.book-info span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.book-more { color: #b7bdc8; font-size: 22px; text-align: center; }
.progress-track { height: 3px; margin-top: 7px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.075); }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.empty-state { margin: auto 14px; padding: 42px 18px; color: var(--muted); text-align: center; }
.empty-state h2 { margin: 14px 0 6px; color: var(--text); font-size: 17px; }
.empty-state p { margin: 0; font-size: 12px; line-height: 1.55; }
.empty-icon {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border: 1px solid rgba(139,92,246,.22);
  border-radius: 50%;
  color: #b799ff;
  background: rgba(139,92,246,.09);
  font-size: 28px;
}

/* Main player */
.player-pane { position: relative; display: flex; align-items: stretch; justify-content: center; padding: 22px 24px; }
.player-placeholder, .player {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.player-placeholder { padding: 30px; color: var(--muted); }
.player-placeholder h2 { margin: 10px 0 8px; color: var(--text); font-size: clamp(21px, 2.2vw, 31px); }
.player-placeholder p { max-width: 390px; margin: 0; line-height: 1.6; font-size: 13px; }
.placeholder-disc {
  width: min(250px, 62%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border: 1px solid rgba(139,92,246,.18);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #171c25 0 9%, transparent 10%),
    repeating-radial-gradient(circle at center, rgba(255,255,255,.025) 0 2px, transparent 3px 8px),
    linear-gradient(145deg, #202633, #10141c);
  box-shadow: 0 28px 60px rgba(0,0,0,.32), inset 0 0 40px rgba(139,92,246,.06);
}
.placeholder-disc span { font-size: 50px; color: #8c67dc; }
.player { justify-content: flex-start; overflow: auto; scrollbar-width: none; padding-top: 6px; }
.player::-webkit-scrollbar { display: none; }
.hero-cover-wrap { width: min(300px, 70%); margin: 0 auto 20px; }
.hero-cover {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: linear-gradient(145deg, #303847, #151a23);
  color: #9d7ede;
  font-size: 52px;
  box-shadow: 0 24px 46px rgba(0,0,0,.42), 0 0 0 1px rgba(255,255,255,.045);
}
.hero-cover img { width: 100%; height: 100%; object-fit: cover; }
.track-heading { max-width: 520px; }
.track-heading h2 { margin: 7px 0 4px; font-size: clamp(21px, 2.4vw, 30px); letter-spacing: -.035em; }
.track-heading p { margin: 0; color: #c4c8d0; font-size: 14px; line-height: 1.5; }
.transport { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 1.4vw, 18px); margin: 20px 0 16px; }
.round-button {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
}
.secondary-round { background: #202633; color: #e1e4ea; }
.secondary-round:hover { border-color: rgba(167,121,255,.25); background: #252c3a; }
.play-button {
  width: 70px;
  height: 70px;
  background: linear-gradient(145deg, #995ff2, #7d4ce1);
  box-shadow: 0 14px 34px rgba(108,63,199,.34), inset 0 1px 0 rgba(255,255,255,.2);
  font-size: 25px;
}
.play-button:hover { filter: brightness(1.08); }
.seek-block { width: 100%; max-width: 610px; }
input[type="range"] {
  width: 100%;
  height: 4px;
  accent-color: var(--accent);
  cursor: pointer;
}
.seek-times { display: flex; justify-content: space-between; margin-top: 5px; color: #c2c7d0; font-size: 10px; }
.player-options { width: 100%; max-width: 610px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.option-tile {
  min-width: 0;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #cfd3dc;
  background: #1d2330;
  font-size: 10px;
}
.option-tile > span { color: var(--muted); }
.option-tile select {
  width: 100%;
  max-width: 135px;
  padding: 0;
  color: #f0f2f6;
  border: 0;
  background: transparent;
  text-align: center;
  font-weight: 750;
}
.button-tile { cursor: pointer; }
.button-tile strong { font-size: 13px; }
.option-tile:hover { border-color: rgba(167,121,255,.25); }
.sleep-status { min-height: 18px; margin-top: 7px; color: #b999ff; font-size: 10px; }
.volume-row { width: 100%; max-width: 610px; display: grid; grid-template-columns: 24px 1fr 24px; align-items: center; gap: 10px; margin-top: 7px; color: #d8dce3; }
.close-player { margin-top: 12px; padding: 7px 10px; border: 0; color: var(--muted-2); background: transparent; font-size: 10px; }
.close-player:hover { color: var(--text); }

/* Chapters */
.chapters-pane { display: flex; flex-direction: column; padding: 0 0 10px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.tab {
  position: relative;
  height: 48px;
  border: 0;
  background: transparent;
  color: #c6cad3;
  font-size: 12px;
  font-weight: 650;
}
.tab.active { color: #b996ff; }
.tab.active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 3px; border-radius: 99px; background: var(--accent); }
.tab-panel { min-height: 0; display: flex; flex: 1; flex-direction: column; }
.chapters-heading { display: none; justify-content: space-between; align-items: center; padding: 12px; }
.chapters-heading h2 { margin: 0; font-size: 15px; }
.chapters-heading span { color: var(--muted-2); font-size: 11px; }
.chapter-list { min-height: 0; flex: 1; overflow: auto; padding: 8px; scrollbar-width: thin; scrollbar-color: #353c4b transparent; }
.chapter-row {
  width: 100%;
  display: grid;
  grid-template-columns: 27px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #e6e8ed;
  text-align: left;
  font-size: 12px;
}
.chapter-row:hover { background: rgba(255,255,255,.025); }
.chapter-row.active { border-color: rgba(139,92,246,.16); background: linear-gradient(90deg, rgba(139,92,246,.22), rgba(139,92,246,.13)); }
.chapter-number { color: #d9dce4; text-align: center; }
.chapter-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-duration { color: #aab1bf; font-size: 10px; }
.chapters-empty { margin: auto; padding: 30px 20px; color: var(--muted-2); text-align: center; font-size: 12px; line-height: 1.55; }
.mini-player {
  display: grid;
  grid-template-columns: 50px 1fr 35px;
  align-items: center;
  gap: 10px;
  margin: 5px 8px 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #171c25;
}
.mini-cover { width: 50px; height: 50px; display: grid; place-items: center; overflow: hidden; border-radius: 5px; background: #282f3d; color: #9678dc; }
.mini-cover img { width: 100%; height: 100%; object-fit: cover; }
.mini-text { min-width: 0; }
.mini-text strong, .mini-text span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-text strong { font-size: 11px; }
.mini-text span { margin-top: 4px; color: var(--muted); font-size: 9px; }
#miniPlayBtn { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; font-size: 18px; }

/* Dialog and toast */
dialog {
  width: min(580px, calc(100% - 28px));
  padding: 20px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #151a23;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0,0,0,.76); backdrop-filter: blur(4px); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dialog-head h2 { margin: 5px 0 0; font-size: 21px; }
dialog > p { color: var(--muted); line-height: 1.55; font-size: 12px; }
.dialog-close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel-2); font-size: 22px; }
.format-results { display: grid; gap: 7px; margin-top: 16px; }
.format-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #1b212c; font-size: 12px; }
.format-ok { color: var(--ok); }
.format-maybe { color: var(--warn); }
.format-no { color: var(--danger); }
.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  top: calc(18px + env(safe-area-inset-top));
  max-width: calc(100% - 30px);
  padding: 10px 14px;
  color: var(--text);
  border: 1px solid rgba(167,121,255,.25);
  border-radius: 10px;
  background: #202633;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, -140%);
  transition: .22s ease;
  text-align: center;
  font-size: 12px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1250px) {
  .workspace { grid-template-columns: 190px 280px minmax(360px, 1fr); }
  .chapters-pane { grid-column: 2 / -1; min-height: 330px; }
  .workspace { height: auto; min-height: 0; }
  .sidebar, .library-pane, .player-pane { height: calc(100vh - 112px); min-height: 650px; }
  .chapters-pane { height: 420px; }
  .chapter-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 3px; }
}

@media (max-width: 900px) {
  .app-frame { width: min(100% - 16px, 860px); margin: 8px auto; padding: 10px; }
  .topbar { padding: 2px 4px 10px; }
  .workspace { display: grid; grid-template-columns: 1fr 1.35fr; gap: 8px; }
  .sidebar { grid-column: 1; height: auto; min-height: 0; }
  .library-pane { grid-column: 2; height: 620px; min-height: 0; }
  .player-pane { grid-column: 1 / -1; height: auto; min-height: 690px; }
  .chapters-pane { grid-column: 1 / -1; height: 430px; min-height: 0; }
  .stats-section { margin-top: 0; }
}

@media (max-width: 640px) {
  body { background: var(--frame); }
  .app-frame { width: 100%; min-height: 100vh; margin: 0; padding: 8px; border: 0; border-radius: 0; box-shadow: none; }
  .topbar { position: sticky; z-index: 20; top: 0; height: 58px; padding: 7px 5px 9px; background: rgba(14,18,24,.93); backdrop-filter: blur(14px); }
  .brand strong { font-size: 16px; }
  .brand span { display: none; }
  .workspace { display: flex; flex-direction: column; }
  .panel { border-radius: 13px; }
  .sidebar, .library-pane, .player-pane, .chapters-pane { width: 100%; height: auto; min-height: 0; }
  .sidebar { padding: 9px 0; }
  .nav-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 0 8px 9px; overflow-x: auto; }
  .nav-item { min-width: 0; min-height: 54px; flex-direction: column; justify-content: center; gap: 3px; padding: 4px; font-size: 8px; text-align: center; }
  .nav-item span { width: auto; font-size: 20px; }
  .source-section { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
  .source-section h2, .source-hint { grid-column: 1 / -1; }
  .source-button { margin: 0; min-height: 58px; }
  .source-button span br { display: none; }
  .stats-section, .storage-bar { display: none; }
  .library-pane { max-height: 520px; }
  .library-list { padding-bottom: 10px; }
  .book-card { grid-template-columns: 58px 1fr 20px; min-height: 76px; }
  .cover { width: 58px; height: 63px; }
  .player-pane { padding: 20px 14px; }
  .player-placeholder { min-height: 460px; }
  .player { min-height: 0; overflow: visible; }
  .hero-cover-wrap { width: min(265px, 76%); }
  .transport { gap: 8px; }
  .round-button { width: 43px; height: 43px; font-size: 11px; }
  .play-button { width: 64px; height: 64px; font-size: 22px; }
  .player-options { grid-template-columns: 1fr 1fr; }
  .player-options .option-tile:last-child { grid-column: 1 / -1; }
  .chapters-pane { height: 420px; }
  .chapter-list { display: block; }
}

@media (max-width: 390px) {
  .app-frame { padding: 5px; }
  .brand-mark { width: 28px; font-size: 21px; }
  .top-actions { gap: 2px; }
  .top-icon { width: 36px; height: 36px; }
  .source-section { grid-template-columns: 1fr; }
  .source-section h2, .source-hint { grid-column: 1; }
  .player-pane { padding-inline: 9px; }
  .transport { gap: 5px; }
  .round-button { width: 39px; height: 39px; }
  .play-button { width: 58px; height: 58px; }
}

@media (hover: none) {
  .book-card:hover { transform: none; }
  button, select, input { min-height: 42px; }
  input[type="range"] { min-height: 30px; }
}


/* PIN-Sperre */
html.pin-locked,
html.pin-locked body { overflow: hidden; }
html.pin-locked .app-frame,
html.pin-locked dialog,
html.pin-locked .toast { visibility: hidden; }
.pin-gate {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 18%, rgba(139,92,246,.18), transparent 27rem),
    linear-gradient(180deg, rgba(5,7,10,.98), rgba(9,12,17,.995));
}
.pin-gate[hidden] { display: none !important; }
.pin-card {
  width: min(420px, 100%);
  padding: 34px 30px 28px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.005)),
    #121720;
  box-shadow: 0 30px 100px rgba(0,0,0,.58), inset 0 1px 0 rgba(255,255,255,.035);
  text-align: center;
}
.pin-logo {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border: 1px solid rgba(167,121,255,.28);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(139,92,246,.24), rgba(139,92,246,.08));
  box-shadow: 0 14px 34px rgba(79,42,150,.24);
  font-size: 34px;
  filter: grayscale(1) brightness(2.15);
}
.pin-card h1 { margin: 7px 0 8px; font-size: clamp(24px, 5vw, 31px); letter-spacing: -.035em; }
.pin-card > p { margin: 0 auto 23px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.pin-form { display: grid; gap: 12px; }
.pin-input {
  width: 100%;
  height: 60px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: #0c1016;
  color: var(--text);
  text-align: center;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: .48em;
  text-indent: .48em;
  caret-color: var(--accent-2);
}
.pin-input::placeholder { color: #535c6c; opacity: 1; }
.pin-input:focus { border-color: rgba(167,121,255,.68); box-shadow: 0 0 0 4px rgba(139,92,246,.12); }
.pin-submit {
  height: 52px;
  border: 1px solid rgba(189,155,255,.42);
  border-radius: 12px;
  background: linear-gradient(135deg, #9d65f4, #7544dc);
  color: #fff;
  box-shadow: 0 12px 28px rgba(92,49,177,.28), inset 0 1px 0 rgba(255,255,255,.18);
  font-weight: 800;
}
.pin-submit:hover { filter: brightness(1.06); }
.pin-submit:disabled { cursor: wait; opacity: .7; }
.pin-message { min-height: 18px; color: var(--danger); font-size: 12px; }
.pin-card.pin-error { animation: pin-shake .32s ease; }
@keyframes pin-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(7px); }
  75% { transform: translateX(-4px); }
}
@media (max-width: 520px) {
  .pin-gate { padding: 16px; }
  .pin-card { padding: 28px 20px 22px; border-radius: 18px; }
}
