/* ============ Scrapku — dashboard & auth ============ */
[hidden] { display: none !important; }
.muted { opacity: .72; }
.small { font-size: 13px; }
.right { text-align: right; }
code, .mono { font-family: var(--font-mono); font-size: .92em; }
.pill {
  display: inline-block;
  padding: 2px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
  font-size: 13px;
  word-break: break-all;
}
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* ---------- Alerts ---------- */
.alert {
  border: var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 0 0 18px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.alert ul { margin: 0; padding-left: 18px; }
.alert-error { background: #ffd0c4; }
.alert-success { background: var(--lime); }
.alert-info { background: var(--sky); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; font-weight: 600; }
.field > span:first-child { font-size: 14px; }
.field input:not([type='checkbox']):not([type='radio']),
.field select,
.field textarea,
.search-row input,
.search-row select,
.inline-form input,
.inline-form select {
  width: 100%;
  padding: 11px 14px;
  border: var(--border);
  border-radius: 14px;
  background: var(--white);
  font: 500 16px var(--font-body);
  color: var(--ink);
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus,
.search-row input:focus, .inline-form input:focus {
  outline: none;
  box-shadow: var(--shadow-sm);
  background: var(--cream);
}
.hint { font-weight: 500; font-size: 13px; opacity: .8; }
.hint code { word-break: break-all; }
.field.check { display: flex; align-items: center; gap: 10px; align-self: end; padding-bottom: 12px; }
.field.check input { width: 22px; height: 22px; accent-color: var(--ink); }
.field-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; }
.pw { position: relative; display: block; }
.pw input { padding-right: 70px !important; }
.pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: 2px solid var(--ink); border-radius: 999px; background: var(--cream);
  font: 700 12px var(--font-body); padding: 4px 10px; cursor: pointer;
}
.prefix-input {
  display: flex;
  border: var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--white);
}
.prefix-input .prefix {
  display: flex; align-items: center;
  padding: 0 10px 0 14px;
  background: var(--orange);
  border-right: var(--border);
  font-family: var(--font-mono); font-size: 14px; font-weight: 700;
  white-space: nowrap;
  flex: none;
  max-width: 70%; overflow: hidden; text-overflow: ellipsis;
}
.prefix-input input { flex: 1; min-width: 0; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }

.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { padding: 8px 12px; font-size: 15px; min-width: 0; }
.inline-form select { padding: 6px 10px; font-size: 14px; width: auto; }

.search-row { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.search-row input { flex: 1; min-width: 200px; }
.search-row select { width: auto; }

/* ---------- Auth ---------- */
body.auth { min-height: 100vh; }
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
  padding: 32px 16px 48px;
}
.auth-logo { font-size: 26px; }
.auth-card { width: min(460px, 100%); position: relative; padding: 36px 32px; }
.auth-card:hover { transform: none; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 38px; margin-bottom: 6px; }
.auth-card .muted { margin: 0 0 22px; }
.auth-mascot {
  position: absolute; right: -28px; top: -56px; width: 110px;
  transform: rotate(10deg);
}
.auth-card a { text-decoration: none; }
.auth-card .hint a, .auth-switch a {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 2px solid transparent;
  transition: background .15s, border-color .15s;
}
.auth-switch a:hover, .auth-switch a:focus-visible { background: var(--white); border-color: var(--ink); }
.auth-switch {
  margin: 30px 0 0;
  padding-top: 20px;
  border-top: 2px dashed rgba(20, 20, 20, .35);
  text-align: center; font-weight: 600;
}
.role-pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-pick legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.role-opt { position: relative; cursor: pointer; }
.role-opt input { position: absolute; opacity: 0; }
.role-opt span {
  display: grid; gap: 2px; height: 100%;
  padding: 12px 14px;
  border: var(--border); border-radius: 16px;
  background: var(--white);
}
.role-opt small { font-size: 12.5px; font-weight: 500; opacity: .75; }
.role-opt .role-tag { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.role-feats { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; font-weight: 500; line-height: 1.35; }
.role-feats li { position: relative; padding-left: 20px; }
.role-feats li::before { position: absolute; left: 0; top: 0; font-weight: 800; }
.role-feats li.yes::before { content: '✓'; }
.role-feats li.no { opacity: .6; }
.role-feats li.no::before { content: '✕'; }
.role-feats code { font-size: 11.5px; word-break: break-all; }
.role-note { grid-column: 1 / -1; margin: 2px 0 0; font-size: 13px; font-weight: 500; opacity: .8; }

/* ---------- Upgrade ke developer ---------- */
.upgrade-box {
  display: grid; gap: 8px;
  margin-top: 16px; padding: 14px 16px;
  border: 2px dashed var(--ink); border-radius: var(--radius-sm);
  background: var(--cream);
}
.upgrade-box p { margin: 0; font-size: 14px; }
.upgrade-box code { word-break: break-all; }
.upgrade-box form { margin: 0; }

/* ---------- Dialog konfirmasi ---------- */
.confirm-dialog {
  width: min(400px, calc(100vw - 32px));
  padding: 22px 22px 20px;
  border: var(--border); border-radius: var(--radius);
  background: var(--white); color: var(--ink);
  box-shadow: var(--shadow);
}
.confirm-dialog::backdrop {
  background: rgba(20, 20, 20, .35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.confirm-dialog[open] { animation: pop-in .16s ease-out; }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@media (prefers-reduced-motion: reduce) { .confirm-dialog[open] { animation: none; } }
.confirm-dialog form { margin: 0; }
.confirm-title { margin: 0 0 6px; font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.confirm-msg { margin: 0 0 20px; font-weight: 500; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.hello-actions form { margin: 0; }
.role-opt input:checked + span { background: var(--ink); color: var(--white); box-shadow: 4px 4px 0 var(--white), 4px 4px 0 3px var(--ink); }
.role-opt input:focus-visible + span { outline: 3px dashed var(--ink); outline-offset: 3px; }

/* ---------- Dashboard shell ---------- */
body.dash { background: var(--cream); }
.dash-shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 22px;
  padding: 24px 18px;
  background: var(--purple);
  border-right: var(--border);
  overflow-y: auto;
}
.me {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border: var(--border); border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.me strong { display: block; word-break: break-all; }
.avatar {
  flex: none;
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border: var(--border); border-radius: 50%;
  background: var(--orange);
  font-family: var(--font-display); font-weight: 800;
}
.role {
  display: inline-block;
  padding: 1px 10px;
  border: 2px solid var(--ink); border-radius: 999px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.role-admin { background: var(--coral); }
.role-developer { background: var(--lime); }
.role-user { background: var(--sky); }
.sidebar nav { display: grid; gap: 14px; }
.side-group { display: grid; gap: 4px; }
.side-cat {
  padding: 0 14px 2px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  opacity: .65;
}
.side-ext { margin-left: auto; font-size: 14px; opacity: .7; }
.side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border: 3px solid transparent; border-radius: 999px;
  font-weight: 700; text-decoration: none;
}
.side-link:hover { border-color: var(--ink); background: var(--orange); }
.side-link.is-active { border-color: var(--ink); background: var(--white); box-shadow: var(--shadow-sm); }
.logout { margin-top: auto; }

.dash-main { padding: 28px clamp(16px, 3vw, 40px) 64px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.topbar h1 { font-size: clamp(26px, 3.4vw, 38px); }
.side-toggle { display: none; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.side-close {
  display: none;
  place-items: center;
  width: 42px; height: 42px; flex: none;
  border: var(--border); border-radius: 50%;
  background: var(--coral);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.side-close:active { transform: translate(3px, 3px); box-shadow: none; }
.side-backdrop { display: none; }

/* ---------- Panels & cards ---------- */
.panel {
  border: var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
  min-width: 0;
}
.panel h3 { font-size: 19px; margin-bottom: 14px; }
.panel h3 small { font-family: var(--font-body); font-weight: 500; font-size: 14px; }
.panel h4 { margin: 16px 0 8px; font-family: var(--font-display); font-size: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.panel-head h3 { margin: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.two-col .panel { margin-bottom: 24px; }

.hello {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.hello:hover { transform: none; box-shadow: var(--shadow); }
.hello.purple-soft { background: var(--purple); }
.hello h2 { font-size: 26px; margin-bottom: 6px; }
.hello p { margin: 0; }
.hello-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card {
  border: var(--border); border-radius: 22px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.stat-card small { font-weight: 700; font-size: 13px; }
.stat-card strong { display: block; font-family: var(--font-display); font-size: 34px; margin-top: 4px; }
.stat-card.lime { background: var(--lime); }
.stat-card.pink { background: var(--pink); }
.stat-card.sky { background: var(--sky); }
.stat-card.orange { background: var(--orange); }

.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.mini-stats > div { border: 2px solid var(--ink); border-radius: 16px; padding: 12px 14px; background: var(--cream); }
.mini-stats small { font-weight: 600; font-size: 13px; }
.mini-stats strong { display: block; font-family: var(--font-display); font-size: 22px; white-space: nowrap; }

.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bar-list li { display: grid; grid-template-columns: minmax(80px, 140px) 1fr auto; align-items: center; gap: 10px; }
.bar-list .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 16px; border: 2px solid var(--ink); border-radius: 999px; background: var(--cream); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--coral); border-right: 2px solid var(--ink); min-width: 2px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: var(--border); border-radius: 18px; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { padding: 12px; text-align: left; border-bottom: 2px solid var(--ink); vertical-align: middle; white-space: nowrap; }
.table th { background: var(--orange); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--cream); }
.table tr.is-off td { opacity: .55; }
.table td.wrap { white-space: normal; min-width: 110px; }
.table td.actions > * { display: inline-block; vertical-align: middle; }
.table td.actions > * + * { margin-left: 6px; }
.table a { font-weight: 700; }

.status, .method {
  display: inline-block;
  padding: 2px 10px;
  border: 2px solid var(--ink); border-radius: 999px;
  font: 700 12px var(--font-mono);
}
.status.s2 { background: var(--lime); }
.status.s4 { background: var(--orange); }
.status.s5 { background: var(--coral); }
.method.m-GET { background: var(--sky); }
.method.m-POST { background: var(--pink); }
.method.m-ANY { background: var(--lime); }

.switch {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; background: none; padding: 0;
  font: 700 13px var(--font-body); cursor: pointer;
}
.switch span {
  position: relative; width: 44px; height: 24px;
  border: var(--border); border-radius: 999px; background: var(--white);
}
.switch span::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--ink); transition: transform .15s ease;
}
.switch.on span { background: var(--lime); }
.switch.on span::after { transform: translateX(20px); }

.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.pager a {
  display: grid; place-items: center; min-width: 38px; height: 38px;
  border: 2px solid var(--ink); border-radius: 12px; text-decoration: none; font-weight: 700;
}
.pager a.is-active { background: var(--ink); color: var(--white); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0 0 14px; }
.kv dt { font-weight: 700; }
.kv dd { margin: 0; word-break: break-all; }

.empty { padding: 20px; text-align: center; font-weight: 600; opacity: .7; }
.empty-state { display: grid; justify-items: center; gap: 14px; padding: 24px 12px; text-align: center; }
.empty-state p { max-width: 440px; margin: 0; }

/* ---------- Keys ---------- */
.new-key { background: var(--lime); }
.new-key-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.new-key-head h3 { margin: 0 0 2px; }
.new-key-head p { margin: 0; font-size: 14px; }
.new-key-icon {
  flex: none; display: grid; place-items: center;
  width: 42px; height: 42px;
  border: var(--border); border-radius: 50%; background: var(--white); font-size: 20px;
}
.keys-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.keys-top h3 { margin: 0 0 2px; }
.keys-top p { margin: 0; }
.quota { display: grid; gap: 6px; min-width: 160px; font-size: 13px; font-weight: 600; }
.quota-num b { font-family: var(--font-display); font-size: 18px; }
.quota-bar { height: 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--cream); overflow: hidden; }
.quota-bar i { display: block; height: 100%; background: var(--lime); }
.key-create { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.key-create .field { flex: 1; }
.key-full { margin: -6px 0 16px; font-size: 13px; font-weight: 600; color: #b3361b; }
.key-empty { padding: 18px; border: 2px dashed var(--ink); border-radius: var(--radius-sm); text-align: center; background: var(--cream); }
.key-empty p { margin: 0; }
.key-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.key-item {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) auto; gap: 14px; align-items: center;
  padding: 12px 14px;
  border: 2px solid var(--ink); border-radius: var(--radius-sm);
  background: var(--white);
}
.key-item:hover { background: var(--cream); }
.key-item.is-off { opacity: .6; background: var(--cream); }
.key-main { display: grid; gap: 2px; min-width: 0; }
.key-name { overflow-wrap: anywhere; }
.key-prefix { font-size: 13px; opacity: .75; }
.key-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; font-size: 13px; }
.key-meta dt { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; opacity: .65; }
.key-meta dd { margin: 0; }
.key-action { justify-self: end; margin: 0; }
.key-revoked { margin-top: 16px; }
.key-revoked summary { cursor: pointer; font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.usage-note { margin: -6px 0 14px; }
.usage { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.usage-item { display: grid; gap: 8px; align-content: start; min-width: 0; }
.usage-item .code-block { font-size: 13px; white-space: pre-wrap; word-break: break-all; }
.usage-item p { margin: 0; }
.usage-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.usage-head .btn { margin-left: auto; }
.chip-sm {
  padding: 1px 10px;
  border: 2px solid var(--ink); border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.chip-sm.lime { background: var(--lime); }
.chip-sm.orange { background: var(--orange); }
@media (max-width: 1100px) { .usage { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .key-item { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .key-meta { grid-column: 1 / -1; grid-row: 2; }
  .key-action { grid-column: 2; grid-row: 1; }
  .key-create { flex-direction: column; align-items: stretch; }
  .quota { width: 100%; }
}
.copy-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.secret {
  flex: 1; min-width: 0;
  padding: 12px 14px;
  border: var(--border); border-radius: 14px;
  background: var(--white);
  word-break: break-all;
}
.code-block {
  margin: 0;
  padding: 16px 18px;
  border: var(--border); border-radius: 16px;
  background: var(--ink); color: #f2f2f2;
  font: 14px/1.65 var(--font-mono);
  overflow-x: auto;
  white-space: pre;
}
.code-block em { color: var(--orange); font-style: normal; }
.code-block.logs { background: #262626; color: var(--lime); max-height: 260px; overflow: auto; }

/* ---------- Catalog ---------- */
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.ep-card {
  display: flex; flex-direction: column; gap: 10px;
  border: var(--border); border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.ep-card.orange { background: var(--orange); }
.ep-card.lime { background: var(--lime); }
.ep-card.pink { background: var(--pink); }
.ep-card.sky { background: var(--sky); }
.ep-card h3 { font-size: 20px; }
.ep-card p { margin: 0; }
.ep-card .btn { align-self: flex-start; margin-top: auto; }
.ep-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.ep-url {
  display: block; padding: 10px 12px;
  border: 2px solid var(--ink); border-radius: 12px;
  background: var(--white); font-size: 13px; word-break: break-all;
}
.param-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.param-list code { font-weight: 700; }
.req {
  margin-left: 6px; padding: 0 6px;
  border: 2px solid var(--ink); border-radius: 6px;
  background: var(--coral); font-size: 11px;
}

/* ---------- Endpoint editor ---------- */
.ep-layout { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 24px; align-items: start; }
.ep-layout .panel { margin-bottom: 24px; }
.ep-layout .panel:first-child .form, .ep-layout .panel:first-child { display: grid; gap: 14px; }
.ep-layout .panel:first-child h3 { margin: 0; }
.ep-detail .opt { font-style: normal; font-weight: 500; opacity: .6; }
.url-preview { word-break: break-all; }
.url-preview b { color: #7b3fd1; }
.code-panel { display: flex; flex-direction: column; gap: 10px; }
.code-panel .panel-head { margin-bottom: 0; }
.tpl-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tpl-pick select {
  padding: 7px 10px; max-width: 100%;
  border: 2px solid var(--ink); border-radius: 12px;
  background: var(--white); font: 600 14px var(--font-body); color: var(--ink);
}

/* Editor kode: textarea transparan di atas <pre> berwarna (overlay) + nomor baris */
.code-wrap {
  --code-font: 14px/1.6 var(--font-mono);
  --code-pad: 16px;
  display: flex;
  min-height: 520px;
  border: var(--border); border-radius: 16px;
  background: #17151f;
  overflow: hidden;
}
.code-wrap:focus-within { box-shadow: 4px 4px 0 var(--purple-deep); }
.code-gutter {
  flex: none;
  min-width: 3.2em;
  padding: var(--code-pad) 10px var(--code-pad) 12px;
  border-right: 1px solid #2e2b3a;
  color: #5f5a73;
  font: var(--code-font);
  text-align: right;
  white-space: pre;
  overflow: hidden;
  user-select: none;
}
.code-area { position: relative; flex: 1; min-width: 0; display: flex; }
.code-editor, .code-hl {
  font: var(--code-font);
  font-variant-ligatures: none;
  letter-spacing: 0;
  tab-size: 2;
  white-space: pre;
  padding: var(--code-pad);
  margin: 0;
}
.code-editor {
  flex: 1;
  width: 100%;
  min-height: 520px;
  border: 0; border-radius: 0;
  background: transparent; color: #f2f2f2;
  resize: vertical;
  caret-color: var(--lime);
  overflow: auto;
}
.code-editor:focus { outline: none; }
.code-hl { display: none; }
.code-wrap.is-hl .code-hl {
  display: block;
  position: absolute; inset: 0;
  overflow: hidden;
  color: #ece9f5;
  pointer-events: none;
}
.code-wrap.is-hl .code-editor { color: transparent; -webkit-text-fill-color: transparent; position: relative; z-index: 1; }
.code-wrap.is-hl .code-editor::selection { background: rgba(157, 140, 242, .45); }
.code-hl .t-c { color: #7d778f; font-style: italic; }
.code-hl .t-s { color: #d6f27a; }
.code-hl .t-n { color: #ffbf6b; }
.code-hl .t-k { color: #c3a6ff; font-weight: 700; }
.code-hl .t-l { color: #ff9d7a; }
.code-hl .t-b { color: #ff8fb8; font-weight: 700; }
.code-hl .t-f { color: #7fd4ff; }
.code-hl .t-p { color: #b5e3d8; }
.editor-keys { margin: 0; }

/* Aturan respons */
.rules { border: 2px dashed var(--ink); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--cream); }
.rules summary { cursor: pointer; font-weight: 700; }
.rules[open] summary { margin-bottom: 8px; }
.rules p { margin: 0 0 10px; font-size: 14px; }
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rules-grid > div { display: grid; gap: 6px; align-content: start; min-width: 0; }
.rules-grid .chip-sm { justify-self: start; }
.rules .code-block { font-size: 12.5px; padding: 10px 12px; white-space: pre-wrap; }
.code-block.light { background: var(--white); color: var(--ink); }
.rules-list { margin: 10px 0 0; padding-left: 18px; font-size: 13.5px; display: grid; gap: 4px; }
.chip-sm.coral { background: var(--coral); }

/* Editor parameter */
.param-editor { display: grid; gap: 10px; justify-items: start; }
.param-rows { display: grid; gap: 10px; width: 100%; }
.param-rows:empty { display: none; }
.param-row {
  --ph: 38px; /* tinggi seragam: input, toggle wajib, tombol hapus */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto var(--ph);
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 2px solid var(--ink); border-radius: 14px;
  background: var(--cream);
}
.param-row input[type='text'] {
  width: 100%; height: var(--ph); padding: 0 10px;
  border: 2px solid var(--ink); border-radius: 10px;
  background: var(--white); font: 500 14px var(--font-body); color: var(--ink);
}
.param-row input[type='text']:focus { outline: none; box-shadow: 3px 3px 0 var(--ink); }
.param-row [data-p='name'] { font-family: var(--font-mono); font-weight: 700; }
.param-row [data-p='desc'] { grid-column: 1 / -1; height: 34px; font-size: 13px; }
.param-row input.invalid { background: #ffd0c4; }
.param-req {
  display: flex; align-items: center; gap: 6px;
  height: var(--ph); padding: 0 10px;
  border: 2px solid var(--ink); border-radius: 10px;
  background: var(--white);
  font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; user-select: none;
}
.param-req input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.param-req:has(input:checked) { background: var(--lime); }
.param-del {
  display: grid; place-items: center;
  width: var(--ph); height: var(--ph); padding: 0;
  border: 2px solid var(--ink); border-radius: 10px;
  background: var(--white); color: var(--ink);
  cursor: pointer;
  transition: background .12s, transform .12s, box-shadow .12s;
}
.param-del:hover, .param-del:focus-visible { background: var(--coral); box-shadow: 2px 2px 0 var(--ink); transform: translate(-1px, -1px); }
.param-del:focus-visible { outline: 2px dashed var(--ink); outline-offset: 2px; }
.param-del:active { transform: translate(1px, 1px); box-shadow: none; }

/* Uji coba */
.test-panel { background: var(--purple); }
.test-grid { display: grid; grid-template-columns: 160px 1fr; gap: 14px 16px; align-items: start; }
.test-grid .test-body { grid-column: 2; }
.test-method select:disabled { opacity: .75; }
.test-param-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.test-param-list:empty { display: none; }
.test-param { display: grid; gap: 4px; font-size: 13px; font-weight: 700; }
.test-param input {
  width: 100%; padding: 10px 12px;
  border: var(--border); border-radius: 12px;
  background: var(--white); font: 500 15px var(--font-body); color: var(--ink);
}
.test-params > p { margin: 4px 0 0; }
.test-body textarea { width: 100%; }
.test-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.test-out { margin-top: 18px; display: grid; gap: 12px; }
.test-out h4 { margin: 0 0 6px; font-family: var(--font-display); font-size: 13px; }
.test-problem { margin: 0; }
.test-problem pre { margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; font: 500 13px/1.5 var(--font-mono); }
.test-meta {
  justify-self: start;
  padding: 4px 14px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: var(--white); font-weight: 700; font-size: 14px;
}
.test-meta.ok { background: var(--lime); }
.test-meta.err { background: var(--coral); }
#test-result { max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-bottom: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .ep-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .dash-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(290px, 85vw); z-index: 60;
    transform: translateX(-105%); transition: transform .2s ease;
  }
  body.side-open .sidebar { transform: none; box-shadow: 8px 0 0 var(--ink); }
  .side-toggle { display: grid; }
  .side-close { display: grid; }
  .side-backdrop {
    display: block;
    position: fixed; inset: 0; z-index: 55;
    background: rgba(20, 20, 20, .35);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
  }
  body.side-open .side-backdrop { opacity: 1; pointer-events: auto; }
  body.side-open { overflow: hidden; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .role-pick { grid-template-columns: 1fr; }
  .auth-card { padding: 30px 20px; }
  .auth-mascot { width: 84px; right: -6px; top: -44px; }
  .panel { padding: 14px 14px 16px; margin-bottom: 14px; border-radius: 20px; box-shadow: var(--shadow-sm); }

  /* Dashboard mobile: lebih rapat */
  .dash-main { padding: 14px 12px 40px; }
  .topbar { margin-bottom: 14px; gap: 10px; }
  .topbar h1 { font-size: 24px; }
  .topbar .nav-toggle { width: 42px; height: 42px; }
  .hello { padding: 16px; gap: 12px; margin-bottom: 14px; border-radius: 20px; box-shadow: var(--shadow-sm); }
  .hello h2 { font-size: 20px; margin-bottom: 4px; }
  .hello p { font-size: 14px; }
  .hello-actions { gap: 8px; width: 100%; }
  .hello-actions .btn { padding: 9px 16px; font-size: 14px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
  .stat-card { padding: 12px 14px; border-radius: 16px; box-shadow: 3px 3px 0 var(--ink); }
  .stat-card small { font-size: 12px; line-height: 1.25; display: block; }
  .stat-card strong { font-size: 24px; margin-top: 2px; }
  .two-col { gap: 0; }
  .two-col .panel { margin-bottom: 14px; }
  .panel h3 { font-size: 17px; margin-bottom: 10px; }
  .mini-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .mini-stats > div { padding: 8px 10px; border-radius: 12px; }
  .mini-stats small { font-size: 12px; }
  .mini-stats strong { font-size: 17px; }
  .alert { padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
  .table { font-size: 14px; }
  .table th, .table td { padding: 8px 10px; }
  .table-wrap { border-radius: 14px; }
  .panel-head .inline-form { width: 100%; }
  .field-row { grid-template-columns: 1fr; }
  .code-wrap { --code-font: 13px/1.6 var(--font-mono); --code-pad: 12px; min-height: 380px; }
  .code-editor { min-height: 380px; }
  .code-gutter { min-width: 2.6em; padding-left: 6px; padding-right: 6px; }
  .rules-grid { grid-template-columns: 1fr; }
  .test-grid { grid-template-columns: 1fr; }
  .test-grid .test-body { grid-column: auto; }
  .tpl-pick, .tpl-pick select { width: 100%; }
}

/* ---------- Profil publik developer ---------- */
body.public-profile { background: var(--purple); }
.profile { padding: 48px 0 96px; }
.profile-hero {
  border: var(--border);
  border-radius: 36px;
  background: var(--orange);
  box-shadow: 10px 10px 0 var(--ink);
  padding: clamp(22px, 4vw, 40px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 26px 32px;
  align-items: center;
  margin-bottom: 72px;
}
.profile-id { display: flex; align-items: center; gap: 22px; min-width: 0; }
.profile-id h1 { font-size: clamp(30px, 6vw, 60px); margin: 10px 0 4px; word-break: break-all; }
.profile-sub { margin: 0; font-weight: 600; }
.profile-avatar {
  flex: none;
  display: grid; place-items: center;
  width: clamp(76px, 12vw, 120px); aspect-ratio: 1;
  border: var(--border); border-radius: 50%;
  background: var(--lime);
  box-shadow: var(--shadow);
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(34px, 6vw, 58px);
  transform: rotate(-6deg);
}
.profile-stats { display: grid; grid-template-columns: repeat(2, minmax(130px, 1fr)); gap: 14px; }
.profile-base { grid-column: 1 / -1; display: grid; gap: 6px; }
.profile-base small { font-weight: 700; }
.owner-note {
  grid-column: 1 / -1; margin: 0;
  padding: 10px 16px;
  border: 2px dashed var(--ink); border-radius: 14px;
  background: var(--cream); font-weight: 600;
}
.profile-list { padding: 0; }
.profile-list .section-head { margin-bottom: 28px; }
.profile-list .section-head a { font-weight: 700; }
.profile-eps { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.profile-eps .ep-card { scroll-margin-top: 110px; }
.profile-eps .ep-card:target { outline: 4px dashed var(--ink); outline-offset: 6px; }
.profile .empty-state:hover { transform: none; }
body.public-profile footer { padding: 28px 0; }

@media (max-width: 760px) {
  .profile-hero { grid-template-columns: 1fr; }
  .profile-id { gap: 16px; }
  .profile-hero { margin-bottom: 48px; }
  .profile-eps { grid-template-columns: 1fr; }
}
.public-link { display: grid; gap: 6px; margin-top: 6px; padding-top: 16px; border-top: 2px dashed var(--ink); }
.public-link small { font-weight: 700; }
.public-link .secret { flex-basis: 100%; }

/* ---------- Playground ---------- */
.pg { padding: 36px 0 80px; }
.pg-hero { margin-bottom: 24px; }
.pg-hero h1 { font-size: clamp(30px, 5vw, 48px); margin: 10px 0 6px; }
.pg-hero p { margin: 0; max-width: 620px; }
.pg-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.pg-list { position: sticky; top: 16px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.pg-list input[type='search'] {
  width: 100%; padding: 10px 12px;
  border: var(--border); border-radius: 12px;
  font: 500 15px var(--font-body); color: var(--ink); background: var(--white);
}
.pg-items { overflow-y: auto; display: grid; gap: 4px; margin: 0 -4px; padding: 0 4px 4px; }
.pg-group { margin: 8px 4px 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .6; }
.pg-group:first-child { margin-top: 0; }
.pg-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px;
  border: 2px solid transparent; border-radius: 12px;
  background: transparent; text-align: left; cursor: pointer;
  font: inherit; color: inherit;
}
.pg-item:hover { background: var(--cream); border-color: var(--ink); }
.pg-item.is-active { background: var(--lime); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.pg-item .method { flex: none; font-size: 10.5px; padding: 1px 7px; }
.pg-item-text { display: grid; min-width: 0; }
.pg-item-text strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-item-text code { font-size: 12px; opacity: .65; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-main { display: grid; gap: 0; min-width: 0; }
.pg-ep-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pg-ep-head h2 { font-size: 24px; margin: 0 0 4px; }
.pg-ep-head p { margin: 0; }
.pg-url {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 18px;
  border: var(--border); border-radius: 14px; background: var(--cream);
}
.pg-url code { flex: 1; min-width: 0; word-break: break-all; font-size: 13.5px; }
.pg-form { display: grid; gap: 16px; }
.pg-auth { border: 2px dashed var(--ink); border-radius: var(--radius-sm); padding: 10px 14px 14px; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.pg-auth legend { font-weight: 700; font-size: 14px; padding: 0 6px; }
.pg-radio { display: flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
.pg-radio input { width: 18px; height: 18px; accent-color: var(--ink); }
.pg-radio small { font-weight: 500; opacity: .7; }
.pg-key { flex-basis: 100%; display: grid; gap: 6px; }
.pg-key input[type='password'], .pg-key input[type='text'] {
  width: 100%; padding: 10px 70px 10px 12px;
  border: var(--border); border-radius: 12px;
  font: 500 14px var(--font-mono); color: var(--ink); background: var(--white);
}
.pg-remember { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.pg-remember input { accent-color: var(--ink); }
.pg-key .hint a { font-weight: 700; }
.pg-params { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.pg-params:empty { display: none; }
.pg-param { display: grid; gap: 4px; }
.pg-param > span { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.pg-param input, .pg-extra-row input {
  width: 100%; height: 40px; padding: 0 12px;
  border: var(--border); border-radius: 12px;
  font: 500 15px var(--font-body); color: var(--ink); background: var(--white);
}
.pg-param input:focus, .pg-extra-row input:focus, .pg-list input:focus, .pg-key input:focus { outline: none; box-shadow: 3px 3px 0 var(--ink); }
.pg-param.missing input { background: #ffd0c4; }
.pg-param.missing > span::after { content: 'isi dulu'; font-size: 12px; font-weight: 700; color: #b3361b; }
.pg-noparams, #pg-noparams { margin: 0; }
.pg-extra { display: grid; gap: 8px; }
.pg-extra:empty { display: none; }
.pg-extra-row { --ph: 40px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) var(--ph); gap: 8px; align-items: center; }
.pg-extra-row [placeholder='nama'] { font-family: var(--font-mono); }
.pg-add { justify-self: start; }
.pg-send { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pg-res-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pg-res-head h3 { margin: 0; }
.pg-res-head > .btn { margin-left: auto; }
.pg-out { max-height: 480px; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.pg-out .j-k { color: #c3a6ff; }
.pg-out .j-s { color: #d6f27a; }
.pg-out .j-n { color: #ffbf6b; }
.pg-out .j-l { color: #ff8fb8; font-weight: 700; }
.pg-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.pg-tabs button {
  padding: 5px 12px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: var(--white); font: 700 13px var(--font-body); cursor: pointer;
}
.pg-tabs button[aria-selected='true'] { background: var(--ink); color: var(--white); }
#pg-snippet { white-space: pre-wrap; word-break: break-all; font-size: 13px; }
@media (max-width: 900px) {
  .pg-layout { grid-template-columns: 1fr; }
  .pg-list { position: static; max-height: 320px; }
}
@media (max-width: 560px) {
  .pg { padding: 20px 0 48px; }
  .pg-ep-head h2 { font-size: 20px; }
  .pg-url { flex-wrap: wrap; }
  .pg-extra-row { grid-template-columns: minmax(0, 1fr) var(--ph); }
  .pg-extra-row input:nth-child(2) { grid-column: 1; grid-row: 2; }
  .pg-extra-row button { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
}
.ep-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ep-try { align-self: flex-start; margin-top: 4px; }

/* ---------- Filter katalog ---------- */
.search-row { margin-bottom: 14px; }
.cat-filters { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 10px; }
.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-chip {
  padding: 7px 16px;
  border: var(--border); border-radius: 999px;
  background: var(--white);
  font-weight: 700; font-size: 14px; text-decoration: none;
  transition: transform .12s, box-shadow .12s;
}
.cat-chip:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.cat-chip.is-on { background: var(--ink); color: var(--white); }
.cat-chip.sm { padding: 4px 12px; font-size: 13px; border-width: 2px; }
.cat-methods .cat-chip.is-on { background: var(--lime); color: var(--ink); }
.cat-info { margin: 0 0 18px; }
.cat-info a { font-weight: 700; }
.ep-stats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; }
.ep-stats li { padding: 2px 10px; border: 2px solid var(--ink); border-radius: 999px; background: rgba(255, 255, 255, .7); }
.ep-stats b { font-family: var(--font-mono); }
@media (max-width: 560px) {
  .cat-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin: 0 -2px; scrollbar-width: none; }
  .cat-chip { flex: none; padding: 6px 13px; font-size: 13px; }
}

/* ---------- Bantuan "Perbaiki dengan AI" ---------- */
.ai-help {
  display: grid; gap: 10px;
  margin: -6px 0 18px;
  padding: 14px 16px;
  border: var(--border); border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.test-out .ai-help { margin: 0; }
.ai-help-text { display: grid; gap: 2px; }
.ai-help-text strong { font-family: var(--font-display); font-size: 15px; }
.ai-help-text span { font-size: 13.5px; opacity: .8; }
.ai-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-btn {
  padding: 7px 16px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: var(--cream);
  font: 700 14px var(--font-body); color: var(--ink);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .12s;
}
.ai-btn:hover, .ai-btn:focus-visible { background: var(--lime); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.ai-btn:active { transform: translate(1px, 1px); box-shadow: none; }
.ai-btn.ai-copy { background: var(--white); border-style: dashed; }
.ai-note { margin: 0; font-size: 13px; font-weight: 600; }

/* ---------- Versi & catatan pembaruan ---------- */
.version-badge {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border: var(--border); border-radius: 999px;
  background: var(--lime); color: var(--ink);
  box-shadow: var(--shadow-sm);
  font: 700 14px/1.2 var(--font-mono);
  cursor: pointer;
  flex: none;
}
.version-badge:hover { background: var(--orange); }
.version-badge:active { transform: translate(3px, 3px); box-shadow: none; }
.version-badge:focus-visible { outline: 3px dashed var(--ink); outline-offset: 3px; }
.version-dot { width: 9px; height: 9px; border: 2px solid var(--ink); border-radius: 50%; background: var(--coral); }

.changelog-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(80vh, 720px);
  padding: 0;
  border: var(--border); border-radius: var(--radius);
  background: var(--cream); color: var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.changelog-dialog[open] { display: flex; flex-direction: column; animation: pop-in .16s ease-out; }
@media (prefers-reduced-motion: reduce) { .changelog-dialog[open] { animation: none; } }
.changelog-dialog::backdrop { background: rgba(20, 20, 20, .35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.changelog-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 20px 22px 16px;
  background: var(--purple);
  border-bottom: var(--border);
}
.changelog-head h2 { margin: 0; font-size: 22px; }
.changelog-kicker { margin: 0 0 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.changelog-close { display: grid; }
.changelog-body { padding: 18px 22px 22px; overflow-y: auto; display: grid; gap: 16px; }
.release {
  padding: 16px 18px;
  border: var(--border); border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.release-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.release-ver { font: 800 16px/1.2 var(--font-mono); }
.release-tag {
  padding: 1px 10px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: var(--lime);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.release-head time { margin-left: auto; font-size: 13px; font-weight: 500; opacity: .75; }
.release h3 { margin: 0 0 4px; font-size: 17px; }
.release-summary { margin: 0 0 12px; font-size: 15px; }
.release-group { margin-top: 12px; }
.release-group ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: 15px; }
.change-type {
  display: inline-block;
  padding: 2px 10px;
  border: 2px solid var(--ink); border-radius: 8px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: var(--sky);
}
.change-added { background: var(--lime); }
.change-improved { background: var(--sky); }
.change-fixed { background: var(--orange); }
.change-security { background: var(--pink); }
.change-removed { background: var(--coral); }

@media (max-width: 600px) {
  .version-badge { padding: 5px 10px; font-size: 12px; }
  .changelog-head { padding: 16px; }
  .changelog-head h2 { font-size: 18px; }
  .changelog-body { padding: 14px 16px 16px; }
  .release { padding: 14px; }
  .release-head time { margin-left: 0; width: 100%; }
}
