:root {
  /* Corner radius, Fibonacci, same scale as spacing so that
     inner = outer - padding lands on another step.
     See branding/tokens.css. */
  --radius-xs: 5px;
  --radius-sm: 8px;
  --radius-md: 13px;
  --radius-lg: 21px;
  --radius-pill: 999px;
  --radius-circle: 50%;

  --bg: #fbfbf9;
  --panel: #fcfcfb;
  --panel-2: #eeeef1;
  --border: #dfdbd3;
  --text: #1c1917;
  /* Dấu mark, KHÔNG thuộc bậc chữ: chỉnh màu chữ thì logo phải đứng yên.
     Cùng giá trị ở mọi site d4t0 (branding/tokens.css --logo-color). */
  --logo-color: #293133;
  --muted: #6f6b64;
  --accent: #6440e0;
  --on-accent: #ffffff;
  --danger: #c0342b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101014;
    --panel: #18181d;
    --panel-2: #202027;
    --border: #34363c;
    --text: #eeeef2;
    --logo-color: #eef0f4; /* branding --logo-color, khối dark */
    --muted: #a2a3a8;
    --accent: #9c7bff;
    --on-accent: #101014;
    --danger: #ff6b60;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--accent);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
}

/* The mark is a masked shape, not an <img>, so it takes var(--text) and
   follows light/dark without shipping two files. */
/* 36×36 is the repo-wide size (branding/chrome.css, 22/08/2026). */
.topbar-logo {
  display: block;
  width: 36px;
  height: 36px;
  background-color: var(--logo-color);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-image: url("/logo.svg");
  mask-image: url("/logo.svg");
  /* Không xoay ở đây: logo.svg sinh ra đã xoay 45° sẵn
     (branding/build-icons.py, LOGO_ROTATE). Xoay thêm lần nữa là ra 90°. */
}

.lang-switch {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.lang-switch:hover {
  color: var(--text);
  border-color: var(--muted);
}

main {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 20px 24px;
}

.mock-notice {
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px dashed var(--danger);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 14px;
}

.ip-hero {
  text-align: center;
  margin: 24px 0 28px;
}

.ip-hero h1 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
}

.ip-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ip-value {
  font-size: clamp(24px, 6vw, 40px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.copy-btn {
  font: inherit;
  font-size: 14px;
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
}

.copy-btn:hover {
  filter: brightness(1.08);
}

.ip-family-note {
  margin: 14px auto 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 13px;
}

.geo-details {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px 18px;
}

.geo-grid {
  margin: 0;
}

.geo-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.geo-row:last-child {
  border-bottom: none;
}

.geo-row dt {
  color: var(--muted);
  font-size: 14px;
  flex-shrink: 0;
}

.geo-row dd {
  margin: 0;
  text-align: right;
  font-weight: 500;
  word-break: break-word;
}

.muted {
  color: var(--muted);
  font-weight: 400;
}

.map-section {
  margin-top: 20px;
}

.map-frame {
  display: block;
  width: 100%;
  height: 280px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.map-link {
  margin: 8px 0 0;
  text-align: right;
  font-size: 13px;
}

.lookup-section {
  margin-top: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.lookup-section h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.lookup-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lookup-form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
}

.lookup-form button {
  font: inherit;
  font-size: 14px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  flex-shrink: 0;
}

.lookup-form button:hover {
  filter: brightness(1.08);
}

.lookup-error {
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 14px;
}

.lookup-result-title {
  margin: 16px 0 8px;
  font-size: 13px;
  color: var(--muted);
  word-break: break-all;
}

.lookup-attribution {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.disclaimer {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Centred (22/08/2026, repo-wide — branding/chrome.css), replacing the
   left-aligned rule this comment used to explain. The horizontal padding still
   matches .topbar: it keeps the line off the viewport edge on a narrow screen. */
.footer {
  margin-top: auto;
  background: var(--bg);
  text-align: center;
  padding: 20px 20px;
}

.footer p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.footer a {
  color: var(--muted);
}

.footer a:hover {
  color: var(--text);
}
