:root {
  --page: #ffffff;
  --surface: #ffffff;
  --text: #202124;
  --muted: #5f6368;
  --line: #dadce0;
  --soft: #f8f9fa;
  --blue: #1a73e8;
  --blue-dark: #1558b0;
  --danger: #b3261e;
  --success: #137333;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--page);
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* HOME — gaya mesin pencari modern */
.search-home-body {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.home-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 60px;
  padding: 8px 18px;
}
.home-topbar nav { display: flex; align-items: center; gap: 16px; }
.home-topbar a { color: #3c4043; font-size: 13px; }
.apps-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.apps-button:hover { background: #f1f3f4; text-decoration: none; }
.apps-button svg { width: 22px; height: 22px; fill: #5f6368; }
.profile-badge {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.google-home-shell {
  display: grid;
  place-items: start center;
  padding: clamp(72px, 15vh, 150px) 20px 48px;
}
.google-search-section { width: min(700px, 100%); text-align: center; }
.logo-link { display: inline-block; }
.logo-link:hover { text-decoration: none; }
.cariokeplay-logo {
  display: block;
  width: min(390px, 72vw);
  height: auto;
  margin: 0 auto 28px;
}
.google-search-form { width: 100%; }
.google-search-box {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid #dfe1e5;
  border-radius: 999px;
  background: #fff;
}
.google-search-box:hover,
.google-search-box:focus-within {
  border-color: transparent;
  box-shadow: 0 1px 6px rgba(32, 33, 36, .28);
}
.google-search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #202124;
  font-size: 16px;
  line-height: 24px;
  padding: 12px 0;
  appearance: none;
}
.google-search-box input::-webkit-search-cancel-button { display: none; }
.leading-search-icon { width: 20px; height: 20px; flex: 0 0 auto; fill: #9aa0a6; }
.voice-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.voice-button:hover { background: #f1f3f4; }
.voice-button svg { width: 21px; height: 21px; fill: #4285f4; }
.google-action-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}
.google-action-button {
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--soft);
  border-radius: 4px;
  background: var(--soft);
  color: #3c4043;
  cursor: pointer;
}
.google-action-button:hover {
  border-color: #dadce0;
  box-shadow: 0 1px 1px rgba(0,0,0,.1);
}
.home-helper { margin-top: 28px; color: var(--muted); font-size: 14px; }
.quick-links { margin: 34px auto 0; width: min(620px, 100%); }
.quick-links h2 {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.quick-link-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.quick-link-grid a {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 8px;
  border-radius: 12px;
  color: #3c4043;
  font-size: 13px;
  overflow: hidden;
}
.quick-link-grid a:hover { background: #f1f3f4; text-decoration: none; }
.quick-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #f1f3f4;
  color: #5f6368;
  font-weight: 700;
  position: relative;
}
.quick-icon img {
  position: absolute;
  inset: 7px;
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}
.google-footer { background: #f2f2f2; color: #70757a; font-size: 14px; }
.google-footer > div:first-child { padding: 15px 30px; border-bottom: 1px solid #dadce0; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 15px 30px;
}
.google-footer a { color: #70757a; }

/* RESULTS */
.results-body { min-height: 100vh; background: #fff; }
.google-results-header {
  min-height: 78px;
  display: grid;
  grid-template-columns: 150px minmax(280px, 690px) 1fr;
  align-items: center;
  gap: 22px;
  padding: 14px 28px 10px;
  border-bottom: 1px solid #ebebeb;
}
.results-logo-link { display: block; }
.results-logo-link:hover { text-decoration: none; }
.results-logo { display: block; width: 116px; height: auto; }
.google-results-form { width: 100%; }
.result-search-box { min-height: 46px; padding-left: 20px; box-shadow: 0 1px 6px rgba(32, 33, 36, .18); border-color: transparent; }
.result-submit {
  width: 42px;
  height: 42px;
  border: 0;
  border-left: 1px solid #e8eaed;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.result-submit svg { width: 21px; height: 21px; fill: #4285f4; }
.results-admin-link { justify-self: end; color: #3c4043; font-size: 13px; }
.result-tabs {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 48px;
  padding-left: 200px;
  border-bottom: 1px solid #ebebeb;
  font-size: 13px;
  color: #5f6368;
}
.result-tabs a { color: #5f6368; height: 48px; display: flex; align-items: center; }
.result-tabs a.active { color: #1a73e8; border-bottom: 3px solid #1a73e8; }
.google-results-main {
  width: min(760px, calc(100% - 40px));
  margin-left: max(200px, calc((100vw - 1120px) / 2));
  padding: 20px 0 60px;
}
.result-count { margin: 0 0 26px; color: #70757a; font-size: 13px; }
.google-result-list { display: grid; gap: 32px; }
.google-result-item { max-width: 680px; }
.result-source {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #202124;
  margin-bottom: 7px;
}
.result-source:hover { text-decoration: none; }
.source-favicon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
  border: 1px solid #e4e7eb;
  border-radius: 50%;
  background: #f1f3f4;
  color: #5f6368;
  font-size: 13px;
  font-weight: 700;
}
.source-favicon img {
  position: absolute;
  inset: 4px;
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
}
.favicon-letter { line-height: 1; }
.source-copy { display: grid; gap: 2px; min-width: 0; }
.source-copy strong { color: #202124; font-size: 14px; font-weight: 400; }
.source-copy small {
  max-width: 540px;
  color: #4d5156;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.google-result-item h2 { margin: 0 0 5px; font-size: 20px; line-height: 1.3; font-weight: 400; }
.google-result-item h2 a { color: #1a0dab; }
.google-result-item h2 a:visited { color: #681da8; }
.google-result-item p { margin: 0; color: #4d5156; font-size: 14px; line-height: 1.58; }
.result-url { display: none; }
.no-results-copy { color: #4d5156; font-size: 14px; line-height: 1.6; }
.no-results-copy ul { padding-left: 20px; }
.google-empty-state { padding: 24px 0; }
.google-empty-state h1 { font-size: 22px; font-weight: 500; }
.google-empty-state p { color: var(--muted); }

/* ADMIN */
.admin-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f3f6fb;
}
.auth-card {
  width: min(430px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(0,0,0,.06);
}
.auth-card h1 { margin-top: 0; }
.auth-card > p { color: var(--muted); line-height: 1.5; }
.auth-link { text-align: center; margin-bottom: 0; }
.admin-dashboard { min-height: 100vh; background: #f3f4f6; }
.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  background: #111827;
  color: #fff;
}
.admin-topbar strong, .admin-topbar span { display: block; }
.admin-topbar span { margin-top: 3px; color: #cbd5e1; font-size: 12px; }
.admin-topbar nav { display: flex; gap: 18px; }
.admin-topbar a { color: #fff; }
.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 22px;
  max-width: 1400px;
  margin: auto;
  padding: 24px;
}
.panel {
  align-self: start;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.panel h1, .panel h2 { margin-top: 0; }
.stack-form { display: grid; gap: 16px; }
.stack-form label { display: grid; gap: 7px; font-size: 14px; font-weight: 600; }
.stack-form input, .stack-form textarea, .stack-form select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
}
.stack-form textarea { resize: vertical; }
.stack-form input:focus, .stack-form textarea:focus, .stack-form select:focus {
  outline: 2px solid #bfdbfe;
  border-color: #60a5fa;
}
.field-hint { color: var(--muted); font-weight: 400; }
.field-note { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.4; }
.primary-button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: 0;
  border-radius: 9px;
  font-weight: 700;
  cursor: pointer;
}
.primary-button { background: var(--blue); color: #fff; }
.primary-button:hover { background: var(--blue-dark); text-decoration: none; }
.secondary-button { background: #eef2ff; color: #3730a3; }
.button-row { display: flex; gap: 10px; }
.alert { padding: 11px 13px; border-radius: 9px; margin-bottom: 16px; font-size: 14px; }
.alert.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert.success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-row { display: flex !important; align-items: center; gap: 8px !important; font-weight: 500 !important; }
.check-row input { width: auto; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
td small { display: block; margin-top: 5px; color: var(--muted); }
.status { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status.on { background: #dcfce7; color: #166534; }
.status.off { background: #f3f4f6; color: #6b7280; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions form { display: inline; }
.actions button { border: 0; background: none; padding: 0; color: var(--blue); cursor: pointer; }
.actions .danger-link { color: var(--danger); }
.admin-site-cell { display: inline-flex; align-items: center; gap: 9px; }
.mini-site-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
}
.mini-site-icon img { position: absolute; inset: 3px; width: 18px; height: 18px; object-fit: contain; background: #fff; }
.muted { color: var(--muted); }

@media (max-width: 900px) {
  .admin-grid { grid-template-columns: 1fr; }
  .google-results-header { grid-template-columns: 110px minmax(0, 1fr); }
  .results-admin-link { display: none; }
  .result-tabs { padding-left: 24px; }
  .google-results-main { margin: 0 auto; }
}

@media (max-width: 640px) {
  .home-topbar { min-height: 52px; padding: 6px 12px; }
  .google-home-shell { padding-top: 18vh; }
  .cariokeplay-logo { width: min(285px, 72vw); margin-bottom: 22px; }
  .google-action-row { margin-top: 22px; }
  .google-action-button:nth-child(2) { display: none; }
  .quick-link-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
  .quick-link-grid a { min-height: 86px; font-size: 11px; }
  .quick-icon { width: 44px; height: 44px; }
  .quick-icon img { inset: 7px; width: 30px; height: 30px; }
  .footer-bottom { align-items: flex-start; flex-direction: column; gap: 10px; }
  .google-footer > div:first-child, .footer-bottom { padding-left: 20px; padding-right: 20px; }

  .google-results-header {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px 14px;
  }
  .results-logo { width: 92px; }
  .result-tabs { min-height: 42px; padding-left: 18px; }
  .result-tabs a { height: 42px; }
  .google-results-main { width: calc(100% - 32px); padding-top: 16px; }
  .source-copy small { max-width: calc(100vw - 96px); }
  .google-result-item h2 { font-size: 19px; }

  .admin-topbar { align-items: flex-start; padding: 16px; }
  .admin-topbar nav { gap: 10px; font-size: 13px; }
  .admin-grid { padding: 14px; }
  .panel { padding: 18px; }
  .two-columns { grid-template-columns: 1fr; }
}
