/* iTutor: tampilan "Buku Kotak" untuk HP. */
:root {
  --ground: #EEF3FB;
  --surface: #FFFFFF;
  --line: #D6DEEC;
  --line-strong: #C3CEE2;
  --grid: #E2EAF8;
  --ink: #18233F;
  --ink-2: #46536F;
  --blue: #2459E0;
  --blue-text: #1B46B8;
  --blue-tint: #E3ECFF;
  --orange: #D9590B;
  --orange-text: #8A3606;
  --orange-tint: #FFE9D6;
  --teal: #0B8A7A;
  --teal-text: #086B5F;
  --teal-tint: #DDF3EE;
  --yellow: #FFE08A;
  --red-text: #A32222;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.icon.small { width: 16px; height: 16px; }
.icon.large { width: 26px; height: 26px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; }
.view { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* ---- pieces ---- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: var(--blue); color: #FFFFFF; }
.brand-name { font-size: 20px; font-weight: 800; }
.brand-large .brand-mark { width: 52px; height: 52px; border-radius: 14px; }
.brand-large .brand-mark .icon { width: 28px; height: 28px; }
.brand-large .brand-name { font-size: 28px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px; border: 1px solid var(--line-strong); border-radius: 26px; background: var(--surface); font-size: 16px; font-weight: 800; }
.button.primary { border-color: var(--blue); background: var(--blue); color: #FFFFFF; }
.button.quiet { min-height: 44px; padding: 0 14px; border-color: transparent; background: transparent; color: var(--ink-2); font-size: 14px; }
.button.wide { width: 100%; }
.round { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 48px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); }
.round.primary { border-color: var(--blue); background: var(--blue); color: #FFFFFF; }
.round[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-tint); color: var(--teal-text); }
/* Listening: a ring that grows with what the microphone hears. */
#hands-free[aria-pressed="true"], #mic[aria-pressed="true"] { box-shadow: 0 0 0 calc(2px + var(--mic-level, 0) * 9px) rgba(11, 138, 122, 0.28); transition: box-shadow 80ms linear; }
.ear-log { margin: 0; padding: 8px 16px 12px 32px; font-size: 12px; line-height: 1.4; color: var(--muted, #46536F); background: var(--surface, #fff); }
.ear-log li { margin-bottom: 6px; }
.ear-log audio { display: block; width: 100%; height: 32px; margin-top: 4px; }
.field { min-width: 0; height: 52px; padding: 0 16px; border: 2px solid var(--line-strong); border-radius: 26px; background: var(--surface); font-size: 16px; font-weight: 600; }
.field:focus { border-color: var(--blue); outline: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 22px; background: var(--surface); font-size: 14px; font-weight: 700; }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #FFFFFF; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.card h2 { font-size: 16px; font-weight: 800; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tag { margin-left: 6px; padding: 2px 8px; border-radius: 10px; background: var(--orange-tint); color: var(--orange-text); font-size: 11px; font-weight: 800; }
.banner { padding: 12px 14px; border-radius: 16px; background: var(--orange-tint); font-size: 14px; line-height: 1.45; }
.error { color: var(--red-text); font-size: 14px; font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(440px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 16px; background: var(--ink); color: #FFFFFF; font-size: 14px; line-height: 1.4; z-index: 10; }

/* ---- masuk ---- */
.login { justify-content: center; gap: 14px; padding: 32px 24px; }
.login-title { margin-top: 18px; font-size: 26px; font-weight: 800; }
.login-form { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.field-code { text-align: center; font-size: 24px; font-weight: 800; letter-spacing: 0.12em; }
.login-links { display: flex; justify-content: space-between; gap: 8px; }
.login-links .button { padding: 0 6px; color: var(--blue-text); }

/* ---- beranda ---- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; }
.home-main { flex: 1 1 auto; display: flex; flex-direction: column; gap: 12px; padding: 0 16px 16px; }
.countdown { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-radius: 22px; background: var(--blue); color: #FFFFFF; }
.countdown-label { font-size: 13px; font-weight: 700; color: #DCE7FF; }
.countdown-days { font-size: 34px; line-height: 1.15; font-weight: 800; }
.countdown-note { font-size: 14px; }
.today { display: flex; align-items: center; gap: 12px; }
.today-title { font-size: 17px; font-weight: 800; }
.glyph { display: flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 48px; border-radius: 14px; font-size: 24px; font-weight: 800; }
.glyph-orange { background: var(--orange-tint); color: var(--orange-text); }
.chip-teal { border-color: #BFE3DC; }
.askbar { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--ground); border-top: 1px solid var(--line); }
.askbar .field { flex: 1 1 auto; }

/* ---- sesi ---- */
.session { height: 100vh; height: 100dvh; min-height: 0; }
.session-head { display: flex; align-items: center; gap: 10px; padding: 6px 12px; }
.session-titles { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.session-kicker { font-size: 12px; font-weight: 800; color: var(--blue-text); }
.session-title { font-size: 17px; line-height: 1.25; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The sheet fills the board's width, so its writing is as big as the phone allows; when the board is shorter than
   the sheet, the board scrolls (and follows the pen, see boardView in app.js). */
.board-area {
  position: relative; flex: 1 1 0; min-height: 160px; margin: 0 8px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 20px; background-color: var(--surface);
}
.board {
  position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px; background-attachment: local;
}
/* The sheet runs on down: a part per answer (app.js stage), each as wide as the board (or, shown whole, as tall as it),
   the student's question over each part after the first. An old part may be a picture of itself. */
.sheet-part iframe, .sheet-picture { display: block; width: 100%; aspect-ratio: 400 / 520; height: auto; border: 0; background: transparent; }
.sheet-part:last-child iframe, .sheet-part:last-child .sheet-picture { min-height: var(--board-h, 0px); }
.sheet-picture { object-fit: contain; }
.sheet-head { display: flex; align-items: flex-start; gap: 8px; margin: 10px 16px 0; padding: 12px 0 2px; border-top: 2px dashed var(--line-strong); font-size: 13px; line-height: 1.35; font-weight: 700; color: var(--ink-2); }
.sheet-head::before { content: attr(data-badge); flex: none; padding: 1px 8px; border-radius: 999px; background: var(--blue-tint, #E8EEFF); color: var(--blue-text); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.sheet-head span { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
/* Three lines of what is said, always the same height, so the board never jumps as lines change. */
.caption { height: calc(3 * 1.35 * 15px + 14px); padding: 6px 16px 8px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.caption-who { display: inline; margin-right: 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--blue-text); }
.caption-text { display: inline; font-size: 15px; line-height: 1.35; }
.dock { display: flex; flex-direction: column; gap: 8px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.dock-chips { display: flex; gap: 8px; }
.dock-chips .chip { flex: 1 1 0; justify-content: center; min-height: 40px; padding: 0 8px; font-size: 14px; white-space: nowrap; }
.askrow { display: flex; gap: 8px; }
.askrow .field { flex: 1 1 auto; }
.dock-main { display: flex; align-items: center; gap: 10px; }
.tutor { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 10px; }
.tutor-text { min-width: 0; display: flex; flex-direction: column; }
.tutor-name { font-size: 14px; font-weight: 800; }
.tutor-status { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-side { flex: 1 1 0; display: flex; justify-content: flex-end; gap: 8px; }
.mic { width: 56px; height: 56px; touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.mic .mic-off { display: none; }
.mic[aria-pressed="true"] { border-color: var(--orange); background: var(--orange); }
.mic[aria-pressed="true"] .mic-on { display: none; }
.mic[aria-pressed="true"] .mic-off { display: block; }
.voice-note { text-align: center; }

/* Orb: diam, berpikir, bicara, mendengarkan. */
.orb { position: relative; display: flex; align-items: center; justify-content: center; gap: 3px; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--blue); }
.orb i { width: 4px; height: 8px; border-radius: 2px; background: #FFFFFF; }
.orb[data-state="speaking"] i { height: 20px; animation: orb-bar 0.9s ease-in-out infinite; }
.orb[data-state="speaking"] i:nth-child(1) { height: 12px; }
.orb[data-state="speaking"] i:nth-child(2) { animation-delay: 0.15s; }
.orb[data-state="speaking"] i:nth-child(3) { height: 14px; animation-delay: 0.3s; }
.orb[data-state="thinking"] { background: var(--blue-tint); }
.orb[data-state="thinking"] i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); animation: orb-dot 1s ease-in-out infinite; }
.orb[data-state="thinking"] i:nth-child(2) { animation-delay: 0.15s; }
.orb[data-state="thinking"] i:nth-child(3) { animation-delay: 0.3s; }
.orb[data-state="listening"] { background: var(--surface); box-shadow: inset 0 0 0 3px var(--blue); }
.orb[data-state="listening"] i { background: var(--orange); height: 14px; animation: orb-bar 0.7s ease-in-out infinite; }
.orb[data-state="listening"] i:nth-child(2) { animation-delay: 0.12s; }
.orb[data-state="listening"] i:nth-child(3) { animation-delay: 0.24s; }
@keyframes orb-bar { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }
@keyframes orb-dot { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .orb i { animation: none !important; } }


/* ---- coretan siswa dan halaman papan ---- */
.session-titles { flex: 1 1 auto; }
.ink-tools { display: flex; gap: 6px; flex: none; }
.round.tool { width: 44px; height: 44px; }
.round.tool:disabled { opacity: 0.4; }
#ink-marker[aria-pressed="true"] { border-color: #E0458E; background: #FFE3F0; color: #A01A5A; }
#ink-pen[aria-pressed="true"] { border-color: #5B2BD9; background: #ECE5FF; color: #3E1A9E; }
.board-area > .page-pill, .board-area > .ink-edit, .board-area > .page-view { z-index: 2; }
.page-pill { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px 0 8px; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); font: inherit; font-size: 13px; font-weight: 800; color: var(--ink); }
.ink-edit { position: absolute; right: 8px; bottom: 8px; display: flex; align-items: center; gap: 6px; }
.ink-hint { padding: 6px 10px; border-radius: 14px; background: rgba(24, 35, 63, 0.82); color: #FFFFFF; font-size: 12px; font-weight: 700; }
.page-view { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--surface); }
.page-view img { flex: 1 1 auto; min-height: 0; width: 100%; object-fit: contain; }
.page-view-bar { display: flex; align-items: center; gap: 8px; padding: 8px; border-top: 1px solid var(--line); }
.page-label { flex: 1 1 auto; font-size: 13px; font-weight: 800; }
.round.flip svg { transform: scaleX(-1); }
.ink-ask { display: flex; align-items: center; gap: 10px; }
.ink-ask .chip-send { flex: none; border-color: var(--blue); background: var(--blue); color: #FFFFFF; font-weight: 800; }
.ink-ask-note { font-size: 12px; color: var(--ink-2); }

/* ---- jeda ---- */
.orb[data-state="paused"] { background: var(--surface); box-shadow: inset 0 0 0 3px var(--ink-2); }
.orb[data-state="paused"] i { height: 10px; background: var(--ink-2); }
#replay[data-role="pause"] svg, #replay[data-role="resume"] svg { fill: currentColor; stroke: none; }

/* ---- papan utuh ---- */
/* When the whole sheet shows big enough (see boardView.fit), it is shown whole: no scrolling. */
.board.whole .sheet-part iframe, .board.whole .sheet-picture { aspect-ratio: auto; height: var(--board-h, 100%); min-height: 0; }
/* Shown whole, a part with a question over it fits the board with its question: the question on one line. */
.board.whole .sheet-part.with-head iframe, .board.whole .sheet-part.with-head .sheet-picture { height: calc(var(--board-h, 100%) - 46px); }
.board.whole .sheet-head { height: 18px; -webkit-line-clamp: 1; }
.board.whole .sheet-head span { -webkit-line-clamp: 1; }

/* ---- komputer: petunjuk spasi ---- */
.key-hint { display: none; text-align: center; }
kbd { padding: 1px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; background: var(--ground); font: inherit; font-size: 12px; font-weight: 800; }
@media (hover: hover) and (pointer: fine) { .key-hint { display: block; } }

/* ---- tablet (dan HP lebar): kolom lebih lebar, beranda dua kolom ---- */
@media (min-width: 700px) {
  .app { max-width: 880px; }
  .login { width: 100%; max-width: 460px; margin: 0 auto; }
  .topbar { padding: 20px 24px 12px; }
  .home-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 16px; padding: 0 24px 24px; }
  .home-main > .banner { grid-column: 1 / -1; }
  .countdown { padding: 22px 24px; }
  .countdown-days { font-size: 40px; }
  .card { padding: 20px; }
  .card h2 { font-size: 18px; }
  .chip { min-height: 48px; font-size: 15px; }
  .askbar { padding: 12px 24px calc(14px + env(safe-area-inset-bottom)); }
  .askbar .field { max-width: none; }
  .session-head { padding: 10px 16px; }
  .session-title { font-size: 20px; }
  .board-area { margin: 0 16px; }
  .caption { height: calc(3 * 1.4 * 17px + 20px); padding: 10px 24px; }
  .caption-text { font-size: 17px; line-height: 1.4; }
  .dock { padding: 12px 24px calc(14px + env(safe-area-inset-bottom)); }
  .dock-chips .chip { min-height: 44px; font-size: 15px; }
  .mic { width: 64px; height: 64px; }
}

/* ---- tablet mendatar dan komputer: papan besar di kiri, Kak Rani di kanan ---- */
@media (min-width: 900px) and (orientation: landscape) {
  .app { max-width: 1440px; }
  .session {
    display: grid; height: 100vh; height: 100dvh;
    grid-template-columns: minmax(0, 1fr) clamp(320px, 30vw, 400px);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "head head" "board talk" "board dock";
  }
  .session-head { grid-area: head; padding: 10px 20px; }
  .board-area { grid-area: board; margin: 0 0 20px 20px; min-height: 0; }
  /* What Kak Rani says, big, at the top of the side column. */
  .caption {
    grid-area: talk; display: block; height: auto; min-height: 0; overflow-y: auto; -webkit-line-clamp: unset;
    margin: 0 20px 12px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface);
  }
  .caption-who { display: block; margin: 0 0 6px; }
  .caption-text { display: block; font-size: 20px; line-height: 1.45; }
  .dock { grid-area: dock; margin: 0 20px 20px; padding: 16px; border: 1px solid var(--line); border-radius: 20px; gap: 12px; }
  .dock-chips { flex-wrap: wrap; }
  .dock-chips .chip { flex: 1 1 auto; }
  .ink-ask { flex-wrap: wrap; }
  .toast { bottom: 32px; }
}
@media (min-width: 900px) and (orientation: landscape) {
  .caption-who[hidden] { display: block !important; }
}
/* Beranda tidak melebar tanpa batas; barisnya tidak ditarik setinggi layar. */
@media (min-width: 700px) {
  .home-main { align-content: start; }
  .home .topbar, .home-main, .home .askbar { width: 100%; max-width: 1080px; margin-left: auto; margin-right: auto; }
}
/* Kolom samping cukup lebar untuk Kak Rani, mik, dan dua tombol. */
@media (min-width: 900px) and (orientation: landscape) {
  .session { grid-template-columns: minmax(0, 1fr) clamp(340px, 32vw, 420px); }
  .dock-chips .chip { padding: 0 10px; font-size: 14px; }
  .dock-side .round { width: 44px; height: 44px; }
  .dock-main { gap: 8px; }
}

/* ---- beranda (konsep awal: tanya di atas, coba tanya, lanjutkan, materi per mapel) ---- */
.topbar-side { display: flex; align-items: center; gap: 8px; }
.pill { padding: 6px 12px; border-radius: 16px; background: var(--blue-tint); color: var(--blue-text); font-size: 13px; font-weight: 800; white-space: nowrap; }
.home-main { gap: 18px; padding-bottom: 28px; }
.hero { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px 14px 20px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); text-align: center; }
.hero-title { font-size: 26px; line-height: 1.2; font-weight: 800; }
.hero-note { max-width: 560px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.hero-ask { width: 100%; max-width: 720px; display: flex; align-items: center; gap: 6px; padding: 5px; border: 2px solid var(--blue); border-radius: 32px; background: var(--surface); }
.hero-mic { width: 48px; height: 48px; }
.hero-mic[aria-pressed="true"] { border-color: var(--orange); background: var(--orange); box-shadow: 0 0 0 calc(2px + var(--mic-level, 0) * 9px) rgba(217, 89, 11, 0.25); }
.hero-field { flex: 1 1 auto; min-width: 0; height: 48px; padding: 0 4px; border: 0; background: transparent; font-size: 16px; font-weight: 600; }
.hero-field:focus { outline: none; }
.hero-ask:focus-within { box-shadow: 0 0 0 4px var(--blue-tint); }
.button.dark { min-height: 48px; padding: 0 20px; border-color: var(--ink); background: var(--ink); color: #FFFFFF; }
/* Development stats under the dock: how long each step of the last question took. */
.dev-stats { width: 100%; margin-top: 8px; padding: 8px 10px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--ground); font-size: 12px; line-height: 1.45; color: var(--ink-2); text-align: left; }
.dev-stats summary { cursor: pointer; font-weight: 700; color: var(--ink); list-style-position: inside; }
.dev-tag { display: inline-block; padding: 0 6px; border-radius: 6px; background: var(--ink); color: #FFFFFF; font-size: 11px; font-weight: 800; }
.dev-stats ul { margin: 6px 0 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.dev-stats li { display: flex; justify-content: space-between; gap: 10px; padding: 1px 0; border-bottom: 1px dotted var(--line); }
.dev-stats li b { font-weight: 800; color: var(--ink); white-space: nowrap; }
.dev-stats li.slow b { color: var(--orange-text); }
.dev-history-title { margin: 8px 0 0; font-weight: 800; }
.dev-off { margin: 8px 0 0; font-size: 11px; }
.hero-mic-note { font-size: 14px; font-weight: 800; color: var(--orange-text); }
/* A photo with the question: its button beside the mic, and what will be sent under the field. */
.hero-photo { width: 48px; height: 48px; flex: none; }
.photo-preview { width: 100%; max-width: 720px; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 8px; border: 1px solid var(--line); border-radius: 18px; background: var(--ground); text-align: left; }
.photo-preview img { width: 56px; height: 56px; flex: none; border-radius: 12px; object-fit: cover; background: #FFFFFF; }
.photo-preview-text { flex: 1 1 auto; min-width: 0; font-size: 14px; line-height: 1.35; color: var(--ink-2); }
.photo-preview-text b { color: var(--ink); }
.board-area > .photo-pill { left: auto; right: 8px; }
.board-area > .photo-pill, .board-area > #photo-view { z-index: 3; }
#photo-view img { background: #FFFFFF; }
.tryask { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tryask-label { font-size: 13px; font-weight: 800; color: var(--ink-2); }
.tryask-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tryask-chips .chip { min-height: 40px; font-size: 14px; }
.home-row { display: flex; flex-direction: column; gap: 16px; }
.home-section { display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.section-title { font-size: 20px; font-weight: 800; }
.glyph-blue { background: var(--blue-tint); color: var(--blue-text); }
.glyph-teal { background: var(--teal-tint); color: var(--teal-text); }
.glyph-small { width: 42px; height: 42px; border-radius: 12px; font-size: 15px; letter-spacing: -0.02em; white-space: nowrap; }
/* The cards share the row's whole width (auto-fit, not auto-fill: no empty columns left at the end). */
.recent-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.recent-card { display: flex; flex-direction: column; padding: 0; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--surface); text-align: left; }
.recent-thumb {
  display: block; height: 120px; overflow: hidden; border-bottom: 1px solid var(--line); background-color: #FFFFFF;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 20px 20px;
}
.recent-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.recent-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.recent-subject { font-size: 12px; font-weight: 800; }
.tint-blue { color: var(--blue-text); }
.tint-teal { color: var(--teal-text); }
.tint-ink { color: var(--ink-2); }
.recent-title { font-size: 16px; line-height: 1.3; font-weight: 800; }
.recent-go { margin-top: 4px; font-size: 13px; font-weight: 800; color: var(--blue-text); }
.subjects { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.subject { display: flex; align-items: center; gap: 10px; padding: 12px; border: 2px solid var(--line); border-radius: 18px; background: var(--surface); text-align: left; }
.subject[aria-selected="true"] { border-color: var(--blue); background: #F5F8FF; }
#subject-bi[aria-selected="true"] { border-color: var(--teal); background: #F1FAF8; }
.subject-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.subject-name { font-size: 15px; line-height: 1.25; font-weight: 800; }
.subject-sub { display: none; font-size: 13px; color: var(--ink-2); }
.topic-groups { display: flex; flex-direction: column; gap: 18px; }
.topic-group-title { margin: 0 0 8px; font-size: 15px; font-weight: 800; }
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.topic { position: relative; display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-align: left; }
.topic:hover, .recent-card:hover, .subject:hover { border-color: var(--line-strong); }
.topic-title { font-size: 14px; line-height: 1.25; font-weight: 800; }
.topic-done { position: absolute; top: 6px; right: 9px; font-size: 13px; font-weight: 800; color: var(--teal-text); }
@media (min-width: 700px) {
  /* Every section as wide as the page (the two-column grid before this left them shrunk to their content). */
  .home-main { display: flex; flex-direction: column; align-items: stretch; gap: 28px; }
  .recent-thumb { height: 150px; }
  .recent-list[data-count="1"] .recent-card { flex-direction: row; }
  .recent-list[data-count="1"] .recent-thumb { flex: 0 0 320px; height: 180px; border-bottom: 0; border-right: 1px solid var(--line); }
  .recent-list[data-count="1"] .recent-body { justify-content: center; padding: 20px 24px; }
  .recent-list[data-count="1"] .recent-title { font-size: 19px; }
  .hero { gap: 18px; padding: 40px 32px 32px; border-radius: 28px; }
  .hero-title { font-size: 38px; }
  .hero-note { font-size: 17px; }
  .hero-ask { padding: 7px; border-radius: 36px; }
  .hero-mic, .hero-photo { width: 54px; height: 54px; }
  .hero-field { height: 52px; font-size: 17px; }
  .home-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .section-title { font-size: 22px; }
  .subject { padding: 16px; }
  .subject-name { font-size: 17px; }
  .subject-sub { display: block; }
  .topic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .topic-title { font-size: 15px; }
}
@media (min-width: 1000px) {
  .topic-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Coba tanya: on a phone one row that scrolls sideways, not a column of chips. */
@media (max-width: 699px) {
  .tryask { align-items: stretch; }
  .tryask-chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: 0 -14px; padding: 0 14px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tryask-chips::-webkit-scrollbar { display: none; }
  .tryask-chips .chip { flex: none; }
}
