/*
 * Melon Tools guide pages (shared by the small single-purpose tools) in the shadcn/ui "Maia" look (Stone + Emerald).
 * Tokens and the top bar live in /melon-shell.css.
 */
:root {
  --max: 740px;
  --g-text: #44403b;
  --g-shadow: 0 1px 2px rgba(12, 10, 9, 0.04), 0 8px 24px rgba(12, 10, 9, 0.06);
  /* Aliases read by /melon-support.js. */
  --surface: color-mix(in srgb, var(--m-card) 88%, transparent);
  --border: var(--m-border);
  --text: var(--m-fg);
  --muted: var(--m-muted-fg);
  --accent: var(--m-fg);
}

[data-theme="dark"] {
  --g-text: #d6d3d1;
  --g-shadow: none;
}

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

body {
  margin: 0;
  background: var(--m-page);
  color: var(--m-fg);
  font-family: var(--m-font);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--m-primary); text-underline-offset: 3px; }
[data-theme="dark"] a { color: var(--m-primary-soft-fg); }

code, kbd {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--m-muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.86em;
}

kbd { box-shadow: inset 0 -1px 0 var(--m-border); }

pre {
  margin: 0 0 20px;
  padding: 14px 16px;
  overflow-x: auto;
  border-radius: var(--m-radius-card);
  background: var(--m-muted);
  font-size: 14px;
  line-height: 1.6;
}

pre code { padding: 0; background: none; font-size: inherit; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--m-input-bg);
  box-shadow: inset 0 0 0 1px var(--m-border);
  color: var(--m-fg);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover { background: var(--m-muted); }

.btn-primary,
[data-theme="dark"] .btn-primary {
  background: var(--m-primary);
  box-shadow: none;
  color: var(--m-primary-fg);
}

.btn-primary:hover { background: var(--m-primary-hover); }

.shell-actions .btn { height: 32px; padding: 0 14px; font-size: 13px; }

main { display: block; padding-bottom: 96px; }

.breadcrumb {
  max-width: var(--max);
  margin: 26px auto 0;
  padding: 0 24px;
  color: var(--m-muted-fg);
  font-size: 13px;
}

.breadcrumb a { color: inherit; text-decoration: none; }
.breadcrumb a:hover { color: var(--m-fg); text-decoration: underline; }

article {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 24px 0;
}

.kicker {
  display: inline-flex;
  margin: 0 0 14px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--m-primary-soft);
  color: var(--m-primary-soft-fg);
  font-size: 12px;
  font-weight: 500;
}

h1, h2, h3 {
  font-family: var(--m-font-heading);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(30px, 5.5vw, 42px);
  line-height: 1.12;
}

h2 {
  margin: 48px 0 14px;
  font-size: clamp(21px, 3vw, 26px);
  line-height: 1.25;
}

h3 { margin: 24px 0 8px; font-size: 17px; }

.lede {
  margin: 0 0 30px;
  color: var(--m-muted-fg);
  font-size: 19px;
  line-height: 1.55;
}

article p { margin: 0 0 18px; color: var(--g-text); }
article strong { color: var(--m-fg); }
article ul, article ol { margin: 0 0 20px; padding-left: 22px; color: var(--g-text); }
article li { margin: 0 0 8px; }

.card {
  border-radius: var(--m-radius-card);
  background: var(--m-card);
  box-shadow: 0 0 0 1px var(--m-ring-line), var(--g-shadow);
}

.cta-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 0 0 30px;
  padding: 16px 18px;
}

.cta-inline p { flex: 1 1 240px; margin: 0; font-size: 16px; }

.toc {
  margin: 0 0 36px;
  padding: 16px 20px;
  font-size: 15px;
}

.toc strong { display: block; margin-bottom: 6px; }
.toc ol { margin: 0; }
.toc li { margin: 0 0 4px; }

.callout {
  margin: 26px 0;
  padding: 16px 20px;
  border-radius: var(--m-radius-card);
  background: var(--m-primary-soft);
}

.callout p { margin: 0; color: var(--m-fg); }
.callout p + p { margin-top: 10px; }

.cta-mid {
  margin: 36px 0;
  padding: 20px 22px;
}

.cta-mid p { margin: 0 0 14px; color: var(--m-fg); }

.cta-box {
  margin: 48px 0;
  padding: 28px 26px;
  border-radius: var(--m-radius-card);
  background: #004f3b;
  color: #ecfdf5;
}

.cta-box h2 { margin-top: 0; color: #ffffff; }
.cta-box p { color: rgba(236, 253, 245, 0.88); }
.cta-box .btn { background: #ffffff; box-shadow: none; color: #004f3b; }
.cta-box .btn:hover { background: #d0fae5; }

.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }

.table-wrap { margin: 0 0 22px; overflow-x: auto; }

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--m-radius-card);
  background: var(--m-card);
  box-shadow: 0 0 0 1px var(--m-ring-line);
  font-size: 15px;
}

th, td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--m-border);
  text-align: left;
  vertical-align: top;
}

th { color: var(--m-muted-fg); font-size: 12.5px; font-weight: 500; letter-spacing: 0.02em; }
tr:last-child td { border-bottom: 0; }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0 8px;
}

.grid-card { padding: 18px 20px; }
.grid-card h3 { margin-top: 0; }
.grid-card p { margin-bottom: 0; font-size: 15px; }

.figure { margin: 10px 0 26px; }
.figure svg { display: block; width: 100%; height: auto; }
.figure figcaption { margin-top: 8px; color: var(--m-muted-fg); font-size: 14px; }

.faq-list { display: flex; flex-direction: column; gap: 10px; margin: 22px 0 8px; }

.faq-item { padding: 2px 20px; }

.faq-item summary {
  padding: 15px 0;
  font-size: 16px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before {
  content: "+";
  display: inline-block;
  width: 16px;
  margin-right: 10px;
  color: var(--m-primary);
  font-weight: 700;
}

.faq-item[open] summary::before { content: "\2212"; }
.faq-item p { margin: 0 0 18px; }

.related { margin: 48px 0 0; }
.related h2 { margin-top: 0; font-size: 19px; }

.related ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related li { margin: 0; }

.related a {
  display: block;
  height: 100%;
  padding: 14px 16px;
  border-radius: var(--m-radius-card);
  background: var(--m-card);
  box-shadow: 0 0 0 1px var(--m-ring-line);
  color: var(--m-fg);
  font-weight: 600;
  text-decoration: none;
}

.related a span { display: block; color: var(--m-muted-fg); font-size: 14px; font-weight: 400; }
.related a:hover { box-shadow: 0 0 0 2px var(--m-primary); }

.sources {
  margin: 52px 0 0;
  padding-top: 26px;
  border-top: 1px solid var(--m-border);
}

.sources h2 { margin-top: 0; font-size: 19px; }

.source-list {
  margin: 10px 0 0;
  padding: 0 0 0 20px;
  color: var(--m-muted-fg);
  font-size: 13.5px;
  line-height: 1.7;
}

.content-footer { max-width: var(--max); margin: 56px auto 0; padding: 0 24px; }

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--m-radius-card);
  background: var(--m-card);
  box-shadow: 0 0 0 1px var(--m-ring-line);
  color: var(--m-muted-fg);
  font-size: 0.92rem;
}

.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-home { color: var(--m-fg); font-weight: 700; text-decoration: none; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 14px; }
.footer-links a { color: inherit; text-decoration: none; }
.footer-links a:hover { color: var(--m-fg); }

.sticky-cta {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: rgba(12, 10, 9, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transform: translateY(100%);
  transition: transform 0.25s ease;
}

.sticky-cta.visible { transform: translateY(0); }
.sticky-cta p { margin: 0; color: #fafaf9; font-size: 14.5px; }
.sticky-cta .btn { background: #ffffff; box-shadow: none; color: #0c0a09; }

.sticky-cta .dismiss {
  padding: 4px 6px;
  border: 0;
  background: none;
  color: rgba(250, 250, 249, 0.6);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 640px) {
  .grid-cards,
  .related ul { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
  .sticky-cta { flex-wrap: wrap; }
  .sticky-cta p { width: 100%; text-align: center; }
  .breadcrumb, article, .content-footer { padding-left: 16px; padding-right: 16px; }
}

/* Amounts line up in tables. */
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wrong { color: var(--m-danger); }
.right { color: var(--m-primary); font-weight: 600; }
[data-theme="dark"] .right { color: var(--m-primary-soft-fg); }
