:root{
  --bg:#000;
  --fg:#fff;
  --muted:#9aa0a6;
  --card:#0d0d0d;
  --border:#1f1f1f;
  --radius:20px;
  --shadow: 0 12px 40px rgba(0,0,0,.45);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =====================
   Phone frame + splash (unchanged)
   ===================== */
.center{ min-height:100dvh; display:grid; place-items:center; padding:18px; }
.phonebox{ width:min(92vw, 420px); aspect-ratio:9/20; border-radius:var(--radius); background:#000; box-shadow:var(--shadow); position:relative; overflow:hidden; border:2px solid rgba(255,255,255,.12); }
.phonebox .fill{ position:absolute; inset:0; width:100%; height:100%; }
.splash{ display:grid; place-items:center; gap:14px; -webkit-tap-highlight-color:transparent; }
.splash .logo{ width:52%; max-width:240px; aspect-ratio:1/1; border-radius:16px; background:#101010; display:grid; place-items:center; overflow:hidden; box-shadow:inset 0 0 0 1px rgba(255,255,255,.06); }
.splash .logo img{ width:100%; height:100%; object-fit:cover; }
.splash .note{ font-size:12px; color:var(--muted); }

@media (max-width:768px){
  .center{ padding:0; place-items:stretch; }
  .phonebox{ width:100vw; height:100dvh; aspect-ratio:auto; border:none; border-radius:0; box-shadow:none; }
  body.ai1{ overflow:hidden; }
  .ai1 .wrap{ padding-top:20px; }
}

/* =====================
   AI+1 PLAYER  CANONICAL RULES (deduped)
   ===================== */

/* Header: tiny logo + pink volume slider */
.ai1-header{ display:flex; align-items:center; gap:12px; padding:8px 12px 0 12px; background:transparent; }
.ai1-brand{ height:50px; width:auto; display:block; opacity:.95; }
.ai1-vol{ flex:0 0 auto; -webkit-appearance:none; appearance:none; height:8px; border-radius:999px; outline:none; background:linear-gradient(90deg,#ff2e88,#ff7ac1); width:260px; }
.ai1-vol::-webkit-slider-thumb{ -webkit-appearance:none; appearance:none; width:18px; height:18px; border-radius:50%; background:#fff; border:none; box-shadow:0 0 12px rgba(255,255,255,.6); margin-top:-5px; }
.ai1-vol::-moz-range-thumb{ width:18px; height:18px; border-radius:50%; background:#fff; border:none; }

/* Layout scaffold */
.ai1 .wrap{ padding:12px; background:#000; min-height:100dvh; max-width:860px; margin:0 auto; }
/* Outer row: 200px art | flexible panel */
.ai1 .row{ display:grid; grid-template-columns:200px 1fr; gap:12px; align-items:stretch; }

/* Cover art (fixed 200x200, reserves space) */
.ai1 .artbox{ width:200px; height:200px; border-radius:12px; background:#111; overflow:hidden; box-shadow:inset 0 0 0 1px rgba(255,255,255,.06); }
.ai1 .artbox img{ width:100%; height:100%; object-fit:cover; display:block; }

/* Panel: left meta | right upgrade */
.ai1 .panel {
display: flex;
gap: 12px;
margin: 0;
min-width: 0;
align-items: flex-start;
}


/* Left meta (stacked) */
.ai1 .meta {
display: block;
flex: 1 1 auto;
min-width: 0;
}


/* CHANGE: flex block so label/value stack */
.ai1 .meta-group{
display: block;
min-width: 0;
}

.ai1 .meta .meta-group + .meta-group { margin-top: 10px; }

.ai1 .meta-label {
font-size: 13px;
letter-spacing: .10em;
color: #9aa0a6;
display: block;
  font-size: 13px;
  letter-spacing: .10em;
  color: #9aa0a6;
}

.ai1 .meta-value {
font-size: 15px;
font-weight: 700;
line-height: 1.2;
margin-top: 2px;
display: block;
  font-size: 15px;  /* adjust smaller here if you like */
  font-weight: 700;
  line-height: 1.2;
  margin-top: 2px;
}

/* Upgrade box pinned in right lane, same row */
.ai1 .upgrade-area {
display: block;
flex: 0 0 200px;
}



.ai1 .ai1-badge{ width:100px; height:auto; display:block; }
.ai1 .upgrade-link{ color:#fff; font-size:14px; font-weight:700; text-decoration:none; }
.ai1 .upgrade-link:hover{ text-decoration:underline; }

/* Controls */
.ai1 .controls{ display:flex; gap:8px; align-items:center; margin-top:8px; }
.ai1 .btn{ padding:8px 10px; border-radius:10px; border:1px solid #222; background:#121212; color:#fff; cursor:pointer; user-select:none; }
.ai1 .btn:active{ transform:translateY(1px); }
.ai1 .btn.toggle.active{ border-color:#ff7ac1; box-shadow:0 0 0 1px #ff7ac1 inset; }

/* Pink progress bar */
.ai1 .timeline{ display:flex; align-items:center; gap:8px; font-size:12px; color:#9aa0a6; margin:6px 0 8px; }
.ai1 .time{ width:36px; text-align:center; }
.ai1 .ai1-track{ -webkit-appearance:none; appearance:none; flex:1; height:8px; border-radius:999px; outline:none; background:linear-gradient(90deg,#ff2e88,#ff7ac1); }
.ai1 .ai1-track::-webkit-slider-thumb{ -webkit-appearance:none; appearance:none; width:18px; height:18px; border-radius:50%; background:#fff; border:none; box-shadow:0 0 12px rgba(255,255,255,.6); margin-top:-5px; }
.ai1 .ai1-track::-moz-range-thumb{ width:18px; height:18px; border-radius:50%; background:#fff; border:none; }

/* Track list  scoped so it doesn't fight the outer .row */
.ai1 .list{ background:#111; border:1px solid #1f1f1f; border-radius:12px; overflow:hidden; }
.ai1 .list .row{ display:grid; grid-template-columns:40px 1fr 60px; gap:10px; align-items:center; padding:10px 12px; border-top:1px solid #151515; }
.ai1 .list .row.head{ background:#0f0f0f; color:#9aa0a6; font-size:12px; border-top:none; }
.ai1 .list .row.active{ background:#2a0f1f; }
.ai1 .cell-title{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ai1 .cell-time{ color:#aaa; text-align:right; }


/* legacy-style controls (scoped) */
.ai1 .sp-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #1f1f1f; /* var(--sp-border) look */
}

.ai1 .sp-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid #1f1f1f;
  background: #1a1a22;
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
}

.ai1 .sp-btn:hover,
.ai1 .sp-btn:focus {
  border-color: #ff2e88;  /* accent */
  color: #ff2e88;
  outline: none;
}

.ai1 .sp-btn.sp-play {
  background: #ff2e88;    /* accent */
  color: #000000;
  border-color: #ff2e88;
}

.ai1 .sp-btn.sp-play.playing {
  background: transparent;
  color: #ff2e88;
  border-color: #ff2e88;
}

.ai1 .sp-btn.active {
  border-color: #ff2e88;
  box-shadow: 0 0 0 2px rgba(255,46,136,0.25) inset;
}

/* optional: SVG size inside buttons */
.ai1 .sp-btn svg { display:block; width: 20px; height: 20px; }


/* === AI+1 pages: shared box layout (appended by apply_style_patch.php) === */
.sp-page {
  flex: 1;
  display: flex;
  padding: 14px;
}

.sp-box {
  background: #fff;
  color: #111;
  border-radius: 16px;
  border: 1px solid #e7e7e7;
  padding: 16px;
  height: 100%;
  width: 100%;
  
}


/* === AI+1 SMS v2 (scoped) === */
:root{
  --a1-accent: #ff3bbf;    /* pink */
  --a1-accent-2: #7c3aed;  /* purple */
}

.a1-sms{
  border:1px solid var(--border, #333);
  background:var(--card, #0d0d0d);
  color:var(--fg, #fff);
  border-radius:var(--radius, 16px);
  padding:14px;
  box-shadow:var(--shadow, 0 10px 24px rgba(0,0,0,.25));
  max-width:520px; /* fits your Tips column; adjust if needed */
}

.a1-sms__title{ margin:0 0 6px; font-size:18px; }
.a1-sms__label{ display:block; margin:4px 0 4px; font-weight:600; }

.a1-sms__input,
.a1-sms__textarea{
  width:100%;
  min-height:44px;
  background:#111;
  color:#fff;
  border:1px solid var(--border, #333);
  border-radius:12px;
  padding:12px;
  font-size:16px;
}
.a1-sms__input{ margin:0 0 6px; }
.a1-sms__textarea{ resize:vertical; }

.a1-sms__help{ font-size:12px; opacity:.85; margin:4px 0 8px; }

.a1-sms__actions{ display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.a1-sms__btn{
  border:1px solid #444;
  background:#181818;
  color:#fff;
  border-radius:12px;
  padding:12px 14px;
  font-size:15px;
  min-height:44px;
  cursor:pointer;
  text-decoration:none; /* makes the QR <a> look like a button */
  display:inline-flex; align-items:center; justify-content:center;
}
.a1-sms__btn--primary{
  background:linear-gradient(90deg, var(--a1-accent), var(--a1-accent-2));
  border-color:transparent;
  font-weight:600;
}
#a1-sms #a1-sms-send:disabled{ filter:grayscale(.4) brightness(.85); cursor:not-allowed; }

.a1-sms__input:focus,
.a1-sms__textarea:focus{
  outline:none;
  border-color:var(--a1-accent);
  box-shadow:0 0 0 2px rgba(255,59,191,.35);
}

.a1-sms__note{ margin-top:8px; font-size:13px; opacity:.9; }



/* Neon dropdown skin for the directory switcher */
.meta .dir-switcher{position:relative;display:inline-block}
.meta .dir-switcher > summary{list-style:none;cursor:pointer;display:inline-block}
.meta .dir-switcher > summary::-webkit-details-marker{display:none}

/* Label vibe */
.meta #dir{
  font-weight:700;text-transform:uppercase;
  padding:2px 6px;border-radius:10px;
  text-shadow:0 0 6px #ff4edb,0 0 18px #ff4edb;
}

/* Caret */



/* Popover */
.meta .dir-menu{
  position:absolute;left:0;top:calc(100% + 8px);min-width:max(160px,100%);
  background:#0b0b0b;border:1px solid #3a0033;border-radius:12px;padding:6px 0;
  box-shadow:0 12px 40px rgba(255,78,219,.35);
  z-index:30;
}

/* Items */
.meta .dir-item{display:block;padding:10px 12px;text-decoration:none;color:#fff;white-space:nowrap}
.meta .dir-item:hover{background:rgba(255,78,219,.08)}
.meta .dir-item[aria-selected="true"]{font-weight:700}


/* Caret (CSS triangles) */
.meta .dir-switcher #dir::after{
  content:"";
  display:inline-block;
  margin-left:6px;
  width:0; height:0; vertical-align:middle;
  border-left:5px solid transparent; border-right:5px solid transparent;
  border-top:7px solid currentColor; /* ▼ */
}
.meta .dir-switcher[open] #dir::after{
  border-top:none;
  border-bottom:7px solid currentColor; /* ▲ */
}

/* Ensure dropdown overlays correctly and doesn't break upgrade box */
.ai1-header, .meta { overflow: visible; }
.meta .dir-menu{ z-index: 1000; }
.upgrade-cta, .upgrade-area { position: relative; z-index: 10; }

/* Limit track list to ~6 rows visible and scroll the rest */
.ai1 .list-body {
  max-height: calc(6 * 50px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Keep the header row visible while scrolling */
.ai1 .list .row.head {
  position: sticky;
  top: 0;
  background: #0f0f0f;
  z-index: 2;
}

/* === Scroll cap: show ~6 tracks + sticky header, scroll rest (applies to both player pages) === */
.ai1 .list {
  /* override earlier overflow hidden to allow scrolling */
  overflow-y: auto;
  /* Approx: header (~48px) + 6 rows (~50px each) = ~348px */
  max-height: 348px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Keep header visible at top while list scrolls */
.ai1 .list .row.head {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Optional: nudge minimum row height so math holds roughly */
.ai1 .list .row { min-height: 48px; }
