:root {
  --brand-navy: #003366;
  --brand-blue: #004a99;
  --brand-blue-hover: #003874;
}

[data-md-color-scheme="default"] {
  --md-primary-fg-color: var(--brand-navy);
  --md-primary-fg-color--light: var(--brand-blue);
  --md-primary-fg-color--dark: #00264d;
  --md-accent-fg-color: var(--brand-blue);
}

.md-header__button.md-logo img { border-radius: 50%; height: 2rem; width: 2rem; }
.md-typeset { font-size: 0.8rem; }
.md-typeset a { color: var(--brand-blue); }
.md-typeset a:hover { color: var(--brand-blue-hover); }

/* Keep large images within the content column */
.md-typeset img { max-width: 100%; height: auto; }

/* Make documentation tables easy to identify and scan */
.md-typeset table:not([class]) { border: 1px solid #9fb9d2; border-collapse: separate; border-radius: 6px; border-spacing: 0; box-shadow: 0 1px 2px rgba(0, 51, 102, 0.06); overflow: hidden; }
.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td { border-bottom: 1px solid #c2d4e5; border-right: 1px solid #c2d4e5; padding: 0.6em 0.75em; vertical-align: top; }
.md-typeset table:not([class]) th { background: #eaf2fa; border-bottom: 2px solid #7fa5c8; color: #10253d; }
.md-typeset table:not([class]) th:last-child,
.md-typeset table:not([class]) td:last-child { border-right: 0; }
.md-typeset table:not([class]) tr:last-child td { border-bottom: 0; }

/*
 * Standard org header block handling.
 * The required header is: title, location, GitHub badge + org link, Last updated, separator.
 * Hide the location and badge lines, show the Last updated line as a small grey
 * caption, and hide the separator, so every page shows a clean last-updated date.
 */
.md-typeset h1 + p,
.md-typeset h1 + p + p {
  display: none;
}
.md-typeset h1 + p + p + p {
  color: #6b7280;
  font-size: 0.7rem;
  margin: -0.4rem 0 0.6rem;
}
.md-typeset h1 + p + p + p + hr {
  display: none;
}

/* Widen the layout so the center gets more space */
@media screen and (min-width: 76.25em) { .md-grid { max-width: 96%; } }
@media screen and (min-width: 90em) { .md-grid { max-width: 1800px; } }

/* Left navigation: grey non-clickable section titles */
.md-nav { font-size: 0.66rem; }
.md-sidebar--primary .md-nav__item--section > .md-nav__link,
.md-sidebar--primary .md-nav__item--section.md-nav__item--active > .md-nav__link,
.md-nav--primary label.md-nav__link {
  color: #8a94a6;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.md-nav__item .md-nav__link[href] { color: #3d4a5c; }
.md-nav__link[href]:hover,
.md-nav__link--active,
.md-nav__item--active > .md-nav__link[href] { color: var(--brand-blue); }

/* Home hub cards */
.guide-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1rem 0 2rem;
}
.guide-card,
.guide-card:visited {
  background: #fff;
  border: 1px solid #dbe4ee;
  border-top: 3px solid var(--brand-blue);
  border-radius: 8px;
  color: inherit;
  display: flex;
  flex-direction: column;
  min-height: 7rem;
  padding: 1rem 1.05rem;
  text-decoration: none;
}
.guide-card:hover { box-shadow: 0 7px 18px rgba(0, 51, 102, 0.12); color: inherit; }
@media screen and (max-width: 44rem) { .guide-grid { grid-template-columns: 1fr; } }

/* PDF workspace */
:root {
  --tool-ink: #15232d;
  --tool-muted: #5c6c76;
  --tool-line: #d6e0e5;
  --tool-paper: #f4f7f8;
  --tool-cyan: #007f8b;
  --tool-green: #287a55;
  --tool-danger: #a13f55;
}
.md-content__inner { max-width: none; }
.pdf-workspace { color: var(--tool-ink); margin: .75rem 0 3rem; }
.tool-intro { align-items: flex-start; border-bottom: 1px solid var(--tool-line); display: flex; gap: 2rem; justify-content: space-between; margin-bottom: 1rem; padding-bottom: 1.25rem; }
.tool-intro h2 { font-size: 1.55rem; margin: .2rem 0 .35rem; }
.tool-intro > div > p:last-child { color: var(--tool-muted); margin: 0; max-width: 62ch; }
.eyebrow, .step-label { color: var(--tool-cyan); font-size: .62rem; font-weight: 700; letter-spacing: .08em; margin: 0; text-transform: uppercase; }
.privacy-mark { align-items: center; background: #e7f5f4; color: #006b74; display: inline-flex; flex: 0 0 auto; font-size: .64rem; font-weight: 700; gap: .35rem; padding: .45rem .6rem; }
.privacy-mark svg { height: .9rem; width: .9rem; }
.mode-switch { display: inline-flex; margin-bottom: 1rem; }
.mode-button { align-items: center; background: #fff; border: 1px solid var(--tool-line); color: var(--tool-muted); cursor: pointer; display: inline-flex; font: inherit; font-size: .7rem; gap: .4rem; min-height: 2.35rem; padding: .45rem .85rem; }
.mode-button + .mode-button { border-left: 0; }
.mode-button.is-active { background: var(--tool-ink); color: #fff; }
.mode-button svg { height: 1rem; width: 1rem; }
.tool-layout { align-items: start; display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1.45fr) minmax(18rem, .55fr); }
.file-panel, .output-panel { background: #fff; border: 1px solid var(--tool-line); min-width: 0; }
.output-panel { position: sticky; top: 4rem; }
.panel-heading { align-items: center; border-bottom: 1px solid var(--tool-line); display: flex; justify-content: space-between; padding: 1rem 1.15rem; }
.panel-heading h3 { font-size: 1rem; margin: .1rem 0 0; }
.text-button { background: transparent; border: 0; color: var(--brand-blue); cursor: pointer; font: inherit; font-size: .65rem; font-weight: 700; }
.text-button:disabled { color: #9aa8af; cursor: default; }
.drop-zone { align-items: center; background: #f8fafb; border: 1px dashed #9fb4c2; cursor: pointer; display: flex; flex-direction: column; margin: 1.15rem; min-height: 14rem; padding: 2rem 1rem; text-align: center; transition: border-color .15s, background .15s; }
.drop-zone:hover, .drop-zone.is-dragging { background: #edf7f6; border-color: var(--tool-cyan); }
.drop-zone > svg { color: var(--tool-cyan); height: 2rem; margin-bottom: .75rem; width: 2rem; }
.drop-zone strong { font-size: .85rem; }
.drop-zone > span { color: var(--tool-muted); font-size: .65rem; margin-top: .25rem; }
.drop-zone .choose-button { background: var(--brand-blue); color: #fff; font-weight: 700; margin-top: .85rem; padding: .55rem .75rem; }
.drop-zone input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.file-empty { color: var(--tool-muted); font-size: .68rem; padding: 0 1.15rem 1.15rem; text-align: center; }
.file-list { display: grid; gap: .5rem; list-style: none !important; margin: 0 !important; padding: 0 1.15rem 1.15rem !important; }
.file-list li { align-items: center; border: 1px solid var(--tool-line); display: grid !important; gap: .65rem; grid-template-columns: auto minmax(0, 1fr) auto; margin: 0 !important; padding: .7rem; }
.file-type-icon { align-items: center; background: #edf3f7; color: var(--brand-blue); display: flex; height: 2.2rem; justify-content: center; width: 2.2rem; }
.file-type-icon svg { height: 1.1rem; width: 1.1rem; }
.file-info { min-width: 0; }
.file-info strong, .file-info span { display: block; }
.file-info strong { font-size: .7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info span { color: var(--tool-muted); font-size: .58rem; margin-top: .18rem; }
.file-actions { display: flex; gap: .2rem; }
.icon-button { align-items: center; background: #fff; border: 1px solid var(--tool-line); color: var(--tool-muted); cursor: pointer; display: inline-flex; height: 1.9rem; justify-content: center; width: 1.9rem; }
.icon-button:hover { color: var(--brand-blue); }
.icon-button:disabled { color: #bdc6cb; cursor: default; }
.icon-button.remove:hover { color: var(--tool-danger); }
.icon-button svg { height: .85rem; width: .85rem; }
.setting-group { border-bottom: 1px solid var(--tool-line); padding: 1rem 1.15rem; }
.setting-group label { display: block; font-size: .68rem; font-weight: 700; margin-bottom: .4rem; }
.setting-group input, .setting-group select { background: #fff; border: 1px solid #aebdc6; border-radius: 0; color: var(--tool-ink); font: inherit; font-size: .7rem; min-height: 2.45rem; padding: .5rem .6rem; width: 100%; }
.setting-group input:focus, .setting-group select:focus { border-color: var(--tool-cyan); outline: 2px solid rgba(0, 127, 139, .15); }
.setting-group small { color: var(--tool-muted); display: block; font-size: .58rem; line-height: 1.45; margin-top: .35rem; }
.output-summary { align-items: center; background: var(--tool-paper); display: flex; gap: .65rem; margin: 1rem 1.15rem; padding: .7rem; }
.output-summary > svg { color: var(--tool-cyan); flex: 0 0 auto; height: 1.15rem; width: 1.15rem; }
.output-summary strong, .output-summary span { display: block; }
.output-summary strong { font-size: .66rem; }
.output-summary span { color: var(--tool-muted); font-size: .58rem; margin-top: .12rem; }
.primary-action { align-items: center; background: var(--brand-blue); border: 0; color: #fff; cursor: pointer; display: flex; font: inherit; font-size: .72rem; font-weight: 700; gap: .45rem; justify-content: center; margin: 0 1.15rem; min-height: 2.7rem; padding: .6rem; width: calc(100% - 2.3rem); }
.primary-action:hover { background: var(--brand-blue-hover); }
.primary-action:disabled { background: #aeb9be; cursor: default; }
.primary-action svg { height: 1rem; width: 1rem; }
.tool-status { color: var(--tool-muted); font-size: .6rem; min-height: 1rem; padding: .55rem 1.15rem 0; }
.tool-status.is-error { color: var(--tool-danger); }
.tool-status.is-success { color: var(--tool-green); }
.progress-track { background: #e5ebee; height: .25rem; margin: .55rem 1.15rem 0; overflow: hidden; }
.progress-track span { background: var(--tool-cyan); display: block; height: 100%; transition: width .2s; width: 0; }
.privacy-note { align-items: flex-start; border-top: 1px solid var(--tool-line); color: var(--tool-muted); display: flex; font-size: .58rem; gap: .45rem; margin: 1rem 0 0; padding: .85rem 1.15rem; }
.privacy-note svg { color: var(--tool-green); flex: 0 0 auto; height: .85rem; width: .85rem; }
.guide-card > svg { color: var(--tool-cyan); height: 1.25rem; margin-bottom: .65rem; width: 1.25rem; }
.guide-card strong, .guide-card span { display: block; }
.guide-card span { color: var(--tool-muted); font-size: .67rem; line-height: 1.5; margin-top: .3rem; }
@media screen and (max-width: 70rem) {
  .tool-layout { grid-template-columns: 1fr; }
  .output-panel { position: static; }
}
@media screen and (max-width: 40rem) {
  .tool-intro { display: block; }
  .privacy-mark { margin-top: .75rem; }
  .drop-zone { min-height: 11rem; }
  .file-list li { grid-template-columns: auto minmax(0, 1fr); }
  .file-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
