/* ============================================
   ReelShort Downloader - Polished B/W Theme
   Only two colors: white (light, default) & black (dark).
   Soft borders, generous radius, subtle shadow, smooth hover.
   ============================================ */

:root {
  /* Light theme = default */
  --bg:        #fafafa;
  --surface:   #ffffff;
  --text:      #0a0a0a;
  --text-soft: #4b4b4b;
  --text-mute: #9a9a9a;
  --border:    #0a0a0a;
  --border-soft: #ececec;
  --border-mid:   #d9d9d9;
  --hover:     #f3f3f3;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
}

[data-theme="dark"] {
  --bg:        #0a0a0a;
  --surface:   #141414;
  --text:      #f5f5f5;
  --text-soft: #b8b8b8;
  --text-mute: #707070;
  --border:    #f5f5f5;
  --border-soft: #2a2a2a;
  --border-mid:   #3d3d3d;
  --hover:     #1c1c1c;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.4);
}

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

html { height: 100%; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== App Shell ===== */
.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  background: var(--bg);
}

.main-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  background: var(--bg);
}

/* ===== Sidebar ===== */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border-soft);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 22px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 14px;
  position: relative;
}
.sidebar-brand .theme-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 36px;
  height: 36px;
  font-size: 16px;
}
.sidebar .logo {
  font-size: 26px;
}
.sb-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sb-title h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.sb-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding: 14px 12px 6px;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }

.sb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.sb-item:not(:disabled):hover {
  background: var(--hover);
  color: var(--text);
  transform: translateX(2px);
}
.sb-item.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  box-shadow: var(--shadow-md);
}
.sb-item:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}
.sb-item:disabled:hover { transform: none; background: transparent; }

.sb-icon-img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--hover);
  border: 1px solid var(--border-soft);
}
.logo-img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
}
.sb-icon {
  font-size: 16px;
  width: 22px;
  display: inline-flex;
  justify-content: center;
}

/* ---------- Sidebar user ---------- */
.sb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--hover);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  transition: background 0.18s ease;
}
.sb-user:hover { background: var(--border-soft); }
.sb-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.sb-user-info { flex: 1; min-width: 0; }
.sb-user-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-user-email {
  font-size: 11px;
  color: var(--text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-logout {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-mute);
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.18s ease;
}
.sb-logout:hover {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.sb-label { flex: 1; }

.sb-tag {
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid var(--border-soft);
}
.sb-tag-live { background: var(--text); color: var(--bg); border-color: var(--text); }
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}
.sb-tag-live { animation: livePulse 2s ease-in-out infinite; }
.sb-tag-new {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #fff; border-color: transparent;
}
.sb-tag-soon {
  background: transparent;
  color: var(--text-mute);
  border: 1px solid var(--border-soft);
}

.sb-tag-off {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.sb-item-off {
  opacity: 0.5;
  cursor: not-allowed !important;
  pointer-events: none;
}
.sb-item-off .sb-icon-img { filter: grayscale(1); }

.maintenance-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #fbbf24;
  color: #92400e;
  padding: 24px 28px;
  border-radius: 12px;
  margin: 40px auto;
  font-size: 15px;
  max-width: 520px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(251, 191, 36, 0.15);
}
.maintenance-banner b { color: #78350f; }

.source-content-off {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.source-content-off > * { display: none !important; }
.source-content-off > .maintenance-banner { display: block !important; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}
.sb-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-mute);
  padding: 6px 12px;
}
.sb-dot {
  width: 5px;
  height: 5px;
  background: var(--text-mute);
  border-radius: 50%;
}

/* ===== Topbar (mobile only) ===== */
.topbar {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
}

/* ===== Main ===== */
main {
  max-width: 1100px;
  margin: 36px auto 40px;
  padding: 0 28px;
  width: 100%;
  flex: 1;
}

/* ===== Source content (multi-source) ===== */
.source-content { display: none; }
.source-content.active { display: block; animation: fadeIn 0.35s ease; }

/* ===== Coming Soon card ===== */
.soon-card {
  text-align: center;
  padding: 72px 36px;
}
.soon-icon {
  font-size: 60px;
  margin-bottom: 18px;
}
.soon-card h2 {
  justify-content: center;
  font-size: 26px;
  margin-bottom: 10px;
}
.soon-roadmap {
  display: inline-flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 36px;
  text-align: left;
}
.roadmap-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-soft);
  min-width: 300px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.roadmap-item:hover {
  background: var(--hover);
  border-color: var(--border-mid);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}
.roadmap-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

/* ===== Theme toggle ===== */
.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.theme-toggle:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  transform: rotate(15deg) scale(1.05);
  box-shadow: var(--shadow-md);
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ===== Card ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  animation: cardIn 0.45s ease-out backwards;
}
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card:hover {
  border-color: var(--border-mid);
  box-shadow: var(--shadow-md);
}

.card h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}

.step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--text);
  color: var(--bg);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* ===== Inputs ===== */
input[type=text], input[type=number], input[type=file] {
  background: var(--surface);
  border: 1px solid var(--border-mid);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  flex: 1;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
input::placeholder { color: var(--text-mute); }
input:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(10,10,10,0.06);
}
[data-theme="dark"] input:focus {
  box-shadow: 0 0 0 3px rgba(245,245,245,0.08);
}

.row { display: flex; gap: 10px; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
label {
  display: block;
  font-size: 11px;
  color: var(--text-soft);
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ===== Buttons ===== */
button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-mid);
  padding: 11px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}
button:hover:not(:disabled) {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  box-shadow: var(--shadow-md);
}
button:active:not(:disabled) { transform: translateY(1px); box-shadow: var(--shadow-sm); }
button:disabled { opacity: 0.35; cursor: not-allowed; }

.input-error {
  animation: shake 0.4s;
  border-color: var(--text) !important;
  background: var(--surface) !important;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.btn-primary {
  background: var(--text);
  border: 1px solid var(--text);
  color: var(--bg);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover:not(:disabled) {
  background: var(--bg);
  color: var(--text);
  border-color: var(--text);
  box-shadow: var(--shadow-md);
}

.btn-success {
  background: var(--text);
  border: 1px solid var(--text);
  color: var(--bg);
  font-weight: 700;
  font-size: 15px;
  padding: 15px 34px;
  letter-spacing: 0.01em;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}
.btn-success:hover:not(:disabled) {
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.btn-danger {
  background: var(--surface);
  border: 1px solid var(--text);
  color: var(--text);
  font-weight: 600;
}
.btn-danger:hover:not(:disabled) {
  background: var(--text);
  color: var(--bg);
}

.btn-icon {
  padding: 8px 14px;
  font-size: 13px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ===== Tabs ===== */
.cookie-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 2px;
}
.tab-btn {
  background: transparent;
  border: none;
  padding: 11px 18px;
  color: var(--text-soft);
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-weight: 500;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.tab-btn:hover { color: var(--text); background: transparent; }
.tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--text);
  font-weight: 600;
  background: transparent;
}
.tab-content { display: none; padding-top: 14px; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== Meta text ===== */
.meta {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 10px;
  line-height: 1.55;
}

/* ===== How-to numbered list ===== */
ol.howto {
  margin: 6px 0 4px 18px;
  padding: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}
ol.howto li {
  margin-bottom: 4px;
}
ol.howto a {
  color: var(--accent, #2563eb);
  word-break: break-all;
}
.meta.success { color: var(--text); font-weight: 600; }
.meta.error   { color: var(--text); font-weight: 700; }

/* ===== Episodes header ===== */
.episodes-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.episodes-header h3 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--hover);
  border-radius: 999px;
  overflow: hidden;
  margin: 16px 0 10px;
  border: 1px solid var(--border-soft);
}
#progress-fill {
  height: 100%;
  background: var(--text);
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 999px;
}

.action-row { display: flex; gap: 12px; margin: 18px 0; }

/* ===== Table ===== */
.episodes-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 14px;
  font-size: 14px;
}
.episodes-table th, .episodes-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
}
.episodes-table th {
  color: var(--text-mute);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg);
}
.episodes-table tr {
  transition: background 0.15s ease;
}
.episodes-table tr:hover td { background: var(--hover); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border-soft);
  color: var(--text-soft);
  background: var(--surface);
}
.status-Pending     { color: var(--text-mute); }
.status-Countdown   { color: var(--text); border-color: var(--text); background: var(--bg); animation: pulse 1s ease-in-out infinite; }
.status-Countdown::after { content: ""; }
.status-Downloading { color: var(--text); border-color: var(--text); background: var(--bg); }
.status-Downloading::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--text);
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}
.status-Retrying    { color: var(--text); border-color: var(--text); }
.status-OK          { background: var(--text); color: var(--bg); border-color: var(--text); }
.status-Failed      { background: var(--text); color: var(--bg); border-color: var(--text); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(1.3); }
}

/* ===== Row download button ===== */
.row-dl-btn {
  background: var(--surface);
  border: 1px solid var(--text);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.18s ease;
}
.row-dl-btn:hover:not(:disabled) {
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow-sm);
}
.row-dl-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== Logs ===== */
.logs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.logs-header h2 { margin: 0; }
.logs-actions { display: flex; gap: 8px; }

.logs {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 16px 18px;
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 12.5px;
  max-height: 340px;
  overflow-y: auto;
  line-height: 1.7;
  scrollbar-width: thin;
  box-shadow: var(--shadow-sm);
}
.logs::-webkit-scrollbar { width: 6px; }
.logs::-webkit-scrollbar-thumb {
  background: var(--border-mid);
  border-radius: 3px;
}

.logs .line {
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-soft);
  padding: 1px 0;
}
.logs .line.error   { color: var(--text); font-weight: 700; }
.logs .line.success { color: var(--text); font-weight: 700; }
.logs .line.warn    { color: var(--text); font-weight: 600; }

/* ===== Footer ===== */
footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 16px;
  font-size: 11px;
  color: var(--text-soft, #64748b);
  text-align: center;
  background: transparent;
  border: none;
  min-height: 0;
}

/* ===== Dashboard ===== */
.dash-welcome {
  display: flex; align-items: center; gap: 16px;
}
.dash-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent, #2563eb); color: #fff;
  font-size: 24px; font-weight: 700;
  flex-shrink: 0;
}
.dash-user { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash-username { font-size: 18px; font-weight: 600; color: var(--text, #0f172a); }
.dash-email { font-size: 13px; color: var(--text-soft, #64748b); }
.dash-plan { margin-top: 6px; }
.plan-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
}
.plan-free { background: #e2e8f0; color: #475569; }
.plan-pro { background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; }
.plan-admin { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; }
.plan-active { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.plan-inactive { background: #e2e8f0; color: #475569; }

/* ===== Settings: change password form ===== */
.settings-form {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 480px;
}
.settings-row {
  display: flex; flex-direction: column; gap: 6px;
}
.settings-label {
  font-size: 13px; font-weight: 600; color: var(--text-muted, #475569);
}
.settings-input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border-soft, #e2e8f0);
  border-radius: 8px; background: var(--surface, #fff);
  color: var(--text, #0f172a); font-size: 14px;
  outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.settings-input:focus {
  border-color: var(--primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99,102,241,.18);
}
.settings-actions {
  display: flex; align-items: center; gap: 12px; margin-top: 4px;
}

/* Alert box (dismissible) - error + success variants */
.pw-alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.45;
  animation: pw-alert-in .22s ease-out;
}
.pw-alert[hidden] { display: none; }
.pw-alert-icon { flex: 0 0 auto; font-size: 16px; line-height: 1; }
.pw-alert-msg { flex: 1 1 auto; }
.pw-alert-close {
  flex: 0 0 auto;
  background: transparent; border: 0; padding: 0 4px;
  font-size: 20px; line-height: 1; cursor: pointer;
  color: inherit; opacity: .55;
  transition: opacity .15s ease;
}
.pw-alert-close:hover { opacity: 1; }

.pw-alert-error {
  background: #fff1f2; /* rose-50 */
  border: 1px solid #fecdd3; /* rose-200 */
  color: #be123c; /* rose-700 */
}
.pw-alert-success {
  background: #f0fdf4; /* green-50 */
  border: 1px solid #bbf7d0; /* green-200 */
  color: #15803d; /* green-700 */
}
.pw-alert-info {
  background: #eff6ff; /* blue-50 */
  border: 1px solid #bfdbfe; /* blue-200 */
  color: #1d4ed8; /* blue-700 */
}

@keyframes pw-alert-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Submit button: loading state */
#settings-pw-submit {
  display: inline-flex; align-items: center; gap: 8px;
  position: relative;
}
#settings-pw-submit[disabled] { cursor: not-allowed; opacity: .8; }
.pw-btn-spinner {
  width: 14px; height: 14px; flex: 0 0 auto;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%;
  display: none;
  animation: pw-spin .7s linear infinite;
}
#settings-pw-submit.is-loading .pw-btn-spinner { display: inline-block; }
#settings-pw-submit.is-loading .pw-btn-label::after {
  content: '...'; /* visual cue */
}

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

.dash-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.stat-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 18px 12px; border-radius: 12px;
  background: var(--bg-soft, #f8fafc);
  border: 1px solid var(--line, #e5e7eb);
  text-align: center; gap: 4px;
}
.stat-icon { font-size: 24px; }
.stat-value {
  font-size: 22px; font-weight: 700; color: var(--text, #0f172a);
  margin-top: 2px;
}
.stat-label {
  font-size: 12px; color: var(--text-soft, #64748b);
  text-transform: uppercase; letter-spacing: 0.4px;
}

.dash-shortcuts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.shortcut-tile {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 14px; border-radius: 10px;
  background: var(--bg-soft, #f8fafc);
  border: 1px solid var(--line, #e5e7eb);
  text-decoration: none; color: inherit; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  gap: 2px;
}
.shortcut-tile:hover {
  transform: translateY(-1px);
  border-color: var(--accent, #2563eb);
  box-shadow: 0 4px 12px rgba(37,99,235,0.08);
}
.sc-icon { font-size: 22px; }
.sc-label { font-weight: 600; font-size: 14px; margin-top: 4px; }
.sc-meta { font-size: 12px; color: var(--text-soft, #64748b); }

/* ===== Cookie consent banner ===== */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 640px;
  margin: 0 auto;
  z-index: 9999;
  background: var(--card, #fff);
  color: var(--text, #0f172a);
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  padding: 14px 16px;
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  transform: translateY(120%);
  transition: transform .3s ease;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner .cb-text { flex: 1 1 280px; line-height: 1.5; }
.cookie-banner .cb-text a { color: var(--accent, #2563eb); }
.cookie-banner .cb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cookie-banner button {
  padding: 7px 14px;
  border-radius: 7px;
  border: 1px solid var(--line, #e5e7eb);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}
.cookie-banner button.cb-accept { background: var(--accent, #2563eb); color: #fff; border-color: transparent; }

/* ===== Spinner ===== */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-soft);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Toast (mini) ===== */
.toast {
  position: fixed;
  top: 80px;
  right: 24px;
  padding: 14px 22px;
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  font-weight: 600;
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .topbar { display: flex; }
  main { margin: 18px auto; padding: 0 16px; }
}

@media (max-width: 720px) {
  .card { padding: 20px; border-radius: 14px; }
  .grid-2 { grid-template-columns: 1fr; }
  .episodes-table { font-size: 12px; }
  .episodes-table th, .episodes-table td { padding: 9px 8px; }
  .roadmap-item { min-width: unset; }
  .soon-card { padding: 44px 20px; }
  .contact-grid-app { grid-template-columns: 1fr; }
}

/* ============================================
   Contact dashboard (sidebar tab)
   ============================================ */
.contact-hero-card-app {
  background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(236,72,153,0.04));
  border: 1px solid var(--border, #e2e8f0);
}
.contact-lead { color: var(--text-soft, #475569); margin: 0 0 18px 0; line-height: 1.6; font-size: 14px; }

.contact-grid-app {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 16px 0 18px 0;
}
.contact-card-app {
  position: relative;
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 14px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.contact-card-app:hover {
  transform: translateY(-2px);
  border-color: var(--icon-color, #6366f1);
  box-shadow: 0 6px 18px rgba(15,23,42,0.06);
}
.contact-icon-app {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  background: var(--icon-bg, #eef2ff);
  color: var(--icon-color, #6366f1);
}
.contact-card-body { flex: 1; min-width: 0; }
.contact-card-body h3 { margin: 0 0 4px 0; font-size: 14px; color: var(--text, #0f172a); }
.contact-card-body p { margin: 0 0 6px 0; font-size: 12px; color: var(--text-soft, #475569); line-height: 1.4; }
.contact-card-body a { font-size: 13px; font-weight: 600; color: var(--accent, #6366f1); text-decoration: none; word-break: break-all; }
.contact-card-body a:hover { text-decoration: underline; }
.contact-mono-app { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 13px; color: var(--text-soft, #475569); }
.contact-badge-app {
  position: absolute; top: 10px; right: 10px;
  background: rgba(16,185,129,0.10); color: #047857;
  padding: 2px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 600;
}
.contact-mini-link { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--text-soft, #475569); }
.contact-mini-link:hover { color: var(--accent, #6366f1); }

.contact-status-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--bg, #f8fafc);
  border: 1px dashed var(--border, #e2e8f0);
  border-radius: 10px;
  font-size: 13px; color: var(--text-soft, #475569);
}
.contact-status-bar b { color: var(--text, #0f172a); margin-right: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-on { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,0.20); }