/* ============================================================
   DentalCode — "Calm Medical" design system
   Display/UI: Outfit  ·  Body: Inter
   Soft blues, rounded forms, patient-friendly trust
   ============================================================ */

:root {
  --blue-900: #0f2433;
  --blue-800: #103a52;
  --blue-700: #106a9e;
  --blue-500: #2f9fdb;
  --blue-100: #e8f4fb;
  --blue-50:  #f7fbfd;

  --ink:      #1a2733;
  --muted:    #52616f;
  --muted-2:  #7c8a97;
  --line:     #eaf0f4;
  --line-2:   #d4e6f0;
  --paper:    #ffffff;
  --paper-2:  #f7fbfd;

  --radius:    14px;
  --radius-lg: 20px;
  --maxw:      1080px;

  --shadow:    0 8px 30px rgba(16,106,158,.1);
  --shadow-sm: 0 1px 2px rgba(16,106,158,.05), 0 6px 18px rgba(16,106,158,.06);

  --grad: linear-gradient(135deg, var(--blue-500), var(--blue-700));

  --font-display: "Outfit", system-ui, -apple-system, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: 30px; }

a { color: var(--blue-700); text-underline-offset: 2px; }
a:hover { color: var(--blue-500); }

h1, h2, h3 {
  font-family: var(--font-display); font-weight: 700; line-height: 1.1;
  color: var(--blue-900); margin: 0 0 .4em; letter-spacing: -.02em;
}
h1 { font-size: clamp(2.2rem, 4.5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.05rem); }
h3 { font-size: 1.25rem; }

.skip { position: absolute; left: -999px; top: 0; background: var(--blue-900);
  color: #fff; padding: 10px 16px; z-index: 100; border-radius: 0 0 8px 0; }
.skip:focus { left: 0; top: 0; }

/* ---------- Header ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 32px; height: 76px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 11px; background: var(--grad);
  display: grid; place-items: center; color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
}
.brand-mark.small { width: 28px; height: 28px; font-size: 1rem; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem;
  color: var(--blue-700); letter-spacing: -.02em; }

.main-nav { display: flex; gap: 28px; margin-right: auto; }
.main-nav a { color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 500; }
.main-nav a:hover { color: var(--blue-700); }

.header-search { display: flex; align-items: center; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.header-search input { border: 0; background: transparent; height: 34px; width: 210px;
  padding: 0 12px; font-size: .9rem; outline: none; color: var(--ink); font-family: var(--font-body); }
.header-search input::placeholder { color: var(--muted-2); }
.header-search button { height: 34px; width: 38px; border: 0; cursor: pointer;
  background: var(--grad); color: #fff; border-radius: 9px; font-size: 1rem; }
.header-search button:hover { filter: brightness(1.05); }

/* ---------- Hero ---------- */
.hero { padding: 70px 0 76px; background: radial-gradient(120% 130% at 90% 0%, var(--blue-100) 0%, #fff 60%); }
.hero .eyebrow { font-family: var(--font-display); font-size: .9rem; font-weight: 600;
  color: var(--blue-500); margin-bottom: 16px; }
.hero h1 { max-width: 15ch; color: var(--blue-900); }
.hero h1 em { font-style: normal; color: var(--blue-700); }
.hero p.lead { font-size: 1.16rem; color: var(--muted); max-width: 51ch; margin: 1.1rem 0 2rem; }

.hero-search { display: flex; max-width: 540px; background: #fff; border: 1px solid var(--line-2);
  border-radius: 16px; padding: 8px; box-shadow: var(--shadow); }
.hero-search input { flex: 1; border: 0; padding: 13px 18px; font-size: 1rem; outline: none;
  background: transparent; font-family: var(--font-body); }
.hero-search button { background: var(--grad); color: #fff; border: 0; padding: 0 28px;
  border-radius: 11px; font-weight: 600; cursor: pointer; font-size: .95rem; font-family: var(--font-display); }
.hero-search button:hover { filter: brightness(1.05); }

.hero-trust { display: flex; gap: 28px; margin-top: 34px; flex-wrap: wrap; }
.hero-trust .item { display: flex; align-items: center; gap: 9px; font-size: .92rem; color: var(--muted); }
.hero-trust .ic { width: 24px; height: 24px; border-radius: 50%; background: var(--blue-100);
  color: var(--blue-700); display: grid; place-items: center; font-size: .8rem; font-weight: 700; }

/* ---------- Sections ---------- */
.section { padding: 62px 0; }
.section.alt { background: var(--paper-2); }
.section-head { margin-bottom: 30px; }
.section-head .eyebrow { font-family: var(--font-display); font-size: .85rem; font-weight: 600;
  color: var(--blue-500); margin-bottom: 6px; }
.section-head .sub { color: var(--muted-2); font-size: .95rem; margin-top: 4px; }

/* ---------- Category grid ---------- */
.cat-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.cat-card { display: block; text-decoration: none; color: inherit;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 26px; transition: background .18s, border-color .18s, transform .18s, box-shadow .18s; }
.cat-card:hover { background: #fff; border-color: var(--blue-500); transform: translateY(-3px); box-shadow: var(--shadow); }
.cat-card .cicon { width: 46px; height: 46px; border-radius: 14px; background: var(--blue-100);
  display: grid; place-items: center; font-size: 1.4rem; margin-bottom: 14px; }
.cat-card .range { font-size: .75rem; font-weight: 600; color: var(--blue-500); }
.cat-card h3 { margin: 4px 0; color: var(--blue-900); font-size: 1.25rem; }
.cat-card p { margin: 0; color: var(--muted-2); font-size: .9rem; }
.cat-card .count { margin-top: 12px; font-size: .82rem; color: var(--blue-700); font-weight: 600; }

/* ---------- Code table ---------- */
.code-table { width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.code-table th, .code-table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); }
.code-table th { background: var(--blue-50); font-family: var(--font-display); font-size: .78rem;
  letter-spacing: .04em; text-transform: uppercase; color: var(--blue-700); font-weight: 600; }
.code-table tr:last-child td { border-bottom: none; }
.code-table tr:hover td { background: var(--paper-2); }
.code-table .code-cell { font-family: var(--font-display); font-weight: 600; }
.code-table .code-cell a { color: var(--blue-900); text-decoration: none; }
.code-table .code-cell a:hover { color: var(--blue-500); }

.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: 3px 10px;
  border-radius: 999px; background: var(--blue-100); color: var(--blue-700); }

/* ---------- Single code page ---------- */
.code-hero { background: radial-gradient(120% 140% at 85% -10%, var(--blue-100) 0%, #fff 60%);
  padding: 48px 0 40px; border-bottom: 1px solid var(--line); }
.code-hero .crumbs { font-size: .85rem; color: var(--muted-2); margin-bottom: 18px; }
.code-hero .crumbs a { color: var(--blue-700); text-decoration: none; }
.code-hero .crumbs a:hover { color: var(--blue-500); }
.code-hero .big-code { font-family: var(--font-display); font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 700; color: var(--blue-900); line-height: 1; letter-spacing: -.03em; }
.code-hero .big-code .d { color: var(--blue-500); }
.code-hero .sub { color: var(--muted); font-size: 1.2rem; margin-top: 12px; max-width: 60ch; }

.code-body { display: grid; grid-template-columns: 1fr 300px; gap: 48px; padding: 48px 0 72px; }
@media (max-width: 860px) { .code-body { grid-template-columns: 1fr; } }
.prose h2 { margin-top: 2rem; }
.prose p { margin: 0 0 1.1rem; }
.summary-box { background: var(--blue-100); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 28px; }
.summary-box .label { font-family: var(--font-display); font-size: .72rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--blue-700); font-weight: 600; margin-bottom: 6px; }
.summary-box p { margin: 0; font-size: 1.05rem; color: var(--blue-900); }

.faq dt { font-family: var(--font-display); font-weight: 600; color: var(--blue-900); margin-top: 18px; }
.faq dd { margin: 6px 0 0; color: var(--ink); }

.sidebar .box { background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px; }
.sidebar h3 { font-family: var(--font-display); font-size: .8rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted-2); font-weight: 600; }
.sidebar ul { list-style: none; padding: 0; margin: 10px 0 0; }
.sidebar li { margin-bottom: 8px; }
.sidebar li a { text-decoration: none; font-weight: 500; }
.sidebar li a:hover { color: var(--blue-500); }

.disclaimer-note { font-size: .82rem; color: var(--muted); background: var(--blue-50);
  border-left: 3px solid var(--blue-500); padding: 12px 16px; border-radius: 0 8px 8px 0; }

/* ---------- Search results ---------- */
.result { display: block; text-decoration: none; color: inherit; padding: 18px 0;
  border-bottom: 1px solid var(--line); }
.result:hover .rc { color: var(--blue-500); }
.result .rc { font-family: var(--font-display); font-weight: 600; color: var(--blue-900); font-size: 1.1rem; }
.result .rt { color: var(--muted-2); }
.empty { text-align: center; color: var(--muted-2); padding: 60px 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-block; text-decoration: none; font-family: var(--font-display);
  font-weight: 600; cursor: pointer; padding: 12px 22px; border-radius: 12px; border: 1px solid transparent; }
.btn-primary { background: var(--grad); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); color: #fff; }
.btn-ghost { border-color: var(--line-2); color: var(--blue-700); background: #fff; }
.btn-ghost:hover { border-color: var(--blue-500); color: var(--blue-500); }
.pill-btn { background: var(--blue-100); color: var(--blue-700); padding: 10px 20px;
  border-radius: 12px; text-decoration: none; font-family: var(--font-display); font-size: .9rem; font-weight: 600; }
.pill-btn:hover { background: var(--blue-500); color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: var(--blue-900); color: #b9cdd9; margin-top: 40px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; padding: 48px 30px 28px; }
.footer-brand { max-width: 380px; display: flex; gap: 14px; align-items: flex-start; }
.footer-brand p { margin: 0; font-size: .88rem; color: #8fa6b4; }
.footer-nav { display: flex; flex-direction: column; gap: 10px; }
.footer-nav a { color: #cfe0ea; text-decoration: none; font-size: .9rem; }
.footer-nav a:hover { color: var(--blue-500); }
.footer-fine { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  border-top: 1px solid rgba(255,255,255,.08); padding: 18px 30px; font-size: .78rem; color: #7891a0; }

/* ---------- Pagination ---------- */
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 32px; }
.pager a, .pager span { padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px;
  text-decoration: none; color: var(--blue-700); font-size: .9rem; font-family: var(--font-display); font-weight: 500; }
.pager .current { background: var(--grad); color: #fff; border-color: transparent; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .main-nav { display: none; }
  .header-search input { width: 130px; }
  .hero-trust { gap: 18px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
