/* Heika Tools — Dark Neo-Brutalism (aksen biru) */
:root {
  color-scheme: dark;
  --bg: #101113; --card: #1b1d20; --card2: #24272b; --line: #f4f4f5; --soft: #55585f;
  --text: #f4f4f5; --muted: #a1a1aa; --blue: #3b82f6; --green: #4ade80; --red: #fb7185; --yellow: #fcd34d;
  --shadow: 5px 5px 0 #3a3d44; --radius: 8px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; }
body { min-height: 100vh; padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
.wrap { width: min(100%, 640px); margin: 0 auto; padding: 18px 16px 8px; }

/* Header */
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.logo { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--blue); color: #fff; font-weight: 900; font-size: 22px; border: 2px solid var(--line); box-shadow: var(--shadow); flex: none; }
.top h1 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.top p { margin: 0; color: var(--muted); font-size: 12.5px; }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; }

/* Kartu */
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.card h2 { margin: 0 0 4px; font-size: 16px; }
.card .sub { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 380px) { .grid2 { grid-template-columns: 1fr; } }

/* Home */
.big { font-size: 46px; font-weight: 900; line-height: 1; letter-spacing: -.02em; color: var(--blue); font-variant-numeric: tabular-nums; }
.big small { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.bars { display: grid; gap: 12px; }
.bar-row .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.bar-row .meta span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 14px; border: 2px solid var(--line); border-radius: 4px; background: var(--bg); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--blue); width: 0; transition: width .5s ease; }
.empty { color: var(--muted); font-size: 13px; text-align: center; padding: 14px 4px; }

/* Tools */
.tool-list { display: grid; gap: 14px; }
.tool { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.tool:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #000; }
.tool .ico { width: 46px; height: 46px; flex: none; display: grid; place-items: center; font-size: 24px; background: var(--card2); border: 2px solid var(--soft); border-radius: 10px; }
.tool b { display: block; font-size: 16px; }
.tool p { margin: 2px 0 8px; color: var(--muted); font-size: 13px; }
.tool.off { opacity: .5; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; font-weight: 800; padding: 2px 8px; border: 1.5px solid var(--soft); border-radius: 99px; color: var(--muted); }
.tag.wa { border-color: var(--green); color: var(--green); }

/* Form */
.back { text-decoration: none; color: var(--text); display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; padding: 8px 12px; background: var(--card2); border: 2px solid var(--soft); border-radius: 6px; font-weight: 800; font-size: 13px; }
label.f { display: block; margin: 12px 0 0; font-size: 12.5px; font-weight: 800; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.in { display: block; width: 100%; margin-top: 6px; padding: 13px 14px; background: var(--bg); color: #fff; border: 2px solid var(--soft); border-radius: 5px; outline: none; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 15px; }
.in:focus { border-color: var(--blue); box-shadow: 3px 3px 0 var(--blue); }
.file { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 14px; border: 2px dashed var(--soft); border-radius: 6px; background: var(--bg); cursor: pointer; }
.file:hover, .file.has { border-color: var(--blue); }
.file input { display: none; }
.file .fi { font-size: 22px; }
.file .fn { font-size: 14px; font-weight: 700; word-break: break-all; }
.file .fs { font-size: 12px; color: var(--muted); font-weight: 500; }
.btn { display: block; width: 100%; margin-top: 16px; padding: 14px; background: var(--blue); color: #101113; border: 2px solid #101113; border-radius: 5px; font-weight: 900; font-size: 15px; box-shadow: 4px 4px 0 #f4f4f5; transition: transform .12s, box-shadow .12s; text-align: center; text-decoration: none; }
.btn:active:not(:disabled) { transform: translate(4px, 4px); box-shadow: 0 0 0 #f4f4f5; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.green { background: var(--green); }
.btn.ghost { background: var(--card2); color: var(--text); border-color: var(--soft); }
.btn.sm { display: inline-block; width: auto; margin: 0; padding: 9px 14px; font-size: 13px; }
.rules { margin: 0 0 4px; padding: 10px 12px; border: 1.5px solid var(--soft); border-radius: 6px; background: var(--card2); font-size: 13px; color: var(--muted); }
.rules b { color: var(--text); }
.note { margin-top: 10px; padding: 9px 12px; border-radius: 5px; font-size: 13px; font-weight: 700; border: 1.5px solid var(--yellow); background: #2b2614; color: var(--yellow); }
.err { margin-top: 12px; padding: 10px 12px; border: 1.5px solid var(--red); border-radius: 5px; background: #3a171d; color: #fecdd3; font-size: 13px; font-weight: 700; }
.ok { border-color: var(--green); background: #12301f; color: #bbf7d0; }

/* Progres */
.prog { margin-top: 14px; }
.prog .pm { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.prog .pm span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Hasil */
.res { margin-top: 14px; }
.kv { display: grid; gap: 0; border: 2px solid var(--soft); border-radius: 6px; overflow: hidden; }
.kv div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 12px; border-bottom: 1px solid #34373c; font-size: 13px; }
.kv div:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); flex: none; }
.kv span:last-child { font-weight: 700; text-align: right; word-break: break-word; }
.avatar { width: 84px; height: 84px; border-radius: 14px; border: 2px solid var(--line); object-fit: cover; display: block; margin: 0 0 12px; background: var(--card2); }
.preview { width: 100%; max-height: 320px; object-fit: contain; border: 2px solid var(--soft); border-radius: 6px; background: #000; margin-top: 10px; }
.linkbox { display: flex; gap: 8px; margin-top: 8px; }
.linkbox .in { margin: 0; flex: 1; min-width: 0; }
.dl { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; margin-top: 8px; border: 2px solid var(--soft); border-radius: 6px; background: var(--bg); }
.dl div { min-width: 0; font-size: 13px; font-weight: 700; word-break: break-all; }
.dl small { display: block; color: var(--muted); font-weight: 500; }

/* Statistik */
.stat { display: grid; gap: 0; }
.stat .r { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid #34373c; font-size: 14px; }
.stat .r:last-child { border-bottom: 0; }
.stat .r span:first-child { color: var(--muted); flex: none; }
.stat .r span:last-child { font-weight: 800; text-align: right; word-break: break-word; }
.clock { font-size: 38px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; border: 1.5px solid; }
.pill.on { color: var(--green); border-color: var(--green); }
.pill.off { color: var(--red); border-color: var(--red); }

/* Nav bawah */
nav.navbar { position: fixed; z-index: 50; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); width: min(calc(100% - 24px), 420px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 6px; background: var(--card); border: 2px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
nav.navbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 800; }
nav.navbar a svg { width: 22px; height: 22px; }
nav.navbar a.on { background: var(--blue); color: #101113; }

/* Skeleton & misc */
.sk { background: linear-gradient(90deg, #24272b 25%, #2f3237 50%, #24272b 75%); background-size: 200% 100%; animation: sk 1.1s linear infinite; border-radius: 4px; color: transparent !important; }
@keyframes sk { to { background-position: -200% 0; } }
.banner { margin-bottom: 14px; padding: 10px 12px; border: 2px solid var(--yellow); border-radius: 6px; background: #2b2614; color: var(--yellow); font-weight: 800; font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.switch { position: relative; width: 48px; height: 28px; flex: none; border: 2px solid var(--line); border-radius: 99px; background: var(--bg); padding: 0; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch.on { background: #12301f; border-color: var(--green); }
.switch.on::after { transform: translateX(20px); background: var(--green); }
.tbl { display: grid; gap: 10px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.tabs button { padding: 11px; border: 2px solid var(--soft); border-radius: 6px; background: var(--card2); font-weight: 900; }
.tabs button.on { background: var(--blue); color: #101113; border-color: var(--line); }

/* Loading bertahap (spinner + langkah) */
.spin { width: 18px; height: 18px; flex: none; border: 3px solid var(--soft); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.prog .pm { align-items: center; }
.prog .pm .l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.steps { display: grid; gap: 6px; margin-top: 12px; padding: 10px 12px; border: 2px solid var(--soft); border-radius: 6px; background: var(--card2); }
.steps div { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.steps div::before { content: ""; width: 12px; height: 12px; flex: none; border: 2px solid var(--soft); border-radius: 3px; }
.steps div.now { color: var(--text); }
.steps div.now::before { border-color: var(--blue); background: var(--blue); animation: blink 1s ease-in-out infinite; }
.steps div.done { color: var(--green); }
.steps div.done::before { border-color: var(--green); background: var(--green); }
@keyframes blink { 50% { opacity: .35; } }

/* Tile tools: neo-brutalism (warna solid, border tebal, bayangan keras) */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; padding-right: 5px; }
.tile { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 22px; min-height: 148px; padding: 14px; text-align: left; background: var(--c); color: #0b0b0c; border: 3px solid #0b0b0c; border-radius: 6px; box-shadow: 6px 6px 0 #f4f4f5; transition: transform .1s, box-shadow .1s; }
.tile:active { transform: translate(6px, 6px); box-shadow: 0 0 0 #f4f4f5; }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; }
.ibox { width: 46px; height: 46px; display: grid; place-items: center; flex: none; background: #fff; color: #0b0b0c; border: 3px solid #0b0b0c; border-radius: 4px; box-shadow: 3px 3px 0 #0b0b0c; }
.ibox.lg { width: 56px; height: 56px; color: #0b0b0c; }
.go { color: #0b0b0c; }
.tile-name { font-size: 18px; font-weight: 900; line-height: 1.1; letter-spacing: -.01em; text-transform: uppercase; }
.tile-off { position: absolute; right: 10px; bottom: 10px; padding: 1px 8px; background: #0b0b0c; color: #f4f4f5; font-size: 11px; font-weight: 900; border-radius: 3px; }
.tile.off { filter: grayscale(1); opacity: .6; }
.desc { margin: 14px 0 12px; color: var(--muted); font-size: 14px; }
.back svg { flex: none; }
.file .fi { display: grid; place-items: center; color: var(--blue); }
nav.navbar a svg { width: 22px; height: 22px; }

/* Tile versi gelap: permukaan gelap, border terang tebal, bayangan keras biru */
.tile { background: var(--card); color: var(--text); border: 3px solid var(--line); box-shadow: 6px 6px 0 var(--blue); }
.tile:active { transform: translate(6px, 6px); box-shadow: 0 0 0 var(--blue); }
.tile .ibox { background: var(--blue); color: #0b0b0c; border: 3px solid #0b0b0c; box-shadow: 3px 3px 0 #0b0b0c; }
.tile .go { color: var(--blue); }
.tile-name { color: var(--text); }
.tile-off { background: var(--red); color: #0b0b0c; }
.tile.off { filter: grayscale(1); opacity: .55; }
.ibox.lg { background: var(--blue) !important; border: 3px solid #0b0b0c; }
