/* ============================================================
   PianoVerse – Light Professional Theme v4.0
   Clean whites + Indigo accents + Warm slate surfaces
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Orbitron:wght@700;900&family=JetBrains+Mono:wght@400;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Light surfaces */
  --bg-page:    #f0f2fa;
  --bg-card:    #ffffff;
  --bg-card2:   #f7f8ff;
  --bg-input:   #f1f3fc;
  --bg-hover:   #e8eaf6;
  --surface:    #ffffff;
  --surface2:   #eef0fb;

  /* Borders */
  --border:     rgba(79,70,229,0.13);
  --border2:    rgba(79,70,229,0.22);

  /* Accent — Indigo */
  --accent:        #4f46e5;
  --accent2:       #6366f1;
  --accent3:       #818cf8;
  --accent-light:  rgba(99,102,241,0.10);
  --accent-glow:   rgba(99,102,241,0.25);

  /* Supporting */
  --pink:   #ec4899;
  --gold:   #f59e0b;
  --teal:   #0d9488;
  --green:  #059669;
  --red:    #dc2626;

  /* Text — dark slate on light background */
  --text-1:  #1e1b4b;   /* near-black indigo */
  --text-2:  #4338ca;   /* accent dark */
  --text-3:  #6b7280;   /* gray-500 */
  --text-4:  #9ca3af;   /* gray-400 */

  /* Piano keys (do not change) */
  --white-key: #f5f5ff;
  --black-key: #12122a;

  /* Misc */
  --radius:    10px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 4px rgba(79,70,229,0.08), 0 2px 8px rgba(0,0,0,0.06);
  --shadow:    0 4px 20px rgba(79,70,229,0.1), 0 1px 6px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 48px rgba(79,70,229,0.18), 0 4px 16px rgba(0,0,0,0.1);
  --header-h: 60px;
}

/* ── BASE ──────────────────────────────────────────────────── */
html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: var(--bg-page);
  color: var(--text-1);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ── SCROLLBAR ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent2); }

/* ── UTILITIES ─────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ════════════════════════════════════════════════════════════
   AUTH MODAL
   ════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(238,240,251,0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px;
}
.modal-overlay.hidden { opacity: 0; pointer-events: none; display: none; }
.modal-overlay.active { opacity: 1; }

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: 22px;
  padding: 38px 42px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.35s cubic-bezier(.22,1,.36,1);
  position: relative;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  border-top: 24px solid var(--bg-card);
}
.modal-box::before {
  content: '';
  position: absolute;
  top: -24px; left: 0; right: 0; height: 24px;
  border-radius: 22px 22px 0 0;
  background: repeating-linear-gradient(
    90deg,
    #ffffff 0px, #ffffff 15px,
    #12122a 15px, #12122a 25px,
    #ffffff 25px, #ffffff 40px,
    #12122a 40px, #12122a 50px,
    #ffffff 50px, #ffffff 65px
  );
  border-bottom: 2px solid var(--border2);
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.5);
}

.modal-box.small-modal { max-width: 380px; padding: 30px 34px; border-top: 0; }
.modal-box.small-modal::before { display: none; }

@keyframes modalIn {
  from { transform: translateY(18px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* Auth Logo */
.modal-logo { text-align: center; margin-bottom: 28px; }
.modal-logo .logo-icon {
  font-size: 48px; display: block; margin-bottom: 10px;
  filter: drop-shadow(0 4px 10px rgba(99,102,241,0.40));
}
.modal-logo h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 22px; font-weight: 900;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent3) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: 2px;
}
.modal-logo p { color: var(--text-3); font-size: 13px; margin-top: 6px; font-weight: 500; }

/* Auth tabs */
.auth-tabs {
  display: flex; gap: 3px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 4px; margin-bottom: 24px;
}
.tab-btn {
  flex: 1; padding: 9px 12px;
  border: none; border-radius: 9px;
  background: transparent; color: var(--text-3);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; font-family: inherit;
}
.tab-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 3px 12px rgba(79,70,229,0.4);
}
.tab-btn:not(.active):hover { color: var(--text-1); background: var(--bg-hover); }

/* Form */
.auth-form .form-group { margin-bottom: 16px; }
.auth-form label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--text-3); margin-bottom: 6px;
  letter-spacing: 1px; text-transform: uppercase;
}
.auth-form input {
  width: 100%; padding: 12px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f8ff 100%);
  border: 1px solid #c5c7e8;
  border-bottom: 3px solid #a5b4fc;
  border-radius: 8px; color: var(--text-1); font-size: 14.5px;
  transition: all 0.15s; outline: none;
  font-family: inherit;
  box-shadow: inset 0 2px 5px rgba(255,255,255,1), 0 2px 5px rgba(0,0,0,0.02);
}
.auth-form input:focus {
  background: linear-gradient(180deg, #f0f0ff 0%, #e4e4ff 100%);
  border-color: var(--accent2);
  border-bottom-width: 1px;
  transform: translateY(2px);
  margin-bottom: 2px;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15), inset 0 3px 6px rgba(0,0,0,0.1);
}
.auth-form input::placeholder { color: var(--text-4); }

.form-error { color: var(--red); font-size: 12.5px; margin-bottom: 10px; min-height: 18px; }

/* Primary button */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff; border: none; border-radius: 11px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: all 0.22s;
  box-shadow: 0 4px 16px rgba(79,70,229,0.38);
  font-family: inherit; letter-spacing: 0.2px;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(79,70,229,0.52); }
.btn-primary:active { transform: translateY(0); }
.btn-full { width: 100%; }
.btn-arrow { transition: transform 0.2s; }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }

/* Secondary button */
.btn-secondary {
  padding: 11px 22px;
  background: var(--bg-card2); color: var(--text-3);
  border: 1.5px solid var(--border);
  border-radius: 11px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.btn-secondary:hover { border-color: var(--accent2); color: var(--accent); background: var(--accent-light); }

.form-switch { text-align: center; font-size: 13px; color: var(--text-3); margin-top: 18px; }
.form-switch a { color: var(--accent); text-decoration: none; font-weight: 600; }
.form-switch a:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════
   APP SHELL
   ════════════════════════════════════════════════════════════ */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }

/* ── HEADER ───────────────────────────────────────────────── */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1.5px solid var(--border);
  position: relative; z-index: 100;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
/* Top gradient strip */
.app-header::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg,
    #6366f1, #818cf8, #ec4899, #0d9488, #f59e0b, #6366f1);
  background-size: 200% 100%;
  animation: headerShimmer 8s linear infinite;
}
@keyframes headerShimmer {
  0%   { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

.header-left { display: flex; align-items: center; gap: 12px; }
.logo-mark { font-size: 22px; line-height: 1; }
.logo-text {
  font-family: 'Orbitron', sans-serif; font-size: 15px; font-weight: 900;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent3) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: 1.5px;
}

.header-center { display: flex; align-items: center; }
.app-nav {
  display: flex; gap: 2px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 4px;
}
.nav-btn {
  padding: 7px 16px; border: none;
  background: transparent; color: var(--text-3);
  border-radius: 9px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.18s; font-family: inherit;
  white-space: nowrap;
}
.nav-btn:hover { background: var(--bg-hover); color: var(--text-1); }
.nav-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(79,70,229,0.38);
}

.header-right { display: flex; align-items: center; gap: 8px; }

.username-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--accent);
  background: var(--accent-light);
  border: 1.5px solid var(--border2);
  border-radius: 10px; padding: 5px 13px;
  white-space: nowrap;
}

.btn-logout {
  padding: 7px 15px;
  background: transparent;
  border: 1.5px solid rgba(220,38,38,0.25);
  border-radius: 9px;
  color: var(--red); font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; font-family: inherit;
}
.btn-logout:hover { background: rgba(220,38,38,0.08); border-color: var(--red); }

.btn-icon {
  width: 36px; height: 36px;
  border: 1.5px solid var(--border);
  background: var(--bg-card2); color: var(--text-3);
  border-radius: 9px; font-size: 17px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s; flex-shrink: 0;
}
.btn-icon:hover { background: var(--accent-light); border-color: var(--accent2); color: var(--accent); }

.mobile-nav-toggle {
  display: none; width: 36px; height: 36px;
  border: 1.5px solid var(--border); background: var(--bg-card2); color: var(--text-3);
  border-radius: 9px; font-size: 20px; cursor: pointer;
  align-items: center; justify-content: center; transition: all 0.18s;
}
.mobile-nav-toggle:hover { background: var(--accent-light); color: var(--accent); }

/* ── SECTION ─────────────────────────────────────────────── */
.section { flex: 1; overflow-y: auto; min-height: 0; }
.section.hidden { display: none !important; }

/* ════════════════════════════════════════════════════════════
   PIANO SECTION
   ════════════════════════════════════════════════════════════ */
#sectionPiano {
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden; padding: 0;
}

.piano-container {
  display: flex; flex-direction: column;
  flex: 1; overflow: hidden; min-height: 0;
}

/* ── INFO BAR ──────────────────────────────────────────────── */
.piano-infobar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 16px;
  background: var(--bg-card);
  border-bottom: 1.5px solid var(--border);
  gap: 12px; flex-shrink: 0;
}
.piano-infobar-left  { display: flex; align-items: center; gap: 10px; }
.piano-infobar-right { display: flex; align-items: center; gap: 10px; }

/* Octave control */
.octave-ctrl {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 9px; padding: 4px 9px;
}
.octave-ctrl label {
  font-size: 10px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .8px;
}
.octave-ctrl button {
  width: 26px; height: 26px;
  border: 1.5px solid var(--border);
  border-radius: 7px; background: var(--bg-card); color: var(--text-1);
  font-size: 16px; cursor: pointer; transition: all 0.15s;
  line-height: 1; display: flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.octave-ctrl button:hover { border-color: var(--accent2); color: var(--accent); background: var(--accent-light); }
#octaveDisplay {
  font-size: 15px; font-weight: 900; color: var(--accent);
  min-width: 18px; text-align: center;
  font-family: 'Orbitron', sans-serif;
}

/* Instrument badge */
.instrument-badge {
  display: flex; align-items: center; gap: 7px;
  background: var(--accent-light);
  border: 1.5px solid var(--border2);
  border-radius: 9px; padding: 6px 12px;
  font-size: 12.5px; font-weight: 700; color: var(--accent);
  cursor: pointer; transition: all 0.18s; white-space: nowrap;
}
.instrument-badge:hover { background: rgba(99,102,241,0.18); }

/* Rec timer small */
.rec-timer-small {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; font-weight: 700; color: var(--accent);
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 8px; padding: 4px 10px;
  min-width: 60px; text-align: center;
  letter-spacing: 1.5px;
}
.rec-timer-small.recording { color: var(--red); border-color: rgba(220,38,38,0.35); animation: blink-timer 1s infinite; }
@keyframes blink-timer { 0%,100%{opacity:1;} 50%{opacity:0.45;} }

/* Piano size range */
.piano-size-ctrl {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 9px; padding: 5px 11px;
}
.piano-size-label {
  font-size: 10px; font-weight: 700;
  color: var(--text-3); letter-spacing: .5px; white-space: nowrap;
}
.piano-size-slider {
  -webkit-appearance: none; appearance: none;
  width: 90px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent2), rgba(99,102,241,0.2));
  outline: none; cursor: pointer;
}
.piano-size-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 15px;
  background: var(--accent); border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(99,102,241,0.3);
  cursor: pointer; transition: transform 0.15s;
}
.piano-size-slider::-webkit-slider-thumb:hover { transform: scale(1.25); }
.piano-size-slider::-moz-range-thumb {
  width: 15px; height: 15px;
  background: var(--accent); border-radius: 50%;
  border: 2px solid #fff; cursor: pointer;
}
.piano-size-val {
  font-size: 11px; font-weight: 800; color: var(--accent);
  min-width: 28px; text-align: center;
  font-family: 'JetBrains Mono', monospace;
}
.piano-size-reset {
  width: 22px; height: 22px;
  border: 1.5px solid var(--border);
  border-radius: 6px; background: var(--bg-card);
  color: var(--text-3); font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; line-height: 1; padding: 0;
}
.piano-size-reset:hover { border-color: var(--accent); color: var(--accent); }

/* Settings button in infobar */
.btn-settings {
  width: 34px; height: 34px;
  border: 1.5px solid var(--border);
  border-radius: 9px; background: var(--bg-card2); color: var(--text-3);
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
}
.btn-settings:hover { border-color: var(--accent2); color: var(--accent); background: var(--accent-light); }

/* ════════════════════════════════════════════════════════════
   PIANO WRAPPER
   ════════════════════════════════════════════════════════════ */
.piano-wrapper {
  flex: 1; min-height: 0;
  background: linear-gradient(180deg, #e8eaf6 0%, #dde0f4 100%);
  border-top: 1.5px solid var(--border);
  overflow-x: hidden; overflow-y: hidden;
  position: relative;
  display: flex; align-items: stretch;
  padding: 0; -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth; justify-content: center;
}
/* Rainbow stripe */
.piano-wrapper::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg,
    #818cf8, #6366f1, #4f46e5,
    #ec4899, #f59e0b, #0d9488,
    #818cf8);
  z-index: 5;
}

.piano-keys {
  display: flex; position: relative;
  height: 100%; align-items: stretch;
  padding: 0; flex-shrink: 0;
}

/* ── WHITE KEYS ──────────────────────────────────────────── */
.key {
  position: relative;
  width: 54px; height: 100%; min-height: 160px;
  background: linear-gradient(180deg,
    #ffffff 0%, #f9f9ff 55%, #eeeeff 100%);
  border-radius: 0 0 10px 10px;
  border: 1px solid #c5c7e8;
  border-top: none; margin: 0 1.5px;
  cursor: pointer;
  display: flex; flex-direction: column;
  justify-content: flex-end; align-items: center;
  padding-bottom: 12px;
  transition: background 0.07s, transform 0.07s, box-shadow 0.08s;
  box-shadow:
    0 6px 18px rgba(79,70,229,0.12),
    inset 0 -4px 12px rgba(79,70,229,0.06),
    inset 0 1px 0 rgba(255,255,255,1),
    inset 1px 0 0 rgba(255,255,255,0.8),
    inset -1px 0 0 rgba(79,70,229,0.08);
  user-select: none; -webkit-user-select: none;
  z-index: 1; touch-action: none; flex-shrink: 0;
}
.key:hover {
  background: linear-gradient(180deg, #f0f0ff 0%, #e4e4ff 80%);
}
.key:active, .key.pressed {
  background: linear-gradient(180deg, #c7d2fe 0%, #a5b4fc 50%, #818cf8 100%);
  transform: translateY(3px);
  box-shadow: 0 2px 8px rgba(79,70,229,0.28),
    inset 0 3px 10px rgba(79,70,229,0.2);
}
.key .key-label {
  font-size: 11px; font-weight: 800; color: #3730a3;
  font-family: 'Inter', sans-serif; letter-spacing: -0.3px;
}
.key .key-shortcut {
  font-size: 9px; color: #6366f1; margin-top: 2px;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(99,102,241,0.12); border-radius: 3px; padding: 0px 3px;
}

/* ── BLACK KEYS ──────────────────────────────────────────── */
.key.black {
  position: absolute;
  background: linear-gradient(180deg,
    #1e1b4b 0%, #312e81 30%, #1e1b4b 65%, #0f0e2e 100%);
  border-radius: 0 0 7px 7px;
  border: 1px solid #0f0e2a;
  border-top: 3px solid #3730a3;
  top: 0; z-index: 2; margin: 0; padding-bottom: 10px;
  box-shadow:
    2px 8px 20px rgba(30,27,75,0.7),
    inset 0 -3px 7px rgba(0,0,0,0.5),
    inset 1px 0 0 rgba(255,255,255,0.06),
    inset 0 1px 0 rgba(99,102,241,0.15);
}
.key.black:hover {
  background: linear-gradient(180deg, #312e81 0%, #1e1b4b 60%, #0f0e2e 100%);
}
.key.black:active, .key.black.pressed {
  background: linear-gradient(180deg, #4f46e5 0%, #4338ca 50%, #3730a3 100%);
  transform: translateY(3px);
  box-shadow: 1px 4px 12px rgba(30,27,75,0.7),
    inset 0 3px rgba(165,180,252,0.18);
}
.key.black .key-label   { font-size: 8px; color: #818cf8; }
.key.black .key-shortcut { font-size: 7px; color: #6366f1; }

.piano-keys--horizontal { align-items: flex-start; }

/* ════════════════════════════════════════════════════════════
   VERTICAL PIANO — Mobile Portrait
   ════════════════════════════════════════════════════════════ */
.piano-wrapper.piano-vertical {
  overflow-y: auto !important; overflow-x: hidden !important;
  flex-direction: column; align-items: stretch;
  padding: 0; background: var(--bg-page);
}
.piano-keys--vertical {
  flex-direction: column; position: static !important;
  width: 100%; height: auto !important;
  padding: 0 !important; margin: 0 !important; display: flex !important;
}
.vkey {
  display: flex; flex-direction: row;
  width: 100%; height: 56px;
  position: relative; flex-shrink: 0;
  user-select: none; -webkit-user-select: none;
  touch-action: none; cursor: pointer;
  transition: filter 0.06s; border-bottom: 1px solid var(--border);
}
.vkey-white { background: linear-gradient(90deg, #f5f5ff 0%, #eeeeff 100%); }
.vkey-white:active, .vkey-white.pressed {
  background: linear-gradient(90deg, #c7d2fe 0%, #a5b4fc 70%, #818cf8 100%);
}
.vkey-white:hover:not(.pressed) { filter: brightness(0.97); }
.vkey-label {
  width: 72px; min-width: 72px; height: 100%;
  display: flex; align-items: center; justify-content: flex-start;
  gap: 6px; padding: 0 10px; flex-shrink: 0;
  border-right: 1px solid var(--border);
}
.vkey-note  { font-size: 15px; font-weight: 900; font-family: 'Inter', sans-serif; line-height: 1; }
.vkey-oct   { font-size: 10px; font-weight: 600; color: var(--text-3); font-family: 'JetBrains Mono', monospace; }
.vkey-sc    { margin-left: auto; font-size: 9px; color: var(--text-4); font-family: 'JetBrains Mono', monospace; background: var(--bg-hover); border-radius: 3px; padding: 1px 4px; }
.vkey-body  { flex: 1; height: 100%; display: flex; align-items: center; position: relative; overflow: hidden; }
.vkey-white .vkey-body::before {
  content: ''; position: absolute; right: 0; top: 20%; bottom: 20%;
  width: 3px; border-radius: 4px; background: rgba(99,102,241,0.1);
}
.vkey-white.pressed .vkey-body::before { display: none; }
.vkey-white.pressed .vkey-body::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% center, rgba(99,102,241,0.25) 0%, transparent 70%);
  animation: vkRipple 0.3s ease-out forwards;
}
@keyframes vkRipple { from{opacity:1;} to{opacity:0;} }
.vkey-black { height: 42px; background: transparent; border-bottom: 1px solid var(--border); }
.vkey-black:active, .vkey-black.pressed { filter: brightness(1.3); }
.vkey-black-spacer { width: 72px; min-width: 72px; height: 100%; background: var(--bg-page); border-right: 1px solid var(--border); flex-shrink: 0; }
.vkey-black-body {
  flex: 1; height: 100%;
  background: linear-gradient(90deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
  display: flex; align-items: center;
  padding-left: 14px; position: relative; overflow: hidden;
}
.vkey-black.pressed .vkey-black-body { background: linear-gradient(90deg, #4f46e5 0%, #6366f1 60%, #818cf8 100%); }
.vkey-black-body::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 60%; background: linear-gradient(90deg, transparent, rgba(0,0,0,0.25)); }
.vkey-black-label { font-size: 12px; font-weight: 700; color: #818cf8; font-family: 'Inter', sans-serif; position: relative; z-index: 1; }
.vkey-black.pressed .vkey-black-label { color: #e0e7ff; }
.piano-keys--vertical .vkey-white[data-note="C"] { border-top: 1.5px solid rgba(99,102,241,0.3); }

/* ════════════════════════════════════════════════════════════
   RECORDER BAR
   ════════════════════════════════════════════════════════════ */
.recorder-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  background: var(--bg-card);
  border-top: 1.5px solid var(--border);
  flex-shrink: 0;
  box-shadow: 0 -2px 8px rgba(79,70,229,0.06);
}

.rec-btn {
  padding: 8px 16px; border-radius: 9px; border: none;
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all 0.18s; display: flex; align-items: center; gap: 7px;
  font-family: inherit; white-space: nowrap; flex-shrink: 0;
}
.rec-btn:not(.secondary) {
  background: var(--red);
  color: #fff; box-shadow: 0 3px 12px rgba(220,38,38,0.35);
}
.rec-btn:not(.secondary):hover { transform: translateY(-1px); box-shadow: 0 5px 18px rgba(220,38,38,0.5); }
.rec-btn:not(.secondary).recording {
  background: var(--green);
  box-shadow: 0 3px 12px rgba(5,150,105,0.4);
  animation: pulsate 1.4s infinite;
}
@keyframes pulsate {
  0%,100% { box-shadow: 0 3px 12px rgba(5,150,105,0.4); }
  50%      { box-shadow: 0 3px 24px rgba(5,150,105,0.72); }
}
.rec-dot { width: 8px; height: 8px; background: currentColor; border-radius: 50%; display: inline-block; }
.rec-btn.recording .rec-dot { animation: blink 0.8s infinite; }
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0;} }

.rec-btn.secondary {
  background: var(--bg-input); color: var(--text-1);
  border: 1.5px solid var(--border);
}
.rec-btn.secondary:hover:not(:disabled) { border-color: var(--accent2); color: var(--accent); background: var(--accent-light); }
.rec-btn.secondary:disabled { opacity: 0.35; cursor: not-allowed; }

.rec-timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px; font-weight: 800; color: var(--accent);
  min-width: 60px; letter-spacing: 1.5px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 8px; padding: 4px 10px; text-align: center;
}

.rec-spacer { flex: 1; }

.btn-save-song {
  padding: 8px 18px;
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  color: #fff; border: none; border-radius: 9px;
  font-size: 13px; font-weight: 700;
  cursor: pointer; box-shadow: 0 3px 12px rgba(13,148,136,0.35);
  transition: all 0.18s; white-space: nowrap; font-family: inherit;
}
.btn-save-song:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(13,148,136,0.5); }
.btn-save-song:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── VISUALIZER ──────────────────────────────────────────── */
.visualizer { width: 100%; height: 44px; background: transparent; flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════
   KEYBOARD HINT BAR — Styled pill badges
   ════════════════════════════════════════════════════════════ */
.keyboard-hint {
  padding: 7px 14px;
  background: var(--bg-card);
  border-top: 1.5px solid var(--border);
  text-align: center; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 4px;
}
.keyboard-hint p {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 5px; font-size: 11px; color: var(--text-3);
  justify-content: center;
}
.keyboard-hint kbd {
  display: inline-flex; align-items: center;
  background: var(--bg-card);
  border: 1.5px solid rgba(99,102,241,0.3);
  border-radius: 5px; padding: 2px 6px;
  font-size: 10px; font-family: 'JetBrains Mono', monospace;
  color: var(--accent); font-weight: 700;
  box-shadow: 0 1px 3px rgba(79,70,229,0.12), 0 2px 0 rgba(99,102,241,0.2);
  letter-spacing: 0.5px;
}

/* ════════════════════════════════════════════════════════════
   SETTINGS MODAL
   ════════════════════════════════════════════════════════════ */
.settings-modal .modal-box { max-width: 460px; padding: 0; overflow: hidden; }
.settings-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1.5px solid var(--border);
  background: var(--bg-card2);
}
.settings-header h3 {
  font-size: 16px; font-weight: 800; color: var(--text-1);
  display: flex; align-items: center; gap: 8px;
}
.btn-close-modal {
  width: 30px; height: 30px;
  border: 1.5px solid var(--border);
  background: var(--bg-input); color: var(--text-3);
  border-radius: 8px; font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; font-family: inherit;
}
.btn-close-modal:hover { background: rgba(220,38,38,0.1); color: var(--red); border-color: rgba(220,38,38,0.3); }

.settings-body { padding: 22px 24px 28px; }
.settings-section { margin-bottom: 22px; }
.settings-section:last-child { margin-bottom: 0; }
.settings-section-title {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--text-4);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.settings-section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.settings-row:last-child { margin-bottom: 0; }
.settings-label {
  font-size: 13.5px; font-weight: 600; color: var(--text-1);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.settings-label .icon { font-size: 16px; }
.settings-control { display: flex; align-items: center; gap: 8px; }

.settings-select {
  background: var(--bg-input); border: 1.5px solid var(--border);
  border-radius: 9px; color: var(--text-1); padding: 7px 12px;
  font-size: 13px; outline: none; cursor: pointer;
  transition: border-color 0.18s; font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236366f1' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 30px; min-width: 140px;
}
.settings-select:hover, .settings-select:focus { border-color: var(--accent2); }

.settings-slider {
  -webkit-appearance: none; appearance: none;
  height: 5px; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent2), var(--bg-hover)); outline: none; cursor: pointer;
  width: 120px;
}
.settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px;
  background: var(--accent); border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(99,102,241,0.3), 0 2px 6px rgba(79,70,229,0.3);
  cursor: pointer; transition: transform 0.15s;
}
.settings-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.settings-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--accent); border-radius: 50%;
  border: 2px solid #fff; cursor: pointer;
}

.slider-value {
  font-size: 12px; font-weight: 700; color: var(--accent);
  min-width: 36px; text-align: right;
  font-family: 'JetBrains Mono', monospace;
}

.settings-number {
  width: 72px; padding: 7px 10px;
  background: var(--bg-input); border: 1.5px solid var(--border);
  border-radius: 9px; color: var(--text-1); font-size: 14px;
  text-align: center; outline: none; font-family: 'JetBrains Mono', monospace;
  transition: border-color 0.18s;
}
.settings-number:focus { border-color: var(--accent2); }

.toggle { position: relative; width: 44px; height: 24px; display: inline-block; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--bg-hover); border-radius: 24px;
  border: 1.5px solid var(--border); transition: 0.25s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 2px; top: 2px;
  background: var(--text-3); border-radius: 50%;
  transition: 0.25s; box-shadow: 0 2px 4px rgba(0,0,0,0.18);
}
.toggle input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent2); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); background: #fff; }

/* ════════════════════════════════════════════════════════════
   SONGS SECTION
   ════════════════════════════════════════════════════════════ */
#sectionSongs { overflow-y: auto; padding: 28px 24px; }
.songs-container { max-width: 100%; margin: 0 auto; }
.songs-header { margin-bottom: 28px; }
.songs-header h2 { font-size: 26px; font-weight: 800; color: var(--text-1); }
.songs-header p { color: var(--text-3); margin-top: 6px; font-size: 14px; }

.songs-list { display: flex; flex-direction: column; gap: 10px; }
.loading-songs { color: var(--text-3); text-align: center; padding: 48px; font-size: 14px; }
.no-songs { text-align: center; padding: 64px 20px; color: var(--text-3); }
.no-songs .no-songs-icon { font-size: 52px; margin-bottom: 14px; }
.no-songs p { font-size: 15px; }

.song-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  transition: all 0.2s;
}
.song-card:hover {
  border-color: var(--border2);
  transform: translateX(3px);
  box-shadow: var(--shadow-sm);
}
.song-info h4 { font-size: 15px; font-weight: 700; color: var(--text-1); }
.song-info p  { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.song-meta    { display: flex; gap: 8px; margin-top: 8px; }
.song-meta span {
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  background: var(--accent-light); border-radius: 20px; color: var(--accent);
  border: 1px solid var(--border2);
}
.song-actions { display: flex; gap: 7px; flex-shrink: 0; }
.song-action-btn {
  padding: 7px 14px; border-radius: 8px; border: none;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: all 0.18s; font-family: inherit;
}
.song-action-btn.play  { background: rgba(13,148,136,0.1); color: var(--teal); border: 1.5px solid rgba(13,148,136,0.25); }
.song-action-btn.play:hover { background: rgba(13,148,136,0.2); }
.song-action-btn.upload { background: rgba(79,70,229,0.1); color: var(--accent); border: 1.5px solid rgba(79,70,229,0.25); }
.song-action-btn.upload:hover { background: rgba(79,70,229,0.2); }
.song-action-btn.delete { background: rgba(220,38,38,0.07); color: var(--red); border: 1.5px solid rgba(220,38,38,0.2); }
.song-action-btn.delete:hover { background: rgba(220,38,38,0.16); }

/* ════════════════════════════════════════════════════════════
   GUIDE / TUTORIALS
   ════════════════════════════════════════════════════════════ */
#sectionTutorials, #sectionGuide { overflow-y: auto; padding: 28px 24px; }
.guide-container { max-width: 100%; margin: 0 auto; }
.guide-container h2 { font-size: 26px; font-weight: 800; margin-bottom: 6px; color: var(--text-1); }
.guide-subtitle { color: var(--text-3); font-size: 14px; margin-bottom: 26px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 16px; }
.guide-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  padding: 22px 20px; transition: all 0.22s;
}
.guide-card:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.tutorial-card { cursor: default; }
.guide-icon { font-size: 30px; margin-bottom: 12px; }
.guide-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; color: var(--text-1); }
.guide-card p  { font-size: 13px; color: var(--text-3); line-height: 1.7; }

.tutorial-keys { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.tutorial-keys div { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.tutorial-keys kbd {
  background: var(--bg-card);
  border: 1.5px solid rgba(99,102,241,0.3);
  border-radius: 5px; padding: 2px 7px; font-size: 11px;
  font-family: 'JetBrains Mono', monospace; color: var(--accent); font-weight: 700;
  box-shadow: 0 1px 3px rgba(79,70,229,0.1), 0 2px 0 rgba(99,102,241,0.2);
}

.key-map { margin-top: 14px; }
.key-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.kmap-entry { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 4px; }
.kmap-entry kbd {
  background: var(--bg-input); border: 1px solid var(--border2);
  border-radius: 4px; padding: 2px 6px; font-size: 10px;
  font-family: 'JetBrains Mono', monospace; color: var(--accent);
}

/* ── MODAL ACTIONS ───────────────────────────────────────── */
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal-box h3.save-title { font-size: 18px; font-weight: 800; margin-bottom: 18px; color: var(--text-1); }

/* ── TOAST ───────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--bg-card);
  color: var(--text-1);
  padding: 13px 22px; border-radius: 12px;
  font-size: 13.5px; font-weight: 600;
  border: 1.5px solid var(--border2);
  box-shadow: var(--shadow);
  z-index: 9999; animation: slideUp 0.28s ease;
  max-width: 320px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.hidden  { display: none; }
@keyframes slideUp { from{transform:translateY(16px);opacity:0;} to{transform:translateY(0);opacity:1;} }


/* ── LANDSCAPE ───────────────────────────────────────────── */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --header-h: 44px; }
  .logo-text { font-size: 10px; }
  .header-center .nav-btn { font-size: 9px; padding: 3px 6px; }
  .username-badge { font-size: 9px; padding: 3px 6px; }
  .piano-infobar { padding: 3px 10px; min-height: 32px; gap: 4px; }
  .octave-ctrl { padding: 2px 4px; }
  .octave-ctrl label { font-size: 8px; }
  .recorder-bar { padding: 4px 10px; min-height: 36px; }
  .rec-btn { padding: 5px 8px; font-size: 10px; }
  .visualizer { height: 22px; }
  .keyboard-hint { padding: 4px; }
  .keyboard-hint p { font-size: 8px; }
  .keyboard-hint kbd { font-size: 7px; padding: 1px 3px; }
}

/* ── DEVICE KEY WIDTHS ────────────────────────────────────── */
.device-mobile    .key        { width: 40px; }
.device-mobile    .key.black  { width: 25px; }
.device-tablet    .key        { width: 60px; }
.device-tablet    .key.black  { width: 38px; }
.device-landscape .key        { width: 44px; }
.device-landscape .key.black  { width: 28px; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .nav-btn { padding: 6px 10px; font-size: 11.5px; }
  .logo-text { font-size: 13px; }
  .piano-size-ctrl { display: flex; transform: scale(0.9); transform-origin: left center; }
}

@media (max-width: 850px) {
  .nav-btn { padding: 4px 6px; font-size: 10px; }
  .username-badge { font-size: 10px; padding: 4px 8px; }
  .btn-logout { font-size: 10px; padding: 4px 8px; }
  .btn-icon { width: 28px; height: 28px; font-size: 14px; }
  .piano-size-ctrl { transform: scale(0.85); margin-left: -5px; }
  .instrument-badge { font-size: 11px; padding: 4px 8px; }
  .visualizer { height: 32px; }
}

@media (max-width: 720px) {
  .app-header { padding: 0 10px; }
  .logo-text { font-size: 11px; }
  .nav-btn { font-size: 9px; padding: 4px 5px; }
  .username-badge { font-size: 9px; padding: 3px 6px; }
  .btn-save-song { font-size: 11px; padding: 5px 10px; }
  .keyboard-hint p { font-size: 9px; }
  .keyboard-hint kbd { font-size: 8px; padding: 1px 3px; }
}

@media (max-width: 600px) {
  :root { --header-h: 54px; }
  .logo-text { font-size: 10px; }
  .logo-mark { font-size: 16px; }
  .nav-btn { font-size: 8px; padding: 3px 4px; }
  .username-badge { font-size: 8px; padding: 2px 4px; }
  .btn-logout { font-size: 8px; padding: 3px 6px; }
  .piano-infobar { padding: 5px 6px; flex-wrap: nowrap; overflow-x: auto; gap: 4px; }
  .instrument-badge { font-size: 10px; padding: 3px 6px; }
  .instrument-badge span.ib-text { font-size: 9px; }
  .piano-size-ctrl { flex: 1; min-width: 80px; transform: scale(0.75); transform-origin: left center; }
  .piano-size-slider { width: 50px; }
  .rec-btn { padding: 4px 6px; font-size: 9px; }
  .rec-timer { font-size: 11px; padding: 3px 6px; min-width: 40px; }
  .visualizer { height: 24px; }
  .keyboard-hint { padding: 3px 6px; gap: 2px; }
  .keyboard-hint p { font-size: 8px; line-height: 1.1; display: flex; flex-wrap: wrap; justify-content: center; }
  .keyboard-hint kbd { font-size: 7px; padding: 1px 2px; margin: 0 1px; }
  .toast { bottom: 74px; max-width: calc(100vw - 32px); right: 16px; }
  #sectionSongs, #sectionTutorials, #sectionGuide { padding: 18px 14px; }
  .guide-grid { grid-template-columns: 1fr; }
  .song-card { flex-direction: column; align-items: flex-start; }
  .song-actions { width: 100%; }
  .song-action-btn { flex: 1; text-align: center; }
  .settings-slider { width: 90px; }
  .settings-select { min-width: 110px; }
}

@media (max-width: 460px) {
  .logo-text { display: none; }
}

@media (max-width: 380px) {
  .key .key-label    { font-size: 9px; }
  .key .key-shortcut { font-size: 7px; }
}

/* ── KEY GLOW (LIGHT) ─────────────────────────────────────── */
@keyframes keyGlow {
  0%   { box-shadow: 0 0 0 rgba(99,102,241,0); }
  50%  { box-shadow: 0 0 16px rgba(99,102,241,0.5), 0 0 32px rgba(165,180,252,0.25); }
  100% { box-shadow: 0 0 0 rgba(99,102,241,0); }
}
.key.pressed { animation: keyGlow 0.4s ease-out; }

/* ════════════════════════════════════════════════════════════
   SKELETON LOADER (full-page, shown before auth check done)
   ════════════════════════════════════════════════════════════ */
#appLoader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-page);
  display: flex; flex-direction: column; overflow: hidden;
}
#appLoader.fade-out {
  animation: loaderFade 0.4s ease forwards;
  pointer-events: none;
}
@keyframes loaderFade { to { opacity: 0; visibility: hidden; } }

/* shimmer animation */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.sk {
  background: linear-gradient(90deg, #e8eaf6 25%, #f0f2fa 50%, #e8eaf6 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 8px;
}

/* Skeleton header */
.sk-header {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1.5px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 20px; flex-shrink: 0;
}
.sk-logo { width: 160px; height: 28px; }
.sk-nav  { width: 340px; height: 34px; margin: 0 auto; }
.sk-ava  { width: 90px; height: 28px; margin-left: auto; }

/* Skeleton info bar */
.sk-infobar {
  height: 46px;
  background: #fff;
  border-bottom: 1.5px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 16px; flex-shrink: 0;
}
.sk-pill { height: 28px; width: 110px; border-radius: 9px; }
.sk-pill-sm { height: 26px; width: 70px; border-radius: 8px; }

/* Skeleton piano */
.sk-piano {
  flex: 1; background: linear-gradient(180deg, #e8eaf6 0%, #dde0f4 100%);
  display: flex; align-items: flex-start;
  gap: 3px; padding: 4px 12px 0; overflow: hidden;
}
.sk-key {
  flex: 1; border-radius: 0 0 10px 10px;
  background: linear-gradient(180deg, #e8eaf6 25%, #f0f2fa 50%, #e8eaf6 75%);
  background-size: 200px 100%;
  animation: shimmer 1.4s infinite linear;
  min-width: 0;
}

/* Skeleton recorder bar */
.sk-recorder {
  height: 48px;
  background: #fff;
  border-top: 1.5px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px; flex-shrink: 0;
}
.sk-btn { height: 32px; width: 90px; border-radius: 9px; }
.sk-btn-sm { height: 32px; width: 60px; border-radius: 9px; }

/* Skeleton hint bar */
.sk-hint {
  height: 32px;
  background: #fff;
  border-top: 1.5px solid var(--border);
  display: flex; align-items: center;
  padding: 0 16px; gap: 8px; flex-shrink: 0;
}
.sk-hint-pill { height: 18px; width: 40px; border-radius: 4px; }

/* ── LOGOUT ANIMATION ──────────────────────────────────────── */
.piano-lid {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: #12122a; /* classic piano black */
  z-index: 999999;
  transform: translateY(-100%);
  transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
  border-bottom: 8px solid #dc2626; /* red felt line */
  box-shadow: 0 10px 50px rgba(0,0,0,0.5);
  pointer-events: none;
}
.piano-lid.active {
  transform: translateY(0);
}

/* ── TUTORIAL section extras ──────────────────────────────── */
.tut-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; margin-bottom: 24px;
}
.tut-controls {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.tut-search {
  padding: 9px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text-1); font-size: 13.5px; width: 200px;
  outline: none; font-family: inherit;
  transition: border-color 0.18s;
}
.tut-search:focus { border-color: var(--accent2); }
.tut-lang-select { min-width: 150px; }
.tut-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tut-lang-pill {
  font-size: 10px; font-weight: 700;
  background: var(--accent-light);
  border: 1px solid var(--border2);
  border-radius: 20px; padding: 3px 9px;
  color: var(--accent); white-space: nowrap;
}
.tut-author {
  font-size: 11px; color: var(--text-3);
  font-style: italic; margin-bottom: 6px;
  display: flex; align-items: center; gap: 5px;
}
.tut-user-badge {
  font-style: normal; font-size: 10px; font-weight: 700;
  background: rgba(245,158,11,0.12);
  color: var(--gold);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 4px; padding: 1px 6px;
}

