/* ==========================================================================
   Putman Apps: gaya bersama (beranda, halaman aplikasi, admin)
   Konsep: kode sekali pakai = TIKET. Hanya tiket yang mencolok; selebihnya tenang.
   ========================================================================== */
:root {
  --paper: #f1f6f3; --surface: #ffffff; --surface-2: #e8f0ec; --ink: #12231f; --ink-2: #4a5f59; --line: #d3e0da;
  --brand: #0e7c74; --brand-ink: #ffffff; --brand-soft: #d9f0eb; --brand-text: #0a6a63;
  --sun: #ffc83d; --sun-ink: #2e2200; --sun-line: rgb(46 34 0 / .28);
  --danger: #b42318; --danger-soft: #fde8e6; --ok: #146c43; --ok-soft: #dcf3e6; --warn-soft: #fff1cc;
  --hue: 172;
  --tint: hsl(var(--hue) 52% 90%); --tint-2: hsl(var(--hue) 45% 84%); --tint-ink: hsl(var(--hue) 55% 20%);
  --r1: 10px; --r2: 14px; --r3: 22px;
  --shadow: 0 1px 2px rgb(18 35 31 / .06), 0 14px 30px -18px rgb(18 35 31 / .35);
  --font: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #08130f; --surface: #102019; --surface-2: #17302a; --ink: #e8f3ef; --ink-2: #9db5ad; --line: #234038;
  --brand: #35d6c0; --brand-ink: #04211c; --brand-soft: #123a34; --brand-text: #5fe5d2;
  --sun: #ffd25e; --sun-ink: #2a2000; --sun-line: rgb(42 32 0 / .3);
  --danger: #ff9a8f; --danger-soft: #3a1714; --ok: #6fe3a6; --ok-soft: #123324; --warn-soft: #3a2f0e;
  --tint: hsl(var(--hue) 34% 17%); --tint-2: hsl(var(--hue) 32% 22%); --tint-ink: hsl(var(--hue) 70% 86%);
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 18px 34px -18px rgb(0 0 0 / .8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.6 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { letter-spacing: -.012em; text-wrap: balance; }
a { color: var(--brand-text); text-underline-offset: 3px; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }
.wrap { width: min(1160px, 100% - clamp(32px, 8vw, 64px)); margin-inline: auto; }

/* ---------- bilah atas ---------- */
.topbar .wrap { display: flex; align-items: center; gap: 12px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.12rem; letter-spacing: -.01em; }
.logomark { flex: none; }
.lm-bg { fill: var(--brand); }
.lm-arrow, .lm-tray { fill: none; stroke: var(--brand-ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.lm-tray { stroke: var(--sun); }
.topbar .spacer { flex: 1; }
.iconbtn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.iconbtn:hover { background: var(--surface-2); }
.toplink { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px; font-weight: 600; text-decoration: none; color: var(--ink); }
.toplink:hover { color: var(--brand-text); }

/* ---------- tombol & isian ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer; font: 700 1rem/1 var(--font);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 0 20px;
  border-radius: var(--r2); background: var(--brand); color: var(--brand-ink); text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; transform: none; }
.btn.block { width: 100%; }
.btn.ink { background: var(--sun-ink); color: var(--sun); }
.btn.soft { background: var(--brand-soft); color: var(--brand-text); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: .92rem; border-radius: 11px; }
label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 6px; }
.hint { font-size: .88rem; color: var(--ink-2); margin-top: 6px; }
input[type=text], input[type=password], input[type=number], input[type=search], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r1); padding: 11px 13px; min-height: 46px;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }

/* ---------- chip & ikon aplikasi ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); font-size: .84rem; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.chip.brand { background: var(--brand-soft); color: var(--brand-text); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.bad { background: var(--danger-soft); color: var(--danger); }
.chip.warn { background: var(--warn-soft); color: var(--ink); }
.appicon { width: 72px; height: 72px; border-radius: 22%; object-fit: cover; flex: none; background: var(--brand-soft); box-shadow: 0 0 0 1px rgb(0 0 0 / .06); }
.appicon.letter { display: grid; place-items: center; font-weight: 800; font-size: 1.9rem; color: var(--brand-text); box-shadow: none; }
.appicon.sm { width: 48px; height: 48px; font-size: 1.25rem; }
.appicon.lg { width: 112px; height: 112px; font-size: 3rem; }

/* ---------- beranda ---------- */
.hero { display: grid; gap: 34px; padding: 22px 0 8px; align-items: center; }
.hero h1 { font-size: clamp(2.15rem, 6vw, 3.7rem); line-height: 1.03; font-weight: 800; letter-spacing: -.028em; max-width: 15ch; }
.hero .lead { margin-top: 16px; font-size: 1.12rem; color: var(--ink-2); max-width: 46ch; }
.tools { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; align-items: center; }
.searchbox { position: relative; flex: 1 1 260px; max-width: 420px; }
.searchbox svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--ink-2); pointer-events: none; }
.searchbox input { padding-left: 44px; min-height: 50px; border-radius: var(--r2); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter { appearance: none; cursor: pointer; font: 700 .92rem var(--font); min-height: 42px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: transparent; color: var(--ink); display: inline-flex; align-items: center; gap: 7px; }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.shelf { padding: 30px 0 56px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.shelf-head h2 { font-size: 1.35rem; font-weight: 800; }
.apps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.tile {
  display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: var(--r3); background: var(--surface);
  border: 1px solid var(--line); text-decoration: none; color: inherit; box-shadow: var(--shadow); min-width: 0;
}
.tile:hover { border-color: var(--brand); }
.tile .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tile h3 { font-size: 1.2rem; font-weight: 800; overflow-wrap: anywhere; }
.tile .tag { color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.2em; }
.tile .body { display: flex; flex-direction: column; gap: 14px; min-width: 0; flex: 1; }
.tile .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tile .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-2); font-size: .9rem; font-weight: 600; }
.tile .go { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-text); flex: none; }
.tile:hover .go { background: var(--brand); color: var(--brand-ink); }
.tile.feat { background: var(--tint); border-color: transparent; overflow: hidden; }
.tile.feat .tag, .tile.feat .meta { color: var(--tint-ink); }
.tile.feat .go { background: var(--tint-ink); color: var(--tint); }
.tile.feat .peek { display: none; }
@media (min-width: 760px) {
  .tile.feat { grid-column: span 2; display: grid; grid-template-columns: minmax(0, 1fr) 210px; column-gap: 24px; padding-right: 0; }
  .tile.feat .body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
  .tile.feat .peek { display: block; align-self: end; margin-top: 8px; height: 250px; border-radius: 22px 22px 0 0; object-fit: cover; object-position: top; background: var(--tint-2); box-shadow: 0 0 0 1px rgb(0 0 0 / .08); width: 100%; }
  .tile.feat h3 { font-size: 1.6rem; }
}

/* kondisi: memuat, kosong, galat */
.sk { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--r2); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.tile.sk-tile { height: 190px; box-shadow: none; }
.state { display: grid; gap: 14px; justify-items: start; padding: 34px; border-radius: var(--r3); border: 1.5px dashed var(--line); max-width: 560px; }
.state h3 { font-size: 1.25rem; font-weight: 800; }
.state svg { color: var(--brand-text); }

/* ---------- TIKET (elemen utama) ---------- */
.ticket { --n: 14px; filter: drop-shadow(0 0 1px var(--line)) drop-shadow(0 16px 20px rgb(18 35 31 / .14)); width: 100%; }
:root[data-theme="dark"] .ticket { filter: drop-shadow(0 0 1px var(--line)) drop-shadow(0 16px 20px rgb(0 0 0 / .5)); }
.tk-body { background: var(--surface); padding: 22px 22px 24px; border-radius: var(--r3) var(--r3) 0 0;
  -webkit-mask: radial-gradient(circle var(--n) at 0 100%, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--n) at 100% 100%, #0000 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle var(--n) at 0 100%, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--n) at 100% 100%, #0000 98%, #000) right / 51% 100% no-repeat; }
.tk-stub { position: relative; background: var(--sun); color: var(--sun-ink); padding: 22px 22px 24px; border-radius: 0 0 var(--r3) var(--r3);
  -webkit-mask: radial-gradient(circle var(--n) at 0 0, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--n) at 100% 0, #0000 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle var(--n) at 0 0, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--n) at 100% 0, #0000 98%, #000) right / 51% 100% no-repeat; }
.tk-stub::before { content: ""; position: absolute; left: 24px; right: 24px; top: 0; border-top: 2px dashed var(--sun-line); }
.tk-title { font-weight: 800; font-size: 1.15rem; }
.tk-sub { font-size: .92rem; color: var(--ink-2); margin-top: 2px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin: 18px 0 0; padding: 0; }
.fact { display: flex; flex-direction: column-reverse; gap: 1px; min-width: 0; }
.fact dt { font-size: .84rem; color: var(--ink-2); font-weight: 600; }
.fact dd { margin: 0; font-weight: 800; font-size: 1.05rem; overflow-wrap: anywhere; }
.tk-stub .stub-h { font-weight: 800; font-size: 1.02rem; }
.tk-stub .stub-p { font-size: .9rem; margin-top: 2px; opacity: .85; }
.tk-stub .btn { margin-top: 14px; }
.codeboxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.codeboxes .cc {
  width: 100%; min-width: 0; text-align: center; text-transform: uppercase; font: 800 1.28rem/1 var(--mono); letter-spacing: .06em;
  padding: 0; height: 54px; border-radius: 12px; border: 2px solid var(--sun-ink); background: #fffdf2; color: #2e2200;
}
.codeboxes .cc:focus { outline: 3px solid #2e2200; outline-offset: 2px; border-color: #2e2200; }
.codeboxes .cc::placeholder { color: rgb(46 34 0 / .28); }
span.cc { display: grid; place-items: center; }
span.cc.ex { opacity: .55; border-style: dashed; background: transparent; }
.codeboxes.shake { animation: shake .32s; }
@keyframes shake { 20% { translate: -7px 0; } 40% { translate: 7px 0; } 60% { translate: -5px 0; } 80% { translate: 5px 0; } }
.tk-msg { min-height: 1.4em; margin-top: 10px; font-size: .92rem; font-weight: 700; }
.tk-msg.bad { color: #7a1208; }
.tk-stub .row { display: flex; gap: 8px; margin-top: 14px; }
.tk-stub .row .btn { margin-top: 0; }
.tk-done { display: grid; gap: 6px; }
.tk-done .big { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; }
.tk-done .tick { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--sun-ink); color: var(--sun); flex: none; }
.tk-stub.torn { animation: tear .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes tear { 0% { transform: none; } 35% { transform: translate(5px, 9px) rotate(1.8deg); } 100% { transform: none; } }
.steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 14px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; counter-increment: s; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); font-weight: 800; }
.steps b { display: block; font-weight: 800; }
.steps span { color: var(--ink-2); font-size: .92rem; }

/* ---------- halaman aplikasi ---------- */
.detail { display: grid; gap: 22px; padding-bottom: 64px; }
.dhero { background: var(--tint); color: var(--tint-ink); border-radius: var(--r3); padding: 26px; display: flex; gap: 22px; align-items: center; margin-top: 4px; }
.dhero.sk { min-height: 170px; background: var(--surface-2); }
.dhero h1 { font-size: clamp(1.75rem, 4.6vw, 2.7rem); line-height: 1.05; font-weight: 800; letter-spacing: -.025em; overflow-wrap: anywhere; }
.dhero .dev { font-weight: 700; margin-top: 6px; opacity: .85; }
.dhero .tagline { margin-top: 8px; max-width: 52ch; }
.crumb { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 700; color: var(--ink-2); min-height: 44px; }
.crumb:hover { color: var(--brand-text); }
.dmain { display: grid; gap: 34px; min-width: 0; }
.sec h2 { font-size: 1.25rem; font-weight: 800; margin-bottom: 12px; }
.sec p { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 68ch; }
.shots { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; margin: 0 calc(-1 * clamp(16px, 4vw, 32px)); padding-inline: clamp(16px, 4vw, 32px); scrollbar-width: thin; }
.shot { flex: none; scroll-snap-align: start; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 18px; }
.shot img { display: block; height: clamp(300px, 56vw, 470px); width: auto; max-width: 82vw; border-radius: 18px; object-fit: contain; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line); }
.tips { border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); }
.tips summary, .verify summary { cursor: pointer; min-height: 48px; padding: 12px 16px; font-weight: 800; display: flex; align-items: center; gap: 10px; list-style: none; }
.tips summary::-webkit-details-marker, .verify summary::-webkit-details-marker { display: none; }
.tips summary::after, .verify summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; rotate: 45deg; translate: 0 -2px; transition: rotate .15s; }
.tips[open] summary::after, .verify[open] summary::after { rotate: -135deg; translate: 0 2px; }
.tips ol { margin: 0; padding: 0 20px 18px 38px; display: grid; gap: 8px; }
.verify { border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); }
.verify .box { padding: 0 16px 16px; display: grid; gap: 10px; }
.hash { font: 500 .82rem/1.5 var(--mono); overflow-wrap: anywhere; background: var(--surface-2); padding: 10px 12px; border-radius: var(--r1); }
.sharebar { display: flex; flex-wrap: wrap; gap: 10px; }
@media (min-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr) 390px; gap: 64px; padding-top: 34px; }
  .detail { grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "crumb crumb" "hero aside" "main aside"; column-gap: 40px; align-items: start; }
  .crumbrow { grid-area: crumb; }
  .dhero { grid-area: hero; padding: 34px; }
  .dmain { grid-area: main; }
  .aside { grid-area: aside; position: sticky; top: 20px; align-self: start; }
  .shots { margin-inline: 0; padding-inline: 0; }
}
@media (max-width: 959px) { .detail .aside { order: 2; } .detail .dmain { order: 3; } .hero .ticket { max-width: 460px; } }
@media (max-width: 520px) { .dhero { flex-direction: column; align-items: flex-start; padding: 22px; } .appicon.lg { width: 92px; height: 92px; } }

/* ---------- penampil gambar ---------- */
dialog { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: 100vw; max-height: 100vh; }
dialog::backdrop { background: rgb(4 12 10 / .82); }
.lightbox { position: fixed; inset: 0; margin: 0; width: 100%; height: 100%; place-items: center; }
.lightbox:not([open]) { display: none; }
.lightbox[open] { display: grid; }
.lightbox img { max-width: min(94vw, 900px); max-height: 86vh; border-radius: 14px; box-shadow: 0 20px 60px rgb(0 0 0 / .6); }
.lightbox .lbbtn { position: absolute; background: rgb(255 255 255 / .16); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.lightbox .lbbtn:hover { background: rgb(255 255 255 / .3); }
.lbbtn.close { top: 16px; right: 16px; } .lbbtn.prev { left: 16px; top: 50%; translate: 0 -50%; } .lbbtn.next { right: 16px; top: 50%; translate: 0 -50%; }
.lbcount { position: absolute; bottom: 18px; left: 50%; translate: -50% 0; color: #fff; font-weight: 700; background: rgb(0 0 0 / .4); padding: 4px 12px; border-radius: 999px; }

/* ---------- notifikasi ---------- */
#toasts { position: fixed; z-index: 50; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); translate: -50% 0; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: 14px; font-weight: 700; box-shadow: var(--shadow); animation: toastin .2s ease-out; }
.toast.bad { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transition: opacity .25s; }
@keyframes toastin { from { translate: 0 8px; opacity: 0; } }

.sitefoot { padding: 30px 0 46px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .92rem; }
.sitefoot .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center; }

@media (prefers-reduced-motion: reduce) {
  .sk { animation: none; }
  .codeboxes.shake, .tk-stub.torn, .toast { animation: none; }
}

