/* =========================================================================
   Pasal.id Desk — "Civic warm" theme
   Arah: tepercaya tapi ramah. Indigo (kepercayaan) + emas batik (aksen) +
   emerald (terverifikasi). Sudut membulat, bayangan lembut, font Plus
   Jakarta Sans (dirancang untuk Jakarta) + Fraunces display.
   ========================================================================= */

:root {
  --bg:        #F6F4EF;
  --bg-tint:   #EFEDE6;
  --surface:   #FFFFFF;
  --ink:       #1E2130;
  --ink-soft:  #5A5E70;
  --ink-faint: #8C8FA0;

  --indigo:      #2E3A8C;
  --indigo-deep: #1F2660;
  --indigo-soft: #EAECF8;

  --gold:      #E0A12E;
  --gold-soft: #FBF1DC;

  --emerald:   #1E9E78;
  --emerald-soft: #E2F4ED;

  --danger:    #C8492E;
  --danger-soft: #FBEAE4;

  --line:      #E6E2D8;
  --line-soft: #EFEDE7;

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(30,33,48,.06), 0 1px 3px rgba(30,33,48,.05);
  --shadow:    0 4px 14px rgba(30,33,48,.08);
  --shadow-lg: 0 18px 50px rgba(30,33,48,.22);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }
a { color: var(--indigo); }
em { font-style: italic; }

/* ----------------------------- Topbar ----------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246,244,239,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: .8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); }
.brand__mark {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  background: var(--indigo); color: #fff;
  border-radius: 9px;
  font-family: var(--font-display); font-size: 1.15rem; line-height: 1;
}
.brand__name { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; }
.brand__dot { color: var(--gold); }

.pill {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  font-size: .76rem; font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface);
}
.pill__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); }
.pill--ok { color: var(--emerald); border-color: var(--emerald-soft); background: var(--emerald-soft); }
.pill--ok .pill__dot { background: var(--emerald); box-shadow: 0 0 0 3px rgba(30,158,120,.18); }
.pill--off { color: var(--ink-soft); }
.pill__meta { font-family: var(--font-mono); font-size: .68rem; color: var(--ink-faint); }

/* ------------------------------ Hero ------------------------------------ */
.hero {
  position: relative;
  background:
    radial-gradient(120% 120% at 85% -10%, var(--indigo-soft) 0%, transparent 55%),
    radial-gradient(90% 90% at -5% 0%, var(--gold-soft) 0%, transparent 45%);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.brand__mark{
  background:url('mark.svg') center/contain no-repeat !important;
  color:transparent !important; box-shadow:none !important;
  width:36px; height:36px; border-radius:0;
}
.hero::after { /* batik-ish dotted texture, very subtle */
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .35;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, transparent, #000 40%, #000 70%, transparent);
}
.hero__inner {
  position: relative;
  max-width: 1140px;
  margin: 0 auto;
  padding: 3.2rem 1.5rem 2.6rem;
}
.hero__eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .74rem; letter-spacing: .06em;
  color: var(--indigo); background: var(--surface);
  border: 1px solid var(--line);
  padding: .3rem .7rem; border-radius: 999px;
  margin: 0 0 1.1rem;
}
.hero__title {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -.02em;
  margin: 0 0 .9rem;
  color: var(--indigo-deep);
}
.hero__title em { color: var(--gold); font-style: italic; }
.hero__lede {
  max-width: 40em;
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0 0 1.8rem;
}

.hero-search {
  display: flex; align-items: center;
  gap: .5rem;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: .5rem .5rem .5rem 1rem;
  max-width: 640px;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.hero-search:focus-within { border-color: var(--indigo); box-shadow: 0 0 0 4px var(--indigo-soft); }
.hero-search__icon { font-size: 1.25rem; color: var(--ink-faint); }
.hero-search input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 1rem; color: var(--ink);
  padding: .55rem .2rem;
}
.hero-search button {
  border: none; cursor: pointer;
  background: var(--indigo); color: #fff;
  font-family: inherit; font-weight: 600; font-size: .95rem;
  padding: .7rem 1.5rem; border-radius: var(--r);
  transition: background .15s ease, transform .1s ease;
}
.hero-search button:hover { background: var(--indigo-deep); }
.hero-search button:active { transform: scale(.97); }

.hero-chips { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.hero-chips__label { font-size: .85rem; color: var(--ink-faint); }
.hero-chips button {
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-soft); font-family: inherit; font-size: .85rem;
  padding: .4rem .85rem; border-radius: 999px; cursor: pointer;
  transition: all .15s ease;
}
.hero-chips button:hover { border-color: var(--indigo); color: var(--indigo); background: var(--indigo-soft); }

/* ----------------------------- Banners ---------------------------------- */
.banner {
  max-width: 1140px; margin: 1rem auto 0;
  padding: .85rem 1.1rem;
  border-radius: var(--r);
  font-size: .9rem;
  display: block;
}
.banner code {
  font-family: var(--font-mono); font-size: .82em;
  background: rgba(0,0,0,.05); padding: .1em .4em; border-radius: 5px;
}
.banner__detail { display: block; margin-top: .35rem; font-family: var(--font-mono); font-size: .78rem; opacity: .8; }
.banner--warn { background: var(--danger-soft); color: #8f3220; border: 1px solid #f1c4b6; }
.banner--warn a { color: var(--danger); font-weight: 600; }
.banner--info { background: var(--gold-soft); color: #7a5b14; border: 1px solid #ecd6a4; }

/* ---------------------------- Workspace --------------------------------- */
.workspace {
  max-width: 1140px;
  margin: 1.5rem auto 3rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 900px) { .workspace { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.card__head {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--line-soft);
}
.card__head h2 { font-size: 1.2rem; color: var(--indigo-deep); }
.card__head--chat { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card__status { display: block; font-size: .82rem; color: var(--ink-faint); margin-top: .2rem; }
.card__status.is-error { color: var(--danger); }

.ghost-btn {
  border: 1px solid var(--line); background: transparent;
  color: var(--ink-soft); font-family: inherit; font-size: .8rem; font-weight: 600;
  padding: .45rem .85rem; border-radius: var(--r-sm); cursor: pointer;
  transition: all .15s ease; white-space: nowrap;
}
.ghost-btn:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }

/* ---------------------------- Results ----------------------------------- */
.results { list-style: none; margin: 0; padding: .75rem; display: flex; flex-direction: column; gap: .65rem; max-height: 560px; overflow-y: auto; }
.results:empty { display: none; }

.result {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: .9rem 1rem .9rem 1.1rem;
  cursor: pointer;
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.result::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
  background: var(--gold); border-radius: 3px;
}
.result:hover, .result:focus-visible {
  border-color: var(--indigo); box-shadow: var(--shadow); outline: none; transform: translateY(-1px);
}
.result__title { font-weight: 600; color: var(--indigo-deep); font-size: .98rem; margin: 0 0 .35rem; }
.result__meta { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .5rem; }
.tag {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .02em;
  padding: .18rem .5rem; border-radius: 6px;
  background: var(--indigo-soft); color: var(--indigo);
}
.tag--year { background: var(--bg-tint); color: var(--ink-soft); }
.tag--status-berlaku { background: var(--emerald-soft); color: var(--emerald); }
.tag--status-dicabut { background: var(--danger-soft); color: var(--danger); }
.tag--status-diubah  { background: var(--gold-soft); color: #8a6314; }
.tag--pasal { background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); }
.result__snippet { margin: 0; font-size: .88rem; color: var(--ink-soft); }
.result__cue { position: absolute; right: 12px; bottom: 10px; font-size: .72rem; color: var(--ink-faint); }

.results-empty { padding: 2.5rem 1.5rem; text-align: center; color: var(--ink-faint); }
.results-empty.is-hidden { display: none; }
.results-empty__art { font-size: 2rem; display: block; margin-bottom: .5rem; }
.results-empty p { margin: 0; font-size: .9rem; max-width: 28em; margin-inline: auto; }

/* ------------------------------ Chat ------------------------------------ */
.chat-log {
  flex: 1; padding: 1.1rem 1.25rem;
  display: flex; flex-direction: column; gap: 1rem;
  max-height: 440px; overflow-y: auto;
}
.chat-msg { display: flex; gap: .65rem; align-items: flex-end; }
.chat-msg--user { flex-direction: row-reverse; }
.chat-avatar {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--indigo); color: #fff;
  font-family: var(--font-display); font-size: .95rem;
}
.chat-msg--user .chat-avatar { background: var(--gold); color: #3a2a05; }

.chat-bubble {
  max-width: 80%;
  padding: .7rem .95rem;
  border-radius: 16px;
  font-size: .93rem; line-height: 1.55;
  position: relative;
}
.chat-msg--ai .chat-bubble { background: var(--bg-tint); border-bottom-left-radius: 5px; color: var(--ink); }
.chat-msg--user .chat-bubble { background: var(--indigo); color: #fff; border-bottom-right-radius: 5px; }
.chat-msg--error .chat-bubble { background: var(--danger-soft); border: 1px solid #f1c4b6; color: #8f3220; white-space: pre-wrap; }
.chat-bubble p { margin: 0; }
.chat-bubble p + p { margin-top: .5rem; }
.chat-bubble strong { font-weight: 700; }
.chat-bubble ul { margin: .4rem 0; padding-left: 1.1rem; }
.chat-bubble li { margin: .15rem 0; }
.chat-bubble code { font-family: var(--font-mono); font-size: .85em; background: rgba(0,0,0,.07); padding: .1em .35em; border-radius: 5px; }
.chat-msg--user .chat-bubble code { background: rgba(255,255,255,.18); }

/* meta row under AI messages */
.chat-meta { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; flex-wrap: wrap; }
.chat-badge {
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .03em;
  padding: .12rem .45rem; border-radius: 5px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-faint);
}
.chat-badge--cache { color: var(--emerald); border-color: var(--emerald-soft); background: var(--emerald-soft); }
.chat-copy {
  border: none; background: none; cursor: pointer;
  font-family: var(--font-body); font-size: .72rem; color: var(--ink-faint);
  padding: .1rem .25rem; border-radius: 5px;
}
.chat-copy:hover { color: var(--indigo); }

/* source chips */
.chat-sources { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.chat-source {
  font-size: .74rem; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--indigo); padding: .25rem .55rem; border-radius: 999px;
  transition: all .15s ease;
}
.chat-source:hover { background: var(--indigo-soft); border-color: var(--indigo); }

/* typing indicator */
.typing { display: inline-flex; gap: 4px; align-items: center; padding: .15rem 0; }
.typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint);
  animation: blink 1.2s infinite ease-in-out both;
}
.typing span:nth-child(2) { animation-delay: .18s; }
.typing span:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* starter prompt chips */
.chat-starters { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0 1.25rem .25rem; }
.chat-starters.is-hidden { display: none; }
.chat-starters button {
  border: 1px dashed var(--line); background: var(--surface);
  color: var(--ink-soft); font-family: inherit; font-size: .82rem;
  padding: .45rem .8rem; border-radius: 999px; cursor: pointer; transition: all .15s ease;
}
.chat-starters button:hover { border-style: solid; border-color: var(--indigo); color: var(--indigo); background: var(--indigo-soft); }

/* active pasal context chip */
.pasal-chip {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  margin: 0 1.25rem .25rem; padding: .5rem .75rem;
  background: var(--gold-soft); border: 1px solid #ecd6a4; border-radius: var(--r-sm);
  font-size: .82rem; color: #7a5b14;
}
.pasal-chip[hidden] { display: none; }
.pasal-chip__text strong { color: var(--indigo-deep); }
.pasal-chip button { border: none; background: none; cursor: pointer; color: #7a5b14; font-size: .85rem; padding: .1rem .3rem; border-radius: 5px; }
.pasal-chip button:hover { background: rgba(0,0,0,.06); }

/* input row */
.chat-input-row {
  display: flex; align-items: flex-end; gap: .6rem;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--line-soft);
}
.chat-input-row textarea {
  flex: 1; resize: none;
  border: 1.5px solid var(--line); border-radius: var(--r);
  padding: .7rem .9rem; font-family: inherit; font-size: .95rem; color: var(--ink);
  background: var(--bg); max-height: 160px; line-height: 1.5;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.chat-input-row textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 4px var(--indigo-soft); background: var(--surface); }
.chat-input-row button {
  flex: 0 0 auto; width: 46px; height: 46px;
  border: none; border-radius: var(--r); cursor: pointer;
  background: var(--indigo); color: #fff; font-size: 1.05rem;
  display: grid; place-items: center;
  transition: background .15s ease, transform .1s ease;
}
.chat-input-row button:hover { background: var(--indigo-deep); }
.chat-input-row button:active { transform: scale(.94); }
.chat-input-row button:disabled { opacity: .5; cursor: not-allowed; }
.chat-send__icon { transform: rotate(0deg); }

/* ------------------------------ Modal ----------------------------------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(20,22,34,.5); backdrop-filter: blur(2px); }
.modal__panel {
  position: relative; background: var(--surface);
  border-radius: var(--r-lg); max-width: 740px; width: 100%; max-height: 86vh;
  display: flex; flex-direction: column; padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__close {
  position: absolute; top: 1rem; right: 1rem;
  border: none; background: var(--bg-tint); color: var(--ink-soft);
  width: 32px; height: 32px; border-radius: 9px; cursor: pointer; font-size: .9rem;
}
.modal__close:hover { background: var(--danger-soft); color: var(--danger); }
.modal__header { padding-right: 2.5rem; border-bottom: 1px solid var(--line-soft); padding-bottom: 1rem; margin-bottom: 1rem; }
.modal__eyebrow { font-family: var(--font-mono); font-size: .76rem; color: var(--ink-faint); display: block; margin-bottom: .35rem; }
.modal__header h2 { font-size: 1.4rem; color: var(--indigo-deep); }
.modal__body { overflow-y: auto; display: flex; flex-direction: column; gap: .7rem; padding-right: .25rem; }

.law-rel { font-size: .85rem; color: var(--ink-soft); background: var(--bg-tint); padding: .6rem .8rem; border-radius: var(--r-sm); margin: 0; }
.law-heading {
  font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; color: var(--indigo-deep);
  margin: .8rem 0 .1rem; padding-top: .7rem; border-top: 1px solid var(--line-soft);
}
.law-heading:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }

.article {
  border: 1px solid var(--line); border-radius: var(--r); padding: .85rem 1rem;
  background: var(--surface);
}
.article__num { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .03em; color: var(--gold); font-weight: 500; margin: 0 0 .4rem; text-transform: uppercase; }
.article__body { margin: 0 0 .75rem; font-size: .92rem; line-height: 1.65; white-space: pre-line; color: var(--ink); }
.article__ask {
  display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid var(--indigo); background: var(--indigo-soft); color: var(--indigo);
  font-family: inherit; font-size: .78rem; font-weight: 600;
  padding: .4rem .8rem; border-radius: 999px; cursor: pointer; transition: all .15s ease;
}
.article__ask:hover { background: var(--indigo); color: #fff; }

/* ------------------------------ Footer ---------------------------------- */
.foot { border-top: 1px solid var(--line); background: var(--bg-tint); }
.foot__inner { max-width: 1140px; margin: 0 auto; padding: 1.25rem 1.5rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; align-items: center; }
.foot__note { margin: 0; font-size: .82rem; color: var(--ink-soft); max-width: 46em; }
.foot__stats { margin: 0; display: flex; gap: .5rem; }
.foot__stats span { font-family: var(--font-mono); font-size: .74rem; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); padding: .25rem .6rem; border-radius: 999px; }

/* --------------------------- Accessibility ------------------------------ */
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===================== Additions: nav, OJK, chat page ==================== */

/* top navigation */
.topnav { display: flex; align-items: center; gap: 1.1rem; }
.topnav__link {
  text-decoration: none; color: var(--ink-soft); font-size: .9rem; font-weight: 600;
  padding: .35rem .2rem; border-bottom: 2px solid transparent;
}
.topnav__link:hover { color: var(--indigo); }
.topnav__link.is-active { color: var(--indigo-deep); border-bottom-color: var(--gold); }
@media (max-width: 560px) { .topnav { gap: .7rem; } .topnav__link { font-size: .82rem; } }

/* type selector inside hero search */
.hero-search__type {
  border: none; background: var(--bg-tint); color: var(--ink);
  font-family: inherit; font-size: .9rem; font-weight: 600;
  padding: .55rem .7rem; border-radius: var(--r); cursor: pointer; outline: none;
}
.hero-search__type:focus { box-shadow: 0 0 0 3px var(--indigo-soft); }
@media (max-width: 560px) {
  .hero-search { flex-wrap: wrap; }
  .hero-search__type { flex: 1 1 100%; order: 3; }
  .hero-search button { order: 2; }
}

/* single-column workspace with CTA */
.workspace--single { grid-template-columns: 1fr; max-width: 820px; }
.cta-chat {
  display: flex; align-items: center; gap: 1rem;
  background: linear-gradient(100deg, var(--indigo) 0%, var(--indigo-deep) 100%);
  color: #fff; border-radius: var(--r-lg); padding: 1.2rem 1.4rem;
}
.cta-chat__icon {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; background: rgba(255,255,255,.15);
  font-family: var(--font-display); font-size: 1.4rem;
}
.cta-chat__body { flex: 1; }
.cta-chat__body h3 { font-size: 1.1rem; margin: 0 0 .15rem; color: #fff; }
.cta-chat__body p { margin: 0; font-size: .88rem; color: rgba(255,255,255,.82); }
.cta-chat__btn {
  flex: 0 0 auto; text-decoration: none; white-space: nowrap;
  background: var(--gold); color: #3a2a05; font-weight: 700; font-size: .9rem;
  padding: .65rem 1.1rem; border-radius: var(--r); transition: transform .1s ease, background .15s ease;
}
.cta-chat__btn:hover { background: #f0b34a; }
.cta-chat__btn:active { transform: scale(.97); }
@media (max-width: 560px) { .cta-chat { flex-direction: column; text-align: center; } }

/* ----------------------------- chat page -------------------------------- */
.body--chat { display: flex; flex-direction: column; min-height: 100vh; }
.chat-page { flex: 1; display: flex; justify-content: center; padding: 1.5rem; }
.chat-shell {
  width: 100%; max-width: 860px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  height: calc(100vh - 64px - 3rem); min-height: 480px; overflow: hidden;
}
.chat-shell__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--line-soft);
}
.chat-shell__head h1 { font-size: 1.4rem; color: var(--indigo-deep); }
.chat-shell__head p { margin: .25rem 0 0; font-size: .86rem; color: var(--ink-soft); max-width: 44ch; }
.chat-shell__tools { display: flex; align-items: center; gap: .9rem; flex-shrink: 0; }

.chat-log--full { flex: 1; max-height: none; }

/* OJK toggle switch */
.switch { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 40px; height: 23px; border-radius: 999px; background: var(--line);
  position: relative; transition: background .18s ease; flex-shrink: 0;
}
.switch__thumb {
  position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm); transition: transform .18s ease;
}
.switch input:checked + .switch__track { background: var(--emerald); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(17px); }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 3px var(--emerald-soft); }
.switch__label { font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.switch input:checked ~ .switch__label { color: var(--emerald); }

@media (max-width: 600px) {
  .chat-shell { height: calc(100vh - 60px - 2rem); }
  .chat-shell__head { flex-direction: column; }
  .chat-page { padding: .75rem; }
}

/* ===================== Regintel: export, admin, knowledge ================ */

/* export buttons in chat toolbar */
.export-group { display: inline-flex; align-items: center; gap: .35rem; }
.export-group__label { font-size: .8rem; color: var(--ink-faint); margin-right: .1rem; }
.export-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  font-family: inherit; font-size: .78rem; font-weight: 600;
  padding: .35rem .6rem; border-radius: var(--r-sm); cursor: pointer; transition: all .15s ease;
}
.export-btn:hover { border-color: var(--indigo); color: var(--indigo); background: var(--indigo-soft); }
.export-btn:disabled { opacity: .55; cursor: progress; }

/* hero compact (knowledge page) */
.hero--compact .hero__inner { padding-top: 2.2rem; padding-bottom: 1.8rem; }

/* stacked workspace */
.workspace--stack { display: block; max-width: 1140px; }
.workspace--stack > .card { margin-bottom: 1.25rem; }
.workspace--two { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 800px) { .workspace--two { grid-template-columns: 1fr; } }

/* skills grid */
.skill-grid { padding: 1rem 1.25rem 1.4rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; }
.skill { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.skill__icon { font-size: 1.4rem; line-height: 1; flex-shrink: 0; }
.skill h3 { font-size: .98rem; color: var(--indigo-deep); margin: 0 0 .2rem; }
.skill p { margin: 0; font-size: .84rem; color: var(--ink-soft); }

/* info lists (kb / rules read-only) */
.info-list { list-style: none; margin: 0; padding: .75rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: .55rem; }
.info-list li { font-size: .9rem; color: var(--ink); padding-left: 1.1rem; position: relative; line-height: 1.55; }
.info-list li::before { content: "▸"; position: absolute; left: 0; color: var(--gold); }
.info-list li.muted { color: var(--ink-faint); }
.info-list li.muted::before { content: ""; }

/* admin */
.admin { max-width: 1140px; margin: 1.5rem auto 3rem; padding: 0 1.5rem; }
.login-card {
  max-width: 420px; margin: 3rem auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 2rem;
}
.login-card h1 { font-size: 1.5rem; color: var(--indigo-deep); margin-bottom: .3rem; }
.login-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.4rem; }
.login-form label { display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.login-form input {
  border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: .65rem .8rem;
  font-family: inherit; font-size: .95rem; background: var(--bg); color: var(--ink);
}
.login-form input:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft); background: var(--surface); }
.login-form button {
  border: none; background: var(--indigo); color: #fff; font-family: inherit; font-weight: 600;
  font-size: .95rem; padding: .7rem; border-radius: var(--r); cursor: pointer; margin-top: .3rem;
}
.login-form button:hover { background: var(--indigo-deep); }

.admin__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.admin__head h1 { font-size: 1.6rem; color: var(--indigo-deep); }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }
.admin-card__body { padding: 1rem 1.25rem 1.25rem; }

.rule-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.rule-list li {
  display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem;
  padding: .65rem .8rem; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg); font-size: .88rem; line-height: 1.5;
}
.mini-del { border: none; background: none; color: var(--ink-faint); cursor: pointer; font-size: .9rem; padding: .1rem .3rem; border-radius: 5px; flex-shrink: 0; }
.mini-del:hover { background: var(--danger-soft); color: var(--danger); }

.admin-add { display: flex; flex-direction: column; gap: .5rem; }
.admin-add textarea {
  border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: .6rem .8rem;
  font-family: inherit; font-size: .9rem; resize: vertical; background: var(--bg); color: var(--ink);
}
.admin-add textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft); background: var(--surface); }
.admin-add button {
  align-self: flex-start; border: none; background: var(--emerald); color: #fff;
  font-family: inherit; font-weight: 600; font-size: .85rem; padding: .55rem 1rem;
  border-radius: var(--r-sm); cursor: pointer;
}
.admin-add button:hover { filter: brightness(.95); }

.corpus { margin-top: 1.1rem; border-top: 1px dashed var(--line); padding-top: .8rem; }
.corpus summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--indigo); }
.corpus-list { list-style: none; margin: .8rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.corpus-list li { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .6rem .75rem; }
.corpus-q { margin: 0 0 .4rem; font-size: .85rem; color: var(--ink); }
.mini-add { border: 1px solid var(--emerald); background: var(--emerald-soft); color: var(--emerald); font-family: inherit; font-size: .76rem; font-weight: 600; padding: .3rem .6rem; border-radius: 999px; cursor: pointer; }
.mini-add:hover { background: var(--emerald); color: #fff; }

/* ===================== Regintel v2: login redesign, badges ============== */

/* status pill (skills all active) */
.status-pill {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .8rem; font-weight: 600; color: var(--emerald);
  background: var(--emerald-soft); border: 1px solid #bce6d8;
  padding: .4rem .8rem; border-radius: 999px;
}
.status-pill__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 0 3px rgba(30,158,120,.2); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px rgba(30,158,120,.2); } 50% { box-shadow: 0 0 0 6px rgba(30,158,120,.05); } }

/* per-skill active badge */
.skill__status {
  display: inline-flex; align-items: center; gap: .3rem; margin-top: .5rem;
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .02em;
  color: var(--emerald); background: var(--emerald-soft);
  padding: .15rem .5rem; border-radius: 999px;
}
.skill__status::before { content: "●"; font-size: .6rem; }

.admin__head-actions { display: flex; align-items: center; gap: .6rem; }

/* ---- Login redesign (split hero + card) ---- */
.login-wrap {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 2.5rem;
  align-items: center; max-width: 980px; margin: 2.5rem auto; padding: 0 .5rem;
}
@media (max-width: 820px) { .login-wrap { grid-template-columns: 1fr; gap: 1.5rem; max-width: 460px; } .login-hero { display: none; } }

.login-hero__badge {
  display: inline-block; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .04em;
  color: var(--indigo); background: var(--surface); border: 1px solid var(--line);
  padding: .35rem .75rem; border-radius: 999px; margin-bottom: 1.1rem;
}
.login-hero__title { font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.08; color: var(--indigo-deep); margin-bottom: .9rem; }
.login-hero__title em { color: var(--gold); font-style: italic; }
.login-hero__lede { color: var(--ink-soft); font-size: 1rem; max-width: 34em; margin: 0 0 1.4rem; }
.login-hero__points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.login-hero__points li { font-size: .92rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .6rem .85rem; }

.login-card {
  position: relative; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 2.4rem 2rem 2rem; margin: 0;
  overflow: hidden;
}
.login-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: linear-gradient(90deg, var(--indigo), var(--gold));
}
.login-card__mark {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  background: var(--indigo); color: #fff; font-family: var(--font-display); font-size: 1.6rem;
  margin-bottom: 1rem; box-shadow: var(--shadow-sm);
}
.login-card h2 { font-size: 1.4rem; color: var(--indigo-deep); margin-bottom: .25rem; }
.login-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.3rem; }
.login-form label { display: flex; flex-direction: column; gap: .4rem; font-size: .82rem; font-weight: 600; color: var(--ink-soft); }

.field { position: relative; display: flex; align-items: center; }
.field__icon { position: absolute; left: .8rem; font-size: .95rem; opacity: .7; pointer-events: none; }
.field input {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--r);
  padding: .72rem .8rem .72rem 2.3rem; font-family: inherit; font-size: .95rem;
  background: var(--bg); color: var(--ink);
}
.field input:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 4px var(--indigo-soft); background: var(--surface); }
.field__toggle { position: absolute; right: .5rem; border: none; background: none; cursor: pointer; font-size: 1rem; padding: .3rem; border-radius: 8px; }
.field__toggle:hover { background: var(--bg-tint); }

.login-submit {
  border: none; background: var(--indigo); color: #fff; font-family: inherit;
  font-weight: 700; font-size: .98rem; padding: .8rem; border-radius: var(--r);
  cursor: pointer; margin-top: .4rem; transition: background .15s ease, transform .1s ease;
}
.login-submit:hover { background: var(--indigo-deep); }
.login-submit:active { transform: scale(.98); }
.login-back { display: inline-block; margin-top: 1.1rem; font-size: .85rem; color: var(--ink-soft); text-decoration: none; }
.login-back:hover { color: var(--indigo); }

/* ===================== Regintel v3: rich chat + skill admin =========== */

/* wider, more flexible chat */
.chat-shell { max-width: 960px; }
.chat-msg--ai .chat-bubble { max-width: 92%; }

/* rich markdown inside AI bubbles */
.chat-bubble .md-h { font-family: var(--font-display); color: var(--indigo-deep); line-height: 1.25; }
.chat-bubble .md-h1, .chat-bubble .md-h2 { font-size: 1.08rem; margin: .7rem 0 .35rem; padding-bottom: .25rem; border-bottom: 1px solid var(--line); }
.chat-bubble .md-h3, .chat-bubble .md-h4 { font-size: .98rem; margin: .6rem 0 .3rem; }
.chat-bubble .md-h:first-child { margin-top: 0; }
.chat-bubble em { font-style: italic; }
.chat-bubble ol { margin: .4rem 0; padding-left: 1.3rem; }
.chat-bubble ol li, .chat-bubble ul li { margin: .2rem 0; }
.chat-bubble blockquote {
  margin: .5rem 0; padding: .5rem .8rem; border-left: 3px solid var(--gold);
  background: rgba(224,161,46,.08); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--ink);
}
.chat-bubble pre {
  margin: .5rem 0; padding: .7rem .85rem; background: #1f2330; color: #e8e8f0;
  border-radius: var(--r-sm); overflow-x: auto; font-family: var(--font-mono); font-size: .82rem; line-height: 1.5;
}
.chat-bubble pre code { background: none; padding: 0; color: inherit; }
.chat-bubble hr { border: none; border-top: 1px solid var(--line); margin: .7rem 0; }

.md-table-wrap { overflow-x: auto; margin: .55rem 0; }
.md-table { border-collapse: collapse; width: 100%; font-size: .85rem; }
.md-table th, .md-table td { border: 1px solid var(--line); padding: .4rem .6rem; text-align: left; vertical-align: top; }
.md-table th { background: var(--indigo-soft); color: var(--indigo-deep); font-weight: 600; }
.md-table tbody tr:nth-child(even) { background: var(--bg); }

/* knowledge page skill states */
.skill--off { opacity: .55; }
.skill__status--off { color: var(--ink-faint); background: var(--bg-tint); }
.skill__status--off::before { content: "○"; }
.skill-note { margin: 0; padding: 0 1.25rem 1.25rem; font-size: .82rem; color: var(--ink-soft); }

/* admin skill management */
.admin-skills { margin-top: 1.25rem; }
.skill-admin-list { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 1rem; }
.skill-admin { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); padding: .8rem .9rem; }
.skill-admin.is-off { opacity: .7; border-style: dashed; }
.skill-admin__top { display: flex; align-items: flex-start; gap: .7rem; }
.skill-admin__icon { font-size: 1.4rem; line-height: 1; }
.skill-admin__meta { flex: 1; }
.skill-admin__meta strong { color: var(--indigo-deep); }
.skill-admin__meta p { margin: .25rem 0 0; font-size: .84rem; color: var(--ink-soft); }
.skill-admin__badge { font-family: var(--font-mono); font-size: .64rem; padding: .1rem .45rem; border-radius: 999px; background: var(--bg-tint); color: var(--ink-faint); margin-left: .4rem; }
.skill-admin__badge.on { background: var(--emerald-soft); color: var(--emerald); }
.skill-admin__actions { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.mini-toggle { border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font-family: inherit; font-size: .74rem; font-weight: 600; padding: .3rem .6rem; border-radius: 999px; cursor: pointer; }
.mini-toggle:hover { border-color: var(--indigo); color: var(--indigo); }

.skill-admin__edit, .skill-add { margin-top: .55rem; }
.skill-admin__edit summary, .skill-add summary { cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--indigo); }
.skill-add { border-top: 1px dashed var(--line); padding-top: .8rem; }
.skill-edit-form { display: flex; flex-direction: column; gap: .6rem; margin-top: .7rem; }
.skill-edit-form label { display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.skill-edit-form input[type=text], .skill-edit-form textarea {
  border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: .55rem .7rem;
  font-family: inherit; font-size: .9rem; background: var(--surface); color: var(--ink); resize: vertical;
}
.skill-edit-form input:focus, .skill-edit-form textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft); }
.skill-edit-row { display: flex; gap: .6rem; }
.skill-edit-row .w-icon { width: 80px; }
.skill-edit-row .w-name { flex: 1; }
.inline-check { flex-direction: row !important; align-items: center; gap: .4rem !important; }
.save-btn { align-self: flex-start; border: none; background: var(--emerald); color: #fff; font-family: inherit; font-weight: 600; font-size: .85rem; padding: .55rem 1rem; border-radius: var(--r-sm); cursor: pointer; }
.save-btn:hover { filter: brightness(.95); }

/* ===================== Regintel v4: skill-usage transparency =========== */
.skills-active {
  display: inline-flex; align-items: center; gap: .3rem; margin-top: .5rem;
  font-size: .78rem; color: var(--indigo); background: var(--indigo-soft);
  border: 1px solid #d4d9f4; padding: .25rem .6rem; border-radius: 999px;
}
.skills-active strong { font-weight: 700; }

.applied { margin-top: .6rem; border-top: 1px dashed var(--line); padding-top: .5rem; }
.applied__sum { cursor: pointer; font-size: .78rem; font-weight: 600; color: var(--indigo); list-style: none; display: flex; align-items: center; gap: .4rem; }
.applied__sum::-webkit-details-marker { display: none; }
.applied__sum::before { content: "▸"; transition: transform .15s ease; }
.applied[open] .applied__sum::before { transform: rotate(90deg); }
.applied__count { font-family: var(--font-mono); font-size: .66rem; font-weight: 400; color: var(--ink-faint); background: var(--surface); border: 1px solid var(--line); padding: .1rem .4rem; border-radius: 999px; }
.applied__body { margin-top: .5rem; display: flex; flex-direction: column; gap: .45rem; }
.applied__row { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.applied__label { font-size: .72rem; color: var(--ink-faint); margin-right: .15rem; }
.applied__chip { font-size: .72rem; padding: .15rem .5rem; border-radius: 999px; background: var(--bg-tint); color: var(--ink-soft); border: 1px solid var(--line); }
.applied__chip--on { background: var(--emerald-soft); color: var(--emerald); border-color: #bce6d8; font-weight: 600; }
.applied__notes { margin: .2rem 0 0; font-size: .72rem; color: var(--ink-faint); }

/* add-skill placed at top of skill manager */
.skill-add--top { border-top: none; border-bottom: 1px dashed var(--line); padding-top: 0; padding-bottom: .9rem; margin-bottom: 1rem; }

/* ===================== Regintel v5: reference picker ==================== */
.ref-bar { margin: 0 0 .5rem; }
.ref-toggle {
  display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  font-family: inherit; font-size: .82rem; font-weight: 600;
  padding: .4rem .75rem; border-radius: 999px; cursor: pointer;
}
.ref-toggle:hover { border-color: var(--indigo); color: var(--indigo); }
.ref-toggle[aria-expanded="true"] { border-color: var(--indigo); color: var(--indigo); background: var(--indigo-soft); }
.ref-count { background: var(--gold); color: #3a2a05; font-weight: 700; border-radius: 999px; padding: 0 .4rem; font-size: .72rem; }

.ref-panel {
  margin-top: .5rem; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); padding: .7rem; box-shadow: var(--shadow-sm);
}
.ref-search { display: flex; align-items: center; gap: .4rem; }
.ref-search__icon { opacity: .6; }
.ref-search input {
  flex: 1; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: .5rem .65rem; font-family: inherit; font-size: .9rem; background: var(--bg); color: var(--ink);
}
.ref-search input:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-soft); background: var(--surface); }
.ref-type { border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: .5rem .4rem; font-family: inherit; font-size: .82rem; background: var(--bg); color: var(--ink); cursor: pointer; }
.ref-status { margin: .5rem 0 .3rem; font-size: .78rem; color: var(--ink-faint); }
.ref-results { list-style: none; margin: 0; padding: 0; max-height: 230px; overflow-y: auto; display: flex; flex-direction: column; gap: .3rem; }
.ref-result {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: .5rem .65rem; cursor: pointer; background: var(--bg);
}
.ref-result:hover { border-color: var(--indigo); background: var(--indigo-soft); }
.ref-result__title { font-size: .85rem; font-weight: 600; color: var(--ink); flex: 1 1 60%; }
.ref-result__meta { font-family: var(--font-mono); font-size: .7rem; color: var(--ink-faint); }
.ref-result__add { font-size: .72rem; font-weight: 700; color: var(--emerald); margin-left: auto; }

.ref-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.ref-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--gold-soft, #fbf0d8); color: #6b4e12; border: 1px solid #e9d29a;
  font-size: .78rem; font-weight: 600; padding: .3rem .35rem .3rem .6rem; border-radius: 999px;
}
.ref-chip__x { border: none; background: rgba(0,0,0,.08); color: inherit; cursor: pointer; width: 18px; height: 18px; border-radius: 50%; line-height: 1; font-size: .7rem; }
.ref-chip__x:hover { background: rgba(0,0,0,.18); }

/* =============== Regintel v6: readable law modal + clickable refs ============ */
/* Headings struktur peraturan */
.law-heading { margin: 1.4rem 0 .6rem; font-family: var(--font-display, inherit); }
.law-heading--bab {
  font-size: 1rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  color: var(--indigo); padding: .5rem .75rem; background: var(--indigo-soft);
  border-radius: var(--r-sm); border-left: 4px solid var(--indigo);
}
.law-heading--bagian { font-size: .92rem; font-weight: 650; color: var(--ink); margin-left: .25rem; padding-left: .6rem; border-left: 3px solid var(--gold); }
.law-heading--paragraf { font-size: .86rem; font-weight: 600; color: var(--ink-soft); margin-left: .5rem; }

/* Kartu pasal */
.article { padding: .95rem 1.05rem; }
.article__num {
  display: inline-block; font-family: var(--font-mono); font-size: .72rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--indigo);
  background: var(--indigo-soft); padding: .2rem .55rem; border-radius: 999px; margin: 0 0 .55rem;
}
.article__body { margin: 0 0 .4rem; line-height: 1.7; color: var(--ink); }
.article__body--ayat { padding-left: .25rem; }
.article__body--sub { padding-left: 1.5rem; color: var(--ink-soft); }
.article__body--empty { font-style: italic; color: var(--ink-faint); }
.article--empty { background: repeating-linear-gradient(135deg, var(--bg), var(--bg) 10px, var(--surface) 10px, var(--surface) 20px); opacity: .9; }

/* Chip referensi yang bisa diklik */
.ref-chip { padding: .25rem .3rem .25rem .25rem; }
.ref-chip__open {
  border: none; background: transparent; color: inherit; font: inherit; font-weight: 600;
  cursor: pointer; padding: .1rem .35rem; border-radius: 999px; text-align: left;
}
.ref-chip__open:hover { text-decoration: underline; }

/* =========================================================================
   Autentikasi pengguna, akun, dan audit (ditambahkan)
   ========================================================================= */

/* Tombol Google */
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  width: 100%; padding: .8rem 1rem; margin: 0 0 .2rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r);
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  text-decoration: none; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .05s;
}
.btn-google:hover { border-color: var(--indigo); box-shadow: var(--shadow); }
.btn-google:active { transform: translateY(1px); }
.btn-google__icon { flex-shrink: 0; }

.login-divider { display: flex; align-items: center; gap: .8rem; margin: 1rem 0; color: var(--ink-faint); font-size: .8rem; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.ghost-btn--full { display: block; width: 100%; text-align: center; text-decoration: none; }

/* Chip pengguna di topbar */
.user-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .25rem .6rem .25rem .3rem; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); max-width: 220px;
}
.user-chip__avatar {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: var(--indigo-soft);
}
.user-chip__avatar--ph {
  display: grid; place-items: center; color: var(--indigo);
  font-weight: 700; font-size: .8rem; font-family: var(--font-display);
}
.user-chip__name { font-size: .82rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip__role {
  font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--gold); background: var(--gold-soft); padding: .1rem .35rem; border-radius: 999px;
}
.topnav__login, .topnav__logout {
  font-size: .85rem; font-weight: 600; text-decoration: none; padding: .35rem .8rem; border-radius: 999px;
}
.topnav__login { color: #fff; background: var(--indigo); }
.topnav__login:hover { background: var(--indigo-deep); }
.topnav__logout { color: var(--ink-soft); border: 1px solid var(--line); }
.topnav__logout:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }

/* Halaman menunggu persetujuan */
.pending-card {
  max-width: 560px; margin: 3rem auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 2.5rem 2rem; text-align: center; box-shadow: var(--shadow);
}
.pending-card__art { font-size: 3rem; display: block; margin-bottom: .5rem; }
.pending-card h1 { font-size: 1.6rem; margin-bottom: .8rem; }
.pending-card p { color: var(--ink-soft); margin: .4rem 0; }
.pending-card__actions { display: flex; gap: .6rem; justify-content: center; margin-top: 1.4rem; }

/* Statistik pengguna */
.user-stats { display: flex; flex-wrap: wrap; gap: .5rem; }
.user-stat { font-size: .82rem; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); padding: .35rem .7rem; border-radius: 999px; }
.user-stat strong { color: var(--ink); }
.user-stat--pending { border-color: var(--gold); background: var(--gold-soft); }
.user-stat--pending strong { color: var(--gold); }

/* Tabel pengguna & audit */
.user-table-wrap { overflow-x: auto; }
.user-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.user-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); font-weight: 700; padding: .5rem .6rem; border-bottom: 2px solid var(--line); }
.user-table td { padding: .65rem .6rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.user-table tr.is-pending { background: var(--gold-soft); }
.user-cell { display: flex; align-items: center; gap: .6rem; }
.user-cell__avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--indigo-soft); flex-shrink: 0; }
.user-cell__avatar--ph { display: grid; place-items: center; color: var(--indigo); font-weight: 700; font-family: var(--font-display); }
.user-cell__email { display: block; font-size: .76rem; color: var(--ink-faint); }
.user-cell__date { color: var(--ink-soft); white-space: nowrap; font-size: .82rem; }

.role-badge { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: .15rem .5rem; border-radius: 999px; }
.role-badge--admin { color: var(--gold); background: var(--gold-soft); }
.role-badge--user { color: var(--ink-soft); background: var(--bg-tint); }

.status-badge { font-size: .72rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px; }
.status-badge--approved { color: var(--emerald); background: var(--emerald-soft); }
.status-badge--pending { color: var(--gold); background: var(--gold-soft); }
.status-badge--rejected { color: var(--danger); background: var(--danger-soft); }
.status-badge--suspended { color: var(--ink-soft); background: var(--bg-tint); }

.user-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.mini-link { font-size: .74rem; font-weight: 600; color: var(--indigo); text-decoration: none; padding: .3rem .5rem; border-radius: 999px; border: 1px solid var(--line); }
.mini-link:hover { border-color: var(--indigo); background: var(--indigo-soft); }

/* Filter & tabel audit */
.audit-filter { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; margin-bottom: 1.2rem; }
.audit-filter label { display: flex; flex-direction: column; gap: .25rem; font-size: .76rem; font-weight: 600; color: var(--ink-soft); }
.audit-filter select { font-family: inherit; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); min-width: 160px; }
.audit-filter button { font-family: inherit; font-weight: 600; padding: .5rem 1rem; border: none; border-radius: var(--r-sm); background: var(--indigo); color: #fff; cursor: pointer; }
.audit-filter button:hover { background: var(--indigo-deep); }
.audit-table { font-size: .82rem; }
.audit-time { font-family: var(--font-mono); font-size: .76rem; color: var(--ink-soft); white-space: nowrap; }
.audit-detail { color: var(--ink-soft); font-size: .8rem; max-width: 360px; }
.audit-ip { font-family: var(--font-mono); font-size: .74rem; color: var(--ink-faint); }
.audit-action { font-size: .72rem; font-weight: 600; padding: .15rem .5rem; border-radius: 999px; background: var(--bg-tint); color: var(--ink-soft); white-space: nowrap; }
.audit-action--login, .audit-action--register { background: var(--emerald-soft); color: var(--emerald); }
.audit-action--login_denied, .audit-action--user_reject, .audit-action--user_delete, .audit-action--user_suspend { background: var(--danger-soft); color: var(--danger); }
.audit-action--chat, .audit-action--search { background: var(--indigo-soft); color: var(--indigo); }
.audit-action--user_approve, .audit-action--user_role { background: var(--gold-soft); color: var(--gold); }
