/* ============================================================
   jaykau console — Design System v3
   Font: Inter | Style: OLED Dark + Glassmorphism
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700&display=swap');

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

:root {
  /* ── Backgrounds (OLED dark) ── */
  --bg:            #050508;
  --bg-elevated:   #08080e;
  --bg-card:       #0c0c15;
  --surface:       #101018;
  --surface-muted: #14141e;
  --surface-hover: #181826;

  /* ── Borders ── */
  --border:        rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --border-glow:   rgba(139, 92, 246, 0.45);

  /* ── Primary – violet ── */
  --primary:       #8b5cf6;
  --primary-soft:  rgba(139, 92, 246, 0.12);
  --primary-dark:  #7c3aed;
  --primary-light: #a78bfa;
  --primary-glow:  rgba(139, 92, 246, 0.35);

  /* ── Secondary – cyan ── */
  --accent:        #06b6d4;
  --accent-soft:   rgba(6, 182, 212, 0.12);
  --accent-dark:   #0891b2;
  --accent-glow:   rgba(6, 182, 212, 0.3);

  /* ── Text ── */
  --text:          #edf2f7;
  --text-soft:     #7d8a9c;
  --text-muted:    #4a5568;
  --text-dim:      #2d3748;

  /* ── Status ── */
  --danger:        #ef4444;
  --danger-soft:   rgba(239, 68, 68, 0.12);
  --success:       #10b981;
  --success-soft:  rgba(16, 185, 129, 0.12);
  --warning:       #f59e0b;
  --warning-soft:  rgba(245, 158, 11, 0.12);

  /* ── Shadows ── */
  --shadow-soft:   0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-card:   0 1px 8px rgba(0, 0, 0, 0.4);
  --shadow-glow:   0 0 0 1px var(--border-glow), 0 8px 32px rgba(139, 92, 246, 0.12);

  /* ── Radii ── */
  --radius-xl:     16px;
  --radius-lg:     12px;
  --radius-md:     8px;
  --radius-sm:     6px;
  --radius-xs:     4px;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 15% 40%, rgba(139, 92, 246, 0.05) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 15%, rgba(6, 182, 212, 0.03) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ══════════════════════════════════════════
   SITE HEADER
══════════════════════════════════════════ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 60px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(5, 5, 8, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #a78bfa 100%);
  box-shadow: 0 0 18px var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.site-logo-text {
  display: flex;
  flex-direction: column;
}

.site-logo-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.1;
}

.site-logo-sub {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 2px;
}

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

/* ── Pill badge ── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-soft);
  letter-spacing: 0.01em;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 7px var(--accent-glow);
  flex-shrink: 0;
}

/* ── Nav buttons ── */
.nav-button,
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.nav-button:hover,
.nav-link:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

.nav-button--primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 12px var(--primary-glow);
}

.nav-button--primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  box-shadow: 0 4px 20px var(--primary-glow);
  color: #fff;
}

/* ══════════════════════════════════════════
   PAGE SHELLS
══════════════════════════════════════════ */

.page-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px 64px;
}

.page-shell > section + section {
  margin-top: 24px;
}

/* ── Hero typography ── */
.page-hero-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}

.page-hero-title {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1.1;
}

.page-hero-title span {
  color: var(--primary);
}

.page-hero-subtitle {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-soft);
  max-width: 560px;
  line-height: 1.7;
}

.page-hero-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ══════════════════════════════════════════
   GRID LAYOUTS
══════════════════════════════════════════ */

.grid-2 {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

/* ══════════════════════════════════════════
   CARDS
══════════════════════════════════════════ */

.card-slab {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  padding: 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card-slab:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
}

.card-slab--soft {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-muted) 100%);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-title-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.card-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.5;
}

/* ── Tags ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 999px;
  padding: 3px 9px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  background: var(--primary-soft);
  color: var(--primary-light);
  white-space: nowrap;
  flex-shrink: 0;
}

.tag--success {
  border-color: rgba(16, 185, 129, 0.3);
  background: var(--success-soft);
  color: var(--success);
}

/* ── Metric ── */
.metric {
  font-size: 13px;
  color: var(--text-soft);
}

.metric span {
  font-weight: 600;
  color: var(--accent);
}

/* ══════════════════════════════════════════
   FORM CONTROLS
══════════════════════════════════════════ */

.label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input,
.textarea {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 10px 13px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-dim);
}

.input:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.input-error,
.input--error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px var(--danger-soft) !important;
}

.input-success {
  border-color: var(--success) !important;
  box-shadow: 0 0 0 3px var(--success-soft) !important;
}

.helper-text {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════
   STATUS
══════════════════════════════════════════ */

.status-banner {
  margin-top: 12px;
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-banner--success {
  background: var(--success-soft);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--success);
}

.status-banner--error {
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--danger);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot--success {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.status-dot--error {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

.status-msg {
  display: none;
  font-size: 11px;
}

.status-msg.visible {
  display: block;
}

.status-msg.success {
  color: var(--success);
}

.status-msg.error {
  color: var(--danger);
}

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  border-radius: var(--radius-md);
  border: none;
  padding: 11px 18px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 2px 16px var(--primary-glow);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  margin-top: 14px;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  box-shadow: 0 4px 24px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 0 12px var(--primary-glow);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  box-shadow: 0 2px 16px rgba(16, 185, 129, 0.35);
}

.btn-primary.btn-error {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  box-shadow: 0 2px 16px rgba(239, 68, 68, 0.35);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  padding: 7px 14px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-soft);
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.btn-ghost:hover {
  border-style: solid;
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-light);
}

/* ══════════════════════════════════════════
   AUTH / LOGIN
══════════════════════════════════════════ */

.auth-shell {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-grid {
  width: 100%;
  max-width: 940px;
  display: grid;
  grid-template-columns: 1.6fr 1.2fr;
  gap: 52px;
  align-items: center;
}

.auth-hero-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.1;
}

.auth-hero-title span {
  color: var(--primary);
}

.auth-hero-copy {
  font-size: 14px;
  color: var(--text-soft);
  max-width: 400px;
  line-height: 1.7;
}

.auth-meta {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.auth-card:hover {
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: var(--shadow-glow);
}

.auth-card-header {
  margin-bottom: 20px;
}

.auth-card-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 5px;
}

.auth-card-subtitle {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.6;
}

.auth-status {
  margin-top: 10px;
  min-height: 18px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════
   REVEAL CARDS
══════════════════════════════════════════ */

.reveal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

a.reveal-card {
  text-decoration: none;
  display: block;
}

.reveal-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  padding: 20px;
  overflow: hidden;
  cursor: pointer;
  outline: none;
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.07) 0%, rgba(6, 182, 212, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.reveal-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
  border-color: rgba(139, 92, 246, 0.35);
}

.reveal-card:hover::before {
  opacity: 1;
}

.reveal-card:focus-visible {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow), 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.reveal-card:focus-visible .reveal-card__back {
  opacity: 1;
  transform: translateY(0);
}

.reveal-card:focus-visible::before {
  opacity: 1;
}

.reveal-hint {
  margin-bottom: 4px;
}

/* ── Front face ── */
.reveal-card__front {
  position: relative;
  z-index: 2;
  transition: opacity 0.18s ease;
}

.reveal-card:hover .reveal-card__front,
.reveal-card:focus-visible .reveal-card__front {
  opacity: 0;
}

/* ── Back face ── */
.reveal-card__back {
  position: absolute;
  inset: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 3;
  background: var(--surface);
  border-radius: var(--radius-lg);
}

.reveal-card:hover .reveal-card__back,
.reveal-card:focus-visible .reveal-card__back {
  opacity: 1;
  transform: translateY(0);
}

/* ── Icon container ── */
.reveal-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.reveal-card__icon svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.reveal-card__icon--primary {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.08));
  color: var(--primary-light);
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.15);
}

.reveal-card__icon--accent {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(6, 182, 212, 0.08));
  color: #22d3ee;
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.15);
}

.reveal-card__icon--warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.08));
  color: #fbbf24;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.12);
}

.reveal-card__icon--purple {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.08));
  color: #c084fc;
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.15);
}

.reveal-card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.reveal-card__subtitle {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.5;
}

.reveal-card__content {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.7;
}

.reveal-card__content strong {
  color: var(--text);
  font-weight: 600;
}

.reveal-card__stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--surface-muted);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  margin-top: 10px;
}

.reveal-card__stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 7px var(--accent);
  flex-shrink: 0;
}

.reveal-card__stat-dot--pulse {
  animation: pulse 2.2s ease-in-out infinite;
}

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

/* ══════════════════════════════════════════
   LINK ITEMS
══════════════════════════════════════════ */

.link-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.link-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.link-icon svg {
  width: 14px;
  height: 14px;
}

.link-item:hover .link-icon {
  color: var(--text-soft);
}

.link-arrow {
  margin-left: auto;
  opacity: 0;
  color: var(--text-muted);
  font-size: 12px;
  transform: translateX(-3px);
  transition: opacity 0.12s, transform 0.12s;
}

.link-item:hover .link-arrow {
  opacity: 0.7;
  transform: translateX(0);
}

/* ── Icon in list items (inline SVG icons) ── */
.list-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.list-icon svg {
  width: 14px;
  height: 14px;
}

/* ══════════════════════════════════════════
   RSS FEED
══════════════════════════════════════════ */

.rss-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.rss-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  text-decoration: none;
  font-size: 12px;
  transition: background 0.12s, color 0.12s;
}

.rss-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.rss-source {
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.rss-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}

.rss-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rss-age {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.rss-loading {
  padding: 18px 10px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

.rss-loading .dots span {
  animation: blink 1.4s infinite both;
}

.rss-loading .dots span:nth-child(2) { animation-delay: 0.2s; }
.rss-loading .dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0; }
  40% { opacity: 1; }
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */

@media (max-width: 900px) {
  .site-header {
    padding: 0 16px;
  }

  .page-shell {
    padding: 24px 16px 48px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .auth-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* ══════════════════════════════════════════
   ACCESSIBILITY
══════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .reveal-card,
  .reveal-card__back,
  .reveal-card::before {
    transition: none;
  }

  .reveal-card__stat-dot--pulse {
    animation: none;
    opacity: 1;
  }

  .rss-loading .dots span {
    animation: none;
    opacity: 1;
  }
}

/* ══════════════════════════════════════════
   NOTES
══════════════════════════════════════════ */

.notes-pane {
  display: flex;
  height: 300px;
  border-top: 1px solid var(--border);
  overflow: hidden;
  background: transparent;
  margin: 0 -20px -20px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.notes-sidebar {
  width: 180px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface-muted);
  display: flex;
  flex-direction: column;
  border-radius: 0 0 0 var(--radius-lg);
}

.notes-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.notes-list::-webkit-scrollbar { width: 3px; }
.notes-list::-webkit-scrollbar-track { background: transparent; }
.notes-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

.notes-item {
  padding: 10px 14px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}

.notes-item + .notes-item::before {
  content: '';
  position: absolute;
  top: 0; left: 14px; right: 14px;
  height: 1px;
  background: var(--border);
}

.notes-item:hover { background: var(--surface-hover); }

.notes-item.active {
  background: var(--primary-soft);
  border-left-color: var(--primary);
}

.notes-item-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
  transition: color 0.15s;
}

.notes-item:hover .notes-item-title { color: var(--text); }
.notes-item.active .notes-item-title { color: var(--primary-light); }

.notes-item-preview {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.notes-item.active .notes-item-preview {
  color: rgba(167, 139, 250, 0.55);
}

.notes-item-date {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
  letter-spacing: 0.01em;
}

.notes-item.active .notes-item-date {
  color: rgba(167, 139, 250, 0.4);
}

.notes-editor {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background: transparent;
}

.notes-title-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 14px 16px 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  outline: none;
  flex-shrink: 0;
  letter-spacing: -0.01em;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.notes-title-input::placeholder { color: var(--text-dim); }

.notes-title-input:focus {
  border-bottom-color: var(--primary);
  box-shadow: 0 1px 0 var(--primary);
  background: rgba(139, 92, 246, 0.02);
}

.notes-body-input {
  flex: 1;
  width: 100%;
  border: none;
  background: transparent;
  padding: 12px 16px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-soft);
  outline: none;
  resize: none;
  line-height: 1.7;
  transition: color 0.15s;
}

.notes-body-input:focus { color: var(--text); }
.notes-body-input::placeholder { color: var(--text-dim); }

.notes-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px 6px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  gap: 8px;
}

.notes-save-status {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.notes-save-status::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
  opacity: 0;
  transition: background 0.2s, opacity 0.2s;
}

.notes-save-status.saved::before {
  background: var(--success);
  opacity: 1;
}

.notes-save-status.saving::before {
  background: var(--warning);
  opacity: 1;
}

.notes-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-family: inherit;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.notes-delete-btn:hover {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.2);
}

.notes-empty-state {
  flex: 1;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  padding: 20px;
}

.notes-empty-state svg {
  opacity: 0.4;
  margin-bottom: 2px;
}

/* Touch: always show back content */
@media (hover: none) {
  .reveal-card {
    cursor: default;
  }

  .reveal-card__back {
    position: relative;
    opacity: 1;
    transform: none;
    padding: 14px 0 0;
    border-radius: 0;
    background: transparent;
    z-index: 2;
  }

  .reveal-card:hover {
    transform: none;
    box-shadow: var(--shadow-card);
    border-color: var(--border);
  }

  .reveal-card:hover::before {
    opacity: 0;
  }

  .reveal-card__front {
    margin-bottom: 4px;
  }
}

/* ══════════════════════════════════════════
   CALENDAR
══════════════════════════════════════════ */

/* Header row */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cal-month-label {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  min-width: 160px;
  text-align: center;
}

.cal-nav-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cal-nav-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

.cal-today-btn {
  background: var(--primary-soft);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-sm);
  color: var(--primary-light);
  font-size: 12px;
  font-weight: 500;
  padding: 0 12px;
  height: 30px;
  cursor: pointer;
  transition: background 0.15s;
}
.cal-today-btn:hover {
  background: rgba(139, 92, 246, 0.2);
}

/* Weekday labels */
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.cal-weekdays > div {
  padding: 6px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Grid */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-cell {
  min-height: 76px;
  padding: 6px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-cell:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}
.cal-cell--empty {
  cursor: default;
  pointer-events: none;
}
.cal-cell--today .cal-cell-num {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-cell-num {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-cell-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
}

.cal-event-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-cell-more {
  font-size: 10px;
  color: var(--text-muted);
}
.cal-cell--selected {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  border-color: var(--primary);
}
.cal-cell--selected .cal-cell-num {
  color: var(--primary);
  font-weight: 700;
}
.cal-cell--in-range {
  background: color-mix(in srgb, var(--primary) 9%, transparent);
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}

/* Color variants */
.cal-event-dot--violet, .cal-list-dot.cal-event-dot--violet { background: var(--primary); }
.cal-event-dot--cyan,   .cal-list-dot.cal-event-dot--cyan   { background: var(--accent); }
.cal-event-dot--green,  .cal-list-dot.cal-event-dot--green  { background: var(--success); }
.cal-event-dot--amber,  .cal-list-dot.cal-event-dot--amber  { background: var(--warning); }
.cal-event-dot--rose,   .cal-list-dot.cal-event-dot--rose   { background: var(--danger); }
.cal-event-dot--blue,   .cal-list-dot.cal-event-dot--blue   { background: #3b82f6; }

/* Event list */
.cal-event-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cal-list-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.cal-list-item:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}

.cal-list-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.cal-list-body {
  flex: 1;
  min-width: 0;
}

.cal-list-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.cal-list-meta {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 2px;
}

.cal-list-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-list-edit {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.cal-list-item:hover .cal-list-edit {
  opacity: 1;
}
.cal-list-edit:hover {
  color: var(--primary-light);
}

/* Modal */
.cal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cal-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft), var(--shadow-glow);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}

.cal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.cal-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.cal-modal-close {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cal-modal-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* Form */
.cal-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.cal-form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 0;
}
.cal-form-row .cal-form-group {
  margin-bottom: 14px;
}

.cal-form-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cal-form-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 8px 10px;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
}
.cal-form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface-hover);
}
.cal-form-input::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
}

.cal-form-textarea {
  resize: vertical;
  min-height: 72px;
}

/* Color picker */
.cal-color-picker {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 6px 0;
}

.cal-color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.cal-color-swatch:hover  { transform: scale(1.2); }
.cal-color-swatch.active { border-color: #fff; transform: scale(1.15); }

.cal-color-swatch--violet { background: var(--primary); }
.cal-color-swatch--cyan   { background: var(--accent); }
.cal-color-swatch--green  { background: var(--success); }
.cal-color-swatch--amber  { background: var(--warning); }
.cal-color-swatch--rose   { background: var(--danger); }
.cal-color-swatch--blue   { background: #3b82f6; }

/* Form actions */
.cal-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  gap: 8px;
}

.cal-delete-btn {
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 12px;
  font-weight: 500;
  padding: 0 12px;
  height: 32px;
  cursor: pointer;
  transition: background 0.15s;
}
.cal-delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

.cal-form-error {
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 12px;
}

/* Responsive */
@media (max-width: 540px) {
  .cal-cell {
    min-height: 52px;
    padding: 4px 4px;
  }
  .cal-month-label {
    min-width: 130px;
    font-size: 15px;
  }
  .cal-form-row {
    flex-direction: column;
    gap: 0;
  }
}
