:root {
  color-scheme: dark;
  --bg: #0e1117;
  --panel: #181c25;
  --panel-2: #11151d;
  --panel-3: #0b0e14;
  --line: #2b3342;
  --text: #f5f7fb;
  --muted: #9aa5b8;
  --accent: #7c5cff;
  --accent-2: #a48fff;
  --danger: #ff637d;
  --ok: #47d18c;
  --warn: #ffd36a;
  --shadow: 0 22px 70px rgba(0,0,0,.34);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(124,92,255,.2), transparent 34rem),
    radial-gradient(circle at top right, rgba(71,209,140,.11), transparent 30rem),
    linear-gradient(180deg, #111620 0%, #0e1117 58%),
    var(--bg);
  background-repeat: no-repeat;
  background-size: max(100vw, 1600px) max(100vh, 1100px);
  background-attachment: fixed;
  color: var(--text);
}

.shell {
  width: min(1500px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.admin-shell { max-width: 1280px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.brand-home {
  display: grid;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  box-shadow: none;
}
.brand-home:hover {
  transform: none;
  border-color: transparent;
}
.brand-home h1 {
  transition: color .12s;
}
.brand-home:hover h1 {
  color: #ffffff;
}

.top-back {
  width: 38px;
  height: 38px;
  font-size: 20px;
  border-color: var(--line);
  background: var(--panel-2);
}

h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(30px, 4vw, 48px); letter-spacing: -0.045em; }
h2 { margin-bottom: 8px; letter-spacing: -0.025em; }
h3 { margin-bottom: 12px; }
h4 { margin-bottom: 8px; }

.eyebrow, .section-label {
  color: var(--accent-2);
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
  margin-bottom: 6px;
}

.section-label { color: #c9bdff; margin: 12px 0 8px; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 13px; margin-bottom: 0; }
code { background: #0b0d12; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.hidden { display: none !important; }

.panel {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012)), var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.setup-panel, .login-panel {
  max-width: 760px;
  padding: 28px;
}

.login-panel {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}

.auth-mode-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 12px;
  border: 1px solid rgba(124,92,255,.48);
  border-radius: 999px;
  background: rgba(124,92,255,.14);
  color: #dcd5ff;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 850;
}

.auth-mode-badge.register {
  border-color: rgba(71,209,140,.45);
  background: rgba(71,209,140,.12);
  color: #d7fbe6;
}

.login-form, .compact-form, .segment-form, .form-inline-card {
  display: grid;
  gap: 10px;
}

.login-switch {
  grid-column: 2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}
.login-switch .muted { font-size: 13px; }
.bot-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.app {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 18px;
  align-items: start;
}

.profile-view {
  display: block;
}

.sidebar {
  padding: 18px;
  position: sticky;
  top: 16px;
}

.sidebar-head, .selected-head, .segment-toolbar, .topbar-actions, .admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.playlist-section + .playlist-section { margin-top: 14px; }

.playlist-list {
  display: grid;
  gap: 8px;
  max-height: 38vh;
  overflow: auto;
  padding-right: 3px;
}

.playlist-list.compact { max-height: 24vh; }
.list-empty { margin: 0 0 6px; font-size: 14px; }

.playlist-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  background: rgba(17,21,29,.88);
  color: var(--text);
  text-align: left;
  transition: border-color .15s, transform .15s, background .15s;
}

.playlist-item:hover { border-color: rgba(124,92,255,.72); transform: translateY(-1px); }
.playlist-item:focus-visible { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(124,92,255,.18); }
.playlist-item.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px rgba(124,92,255,.58); background: rgba(124,92,255,.12); }
.playlist-item-body { min-width: 0; }
.playlist-item strong { display: block; margin-bottom: 4px; }
.playlist-item span { color: var(--muted); font-size: 13px; }
.playlist-play-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: #dcd5ff;
  background: rgba(124,92,255,.18);
  border-color: rgba(164,143,255,.36);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.025);
}
.playlist-play-button:hover {
  background: rgba(124,92,255,.28);
  border-color: rgba(164,143,255,.68);
  color: #ffffff;
}
.playlist-play-button .transport-icon {
  width: 15px;
  height: 18px;
}
.playlist-play-button .play-icon {
  margin-left: 2px;
  border-top-width: 9px;
  border-bottom-width: 9px;
  border-left-width: 14px;
}

.content { display: grid; gap: 18px; min-width: 0; }
.player-panel, .selected-panel { padding: 18px; }

.player-layout {
  display: grid;
  grid-template-columns: minmax(280px, 580px) minmax(280px, 1fr);
  gap: 18px;
  align-items: stretch;
}

.video-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #08090d;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}

#player, #player iframe { width: 100%; height: 100%; }

.now-box {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.1), transparent 14rem),
    linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.018)),
    var(--panel-2);
  padding: 18px;
  min-height: 100%;
  display: grid;
  align-content: center;
}

.player-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
#nowTitle { font-size: clamp(22px, 3vw, 34px); margin: 4px 0 8px; }
#nowMeta { min-height: 1.3em; }

.progress-wrap { margin: 18px 0; }
.progress-line { width: 100%; height: 8px; display: block; padding: 0; border-radius: 999px; background: #090b10; overflow: hidden; border: 1px solid var(--line); cursor: pointer; }
.progress-line:hover { transform: none; border-color: rgba(255,255,255,.3); }
.progress-line span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--ok)); }
.progress-times { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 6px; }

.transport-row, .mode-row, .controls, .form-actions, .filter-buttons, .selected-actions, .side-links, .admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.transport-row { align-items: center; justify-content: center; margin-top: 8px; }
.mode-row { justify-content: center; margin-top: 10px; }

button, .button, select, input, textarea { font: inherit; }

button, .button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #222737;
  color: var(--text);
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 780;
  text-decoration: none;
  transition: transform .12s, background .12s, border-color .12s, opacity .12s;
}

button:hover, .button:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.24); }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); }
button.ghost, .button.ghost { background: transparent; }
button.danger, .danger { color: #ffd7df; border-color: rgba(255,99,125,.42); }
button.small, .button.small { padding: 7px 10px; font-size: 13px; }
button.active { background: rgba(124,92,255,.28); border-color: var(--accent); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.round-btn {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  line-height: 1;
  background: transparent;
  border-color: transparent;
}

.main-play {
  width: 68px;
  height: 68px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  background: #f5f7fb;
  color: #11151d;
  border-color: #f5f7fb;
  border-radius: 999px;
}

.transport-icon {
  display: block;
  width: 24px;
  height: 24px;
  position: relative;
}

.play-icon {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 20px solid currentColor;
}

.pause-icon::before,
.pause-icon::after {
  content: "";
  position: absolute;
  top: 2px;
  width: 7px;
  height: 20px;
  border-radius: 4px;
  background: currentColor;
}

.pause-icon::before { left: 4px; }
.pause-icon::after { right: 4px; }

.main-play.is-playing {
  background: #ffffff;
  border-color: #ffffff;
}

.player-icon {
  display: block;
  width: 22px;
  height: 22px;
  position: relative;
}

.skip-icon::before,
.skip-icon::after {
  content: "";
  position: absolute;
  top: 4px;
}

.skip-icon::before {
  left: 3px;
  width: 14px;
  height: 14px;
  background: currentColor;
  clip-path: polygon(0 0, 0 100%, 100% 50%);
}

.skip-icon::after {
  right: 3px;
  width: 3px;
  height: 14px;
  border-radius: 999px;
  background: currentColor;
}

.skip-prev-icon {
  transform: scaleX(-1);
}

.shuffle-icon,
.repeat-icon,
.star-icon,
.profile-icon,
.profile-menu-icon {
  background: currentColor;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.shuffle-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M17.7 3.9 22 8.2l-4.3 4.2-1.4-1.4 1.9-1.9h-2.1c-2.3 0-3.7 1.1-5.1 3.8-1.7 3.2-3.8 5.2-7.1 5.2H2v-2h1.9c2.3 0 3.7-1.1 5.1-3.8 1.7-3.2 3.8-5.2 7.1-5.2h2.1l-1.9-1.8 1.4-1.4Zm0 7.7L22 15.8l-4.3 4.3-1.4-1.4 1.9-1.9h-2.1c-1.4 0-2.7-.4-3.8-1.3l1.1-1.7c.8.6 1.6 1 2.7 1h2.1l-1.9-1.8 1.4-1.4ZM2 7.9h1.9c1.4 0 2.7.4 3.8 1.3l-1.1 1.7c-.8-.6-1.6-1-2.7-1H2v-2Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M17.7 3.9 22 8.2l-4.3 4.2-1.4-1.4 1.9-1.9h-2.1c-2.3 0-3.7 1.1-5.1 3.8-1.7 3.2-3.8 5.2-7.1 5.2H2v-2h1.9c2.3 0 3.7-1.1 5.1-3.8 1.7-3.2 3.8-5.2 7.1-5.2h2.1l-1.9-1.8 1.4-1.4Zm0 7.7L22 15.8l-4.3 4.3-1.4-1.4 1.9-1.9h-2.1c-1.4 0-2.7-.4-3.8-1.3l1.1-1.7c.8.6 1.6 1 2.7 1h2.1l-1.9-1.8 1.4-1.4ZM2 7.9h1.9c1.4 0 2.7.4 3.8 1.3l-1.1 1.7c-.8-.6-1.6-1-2.7-1H2v-2Z'/%3E%3C/svg%3E");
}

.repeat-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M7 6h9.2l-1.8-1.8L15.8 2 21 7.2l-5.2 5.1-1.4-1.4L16.3 9H7a3 3 0 0 0-3 3v1H2v-1a5 5 0 0 1 5-6Zm10 12H7.8l1.8 1.8L8.2 22 3 16.8l5.2-5.1 1.4 1.4L7.7 15H17a3 3 0 0 0 3-3v-1h2v1a5 5 0 0 1-5 6Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M7 6h9.2l-1.8-1.8L15.8 2 21 7.2l-5.2 5.1-1.4-1.4L16.3 9H7a3 3 0 0 0-3 3v1H2v-1a5 5 0 0 1 5-6Zm10 12H7.8l1.8 1.8L8.2 22 3 16.8l5.2-5.1 1.4 1.4L7.7 15H17a3 3 0 0 0 3-3v-1h2v1a5 5 0 0 1-5 6Z'/%3E%3C/svg%3E");
}

.star-icon {
  clip-path: polygon(50% 4%, 61% 36%, 95% 36%, 67% 56%, 78% 90%, 50% 69%, 22% 90%, 33% 56%, 5% 36%, 39% 36%);
}

.round-btn .star-icon {
  color: #c8cfdd;
  opacity: .9;
}

.round-btn.is-favorite .star-icon {
  color: var(--warn);
  opacity: 1;
}

.icon-toggle {
  width: 44px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.04);
}

.icon-toggle.active {
  color: #fff;
  background: rgba(124,92,255,.32);
  border-color: rgba(124,92,255,.8);
}

input, select, textarea {
  width: 100%;
  border: 1px solid #363f52;
  border-radius: 13px;
  background: #0b0e14;
  color: var(--text);
  padding: 11px 12px;
}

textarea { resize: vertical; }
label { color: #c8cfdd; font-size: 14px; font-weight: 750; }
.check-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 650; color: var(--muted); }
.check-row.inline { margin-top: 0; align-self: end; }
.check-row input { width: auto; }

.playlist-creator-panel {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.empty-playlist-actions {
  display: grid;
  gap: 12px;
}

.empty-playlist-actions p {
  margin: 0;
  color: #c6ccda;
  line-height: 1.45;
  font-size: 14px;
}

.empty-playlist-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.empty-playlist-buttons button {
  min-height: 46px;
}

.playlist-creator-toggle {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.018)), var(--panel-2);
  border-color: rgba(164,143,255,.28);
  color: #eef1f8;
}

.playlist-creator-toggle:hover {
  background: linear-gradient(180deg, rgba(124,92,255,.14), rgba(124,92,255,.06)), var(--panel-2);
  border-color: rgba(164,143,255,.58);
}

.plus-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(124,92,255,.22);
  color: #dcd5ff;
  flex: 0 0 auto;
  position: relative;
}

.plus-icon::before,
.plus-icon::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 10px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.plus-icon::after {
  width: 2px;
  height: 10px;
}

.playlist-creator-toggle.is-open .plus-icon::after {
  display: none;
}

.compact-form {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 10px;
}

.playlist-form-hint { font-size: 13px; margin-bottom: 4px; }

.side-links { margin-top: 14px; }
.account-panel { padding: 18px; }
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.profile-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-2);
  padding: 14px;
}
.profile-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.social-list { display: grid; gap: 9px; margin-top: 10px; }
.social-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(11,14,20,.7);
  padding: 12px;
}
.social-card strong, .social-card span { display: block; }
.social-card span { color: var(--muted); font-size: 13px; margin-top: 3px; }
.social-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.social-actions button { padding: 8px 10px; font-size: 13px; }
.search-label {
  display: block;
  margin: 2px 0 8px;
}
.people-search-input {
  min-height: 46px;
  border-color: rgba(164,143,255,.35);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.018)),
    #0b0e14;
}
.people-search-input:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(124,92,255,.18);
}
.account-form { max-width: 420px; margin-top: 12px; }
.layout-preference-form {
  max-width: 460px;
  margin-top: 12px;
  display: grid;
  gap: 12px;
}
.layout-preference-form label {
  color: #d7dcec;
  font-size: 14px;
  line-height: 1.45;
}
.modern-select {
  min-height: 48px;
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, #dce2f0 50%) calc(100% - 21px) 20px / 7px 7px no-repeat,
    linear-gradient(135deg, #dce2f0 50%, transparent 50%) calc(100% - 16px) 20px / 7px 7px no-repeat,
    linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.025)),
    #0b0e14;
  border-color: rgba(164,143,255,.45);
  border-radius: 16px;
  padding-right: 42px;
  font-weight: 800;
}
.modern-select:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(124,92,255,.18);
}
.empty-state {
  border: 1px dashed #3b4254;
  background: var(--panel-2);
  color: var(--muted);
  border-radius: 18px;
  padding: 24px;
}
.empty-state.subtle { padding: 14px; background: rgba(17,21,29,.62); }
#readOnlyNotice { margin-top: 14px; }

.meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.badge { border: 1px solid var(--line); background: var(--panel-2); color: #dce2f0; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 800; }
.badge.global { color: #d7fbe6; border-color: rgba(71,209,140,.5); }
.badge.pending { color: #fff2c6; border-color: rgba(255,211,106,.5); }
.badge.private { color: #dce2f0; }

.segment-editor-panel {
  margin: 18px 0 0;
}

.segment-editor-toggle {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.018)), var(--panel-2);
  border-color: rgba(164,143,255,.28);
  color: #eef1f8;
  text-align: left;
}

.segment-editor-toggle:hover {
  background: linear-gradient(180deg, rgba(124,92,255,.14), rgba(124,92,255,.06)), var(--panel-2);
  border-color: rgba(164,143,255,.58);
}

.chevron-icon {
  width: 14px;
  height: 14px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .16s;
  opacity: .82;
  flex: 0 0 auto;
}

.segment-editor-toggle.is-open .chevron-icon {
  transform: translateY(4px) rotate(225deg);
}

.segment-form {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  margin: 10px 0 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-grid.wide-left { grid-template-columns: 1.35fr 1fr; }
.times-grid { grid-template-columns: 150px 150px 1fr; }
.compact-two { grid-template-columns: 1fr auto; align-items: end; }
.align-end { align-self: end; }

.segment-toolbar { margin: 18px 0 12px; }
.segment-list { display: grid; gap: 10px; }

.segment-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 18px;
  padding: 14px;
}
.segment-card.playing { border-color: var(--accent); box-shadow: inset 0 0 0 1px rgba(124,92,255,.55); }
.segment-card h4 { margin: 0 0 6px; font-size: 16px; }
.segment-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.segment-note { color: #c6ccda; margin: 8px 0 0; font-size: 14px; }
.segment-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-content: start; }
.segment-actions button { padding: 8px 10px; font-size: 13px; }
.segment-actions button.icon-action {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}
.segment-actions .player-icon {
  width: 17px;
  height: 17px;
}
.segment-actions .segment-play {
  width: 38px;
  height: 38px;
  color: #dcd5ff;
  background: rgba(124,92,255,.18);
  border-color: rgba(164,143,255,.36);
}
.segment-actions .segment-play:hover {
  color: #fff;
  background: rgba(124,92,255,.28);
  border-color: rgba(164,143,255,.68);
}
.segment-actions .segment-play .player-icon {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid currentColor;
}
.star .star-icon { color: #c8cfdd; opacity: .88; }
.star.is-favorite .star-icon { color: var(--warn); opacity: 1; }
.profile-badge { border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px 7px 12px; background: var(--panel-2); color: #dce2f0; display: inline-flex; align-items: center; gap: 9px; }
.profile-button { cursor: pointer; }
.profile-button:hover { border-color: rgba(124,92,255,.72); background: rgba(124,92,255,.14); }
.profile-badge-text {
  display: grid;
  gap: 1px;
  line-height: 1.05;
  text-align: left;
}
.profile-badge-text small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}
.profile-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  opacity: .92;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 12.2a4.7 4.7 0 1 0 0-9.4 4.7 4.7 0 0 0 0 9.4Zm0 2.1c-4 0-7.5 2.2-9.2 5.4-.4.8.2 1.5 1 1.5h16.4c.8 0 1.4-.8 1-1.5-1.7-3.2-5.2-5.4-9.2-5.4Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 12.2a4.7 4.7 0 1 0 0-9.4 4.7 4.7 0 0 0 0 9.4Zm0 2.1c-4 0-7.5 2.2-9.2 5.4-.4.8.2 1.5 1 1.5h16.4c.8 0 1.4-.8 1-1.5-1.7-3.2-5.2-5.4-9.2-5.4Z'/%3E%3C/svg%3E");
}
.profile-menu-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--muted);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='m7.4 8.6 4.6 4.6 4.6-4.6L18 10l-6 6-6-6 1.4-1.4Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='m7.4 8.6 4.6 4.6 4.6-4.6L18 10l-6 6-6-6 1.4-1.4Z'/%3E%3C/svg%3E");
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #0c0e13;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 15px;
  padding: 13px 15px;
  box-shadow: var(--shadow);
  max-width: min(460px, calc(100% - 44px));
  z-index: 20;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.admin-card { padding: 18px; min-width:0; overflow:hidden; }
.stat-card { grid-column: 1 / -1; }
.admin-list { display: grid; gap: 10px; margin-top: 12px; }
.admin-list-card {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-2);
  padding: 14px;
  overflow: hidden;
}
.admin-list-card strong { display: block; margin-bottom: 5px; }
.admin-list-card .muted { display: block; font-size: 13px; }
.profile-edit-form {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}
.profile-edit-form input { min-width: 0; }
.form-inline-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-2);
  padding: 14px;
  margin: 12px 0;
}

@media (max-width: 1180px) {
  .app { grid-template-columns: 1fr; }
  .content { display: contents; }
  .player-panel { order: 1; }
  .mobile-order-selected-first .selected-panel { order: 2; }
  .mobile-order-selected-first .sidebar { order: 3; }
  .mobile-order-playlists-first .sidebar { order: 2; }
  .mobile-order-playlists-first .selected-panel { order: 3; }
  .sidebar { position: static; }
  .player-layout { grid-template-columns: 1fr; }
  .playlist-list, .playlist-list.compact { max-height: none; }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .shell { width: min(100% - 16px, 1500px); padding-top: 12px; padding-bottom: 24px; }
  .topbar, .login-panel, .selected-head, .segment-toolbar, .admin-head { align-items: stretch; flex-direction: column; }
  .login-switch { grid-column: auto; }
  .topbar-actions, .selected-actions { justify-content: flex-start; }
  .login-panel { display: flex; }
  .player-panel, .selected-panel, .sidebar, .setup-panel, .login-panel, .admin-card { padding: 14px; border-radius: 18px; }
  .form-grid, .form-grid.wide-left, .times-grid, .compact-two { grid-template-columns: 1fr; }
  .segment-card, .admin-list-card, .profile-edit-form, .profile-grid, .social-card { min-width: 0; grid-template-columns: 1fr; }
  .segment-actions, .admin-actions, .social-actions { justify-content: flex-start; }
  .now-box { border-radius: 20px; padding: 14px; }
  .round-btn { width: 42px; height: 42px; }
  .main-play { width: 64px; height: 64px; flex: 0 0 auto; min-width: 0; }
  .mode-row button { flex: 0 0 auto; }
  .profile-badge-text small { display: none; }
  h1 { font-size: 32px; }
  #nowTitle { font-size: 24px; }
}
