/* Baseline site styles for CupsToML pages (no framework). */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #fbfdff;
  --text: #172031;
  --muted: #5f6f86;
  --border: #d9e1ea;
  --accent: #0b6fb9;
  --accent-soft: #e8f4ff;
  --accent-strong: #084f8a;
  --warm-soft: #fff4d6;
  --hero-glow: radial-gradient(circle at top left, rgba(11, 111, 185, 0.14), rgba(11, 111, 185, 0) 52%);
  --shadow: 0 6px 20px rgba(14, 23, 38, 0.06);
  --shadow-md: 0 12px 28px rgba(14, 23, 38, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --icon-accent: #2563eb;
  --brand-blue: #0b5fb3;
  --brand-accent: #f5c542;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Segoe UI",
    -apple-system,
    BlinkMacSystemFont,
    "Helvetica Neue",
    Arial,
    sans-serif;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

h1,
h2,
h3 {
  margin: 0 0 var(--space-2);
  line-height: 1.2;
}

/* NEW: Reusable heading + icon row for rounded outline section icons. */
.ui-h1,
.ui-h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-title,
.tips-title,
.faq-title,
.related-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-block;
  color: var(--brand-blue);
  position: relative;
}

.section-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Defensive: any SVG used inside section title rows should never render huge */
.section-title svg,
.tips-title svg,
.faq-title svg,
.related-title svg,
.ui-h1 svg,
.ui-h2 svg {
  width: 22px !important;
  height: 22px !important;
  flex: 0 0 22px;
  display: block;
}

/* Defensive: any svg with .icon class is always sized */
svg.icon {
  width: 22px !important;
  height: 22px !important;
  display: inline-block;
}

.section-icon--accent {
  color: var(--brand-blue);
}

.section-icon--with-dot::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--brand-accent);
}

.icon {
  color: var(--accent);
  width: 22px;
  height: 22px;
  vertical-align: middle;
}

.icon--sm {
  width: 18px;
  height: 18px;
}

.icon--md {
  width: 26px;
  height: 26px;
}

.icon--lg {
  width: 24px;
  height: 24px;
}

.ui-h1 .icon,
.ui-h2 .icon {
  flex: 0 0 auto;
}

.ui-h2__icon,
.ui-h2 .icon {
  padding: 4px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent);
}

/* NEW: Extra separation before the home About disclaimer line. */
.about-disclaimer {
  margin-top: 14px;
}

.home-about ul {
  margin-bottom: 1rem;
}

.home-about .about-disclaimer {
  margin-top: 14px;
}

p,
ul {
  margin: 0 0 var(--space-3);
}

ul {
  padding-left: 1.2rem;
}

main {
  width: min(960px, calc(100% - 2rem));
  margin: var(--space-4) auto var(--space-5);
}

.hub-page > h1,
.guide-page > h1 {
  margin-bottom: var(--space-4);
  padding: clamp(1.2rem, 2vw, 1.55rem) clamp(1.1rem, 2.2vw, 1.6rem);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 247, 255, 0.96)),
    var(--hero-glow);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.hub-page > h1::before,
.guide-page > h1::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
}

/* Header / top navigation */
.site-header {
  background: var(--accent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  position: sticky;
  top: 0;
  z-index: 20;
  /* new: subtle separation when sticky */
  box-shadow: 0 8px 18px rgba(10, 20, 35, 0.14);
}

.site-nav {
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
  min-height: 3.1rem;          /* was 3.5rem */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;         /* tighter */
  padding: 0.55rem 0;          /* tighter */
}

.site-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.site-brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.brand-pill {
  display:inline-flex;
  align-items:center;
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

.brand-text {
  font-weight:800;
  letter-spacing:-0.3px;
  color: var(--brand-accent);
  line-height:1.05;
  position:relative;
  padding-right:10px;
  font-size:1.05rem;
}

.brand-tagline {
  font-weight: 600;
  opacity: 0.95;
  font-size: 0.95rem;
  color: #fff;
}

.site-brand:hover,
.site-brand:focus-visible {
  background: transparent;
  opacity: 0.92;
  text-decoration: none;
}

.site-brand:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 2px;
  border-radius: 6px;
}

.site-brand[aria-current="page"],
.site-brand[aria-current="page"]:hover,
.site-brand[aria-current="page"]:focus-visible {
  background: transparent;
  font-weight: inherit;
  text-decoration: none;
}

.site-nav a {
  color: #fff;
  opacity: 0.92;
  padding: 0.22rem 0.45rem;    /* smaller pill */
  border-radius: 8px;
  text-decoration: none;
  line-height: 1.1;
}

.site-nav a:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  opacity: 1;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.16); /* pill highlight */
  text-decoration: none;                 /* remove underline */
}

.site-nav a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

/* Footer navigation */
.site-footer {
  border-top: 1px solid var(--border);
  background: #eef2f7;
  font-size: 0.92rem;
}

.site-footer-nav {
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
  padding: var(--space-3) 0 var(--space-1);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

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

.site-footer-nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-footer-meta {
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0 0 var(--space-3);
  color: var(--muted);
  font-size: 0.85rem;
}

/* Surface sections */
main > section,
.converter-calculator,
.quick-reference,
.tips-cards,
.related-conversions,
.faq,
.home-universal-converter,
.home-popular-conversions,
.home-browse-categories,
.hub-converter-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.converter-calculator {
  background: linear-gradient(180deg, #fcfeff 0%, #f5f9ff 100%);
  border: 2px solid #c2d5ef;
  box-shadow:
    0 14px 34px rgba(17, 36, 66, 0.16),
    0 2px 0 rgba(255, 255, 255, 0.8) inset;
  position: relative;
}

.converter-calculator::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: calc(var(--radius) + 4px);
  background: radial-gradient(70% 60% at 50% 0%, rgba(11, 111, 185, 0.08), rgba(11, 111, 185, 0));
  pointer-events: none;
  z-index: -1;
}

.converter-calculator:focus-within {
  box-shadow:
    0 18px 40px rgba(17, 36, 66, 0.2),
    0 0 0 3px rgba(11, 111, 185, 0.12),
    0 2px 0 rgba(255, 255, 255, 0.8) inset;
  border-color: #93b8e3;
}

.home-universal-converter--hero {
  background: linear-gradient(180deg, #f7fbff 0%, #f1f7ff 100%);
  border-color: #c5d8ee;
  box-shadow: 0 12px 30px rgba(16, 37, 72, 0.13);
  position: relative;
}

.home-universal-converter--hero::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 5px;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  background: linear-gradient(90deg, #0b6fb9 0%, #2f94df 100%);
}

.hub-intro,
.home-page > p {
  color: var(--muted);
}

.hub-intro {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 250, 255, 0.98)),
    var(--hero-glow);
  border: 1px solid color-mix(in srgb, var(--accent) 15%, var(--border));
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow-md);
  padding: clamp(1.2rem, 2.4vw, 1.7rem);
  position: relative;
}

.hub-intro::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 1rem;
  width: 68px;
  height: 68px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(245, 197, 66, 0.22), rgba(245, 197, 66, 0));
  pointer-events: none;
}

.converter-info__body .hub-intro {
  margin: 0;
}

.converter-steps .formula-line code {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.converter-units-info h3 + ul,
.converter-steps h3 + p {
  margin-top: var(--space-2);
}

/* NEW: Guide pages */
.guide-page > h1 {
  margin-bottom: var(--space-3);
}

.guide-intro {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.65;
  font-weight: 500;
}

.guide-section,
.home-popular-conversions,
.home-browse-categories,
.hub-converter-list,
.related-conversions,
.quick-reference,
.sitemap-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  position: relative;
  overflow: hidden;
}

.guide-section::before,
.home-popular-conversions::before,
.home-browse-categories::before,
.hub-converter-list::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, #3aa0ea 58%, rgba(58, 160, 234, 0.2) 100%);
}

.related-conversions::before,
.quick-reference::before,
.sitemap-group::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, #3aa0ea 58%, rgba(58, 160, 234, 0.2) 100%);
}

.guide-section > h2,
.home-popular-conversions > h2,
.home-browse-categories > h2,
.hub-converter-list > h2,
.quick-reference > h2,
.faq > h2,
.related-conversions > h2,
.sitemap-group > h2,
.tips-cards > h2 {
  margin-bottom: 0.7rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
}

.guide-section > h3,
.home-popular-conversions > h3,
.home-browse-categories > h3,
.hub-converter-list > h3 {
  margin-top: 1.15rem;
  color: var(--accent-strong);
}

.chart-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.chart-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 560px;
}

.chart-table thead th {
  background: var(--accent);
  color: #fff;
  text-align: left;
  padding: 0.75rem 0.8rem;
  font-weight: 800;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.chart-table thead th:first-child { border-top-left-radius: 12px; }
.chart-table thead th:last-child  { border-top-right-radius: 12px; }

.chart-table td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
  background: #fff;
}

.chart-table tbody tr:nth-child(even) td { background: var(--bg); }

.chart-table tbody tr:hover td {
  background: color-mix(in srgb, var(--accent) 6%, white);
}

.chart-table td:first-child {
  font-weight: 700;
}

.chart-table td:nth-child(3) {
  text-align: center;
  font-weight: 700;
  white-space: nowrap;
}

/* Form controls */
label,
legend {
  font-weight: 600;
  color: var(--text);
}

input[type="number"],
select {
  width: 100%;
  max-width: 16rem;
  margin-top: 0.35rem;
  margin-bottom: var(--space-3);
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--text);
  background: #fff;
}
/* Converter pages: keep amount input compact instead of full-row stretch. */
.converter-calculator .js-amount-input {
  width: 10rem;
  max-width: 10rem;
}

input[type="number"]:focus-visible,
select:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, white);
  outline-offset: 1px;
}

.home-result-card {
  margin-top: var(--space-2);
  margin-bottom: 0;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: #e8f2ff;
  border: 1px solid #c7dcf6;
}

.js-result-output,
.js-home-result {
  font-size: 1.35rem;
  font-weight: 700;
}

.home-result-card__label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.home-result-card__value {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 1.6rem;
  line-height: 1.1;
}

.home-result-card__value .js-home-result {
  font-size: 2rem;
}

.uconv-controls {
  background: #fff;
  border: 1px solid #d5e2f3;
  border-radius: 12px;
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}

.converter-result-card {
  margin-top: var(--space-2);
  margin-bottom: 0;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, white);
}

.converter-result-card__label {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.converter-result-card__primary {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.converter-result-card__primary .js-result-output {
  font-size: 1.9rem;
  line-height: 1.1;
}

.converter-result-card__primary [data-role="result-unit"] {
  font-weight: 700;
}

.converter-result-card__secondary {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.converter-meter {
  margin-top: 0.55rem;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, white);
  overflow: hidden;
}

.converter-meter__fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #0b6fb9 0%, #3aa0ea 100%);
  transition: width 160ms ease;
}

.converter-meter__label {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.converter-equivalents {
  margin-top: 0.7rem;
}

.converter-equivalents__label {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.converter-equivalents__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.converter-equivalents__item {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
  background: #fff;
  padding: 0.18rem 0.5rem;
  font-size: 0.82rem;
}

.converter-confidence {
  margin: 0.7rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.converter-hint {
  margin-top: 0.45rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.converter-input-feedback {
  margin: 0.5rem 0 0;
  font-size: 0.86rem;
  color: #a13e13;
}

.converter-amount-helper {
  margin-top: -0.55rem;
  margin-bottom: var(--space-2);
  font-size: 0.85rem;
  color: var(--muted);
}

.quick-amount-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 var(--space-2);
}

.quick-chip {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  font-size: 0.85rem;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
}

.quick-chip:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  background: color-mix(in srgb, var(--accent) 6%, white);
}

.quick-chip:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, white);
  outline-offset: 1px;
}

.converter-actions {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.converter-action-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  font-size: 0.86rem;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}

.converter-action-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--accent) 6%, white);
}

.converter-action-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, white);
  outline-offset: 1px;
}

.home-universal-converter .uconv-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  align-items: end;
  margin-bottom: var(--space-2);
}

.home-universal-converter .uconv-field {
  min-width: 0;
}

.home-universal-converter .uconv-field label {
  display: block;
  margin-bottom: 0.35rem;
}

.home-universal-converter .uconv-field input[type="number"],
.home-universal-converter .uconv-field select {
  width: 100%;
  max-width: 16rem;
  min-width: 7rem;
  margin-top: 0;
  margin-bottom: 0;
  padding: 0.5rem 0.65rem;
  background: #fff;
  border-color: #c8d8ec;
}

.cup-standard-toggle,
.js-home-cup-toggle {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  margin: 0 0 var(--space-3);
}

.uconv-standard-panel {
  background: #f8fbff;
  border-color: #d3e1f2;
}

.uconv-standard-note {
  margin: 0;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: #f3f8ff;
  border: 1px solid #d7e5f7;
}

.cup-standard-toggle label,
.js-home-cup-toggle label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: var(--space-3);
  font-weight: 500;
}

/* Table */
.quick-reference table {
  width: 100%;
  border-collapse: collapse;
}

.quick-reference th,
.quick-reference td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

.quick-reference th {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Tips cards (deduped + consistent) */
.tips-cards h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.tip-card {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f9ff 100%);
  border: 1px solid #cfe4f8;
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  box-shadow: 0 8px 20px rgba(14, 23, 38, 0.05);
  min-height: 100%;
}

.tip-card__icon {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff9df 0%, #ffeaa0 100%);
  border: 1px solid #f2d37b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
  line-height: 1;
  margin-top: 0.05rem;
}

.tip-card p {
  margin: 0;
}

.home-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}

.home-link-card {
  display: block;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
  padding: var(--space-3);
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
  overflow: hidden;
  min-height: 100%;
}

.home-link-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, #6cb7ef 100%);
  opacity: 0.8;
}

.home-link-card:hover,
.home-link-card:focus-visible {
  transform: translateY(-2px);
  border-color: #93b8e3;
  box-shadow: 0 12px 28px rgba(17, 36, 66, 0.1);
}

.home-link-card strong {
  display: block;
  color: var(--accent);
  margin-bottom: 0.45rem;
  font-size: 1rem;
}

.home-link-card span {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.ad-slot {
  margin: 18px 0;
}

.ad-slot--content {
  padding: 10px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.adsbygoogle {
  margin: 18px 0;
}

/* Lists + FAQ */
.related-conversions ul,
.hub-converter-list ul,
.home-popular-conversions ul,
.home-browse-categories ul {
  margin: 0;
  padding-left: 1.1rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  padding: var(--space-3);
  margin-bottom: var(--space-2);
  position: relative;
  overflow: hidden;
}

.faq-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand-accent) 0%, #f1b52b 100%);
}

.faq-item h3 {
  margin-bottom: 0.4rem;
  font-size: 1.03rem;
  padding-left: 0.2rem;
}

.faq-item p {
  margin: 0;
  color: var(--muted);
  padding-left: 0.2rem;
}

/* NEW: Contact page form styles. */
.contact-page .hub-intro {
  margin-bottom: var(--space-3);
}

.contact-form .form-field {
  margin-bottom: var(--space-3);
}

.contact-form label {
  display: block;
  margin-bottom: 0.35rem;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--text);
  background: #fff;
}

.contact-form textarea {
  min-height: 10rem;
  resize: vertical;
}

.contact-form input[type="text"]:focus-visible,
.contact-form input[type="email"]:focus-visible,
.contact-form textarea:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, white);
  outline-offset: 1px;
}

.form-actions {
  margin-top: var(--space-2);
}

.form-submit {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  font: inherit;
  cursor: pointer;
}

.form-submit:hover,
.form-submit:focus-visible {
  opacity: 0.94;
}

.form-status {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}

.form-status--success {
  background: #ecfdf3;
  border-color: #b7ebcf;
}

.form-status--error {
  background: #fff4f4;
  border-color: #f3caca;
}

.hp-field {
  position: absolute;
  left: -9999px;
}

/* Converter page: pair quick reference + FAQ in one layout block. */
.converter-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.converter-two-col .quick-reference,
.converter-two-col .faq {
  margin-bottom: 0;
}

@media (min-width: 900px) {
  .converter-two-col {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .tips-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .site-brand-wrap .brand-tagline {
    display: none;
  }
}

@media (max-width: 480px) {
  main {
    width: calc(100% - 1rem);
    margin-top: var(--space-3);
  }

  .hub-page > h1,
  .guide-page > h1 {
    padding: var(--space-3);
  }

  .site-nav {
    width: calc(100% - 1rem);
    min-height: 3rem;
    gap: 0.4rem 0.6rem;
    padding: 0.6rem 0;
    font-size: 0.95rem;
  }

  .site-footer-nav {
    width: calc(100% - 1rem);
    padding: var(--space-2) 0;
  }

  .site-footer-meta {
    width: calc(100% - 1rem);
    padding-bottom: var(--space-2);
  }

  main > section,
  .converter-calculator,
  .quick-reference,
  .tips-cards,
  .related-conversions,
  .faq,
  .home-universal-converter,
  .home-popular-conversions,
  .home-browse-categories,
  .hub-converter-list {
    padding: var(--space-3);
  }

  input[type="number"],
  select {
    max-width: 100%;
  }

  .converter-calculator .js-amount-input {
    width: 100%;
    max-width: 100%;
  }

  .converter-result-card__primary .js-result-output {
    font-size: 1.6rem;
  }

  .converter-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.45rem;
    box-shadow: 0 6px 16px rgba(14, 23, 38, 0.09);
  }

  .converter-action-btn {
    flex: 1 1 45%;
    text-align: center;
  }

  .home-universal-converter .uconv-field input[type="number"],
  .home-universal-converter .uconv-field select {
    max-width: 100%;
  }

  .home-universal-converter .uconv-row {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .tips-grid {
    grid-template-columns: 1fr;
  }
}

/* Infographic embed */
.infographic-figure {
  max-width: 100%;
  margin: 1.5rem auto;
  text-align: center;
}

.infographic-figure img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
  box-shadow: 0 12px 26px rgba(14, 23, 38, 0.08);
}

.infographic-figure figcaption {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.45;
}

.infographic-download {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 700;
}

.infographic-download:hover {
  text-decoration: underline;
}

.guide-video-section {
  margin: 1.75rem 0 0;
}

.guide-video-card {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(1rem, 2vw, 1.25rem);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.guide-video-card h2 {
  margin: 0 0 0.5rem;
}

.guide-video-intro {
  margin: 0 0 0.9rem;
  color: var(--muted);
}

.guide-video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #0f172a;
  box-shadow: 0 12px 26px rgba(14, 23, 38, 0.14);
}

.guide-video-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.guide-video-note {
  margin: 0.65rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .guide-video-section {
    margin-top: 1.5rem;
  }

  .guide-video-card {
    padding: 0.9rem;
    border-radius: 14px;
  }
}

.share-link-box {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-4);
  margin: var(--space-4) 0;
  position: relative;
  overflow: hidden;
}

.share-link-box::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--accent) 0%, #3aa0ea 100%);
}

.share-link-box h2 {
  margin-bottom: 0.55rem;
}

.share-link-box p {
  margin-bottom: var(--space-2);
}

.share-link-box__meta + .share-link-box__meta {
  margin-top: var(--space-3);
}

.share-link-box__label {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.share-link-box__field {
  display: block;
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.92rem;
  line-height: 1.45;
  resize: vertical;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: auto;
}

.share-link-box__field:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, white);
  outline-offset: 2px;
}

.photo-placeholder {
  margin: 1.5rem auto;
  max-width: 100%;
  text-align: center;
}

.photo-placeholder-box {
  background: #f5f5f0;
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 2rem;
  color: #888;
  font-style: italic;
  font-size: 1rem;
}

.photo-placeholder figcaption {
  font-size: 0.875rem;
  color: #666;
  margin-top: 0.5rem;
}
