/* Bijak Labur: gaya utama */
@font-face { font-family: "Geist"; src: url("../fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede6;
  --text: #14201b;
  --muted: #646d68;
  --faint: #8b928e;
  --border: #e3e0d7;
  --brand: #0b5d4b;
  --brand-ink: #ffffff;
  --brand-soft: #e3efe9;
  --gold: #a87a22;
  --up: #0f8a5f;
  --down: #c8402f;
  --warn: #b26b00;
  --info: #2563c9;
  --purple: #7046c8;
  --panel: #0f3d33;
  --panel-ink: #f3efe2;
  --radius: 14px;
  --tab-h: 58px;
  --shadow: 0 1px 2px color-mix(in srgb, #14201b 6%, transparent), 0 6px 18px -10px color-mix(in srgb, #0b5d4b 22%, transparent);
  --font: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1311; --surface: #161c19; --surface-2: #1d2521; --text: #e8ece9; --muted: #9aa49f; --faint: #6f7974;
    --border: #262f2b; --brand: #52c3a1; --brand-ink: #06231b; --brand-soft: #173029; --gold: #d8aa52;
    --up: #3ccf91; --down: #f0715f; --warn: #e9a23b; --info: #6ea2ff; --purple: #a98bf0; --panel: #12352d; --panel-ink: #f3efe2;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1311; --surface: #161c19; --surface-2: #1d2521; --text: #e8ece9; --muted: #9aa49f; --faint: #6f7974;
  --border: #262f2b; --brand: #52c3a1; --brand-ink: #06231b; --brand-soft: #173029; --gold: #d8aa52;
  --up: #3ccf91; --down: #f0715f; --warn: #e9a23b; --info: #6ea2ff; --purple: #a98bf0; --panel: #12352d; --panel-ink: #f3efe2;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.55; overflow-x: hidden; overscroll-behavior-y: none;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.65rem, 4.5vw, 2.25rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 650; margin-bottom: 8px; }
p { margin: 0 0 12px; }
button { font: inherit; color: inherit; }
.num, .mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.up { color: var(--up); } .down { color: var(--down); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* Bar atas */
.topbar {
  position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; padding-top: env(safe-area-inset-top); transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; min-height: 56px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.logo img { border-radius: 8px; }
.desk-nav { display: none; gap: 2px; margin-left: auto; }
.desk-nav a { padding: 8px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 550; font-size: 0.94rem; }
.desk-nav a:hover { color: var(--text); background: var(--surface-2); }
.desk-nav a.active { color: var(--text); background: var(--surface-2); }
.icon-btn { border: 1px solid var(--border); background: var(--surface); width: 40px; height: 40px; border-radius: 11px; cursor: pointer; display: grid; place-items: center; color: var(--text); flex: none; }
.icon-btn.plain { border: 0; background: none; color: var(--muted); }
.topbar .icon-btn { margin-left: auto; }

/* Bar tab bawah (telefon) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { height: var(--tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); text-decoration: none; font-size: 0.68rem; font-weight: 600; }
.tabbar a .ic { width: 23px; height: 23px; }
.tabbar a.active { color: var(--brand); }
@media (min-width: 900px) {
  .desk-nav { display: flex; }
  .topbar .icon-btn { margin-left: 8px; }
  .tabbar { display: none; }
  body { padding-bottom: 0; }
}

/* Susun atur */
main { max-width: 1120px; margin: 0 auto; padding: 8px 16px 32px; }
.view { display: none; }
.view.active { display: block; animation: enter .22s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view.active { animation: none; } * { transition: none !important; } }
.page-head { margin: 14px 0 20px; }
.page-head.with-aside { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.eyebrow { font-size: 0.8rem; font-weight: 650; color: var(--muted); margin: 0 0 4px; letter-spacing: 0.01em; }
.lead { color: var(--muted); max-width: 640px; margin: 8px 0 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.block-head { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.block-head h2 { margin-right: auto; }
.block-head .more { font-size: 0.88rem; font-weight: 600; text-decoration: none; }
.with-ic { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row-between.wrap { flex-wrap: wrap; margin-bottom: 4px; }
.row-between h3 { margin: 0; }
.two-col { display: grid; gap: 0 14px; }
@media (min-width: 760px) { .two-col { grid-template-columns: 1fr 1fr; } .two-col.wide { grid-template-columns: 3fr 2fr; } }
.source { font-size: 0.8rem; color: var(--faint); margin-top: 4px; }
.note { display: flex; gap: 10px; align-items: flex-start; font-size: 0.86rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 14px; margin-top: 18px; }
.note .ic { width: 18px; height: 18px; color: var(--warn); margin-top: 2px; }

/* Butang & borang */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; cursor: pointer; font-weight: 650; font-size: 0.95rem; padding: 0 16px; height: 44px; border-radius: 11px; background: var(--brand); color: var(--brand-ink); text-decoration: none; transition: filter .15s, transform .1s; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); } .btn:active { transform: scale(0.98); }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 0.86rem; border-radius: 9px; }
.btn.sm .ic { width: 16px; height: 16px; }
.btn.block { width: 100%; margin-top: 14px; }
.btn:disabled { opacity: 0.6; cursor: progress; }
.link-btn { background: none; border: 0; color: var(--brand); font-weight: 600; cursor: pointer; padding: 6px 0; font-size: 0.88rem; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 0 12px; height: 44px; width: 100%; min-width: 0; }
textarea { height: auto; padding: 12px; resize: vertical; line-height: 1.6; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
label { font-weight: 600; font-size: 0.88rem; display: block; margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; margin: 8px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 14px; }
.inline-form > input { flex: 1 1 180px; }
.inline-form > select { flex: 1 1 110px; }
.inline-form > .btn { flex: none; }

/* Kawalan bersegmen & cip */
.segmented { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 11px; gap: 2px; }
.seg { border: 0; background: none; padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 0.9rem; color: var(--muted); cursor: pointer; }
.seg.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.segmented.small .seg { padding: 5px 10px; font-size: 0.82rem; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 10px; margin: 0 -16px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; scroll-snap-align: start; border: 1px solid var(--border); background: var(--surface); padding: 7px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 0.88rem; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .done-n { font-size: 0.75rem; opacity: 0.7; font-variant-numeric: tabular-nums; }

/* Utama */
.home-grid { display: grid; gap: 0 18px; }
@media (min-width: 900px) { .home-grid { grid-template-columns: 1.15fr 1fr; align-items: start; } }
.prayer-card { display: block; text-decoration: none; color: var(--panel-ink); background: var(--panel); border-radius: 18px; padding: 18px 18px 14px; margin-bottom: 14px; }
.pc-top { display: flex; justify-content: space-between; font-size: 0.82rem; opacity: 0.75; font-weight: 600; }
.pc-main { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 10px 0 16px; }
.pc-name { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.pc-time { opacity: 0.8; font-size: 0.95rem; }
.pc-count { font-size: clamp(1.7rem, 7vw, 2.3rem); font-weight: 600; letter-spacing: 0.01em; color: #e2bd6b; }
.pc-row { list-style: none; margin: 0; padding: 12px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid rgba(255,255,255,.12); }
.pc-row li { text-align: center; font-size: 0.75rem; opacity: 0.6; }
.pc-row li b { display: block; font-size: 0.86rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.pc-row li.next { opacity: 1; color: #e2bd6b; }
.pc-row li.past { opacity: 0.4; }
.shortcut-row { display: grid; gap: 0; }
.shortcut, .toggle-row, .install { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; padding: 14px 16px; }
.shortcut:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.sc-body { flex: 1; min-width: 0; }
.sc-title { font-weight: 650; }
.sc-sub { font-size: 0.85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.sc-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.chev { color: var(--faint); width: 18px; height: 18px; }
.ring-wrap { position: relative; width: 44px; height: 44px; flex: none; }
.ring-txt { position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.68rem; font-weight: 700; color: var(--brand); }
.ring { width: 44px; height: 44px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4.5; }
.ring-bg { stroke: var(--surface-2); }
.ring-fg { stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset .6s; }
.install { margin-top: 4px; }

/* Senarai harga */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.qrow { display: grid; grid-template-columns: 34px minmax(0, 1fr) 64px auto; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; background: none; border: 0; border-top: 1px solid var(--border); text-align: left; cursor: pointer; transition: background-color .5s; text-decoration: none; color: inherit; }
.qrow:first-child { border-top: 0; }
.qrow:hover { background: var(--surface-2); }
.qrow.sel { background: var(--brand-soft); }
.coin { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 0.8rem; color: #fff; }
.q-sym { font-weight: 650; }
.q-name { font-size: 0.8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-right { text-align: right; min-width: 92px; }
.q-price { font-weight: 650; font-variant-numeric: tabular-nums; }
.q-chg { font-size: 0.8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.spark { width: 64px; height: 28px; display: block; }
.qrow.tick-up { background: color-mix(in srgb, var(--up) 10%, transparent); transition: none; }
.qrow.tick-down { background: color-mix(in srgb, var(--down) 10%, transparent); transition: none; }
.q-del { border: 0; background: none; color: var(--faint); cursor: pointer; padding: 6px; margin: -6px -6px -6px 0; display: none; }
.editing .q-del { display: block; }
.skeleton { display: inline-block; height: 0.9em; width: 70px; border-radius: 4px; background: var(--surface-2); vertical-align: middle; }
.live { font-size: 0.78rem; font-weight: 650; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.live.on { color: var(--up); }
.live.on::before { background: var(--up); animation: blink 2s infinite; }
@keyframes blink { 50% { opacity: 0.35; } }
.chart-card { padding: 14px 14px 8px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.chart-head h3 { margin: 0; }
.chart-box { height: 340px; }
.tv-box { height: 520px; }
.tv-box.short { height: 420px; }
@media (max-width: 600px) { .tv-box { height: 440px; } .chart-box { height: 300px; } }
.alert-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); font-size: 0.92rem; gap: 8px; }

/* Belajar */
.progress-line { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-weight: 600; font-size: 0.88rem; color: var(--muted); }
.progress-bar { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--brand); width: 0; transition: width .4s; border-radius: 99px; }
.lesson { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 10px; overflow: hidden; }
.lesson summary { cursor: pointer; padding: 14px 16px; font-weight: 650; display: flex; align-items: center; gap: 12px; list-style: none; }
.lesson summary::-webkit-details-marker { display: none; }
.lesson summary .chev { margin-left: auto; transition: transform .2s; }
.lesson[open] summary .chev { transform: rotate(90deg); }
.lesson .dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border); flex: none; display: grid; place-items: center; color: #fff; }
.lesson .dot .ic { width: 14px; height: 14px; stroke-width: 3; display: none; }
.lesson.done .dot { background: var(--up); border-color: var(--up); }
.lesson.done .dot .ic { display: block; }
.lesson-body { padding: 0 16px 16px 50px; }
@media (max-width: 520px) { .lesson-body { padding-left: 16px; } }
.lesson-body ul, .lesson-body ol { padding-left: 1.2em; margin: 0 0 12px; }
.lesson-body li { margin-bottom: 5px; }
.tip { border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 10px 10px 0; padding: 10px 12px; margin: 12px 0; font-size: 0.92rem; }
.tip b { color: var(--brand); }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 12px; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 650; font-size: 0.78rem; white-space: nowrap; }
td.wrap, th.wrap { min-width: 190px; }
.candle-demo { display: flex; gap: 20px; align-items: end; padding: 6px 0 12px; flex-wrap: wrap; color: var(--muted); }
.quiz-opt { display: block; width: 100%; text-align: left; margin-bottom: 8px; padding: 13px 14px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.quiz-opt:hover:not(:disabled) { border-color: var(--brand); }
.quiz-opt.correct { border-color: var(--up); background: color-mix(in srgb, var(--up) 12%, var(--surface)); }
.quiz-opt.wrong { border-color: var(--down); background: color-mix(in srgb, var(--down) 12%, var(--surface)); }
.calc-grid { display: grid; gap: 0 14px; }
@media (min-width: 760px) { .calc-grid { grid-template-columns: repeat(3, 1fr); } }
.calc-out { font-size: 1.45rem; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; margin-top: 4px; }

/* Solat */
.zone-pick { display: flex; gap: 8px; width: 100%; max-width: 420px; }
.solat-panel { background: var(--panel); color: var(--panel-ink); border-radius: 18px; padding: 22px 18px; text-align: center; margin-bottom: 14px; }
.sp-label { font-weight: 600; opacity: 0.85; }
.sp-count { font-size: clamp(2.4rem, 11vw, 3.4rem); font-weight: 600; color: #e2bd6b; line-height: 1.15; margin: 4px 0; }
.sp-zone { font-size: 0.85rem; opacity: 0.7; }
.solat-list { list-style: none; margin: 0 0 14px; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.solat-list li { display: flex; justify-content: space-between; padding: 13px 16px; border-top: 1px solid var(--border); font-weight: 550; }
.solat-list li:first-child { border-top: 0; }
.solat-list li span:last-child { font-variant-numeric: tabular-nums; }
.solat-list li.minor { color: var(--muted); font-weight: 450; font-size: 0.94rem; }
.solat-list li.past { color: var(--faint); }
.solat-list li.next { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
@media (min-width: 760px) { .solat-list { display: grid; grid-template-columns: repeat(4, 1fr); } .solat-list li { flex-direction: column; border-top: 0; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); } .solat-list li span:last-child { font-size: 1.2rem; } }
.switch { width: 50px; height: 30px; border-radius: 99px; border: 0; background: var(--surface-2); position: relative; cursor: pointer; flex: none; transition: background .2s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--up); }
.switch[aria-checked="true"] span { transform: translateX(20px); }
table.month { font-size: 0.86rem; }
table.month td, table.month th { white-space: nowrap; padding: 8px 10px; }
table.month td { font-variant-numeric: tabular-nums; }
tr.today td { background: var(--brand-soft); font-weight: 700; }

/* Semak kertas */
.checker-input { display: grid; gap: 0 14px; }
@media (min-width: 860px) { .checker-input { grid-template-columns: 3fr 2fr; } }
.drop { width: 100%; border: 1.5px dashed var(--border); border-radius: 11px; padding: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); cursor: pointer; background: none; font-weight: 600; margin-bottom: 12px; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
textarea#paper { min-height: 260px; }
textarea.short { min-height: 96px; }
.privacy-note { margin: 10px 0 0; }
.gauges { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 10px; margin-bottom: 12px; }
@media (min-width: 760px) { .gauges { grid-template-columns: repeat(4, 1fr); } }
.gauge { text-align: center; }
.gauge svg { width: 112px; height: 112px; display: block; margin: 0 auto; }
.gauge .lbl { font-weight: 650; margin-top: 4px; font-size: 0.95rem; }
.gauge .sub { font-size: 0.78rem; color: var(--muted); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.stat .v { font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 0.75rem; color: var(--muted); line-height: 1.3; }
@media (max-width: 420px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.bars .bar { display: grid; grid-template-columns: minmax(0, 1fr) 90px 38px; gap: 10px; align-items: center; font-size: 0.85rem; padding: 5px 0; }
.bars .track { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bars .track > div { height: 100%; border-radius: 99px; }
.bars .bar .num { text-align: right; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.8rem; color: var(--muted); margin: 8px 0 10px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }
.annotated { line-height: 1.95; font-size: 1rem; background: var(--bg); padding: 14px; border-radius: 11px; border: 1px solid var(--border); max-height: 560px; overflow: auto; overflow-wrap: anywhere; }
.annotated .s-ai { background: color-mix(in srgb, var(--purple) var(--a, 20%), transparent); border-radius: 3px; }
.annotated .s-plag { background: color-mix(in srgb, var(--down) 18%, transparent); border-bottom: 2px solid var(--down); }
.annotated mark.fix { background: none; color: inherit; border-bottom: 2px solid var(--c, var(--warn)); cursor: pointer; border-radius: 2px; }
.annotated mark.fix:hover, .annotated mark.fix.focus { background: color-mix(in srgb, var(--c, var(--warn)) 20%, transparent); }
.annotated mark.fix.applied { border-bottom: 2px dotted var(--up); background: color-mix(in srgb, var(--up) 14%, transparent); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.count { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--surface-2); font-size: 0.78rem; margin-left: 6px; color: var(--muted); }
.sugg-list { display: grid; gap: 8px; max-height: 640px; overflow: auto; }
.sugg { border: 1px solid var(--border); border-radius: 11px; padding: 11px 12px 11px 14px; background: var(--surface); position: relative; cursor: pointer; }
.sugg::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.sugg.focus { border-color: var(--c); }
.sugg .cat { font-size: 0.72rem; font-weight: 700; color: var(--c); }
.sugg .diff { margin: 4px 0; overflow-wrap: anywhere; }
.sugg del { color: var(--down); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.sugg ins { color: var(--up); text-decoration: none; font-weight: 650; }
.sugg .why { font-size: 0.84rem; color: var(--muted); }
.sugg .acts { display: flex; gap: 6px; margin-top: 8px; }
.sugg.done { opacity: 0.55; }
.sugg.done .acts { font-size: 0.82rem; color: var(--muted); }
.source-item { font-size: 0.9rem; padding: 9px 0; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: baseline; }
.source-item:first-child { border-top: 0; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; z-index: 60; font-weight: 600; font-size: 0.9rem; max-width: calc(100% - 32px); box-shadow: 0 6px 24px rgba(0,0,0,.18); animation: enter .2s ease-out; }
@media (min-width: 900px) { .toast { bottom: 24px; } }
.site-footer { max-width: 1120px; margin: 0 auto; padding: 18px 16px 28px; color: var(--faint); font-size: 0.8rem; border-top: 1px solid var(--border); }
.site-footer p { margin: 0 0 6px; }
.site-footer a { color: var(--muted); }
.native .site-footer { display: none; }

/* Premium */
.sc-ico.gold { background: color-mix(in srgb, var(--gold) 16%, var(--surface)); color: var(--gold); }
.btn .lock { width: 14px; height: 14px; opacity: 0.7; }
.chip .lock { width: 14px; height: 14px; }
.pro-wrap { display: flex; flex-direction: column; }
.pro-wrap > * { min-width: 0; }
.pro-wrap:not(.subscribed) #plansBlock { order: -1; margin-bottom: 18px; }
.locked { display: flex; gap: 14px; align-items: flex-start; }
.locked .sc-sub { white-space: normal; margin: 4px 0 12px; max-width: 560px; }
.plan-grid { display: grid; gap: 14px; margin-bottom: 12px; }
@media (min-width: 820px) { .plan-grid { grid-template-columns: repeat(3, 1fr); } }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; }
.plan.featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.plan header { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; }
.plan h3 { margin: 0; font-size: 1.1rem; }
.plan > p { margin: 4px 0 14px; }
.plan-tag { font-size: 0.72rem; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 3px 8px; border-radius: 99px; }
.plan-price { display: flex; align-items: baseline; gap: 4px; }
.plan-price .num { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
.plan-per { font-size: 0.8rem; color: var(--muted); min-height: 1.3em; }
.plan-feats { list-style: none; padding: 0; margin: 16px 0 6px; display: grid; gap: 9px; font-size: 0.92rem; flex: 1; align-content: start; }
.plan-feats li { display: flex; gap: 9px; align-items: flex-start; }
.plan-feats .ic { width: 17px; height: 17px; color: var(--up); stroke-width: 2.4; margin-top: 3px; }
.restore summary { cursor: pointer; font-weight: 650; list-style: none; }
.restore summary::-webkit-details-marker { display: none; }
.restore summary::after { content: ""; display: inline-block; width: 7px; height: 7px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(45deg); margin-left: 10px; vertical-align: 3px; transition: transform .2s; }
.restore[open] summary::after { transform: rotate(225deg); vertical-align: -1px; }
.restore form { margin-top: 14px; }
.form-grid { display: grid; gap: 0 12px; align-items: end; }
@media (min-width: 640px) { .form-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } }
.form-grid > .btn { margin-bottom: 14px; }
.form-grid > .check { margin: 0 0 14px; height: 44px; }
.tool .stat-row { margin-bottom: 14px; }
.stat-row.four { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .stat-row.four { grid-template-columns: repeat(4, 1fr); } }
.alloc { display: flex; height: 10px; border-radius: 99px; overflow: hidden; gap: 2px; margin: 0 0 4px; }
.alloc span { min-width: 3px; }
#pfAlloc .legend { margin: 6px 0 14px; }
.stat-row.two { grid-template-columns: repeat(2, 1fr); }
.pf-list { margin-bottom: 4px; }
.pf-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 36px; grid-template-areas: "main val del" "sub sub del"; gap: 6px 12px; align-items: center; padding: 12px 8px 12px 14px; border-top: 1px solid var(--border); }
.pf-row:first-child { border-top: 0; }
.pf-main { grid-area: main; display: flex; flex-direction: column; min-width: 0; }
.pf-sub { grid-area: sub; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pf-val { grid-area: val; text-align: right; font-weight: 650; }
.pf-val .small { font-weight: 600; }
.pf-del { grid-area: del; width: 34px; height: 34px; }
.pf-edit { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; font-size: inherit; }
.pf-price { height: 32px; width: 92px; padding: 0 8px; font-size: 15px; }
.pf-empty { padding: 14px; margin: 0; }
.zk-due { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.zk-due span { font-weight: 650; }
.zk-due b { font-size: 1.8rem; letter-spacing: -0.02em; color: var(--brand); }
.zk-lines { margin: 12px 0 0; border-top: 1px solid var(--border); }
.zk-lines div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.zk-lines div:last-child { border-bottom: 0; padding-bottom: 0; }
.zk-lines dt { color: var(--muted); }
.zk-lines dd { margin: 0; font-weight: 600; }
.ref-preview { background: var(--bg); border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px; margin: 4px 0 4px; min-height: 48px; overflow-wrap: anywhere; font-family: "Times New Roman", Times, serif; font-size: 1.02rem; line-height: 1.6; }
.ref-list { margin: 8px 0 0; padding: 0; list-style: none; }
.ref-list li { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--border); font-family: "Times New Roman", Times, serif; font-size: 1rem; overflow-wrap: anywhere; }
.ref-list li > span { padding-left: 24px; text-indent: -24px; }
.ref-list li:first-child { border-top: 0; }
.ref-list li.muted { font-family: var(--font); font-size: 0.9rem; }
.ref-list .icon-btn { width: 30px; height: 30px; margin-top: -4px; }
dialog { border: 0; border-radius: 18px; padding: 22px; width: min(440px, calc(100% - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10, 20, 16, 0.45); }
dialog h2 { margin-bottom: 14px; }
.pay-amt { display: flex; justify-content: space-between; align-items: baseline; background: var(--surface-2); border-radius: 11px; padding: 12px 14px; margin-bottom: 16px; }
.pay-amt b { font-size: 1.35rem; }
.err { color: var(--down); font-size: 0.88rem; font-weight: 600; min-height: 0; margin: 0; }
.err:empty { display: none; }
.actions.end { justify-content: flex-end; }
#printArea { display: none; }

/* Laporan PDF (cetak) */
@media print {
  @page { margin: 16mm; }
  body { background: #fff; color: #111; padding: 0; font-size: 11pt; }
  body.printing > *:not(#printArea) { display: none !important; }
  body.printing #printArea { display: block; }
  #printArea h1 { font-size: 17pt; margin: 0; }
  #printArea h2 { font-size: 12.5pt; margin: 18px 0 6px; }
  #printArea table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
  #printArea td, #printArea th { border-bottom: 1px solid #ddd; padding: 5px 6px; color: #111; }
  #printArea tr { break-inside: avoid; }
  #printArea td.num { text-align: right; white-space: nowrap; }
  .rp-head { display: flex; gap: 12px; align-items: center; border-bottom: 2px solid #0b5d4b; padding-bottom: 10px; }
  .rp-head p { margin: 0; color: #555; }
  .rp-gauges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 8px; }
  .rp-g { border: 1px solid #ddd; border-radius: 8px; padding: 10px; text-align: center; }
  .rp-g b { display: block; font-size: 18pt; color: #0b5d4b; }
  .rp-g span { font-size: 9pt; color: #555; }
  .rp-meta { font-size: 9.5pt; color: #333; }
  .rp-text { font-size: 10pt; line-height: 1.6; border: 1px solid #ddd; border-radius: 8px; padding: 10px 12px; }
  .rp-foot { font-size: 8.5pt; color: #666; margin-top: 16px; }
}
.locked .btn { white-space: normal; height: auto; min-height: 36px; padding: 8px 12px; text-align: left; }

/* Premium: pelancar alat */
.grid-title { font-size: 0.95rem; color: var(--muted); font-weight: 650; margin: 6px 0 10px; }
.tools { display: grid; gap: 10px; margin-bottom: 18px; }
@media (min-width: 640px) { .tools { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .tools { grid-template-columns: repeat(3, 1fr); } }
.tool-card { display: flex; gap: 12px; align-items: center; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; color: inherit; transition: border-color .15s; }
.tool-card:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.tool-card .sc-ico { width: 40px; height: 40px; border-radius: 11px; }
.tc-body { display: flex; flex-direction: column; min-width: 0; }
.tc-name { font-weight: 650; display: flex; align-items: center; gap: 6px; }
.tc-name .lock { width: 14px; height: 14px; color: var(--faint); }
.tc-desc { font-size: 0.83rem; color: var(--muted); }
.tool-head { display: flex; flex-direction: column; gap: 2px; margin: 0 0 12px; }
.tool-head h2 { font-size: 1.3rem; }
.link-btn.back { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; }
.link-btn.back .ic { width: 16px; height: 16px; transform: rotate(180deg); }
.trial-card { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; border-color: color-mix(in srgb, var(--gold) 45%, var(--border)); background: color-mix(in srgb, var(--gold) 7%, var(--surface)); }
.trial-card .sc-sub { white-space: normal; }
.store-terms { line-height: 1.5; }
.field.wide { grid-column: 1 / -1; }
.warn-t { color: var(--warn); }
.mini-bars { width: 100%; height: 150px; display: block; }
.mini-axis { display: flex; font-size: 0.7rem; color: var(--muted); margin-top: 4px; }
.mini-axis span { flex: 1; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.curve { width: 100%; height: 140px; display: block; }
.stack-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; gap: 2px; margin: 12px 0 4px; }
.dot-c { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 8px; }
.sem .row-between { margin-bottom: 8px; }
.sem-name { height: 38px; font-weight: 650; border-color: transparent; background: transparent; padding: 0 6px; margin-left: -6px; flex: 1; }
.sem-name:hover { border-color: var(--border); }
.sem-gpa { font-weight: 700; color: var(--brand); white-space: nowrap; }
.course { display: grid; grid-template-columns: minmax(0, 1fr) 64px 76px 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.course input, .course select { height: 40px; }
.course .icon-btn { width: 34px; height: 34px; }
.diff-view ins { background: color-mix(in srgb, var(--up) 18%, transparent); color: inherit; text-decoration: none; border-radius: 3px; }
.diff-view del { background: color-mix(in srgb, var(--down) 15%, transparent); color: var(--down); border-radius: 3px; }
.hs .pf-val { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 180px; }
.hs-chip { font-size: 0.72rem; font-weight: 650; padding: 2px 7px; border-radius: 99px; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.hs .pf-sub { margin-top: 4px; }

/* Muka depan tugasan */
.cover-wrap { background: var(--surface-2); display: grid; place-items: center; }
.cover-preview { width: 100%; max-width: 340px; aspect-ratio: 210 / 297; background: #fff; color: #111; box-shadow: 0 4px 18px rgba(0,0,0,.12); padding: 8% 9%; font-size: 7px; overflow: hidden; }
.cv { height: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; font-family: "Times New Roman", Times, serif; }
.cv-logo { max-height: 14%; max-width: 50%; object-fit: contain; margin-bottom: 6%; }
.cv-uni { font-size: 1.7em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.cv-fac { font-size: 1.25em; margin-top: 2%; }
.cv-course { font-size: 1.25em; margin-top: 10%; font-weight: 600; }
.cv-title { font-size: 2.1em; font-weight: 700; margin: 6% 0 10%; line-height: 1.25; }
.cv-students { border-collapse: collapse; font-size: 1.15em; margin: 0 auto; width: 90%; }
.cv-students th, .cv-students td { border: 1px solid #333; padding: 0.5em 0.8em; text-align: left; color: #111; }
.cv-students th { font-weight: 700; background: #f2f2f2; }
.cv-meta { margin-top: auto; font-size: 1.2em; display: grid; gap: 0.6em; }
.cv-meta span { display: block; font-size: 0.8em; color: #555; text-transform: uppercase; letter-spacing: 0.05em; }
@media print {
  .print-cover { height: 265mm; font-size: 14px; }
  .print-cover .cv { padding: 10mm 6mm; }
}
.pf-row.hs { grid-template-columns: minmax(0, 1fr) 36px; grid-template-areas: "main del" "val del" "sub del"; }
.hs .pf-val { justify-content: flex-start; max-width: none; }

/* Kemasan reka bentuk (audit taste-skill) */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

h1, h2, h3, .sc-title, .plan h3 { text-wrap: balance; }
p, .lead, .sc-sub { text-wrap: pretty; }
h1 { font-weight: 650; letter-spacing: -0.035em; }
.num, .mono, .q-price, .q-chg, .pc-count, .pc-row li b { font-feature-settings: "tnum" 1; }
.pc-count { font-weight: 500; letter-spacing: -0.02em; }
.lead { max-width: 62ch; }
/* Kad: bayang bertint, sempadan lebih lembut, angkat sedikit apabila boleh diklik */
.card, .list, .tool-card { border-color: color-mix(in srgb, var(--border) 70%, transparent); box-shadow: var(--shadow); }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .list, :root[data-theme="dark"] .tool-card { box-shadow: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card, :root:not([data-theme="light"]) .list, :root:not([data-theme="light"]) .tool-card { box-shadow: none; } }
a.card, .shortcut, .tool-card { transition: transform .2s cubic-bezier(.2,.8,.2,1), border-color .2s, box-shadow .2s; }
a.card:hover, .shortcut:hover, .tool-card:hover { transform: translateY(-1px); }
a.card:active, .shortcut:active, .tool-card:active { transform: translateY(0) scale(.995); }
.btn { transition: filter .2s, transform .12s, background-color .2s; }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.desk-nav a { transition: color .2s, background-color .2s; }
.qrow { transition: background-color .25s; }
/* Lencana koin: warna jenama dilembutkan supaya tidak bersaing dengan warna utama */
.coin { --c: var(--brand); color: color-mix(in srgb, var(--c) 82%, var(--text)); background: color-mix(in srgb, var(--c) 14%, var(--surface)); font-weight: 700; }
/* Pautan langkau untuk papan kekunci */
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 9px; font-weight: 600; text-decoration: none; transition: top .15s; }
.skip-link:focus { top: calc(8px + env(safe-area-inset-top)); }
#main:focus { outline: none; }

/* Sumber plagiarisme dan perbandingan sebelah-menyebelah */
.annotated .s-plag sup { font-size: 0.66em; font-weight: 700; color: var(--down); margin-left: 1px; }
.src-sum { margin: 0 0 6px; }
.src { border-top: 1px solid var(--border); padding: 4px 0; }
.src summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 0 6px; cursor: pointer; }
.src summary::-webkit-details-marker { display: none; }
.src-rank { width: 24px; height: 24px; border-radius: 7px; flex: none; display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; color: var(--down); background: color-mix(in srgb, var(--down) 12%, var(--surface)); }
.src-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.src-name { font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src[open] .src-name { white-space: normal; }
.src-pct { font-weight: 700; font-size: 1.05rem; color: var(--down); }
.src-bar { height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 0 0 8px 34px; }
.src-bar > div { height: 100%; background: var(--down); border-radius: 99px; }
.src > a { margin-left: 34px; }
.cmp-list { display: grid; gap: 10px; margin: 10px 0 8px; }
.cmp { display: grid; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; }
@media (min-width: 700px) { .cmp { grid-template-columns: 1fr 1fr; gap: 14px; } .cmp > div + div { border-left: 1px solid var(--border); padding-left: 14px; } }
.cmp-k { font-size: 0.72rem; font-weight: 650; color: var(--muted); margin-bottom: 3px; }
.cmp p { margin: 0; font-size: 0.88rem; line-height: 1.6; overflow-wrap: anywhere; }
.cmp mark { background: color-mix(in srgb, var(--down) 18%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
/* Logo kripto sebenar */
.coin.logo { background: var(--surface-2); overflow: hidden; }
.coin.logo img { width: 100%; height: 100%; display: block; }
