/* Growdee App — guru & orang tua. Gaya bersih ala ElevenLabs. */
:root {
  --bg: #f7f7f6;
  --surface: #ffffff;
  --text: #0a0a0a;
  --muted: #6b6b6b;
  --faint: #a3a3a3;
  --line: rgba(0, 0, 0, 0.07);
  --line-strong: rgba(0, 0, 0, 0.13);
  --accent: #10b981;
  --ok: #059669;
  --ok-bg: #ecfdf5;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --bad: #dc2626;
  --bad-bg: #fef2f2;
  --info: #2563eb;
  --info-bg: #eff6ff;
  --r-lg: 22px;
  --r: 16px;
  --r-sm: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 1px rgba(0, 0, 0, 0.02);
  --shadow-up: 0 -8px 30px rgba(0, 0, 0, 0.08);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --heading: 'Inter Tight', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: #ececea;
  color: var(--text);
  font-family: var(--body);
  font-size: calc(15px * var(--fs, 1));
  line-height: 1.45;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
[x-cloak] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---------- Kerangka ---------- */
.app {
  position: relative;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
@media (min-width: 520px) {
  .app { box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(0, 0, 0, 0.08); }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 16px;
  background: rgba(247, 247, 246, 0.82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar h1 {
  flex: 1;
  margin: 0;
  font-family: var(--heading);
  font-size: calc(19px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  transition: background 0.15s;
  flex: none;
}
.icon-btn:active { background: rgba(0, 0, 0, 0.06); }
.icon-btn svg { width: 21px; height: 21px; }
.dot {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--bad);
  color: #fff;
  font-size: calc(10px * var(--fs, 1));
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}

.screen {
  flex: 1;
  padding: 6px 16px calc(96px + var(--safe-b));
  animation: rise 0.42s var(--ease) both;
}
.screen.no-nav { padding-bottom: calc(32px + var(--safe-b)); }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Navigasi bawah ---------- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: 100%;
  max-width: 480px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 6px 8px calc(6px + var(--safe-b));
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 0 5px;
  color: var(--faint);
  font-size: calc(11px * var(--fs, 1));
  font-weight: 500;
  transition: color 0.2s;
}
.tab svg { width: 23px; height: 23px; transition: transform 0.3s var(--ease); }
.tab.on { color: var(--text); }
.tab.on svg { transform: translateY(-1px) scale(1.06); }
.tab .dot { top: 2px; right: calc(50% - 20px); }

/* ---------- Tipografi ---------- */
.hello { margin: 10px 2px 18px; }
.hello small { display: block; color: var(--muted); font-size: calc(13px * var(--fs, 1)); margin-bottom: 2px; }
.hello h2 {
  margin: 0;
  font-family: var(--heading);
  font-size: calc(28px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
}
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 24px 2px 10px;
  font-family: var(--heading);
  font-size: calc(16px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: -0.02em;
}
.section-title a, .section-title button { font-family: var(--body); font-size: calc(13px * var(--fs, 1)); font-weight: 500; color: var(--muted); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: calc(13px * var(--fs, 1)); }
.tiny { font-size: calc(12px * var(--fs, 1)); }
.strong { font-weight: 600; }
.center { text-align: center; }
.mt { margin-top: 12px; }
.mt-lg { margin-top: 22px; }
.pre { white-space: pre-line; }

/* ---------- Kartu & daftar ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 16px;
}
.card + .card { margin-top: 10px; }
.card.tight { padding: 4px 0; }
.card h3 {
  margin: 0 0 4px;
  font-family: var(--heading);
  font-size: calc(17px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: -0.025em;
}
.press { transition: transform 0.18s var(--ease), box-shadow 0.18s; }
.press:active { transform: scale(0.985); }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  text-align: left;
  border-top: 1px solid var(--line);
  transition: background 0.15s;
}
.row:first-child { border-top: 0; }
button.row:active, a.row:active { background: rgba(0, 0, 0, 0.03); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: calc(13px * var(--fs, 1)); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .chev { color: var(--faint); width: 18px; height: 18px; flex: none; }

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 999px;
  background: #f0f0ee;
  font-family: var(--heading);
  font-weight: 600;
  font-size: calc(15px * var(--fs, 1));
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar svg { width: 20px; height: 20px; }
.avatar.lg { width: 56px; height: 56px; font-size: calc(21px * var(--fs, 1)); }
.avatar.accent { background: color-mix(in srgb, var(--accent) 14%, white); color: color-mix(in srgb, var(--accent) 70%, black); }

/* ---------- Statistik ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stats.three { grid-template-columns: repeat(3, 1fr); }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  box-shadow: var(--shadow);
}
.stat b {
  display: block;
  font-family: var(--heading);
  font-size: calc(26px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.stat span { font-size: calc(12.5px * var(--fs, 1)); color: var(--muted); }

.progress { height: 6px; border-radius: 999px; background: #efefed; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--text); transition: width 0.6s var(--ease); }
.progress.accent i { background: var(--accent); }

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: calc(12px * var(--fs, 1));
  font-weight: 500;
  white-space: nowrap;
  background: #f1f1ef;
  color: #3f3f3f;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.dark { background: var(--text); color: #fff; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-weight: 500;
  transition: transform 0.18s var(--ease), opacity 0.2s, background 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn.soft { background: #efefed; color: var(--text); }
.btn.danger { background: var(--bad); }
.btn.ok { background: var(--ok); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: calc(14px * var(--fs, 1)); }
.btn svg { width: 18px; height: 18px; }
.btn-row { display: flex; gap: 8px; }
.btn-row > * { flex: 1; min-width: 0; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick button, .quick a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 4px 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: calc(12px * var(--fs, 1));
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
  transition: transform 0.18s var(--ease);
}
.quick button:active, .quick a:active { transform: scale(0.95); }
.quick svg { width: 22px; height: 22px; }

/* ---------- Form ---------- */
.field { margin-bottom: 16px; }
.field > label, .label {
  display: block;
  margin: 0 2px 7px;
  font-size: calc(13.5px * var(--fs, 1));
  font-weight: 500;
}
.field .req { color: var(--bad); }
.help, .field .help { margin: 6px 2px 0; font-size: calc(12.5px * var(--fs, 1)); color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%;
  min-height: 48px;
  padding: 12px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--text); box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05); }
.input:disabled { background: #f6f6f4; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: calc(14px * var(--fs, 1));
  transition: background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.15s var(--ease);
}
.chip:active { transform: scale(0.95); }
.chip.on { background: var(--text); color: #fff; box-shadow: none; }
.chip:disabled { opacity: 0.55; }

.stars { display: flex; gap: 4px; }
.stars button { font-size: calc(30px * var(--fs, 1)); line-height: 1; color: #d9d9d6; transition: color 0.15s, transform 0.2s var(--ease); }
.stars button.on { color: #f5a524; }
.stars button:active { transform: scale(0.85); }

.seg { display: flex; padding: 4px; gap: 4px; border-radius: 999px; background: #ececea; }
.seg button { flex: 1; padding: 8px 10px; border-radius: 999px; font-size: calc(13.5px * var(--fs, 1)); font-weight: 500; color: var(--muted); transition: background 0.2s, color 0.2s; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.scroll-x { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 4px; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x .chip { flex: none; }

/* ---------- Galeri ---------- */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: var(--r); overflow: hidden; }
.grid3 .ph { position: relative; aspect-ratio: 1; background: #e8e8e5; overflow: hidden; }
.grid3 .ph img, .grid3 .ph video { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.thumbs .ph { width: 72px; height: 72px; border-radius: 12px; overflow: hidden; background: #e8e8e5; }
.thumbs .ph img { width: 100%; height: 100%; object-fit: cover; }
.play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.play svg { width: 28px; height: 28px; filter: drop-shadow(0 1px 4px rgba(0,0,0,.4)); }

.viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.94);
  animation: fade 0.2s both;
}
.viewer img, .viewer video { max-width: 100%; max-height: 86dvh; }
.viewer .cap { position: absolute; bottom: calc(20px + var(--safe-b)); left: 20px; right: 20px; color: #fff; text-align: center; font-size: calc(14px * var(--fs, 1)); }
.viewer .close { position: absolute; top: 14px; right: 14px; color: #fff; }

/* ---------- Bottom sheet ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.36);
  animation: fade 0.25s both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 70;
  width: 100%;
  max-width: 480px;
  max-height: 88dvh;
  overflow-y: auto;
  transform: translateX(-50%);
  padding: 8px 18px calc(22px + var(--safe-b));
  background: var(--surface);
  border-radius: 26px 26px 0 0;
  box-shadow: var(--shadow-up);
  animation: sheet-up 0.42s var(--ease) both;
}
@keyframes sheet-up {
  from { transform: translate(-50%, 100%); }
  to { transform: translate(-50%, 0); }
}
.sheet .grip { width: 38px; height: 5px; margin: 2px auto 14px; border-radius: 999px; background: #dcdcd9; }
.sheet h3 {
  margin: 0 0 4px;
  font-family: var(--heading);
  font-size: calc(20px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: -0.03em;
}
.sheet .lead { margin: 0 0 18px; color: var(--muted); font-size: calc(14px * var(--fs, 1)); }

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border-radius: var(--r);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  text-align: left;
  transition: box-shadow 0.15s, background 0.15s;
}
.option + .option { margin-top: 8px; }
.option.on { box-shadow: inset 0 0 0 2px var(--text); background: #fafaf9; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + var(--safe-b));
  z-index: 90;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-size: calc(14px * var(--fs, 1));
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transform: translateX(-50%);
  animation: toast-in 0.4s var(--ease) both;
  text-align: center;
}
.toast.bad { background: var(--bad); }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* ---------- Status & kosong ---------- */
.empty { padding: 44px 24px; text-align: center; color: var(--muted); }
.empty svg { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--faint); }
.empty b { display: block; color: var(--text); font-family: var(--heading); font-size: calc(16px * var(--fs, 1)); font-weight: 600; margin-bottom: 4px; }

.skeleton { border-radius: var(--r-lg); background: linear-gradient(90deg, #ececea 0%, #f5f5f3 50%, #ececea 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
.skeleton + .skeleton { margin-top: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.banner { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r); font-size: calc(14px * var(--fs, 1)); margin-bottom: 12px; }
.banner svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.banner.info { background: var(--info-bg); color: var(--info); }
.banner.ok { background: var(--ok-bg); color: var(--ok); }

.spinner { width: 18px; height: 18px; border-radius: 999px; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Catatan harian ---------- */
.note-section { margin-bottom: 10px; }
.note-section .card { padding: 18px 16px 4px; }
.note-section h4 { margin: 0 0 14px; font-family: var(--heading); font-size: calc(15px * var(--fs, 1)); font-weight: 600; letter-spacing: -0.02em; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); font-size: calc(14.5px * var(--fs, 1)); }
.kv:first-of-type { border-top: 0; }
.kv > span:first-child { color: var(--muted); }
.kv > span:last-child { text-align: right; font-weight: 500; }
.kv.block { display: block; }
.kv.block > span { display: block; text-align: left; }
.kv.block > span:last-child { margin-top: 3px; font-weight: 400; white-space: pre-line; }

.savebar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 25;
  width: 100%;
  max-width: 480px;
  transform: translateX(-50%);
  padding: 12px 16px calc(12px + var(--safe-b));
  background: linear-gradient(to top, var(--bg) 70%, rgba(247, 247, 246, 0));
}
.savestate { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 8px; font-size: calc(12.5px * var(--fs, 1)); color: var(--muted); }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; }
.bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: calc(14.5px * var(--fs, 1));
  word-wrap: break-word;
  animation: rise 0.3s var(--ease) both;
}
.bubble.mine { align-self: flex-end; background: var(--text); color: #fff; border-color: transparent; border-bottom-right-radius: 6px; }
.bubble.theirs { align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble .text { white-space: pre-line; }
.bubble .who { display: block; margin-bottom: 2px; font-size: calc(12px * var(--fs, 1)); font-weight: 600; color: var(--muted); }
.bubble .at { display: block; margin-top: 3px; font-size: calc(11px * var(--fs, 1)); opacity: 0.55; text-align: right; }
.bubble img { margin-top: 6px; border-radius: 12px; max-height: 240px; }
.day-sep { align-self: center; margin: 10px 0 4px; font-size: calc(12px * var(--fs, 1)); color: var(--faint); }
.composer {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 25;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  max-width: 480px;
  transform: translateX(-50%);
  padding: 10px 12px calc(10px + var(--safe-b));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.composer textarea {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  padding: 10px 16px;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  outline: none;
  resize: none;
  background: var(--bg);
  line-height: 1.4;
}
.composer .send { width: 42px; height: 42px; border-radius: 999px; background: var(--text); color: #fff; display: grid; place-items: center; flex: none; transition: transform 0.15s var(--ease), opacity 0.2s; }
.composer .send:disabled { opacity: 0.3; }
.composer .send:active { transform: scale(0.9); }
.composer .send svg { width: 19px; height: 19px; }

/* ---------- Login ---------- */
.login {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 24px calc(32px + var(--safe-b));
  animation: rise 0.6s var(--ease) both;
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 40px; }
.brand .mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--text);
  color: #fff;
  font-family: var(--heading);
  font-weight: 700;
  font-size: calc(20px * var(--fs, 1));
}
.brand span { font-family: var(--heading); font-size: calc(20px * var(--fs, 1)); font-weight: 600; letter-spacing: -0.03em; }
.login h2 {
  margin: 0 0 6px;
  font-family: var(--heading);
  font-size: calc(34px * var(--fs, 1));
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.08;
}
.login p.lead { margin: 0 0 30px; color: var(--muted); }

/* ---------- Timeline / agenda ---------- */
.date-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 54px;
  flex: none;
  border-radius: 14px;
  background: #f1f1ef;
  line-height: 1;
}
.date-box b { font-family: var(--heading); font-size: calc(20px * var(--fs, 1)); font-weight: 600; letter-spacing: -0.03em; }
.date-box small { margin-top: 3px; font-size: calc(11px * var(--fs, 1)); color: var(--muted); text-transform: uppercase; }

.goal-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin-top: 8px; }
.goal-bar i { height: 8px; border-radius: 3px; background: #ececea; position: relative; }
.goal-bar i.done { background: var(--text); }
.goal-bar i.target { box-shadow: inset 0 0 0 2px var(--accent); }

.days14 { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; margin-top: 8px; }
.days14 i { aspect-ratio: 1; border-radius: 4px; background: #ececea; }
.days14 i.yes { background: var(--ok); }
.days14 i.no { background: #f3c9c9; }

.md p { margin: 0 0 10px; }
.md ul { margin: 0 0 10px; padding-left: 20px; }
.md h1, .md h2, .md h3 { font-family: var(--heading); letter-spacing: -0.02em; margin: 14px 0 6px; font-size: calc(17px * var(--fs, 1)); }

hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* =====================================================================
   TEMA CERIA — biru lembut, kartu putih membulat, ikon gradien.
   (Lapisan ini menimpa token & komponen dasar di atas.)
   ===================================================================== */
:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: rgba(15, 23, 42, 0.06);
  --line-strong: rgba(15, 23, 42, 0.12);
  --primary: #0b6aa2;
  --primary-soft: #e0f2fe;
  --ok: #059669;
  --ok-bg: #ecfdf5;
  --warn: #c2410c;
  --warn-bg: #fff7ed;
  --info: #0369a1;
  --info-bg: #e0f2fe;
  --r-lg: 24px;
  --r: 18px;
  --r-sm: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px -14px rgba(15, 23, 42, 0.16);
  --shadow-up: 0 -10px 40px rgba(15, 23, 42, 0.12);
}
body { background: #e2e8f0; }
.app { background: var(--bg); }
@media (min-width: 520px) { .app { box-shadow: 0 30px 80px rgba(15, 23, 42, 0.12); } }

.topbar { background: rgba(255, 255, 255, 0.86); border-bottom-color: var(--line); }
.topbar.scrolled { box-shadow: 0 6px 20px -16px rgba(15, 23, 42, 0.3); }
.topbar .icon-btn { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.topbar .icon-btn:active { background: #f8fafc; }
.brand-row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.brand-row .t { font-family: var(--heading); font-weight: 600; font-size: calc(17px * var(--fs, 1)); letter-spacing: -0.025em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-row .s { font-size: calc(12.5px * var(--fs, 1)); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-row > div:last-child { min-width: 0; }

/* Kartu */
.card, .list, .stat { border-color: var(--line); box-shadow: var(--shadow); }
.card { border-radius: var(--r-lg); }
.list { border-radius: var(--r-lg); }
.row { padding: 14px 16px; }
.row + .row, .row { border-top-color: rgba(15, 23, 42, 0.05); }

/* Tombol & pilihan */
.btn {
  background: linear-gradient(180deg, #1683c4 0%, var(--primary) 100%);
  box-shadow: 0 10px 22px -12px rgba(11, 106, 162, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-weight: 600;
  min-height: 50px;
}
.btn.ghost { background: #fff; color: var(--primary); box-shadow: inset 0 0 0 1.5px #bae6fd; }
.btn.soft { background: var(--primary-soft); color: var(--primary); box-shadow: none; }
.btn.danger { background: linear-gradient(180deg, #ef4444, #dc2626); }
.btn.sm { min-height: 38px; }
.chip { box-shadow: inset 0 0 0 1px var(--line-strong); }
.chip.on { background: var(--primary); color: #fff; box-shadow: 0 6px 14px -8px rgba(11, 106, 162, 0.7); }
.seg { background: #e2e8f0; }
.seg button.on { color: var(--primary); }
.option.on { box-shadow: inset 0 0 0 2px var(--primary); background: #f0f9ff; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15); }
.progress { background: #e2e8f0; }
.progress i { background: linear-gradient(90deg, #38bdf8, var(--primary)); }
.progress.accent i { background: linear-gradient(90deg, #fdba74, #f97316); }
.section-title { font-size: calc(13px * var(--fs, 1)); font-family: var(--body); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 26px; }
.section-title a, .section-title button { text-transform: none; letter-spacing: 0; color: var(--primary); font-weight: 600; }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.dark { background: #f43f5e; color: #fff; }
.dot { background: #f43f5e; }

/* Navigasi bawah: pil biru muda di ikon aktif */
.tabbar { background: rgba(255, 255, 255, 0.94); border-top-color: var(--line); padding-top: 8px; }
.tab { color: var(--faint); gap: 4px; padding: 0 0 4px; }
.tab > span:first-child { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 999px; transition: background 0.25s var(--ease); }
.tab svg { width: 22px; height: 22px; }
.tab.on { color: var(--primary); font-weight: 600; }
.tab.on > span:first-child { background: var(--primary-soft); }
.tab.on svg { transform: none; }

/* Ikon gradien */
.ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -2px 6px rgba(0, 0, 0, 0.08), 0 10px 18px -10px var(--c2);
}
.ic svg { width: 24px; height: 24px; stroke-width: 2; }
.ic.sm { width: 36px; height: 36px; border-radius: 12px; }
.ic.sm svg { width: 19px; height: 19px; }
.ic.lg { width: 56px; height: 56px; border-radius: 18px; }
.ic-blue { --c1: #7dd3fc; --c2: #0284c7; }
.ic-orange { --c1: #fdba74; --c2: #ea580c; }
.ic-purple { --c1: #c4b5fd; --c2: #7c3aed; }
.ic-pink { --c1: #fda4af; --c2: #e11d48; }
.ic-green { --c1: #86efac; --c2: #059669; }
.ic-amber { --c1: #fde68a; --c2: #d97706; }
.ic-indigo { --c1: #a5b4fc; --c2: #4f46e5; }
.ic-teal { --c1: #99f6e4; --c2: #0d9488; }
.ic-slate { --c1: #cbd5e1; --c2: #475569; }

/* Avatar pastel (warna dari nama) */
.avatar { font-family: var(--body); font-weight: 700; font-size: calc(14px * var(--fs, 1)); letter-spacing: 0.01em; }
.tone-0 { background: #fef3c7; color: #a16207; }
.tone-1 { background: #e0f2fe; color: #0369a1; }
.tone-2 { background: #ede9fe; color: #6d28d9; }
.tone-3 { background: #ffe4e6; color: #be123c; }
.tone-4 { background: #dcfce7; color: #15803d; }
.tone-5 { background: #ffedd5; color: #c2410c; }
.avatar.halo { box-shadow: 0 0 0 3px #fff, 0 0 0 5px #fbbf24; }

/* Kartu sorotan bergradien */
.hero {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background:
    radial-gradient(120% 90% at 100% 100%, rgba(253, 186, 116, 0.55) 0%, rgba(253, 186, 116, 0) 55%),
    radial-gradient(90% 80% at 0% 0%, rgba(125, 211, 252, 0.55) 0%, rgba(125, 211, 252, 0) 60%),
    linear-gradient(135deg, #eef6ff 0%, #f3efff 50%, #fff4ea 100%);
  box-shadow: 0 18px 40px -24px rgba(15, 23, 42, 0.35);
}
.hero .eyebrow { font-size: calc(13px * var(--fs, 1)); color: #475569; }
.hero h2 {
  margin: 4px 0 0;
  font-family: var(--heading);
  font-size: calc(27px * var(--fs, 1));
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
}
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(6px);
  font-size: calc(13.5px * var(--fs, 1));
  font-weight: 600;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.pill svg { width: 17px; height: 17px; color: #475569; }
.pill.warm { background: rgba(254, 215, 170, 0.75); color: #9a3412; }
.pill.warm svg { color: #c2410c; }
.pill.cool { background: rgba(186, 230, 253, 0.8); color: #075985; }
.pill.cool svg { color: #0369a1; }

/* Cincin progres */
.ring {
  --p: 0;
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  flex: none;
  border-radius: 999px;
  background: conic-gradient(#0ea5e9 calc(var(--p) * 1%), rgba(255, 255, 255, 0.85) 0);
  box-shadow: 0 8px 20px -12px rgba(2, 132, 199, 0.7);
}
.ring::before { content: ''; position: absolute; inset: 9px; border-radius: inherit; background: #fff; }
.ring > div { position: relative; text-align: center; line-height: 1.05; }
.ring b { display: block; font-family: var(--heading); font-size: calc(24px * var(--fs, 1)); font-weight: 700; letter-spacing: -0.04em; }
.ring small { font-size: calc(11px * var(--fs, 1)); color: var(--muted); }

/* Bento menu utama */
.bento { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bento > a, .bento > button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  min-height: 132px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.bento > a:active, .bento > button:active { transform: scale(0.97); }
.bento .t { font-family: var(--heading); font-size: calc(16.5px * var(--fs, 1)); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.bento .s { font-size: calc(13px * var(--fs, 1)); font-weight: 500; color: var(--muted); margin-top: 2px; }
.bento .s.warn { color: #ea580c; }
.bento .s.ok { color: #059669; }
.bento .s.info { color: #0284c7; }

/* Menu kecil */
.quick button, .quick a { border-radius: 20px; padding: 12px 4px 10px; gap: 8px; box-shadow: var(--shadow); color: #334155; }
.quick .ic { width: 40px; height: 40px; border-radius: 13px; }
.quick .ic svg { width: 21px; height: 21px; }

/* Sorotan catatan */
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.mini { padding: 11px 12px; border-radius: 16px; background: #f8fafc; border: 1px solid rgba(15, 23, 42, 0.04); }
.mini span { display: block; font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.mini b { display: block; margin-top: 2px; font-size: calc(14.5px * var(--fs, 1)); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quote { margin-top: 10px; padding: 14px 16px; border-radius: 18px; background: #f0f9ff; color: #334155; font-style: italic; font-size: calc(14.5px * var(--fs, 1)); }
.link { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; color: var(--primary); font-weight: 600; font-size: calc(14.5px * var(--fs, 1)); }
.link svg { width: 16px; height: 16px; }

/* Chat & lain-lain */
.bubble.mine { background: linear-gradient(160deg, #1683c4, var(--primary)); }
.composer .send { background: var(--primary); }
.stars button.on { color: #f59e0b; }
.hello h2 { font-weight: 700; }
.toast { background: #0f172a; }
.sheet { border-radius: 30px 30px 0 0; }
.login .brand .mark { background: linear-gradient(160deg, #7dd3fc, #0284c7); border-radius: 14px; box-shadow: 0 10px 20px -10px #0284c7; }
.login { background:
    radial-gradient(80% 50% at 100% 0%, rgba(253, 186, 116, 0.35), rgba(253, 186, 116, 0) 70%),
    radial-gradient(80% 50% at 0% 100%, rgba(125, 211, 252, 0.35), rgba(125, 211, 252, 0) 70%); }
.date-box { background: #f0f9ff; color: var(--primary); }
.date-box small { color: #0284c7; }
.goal-bar i.done { background: linear-gradient(90deg, #38bdf8, var(--primary)); }
.empty svg { color: #cbd5e1; }

/* ---- Revisi: latar putih, bayangan minimal, kilau ikon hanya di dalam ---- */
:root {
  --bg: #ffffff;
  --shadow: none;
  --line: rgba(15, 23, 42, 0.08);
}
body { background: #f1f5f9; }
.app { background: #fff; }
@media (min-width: 520px) { .app { box-shadow: 0 0 0 1px var(--line); } }
.topbar { background: rgba(255, 255, 255, 0.92); }
.topbar.scrolled { box-shadow: none; }
.card, .list, .stat, .bento > a, .bento > button, .quick button, .quick a { box-shadow: none; border: 1px solid var(--line); }
.hero { box-shadow: none; border: 1px solid rgba(15, 23, 42, 0.05); }
.ic { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -3px 8px rgba(0, 0, 0, 0.1); }
.btn, .btn.danger { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.btn.ghost { box-shadow: inset 0 0 0 1.5px #bae6fd; }
.chip.on { box-shadow: none; }
.ring { box-shadow: none; }
.pill { box-shadow: none; }
.seg button.on { box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }
.mini { background: #f8fafc; }
.note-section .card { border-color: var(--line); }
.savebar { background: linear-gradient(to top, #fff 70%, rgba(255, 255, 255, 0)); }
.skeleton { background: linear-gradient(90deg, #f1f5f9 0%, #f8fafc 50%, #f1f5f9 100%); background-size: 200% 100%; }

/* ---- Revisi: ikon lebih kecil ---- */
.ic { width: 40px; height: 40px; border-radius: 13px; }
.ic svg { width: 20px; height: 20px; }
.ic.sm { width: 32px; height: 32px; border-radius: 10px; }
.ic.sm svg { width: 17px; height: 17px; }
.quick .ic { width: 34px; height: 34px; border-radius: 11px; }
.quick .ic svg { width: 18px; height: 18px; }
.bento > a, .bento > button { min-height: 112px; gap: 10px; padding: 14px; }
.bento .t { font-size: calc(15.5px * var(--fs, 1)); }
.brand-row .ic.sm { width: 34px; height: 34px; }

/* ---- Revisi: garis atas baris pertama tidak dobel; logo inisial sekolah ---- */
.list > template:first-child + .row,
.list > template:first-child + template + .row,
.list > .row:first-child { border-top: 0; }
.brand-row .ic.sm { font-family: var(--heading); font-size: calc(13.5px * var(--fs, 1)); font-weight: 700; letter-spacing: -0.01em; }

/* ---- Kartu profil di "Lainnya" ---- */
.profile-hero { padding: 20px 20px 16px; }
.role-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.85); color: var(--primary); font-size: calc(12px * var(--fs, 1)); font-weight: 600; }
.profile-meta { display: grid; gap: 7px; margin-top: 16px; font-size: calc(13.5px * var(--fs, 1)); color: #334155; }
.profile-meta > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.profile-meta > div > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-meta svg { width: 16px; height: 16px; color: #64748b; flex: none; }
.profile-stats { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin-top: 16px; padding: 12px 4px; border-radius: 18px; background: rgba(255, 255, 255, 0.75); }
.profile-stats > div { text-align: center; }
.profile-stats > div:not(:first-of-type) { border-left: 1px solid rgba(15, 23, 42, 0.08); }
.profile-stats b { display: block; font-family: var(--heading); font-size: calc(20px * var(--fs, 1)); font-weight: 700; letter-spacing: -0.03em; }
.profile-stats span { font-size: calc(12px * var(--fs, 1)); color: var(--muted); }

/* ---- Revisi: avatar tanpa lingkaran, tombol atas tanpa bingkai ---- */
.avatar.halo { box-shadow: none; }
.topbar .icon-btn { background: transparent; box-shadow: none; }
.topbar .icon-btn:active { background: rgba(15, 23, 42, 0.06); }

/* ---- Daftar chat ala WhatsApp: tanpa kartu, garis pemisah di bawah ---- */
.chatlist { margin: 0 -16px; }
.chatrow { display: flex; align-items: center; gap: 14px; padding: 0 16px; transition: background 0.15s; }
.chatrow:active { background: #f8fafc; }
.chatrow .avatar { width: 50px; height: 50px; font-size: calc(16px * var(--fs, 1)); }
.chatrow .body { flex: 1; min-width: 0; padding: 14px 0; border-bottom: 1px solid rgba(15, 23, 42, 0.07); }
.chatrow .top, .chatrow .bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chatrow .name { font-weight: 600; font-size: calc(16px * var(--fs, 1)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chatrow .time { flex: none; font-size: calc(12px * var(--fs, 1)); color: var(--faint); }
.chatrow .time.unread { color: #16a34a; font-weight: 600; }
.chatrow .bottom { margin-top: 3px; }
.chatrow .msg { font-size: calc(14px * var(--fs, 1)); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chatrow .msg.unread { color: var(--text); font-weight: 500; }
.chatrow .count { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #22c55e; color: #fff; font-size: calc(11.5px * var(--fs, 1)); font-weight: 700; line-height: 20px; text-align: center; }
.chatrow .newdot { flex: none; width: 10px; height: 10px; border-radius: 999px; background: #22c55e; }
.chatrow .date-box { width: 50px; height: 50px; }
.chatrow .ic { width: 50px; height: 50px; border-radius: 999px; }

/* ---- Isian berulang, dokumentasi per isian, PR ---- */
.rep { display: grid; gap: 10px; }
.rep-item { padding: 12px; border-radius: 16px; background: #f8fafc; border: 1px solid rgba(15, 23, 42, 0.05); }
.rep-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: calc(12.5px * var(--fs, 1)); font-weight: 600; color: var(--muted); }
.rep-del { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; color: var(--faint); flex: none; }
.rep-del:active { background: #e2e8f0; }
.rep-del svg { width: 16px; height: 16px; }
.add-row { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 11px; border-radius: 14px; border: 1.5px dashed #bae6fd; color: var(--primary); font-weight: 600; font-size: calc(14px * var(--fs, 1)); }
.add-row svg { width: 17px; height: 17px; }
.add-row:active { background: #f0f9ff; }

.media-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot { position: relative; aspect-ratio: 1; border-radius: 16px; background: #f1f5f9; display: grid; place-items: center; overflow: hidden; }
.slot.add { cursor: pointer; border: 1.5px dashed #cbd5e1; background: #fff; color: var(--muted); align-content: center; gap: 4px; }
.slot.add svg { width: 24px; height: 24px; }
.slot.add small { font-size: calc(11.5px * var(--fs, 1)); }
.slot-open { position: absolute; inset: 0; }
.slot-open img { width: 100%; height: 100%; object-fit: cover; }
.slot-del { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; background: rgba(15, 23, 42, 0.6); color: #fff; }
.slot-del svg { width: 14px; height: 14px; }
.thumbs .ph .play { position: absolute; inset: 0; }

.tasks { display: grid; gap: 8px; }
.task-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: #f8fafc; }
.task-row .tick { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 999px; border: 2px solid #cbd5e1; color: transparent; transition: background 0.2s, border-color 0.2s; }
.task-row .tick svg { width: 15px; height: 15px; stroke-width: 3; }
.task-row .tick.on { background: #22c55e; border-color: #22c55e; color: #fff; }
.task-row.done .task-text { color: var(--muted); text-decoration: line-through; }
.task-text { flex: 1; font-size: calc(14.5px * var(--fs, 1)); }
.input.bare { min-height: 38px; padding: 6px 10px; border-color: transparent; background: transparent; }
.input.bare:focus { background: #fff; border-color: var(--primary); }
.tasks.ro .task-row { background: transparent; padding: 4px 0; }

.copy-bar { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; margin-bottom: 12px; border-radius: 18px; background: #eef2ff; text-align: left; }
.copy-bar b { display: block; font-size: calc(14.5px * var(--fs, 1)); color: #3730a3; }
.copy-bar small { display: block; font-size: calc(12.5px * var(--fs, 1)); color: #4f46e5; }
.copy-bar .chev { color: #6366f1; }

/* ---- Revisi: tombol & pilihan hitam (sesuai tema), navigasi bawah dengan titik ---- */
.btn { background: #0f172a; box-shadow: none; }
.btn.ghost { background: #fff; color: #0f172a; box-shadow: inset 0 0 0 1.5px rgba(15, 23, 42, 0.18); }
.btn.soft { background: #f1f5f9; color: #0f172a; }
.chip.on { background: #0f172a; color: #fff; }
.seg button.on { color: #0f172a; }
.option.on { box-shadow: inset 0 0 0 2px #0f172a; background: #f8fafc; }
.input:focus, .input.bare:focus { border-color: #0f172a; box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.06); }
.add-row { border-color: rgba(15, 23, 42, 0.2); color: #0f172a; }
.add-row:active { background: #f8fafc; }
.section-title a, .section-title button, .link { color: #0f172a; }
.bubble.mine { background: #0f172a; }
.composer .send { background: #0f172a; }
.progress i { background: #0f172a; }

.tab { color: var(--faint); font-weight: 500; }
.tab > span:first-child { width: auto; height: 26px; background: none !important; }
.tab.on { color: #0f172a; font-weight: 600; }
.tab::after { content: ''; width: 5px; height: 5px; margin-top: 1px; border-radius: 999px; background: transparent; transition: background 0.2s; }
.tab.on::after { background: #0f172a; }

/* ---- PR / tugas ---- */
.pr-edit { padding: 12px; border-radius: 16px; background: #f8fafc; border: 1px solid rgba(15, 23, 42, 0.05); }
.pr-edit .input { background: #fff; }
.link-input { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding-left: 10px; border-radius: 12px; background: #fff; border: 1px solid var(--line-strong); }
.link-input svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.link-input .input.bare { flex: 1; min-height: 42px; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.att { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 76px; }
.att-open, .att.add { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.att-open img { width: 100%; height: 100%; object-fit: cover; }
.att-ic { display: grid; place-items: center; width: 100%; height: 100%; background: #f1f5f9; color: #334155; }
.att-ic svg { width: 26px; height: 26px; }
.att-name { width: 100%; font-size: calc(11px * var(--fs, 1)); color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att.add { cursor: pointer; align-content: center; gap: 2px; border-style: dashed; border-width: 1.5px; color: var(--muted); }
.att.add svg { width: 20px; height: 20px; }
.att.add small { font-size: calc(11px * var(--fs, 1)); }
.att .slot-del { top: 4px; right: 4px; }
.att-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: calc(13.5px * var(--fs, 1)); font-weight: 500; color: #0369a1; word-break: break-all; }
.att-link svg { width: 15px; height: 15px; flex: none; }

.pr-list { display: grid; gap: 12px; }
.pr-row { display: flex; align-items: flex-start; gap: 10px; }
.status-dot { display: grid; place-items: center; flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 999px; border: 2px solid #cbd5e1; color: #fff; }
.status-dot.on { background: #22c55e; border-color: #22c55e; }
.status-dot svg { width: 13px; height: 13px; stroke-width: 3; }
.pr-row.done .task-text { color: var(--muted); }
.ok-text { color: var(--ok); }

.hw-row { display: flex; align-items: flex-start; gap: 12px; padding: 0 16px; }
.hw-row .avatar { margin-top: 14px; }
.hw-row .body { flex: 1; min-width: 0; padding: 14px 0; border-bottom: 1px solid rgba(15, 23, 42, 0.07); }
.hw-row .name { font-weight: 600; margin-bottom: 2px; }
.hw-row > .badge { margin-top: 16px; }
.hw-row.done .task-text { color: var(--muted); text-decoration: line-through; }
.check-btn { display: grid; place-items: center; flex: none; width: 34px; height: 34px; margin-top: 14px; border-radius: 999px; border: 2px solid #cbd5e1; color: transparent; transition: background 0.2s, border-color 0.2s, transform 0.15s var(--ease); }
.check-btn svg { width: 18px; height: 18px; stroke-width: 3; }
.check-btn.on { background: #22c55e; border-color: #22c55e; color: #fff; }
.check-btn:active { transform: scale(0.9); }

/* ---- Insight AI performa ---- */
.hero.insight { padding: 16px; }
.insight-box { margin-top: 10px; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.8); }
.insight-label { font-size: calc(12px * var(--fs, 1)); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.insight-label.ok { color: #047857; }
.insight-label.warn { color: #b45309; }
.insight-label.info { color: #4338ca; }
.insight-box ul { margin: 6px 0 0; padding-left: 18px; font-size: calc(14px * var(--fs, 1)); line-height: 1.5; }
.insight-box li + li { margin-top: 4px; }

/* ---- Daftar yang langsung di bawah navbar: baris datar ala chat ---- */
.chatrow.tall { align-items: flex-start; }
.chatrow.tall > .avatar, .chatrow.tall > .ic, .chatrow.tall > .date-box { flex: none; margin-top: 14px; }
.chatrow > .avatar, .chatrow > .ic, .chatrow > .date-box { flex: none; }
.chatrow .name.wrap, .chatrow .msg.wrap { white-space: normal; }
.chatrow .top .badge { flex: none; }
.chatrow .row-head { display: block; width: 100%; padding: 0; text-align: left; background: none; border: 0; font: inherit; color: inherit; }
.chatrow .chev { flex: none; display: inline-grid; color: var(--faint); transition: transform 0.2s; }
.chatrow .chev svg { width: 18px; height: 18px; }
.chatrow .chev.open { transform: rotate(90deg); }
.chatrow .detail { margin-top: 12px; }

/* =====================================================================
   PERILAKU APLIKASI NATIVE
   ===================================================================== */
:root { --fs: 1; --safe-t: env(safe-area-inset-top, 0px); color-scheme: light; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; overscroll-behavior: none; background: var(--bg); }
body {
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
/* Teks yang memang boleh disalin */
input, textarea, select, [contenteditable], .md, .bubble .text, .pre, .task-text, .kv > span:last-child, .selectable {
  -webkit-user-select: text;
  user-select: text;
}
img, svg, a { -webkit-user-drag: none; user-drag: none; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 8px; }
/* iOS tidak memperbesar halaman saat mengetik bila teks input >= 16px */
.input, select.input, textarea.input, .composer textarea { font-size: max(16px, calc(15px * var(--fs, 1))); }
.input.bare { font-size: max(16px, calc(14px * var(--fs, 1))); }
@media (display-mode: standalone) {
  ::-webkit-scrollbar { display: none; }
  html { scrollbar-width: none; }
}
.topbar { padding-top: calc(10px + var(--safe-t)); }
html.kb .tabbar { transform: translate(-50%, 110%); }
.tabbar { transition: transform 0.25s var(--ease), background 0.2s; }

/* Ukuran yang dijaga supaya tata letak tetap rapi saat teks diperbesar */
.tab { font-size: 11px; }
.dot { font-size: 10px; }
.quick button, .quick a { font-size: calc(12px * min(var(--fs, 1), 1.1)); }
.stat span { font-size: calc(12.5px * min(var(--fs, 1), 1.12)); }
.badge { font-size: calc(12px * min(var(--fs, 1), 1.15)); }
.date-box b { font-size: calc(20px * min(var(--fs, 1), 1.1)); }
.date-box small { font-size: calc(11px * min(var(--fs, 1), 1.1)); }
.ring b { font-size: calc(24px * min(var(--fs, 1), 1.1)); }
.profile-stats span { font-size: calc(12px * min(var(--fs, 1), 1.12)); }
.avatar { font-size: calc(14px * min(var(--fs, 1), 1.1)); }
.chatrow .avatar { font-size: calc(16px * min(var(--fs, 1), 1.1)); }

/* Perpindahan halaman */
.screen { animation: none; }
.screen.nav-fwd { animation: push-in 0.32s var(--ease) both; }
.screen.nav-back { animation: pop-in 0.32s var(--ease) both; }
.screen.nav-tab { animation: fade 0.22s ease-out both; }
@keyframes push-in { from { opacity: 0; transform: translateX(42px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: translateX(-42px); } to { opacity: 1; transform: none; } }
.screen.dragging { animation: none; transition: none; box-shadow: -12px 0 30px rgba(0, 0, 0, 0.12); background: var(--bg); }
.screen.settle { transition: transform 0.28s var(--ease); }
.swipe-shade { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: rgba(0, 0, 0, 0.06); }

/* Tarik untuk memuat ulang */
.ptr {
  position: fixed;
  top: calc(64px + var(--safe-t));
  left: 50%;
  z-index: 19;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-left: -19px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.14), 0 0 0 1px var(--line);
  opacity: 0;
  transform: translateY(-50px) scale(0.6);
  pointer-events: none;
}
.ptr svg { width: 20px; height: 20px; }
.ptr.spin svg { animation: spin 0.8s linear infinite; }
.ptr.back { transition: transform 0.3s var(--ease), opacity 0.3s; }
main.pulling { transition: none; }
main.release { transition: transform 0.3s var(--ease); }

/* Sheet & penampil foto: animasi keluar + geser untuk menutup */
.sheet { overscroll-behavior: contain; touch-action: pan-y; }
.sheet.closing { animation: sheet-down 0.24s ease-in both; }
.backdrop.closing { animation: fade-out 0.24s ease-in both; }
.sheet.dragging { animation: none; transition: none; }
.sheet.settle { transition: transform 0.28s var(--ease); }
@keyframes sheet-down { from { transform: translate(-50%, 0); } to { transform: translate(-50%, 100%); } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
.sheet .grip { touch-action: none; }
.viewer { touch-action: none; overflow: hidden; }
.viewer .stage { width: 100%; height: 100%; display: grid; place-items: center; }
.viewer img { transition: transform 0.25s var(--ease); -webkit-touch-callout: default; will-change: transform; }
.viewer img.live { transition: none; }
.viewer .close, .viewer .share { position: absolute; top: calc(14px + var(--safe-t)); color: #fff; z-index: 2; }
.viewer .close { right: 14px; }
.viewer .share { right: 58px; }
.viewer .share svg, .viewer .close svg { filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5)); }
.viewer.closing { animation: fade-out 0.2s ease-in both; }
.toast { top: auto; }
.toast.top { bottom: auto; top: calc(12px + var(--safe-t)); display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; }
.toast .btn { min-height: 34px; padding: 0 14px; font-size: calc(13px * var(--fs, 1)); background: #fff; color: #0f172a; }

/* Gambar muncul halus saat selesai dimuat */
.ph img, .avatar img, .slot-open img, .att-open img, .bubble img { opacity: 0; transition: opacity 0.3s ease; }
.ph img.in, .avatar img.in, .slot-open img.in, .att-open img.in, .bubble img.in { opacity: 1; }
.grid3 .ph, .thumbs .ph { background: linear-gradient(100deg, var(--sk) 30%, var(--sk-hi) 50%, var(--sk) 70%); background-size: 300% 100%; animation: sk 1.6s ease-in-out infinite; }
.grid3 .ph:has(img.in), .thumbs .ph:has(img.in) { animation: none; }

/* Getar halus saat menekan */
.chatrow, .row, .hw-row { -webkit-tap-highlight-color: transparent; }
.tab:active svg { transform: scale(0.88); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }

/* =====================================================================
   KERANGKA MEMUAT (SKELETON)
   ===================================================================== */
:root { --sk: #e9edf2; --sk-hi: #f5f7fa; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.skel { animation: fade 0.25s 0.06s ease-out both; }
.sk {
  display: block;
  border-radius: 8px;
  background: linear-gradient(100deg, var(--sk) 30%, var(--sk-hi) 50%, var(--sk) 70%);
  background-size: 300% 100%;
  animation: sk 1.5s ease-in-out infinite;
}
.sk.line { height: 12px; }
.sk.line.lg { height: 18px; border-radius: 9px; }
.sk.line.xl { height: 26px; border-radius: 10px; }
.sk.circle { border-radius: 999px; flex: none; }
.sk.pill { height: 22px; border-radius: 999px; flex: none; }
.sk.box { border-radius: var(--r-lg); }
.sk + .sk.line { margin-top: 8px; }
.sk-row { display: flex; align-items: center; gap: 14px; padding: 0 16px; }
.sk-row .body { flex: 1; min-width: 0; padding: 15px 0; border-bottom: 1px solid var(--line); }
.sk-row .body .between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sk-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.sk-card + .sk-card { margin-top: 10px; }
.sk-card .sk-in { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.sk-card .sk-in:first-child { border-top: 0; padding-top: 0; }
.sk-card .sk-in:last-child { padding-bottom: 0; }
.sk-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sk-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sk-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sk-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: var(--r); overflow: hidden; }
.sk-photos .sk { aspect-ratio: 1; border-radius: 0; }
.sk-title { margin: 26px 2px 12px; }
.sk-chat { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.sk-chat .sk { height: 40px; border-radius: 20px; }
.sk-chat .me { align-self: flex-end; border-bottom-right-radius: 6px; }
.sk-chat .you { align-self: flex-start; border-bottom-left-radius: 6px; }
.skeleton { background: linear-gradient(100deg, var(--sk) 30%, var(--sk-hi) 50%, var(--sk) 70%); background-size: 300% 100%; animation: sk 1.5s ease-in-out infinite; }

/* =====================================================================
   HALAMAN TAMPILAN (tema & ukuran teks)
   ===================================================================== */
.hero-sub { color: #475569; }
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-pick button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 6px 12px; border-radius: 20px; font-size: calc(13.5px * min(var(--fs, 1), 1.12)); font-weight: 500; transition: background 0.2s; }
.theme-pick button:active { background: var(--line); }
.mock { position: relative; width: 70px; height: 112px; border-radius: 16px; overflow: hidden; box-shadow: 0 0 0 1px var(--line-strong); transition: box-shadow 0.2s; }
.theme-pick button.on .mock { box-shadow: 0 0 0 2.5px var(--text); }
.mock i { position: absolute; left: 9px; right: 9px; height: 7px; border-radius: 4px; }
.mock .m-light, .mock .m-dark { position: absolute; inset: 0; }
.mock .m-light { background: #fff; }
.mock .m-dark { background: #0b0f14; }
.mock.sys .m-dark { clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.mock .m-light i { background: #e2e8f0; }
.mock .m-dark i { background: #232a33; }
.mock .m-light i.a, .mock .m-dark i.a { height: 22px; top: 12px; border-radius: 6px; }
.mock .m-light i.a { background: linear-gradient(135deg, #dbeafe, #fde4cf); }
.mock .m-dark i.a { background: linear-gradient(135deg, #16263a, #2a1c14); }
.mock i.b { top: 42px; right: 26px; }
.mock i.c { top: 56px; }
.mock i.d { top: 70px; right: 20px; }
.mock .m-light i.e, .mock .m-dark i.e { top: 92px; left: 22px; right: 22px; height: 9px; border-radius: 5px; }
.mock .m-light i.e { background: #0f172a; }
.mock .m-dark i.e { background: #e8edf3; }
.radio { width: 20px; height: 20px; border-radius: 999px; box-shadow: inset 0 0 0 2px var(--line-strong); display: grid; place-items: center; transition: box-shadow 0.2s; }
.theme-pick button.on .radio { box-shadow: inset 0 0 0 6px var(--text); }

.ts-preview { padding: 16px; border-radius: 18px; background: var(--sk-hi); }
.ts-preview .who { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ts-preview p { margin: 0; line-height: 1.5; }
.ts-slider { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.ts-slider .a-s { font-size: 14px; font-weight: 600; }
.ts-slider .a-l { font-size: 24px; font-weight: 600; }
.ts-track { position: relative; flex: 1; height: 36px; }
.ts-track input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; touch-action: none; }
.ts-rail { position: absolute; left: 10px; right: 10px; top: 50%; height: 4px; margin-top: -2px; border-radius: 99px; background: var(--line-strong); }
.ts-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: var(--text); transition: width 0.2s var(--ease); }
.ts-ticks { position: absolute; left: 10px; right: 10px; top: 50%; display: flex; justify-content: space-between; transform: translateY(-50%); pointer-events: none; }
.ts-ticks i { width: 8px; height: 8px; border-radius: 99px; background: var(--line-strong); }
.ts-ticks i.on { background: var(--text); }
.ts-knob { position: absolute; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 999px; background: #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.06); transition: left 0.2s var(--ease); pointer-events: none; }
.ts-label { margin-top: 6px; text-align: center; font-size: calc(13px * min(var(--fs, 1), 1.12)); color: var(--muted); }
.switch { position: relative; width: 50px; height: 30px; flex: none; border-radius: 999px; background: var(--line-strong); transition: background 0.2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.22s var(--ease); }
.switch.on { background: #22c55e; }
.switch.on::after { transform: translateX(20px); }
.install-steps { margin: 0; padding-left: 20px; }
.install-steps li { margin: 8px 0; }
.install-steps svg { width: 18px; height: 18px; display: inline-block; vertical-align: -3px; }

/* =====================================================================
   MODE GELAP
   ===================================================================== */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0f14;
  --surface: #141a21;
  --surface-2: #1a2129;
  --text: #e8edf3;
  --muted: #9aa8b8;
  --faint: #66768a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  --primary: #e8edf3;
  --primary-soft: rgba(255, 255, 255, 0.08);
  --ok: #34d399;
  --ok-bg: rgba(52, 211, 153, 0.13);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.12);
  --bad: #f87171;
  --bad-bg: rgba(248, 113, 113, 0.13);
  --info: #7dd3fc;
  --info-bg: rgba(125, 211, 252, 0.12);
  --sk: #161c23;
  --sk-hi: #1f2730;
  --shadow-up: 0 -10px 40px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] body { background: #000; }
html[data-theme="dark"] .app { background: var(--bg); }
html[data-theme="dark"] .topbar { background: rgba(11, 15, 20, 0.88); }
html[data-theme="dark"] .icon-btn:active, html[data-theme="dark"] .topbar .icon-btn:active { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .tabbar { background: rgba(11, 15, 20, 0.92); }
html[data-theme="dark"] .tab.on { color: var(--text); }
html[data-theme="dark"] .tab.on::after { background: var(--text); }
html[data-theme="dark"] .btn { background: #e8edf3; color: #0b0f14; }
html[data-theme="dark"] .btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.2); }
html[data-theme="dark"] .btn.soft { background: var(--surface-2); color: var(--text); }
html[data-theme="dark"] .btn.danger { background: #dc2626; color: #fff; }
html[data-theme="dark"] .chip.on { background: #e8edf3; color: #0b0f14; }
html[data-theme="dark"] .seg { background: var(--surface-2); }
html[data-theme="dark"] .seg button.on { background: #2a323d; color: var(--text); box-shadow: none; }
html[data-theme="dark"] .option.on { box-shadow: inset 0 0 0 2px var(--text); background: var(--surface-2); }
html[data-theme="dark"] .input:focus, html[data-theme="dark"] .input.bare:focus { border-color: rgba(255, 255, 255, 0.45); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .input:disabled { background: var(--surface-2); }
html[data-theme="dark"] .input.bare:focus { background: var(--surface); }
html[data-theme="dark"] .add-row { border-color: rgba(255, 255, 255, 0.2); color: var(--text); }
html[data-theme="dark"] .add-row:active, html[data-theme="dark"] .chatrow:active, html[data-theme="dark"] button.row:active, html[data-theme="dark"] a.row:active { background: rgba(255, 255, 255, 0.04); }
html[data-theme="dark"] .section-title a, html[data-theme="dark"] .section-title button, html[data-theme="dark"] .link { color: var(--text); }
html[data-theme="dark"] .bubble.mine { background: #e8edf3; color: #0b0f14; }
html[data-theme="dark"] .composer { background: rgba(11, 15, 20, 0.94); }
html[data-theme="dark"] .composer .send { background: #e8edf3; color: #0b0f14; }
html[data-theme="dark"] .progress { background: #232a33; }
html[data-theme="dark"] .progress i { background: var(--text); }
html[data-theme="dark"] .badge { background: #232a33; color: #cbd5e1; }
html[data-theme="dark"] .badge.ok { background: var(--ok-bg); color: var(--ok); }
html[data-theme="dark"] .badge.warn { background: var(--warn-bg); color: var(--warn); }
html[data-theme="dark"] .badge.bad { background: var(--bad-bg); color: var(--bad); }
html[data-theme="dark"] .badge.info { background: var(--info-bg); color: var(--info); }
html[data-theme="dark"] .badge.dark { background: #f43f5e; color: #fff; }
html[data-theme="dark"] .avatar { background: #232a33; }
html[data-theme="dark"] .tone-0 { background: rgba(251, 191, 36, 0.16); color: #fcd34d; }
html[data-theme="dark"] .tone-1 { background: rgba(56, 189, 248, 0.16); color: #7dd3fc; }
html[data-theme="dark"] .tone-2 { background: rgba(167, 139, 250, 0.18); color: #c4b5fd; }
html[data-theme="dark"] .tone-3 { background: rgba(251, 113, 133, 0.16); color: #fda4af; }
html[data-theme="dark"] .tone-4 { background: rgba(74, 222, 128, 0.15); color: #86efac; }
html[data-theme="dark"] .tone-5 { background: rgba(251, 146, 60, 0.16); color: #fdba74; }
html[data-theme="dark"] .ic { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -3px 8px rgba(0, 0, 0, 0.18); }
html[data-theme="dark"] .hero {
  border-color: rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(120% 90% at 100% 100%, rgba(251, 146, 60, 0.2) 0%, rgba(251, 146, 60, 0) 55%),
    radial-gradient(90% 80% at 0% 0%, rgba(56, 189, 248, 0.2) 0%, rgba(56, 189, 248, 0) 60%),
    linear-gradient(135deg, #111c2b 0%, #17162a 50%, #21170f 100%);
}
html[data-theme="dark"] .hero .eyebrow, html[data-theme="dark"] .hero-sub { color: #a3b1c2; }
html[data-theme="dark"] .pill { background: rgba(255, 255, 255, 0.08); color: #e2e8f0; }
html[data-theme="dark"] .pill svg { color: #a3b1c2; }
html[data-theme="dark"] .pill.warm { background: rgba(251, 146, 60, 0.18); color: #fdba74; }
html[data-theme="dark"] .pill.warm svg { color: #fdba74; }
html[data-theme="dark"] .pill.cool { background: rgba(56, 189, 248, 0.16); color: #7dd3fc; }
html[data-theme="dark"] .pill.cool svg { color: #7dd3fc; }
html[data-theme="dark"] .ring { background: conic-gradient(#38bdf8 calc(var(--p) * 1%), rgba(255, 255, 255, 0.1) 0); }
html[data-theme="dark"] .ring::before { background: #121a25; }
html[data-theme="dark"] .bento > a, html[data-theme="dark"] .bento > button { background: var(--surface); }
html[data-theme="dark"] .bento .s.warn { color: #fb923c; }
html[data-theme="dark"] .bento .s.ok { color: #34d399; }
html[data-theme="dark"] .bento .s.info { color: #38bdf8; }
html[data-theme="dark"] .quick button, html[data-theme="dark"] .quick a { color: #cbd5e1; }
html[data-theme="dark"] .mini { background: var(--surface-2); border-color: var(--line); }
html[data-theme="dark"] .quote { background: rgba(56, 189, 248, 0.08); color: #cbd5e1; }
html[data-theme="dark"] .stars button { color: #3a434f; }
html[data-theme="dark"] .stars button.on { color: #f59e0b; }
html[data-theme="dark"] .grid3 .ph, html[data-theme="dark"] .thumbs .ph { background-color: var(--surface-2); }
html[data-theme="dark"] .sheet .grip { background: #3a434f; }
html[data-theme="dark"] .backdrop { background: rgba(0, 0, 0, 0.6); }
html[data-theme="dark"] .toast { background: #e8edf3; color: #0b0f14; }
html[data-theme="dark"] .toast.bad { background: #dc2626; color: #fff; }
html[data-theme="dark"] .toast .btn { background: #0b0f14; color: #fff; }
html[data-theme="dark"] .savebar { background: linear-gradient(to top, var(--bg) 70%, rgba(11, 15, 20, 0)); }
html[data-theme="dark"] .login { background:
    radial-gradient(80% 50% at 100% 0%, rgba(251, 146, 60, 0.14), rgba(251, 146, 60, 0) 70%),
    radial-gradient(80% 50% at 0% 100%, rgba(56, 189, 248, 0.14), rgba(56, 189, 248, 0) 70%); }
html[data-theme="dark"] .date-box { background: rgba(56, 189, 248, 0.12); color: #7dd3fc; }
html[data-theme="dark"] .date-box small { color: #7dd3fc; }
html[data-theme="dark"] .goal-bar i, html[data-theme="dark"] .days14 i { background: #232a33; }
html[data-theme="dark"] .goal-bar i.done { background: linear-gradient(90deg, #38bdf8, #0ea5e9); }
html[data-theme="dark"] .days14 i.yes { background: var(--ok); }
html[data-theme="dark"] .days14 i.no { background: rgba(248, 113, 113, 0.4); }
html[data-theme="dark"] .role-chip { background: rgba(255, 255, 255, 0.1); color: #7dd3fc; }
html[data-theme="dark"] .profile-meta { color: #cbd5e1; }
html[data-theme="dark"] .profile-meta svg { color: #a3b1c2; }
html[data-theme="dark"] .profile-stats { background: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .profile-stats > div:not(:first-of-type) { border-left-color: var(--line); }
html[data-theme="dark"] .chatrow .body, html[data-theme="dark"] .hw-row .body { border-bottom-color: var(--line); }
html[data-theme="dark"] .chatrow .time.unread { color: #4ade80; }
html[data-theme="dark"] .row, html[data-theme="dark"] .row + .row { border-top-color: var(--line); }
html[data-theme="dark"] .rep-item, html[data-theme="dark"] .pr-edit, html[data-theme="dark"] .task-row { background: var(--surface-2); border-color: var(--line); }
html[data-theme="dark"] .rep-del:active { background: #232a33; }
html[data-theme="dark"] .slot { background: var(--surface-2); }
html[data-theme="dark"] .slot.add { background: transparent; border-color: #3a434f; }
html[data-theme="dark"] .task-row .tick, html[data-theme="dark"] .status-dot, html[data-theme="dark"] .check-btn { border-color: #3a434f; }
html[data-theme="dark"] .task-row .tick.on, html[data-theme="dark"] .status-dot.on, html[data-theme="dark"] .check-btn.on { border-color: #22c55e; }
html[data-theme="dark"] .copy-bar { background: rgba(129, 140, 248, 0.12); }
html[data-theme="dark"] .copy-bar b { color: #c7d2fe; }
html[data-theme="dark"] .copy-bar small, html[data-theme="dark"] .copy-bar .chev { color: #a5b4fc; }
html[data-theme="dark"] .pr-edit .input, html[data-theme="dark"] .link-input, html[data-theme="dark"] .att-open { background: var(--surface); }
html[data-theme="dark"] .att-ic { background: #232a33; color: #cbd5e1; }
html[data-theme="dark"] .att-link { color: #7dd3fc; }
html[data-theme="dark"] .insight-box { background: rgba(255, 255, 255, 0.05); }
html[data-theme="dark"] .insight-label.ok { color: #34d399; }
html[data-theme="dark"] .insight-label.warn { color: #fbbf24; }
html[data-theme="dark"] .insight-label.info { color: #a5b4fc; }
html[data-theme="dark"] .empty svg { color: #3a434f; }
html[data-theme="dark"] .ptr { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--line); }
html[data-theme="dark"] .screen.dragging { box-shadow: -12px 0 30px rgba(0, 0, 0, 0.5); }
html[data-theme="dark"] .ts-knob { background: #e8edf3; }
html[data-theme="dark"] .ts-preview { background: var(--surface-2); }
html[data-theme="dark"] input[type="date"], html[data-theme="dark"] input[type="time"], html[data-theme="dark"] input[type="datetime-local"] { color-scheme: dark; }
html[data-theme="dark"] .card.press:active, html[data-theme="dark"] .bento > a:active { background: var(--surface-2); }
@media (min-width: 520px) { html[data-theme="dark"] .app { box-shadow: 0 0 0 1px var(--line); } }
.between > .sk, .sk-in > .sk, .sk-row > .sk, .scroll-x > .sk { margin-top: 0; }
.sk-in > .sk.line + .sk.line { margin-top: 0; }
/* Animasi masuk (fill: both) menahan transform; matikan saat ditarik/digeser */
main.screen.pulling, main.screen.release, main.screen.settle, main.screen.dragging { animation: none; }
.row.wrap .title, .row.wrap .sub { white-space: normal; }

/* =====================================================================
   KERANGKA APLIKASI TETAP: jendela tidak digulir, hanya <main>.
   Mencegah navigasi bawah "terangkat" dan halaman memantul di iPhone.
   ===================================================================== */
html, body { height: 100%; overflow: hidden; background: var(--bg); }
@media (min-width: 520px) {
  body { background: #f1f5f9; }
  html[data-theme="dark"] body { background: #000; }
}
@media (max-width: 519px) {
  html[data-theme="dark"] body { background: var(--bg); }
}
.app { height: 100%; height: 100dvh; min-height: 0; overflow: hidden; }
.screen {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}
.topbar { position: relative; flex: none; }
.app > .banner, .app .banner[x-show] { flex: none; }
.login { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; }
.login { justify-content: safe center; }
/* Bilah status transparan (iPhone, tema gelap): beri ruang di bagian atas layar penuh */
.login { padding-top: calc(32px + var(--safe-t)); }

/* Navigasi bawah ikut alur tata letak (bukan "fixed") → selalu menempel di dasar aplikasi */
.app { height: var(--app-h, 100dvh); }
.tabbar { position: relative; left: auto; bottom: auto; transform: none; flex: none; width: 100%; max-width: none; }
html.kb .tabbar { display: none; transform: none; }
.screen { padding-bottom: 28px; }
.screen.no-nav { padding-bottom: calc(32px + var(--safe-b)); }
.toast { bottom: calc(96px + var(--safe-b)); }

/* Kerangka aplikasi menempel ke empat sisi layar (tanpa menghitung tinggi sendiri).
   iPhone mode aplikasi sering salah melaporkan 100dvh/innerHeight; posisi "fixed" + inset
   selalu mengikuti area layar yang sebenarnya, jadi navigasi bawah tidak terdorong keluar. */
.app { position: fixed; top: 0; right: 0; bottom: 0; left: 0; height: auto; min-height: 0; max-width: 480px; margin: 0 auto; }

/* Bilah status transparan (dipilih saat pasang dengan tema gelap) tapi sekarang tema terang:
   beri latar gelap di area jam/baterai supaya ikon putihnya tetap terbaca. */
html.sb-tl[data-theme="light"] .app::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 95;
  height: env(safe-area-inset-top, 0px);
  background: #0f172a;
  pointer-events: none;
}

/* =====================================================================
   AKTIVASI AKUN, LUPA PASSWORD, NOTIFIKASI
   ===================================================================== */
.linkish { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.invite { justify-content: flex-start; padding-top: calc(28px + var(--safe-t)); }
.invite .brand { margin-bottom: 28px; }
.invite h2 { font-size: calc(30px * var(--fs, 1)); }
.invite .lead { margin-bottom: 22px; }
.school-chip { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; margin-bottom: 18px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); font-weight: 600; font-size: calc(14px * var(--fs, 1)); }
.school-chip .logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; overflow: hidden; background: linear-gradient(160deg, #7dd3fc, #0284c7); color: #fff; font-size: 12px; font-weight: 700; }
.school-chip .logo img { width: 100%; height: 100%; object-fit: cover; }
.invite-error { display: grid; justify-items: start; gap: 6px; }
.invite-error h2 { margin-top: 14px; }
.input.bad { border-color: var(--bad); }
.help.bad { color: var(--bad); }
.pw { position: relative; }
.pw .input { padding-right: 104px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 8px 12px; border-radius: 10px; font-size: calc(13px * var(--fs, 1)); font-weight: 600; color: var(--muted); }
.pw-eye:active { background: var(--line); }
.pw-meter { display: flex; align-items: center; gap: 10px; margin: 8px 2px 0; font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.pw-meter i { position: relative; flex: 1; height: 4px; border-radius: 99px; background: var(--line-strong); overflow: hidden; }
.pw-meter i::after { content: ''; position: absolute; inset: 0 auto 0 0; border-radius: inherit; transition: width 0.3s var(--ease), background 0.3s; }
.pw-meter i.on1::after { width: 33%; background: var(--bad); }
.pw-meter i.on2::after { width: 66%; background: #f59e0b; }
.pw-meter i.on3::after { width: 100%; background: #22c55e; }
.consents { margin-top: 4px; }
.consent-card { padding: 14px; border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.consent-card + .consent-card { margin-top: 10px; }
.consent-card .who { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.consent-card .who b { display: block; }
.consent-card .who small { color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); }
.check-opt { display: flex; align-items: flex-start; gap: 12px; padding: 10px 2px; cursor: pointer; border-top: 1px solid var(--line); }
.check-opt input { position: absolute; opacity: 0; pointer-events: none; }
.check-opt .box { display: grid; place-items: center; flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 8px; box-shadow: inset 0 0 0 2px var(--line-strong); color: transparent; transition: background 0.15s, box-shadow 0.15s; }
.check-opt .box svg { width: 15px; height: 15px; stroke-width: 3; }
.check-opt input:checked + .box { background: var(--text); box-shadow: none; color: var(--bg); }
.check-opt input:focus-visible + .box { outline: 2px solid var(--text); outline-offset: 2px; }
.check-opt b { font-weight: 600; font-size: calc(14.5px * var(--fs, 1)); }
.check-opt small { display: block; margin-top: 2px; color: var(--muted); font-size: calc(13px * var(--fs, 1)); line-height: 1.4; }
.check-opt em.req { font-style: normal; font-size: calc(11px * var(--fs, 1)); font-weight: 600; color: var(--bad); }
.push-card { display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 14px; border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.push-card b { display: block; font-size: calc(14.5px * var(--fs, 1)); }
.push-card small { display: block; color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); line-height: 1.35; }
.push-card .btn.sm { flex: none; min-height: 36px; }
.push-card .x { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 999px; color: var(--faint); }
.push-card .x svg { width: 16px; height: 16px; }
.setup-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; margin-top: 10px; border-radius: 18px; text-align: left; box-shadow: inset 0 0 0 1px var(--line-strong); }
.setup-row b { display: block; }
.setup-row small { display: block; color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); }
.setup-row .chev { color: var(--faint); }
.setup-row .chev svg { width: 18px; height: 18px; }
.setup-row:active { background: var(--line); }
html[data-theme="dark"] .school-chip, html[data-theme="dark"] .consent-card, html[data-theme="dark"] .push-card { background: var(--surface); }

/* Animasi pindah layar tidak boleh "menahan" transform setelah selesai: elemen dengan transform
   menjadi acuan posisi "fixed", sehingga tombol simpan / kolom chat ikut tergulir. */
.screen.nav-fwd, .screen.nav-back, .screen.nav-tab { animation-fill-mode: backwards; }
.screen { -webkit-overflow-scrolling: auto; }

/* =====================================================================
   LAPORAN PERFORMA GURU (dibagikan koordinator) — grafik .pc-*
   Biru = Anda, oranye = seri kedua, abu tinta putus-putus = rata-rata tim.
   ===================================================================== */
.perf {
  --pc-s1: #2a78d6; --pc-s2: #eb6834; --pc-s3: #c9c8c2; --pc-ref: #52514e;
  --pc-grid: rgba(15, 23, 42, 0.07); --pc-track: #f1f1ef;
  --pc-l0: #f1f1ef; --pc-l1: #cde2fb; --pc-l2: #86b6ef; --pc-l3: #3987e5; --pc-l4: #1c5cab;
}
html[data-theme="dark"] .perf {
  --pc-s1: #3987e5; --pc-s2: #d95926; --pc-s3: #4a4a46; --pc-ref: #c3c2b7;
  --pc-grid: rgba(255, 255, 255, 0.08); --pc-track: #232a33;
  --pc-l0: #1d242d; --pc-l1: #184f95; --pc-l2: #256abf; --pc-l3: #5598e7; --pc-l4: #9ec5f4;
}
.pc-hero { padding: 20px 18px; }
.pc-score-row { display: flex; align-items: center; gap: 12px; margin: 2px 0 6px; flex-wrap: wrap; }
.pc-score { font-family: var(--heading); font-size: calc(60px * var(--fs, 1)); font-weight: 600; letter-spacing: -0.06em; line-height: 1.02; font-variant-numeric: tabular-nums; }
.pc-tone { border-radius: 999px; padding: 3px 10px; font-size: calc(12.5px * var(--fs, 1)); font-weight: 650; }
.pc-tone.good { background: var(--ok-bg, #e9f7ef); color: var(--ok, #0f7a3d); }
.pc-tone.mid { background: var(--warn-bg, #fff6e0); color: var(--warn, #8a5a00); }
.pc-tone.low { background: var(--bad-bg, #fdecec); color: var(--bad, #b42323); }
.pc-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: calc(13px * var(--fs, 1)); }
.pc-adjust { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2, #f6f7f8); font-size: calc(13px * var(--fs, 1)); line-height: 1.45; }
.pc-adjust b { display: block; font-weight: 600; margin-bottom: 2px; }
.pc-note-h { display: flex; align-items: center; gap: 10px; }
.pc-note p { margin: 10px 0 0; font-size: calc(14.5px * var(--fs, 1)); line-height: 1.6; white-space: pre-line; }
.pc-stats .stat b { display: flex; align-items: baseline; gap: 1px; }
.pc-stats .stat b small { font-size: calc(13px * var(--fs, 1)); font-weight: 500; color: var(--muted); }
.pc-stats .stat em { font-style: normal; display: block; margin-top: 6px; }
.pc-card { padding: 16px; }
.pc-h { font-weight: 650; font-size: calc(15px * var(--fs, 1)); }
.pc-d { color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); margin: 2px 0 12px; line-height: 1.4; }
.pc-empty { color: var(--muted); font-size: calc(13px * var(--fs, 1)); margin: 0; }
.pc-muted { color: var(--muted); font-size: calc(12px * var(--fs, 1)); }
.pc-chip { display: inline-flex; align-items: center; gap: 2px; border-radius: 999px; padding: 1px 8px; font-size: calc(11.5px * var(--fs, 1)); font-weight: 650; white-space: nowrap; }
.pc-chip.up { background: var(--ok-bg, #e9f7ef); color: var(--ok, #0f7a3d); }
.pc-chip.down { background: var(--warn-bg, #fdf0e6); color: var(--warn, #a24a10); }

.pc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: calc(12px * var(--fs, 1)); color: var(--muted); margin-bottom: 8px; }
.pc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pc-legend b { color: var(--text); font-weight: 650; }
.pc-key { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.pc-key.pc-key-dash { height: 0; border-radius: 0; border-top: 2px dashed var(--pc-ref); background: none !important; }
.pc-key.pc-s1, .pc-bar.pc-s1, .pc-fill.pc-s1, .pc-seg.pc-s1 { background: var(--pc-s1); }
.pc-key.pc-s2, .pc-bar.pc-s2, .pc-seg.pc-s2 { background: var(--pc-s2); }
.pc-key.pc-s3, .pc-seg.pc-s3 { background: var(--pc-s3); }

.pc-svg { width: 100%; height: auto; display: block; overflow: visible; }
.pc-grid { stroke: var(--pc-grid); stroke-width: 1; }
.pc-tick { fill: var(--muted); color: var(--muted); font-size: 10.5px; }
.pc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pc-line.pc-s1 { stroke: var(--pc-s1); } .pc-line.pc-s2 { stroke: var(--pc-s2); } .pc-line.pc-ref { stroke: var(--pc-ref); }
.pc-line.pc-dash { stroke-dasharray: 4 4; stroke-width: 1.5; }
.pc-dot { stroke: var(--surface, #fff); stroke-width: 2; }
.pc-dot.pc-s1 { fill: var(--pc-s1); } .pc-dot.pc-s2 { fill: var(--pc-s2); }
.pc-end { fill: var(--text); font-size: 11px; font-weight: 650; }

.pc-cols { display: flex; gap: 8px; align-items: flex-end; }
.pc-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pc-val { text-align: center; font-size: calc(11.5px * var(--fs, 1)); font-weight: 650; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.pc-group { display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--pc-grid); }
.pc-bw { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.pc-bar { width: 100%; border-radius: 4px 4px 0 0; }
.pc-bar.pc-none { height: 3px; background: var(--pc-track); border-radius: 2px; }
.pc-cl { text-align: center; margin-top: 6px; font-size: calc(10.5px * var(--fs, 1)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pc-cmps { display: flex; flex-direction: column; gap: 14px; }
.pc-cmp-h { display: flex; justify-content: space-between; gap: 8px; font-size: calc(13.5px * var(--fs, 1)); margin-bottom: 6px; }
.pc-cmp-h small, .pc-cmp-f small { color: var(--muted); font-size: calc(11.5px * var(--fs, 1)); }
.pc-cmp-h b { font-variant-numeric: tabular-nums; }
.pc-track { position: relative; height: 10px; border-radius: 999px; background: var(--pc-track); }
.pc-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }
.pc-avg { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--pc-ref); border-radius: 1px; }
.pc-avg-key { display: inline-block; width: 2px; height: 10px; background: var(--pc-ref); margin-right: 6px; vertical-align: -1px; }
.pc-cmp-f { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }

.pc-calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.pc-cal-h { font-size: calc(10.5px * var(--fs, 1)); color: var(--muted); text-align: center; }
.pc-cal { border-radius: 8px; min-height: 40px; padding: 4px 5px; display: flex; flex-direction: column; justify-content: space-between; font-size: calc(11.5px * var(--fs, 1)); font-weight: 650; cursor: pointer; }
.pc-cal small { font-size: calc(9.5px * var(--fs, 1)); font-weight: 500; opacity: 0.85; }
.pc-l0 { background: var(--pc-l0); color: var(--muted); }
.pc-l1, .pc-l2 { color: #0d366b; } .pc-l3, .pc-l4 { color: #fff; }
.pc-l1 { background: var(--pc-l1); } .pc-l2 { background: var(--pc-l2); } .pc-l3 { background: var(--pc-l3); } .pc-l4 { background: var(--pc-l4); }
html[data-theme="dark"] .perf .pc-l1, html[data-theme="dark"] .perf .pc-l2 { color: #fff; }
html[data-theme="dark"] .perf .pc-l3, html[data-theme="dark"] .perf .pc-l4 { color: #0d366b; }
.pc-cal-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 10px; font-size: calc(11px * var(--fs, 1)); color: var(--muted); }
.pc-cal-legend span { display: inline-flex; align-items: center; gap: 4px; }
.pc-cal-legend i.pc-cal { width: 11px; height: 11px; min-height: 0; padding: 0; border-radius: 3px; display: inline-block; cursor: default; }

.pc-stack { display: flex; gap: 2px; height: 14px; border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.pc-seg:first-child { border-radius: 999px 0 0 999px; } .pc-seg:last-child { border-radius: 0 999px 999px 0; } .pc-seg:only-child { border-radius: 999px; }
.icon-btn:disabled { opacity: 0.3; pointer-events: none; }
.pc-stats .stat b span { font-size: inherit; color: inherit; }

/* ---- Laporan perkembangan anak: grafik tambahan ---- */
.perf {
  --pc-c1: #2a78d6; --pc-c2: #eb6834; --pc-c3: #1baf7a; --pc-c4: #eda100; --pc-c5: #e87ba4; --pc-c6: #008300; --pc-bad: #e34948;
}
html[data-theme="dark"] .perf {
  --pc-c1: #3987e5; --pc-c2: #d95926; --pc-c3: #199e70; --pc-c4: #c98500; --pc-c5: #d55181; --pc-c6: #008300; --pc-bad: #e66767;
}
.mt-s { margin-top: 10px; }
.pc-c1 { background: var(--pc-c1); } .pc-c2 { background: var(--pc-c2); } .pc-c3 { background: var(--pc-c3); }
.pc-c4 { background: var(--pc-c4); } .pc-c5 { background: var(--pc-c5); } .pc-c6 { background: var(--pc-c6); }
.pc-vstack { display: flex; flex-direction: column-reverse; gap: 2px; border-radius: 6px; overflow: hidden; }
.pc-vseg.pc-empty-seg { background: var(--pc-track); }
.pc-dist { display: flex; flex-direction: column; gap: 10px; }
.pc-drow { display: grid; grid-template-columns: minmax(80px, 38%) 1fr 34px; gap: 10px; align-items: center; font-size: calc(13px * var(--fs, 1)); }
.pc-dl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-drow b { text-align: right; font-variant-numeric: tabular-nums; }
.pc-at-present { background: var(--pc-c1); color: #fff; } .pc-at-sick { background: var(--pc-c2); color: #fff; }
.pc-at-permit { background: var(--pc-c4); color: #3d2a00; } .pc-at-absent { background: var(--pc-bad); color: #fff; }
.pc-at-none { background: var(--pc-l0); color: var(--muted); }
.pc-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.pc-step { height: 10px; background: var(--pc-track); border-radius: 3px; position: relative; }
.pc-step:first-child { border-radius: 999px 3px 3px 999px; } .pc-step:last-child { border-radius: 3px 999px 999px 3px; }
.pc-step.on { background: var(--pc-s1); }
.pc-step.target::after { content: ''; position: absolute; right: -3px; top: -4px; bottom: -4px; width: 2px; background: var(--pc-ref); border-radius: 1px; }
.pc-goal .pc-cmp-h span { line-height: 1.35; }
.pc-meter { display: flex; align-items: center; gap: 10px; } .pc-meter .pc-track { flex: 1; } .pc-meter b { min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }

/* Worksheet kelompok */
.ws-team { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2, #f6f7f8); font-size: calc(13px * var(--fs, 1)); }
.ws-team b { display: block; font-weight: 650; }
.ws-team span:not(.ic) { color: var(--muted); }

/* =====================================================================
   CATATAN HARIAN — tampilan baca (orang tua & guru)
   ===================================================================== */
.nv { --nv-good: var(--ok); --nv-good-bg: var(--ok-bg); --nv-mid: var(--warn); --nv-mid-bg: var(--warn-bg); --nv-low: var(--bad); --nv-low-bg: var(--bad-bg); }
.nv > * + * { margin-top: 12px; }

.nv-hero {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 18px 16px 16px;
  background: linear-gradient(140deg, #fff7ed 0%, #fdf2f8 48%, #eef2ff 100%);
  border: 1px solid rgba(15, 23, 42, 0.05);
}
.nv-hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.7), transparent 70%); pointer-events: none; }
.nv-hero-top { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.nv-avatar { width: 54px; height: 54px; font-size: calc(18px * var(--fs, 1)); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85); }
.nv-kicker { font-size: calc(12.5px * var(--fs, 1)); color: #64748b; font-weight: 500; }
.nv-date { font-family: var(--heading); font-size: calc(23px * var(--fs, 1)); font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; margin: 2px 0 3px; }
.nv-by { font-size: calc(12.5px * var(--fs, 1)); color: #64748b; }
.nv-hero-chips { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; position: relative; z-index: 1; }
.nv-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border-radius: 14px; background: rgba(255, 255, 255, 0.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.nv-chip small { display: block; font-size: calc(10.5px * var(--fs, 1)); color: #64748b; line-height: 1.2; }
.nv-chip b { display: block; font-size: calc(13.5px * var(--fs, 1)); font-weight: 650; line-height: 1.25; }
.nv-emo { font-size: calc(20px * var(--fs, 1)); line-height: 1; }
.nv-chip .nv-emo { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: #fff; font-size: calc(18px * var(--fs, 1)); }

.nv-mosaic { display: grid; gap: 4px; border-radius: var(--r-lg); overflow: hidden; }
.nv-mosaic.n1 { grid-template-columns: 1fr; }
.nv-mosaic.n1 .nv-ph { aspect-ratio: 16 / 10; }
.nv-mosaic.n2 { grid-template-columns: 1fr 1fr; }
.nv-mosaic.n2 .nv-ph { aspect-ratio: 4 / 5; }
.nv-mosaic.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 3 / 2; }
.nv-mosaic.n3 .nv-ph.big { grid-row: span 2; }
.nv-ph { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: var(--surface-2, #eef0f2); overflow: hidden; }
.nv-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nv-vid { position: absolute; inset: 0; display: grid; place-items: center; background: #0f172a; color: #fff; }
.nv-vid span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.nv-more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(15, 23, 42, 0.45); color: #fff; font-weight: 650; font-size: calc(20px * var(--fs, 1)); }

.nv-quote { border-radius: var(--r-lg); padding: 14px 16px 16px; border: 1px solid var(--line); background: var(--surface); }
.nv-quote.achieve { background: linear-gradient(135deg, #fffbeb, #fff7ed); border-color: rgba(245, 158, 11, 0.18); }
.nv-quote.message { background: linear-gradient(135deg, #fdf2f8, #f5f3ff); border-color: rgba(236, 72, 153, 0.14); }
.nv-quote-h { display: flex; align-items: center; gap: 8px; font-size: calc(13px * var(--fs, 1)); }
.nv-quote-h .nv-emo { font-size: calc(17px * var(--fs, 1)); }
.nv-quote p { margin: 8px 0 0; font-size: calc(15.5px * var(--fs, 1)); line-height: 1.6; white-space: pre-line; }

.nv-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px 6px; }
.nv-card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; font-size: calc(15px * var(--fs, 1)); }
.nv-sec-ic { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; font-size: calc(17px * var(--fs, 1)); }
.nv-sec-ic.c-orange { background: #fff1e6; } .nv-sec-ic.c-indigo { background: #eef0ff; } .nv-sec-ic.c-teal { background: #e6f8f5; }
.nv-sec-ic.c-pink { background: #fdecf4; } .nv-sec-ic.c-amber { background: #fff6dc; } .nv-sec-ic.c-green { background: #e8f8ee; } .nv-sec-ic.c-blue { background: #e9f2fe; }
.nv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.nv-card-h + .nv-row, .nv-span + .nv-row { border-top: 0; }
.nv-row.stack { flex-direction: column; align-items: stretch; gap: 8px; }
.nv-label { color: var(--muted); font-size: calc(13.5px * var(--fs, 1)); }
.nv-val { font-weight: 550; text-align: right; font-size: calc(14px * var(--fs, 1)); }
.nv-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 12px; font-size: calc(13.5px * var(--fs, 1)); font-weight: 600; white-space: nowrap; background: var(--surface-2, #f2f3f5); }
.nv-pill.t-good { background: var(--nv-good-bg); color: var(--nv-good); }
.nv-pill.t-mid { background: var(--nv-mid-bg); color: var(--nv-mid); }
.nv-pill.t-low { background: var(--nv-low-bg); color: var(--nv-low); }
.nv-pill-ic { width: 14px; height: 14px; display: inline-grid; }
.nv-pill-ic svg { width: 14px; height: 14px; }
.nv-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.nv-tag { border-radius: 999px; padding: 4px 11px; font-size: calc(13px * var(--fs, 1)); font-weight: 550; background: var(--surface-2, #f2f3f5); }
.nv-stars { display: inline-flex; gap: 2px; }
.nv-stars i { width: 18px; height: 18px; color: #d9dce1; display: inline-grid; }
.nv-stars i svg { width: 18px; height: 18px; fill: currentColor; }
.nv-stars i.on { color: #f5b301; }
.nv-num b { font-family: var(--heading); font-size: calc(19px * var(--fs, 1)); font-weight: 650; letter-spacing: -0.01em; }
.nv-num small { margin-left: 3px; color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); }
.nv-time { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.nv-time span:first-child { width: 15px; height: 15px; display: inline-grid; color: var(--muted); }
.nv-time svg { width: 15px; height: 15px; }
.nv-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.nv-steps li { position: relative; padding: 0 0 10px 30px; font-size: calc(14.5px * var(--fs, 1)); line-height: 1.45; counter-increment: s; }
.nv-steps li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; background: #fdecf4; color: #be185d; font-size: calc(11.5px * var(--fs, 1)); font-weight: 700; }
.nv-steps li:not(:last-child)::after { content: ''; position: absolute; left: 10px; top: 22px; bottom: 2px; width: 1px; background: var(--line-strong); }

.nv-span { padding: 8px 0 12px; }
.nv-span-times { display: flex; align-items: baseline; justify-content: space-between; font-family: var(--heading); font-size: calc(20px * var(--fs, 1)); font-weight: 650; font-variant-numeric: tabular-nums; }
.nv-span-dur { font-family: var(--body); font-size: calc(12.5px * var(--fs, 1)); font-weight: 600; color: #4f46e5; background: #eef0ff; padding: 3px 10px; border-radius: 999px; }
.nv-span-bar { position: relative; height: 8px; border-radius: 999px; background: #eef0ff; margin: 8px 0 6px; }
.nv-span-bar i { position: absolute; inset: 0; border-radius: 999px; background: linear-gradient(90deg, #a5b4fc, #6366f1); }
.nv-span-bar::before, .nv-span-bar::after { content: ''; position: absolute; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: #fff; border: 2.5px solid #6366f1; z-index: 1; }
.nv-span-bar::before { left: -2px; } .nv-span-bar::after { right: -2px; }
.nv-span-labels { display: flex; justify-content: space-between; color: var(--muted); }
.nv-span-labels small { font-size: calc(12px * var(--fs, 1)); }

.nv-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nv-nav-btn { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); text-align: left; color: inherit; }
.nv-nav-btn.right { justify-content: flex-end; text-align: right; }
.nv-nav-btn > span:not([x-html]) { min-width: 0; }
.nv-nav-btn small { display: block; color: var(--muted); font-size: calc(11.5px * var(--fs, 1)); }
.nv-nav-btn b { display: block; font-size: calc(13.5px * var(--fs, 1)); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-nav-btn svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.nv-nav-btn:disabled { opacity: 0.4; }

/* Mode gelap */
html[data-theme="dark"] .nv-hero { background: linear-gradient(140deg, #2a1f17 0%, #2a1825 48%, #1b1f36 100%); border-color: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .nv-hero::after { background: radial-gradient(circle, rgba(255, 255, 255, 0.06), transparent 70%); }
html[data-theme="dark"] .nv-kicker, html[data-theme="dark"] .nv-by, html[data-theme="dark"] .nv-chip small { color: var(--muted); }
html[data-theme="dark"] .nv-avatar { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .nv-chip { background: rgba(255, 255, 255, 0.07); }
html[data-theme="dark"] .nv-chip .nv-emo { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .nv-quote.achieve { background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(249, 115, 22, 0.08)); border-color: rgba(245, 158, 11, 0.2); }
html[data-theme="dark"] .nv-quote.message { background: linear-gradient(135deg, rgba(236, 72, 153, 0.11), rgba(139, 92, 246, 0.09)); border-color: rgba(236, 72, 153, 0.18); }
html[data-theme="dark"] .nv-sec-ic { background: rgba(255, 255, 255, 0.07) !important; }
html[data-theme="dark"] .nv-stars i { color: #3a4350; }
html[data-theme="dark"] .nv-steps li::before { background: rgba(236, 72, 153, 0.16); color: #f9a8d4; }
html[data-theme="dark"] .nv-span-dur { background: rgba(99, 102, 241, 0.18); color: #c7d2fe; }
html[data-theme="dark"] .nv-span-bar { background: rgba(99, 102, 241, 0.16); }
html[data-theme="dark"] .nv-span-bar::before, html[data-theme="dark"] .nv-span-bar::after { background: var(--surface); }

/* Laporan perkembangan: catatan dari sekolah (gaya surat) */
.rp-letter { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 18px 16px; }
.rp-letter-h { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.rp-letter-h b { display: block; font-size: calc(15.5px * var(--fs, 1)); }
.rp-letter-h small { display: block; color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); }
.rp-body { margin-top: 14px; font-size: calc(15.5px * var(--fs, 1)); line-height: 1.65; }
.rp-sec { margin-top: 16px; }
.rp-sec ul { margin: 6px 0 0; padding-left: 18px; font-size: calc(14.5px * var(--fs, 1)); line-height: 1.55; }
.rp-sec li + li { margin-top: 4px; }
.rp-note { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2, #f6f7f8); }
.rp-note small { color: var(--muted); font-size: calc(12px * var(--fs, 1)); font-weight: 600; }
.rp-note p { margin: 4px 0 0; font-size: calc(14.5px * var(--fs, 1)); line-height: 1.55; }
.rp-sign { margin-top: 18px; display: flex; flex-direction: column; gap: 2px; font-size: calc(14px * var(--fs, 1)); }
.rp-sign span { color: var(--muted); }
.rp-sign b { font-weight: 650; }
.rp-sign small { color: var(--muted); font-size: calc(12.5px * var(--fs, 1)); }

/* ---------- Offline: antrean kirim (v30) ---------- */
.banner.ob-banner { width: calc(100% - 32px); align-items: center; border: 0; font: inherit; text-align: left; cursor: pointer; }
.banner.ob-banner .grow { flex: 1; }
.banner.ob-banner b { font-weight: 600; }
.banner .spin { animation: spin .9s linear infinite; }
.thumbs .ph.ph-local { position: relative; }
.thumbs .ph.ph-local img { opacity: .55; }
.ph-wait { position: absolute; right: 4px; bottom: 4px; width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; }
.ph-wait svg { width: 14px; height: 14px; }
.ob-list .row .sub { white-space: normal; }
