/* Tools identity: Bootstrap for functionality; bavdaz.com for the visual language. */
:root {
  --tool-blue: #31668e;
  --tool-blue-dark: #214d6c;
  --tool-paper: #fff;
  --tool-bg: #e0e0e0;
  --tool-ink: #252d34;
  --tool-border: #dedede;
  --tool-added: #e6f7ec;
  --tool-removed: #fcebed;
}
html { scroll-behavior: smooth; }
body { background: var(--tool-bg); color: var(--tool-ink); }
a { color: var(--tool-blue); }
a:hover { color: var(--tool-blue-dark); }
.btn { border-radius: 2px; }
.btn-primary { --bs-btn-bg: var(--tool-blue); --bs-btn-border-color: var(--tool-blue); --bs-btn-hover-bg: var(--tool-blue-dark); --bs-btn-hover-border-color: var(--tool-blue-dark); --bs-btn-active-bg: var(--tool-blue-dark); --bs-btn-active-border-color: var(--tool-blue-dark); box-shadow: 0 2px 5px rgba(0,0,0,.17); }
.form-control:focus, .form-check-input:focus { border-color: #85afce; box-shadow: 0 0 0 .2rem rgba(49,102,142,.15); }
.form-check-input:checked { background-color: var(--tool-blue); border-color: var(--tool-blue); }
/* Shared visual language with the homepage navigation; Bootstrap CSS remains scoped to Tools. */
.tool-header { background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); position: fixed; inset: 0 0 auto; z-index: 1000; }
.tool-nav-container { height: 64px; margin-inline: auto; display: flex; align-items: center; }
.brand { display: inline-flex; align-items: center; min-height: 64px; flex: 0 0 auto; }
.brand img { display: block; width: 50px; height: auto; }
.tool-site-menu { height: 64px; }
.tool-site-link { display: inline-flex; height: 64px; align-items: center; gap: .35rem; padding: 0 15px; color: var(--tool-blue); font-family: inherit; font-size: 1rem; font-weight: 400; line-height: 64px; text-decoration: none; white-space: nowrap; }
.tool-site-link:hover, .tool-site-link:focus-visible { background: rgba(0,0,0,.075); color: var(--tool-blue-dark); }
.tool-nav-dropdown { position: relative; height: 64px; }
.tool-dropdown-toggle { appearance: none; background: transparent; border: 0; cursor: pointer; }
.tool-dropdown-toggle i { font-size: .73rem; margin-left: .4rem; }
.tool-dropdown-toggle[aria-expanded="true"] { background: rgba(0,0,0,.075); }
.tool-nav-dropdown-menu { list-style: none; position: absolute; right: 0; top: 64px; min-width: 230px; max-height: calc(100vh - 72px); overflow-y: auto; margin: 0; padding: 0; background: #fff; box-shadow: 0 3px 9px rgba(0,0,0,.24); z-index: 1010; }
.tool-nav-dropdown-menu li { margin: 0; padding: 0; }
.tool-nav-dropdown-menu a { display: block; padding: 14px 18px; color: var(--tool-blue); text-decoration: none; font-size: 1rem; line-height: 1.35; white-space: nowrap; }
.tool-nav-dropdown-menu a:hover, .tool-nav-dropdown-menu a:focus-visible { background: #eee; color: var(--tool-blue-dark); }
.tool-nav-dropdown-menu a[aria-current="page"] { font-weight: 600; }
.tool-nav-vr { display: inline-block; width: 1px; height: 1.2rem; margin: 0 .35rem; background: currentColor; color: var(--tool-blue); opacity: .35; }
.tool-lang { display: inline-flex; align-items: center; height: 64px; padding: 0 .5rem; font-family: inherit; font-size: .85rem; font-weight: 600; color: var(--tool-blue); text-decoration: none; white-space: nowrap; }
.tool-lang:hover { color: var(--tool-blue-dark); }
.tool-lang.active { color: var(--tool-blue-dark); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .3rem; }
/* Keep hidden menus hidden even if Bootstrap display utility rules are present. */
.tool-header [hidden] { display: none !important; }
.tool-mobile-toggle, .tool-mobile-close { border: 0; background: transparent; color: var(--tool-blue); display: inline-flex; justify-content: center; align-items: center; cursor: pointer; }
.tool-mobile-toggle { height: 64px; width: 48px; font-size: 1.6rem; }
.tool-mobile-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 1015; }
.tool-mobile-panel { position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 88vw); overflow-y: auto; z-index: 1020; background: #fff; box-shadow: 2px 0 9px rgba(0,0,0,.25); }
.tool-mobile-panel-head { display: flex; align-items: center; justify-content: space-between; box-sizing: border-box; height: 64px; min-height: 64px; padding: 0 1rem 0 1.5rem; background: var(--tool-blue); }
.tool-mobile-monogram { display: block; width: 50px; height: 39px; filter: brightness(0) invert(1); }
.tool-mobile-close { position: static; display: inline-flex; flex: 0 0 40px; align-items: center; justify-content: center; width: 40px; height: 40px; margin: 0; padding: 0; font-size: 1.35rem; line-height: 1; color: #fff; }
.tool-mobile-close .bi { display: block; line-height: 1; }
@media (max-width: 600px) {
  .tool-mobile-panel-head { height: 56px; min-height: 56px; }
  .tool-nav-container, .brand, .tool-mobile-toggle { height: 56px; min-height: 56px; }
}
.tool-mobile-panel nav { display: flex; flex-direction: column; padding: .5rem 0; }
.tool-mobile-panel nav > a { display: block; padding: .85rem 1.5rem; font-size: 1rem; text-decoration: none; color: var(--tool-blue); }
.tool-mobile-panel nav > a:hover, .tool-mobile-panel nav > a:focus-visible { background: #eee; }
.tool-mobile-group summary { display: flex; align-items: center; justify-content: space-between; padding: .85rem 1.5rem; font-size: 1rem; color: var(--tool-blue); cursor: pointer; list-style: none; }
.tool-mobile-group summary::-webkit-details-marker { display: none; }
.tool-mobile-group summary:hover, .tool-mobile-group summary:focus-visible { background: #eee; }
.tool-mobile-group summary .bi { font-size: .75rem; }
.tool-mobile-group[open] summary .bi { transform: rotate(180deg); }
.tool-mobile-panel nav .tool-mobile-group > a { display: block; padding: .75rem 1.5rem .75rem 2.65rem; color: var(--tool-blue); text-decoration: none; font-size: .95rem; }
.tool-mobile-panel nav .tool-mobile-group > a:hover, .tool-mobile-panel nav .tool-mobile-group > a:focus-visible { background: #eee; }
.tool-mobile-sub-link[aria-current="page"] { font-weight: 600; }
.tool-mobile-language { display: flex; border-top: 1px solid #e5e5e5; margin-top: .7rem; padding: 0 1rem; gap: 1rem; }
.tool-mobile-language .tool-lang { height: 52px; }
/* Same locally hosted photograph as the existing portfolio header. Desktop has a restrained CSS parallax effect. */
.tool-parallax { background: #aaa url('../../../images/backgrounds/home.jpg') center center / cover no-repeat; background-attachment: fixed; }
.tool-main { position: relative; }
.tool-stage { position: relative; z-index: 1; margin-bottom: 3.5rem; }
.tool-page-card { background: var(--tool-paper); padding: clamp(1.35rem, 3.5vw, 3.5rem); box-shadow: 0 2px 5px rgba(0,0,0,.3); border-radius: 2px; }
.tool-section-title { display: flex; align-items: center; justify-content: center; gap: 1.4rem; }
.tool-section-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; background: var(--tool-blue); color: #fff; font-size: 1.65rem; box-shadow: 0 2px 5px rgba(0,0,0,.24); flex: 0 0 auto; }
.tool-section-word { font-size: clamp(1.65rem, 3vw, 2.2rem); font-weight: 600; line-height: 1.2; letter-spacing: -.025em; color: #616161; text-shadow: 2px 2px 4px rgba(0,0,0,.2); }
.tool-intro { border-bottom: 1px solid #e0e0e0; padding-bottom: 1.65rem; }
.tool-headline { font-size: clamp(1.45rem, 2.5vw, 2.05rem); font-weight: 600; letter-spacing: -.025em; color: #404040; }
.tool-intro .lead { font-size: 1.08rem; line-height: 1.65; }
.feature-card { background: #fff; border: 1px solid #dedede; border-radius: 2px; box-shadow: 0 1px 3px rgba(0,0,0,.08); border-top: 3px solid var(--tool-blue); transition: box-shadow .2s ease, transform .2s ease; }
.feature-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,.13); transform: translateY(-2px); }
.feature-icon { width: 3.4rem; height: 3.4rem; display: inline-grid; place-items: center; font-size: 1.5rem; color: #fff; background: var(--tool-blue); border-radius: 2px; box-shadow: 0 2px 4px rgba(0,0,0,.14); }
.feature-icon.subtle { background: #ededed; color: #6b747d; }
.future-card { border: 1px dashed #b9c3c9; background: #fafafa; border-radius: 2px; }
.privacy-tag { display: inline-flex; align-items: center; gap: .5rem; background: #edf4f6; color: #285b70; border-left: 3px solid var(--tool-blue); padding: .5rem .75rem; }
.editor-card { padding: 1.1rem; background: var(--tool-paper); border: 1px solid var(--tool-border); border-radius: 2px; box-shadow: 0 1px 4px rgba(0,0,0,.07); }
.breadcrumb { --bs-breadcrumb-divider-color: #a0a0a0; }
/* Dark Bootstrap footer, aligned with the Materialize homepage. */
.tool-footer { background: #18384f; color: #c7d7e1; margin-top: 2rem; padding-top: 3rem; font-family: 'Raleway', Arial, sans-serif; font-size: 15px; }
.tool-footer a { color: #dbe6ec; text-decoration: none; }
.tool-footer a:hover { color: #fff; text-decoration: underline; }
.tool-footer a:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.tool-footer .site-footer__top { padding-bottom: 2.25rem; }
.tool-footer .site-footer__identity { display: inline-flex; align-items: center; gap: 1rem; text-decoration: none; }
.tool-footer .site-footer__logo { box-sizing: border-box; display: inline-flex; flex: 0 0 52px; align-items: center; justify-content: center; width: 52px; height: 52px; border: 1px solid #8099a8; border-radius: 2px; }
.tool-footer .site-footer__logo img { display: block; filter: brightness(0) invert(1); }
.tool-footer .site-footer__name { display: block; color: #fff; font-size: 1.1rem; font-weight: 600; line-height: 1.45; }
.tool-footer .site-footer__role { display: block; color: #b6cdd9; font-size: .88rem; line-height: 1.5; }
.tool-footer .site-footer__heading { color: #fff; margin: .25rem 0 1rem; font-size: .9rem; font-weight: 600; line-height: 1.4; }
.tool-footer .site-footer__links { margin: 0; padding: 0; list-style: none; }
.tool-footer .site-footer__links li { margin: 0 0 .7rem; line-height: 1.45; }
.tool-footer .site-footer__external { font-size: .85em; opacity: .7; }
.tool-footer .site-footer__copyright { background: rgba(0,0,0,.14); color: #b6cdd9; font-size: .8rem; }
.tool-footer .site-footer__bottom { box-sizing: border-box; display: flex; justify-content: space-between; align-items: center; gap: .8rem 1.5rem; flex-wrap: wrap; padding-top: 1rem; padding-bottom: 1rem; }
.tool-footer .site-footer__heart { color: #ee9aab; margin: 0 .12rem; }
@media (max-width: 575.98px) {
  .tool-footer { padding-top: 2.25rem; }
  .tool-footer .site-footer__identity { margin-bottom: .35rem; }
  .tool-footer .site-footer__bottom { flex-direction: column; align-items: flex-start; }
}
.side-marker { display: inline-block; width: .53rem; height: .53rem; border-radius: 2px; background: #bd6269; margin-right: .45rem; }
.side-marker.new { background: #41946b; }
.code-editor { resize: vertical; min-height: 260px; font: 13.5px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; tab-size: 4; background: #fafcfd; border-color: #e1e7eb; }
/* Subtle feedback while a file is dragged over either Diff Checker editor. */
#diff-app .editor-card.diff-file-over .code-editor { border-color: var(--tool-blue); background-color: #eaf4f8; outline: 2px dashed var(--tool-blue); outline-offset: -6px; }
.upload-btn { cursor: pointer; white-space: nowrap; }
.action-bar { min-height: 44px; }
.results { scroll-margin-top: 1rem; }
.result-toolbar { background: #fff; border: 1px solid var(--tool-border); padding: .75rem .9rem; border-radius: 2px; }
.choice { font-size: .85rem; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: .3rem; }
.choice input { accent-color: var(--tool-blue); }
.toolbar-divider { height: 1.15rem; border-left: 1px solid var(--tool-border); }
.stat-chip { border: 1px solid var(--tool-border); border-radius: 20px; padding: .18rem .55rem; color: #5c6c79; }
.stat-chip.added { background: var(--tool-added); border-color: #cce9d5; color: #286646; }
.stat-chip.removed { background: var(--tool-removed); border-color: #f0d7dc; color: #9c3e4d; }
.diff-output { border: 1px solid var(--tool-border); border-radius: 2px; background: #fff; overflow: auto; min-height: 170px; max-height: 650px; }
.diff-line, .diff-cell { white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; }
.diff-row { display: grid; grid-template-columns: 45px 45px minmax(0, 1fr); border-bottom: 1px solid #f0f3f5; }
.diff-row:last-child { border-bottom: 0; }
.diff-row .line-number + .line-number { border-right: 1px solid #d9e2e8; }
.diff-row-heading { background: #f4f7f9; color: #647381; font-weight: 700; }
.diff-row-heading .diff-line { font-size: 12px; }
.line-number { text-align: right; padding: .19rem .65rem; color: #8b97a2; user-select: none; background: rgba(245,247,249,.65); border-right: 1px solid #e9edf0; font: 12px/1.8 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.diff-line { padding: .17rem .75rem; }
.diff-added { background: var(--tool-added); }
.diff-removed { background: var(--tool-removed); }
.diff-placeholder { background: #fafbfc; }
.diff-grid { min-width: 690px; }
.diff-grid-header, .diff-grid-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.diff-grid-header { position: sticky; top: 0; z-index: 1; background: #f4f7f9; border-bottom: 1px solid var(--tool-border); font-size: .77rem; font-weight: 700; color: #647381; }
.diff-grid-header > div { padding: .55rem 1rem; }
.diff-grid-header > div + div, .diff-grid-row > div + div { border-left: 1px solid var(--tool-border); }
.diff-grid-row { border-bottom: 1px solid #edf0f2; }
.diff-grid-row:last-child { border-bottom: 0; }
.diff-cell { display: grid; grid-template-columns: 45px minmax(0, 1fr); min-height: 26px; }
.diff-cell .diff-line { min-width: 0; }
.token-added { background: #a8dfbb; border-radius: 2px; text-decoration: none; }
.token-removed { background: #f1bbc4; border-radius: 2px; text-decoration: none; }
.empty-state { border: 1px dashed #d3dfe6; border-radius: 2px; background: #f9fbfc; color: var(--tool-blue); }
.skip-link { position: absolute; top: 0; left: 0; z-index: 2000; background: #fff; padding: 1rem; }
@media (max-width: 767.98px) { .tool-parallax { background-attachment: scroll; } .tool-stage { margin-bottom: 2rem; } .tool-section-title { gap: .85rem; } .tool-section-icon { width: 44px; height: 44px; font-size: 1.3rem; } .tool-menu { gap: .65rem !important; } .editor-card { padding: .85rem; } .result-toolbar { padding: .75rem; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .tool-parallax { background-attachment: scroll; } .feature-card { transition: none; } .feature-card:hover { transform: none; } }

body.tool-mobile-open { overflow: hidden; }

/* JSON / XML Formatter: the same stage geometry and editor language as Text Diff. */
.formatter-indent { width: auto; min-width: 9rem; }
.formatter-editor { min-height: 380px; }
.formatter-code { display: grid; grid-template-columns: 3.25rem minmax(0,1fr); position: relative; min-height: 380px; max-height: 620px; overflow: auto; background: #fafcfd; border: 1px solid #e1e7eb; border-radius: 2px; font: 13.5px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; tab-size: 4; }
.formatter-gutter { color: #86939e; text-align: right; user-select: none; padding: .75rem .55rem; border-right: 1px solid #e1e7eb; background: #f4f7f9; white-space: pre; }
.formatter-pre { margin: 0; padding: .75rem 1rem; min-width: max-content; font: inherit; line-height: inherit; color: #303b45; tab-size: 4; white-space: pre; }
.formatter-pre code { font: inherit; color: inherit; }
.formatter-placeholder { position: absolute; left: 3.25rem; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 1rem; color: #647381; text-align: center; font: 14px/1.55 system-ui, sans-serif; }
.formatter-code.has-output .formatter-placeholder { display: none; }
.formatter-code:not(.has-output) .formatter-gutter { visibility: hidden; }
.formatter-status { min-height: 2.5rem; padding: .7rem 1rem; background: #f4f7f9; border-left: 3px solid #91a5b5; color: #4b606f; }
.formatter-status.ok { background: #e8f5ee; border-left-color: #32815b; color: #286344; }
.formatter-status.error { background: #fdf0f1; border-left-color: #b64856; color: #873644; white-space: pre-wrap; }
.fmt-key { color: #7b43a6; } .fmt-string { color: #237449; } .fmt-number { color: #a05a14; } .fmt-keyword { color: #2865a3; font-weight: 600; }
.fmt-tag { color: #2b6893; } .fmt-attr { color: #8552a3; } .fmt-value { color: #237449; } .fmt-comment { color: #78838c; } .fmt-cdata { color: #916023; } .fmt-pi { color: #69769d; }
@media (max-width: 991.98px) { .formatter-editor { min-height: 260px; } .formatter-code { min-height: 280px; } }

/* Native, accessible validation dialog (Bootstrap alert inside; no JS bundle). */
.formatter-validation-dialog { border: 0; border-radius: 3px; padding: 0; width: min(92vw, 480px); max-height: 85vh; box-shadow: 0 18px 55px rgba(0,0,0,.27); color: #303b45; }
.formatter-validation-dialog::backdrop { background: rgba(18,31,42,.52); }
#formatter-validation-message { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Hex Viewer – same page geometry as Diff and Formatter; bounded virtual byte grid. */
.hex-drop { border: 1px dashed #9fb7c7; background: #f5f9fb; padding: 1.3rem; display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; color: var(--tool-blue); }
.hex-drop.dragover { background: #e3f2fb; border-color: var(--tool-blue); }
.hex-drop > div { flex: 1 1 13rem; }
.hex-facts { display: grid; grid-template-columns: minmax(7rem, 24%) minmax(0, 1fr); gap: .65rem 1rem; font-size: .88rem; overflow-wrap: anywhere; }
.hex-facts dt { color: #63717e; font-weight: 600; } .hex-facts dd { margin: 0; }
.hex-search-type { width: auto; flex: 0 0 9rem; } .hex-search-term { flex: 1 1 14rem; min-width: 10rem; }
.hex-table-scroller { height: 440px; border: 1px solid #e1e7eb; overflow: auto; background: #fafcfd; color: #33424e; }
.hex-table { min-width: 810px; font: 12.5px/30px ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; }
.hex-row { display: grid; grid-template-columns: 100px 1fr 160px; align-items: center; height: 30px; border-bottom: 1px solid #eaf0f3; }
.hex-row:nth-child(even) { background: rgba(245,248,250,.8); }
.hex-heading { position: sticky; top: 0; z-index: 2; background: #ecf2f6 !important; color: #506372; font-weight: 700; }
.hex-offset { background: #f1f5f8; border-right: 1px solid #dce5eb; color: #698092; padding: 0 9px; user-select: none; }
.hex-values { display: flex; gap: 13px; justify-content: center; padding: 0 10px; }
.hex-half { display: flex; gap: 7px; white-space: nowrap; }
.hex-byte { display: inline-block; min-width: 2ch; text-align: center; border-radius: 2px; cursor: pointer; }
.hex-ascii { display: flex; width: 100%; justify-content: flex-start; border-left: 1px solid #dce5eb; padding: 0 8px; white-space: pre; }
.hex-char { display: inline-block; min-width: 1ch; cursor: pointer; }
.hex-byte:hover,.hex-char:hover { background: #e0ebf3; }
.hex-byte.bom-byte,.hex-char.bom-byte { color: #7a4a9c; font-weight: 700; }
.hex-byte.match,.hex-char.match { background: #fff1b6; color: #574010; }
.hex-byte.selected,.hex-char.selected { background: var(--tool-blue); color: white; }
.hex-inspector-cell { border: 1px solid #e1e7eb; border-radius: 2px; padding: .5rem .65rem; background: #f8fafc; display: flex; flex-direction: column; gap: .25rem; min-height: 64px; }
.hex-inspector-cell span { color: #687b8b; font-size: .77rem; } .hex-inspector-cell strong { font: 600 .92rem/1.4 ui-monospace,Consolas,monospace; overflow-wrap: anywhere; }
#hex-workspace[hidden], #hex-cancel[hidden] { display: none !important; }
@media (max-width: 767.98px) { .hex-drop { padding: 1rem; } .hex-facts { grid-template-columns: 1fr; gap: .2rem; } .hex-facts dd { margin-bottom: .35rem; } }

/* HTML Beautifier: independent preview with the exact same Tools stage geometry. */
.html-preview-shell { position: relative; width: 100%; padding: 12px; min-height: 365px; border: 1px solid var(--tool-border); background: #edf1f4; overflow: auto; display: flex; justify-content: center; align-items: stretch; }
.html-preview-shell iframe { display: block; width: 100%; height: 360px; background: #fff; border: 1px solid #d9e1e6; box-shadow: 0 1px 5px rgba(0,0,0,.07); transition: width .15s ease; }
.html-preview-shell.mobile iframe { width: min(100%, 375px); }
.html-preview-placeholder { position: absolute; inset: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fff; text-align: center; color: #657889; pointer-events: none; }
.html-preview-shell.has-preview .html-preview-placeholder { display: none; }
@media (max-width: 767.98px) { .html-preview-shell { padding: 8px; } .html-preview-shell iframe { height: 310px; } }

/* Base64 Studio — shared Tools controls, bounded non-executable previews. */
.tool-stage-base64 [hidden] { display: none !important; }
.b64-text-preview, .b64-hex-preview { background: #fafcfd; border: 1px solid #e1e7eb; padding: 1rem; max-height: 420px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #33424e; }
.b64-hex-preview { white-space: pre; overflow-x: auto; }
.b64-image-preview { border: 1px solid #e1e7eb; background: #edf1f4; min-height: 170px; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.b64-image-preview img { display: block; max-width: 100%; max-height: 420px; object-fit: contain; background: #fff; }
.b64-html-shell iframe { pointer-events: none; }

/* Image Metadata Viewer — local-only raster preview, metadata groups and lossless cleaning controls. */
.tool-stage-metadata [hidden] { display: none !important; }
.metadata-drop { border: 1px dashed #9fb7c7; background: #f5f9fb; padding: 1.3rem; display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; color: var(--tool-blue); }
.metadata-drop.dragover { background: #e3f2fb; border-color: var(--tool-blue); }
.metadata-drop > div { flex: 1 1 18rem; }
.metadata-status { min-height: 2.5rem; padding: .7rem 1rem; background: #f4f7f9; border-left: 3px solid #91a5b5; color: #4b606f; }
.metadata-status.text-success { background: #e8f5ee; border-left-color: #32815b; color: #286344 !important; }
.metadata-status.text-danger { background: #fdf0f1; border-left-color: #b64856; color: #873644 !important; }
.metadata-preview { position: relative; min-height: 330px; background: #edf1f4; border: 1px solid #d9e1e6; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.metadata-preview img { display: block; max-width: 100%; max-height: 520px; object-fit: contain; background: #fff; }
.metadata-preview-placeholder { min-height: 330px; width: 100%; padding: 1.25rem; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #657889; text-align: center; }
.metadata-file-facts { display: grid; grid-template-columns: minmax(6.5rem, 28%) minmax(0, 1fr); gap: .45rem .9rem; overflow-wrap: anywhere; }
.metadata-file-facts dt { color: #63717e; font-weight: 600; }
.metadata-file-facts dd { margin: 0; }
.metadata-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.metadata-summary-item { display: grid; grid-template-columns: 2rem minmax(0,1fr); gap: .65rem; align-items: start; padding: .8rem .9rem; background: #f8fafb; border: 1px solid #e2e8ec; min-height: 76px; }
.metadata-summary-item > .bi { color: var(--tool-blue); font-size: 1.15rem; margin-top: .08rem; }
.metadata-summary-label { color: #6b7984; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .035em; margin-bottom: .18rem; }
.metadata-summary-value { color: #2f3d47; font-size: .9rem; line-height: 1.45; overflow-wrap: anywhere; }
.metadata-location { padding: .9rem 1rem; border-left: 3px solid var(--tool-blue); background: #edf4f6; }
.metadata-option { height: 100%; padding: .8rem .8rem .8rem 2.2rem; border: 1px solid #dde5ea; background: #fafcfd; border-radius: 2px; }
.metadata-option .form-check-input { margin-left: -1.35rem; }
.metadata-option-disabled { opacity: .48; background: #f4f5f6; }
.metadata-toolbar { flex: 0 1 auto; }
.metadata-search-wrap { width: min(100%, 18rem); }
.metadata-group { border: 1px solid #dfe6ea; background: #fff; margin-bottom: .75rem; }
.metadata-group > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; padding: .8rem 1rem; background: #f5f8fa; color: #3c4b57; font-weight: 700; user-select: none; }
.metadata-group > summary::-webkit-details-marker { display: none; }
.metadata-group > summary::before { content: '\F285'; font-family: 'bootstrap-icons'; color: #687c8b; margin-right: .55rem; font-weight: 400; transition: transform .15s ease; }
.metadata-group[open] > summary::before { transform: rotate(90deg); }
.metadata-group > summary > span:first-child { margin-right: auto; }
.metadata-group-count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.8rem; height: 1.45rem; padding: 0 .38rem; border: 1px solid #d1dce3; border-radius: 999px; background: #fff; color: #6b7a86; font-size: .72rem; font-weight: 700; }
.metadata-table { table-layout: fixed; }
.metadata-table th:first-child { width: min(34%, 18rem); }
.metadata-table th, .metadata-table td { padding: .58rem .75rem; vertical-align: top; overflow-wrap: anywhere; }
.metadata-table tbody th { color: #536675; font: 600 .79rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #fbfcfd; }
.metadata-table tbody td { color: #33424e; font-size: .84rem; line-height: 1.55; }
.metadata-raw { color: #75828d; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .74rem; }
@media (max-width: 767.98px) {
  .metadata-drop { padding: 1rem; }
  .metadata-preview, .metadata-preview-placeholder { min-height: 240px; }
  .metadata-summary-grid { grid-template-columns: 1fr; }
  .metadata-file-facts { grid-template-columns: 1fr; gap: .12rem; }
  .metadata-file-facts dd { margin-bottom: .35rem; }
  .metadata-toolbar, .metadata-search-wrap { width: 100%; }
  .metadata-table { min-width: 660px; }
  .metadata-table th:first-child { width: 14rem; }
}

/* PDF tools — merge: clear mobile controls and an accessible, reorderable file list. */
.tool-stage-pdf [hidden] { display: none !important; }
.pdf-merge-drop { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 2rem 1rem; border: 2px dashed #b4c8d5; background: #f5f9fb; color: #335e78; transition: border-color .15s ease, background .15s ease; }
.pdf-merge-drop.is-over, .pdf-merge-drop:focus-within { border-color: var(--tool-blue); background: #eaf3f8; }
.pdf-merge-drop.is-busy { opacity: .65; pointer-events: none; }
.pdf-merge-drop-icon { display: block; font-size: 2.6rem; margin-bottom: .35rem; }
.pdf-merge-drop label { cursor: pointer; }
.pdf-merge-drop .visually-hidden:focus-visible + span { outline: 2px solid var(--tool-blue); }
.pdf-merge-empty { text-align: center; padding: 2.3rem 1rem; border: 1px dashed #cbd7de; background: #fafcfd; }
.pdf-merge-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .55rem; }
.pdf-merge-item { display: flex; align-items: center; min-width: 0; gap: .8rem; padding: .8rem; border: 1px solid #dce5ea; background: #fff; transition: background .15s ease, border-color .15s ease; }
.pdf-merge-item.is-over { background: #edf5fa; border-color: var(--tool-blue); }
.pdf-merge-item.is-dragging { opacity: .48; }
.pdf-merge-grip { color: #8699a5; font-size: 1.2rem; cursor: grab; }
.pdf-merge-number { display: inline-grid; place-items: center; flex: 0 0 1.65rem; width: 1.65rem; height: 1.65rem; border-radius: 50%; background: #e8f0f5; color: #315f7c; font-weight: 700; font-size: .76rem; }
.pdf-merge-file-icon { color: #bb5050; font-size: 1.6rem; }
.pdf-merge-file-info { min-width: 0; flex: 1 1 auto; }
.pdf-merge-file-title { font-weight: 600; color: #354750; overflow-wrap: anywhere; }
.pdf-merge-actions { display: flex; align-items: center; gap: .3rem; margin-left: auto; }
.pdf-merge-control { width: 2.1rem; height: 2.1rem; display: grid; place-items: center; padding: 0; }
.pdf-merge-summary { padding: .7rem .9rem; background: #f5f8fa; border: 1px solid #e1e8ec; }
.pdf-merge-status { min-height: 2.5rem; padding: .7rem 1rem; background: #f4f7f9; border-left: 3px solid #91a5b5; color: #4b606f; overflow-wrap: anywhere; }
.pdf-merge-status.is-success { background: #e8f5ee; border-left-color: #32815b; color: #286344; }
.pdf-merge-status.is-error { background: #fdf0f1; border-left-color: #b64856; color: #873644; }
@media (max-width: 575.98px) {
  .pdf-merge-item { gap: .5rem; padding: .65rem .5rem; flex-wrap: wrap; }
  .pdf-merge-grip { display: none; }
  .pdf-merge-file-icon { font-size: 1.3rem; }
  .pdf-merge-file-info { flex-basis: calc(100% - 5.5rem); }
  .pdf-merge-actions { flex: 1 0 100%; justify-content: flex-end; }
  .pdf-merge-control { min-width: 2.4rem; min-height: 2.4rem; }
}
