/* DenzaPlay Life — shared design tokens + components. Mobile-first. */
@font-face {
  font-family: 'Outfit';
  src: url('/fonts/Outfit.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --indigo: #1F2A5C;
  --night: #141B3C;
  --kunyit: #E8862A;
  --merah: #B3322A;
  --jade: #3E8C6A;
  --peri: #5C6FB0;
  --accent: #E8862A;
  --bg: #F7F5EF;
  --surface: #FFFFFF;
  --surface2: #EDEAE0;
  --ink: #1F2A5C;
  --muted: #5C6FB0;
  --danger: #B3322A;
  --radius: 14px;
  --kawung: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%235C6FB0' stroke-width='2' opacity='0.10'%3E%3Cellipse cx='48' cy='26' rx='14' ry='20'/%3E%3Cellipse cx='48' cy='70' rx='14' ry='20'/%3E%3Cellipse cx='26' cy='48' rx='20' ry='14'/%3E%3Cellipse cx='70' cy='48' rx='20' ry='14'/%3E%3C/g%3E%3C/svg%3E");
}
[data-theme="dark"] {
  --bg: #141B3C;
  --surface: #1C2450;
  --surface2: #232C5B;
  --ink: #FFFFFF;
  --muted: #9AA6D6;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  background-image: var(--kawung);
  color: var(--ink);
  min-height: 100vh;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px 96px; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--indigo); color: #fff;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
}
.topbar h1 { font-size: 1.1rem; margin: 0; flex: 1; font-weight: 700; }
.topbar a.back { color: #fff; text-decoration: none; font-size: 1.3rem; line-height: 1; }
.iconbtn {
  background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 10px;
  padding: 6px 10px; font-size: .85rem; cursor: pointer; font-family: inherit;
}
.card {
  background: var(--surface); border-radius: var(--radius);
  padding: 16px; margin: 12px 0;
  box-shadow: 0 1px 4px rgba(20,27,60,.10);
}
.card h2, .card h3 { margin: 0 0 8px; }
.sec { color: var(--accent); font-weight: 700; margin: 18px 0 6px; font-size: .95rem; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; }
.muted { color: var(--muted); font-size: .9rem; }
.btn {
  display: inline-block; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 700; font-family: inherit;
  padding: 12px 18px; font-size: 1rem; text-align: center;
}
.btn.block { display: block; width: 100%; }
.btn.ghost { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.btn.dark { background: var(--indigo); }
.btn.danger { background: transparent; color: var(--danger); border: 0; padding: 8px; }
input, select, textarea {
  font-family: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 2px solid var(--surface2); border-radius: 10px;
  padding: 10px 12px; width: 100%;
}
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { background: var(--surface2); }
label.f { display: block; margin: 8px 0 4px; font-weight: 600; font-size: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chip {
  border: 2px solid var(--surface2); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 8px 14px; cursor: pointer; font-family: inherit; font-size: .92rem;
}
.chip.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); font-weight: 700; }
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  background: var(--surface); border-top: 1px solid var(--surface2);
  display: flex; max-width: 640px; margin: 0 auto;
}
.tabbar button {
  flex: 1; background: none; border: 0; cursor: pointer; font-family: inherit;
  color: var(--muted); padding: 10px 4px 14px; font-size: .72rem;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tabbar button.on { color: var(--accent); font-weight: 700; }
.tabbar button .ic { font-size: 1.3rem; }
.kv { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--surface2); }
.dot { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
table.grid { border-collapse: collapse; width: 100%; }
table.grid td, table.grid th { text-align: center; padding: 6px 2px; font-size: .85rem; }
.day {
  width: 38px; height: 38px; border-radius: 10px; display: inline-flex;
  align-items: center; justify-content: center; cursor: pointer; font-weight: 600;
  background: var(--surface2);
}
.day.haid { background: var(--merah); color: #fff; }
.day.subur { background: var(--jade); color: #fff; }
.day.guess { background: color-mix(in srgb, var(--merah) 35%, var(--surface2)); }
.day.today { outline: 3px solid var(--accent); }
.px { width: 16px; height: 16px; border-radius: 4px; background: var(--surface2); }
#toasts { position: fixed; bottom: 84px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 50; pointer-events: none; }
.toast { background: var(--night); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: .9rem; }
.hubgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .hubgrid { grid-template-columns: 1fr 1fr; } }
.appcard {
  background: var(--surface); border-radius: var(--radius); padding: 14px;
  text-decoration: none; color: var(--ink); display: block;
  border-top: 6px solid var(--accent);
  box-shadow: 0 1px 4px rgba(20,27,60,.10);
}
.appcard b { display: block; font-size: 1rem; }
.appcard span { font-size: .8rem; color: var(--muted); }
.hero { text-align: center; padding: 28px 12px 8px; }
.hero .logo {
  width: 76px; height: 76px; margin: 0 auto 10px; border-radius: 22px;
  background: var(--indigo);
  background-image: var(--kawung);
  display: flex; align-items: center; justify-content: center;
  color: var(--kunyit); font-size: 2rem; font-weight: 800;
}
.badge {
  display: inline-block; background: var(--jade); color: #fff; font-weight: 700;
  border-radius: 999px; padding: 6px 14px; margin: 8px 0; font-size: .85rem;
}
canvas.chart { width: 100%; height: 170px; }
.ringwrap { display: flex; justify-content: center; padding: 8px 0; }
input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); }
details.help { margin: 12px 0; font-size: .9rem; }
details.help summary { cursor: pointer; font-weight: 700; }
img.scan { width: 100%; border-radius: 10px; }
video.cam { width: 100%; border-radius: 12px; background: #000; }
/* Designer assets: pattern tiles, hero art, onboarding */
body {
  background-image: url('/art/shared/pattern_tile_light.png');
  background-size: 120px;
}
[data-theme="dark"] body {
  background-image: url('/art/shared/pattern_tile_dark.png');
}
.heroimg { width: 170px; max-height: 150px; object-fit: contain; display: block; margin: 6px auto; }
.ob-overlay {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  background-image: url('/art/shared/pattern_tile_light.png'); background-size: 120px;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
[data-theme="dark"] .ob-overlay { background-image: url('/art/shared/pattern_tile_dark.png'); }
.ob-card { max-width: 380px; width: 100%; text-align: center; background: var(--surface); border-radius: 18px; padding: 28px 22px; }
.ob-card img { width: 200px; max-height: 170px; object-fit: contain; }
.ob-card h2 { margin: 12px 0 6px; }
.ob-dots { margin: 10px 0 16px; }
.ob-dots span { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--surface2); margin: 0 4px; }
.ob-dots span.on { background: var(--accent); }
/* Hub with real icons + splash styling */
.hero.splash {
  background-image: linear-gradient(rgba(247,245,239,.88), rgba(247,245,239,.94)), url('/art/shared/splash_1080x1920.svg');
  background-size: cover; background-position: center top;
  border-radius: 18px; margin-top: 12px;
}
[data-theme="dark"] .hero.splash {
  background-image: linear-gradient(rgba(20,27,60,.88), rgba(20,27,60,.94)), url('/art/shared/splash_1080x1920.svg');
}
.hubdiv { width: 100%; max-height: 26px; object-fit: cover; margin: 4px 0 10px; }
.appcard { display: flex; align-items: center; gap: 12px; }
.appcard img { width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; }
