:root {
  color-scheme: dark;
  --bg: #091324;
  --bg-soft: #0D1A2E;
  --hero: #004A86;
  --hero-2: #00599D;
  --card: #1B283B;
  --card-2: #223149;
  --border: rgba(151, 184, 224, .18);
  --text: #FFFFFF;
  --muted: #AFC4DF;
  --muted-2: #7F94AE;
  --yellow: #FFD200;
  --blue: #0673C7;
  --blue-2: #085DA2;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
  --radius-xl: 34px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --max: 900px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #F4F8FE;
  --bg-soft: #EDF4FC;
  --hero: #005A9F;
  --hero-2: #006BBE;
  --card: #FFFFFF;
  --card-2: #F7FAFE;
  --border: rgba(20, 67, 116, .14);
  --text: #112034;
  --muted: #536A85;
  --muted-2: #6D8097;
  --shadow: 0 24px 70px rgba(23, 72, 124, .13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: calc(100vh - 64px);
}

.hero {
  position: relative;
  min-height: 300px;
  padding: 44px 18px 92px;
  background: linear-gradient(180deg, var(--hero-2), var(--hero));
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  filter: blur(1px);
}

.hero::before {
  width: 340px;
  height: 340px;
  top: -190px;
  left: -110px;
}

.hero::after {
  width: 260px;
  height: 260px;
  right: -90px;
  bottom: -150px;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .7);
}

.hero h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 54px);
  line-height: 1.05;
  letter-spacing: -.05em;
}

.subtitle {
  max-width: 520px;
  margin: 20px auto 24px;
  color: rgba(255, 255, 255, .92);
  font-size: clamp(15px, 2.2vw, 18px);
  line-height: 1.6;
}

.menu-pills {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .08);
}

.pill {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}

.pill:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, .18);
}

.pill.active {
  background: var(--yellow);
  color: #0E1726;
}

.theme-toggle {
  position: absolute;
  z-index: 2;
  top: 22px;
  right: 22px;
  width: 70px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 999px;
  background: rgba(9, 19, 36, .42);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 5px 4px 10px;
  backdrop-filter: blur(14px);
}

.theme-icon {
  font-size: 15px;
  opacity: .85;
}

.theme-dot {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--yellow);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  transition: transform .25s ease;
}

html[data-theme="light"] .theme-dot {
  transform: translateX(-30px);
}

html[data-theme="light"] .theme-toggle {
  flex-direction: row-reverse;
  background: rgba(255, 255, 255, .26);
}

.search-section {
  width: min(var(--max), calc(100% - 34px));
  margin: -36px auto 42px;
  position: relative;
  z-index: 3;
}

.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  min-height: 68px;
  border: 1px solid transparent;
  border-radius: 22px;
  background: #1B2639;
  color: #fff;
  outline: none;
  padding: 0 58px 0 30px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .24);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

html[data-theme="light"] .search-box input {
  background: #fff;
  color: var(--text);
}

.search-box input::placeholder {
  color: #7D8B9E;
}

.search-box input:focus {
  border-color: rgba(255, 210, 0, .75);
  box-shadow: 0 0 0 4px rgba(255, 210, 0, .13), 0 22px 42px rgba(0, 0, 0, .2);
}

.clear-btn {
  position: absolute;
  right: 17px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .11);
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

html[data-theme="light"] .clear-btn {
  background: #EDF3FA;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 4px 16px;
  color: var(--muted);
  font-size: 14px;
}

.result-info,
.hint {
  margin: 0;
}

.hint {
  color: var(--muted-2);
}

.table-head {
  display: grid;
  grid-template-columns: 1fr 2.25fr 120px;
  gap: 24px;
  padding: 16px 24px;
  color: #9EC0E6;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 13px;
}

.results {
  display: grid;
  gap: 14px;
}

.result-card {
  display: grid;
  grid-template-columns: 1fr 2.25fr 120px;
  gap: 24px;
  align-items: center;
  min-height: 82px;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  box-shadow: 0 18px 38px rgba(0, 0, 0, .12);
  animation: cardIn .24s ease both;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.province {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.3;
}

.cities {
  color: var(--muted);
  line-height: 1.62;
}

.area-badge {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 10px 14px;
  border-radius: 11px;
  background: linear-gradient(180deg, #0B83D9, var(--blue-2));
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  box-shadow: 0 8px 20px rgba(6, 115, 199, .26);
}

mark {
  padding: 0 3px;
  border-radius: 4px;
  background: var(--yellow);
  color: #06101D;
}

.empty-state {
  margin-top: 20px;
  padding: 36px 24px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
}

.empty-state h2 {
  margin: 8px 0 8px;
  color: var(--text);
}

.empty-state p {
  max-width: 530px;
  margin: 0 auto;
  line-height: 1.6;
}

.empty-icon {
  font-size: 32px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 20;
  transform: translateX(-50%);
  padding: 12px 16px;
  border-radius: 999px;
  background: #101B2D;
  border: 1px solid var(--border);
  color: #fff;
  box-shadow: var(--shadow);
}

.footer {
  padding: 24px 18px 36px;
  text-align: center;
  color: var(--muted-2);
  font-size: 14px;
}

@media (max-width: 760px) {
  .hero {
    min-height: 280px;
    padding-top: 56px;
    border-bottom-left-radius: 26px;
    border-bottom-right-radius: 26px;
  }

  .theme-toggle {
    top: 14px;
    right: 14px;
  }

  .menu-pills {
    gap: 6px;
  }

  .pill {
    padding: 10px 13px;
    font-size: 13px;
  }

  .search-section {
    width: min(100% - 24px, var(--max));
    margin-top: -31px;
  }

  .search-box input {
    min-height: 62px;
    border-radius: 19px;
    padding-left: 20px;
  }

  .status-row {
    display: block;
  }

  .hint {
    margin-top: 8px;
  }

  .table-head {
    display: none;
  }

  .result-card {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 20px;
  }

  .area-badge {
    justify-self: start;
  }

  .province {
    font-size: 17px;
  }

  .cities {
    font-size: 14px;
  }
}

/* Patch 5, 6, 7: empty state lebih rapi, branding kecil, shortcut web utama */
.home-shortcut {
  position: absolute;
  z-index: 2;
  top: 22px;
  left: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: rgba(9, 19, 36, .30);
  color: rgba(255, 255, 255, .95);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  backdrop-filter: blur(14px);
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.home-shortcut:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .42);
}

.empty-state {
  padding: 0;
  background: transparent;
  border: 0;
}

.empty-card {
  width: 100%;
  padding: 36px 26px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top left, rgba(255, 210, 0, .10), transparent 34%),
    linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  box-shadow: 0 18px 38px rgba(0, 0, 0, .12);
  text-align: center;
}

.empty-kicker {
  margin: 10px 0 8px;
  color: #9EC0E6;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.empty-state h2 {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.25;
}

#emptyQuery {
  color: var(--yellow);
}

.quick-searches {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 22px auto 18px;
}

.quick-searches button,
.show-all-btn {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 850;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.quick-searches button {
  padding: 10px 14px;
  background: rgba(255, 255, 255, .10);
  color: var(--text);
  border: 1px solid var(--border);
}

html[data-theme="light"] .quick-searches button {
  background: #F1F6FC;
}

.quick-searches button:hover,
.show-all-btn:hover {
  transform: translateY(-1px);
}

.show-all-btn {
  padding: 12px 18px;
  background: var(--yellow);
  color: #091324;
  box-shadow: 0 12px 28px rgba(255, 210, 0, .18);
}

.footer {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 30px 18px 38px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  color: var(--text);
}

html[data-theme="light"] .footer-brand {
  background: #FFFFFF;
}

.footer-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 10px;
}

.footer-brand div {
  display: grid;
  gap: 2px;
  text-align: left;
}

.footer-brand span {
  color: var(--muted-2);
  font-size: 12px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(6, 115, 199, .15);
  color: #9ED0FF;
  text-decoration: none;
  font-weight: 850;
  border: 1px solid rgba(6, 115, 199, .25);
}

html[data-theme="light"] .footer-links a {
  color: var(--blue-2);
}

.footer p {
  margin: 0;
}

@media (max-width: 760px) {
  .home-shortcut {
    top: 14px;
    left: 14px;
    max-width: calc(100% - 94px);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 0 12px;
    font-size: 12px;
  }

  .empty-card {
    padding: 30px 18px;
  }

  .quick-searches {
    gap: 8px;
  }

  .quick-searches button {
    padding: 9px 12px;
    font-size: 13px;
  }

  .footer-brand {
    width: 100%;
    max-width: 380px;
    border-radius: 18px;
  }
}

/* Patch logo header clean: logo kiri jadi seperti web utama, footer/tulisan bawah dihapus */
.brand-home {
  position: absolute;
  z-index: 4;
  top: 20px;
  left: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(248px, calc(100% - 112px));
  min-height: 50px;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  background: rgba(3, 8, 24, .78);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.brand-home:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .24);
  opacity: .96;
}

.brand-home img {
  display: block;
  width: 100%;
  height: auto;
}

/* Pastikan shortcut lama dan footer lama tidak muncul lagi walau file lama masih tersisa */
.home-shortcut,
.footer,
.footer-brand,
.footer-links {
  display: none !important;
}

@media (max-width: 760px) {
  .brand-home {
    top: 13px;
    left: 13px;
    width: min(220px, calc(100% - 96px));
    min-height: 42px;
    border-radius: 12px;
  }

  .hero {
    padding-top: 78px;
  }
}


/* Patch fixed branding: selalu tampil di bawah layar, tidak menutupi konten */
body {
  padding-bottom: calc(58px + env(safe-area-inset-bottom));
}

.app-shell {
  min-height: calc(100vh - 58px);
}

.fixed-branding {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  min-height: 46px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: rgba(6, 15, 30, .94);
  border-top: 1px solid rgba(151, 184, 224, .16);
  color: var(--muted-2);
  font-size: 14px;
  line-height: 1.4;
  backdrop-filter: blur(14px);
  box-shadow: 0 -10px 28px rgba(0, 0, 0, .22);
}

.fixed-branding strong {
  color: #9EC0E6;
  font-weight: 900;
  letter-spacing: .02em;
}

html[data-theme="light"] .fixed-branding {
  background: rgba(244, 248, 254, .96);
  border-top-color: rgba(20, 67, 116, .12);
  box-shadow: 0 -10px 28px rgba(23, 72, 124, .10);
}

html[data-theme="light"] .fixed-branding strong {
  color: var(--blue-2);
}

@media (max-width: 760px) {
  body {
    padding-bottom: calc(62px + env(safe-area-inset-bottom));
  }

  .fixed-branding {
    justify-content: center;
    text-align: center;
    font-size: 12px;
    min-height: 50px;
    padding-left: 12px;
    padding-right: 12px;
  }
}


/* Patch branding center + bar lebih pendek */
body {
  padding-bottom: calc(42px + env(safe-area-inset-bottom));
}

.app-shell {
  min-height: calc(100vh - 42px);
}

.fixed-branding {
  min-height: 34px;
  padding: 6px 14px calc(6px + env(safe-area-inset-bottom));
  justify-content: center;
  text-align: center;
  font-size: 13px;
  line-height: 1.25;
}

.fixed-branding span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
}

@media (max-width: 760px) {
  body {
    padding-bottom: calc(44px + env(safe-area-inset-bottom));
  }

  .fixed-branding {
    min-height: 36px;
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    justify-content: center;
    text-align: center;
    font-size: 11.5px;
    line-height: 1.25;
  }
}
