:root {
  --gold: #F4C95D;
  --black: #000;
  --bg: #F5F5F5;
  --card: #FFF;
  --red: #E63946;
  --muted: #8a8a8a;
  --r-big: 20px;
  --r-sm: 8px;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg);
  color: #111;
  min-height: 100vh;
  line-height: 1.45;
}

#app { display: flex; justify-content: center; padding: 18px 10px 40px; }

.phone {
  background: var(--card);
  border: 1px solid #ddd;
  border-radius: 28px;
  width: 100%;
  max-width: 430px;
  min-height: 640px;
  padding: 18px 18px 28px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

/* ---------- Topbar ---------- */
.topbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.tb-title { flex: 1; text-align: center; }
.tb-main { font-weight: 700; font-size: 1.05rem; }
.tb-sub { color: #444; font-size: 0.95rem; }
.tb-btn {
  background: none; border: none; font-size: 1.05rem; cursor: pointer;
  width: 38px; height: 38px; border-radius: 8px; flex: none;
}
.tb-btn:hover { background: #f0f0f0; }
.burger span { display: block; width: 22px; height: 3.5px; background: #000; margin: 3.5px auto; border-radius: 2px; }

/* ---------- Side panels ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.25); opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 40; }
.overlay.show { opacity: 1; pointer-events: auto; }
.panel {
  position: fixed; top: 0; bottom: 0; width: 260px; background: var(--card);
  z-index: 50; padding: 22px 20px; overflow-y: auto; transition: transform 0.25s;
  box-shadow: 0 0 30px rgba(0,0,0,0.15);
}
.panel-left { left: 0; transform: translateX(-105%); border-radius: 0 20px 20px 0; }
.panel-right { right: 0; transform: translateX(105%); border-radius: 20px 0 0 20px; }
.panel.open { transform: translateX(0); }
.panel h3 { font-weight: 500; font-size: 1.3rem; margin-bottom: 10px; }
.signs-list { list-style: none; }
.signs-list li { padding: 9px 6px; border-bottom: 1px solid #000; cursor: pointer; font-size: 1.15rem; }
.signs-list li:hover { background: #faf3e0; }
.signs-list li.active { background: var(--gold); border-radius: 6px; font-weight: 700; }
.menu-auth { text-align: center; font-size: 0.95rem; margin-bottom: 6px; }
.menu-auth a { color: #111; }
.menu-sub { text-align: center; font-size: 0.9rem; display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; }
.menu-sub a { color: #333; text-decoration: none; }
.menu-nav { display: flex; flex-direction: column; }
.menu-nav a { padding: 11px 4px; border-bottom: 1px solid #000; color: #111; text-decoration: none; font-size: 1.2rem; }
.menu-nav a:hover { background: #faf3e0; }
.menu-nav .admin-link { color: var(--red); font-weight: 600; }

/* ---------- Landing ---------- */
.landing { padding-top: 34px; }
.landing-title { text-align: center; font-size: 1.9rem; font-weight: 800; margin-bottom: 16px; }
.landing-text { color: #333; text-align: justify; margin-bottom: 20px; }
.lbl { display: block; color: var(--muted); font-weight: 600; margin: 12px 0 8px; }
.dob-row { display: flex; gap: 10px; }
.dob-row input {
  width: 72px; font-size: 1.6rem; text-align: center; padding: 10px 4px;
  border: 2px solid #000; border-radius: var(--r-sm);
}
.dob-row input.wide { width: 120px; }
.report-date input { border-color: var(--gold); border-width: 3px; }
.divider { border: none; border-top: 1px solid #bbb; margin: 16px 0; }
.row2 { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
select {
  font-size: 1.1rem; padding: 9px 12px; border: 2px solid #000;
  border-radius: var(--r-sm); background: #fff; min-width: 150px;
}
.gender-col { display: flex; flex-direction: column; gap: 8px; }
.radio { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.radio input { width: 20px; height: 20px; accent-color: #000; }
.chk { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.chk input, .chk-row input { width: 20px; height: 20px; accent-color: #000; }
.save-row { margin-bottom: 8px; }
.muted { color: var(--muted); }
.center { text-align: center; }

.btn-black {
  background: #000; color: #fff; border: none; border-radius: var(--r-sm);
  font-size: 1.25rem; padding: 12px 30px; cursor: pointer;
}
.btn-black:hover { background: #222; }
.btn-black.big { display: block; margin: 22px auto 0; min-width: 200px; }
.btn-outline {
  display: block; margin: 14px auto; background: #fff; border: 1.5px solid #000;
  border-radius: var(--r-sm); font-size: 1.1rem; padding: 8px 34px; cursor: pointer;
}

/* ---------- Today ---------- */
.today-wrap { position: relative; }
.golden-card {
  position: relative; overflow: hidden;
  background: var(--gold) center/cover no-repeat; border-radius: var(--r-big);
  min-height: 420px; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; padding: 24px;
}
.gc-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
.golden-card .gc-name { position: relative; z-index: 1; }
.day-row { display: flex; align-items: flex-start; gap: 14px; margin-top: 14px; }
.day-row-icon { flex: none; line-height: 0; }
.day-row .day-desc { flex: 1; margin-top: 4px; }
.gc-name { font-size: 1.7rem; font-weight: 800; letter-spacing: 0.5px; text-align: center; background: rgba(244,201,93,0.85); border-radius: 8px; padding: 2px 10px; }
.nav-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: #fff; border: 2px solid #3cb54a; color: #000; width: 40px; height: 40px;
  border-radius: 50%; font-size: 1rem; cursor: pointer; z-index: 5;
}
.nav-arrow.left { left: -8px; }
.nav-arrow.right { right: -8px; }
.day-sub { text-align: center; margin-top: 10px; font-size: 0.92rem; }
.day-desc { margin-top: 8px; text-align: justify; }
.offline { font-size: 0.8rem; text-align: center; margin-top: 6px; }

/* ---------- Facts ---------- */
.facts-title { text-align: center; font-size: 1.4rem; font-weight: 800; margin-bottom: 10px; }
.fact-user { color: var(--red); font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; gap: 8px; }
.fact-time { color: var(--muted); font-weight: 400; font-size: 0.78rem; }
.fact-del { background: none; border: none; color: var(--red); font-size: 1rem; cursor: pointer; }
.fact-advice { font-weight: 600; margin: 4px 0 2px; }
.fact-text { margin: 4px 0 10px; text-align: justify; }
.rp-label { display: block; font-weight: 700; margin-bottom: 6px; }
.rp-field { width: 100%; border: none; background: transparent; font-family: inherit; font-size: 1rem; resize: vertical; outline: none; }
.rp-count { text-align: right; font-size: 0.78rem; color: var(--muted); margin-top: 4px; }
.fact-divider { border: none; border-top: 1px solid #ccc; margin: 8px 0; }
.fact-input {
  width: 100%; border: 2px solid var(--gold); border-radius: var(--r-big);
  padding: 12px 14px; font-size: 1rem; font-family: inherit; margin-top: 16px; resize: vertical;
}

/* ---------- Week ---------- */
.scroll-arrow { display: block; margin: 4px auto; background: none; border: none; font-size: 1.1rem; cursor: pointer; }
.week-card { border: 3px solid var(--gold); border-radius: var(--r-big); padding: 10px 16px; }
.week-row { display: flex; align-items: center; gap: 12px; padding: 9px 2px; cursor: pointer; border-radius: 8px; }
.week-row:hover { background: #faf3e0; }
.wr-date { font-weight: 800; font-size: 0.85rem; width: 44px; }
.wr-day { flex: 1; font-size: 1.15rem; }
.wr-sel { color: #2f6fd6; font-weight: 700; font-size: 0.85rem; }
.wr-hex { line-height: 0; }
.sel-card {
  display: flex; align-items: center; gap: 14px; border: 1px solid #000;
  border-radius: 10px; padding: 8px 14px; margin-top: 10px;
}
.sel-card b { font-size: 1.1rem; flex: 1; }
.desc-card { border: 1px solid #000; border-radius: 10px; padding: 12px 14px; margin-top: 10px; text-align: justify; }

/* ---------- Month ---------- */
.month-card { border: 3px solid var(--gold); border-radius: var(--r-big); padding: 16px 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px 2px; text-align: center; }
.cal-h { font-weight: 800; }
.cal-d { font-weight: 700; font-size: 1.15rem; padding: 6px 0; border-radius: 50%; cursor: pointer; }
.cal-d:hover { background: #faf3e0; }
.cal-d.today { outline: 2px dashed var(--gold); }
.cal-d.sel { background: var(--gold); }

/* ---------- Report ---------- */
.report-head { display: flex; align-items: center; gap: 16px; margin: 18px 0 6px; }
.report-head.center { flex-direction: column; gap: 8px; justify-content: center; }
.rh-name { font-size: 1.35rem; font-weight: 800; }
.frame-card { border: 3px solid var(--gold); border-radius: var(--r-big); padding: 14px 16px; margin-top: 14px; }
.frame-card b { display: block; margin-bottom: 6px; }
.frame-card .pre { white-space: pre-wrap; }
.frame-plain { border: 1.5px solid #000; border-radius: 10px; padding: 14px 16px; margin-top: 16px; }

/* ---------- Settings ---------- */
.text-input {
  width: 100%; font-size: 1.05rem; padding: 11px 14px; border: 2px solid #000;
  border-radius: var(--r-sm); margin-top: 4px;
}
.chk-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 1.02rem; }
.chk-row.small { font-size: 0.9rem; margin: 8px 0; }
.time-row { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; padding: 6px 0; }
.time-row input { width: 58px; font-size: 1.3rem; text-align: center; padding: 7px 2px; border: 2px solid #000; border-radius: var(--r-sm); }
.sub-row { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 8px; }
.price-box { border: 2px solid #000; border-radius: var(--r-sm); padding: 6px 12px; font-weight: 800; text-align: center; font-size: 0.85rem; }
.footer-links { display: flex; justify-content: space-around; margin-top: 22px; }
.footer-links a { color: #333; text-decoration: none; }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: #fff; border-radius: var(--r-big); padding: 26px 24px; width: 100%;
  max-width: 360px; position: relative;
}
.modal h3 { text-align: center; margin-bottom: 14px; font-size: 1.3rem; }
.modal .text-input { margin-bottom: 10px; }
.modal-x { position: absolute; top: 10px; right: 14px; background: none; border: none; font-size: 1.6rem; cursor: pointer; }
.modal-links { text-align: center; margin-top: 12px; }
.modal-links a { color: #2f6fd6; }
.modal-err { color: var(--red); text-align: center; margin-top: 8px; min-height: 1.2em; }

@media (max-width: 480px) {
  .phone { border-radius: 18px; padding: 14px 12px 22px; }
  .nav-arrow.left { left: -4px; }
  .nav-arrow.right { right: -4px; }
  .dob-row input { width: 64px; font-size: 1.35rem; }
  .dob-row input.wide { width: 100px; }
}
