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

:root {
  --gold: #C9A84C;
  --gold-light: #F0D98A;
  --gold-dim: #7A5C1E;
  --stone: #1A1C23;
  --stone-2: #22252F;
  --stone-3: #2C3040;
  --stone-4: #383D50;
  --stone-5: #454B60;
  --text-primary: #F0EBDC;
  --text-secondary: #C4BEAB;
  --text-muted: #8E8775;
  --text-dim: #6A6558;
  --border: rgba(201,168,76,0.18);
  --border-strong: rgba(201,168,76,0.38);
  --red: #C44B3A;
  --red-bg: rgba(196,75,58,0.12);
  --green: #4A9C6A;
  --green-bg: rgba(74,156,106,0.12);
  --blue: #4A7FC4;
  --blue-bg: rgba(74,127,196,0.12);
}

html, body {
  min-height: 100vh;
  background: var(--stone);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

/* ── BACKGROUND TEXTURE ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(201,168,76,0.03) 39px, rgba(201,168,76,0.03) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(201,168,76,0.03) 39px, rgba(201,168,76,0.03) 40px);
  pointer-events: none;
  z-index: 0;
}

/* ── SCREENS ── */
.screen { position: relative; z-index: 1; }
#lock-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}
#hub-screen { display: none; min-height: 100vh; }

/* ── LOCK SCREEN ── */
.lock-emblem {
  width: 90px; height: 90px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.5rem;
  position: relative;
}
.lock-emblem::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 50%;
}
.lock-emblem svg { width: 36px; height: 36px; }

.lock-knum {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.lock-title {
  font-family: 'Cinzel', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.2;
  margin-bottom: 6px;
}
.lock-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  text-align: center;
}

.lock-form {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lock-form label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: block;
}

.lock-input-wrap { position: relative; }

.lock-input {
  width: 100%;
  background: var(--stone-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  padding: 12px 44px 12px 14px;
  outline: none;
  transition: border-color 0.2s;
  letter-spacing: 0.08em;
}
.lock-input:focus { border-color: var(--gold); }
.lock-input::placeholder { color: var(--text-muted); letter-spacing: 0; }

.eye-btn {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  line-height: 1;
}
.eye-btn:hover { color: var(--text-secondary); }

.lock-btn {
  background: var(--gold);
  border: none;
  border-radius: 8px;
  color: #1A1200;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 13px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 0.15s, transform 0.1s;
  margin-top: 4px;
}
.lock-btn:hover { background: var(--gold-light); }
.lock-btn:active { transform: scale(0.98); }
.lock-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.lock-error {
  display: none;
  background: var(--red-bg);
  border: 1px solid rgba(196,75,58,0.35);
  border-radius: 8px;
  color: #E87A6A;
  font-size: 13px;
  padding: 10px 14px;
  text-align: center;
}
.lock-error.show { display: block; }

/* ── CREATOR CREDIT (highlighted) ── */
.lock-credit {
  width: 100%;
  max-width: 340px;
  margin: 2rem 0 0;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(201,168,76,0.10), rgba(201,168,76,0.04));
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  text-align: center;
  position: relative;
}
.lock-credit::before {
  content: '★';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--stone);
  color: var(--gold);
  font-size: 14px;
  padding: 0 8px;
  line-height: 1;
}
.lock-credit-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: block;
}
.lock-credit-name {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-shadow: 0 0 18px rgba(201,168,76,0.35);
}

.hub-footer-credit {
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* ── HUB LAYOUT ── */
.hub-topbar {
  background: var(--stone-2);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 58px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.hub-crest {
  width: 32px; height: 32px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hub-crest svg { width: 14px; height: 14px; }

.hub-brand {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.hub-brand-name {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  letter-spacing: 0.05em;
}
.hub-brand-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hub-lock-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  padding: 6px 12px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: border-color 0.15s, color 0.15s;
}
.hub-lock-btn:hover { border-color: var(--border-strong); color: var(--text-secondary); }

/* ── SIDEBAR + CONTENT ── */
.hub-body {
  display: flex;
  min-height: calc(100vh - 58px);
}

.hub-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--stone-2);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  overflow-y: auto;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.65;
  padding: 0 1.25rem;
  margin-bottom: 8px;
  margin-top: 1.25rem;
}
.sidebar-section-label:first-child { margin-top: 0; }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 1.25rem;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  user-select: none;
}
.sidebar-item:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}
.sidebar-item.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: rgba(201,168,76,0.07);
}

.sidebar-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}
.sidebar-item.active .sidebar-icon { opacity: 1; }

.sidebar-badge {
  margin-left: auto;
  font-size: 10px;
  background: rgba(201,168,76,0.15);
  color: var(--gold-light);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 99px;
  padding: 2px 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ── CONTENT AREA ── */
.hub-content {
  flex: 1;
  padding: 2rem;
  min-width: 0;
}

.content-panel { display: none; }
.content-panel.active { display: block; }

/* ── PANEL HEADER ── */
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.panel-title-block {}
.panel-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.85;
  margin-bottom: 6px;
}
.panel-title {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.panel-desc {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 8px;
  letter-spacing: 0.02em;
}

/* ── STATUS BADGE ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid;
  white-space: nowrap;
}
.status-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-active {
  color: #6DC98A;
  background: var(--green-bg);
  border-color: rgba(74,156,106,0.3);
}
.status-pending {
  color: #E8B84B;
  background: rgba(232,184,75,0.1);
  border-color: rgba(232,184,75,0.3);
}

/* ── DAY CARDS ── */
.day-grid { display: flex; flex-direction: column; gap: 10px; }

.day-card {
  background: var(--stone-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.day-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 12px rgba(201,168,76,0.08);
}

.day-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
}

.day-num-circle {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
  border: 1.5px solid;
}
.dn-0 { border-color: #5A5650; color: #9A9587; background: rgba(90,86,80,0.2); }
.dn-1 { border-color: #3A6FA0; color: #7AB4E8; background: rgba(58,111,160,0.2); }
.dn-2 { border-color: #3A7A5A; color: #6EC49A; background: rgba(58,122,90,0.2); }
.dn-3 { border-color: #8A6020; color: #E8A840; background: rgba(138,96,32,0.2); }
.dn-4 { border-color: #8A4030; color: #E88A70; background: rgba(138,64,48,0.2); }
.dn-5 { border-color: #5A48A0; color: #9A88E8; background: rgba(90,72,160,0.2); }

.day-card-title-block { flex: 1; }
.day-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.day-card-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--gold-light);
  opacity: 0.78;
  margin-top: 4px;
  letter-spacing: 0.04em;
}
.day-card-chevron {
  color: var(--text-muted);
  transition: transform 0.25s;
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
}
.day-card-chevron.open { transform: rotate(180deg); }

.day-card-body {
  display: none;
  padding: 0 18px 18px;
  border-top: 1px solid var(--border);
}
.day-card-body.open { display: block; padding-top: 16px; }

/* ── CHECKLIST PILLS ── */
.pill-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 16px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.pill {
  font-size: 12px; font-weight: 500;
  padding: 5px 12px;
  border-radius: 99px;
  color: #8FE0AC;
  background: var(--green-bg);
  border: 1px solid rgba(74,156,106,0.35);
  display: flex; align-items: center; gap: 5px;
  letter-spacing: 0.01em;
}
.pill::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ── TIMELINE ── */
.tl { width: 100%; border-collapse: collapse; }
.tl tr + tr td { border-top: 1px solid rgba(201,168,76,0.10); }
.tl-time {
  font-size: 12px; font-weight: 700;
  color: var(--gold-light);
  vertical-align: top;
  padding: 12px 16px 12px 0;
  white-space: nowrap;
  width: 120px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}
.tl-time small {
  display: inline-block;
  margin-top: 3px;
  font-size: 10px !important;
  font-weight: 500 !important;
  color: var(--text-muted) !important;
  opacity: 1 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tl-content {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.65;
  padding: 12px 0;
  vertical-align: top;
}
.tl-warn .tl-time { color: #FF9985; }
.tl-warn .tl-content { color: #FF9985; font-weight: 600; }
.tl-note {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 5px;
  font-weight: 400;
}
.day5-note {
  font-size: 12px;
  color: #7AB4E8;
  background: var(--blue-bg);
  border: 1px solid rgba(74,127,196,0.25);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 14px;
}

/* ── NAP PANEL ── */
.nap-grid { display: flex; flex-direction: column; gap: 12px; }

.nap-card {
  background: var(--stone-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: border-color 0.15s;
}
.nap-card:hover { border-color: var(--border-strong); }

.nap-k-badge {
  width: 44px; height: 44px;
  border-radius: 8px;
  background: var(--stone-3);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 11px; font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
  text-align: center;
  line-height: 1.2;
}

.nap-body { flex: 1; min-width: 0; }
.nap-name {
  font-size: 14px; font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.nap-terms {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.nap-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.nap-date {
  font-size: 11px;
  color: var(--text-muted);
}

.nap-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.nap-empty-icon {
  width: 48px; height: 48px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}
.nap-empty-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.nap-empty-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── COMING SOON ── */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 1rem;
  text-align: center;
}
.cs-icon {
  width: 60px; height: 60px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem;
}
.cs-title {
  font-family: 'Cinzel', serif;
  font-size: 16px; font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.cs-sub {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 280px;
}

/* ── FOOTER ── */
.hub-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 2rem;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  letter-spacing: 0.05em;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--stone-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--stone-5); }

/* ── LANGUAGE SELECTION SCREEN ── */
#lang-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}
#lang-screen.show { display: flex; }

.lang-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 460px;
  margin-top: 2rem;
}

.lang-btn {
  background: var(--stone-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 14px 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}
.lang-btn:hover {
  border-color: var(--gold);
  background: rgba(201,168,76,0.07);
  transform: translateY(-1px);
}
.lang-btn.active {
  border-color: var(--gold);
  background: rgba(201,168,76,0.12);
  color: var(--gold);
}
.lang-btn-native {
  font-size: 15px;
  font-weight: 600;
}
.lang-btn-en {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ── HUB LANGUAGE SWITCHER ── */
.hub-lang-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  padding: 6px 12px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: border-color 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hub-lang-btn:hover { border-color: var(--border-strong); color: var(--text-secondary); }
.hub-lang-btn::before {
  content: '🌐';
  font-size: 12px;
}

/* ── RTL SUPPORT ── */
[dir="rtl"] .sidebar-item { border-left: none; border-right: 2px solid transparent; }
[dir="rtl"] .sidebar-item.active { border-right-color: var(--gold); }
[dir="rtl"] .sidebar-badge { margin-left: 0; margin-right: auto; }
[dir="rtl"] .tl-time { padding: 10px 0 10px 14px; }
[dir="rtl"] .hub-sidebar { border-right: none; border-left: 1px solid var(--border); }
[dir="rtl"] .eye-btn { right: auto; left: 12px; }
[dir="rtl"] .lock-input { padding: 12px 14px 12px 44px; }

/* ── RESPONSIVE ── */
@media (max-width: 680px) {
  .hub-sidebar { display: none; }
  .hub-content { padding: 1.25rem 1rem; }
  .panel-header { flex-direction: column; align-items: flex-start; }
  .lang-grid { grid-template-columns: 1fr; }
}
