:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --navy: #091326;
  --slate: #475569;
  --border: #e2e8f0;
  --cyber: #0284c7;
  --cyber-light: #e0f2fe;
  --violet: #7c3aed;
  --rose: #e11d48;
  --emerald: #059669;
  --radius: 16px;
  --shadow: 0 10px 25px -5px rgba(9, 19, 38, 0.07), 0 4px 10px -3px rgba(9, 19, 38, 0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg);
  color: var(--navy);
  line-height: 1.6;
}
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.topbar {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 3px solid #38bdf8;
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; gap: 16px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.2rem; color: #fff; text-decoration: none;
}
.brand-badge {
  background: #38bdf8; color: var(--navy); padding: 3px 9px; border-radius: 8px; font-weight: 900; font-size: 0.85rem;
}
.nav-links { display: flex; gap: 16px; flex-wrap: wrap; }
.nav-links a { color: #cbd5e1; text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.nav-links a:hover { color: #38bdf8; }

.hero {
  background: linear-gradient(135deg, #091326 0%, #1e1b4b 100%);
  color: #fff; padding: 44px 0 36px; text-align: center;
}
.hero h1 { font-size: clamp(1.7rem, 3.8vw, 2.6rem); font-weight: 900; margin-bottom: 10px; letter-spacing: -0.7px; }
.hero h1 span { color: #38bdf8; }
.hero p { color: #cbd5e1; max-width: 700px; margin: 0 auto 22px; font-size: 1.03rem; }
.tool-pills { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.pill-btn {
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff; padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: 0.9rem; text-decoration: none;
}
.pill-btn:hover, .pill-btn.active { background: #38bdf8; border-color: #38bdf8; color: var(--navy); }

.ad-slot {
  margin: 20px auto; padding: 12px; background: #fff; border: 1px dashed var(--border);
  border-radius: 12px; text-align: center; min-height: 90px; display: flex; align-items: center; justify-content: center;
  color: #94a3b8; font-size: 0.78rem; text-transform: uppercase;
}
.ad-slot[data-empty="true"] { display: none; }

.section { padding: 30px 0; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); margin-bottom: 24px;
}
.card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.card-header h2 { font-size: 1.42rem; font-weight: 800; }
.card-tag {
  background: var(--cyber-light); color: var(--cyber); font-weight: 800;
  font-size: 0.76rem; padding: 5px 12px; border-radius: 999px; text-transform: uppercase;
}

.grid-2 { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 26px; align-items: start; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }

.tabs-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab-btn {
  padding: 9px 15px; border-radius: 10px; border: 2px solid var(--border); background: #fff;
  font-weight: 700; cursor: pointer; color: var(--slate); font-size: 0.9rem;
}
.tab-btn.active { border-color: var(--cyber); background: var(--cyber-light); color: var(--navy); }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 700; font-size: 0.89rem; margin-bottom: 6px; }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type="text"], input[type="number"], input[type="time"], select, textarea {
  width: 100%; padding: 11px 13px; border: 2px solid var(--border); border-radius: 10px;
  font-size: 0.98rem; font-weight: 600; color: var(--navy); font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyber); }

.btn-primary {
  width: 100%; background: var(--cyber); color: #fff; border: none; padding: 13px 18px;
  border-radius: 11px; font-size: 0.98rem; font-weight: 800; cursor: pointer;
}
.btn-primary:hover { background: #0369a1; }
.btn-secondary {
  background: var(--navy); color: #fff; border: none; padding: 11px 16px;
  border-radius: 10px; font-size: 0.9rem; font-weight: 700; cursor: pointer;
}

.qr-preview-box {
  background: var(--surface-alt); border: 2px solid var(--border); border-radius: 14px;
  padding: 22px; text-align: center;
}
#qr-canvas {
  width: 240px; height: 240px; max-width: 100%; border-radius: 12px;
  background: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08); margin-bottom: 14px;
}
.btn-group { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.pwd-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.2rem; font-weight: 800;
  background: #0f172a; color: #38bdf8; padding: 16px; border-radius: 12px; word-break: break-all;
  margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.strength-bar { height: 10px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin: 10px 0; }
.strength-fill { height: 100%; width: 80%; background: var(--emerald); transition: width 0.2s, background 0.2s; }

.pomo-clock {
  font-size: 3.3rem; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums;
  color: var(--navy); margin: 8px 0 14px;
}
.sleep-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.sleep-chip {
  background: #ecfdf5; border: 2px solid #10b981; color: #065f46;
  padding: 10px 14px; border-radius: 10px; font-weight: 800; font-size: 1.02rem;
}

.affiliate-box {
  margin-top: 16px; padding: 14px 16px; background: linear-gradient(90deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #93c5fd; border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.affiliate-box p { font-size: 0.89rem; font-weight: 600; color: #1e3a8a; flex: 1; min-width: 190px; }
.affiliate-btn {
  background: var(--navy); color: #38bdf8; padding: 9px 15px; border-radius: 9px;
  font-weight: 800; font-size: 0.85rem; text-decoration: none; white-space: nowrap;
}

.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.post-card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.post-meta { font-size: 0.76rem; font-weight: 700; color: var(--cyber); text-transform: uppercase; margin-bottom: 6px; }
.post-card h3 { font-size: 1.06rem; margin-bottom: 8px; }
.post-card p { color: var(--slate); font-size: 0.9rem; margin-bottom: 14px; }
.post-link { font-weight: 800; color: var(--navy); text-decoration: none; font-size: 0.89rem; }
.post-link:hover { color: var(--cyber); }

.seo-guide h2 { font-size: 1.32rem; margin: 22px 0 10px; color: var(--navy); }
.seo-guide h3 { font-size: 1.15rem; margin: 16px 0 8px; }
.seo-guide p { color: var(--slate); margin-bottom: 12px; font-size: 0.97rem; }

footer { background: var(--navy); color: #94a3b8; padding: 34px 0; margin-top: 36px; font-size: 0.88rem; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.footer-links button, .footer-links a { background: none; border: none; color: #cbd5e1; cursor: pointer; font-size: 0.88rem; text-decoration: underline; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(9, 19, 38, 0.72);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal-box { background: #fff; max-width: 660px; width: 100%; max-height: 82vh; overflow-y: auto; border-radius: 16px; padding: 26px; }
.modal-box p { color: var(--slate); font-size: 0.92rem; margin-bottom: 12px; }
.close-modal { margin-top: 14px; background: var(--navy); color: #fff; border: none; padding: 9px 16px; border-radius: 8px; cursor: pointer; font-weight: 700; }
