:root {
  --bg: #f2f6f5; --card: #ffffff; --text: #15211f; --muted: #587069; --line: #d8e3e0;
  --accent: #0f766e; --accent-text: #ffffff; --accent-soft: #d6efeb; --side: #e8f0ee;
  --ok: #1a7f37; --bad: #cf222e; --warn: #9a6700;
  --bar-h: 62px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1514; --card: #162120; --text: #e4ecea; --muted: #93a8a3; --line: #263836; --accent: #2dd4bf; --accent-text: #052a26; --accent-soft: #14403b; --side: #111c1b; --ok: #3fb950; --bad: #ff7b72; --warn: #d29922; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#main { max-width: 1120px; margin: 0 auto; padding: 8px 20px 28px; }
.narrow { max-width: 380px; margin: 10vh auto 0; padding: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
h1 { font-size: 20px; margin: 0; font-weight: 600; }
h2 { font-size: 16px; margin: 0 0 8px; font-weight: 600; }
.muted { color: var(--muted); margin: 2px 0; }
.note { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: 8px 12px; border-radius: 6px; }
.err { color: var(--bad); min-height: 1.4em; margin: 4px 0; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; word-break: break-word; }
label { display: block; margin: 8px 0; color: var(--muted); font-size: 13px; }
input, select, textarea { width: 100%; padding: 8px 10px; margin-top: 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
button { padding: 8px 14px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); border-radius: 6px; font: inherit; cursor: pointer; }
button.ghost { background: transparent; color: var(--text); border-color: var(--line); }
button.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
button.small { padding: 3px 8px; font-size: 13px; }
button:disabled { opacity: .5; cursor: default; }
.toolbar { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.toolbar input[type=search] { flex: 1 1 220px; margin: 0; }
.toolbar select { width: auto; margin: 0; }
.scroll { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: 0; }
tr.off td { opacity: .55; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); }
.pill.ok { color: var(--ok); border-color: var(--ok); }
.pill.bad { color: var(--bad); border-color: var(--bad); }
.pill.warn { color: var(--warn); border-color: var(--warn); }
.cell-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 12px 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace; }
.shots { display: flex; gap: 12px; flex-wrap: wrap; }
.shot { width: 140px; font-size: 12px; color: var(--muted); }
.shot img { width: 140px; border: 1px solid var(--line); border-radius: 6px; background: #fff; display: block; image-rendering: pixelated; }
dialog { border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); width: min(480px, 92vw); padding: 16px; }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
[hidden] { display: none !important; }
.enroll-msg { min-height: 3em; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.enroll-msg.ok { border-color: var(--ok); color: var(--ok); }
.enroll-msg.bad { border-color: var(--bad); color: var(--bad); }
.summary { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.summary .pill { font-size: 13px; padding: 2px 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 16px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; }
.check input { width: auto; margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: 6px; margin: 8px 0 0; padding: 4px 12px 8px; }
legend { color: var(--muted); font-size: 13px; padding: 0 4px; }
fieldset .check { display: inline-flex; margin-right: 14px; }
td select { width: auto; margin: 0; padding: 3px 6px; }
.msg-cell { max-width: 380px; font-size: 13px; color: var(--muted); }
.toolbar input[type=date], .toolbar input[type=month] { width: auto; margin: 0; }
.actions.start { justify-content: flex-start; }

/* ---- jadwal & nilai ---- */
.day { margin: 0 0 12px; }
.day h3 { font-size: 14px; margin: 0 0 4px; }
.blk { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); margin-bottom: 4px; }
.blk .t { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; color: var(--muted); }
input.sc { width: 72px; margin: 0; padding: 4px 6px; text-align: right; }
th .hd { display: flex; gap: 4px; align-items: center; }
th .hd button { padding: 0 6px; font-size: 12px; }
td.num, th.num { text-align: right; }


.toolbar input:not([type=checkbox]) { width: auto; margin: 0; }
.toolbar input[type=search], .toolbar input#ga_title, .toolbar input#sub_name { flex: 1 1 220px; }

/* tambahan: portal, tab baru */
.subhead { margin: 12px 0 4px; font-weight: 600; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.topbar h1 { font-size: 18px; margin: 8px 0; }
h3 { font-size: 15px; margin: 14px 0 6px; }

.term { background: #0d1117; color: #c9d1d9; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; padding: 8px 10px; border-radius: 6px; height: 11em; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 8px 0; }

/* ================= kerangka: sidebar (layar lebar) dan bottom bar (ponsel) ================= */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; }
.login-logo { display: block; margin: 0 auto 8px; border-radius: 12px; }
#login h1 { text-align: center; margin-bottom: 8px; }

.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 12px 12px; }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 8px 14px; }
.brand img { border-radius: 10px; }
.brand strong { display: block; font-size: 15px; line-height: 1.25; }
.who { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.tabs { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.grp { margin: 14px 10px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tabs button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: 14.5px; position: relative; }
.tabs button:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.tabs button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tabs button.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.side-foot { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 12px; }
.side-foot button { display: flex; align-items: center; gap: 10px; justify-content: flex-start; }
.content { min-width: 0; }
.appbar { display: flex; align-items: center; gap: 12px; padding: 18px 20px 6px; max-width: 1120px; margin: 0 auto; }
.appbar h1 { font-size: 22px; letter-spacing: -.01em; }
.bottombar { display: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .term:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* menu lembar (ponsel) */
.sheet { width: 100%; max-width: 560px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); font-size: 13px; text-align: center; min-height: 76px; }
.tile.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.sheet .grp { margin: 14px 2px 6px; }
.sheet-foot { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }

@media (max-width: 899px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .appbar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: calc(10px + env(safe-area-inset-top)) 16px 8px; border-bottom: 1px solid var(--line); max-width: none; }
  .appbar h1 { font-size: 18px; }
  #main { padding: 12px 12px calc(var(--bar-h) + 24px + env(safe-area-inset-bottom)); }
  .bottombar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--card); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); min-height: var(--bar-h); }
  .bb { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 2px; min-width: 0; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 11.5px; }
  .bb span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bb.on { color: var(--accent); font-weight: 600; }
  .bb.on .ic { background: var(--accent-soft); border-radius: 10px; box-sizing: content-box; padding: 3px 14px; }
  input, select, textarea { font-size: 16px; }
  button { min-height: 40px; }
  button.small { min-height: 34px; }
  .toolbar > * { flex: 1 1 150px; }
  .toolbar input[type=search] { flex-basis: 100%; }
  .card { padding: 14px; }
  .scroll { border-radius: 8px; }
  th, td { padding: 8px; }
  /* dialog menjadi lembar dari bawah */
  dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 92vh; overflow-y: auto; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .actions button { flex: 1; }
  .rapor { padding: 14px; }
}
@media (min-width: 900px) { .bb, .tile { display: none; } .sheet { display: none; } }
@media (prefers-reduced-motion: no-preference) {
  .tabs button, .bb { transition: background-color .12s, color .12s; }
}
.appbar h1 { flex: 1; }
@media (min-width: 900px) { .appbar > button { display: none; } }

/* rapor di layar ponsel: kartu per mapel, bukan tabel lebar (cetak tetap format tabel) */
@media screen and (max-width: 899px) {
  .rapor { padding: 14px 12px; font-size: 14px; overflow: hidden; }
  .rapor h1 { font-size: 16px; }
  .rapor h2 { font-size: 13px; }
  .rapor table, .rapor tbody, .rapor tr, .rapor td { display: block; width: 100%; }
  .rapor table.id td { padding: 1px 0; }
  .rapor table.id tr { display: grid; grid-template-columns: 7.5em 1fr; }
  .rapor table.id tr.blank td:nth-child(1), .rapor table.id tr.blank td:nth-child(2) { display: none; }
  .rapor table.mp { border: 0; }
  .rapor table.mp thead { display: none; }
  .rapor table.mp tr { border: 1px solid #000; border-radius: 8px; margin: 0 0 10px; overflow: hidden; display: grid; grid-template-columns: repeat(3, 1fr); }
  .rapor table.mp td { border: 0; border-top: 1px solid #ccc; padding: 6px 8px; text-align: center; font-size: 13px; }
  .rapor table.mp td::before { content: attr(data-label); display: block; font-size: 11px; color: #555; }
  .rapor table.mp td.no { display: none; }
  .rapor table.mp td.mapel { grid-column: 1 / -1; background: #eee; border-top: 0; text-align: left; font-weight: 700; font-size: 14px; }
  .rapor table.mp td.fin, .rapor table.mp td.ket { grid-column: span 1; }
  .rapor table.mp td.ket { grid-column: 1 / -1; }
  .rapor table.att tr { display: grid; grid-template-columns: 1fr 1fr; }
  .rapor table.att td { text-align: left; }
  .rapor table.att thead th { display: block; }
  .rapor .sig { flex-direction: column; gap: 4px; }
  .rapor .sig .line { margin-top: 36px; }
}
tr.grouprow th { background: var(--accent-soft); color: var(--accent); text-align: left; text-transform: none; font-size: 13.5px; }

/* ================= tampilan premium: kedalaman, gerak halus, status memuat ================= */
:root {
  --shadow-sm: 0 1px 2px rgba(14, 40, 36, .06), 0 1px 1px rgba(14, 40, 36, .04);
  --shadow-md: 0 1px 2px rgba(14, 40, 36, .05), 0 10px 28px -14px rgba(14, 40, 36, .22);
  --shadow-lg: 0 24px 60px -18px rgba(8, 28, 25, .45), 0 4px 14px rgba(8, 28, 25, .12);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --r: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow-md: 0 12px 30px -14px rgba(0, 0, 0, .7); --shadow-lg: 0 28px 70px -18px rgba(0, 0, 0, .8); }
}
body {
  background: radial-gradient(900px 420px at 88% -8%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 70%), radial-gradient(700px 380px at -5% 105%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%), var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3 { letter-spacing: -.012em; }
td.num, th.num, .num { font-variant-numeric: tabular-nums; }
.card { border-radius: var(--r); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--line) 80%, transparent); }
.scroll { border-radius: var(--r); box-shadow: var(--shadow-sm); }
.note { border-radius: 10px; box-shadow: var(--shadow-sm); }
.sidebar { background: color-mix(in srgb, var(--side) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); }
.appbar { position: sticky; top: 0; z-index: 4; backdrop-filter: saturate(1.3) blur(10px); background: color-mix(in srgb, var(--bg) 82%, transparent); }

/* tombol */
button { border-radius: 10px; font-weight: 500; transition: transform .14s var(--ease), box-shadow .2s var(--ease), background-color .15s, border-color .15s, opacity .15s; position: relative; }
button:not(.ghost):not(.danger):not(.bb):not(.tile) { background-image: linear-gradient(180deg, color-mix(in srgb, #fff 14%, transparent), transparent); box-shadow: 0 1px 2px rgba(15, 118, 110, .35), inset 0 1px 0 rgba(255, 255, 255, .18); }
button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 14px -6px rgba(15, 118, 110, .5); }
button.ghost:hover:not(:disabled), button.danger:hover:not(:disabled) { box-shadow: var(--shadow-sm); background: color-mix(in srgb, var(--accent) 7%, transparent); }
button.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--bad) 9%, transparent); }
button.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
button:active:not(:disabled) { transform: translateY(0) scale(.98); }
.tabs button:hover, .bb:hover, .tile:hover { transform: none; box-shadow: none; }
.tabs button, .bb, .tile { background-image: none !important; box-shadow: none !important; }
.tile { transition: transform .15s var(--ease), border-color .15s, background-color .15s; }
.tile:active { transform: scale(.96); }

/* kolom isian */
input, select, textarea { border-radius: 10px; transition: border-color .15s, box-shadow .2s var(--ease), background-color .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); background: var(--card); }
input:invalid:not(:placeholder-shown):not(:focus) { border-color: var(--bad); }

/* tabel: baris naik satu per satu, sorotan saat disentuh */
tbody tr { transition: background-color .12s; }
tbody tr:hover td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
thead th { position: sticky; top: 0; background: color-mix(in srgb, var(--card) 94%, var(--accent)); z-index: 1; }
.pill { font-weight: 500; background: color-mix(in srgb, currentColor 8%, transparent); border-color: color-mix(in srgb, currentColor 35%, transparent); }
.pill:not(.ok):not(.bad):not(.warn) { color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes popout { to { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes sheetin { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetout { to { transform: translateY(100%); } }
@keyframes toastin { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes barmove { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

@media (prefers-reduced-motion: no-preference) {
  #main > section:not([hidden]) { animation: rise .32s var(--ease) both; }
  tbody tr:not(.sk) { animation: rise .34s var(--ease) both; }
  tbody tr:nth-child(2) { animation-delay: 30ms; } tbody tr:nth-child(3) { animation-delay: 60ms; } tbody tr:nth-child(4) { animation-delay: 90ms; }
  tbody tr:nth-child(5) { animation-delay: 120ms; } tbody tr:nth-child(6) { animation-delay: 150ms; } tbody tr:nth-child(7) { animation-delay: 180ms; }
  tbody tr:nth-child(8) { animation-delay: 210ms; } tbody tr:nth-child(n+9) { animation-delay: 240ms; }
  .blk, .day, #rpView > *, #exView > * { animation: rise .34s var(--ease) both; }
  #login .card, #login.card { animation: rise .5s var(--ease) both; }
  dialog[open] { animation: pop .26s var(--ease) both; }
  dialog[open]::backdrop { animation: fade .26s ease both; }
  dialog.closing { animation: popout .2s ease both; }
  dialog.closing::backdrop { animation: fade .2s ease reverse both; }
}

/* dialog */
dialog { border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 20px 22px; }
dialog::backdrop { background: rgba(6, 22, 20, .5); backdrop-filter: blur(5px); }
dialog h2 { font-size: 18px; margin-bottom: 10px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
dialog.ask { width: min(420px, 92vw); }
.ask-msg { margin: 0 0 8px; line-height: 1.55; }
@media (max-width: 899px) {
  @media (prefers-reduced-motion: no-preference) { dialog[open] { animation: sheetin .32s var(--ease) both; } dialog.closing { animation: sheetout .22s ease both; } }
  dialog { border-radius: 20px 20px 0 0; }
  dialog::before { content: ""; display: block; width: 38px; height: 4px; border-radius: 4px; background: var(--line); margin: -8px auto 12px; }
  dialog.ask { width: 100%; }
}

/* bilah progres, loading, tombol bekerja */
.topbar-progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 100; overflow: hidden; opacity: 0; transition: opacity .2s; pointer-events: none; }
.topbar-progress.on { opacity: 1; }
.topbar-progress::before { content: ""; position: absolute; inset: 0; width: 38%; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: barmove 1.05s ease-in-out infinite; }
.is-loading { position: relative; }
.is-loading > :not(.toolbar) { opacity: .55; transition: opacity .2s; pointer-events: none; }
button.busy { pointer-events: none; opacity: .85; }
button.busy::before { content: ""; display: inline-block; width: 13px; height: 13px; margin-right: 8px; vertical-align: -2px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
button.done { background: var(--ok) !important; border-color: var(--ok) !important; color: #fff !important; opacity: 1; }
tr.sk td { padding: 14px 10px; }
.sk-bar { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--line) 25%, color-mix(in srgb, var(--line) 40%, var(--card)) 37%, var(--line) 63%); background-size: 300% 100%; animation: shimmer 1.3s linear infinite; }
tr.sk:nth-child(2) .sk-bar { width: 82%; } tr.sk:nth-child(3) .sk-bar { width: 64%; } tr.sk:nth-child(4) .sk-bar { width: 74%; }

/* toast */
.toasts { position: fixed; z-index: 120; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92vw, 420px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; background: color-mix(in srgb, var(--text) 94%, var(--bg)); color: var(--bg); box-shadow: var(--shadow-lg); font-size: 14px; max-width: 100%; animation: toastin .3s var(--ease) both; cursor: pointer; }
.toast.out { animation: toastout .24s ease both; }
.toast .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .25); }
.toast.err .dot { background: #fb7185; box-shadow: 0 0 0 4px rgba(251, 113, 133, .28); }
.toast .msg { overflow-wrap: anywhere; }
@media (max-width: 899px) { .toasts { bottom: calc(var(--bar-h) + 14px + env(safe-area-inset-bottom)); } }

/* masuk */
#login.card { box-shadow: var(--shadow-lg); border-radius: 20px; padding: 30px 26px; backdrop-filter: blur(8px); }
.login-logo { box-shadow: 0 10px 26px -8px color-mix(in srgb, var(--accent) 70%, transparent); border-radius: 16px; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }

/* cegah halaman melebar melewati layar (di ponsel itu membuat browser memperkecil halaman dan bottom bar tampak ikut tergulung) */
html, body { overflow-x: clip; max-width: 100%; }
.shell, .content, #main, #main > section, .card, .toolbar { min-width: 0; max-width: 100%; }
.toolbar select, .toolbar input, .grid select, .grid input, label select, label input { min-width: 0; max-width: 100%; }
select { text-overflow: ellipsis; }
@media (max-width: 899px) {
  .bottombar { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; transform: translateZ(0); -webkit-transform: translateZ(0); }
}

/* terminal: baris perintah */
.term-input { display: flex; align-items: center; gap: 8px; margin: 8px 0 6px; padding: 4px 6px 4px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.term-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.term-input .prompt { color: var(--accent); font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; }
.term-input input { border: 0; background: transparent; margin: 0; box-shadow: none !important; font-family: ui-monospace, Menlo, Consolas, monospace; flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.thumb { width: 72px; height: 48px; object-fit: cover; border-radius: 6px; display: block; }

/* ===== 1.6.0 header salam + mode + profil, Kelasku ===== */
.appbar .greet { flex: 1; min-width: 0; display: grid; }
.appbar .greet h1 { margin: 0; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; }
.appbar .page-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 900px) { .appbar > button:not([hidden]) { display: inline-flex; } }
.appbar > button { white-space: nowrap; }
@media (max-width: 520px) { #profileBtn { font-size: 0; padding: 6px 10px; } #profileBtn::before { content: "👤"; font-size: 16px; } }
.mode-list { display: grid; gap: 8px; margin: 10px 0; }
.mode-card { display: grid; gap: 2px; justify-items: start; text-align: left; width: 100%; padding: 12px 14px; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 12px; background-image: none !important; box-shadow: none !important; }
.mode-card.on { border-color: var(--accent); background: var(--accent-soft); }
.prof-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 12px 0; }
.kl-tile { display: grid; gap: 4px; justify-items: start; align-content: center; min-height: 96px; padding: 14px; text-align: left; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 14px; background-image: none !important; box-shadow: none !important; }
.kl-tile b { font-size: 20px; }
.kl-tile:hover, .mode-card:hover { border-color: var(--accent); }
.tabs button[data-mode-hidden] { display: none; }
.kl-head { display: flex; align-items: center; gap: 12px; } .kl-head h2 { margin: 0; } .kl-head button { flex: none; width: auto; }
#modeBtn { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }

label.stay { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted, #556); }
label.stay input { width: auto; margin: 0; }
#restoring[hidden], #loginForm[hidden] { display: none; }
