/* ==========================================================================
   File-Extension.com — shared stylesheet
   Clean, card-based, fast-loading reference design (calculatorplus.com-style)
   ========================================================================== */

:root {
  --blue-600: #1a56db;
  --blue-700: #1544ad;
  --blue-50: #eef4ff;
  --ink-900: #101828;
  --ink-700: #344054;
  --ink-500: #667085;
  --line: #e4e7ec;
  --card-bg: #ffffff;
  --page-bg: #f7f9fc;
  --green-600: #0a8a4a;
  --green-50: #e9f9f0;
  --amber-600: #b54708;
  --amber-50: #fff6ed;
  --red-600: #b42318;
  --red-50: #fef3f2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --max: 1080px;
}

* { box-sizing: border-box; }

/* The hidden attribute must always win over a class's own `display` rule
   (e.g. .apk-progress sets display:flex for when it's shown). */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  color: var(--ink-700);
  background: var(--page-bg);
  line-height: 1.6;
  font-size: 16px;
}

img { max-width: 100%; display: block; }

a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  color: var(--ink-900);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.6em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; margin-top: 2.2em; }
h3 { font-size: 1.1rem; margin-top: 1.6em; }

p { margin: 0 0 1em; }

ul, ol { margin: 0 0 1.2em; padding-left: 1.4em; }
li { margin-bottom: 0.4em; }

code {
  background: #f2f4f7;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-size: 0.9em;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- header ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink-900);
  white-space: nowrap;
}
.logo span { color: var(--blue-600); }
.logo:hover { text-decoration: none; }

.site-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}
.site-search input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--page-bg) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23667085' stroke-width='2'><circle cx='6.5' cy='6.5' r='5'/><path d='M10.5 10.5 15 15' stroke-linecap='round'/></svg>") no-repeat 12px center;
}
.site-search input:focus { outline: 2px solid var(--blue-600); background-color: #fff; }

.main-nav {
  display: flex;
  gap: 18px;
  margin-left: auto;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}
.main-nav a { color: var(--ink-700); }
.main-nav a:hover { color: var(--blue-600); text-decoration: none; }

/* ---------- breadcrumb ---------- */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--ink-500);
  margin: 18px 0;
}
.breadcrumb a { color: var(--ink-500); }
.breadcrumb a:hover { color: var(--blue-600); }
.breadcrumb .sep { margin: 0 6px; }

/* ---------- hero / page head ---------- */
.ext-hero {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 28px 24px;
  margin-bottom: 24px;
  display: flex;
  gap: 22px;
  align-items: flex-start;
}

.ext-badge {
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  border-radius: 14px;
  background: var(--blue-50);
  color: var(--blue-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border: 1px solid #d5e3fd;
}

.ext-hero h1 { margin-bottom: 6px; }
.ext-hero .dek { color: var(--ink-500); font-size: 1.02rem; margin: 0; }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.pill {
  display: inline-block;
  background: var(--blue-50);
  color: var(--blue-700);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ---------- layout: content + sidebar ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 28px;
  margin-bottom: 22px;
}

/* table of contents */
.toc {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 22px;
  margin-bottom: 24px;
}
.toc h2 { margin: 0 0 10px; font-size: 1rem; }
.toc ol { columns: 2; column-gap: 24px; margin: 0; padding-left: 1.2em; font-size: 0.92rem; }
@media (max-width: 640px) { .toc ol { columns: 1; } }

/* sidebar */
.side-card { position: sticky; top: 84px; }
.side-card h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-500);
  margin-top: 0;
}
.side-card ul { list-style: none; padding: 0; margin: 0 0 18px; }
.side-card ul li { margin-bottom: 8px; font-size: 0.92rem; }
.side-card ul li:last-child { margin-bottom: 0; }

/* callouts */
.callout {
  border-radius: 8px;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 0.95rem;
}
.callout-safe { background: var(--green-50); border: 1px solid #b7ebc9; color: #06603a; }
.callout-warn { background: var(--amber-50); border: 1px solid #f7d0a4; color: #93370d; }
.callout-danger { background: var(--red-50); border: 1px solid #f6c0bb; color: #91221a; }
.callout strong { color: inherit; }

/* step list */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 1.2em; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 40px;
  margin-bottom: 14px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 26px; height: 26px;
  background: var(--blue-600);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

/* platform tabs (static, CSS-only anchor cards) */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 18px 0 8px;
}
.platform-link {
  display: block;
  background: var(--blue-50);
  border: 1px solid #d5e3fd;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 700;
  color: var(--blue-700);
  text-align: center;
  font-size: 0.92rem;
}
.platform-link:hover { background: #e0ebff; text-decoration: none; }

/* table */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0 1.6em;
  font-size: 0.93rem;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
th { color: var(--ink-900); background: #f9fafb; font-weight: 700; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item h3 { margin: 0 0 8px; font-size: 1rem; }
.faq-item p { margin: 0; color: var(--ink-700); }

/* related grid on homepage / hub */
.ext-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.ext-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.ext-card .ext-name { font-weight: 800; color: var(--ink-900); }
.ext-card p { margin: 4px 0 0; font-size: 0.88rem; color: var(--ink-500); }

/* homepage hero */
.home-hero {
  text-align: center;
  padding: 56px 20px 40px;
}
.home-hero h1 { font-size: 2.1rem; }
.home-hero p { color: var(--ink-500); max-width: 640px; margin: 0 auto 24px; }
.home-search {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}
.home-search input {
  width: 100%;
  padding: 14px 18px 14px 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 1.05rem;
  box-shadow: var(--shadow);
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23667085' stroke-width='2'><circle cx='7' cy='7' r='5.5'/><path d='M11.5 11.5 16 16' stroke-linecap='round'/></svg>") no-repeat 16px center;
}
.home-search input:focus { outline: 2px solid var(--blue-600); }

/* footer */
.site-footer {
  background: #101828;
  color: #cbd2e0;
  margin-top: 48px;
  padding: 40px 0 24px;
  font-size: 0.9rem;
}
.site-footer a { color: #cbd2e0; }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}
.footer-grid h4 {
  color: #fff;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-bottom {
  border-top: 1px solid #1d2939;
  padding-top: 18px;
  color: #98a2b3;
  font-size: 0.82rem;
}

main { display: block; padding: 24px 0 48px; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   APK Opener tool
   ========================================================================== */

.apk-opener-card {
  border: 1px solid #d5e3fd;
  background: linear-gradient(180deg, #f7faff 0%, #ffffff 140px);
}
.apk-opener-card h2 { margin-top: 0; }
.apk-opener-intro { color: var(--ink-500); margin-bottom: 18px; }

.privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--green-600);
  background: var(--green-50);
  border: 1px solid #b7ebc9;
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 18px;
}

.apk-dropzone {
  border: 2px dashed #b9cdf7;
  border-radius: 12px;
  background: #fff;
  text-align: center;
  padding: 40px 20px;
  transition: border-color 0.15s, background 0.15s;
}
.apk-dropzone.dragover {
  border-color: var(--blue-600);
  background: var(--blue-50);
}
.apk-dropzone-label {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.apk-dropzone-icon {
  width: 44px; height: 44px;
  color: var(--blue-600);
}
.apk-dropzone-label strong { color: var(--ink-900); }
.apk-dropzone-sub { font-size: 0.85rem; color: var(--ink-500); margin: 0; }

.apk-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 4px;
  color: var(--ink-700);
  font-weight: 600;
}
.apk-spinner {
  width: 22px; height: 22px;
  border: 3px solid var(--blue-50);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: apk-spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes apk-spin { to { transform: rotate(360deg); } }

.apk-results-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.apk-icon-wrap {
  width: 56px; height: 56px;
  border-radius: 12px;
  background: var(--blue-50);
  border: 1px solid #d5e3fd;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.apk-icon-wrap img { width: 100%; height: 100%; object-fit: contain; }
.apk-icon-fallback { font-size: 1.4rem; }
#apk-app-label { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; flex: 1; min-width: 140px; }
.apk-reset-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-700);
  cursor: pointer;
  flex-shrink: 0;
}
.apk-reset-btn:hover { background: var(--page-bg); }

.apk-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.apk-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 4px;
  margin-right: 18px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-500);
  cursor: pointer;
}
.apk-tab.active { color: var(--blue-600); border-bottom-color: var(--blue-600); }
.apk-tab:hover { color: var(--blue-700); }

.apk-panel { display: none; }
.apk-panel.active { display: block; }

#apk-summary-table th { width: 42%; }
#apk-summary-table td { overflow-wrap: anywhere; }

.apk-perm-list {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 2;
  column-gap: 20px;
}
.apk-perm-list li { font-size: 0.88rem; margin-bottom: 6px; break-inside: avoid; }
@media (max-width: 640px) { .apk-perm-list { columns: 1; } }

.apk-file-filter {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.92rem;
  margin-bottom: 12px;
}
.apk-file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.apk-file-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--line);
  margin: 0;
}
.apk-file-list li:last-child { border-bottom: none; }
.apk-file-path {
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  word-break: break-all;
  color: var(--ink-700);
}
.apk-file-size { color: var(--ink-500); white-space: nowrap; flex-shrink: 0; }
.apk-file-list-note { font-size: 0.82rem; color: var(--ink-500); margin-top: 8px; }

.apk-manifest-pre {
  background: #101828;
  color: #d0f4de;
  padding: 16px 18px;
  border-radius: 8px;
  font-size: 0.82rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.apk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.btn {
  display: inline-block;
  background: var(--blue-600);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover { background: var(--blue-700); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-secondary {
  background: #fff;
  color: var(--blue-700);
  border: 1px solid #b9cdf7;
}
.btn-secondary:hover { background: var(--blue-50); }

.btn-mini {
  background: var(--blue-50);
  color: var(--blue-700);
  border: 1px solid #d5e3fd;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-mini:hover { background: #e0ebff; }
.btn-mini:disabled { opacity: 0.6; cursor: default; }

.xapk-obb-section { margin-top: 20px; }
.xapk-obb-section h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-500); margin: 0 0 8px; }

.password-wrap {
  background: var(--amber-50);
  border: 1px solid #f7d0a4;
  border-radius: 10px;
  padding: 20px 22px;
  margin-top: 4px;
}
.password-wrap p { margin: 0 0 12px; color: #93370d; font-weight: 600; }
.password-row { display: flex; gap: 10px; flex-wrap: wrap; }
.password-row input[type="password"] {
  flex: 1;
  min-width: 180px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
}

.bin-detection-note {
  font-size: 0.9rem;
  color: var(--ink-700);
  background: var(--blue-50, #eff6ff);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 14px;
}
.hex-pre {
  white-space: pre;
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.5;
}
.hex-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.hex-nav-info {
  font-size: 0.82rem;
  color: var(--ink-500);
  flex: 1 1 auto;
  min-width: 180px;
}
.hex-jump {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hex-jump input {
  width: 110px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
}

.pdf-viewer-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.pdf-viewer-nav .pdf-page-info {
  font-size: 0.85rem;
  color: var(--ink-500);
  white-space: nowrap;
}
.pdf-page-jump {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pdf-page-jump input {
  width: 64px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: center;
}
.pdf-zoom-group {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.pdf-zoom-group span {
  font-size: 0.82rem;
  color: var(--ink-500);
  min-width: 44px;
  text-align: center;
}
.pdf-canvas-wrap {
  background: #4b5563;
  border-radius: 10px;
  padding: 20px;
  display: flex;
  justify-content: center;
  overflow: auto;
  max-height: 640px;
}
#pdf-canvas {
  background: #fff;
  box-shadow: 0 4px 18px rgba(0,0,0,0.25);
  max-width: 100%;
  height: auto;
}
.pdf-thumb-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 2px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}
.pdf-thumb {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-700);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.pdf-thumb.active {
  border-color: var(--blue-600);
  background: var(--blue-600);
  color: #fff;
}
.pdf-thumb-note {
  flex: 0 0 auto;
  align-self: center;
  font-size: 0.78rem;
  color: var(--ink-500);
  white-space: nowrap;
}
.pdf-text-output {
  max-height: 480px;
  overflow-y: auto;
}
.pdf-text-status {
  font-size: 0.82rem;
  color: var(--ink-500);
  margin-bottom: 10px;
}

.dl-rename-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--green-50, #f0fdf4);
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 14px;
}
.dl-rename-preview {
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 0.82rem;
  color: var(--ink-700);
  word-break: break-all;
}

.py-source-pre {
  max-height: 480px;
  overflow-y: auto;
  white-space: pre;
  tab-size: 4;
}
.py-lineno {
  display: inline-block;
  width: 3ch;
  margin-right: 14px;
  color: #6b7788;
  user-select: none;
  text-align: right;
}
.py-kw { color: #7dd3fc; font-weight: 600; }
.py-str { color: #86efac; }
.py-comment { color: #94a3b8; font-style: italic; }

.py-run-status {
  font-size: 0.85rem;
  color: var(--ink-500);
  margin-bottom: 10px;
}
.py-run-output {
  max-height: 360px;
  overflow-y: auto;
  min-height: 60px;
}

.jpg-preview-wrap {
  display: flex;
  justify-content: center;
  background: repeating-conic-gradient(#f1f3f5 0% 25%, #ffffff 0% 50%) 50% / 20px 20px;
  border: 1px solid var(--ink-100, #e5e7eb);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}
.jpg-preview-wrap img {
  max-width: 100%;
  max-height: 420px;
  border-radius: 6px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.12);
}
.jpg-gps-warning {
  margin-top: 14px;
}
.jpg-gps-warning strong.jpg-coords {
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
}
.jpg-exif-note {
  color: var(--ink-500);
  font-size: 0.9rem;
  margin-top: 10px;
}
.jpg-download-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tmp-text-pre {
  max-height: 420px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.tmp-text-note {
  color: var(--ink-500);
  font-size: 0.9rem;
}

.xlsx-sheet-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin: 14px 0 10px;
  border-bottom: 1px solid var(--ink-100, #e5e7eb);
  padding-bottom: 2px;
}
.xlsx-sheet-tab {
  flex: 0 0 auto;
  background: var(--ink-50, #f8fafc);
  border: 1px solid var(--ink-100, #e5e7eb);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--ink-500);
}
.xlsx-sheet-tab.active {
  background: #fff;
  color: var(--blue-600, #1a56db);
  font-weight: 600;
  border-color: var(--blue-600, #1a56db);
}
.xlsx-table-wrap {
  max-height: 480px;
  overflow: auto;
  border: 1px solid var(--ink-100, #e5e7eb);
  border-radius: 8px;
}
table.xlsx-grid {
  border-collapse: collapse;
  font-size: 0.82rem;
  width: max-content;
  min-width: 100%;
}
table.xlsx-grid th, table.xlsx-grid td {
  border: 1px solid var(--ink-100, #e5e7eb);
  padding: 4px 10px;
  white-space: nowrap;
  text-align: left;
}
table.xlsx-grid thead th {
  background: var(--ink-50, #f8fafc);
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--ink-500);
  font-weight: 600;
  text-align: center;
}
table.xlsx-grid tbody th {
  background: var(--ink-50, #f8fafc);
  color: var(--ink-500);
  font-weight: 600;
  text-align: center;
  position: sticky;
  left: 0;
}
table.xlsx-grid th.xlsx-corner {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 2;
}
.xlsx-trunc-note {
  color: var(--ink-500);
  font-size: 0.85rem;
  margin-top: 8px;
}

.heic-preview-wrap {
  display: flex;
  justify-content: center;
  background: repeating-conic-gradient(#f1f3f5 0% 25%, #ffffff 0% 50%) 50% / 20px 20px;
  border: 1px solid var(--ink-100, #e5e7eb);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}
.heic-preview-wrap img {
  max-width: 100%;
  max-height: 420px;
  border-radius: 6px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.12);
}
.heic-preview-unsupported {
  padding: 4px 2px;
}
.heic-download-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- JSON opener tool ---- */

.json-error-snippet {
  background: #101828;
  color: #ffb4b0;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  overflow-x: auto;
  white-space: pre;
  margin: 10px 0 0;
  line-height: 1.5;
}

.json-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.json-search-input {
  flex: 1 1 220px;
  min-width: 160px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.88rem;
}
.json-search-status {
  font-size: 0.8rem;
  color: var(--ink-500);
  white-space: nowrap;
}

.json-tree-wrap {
  max-height: 480px;
  overflow: auto;
  border: 1px solid var(--ink-100, #e5e7eb);
  border-radius: 8px;
  padding: 10px 4px;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 0.84rem;
  background: #fff;
}
.json-tree-trunc-note {
  color: var(--ink-500);
  font-size: 0.85rem;
  margin-top: 8px;
}

.json-tree-row {
  position: relative;
  padding: 1px 0 1px 18px;
  line-height: 1.65;
}
.json-tree-row .json-children {
  padding-left: 16px;
  border-left: 1px dashed var(--ink-100, #e2e8f0);
  margin-left: 4px;
}
.json-tree-row.collapsed > .json-children { display: none; }
.json-tree-row.collapsed > .json-summary .json-count { display: inline; }
.json-tree-row:not(.collapsed) > .json-summary .json-bracket-close-inline { display: none; }
.json-tree-row.collapsed > .json-summary .json-bracket-close-inline { display: inline; }

.json-toggle {
  position: absolute;
  left: -4px;
  top: 0;
  width: 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-500);
  font-size: 0.72rem;
  padding: 0;
  line-height: 1.65;
}
.json-toggle:hover { color: var(--blue-600); }

.json-summary { cursor: default; }
.json-key { color: #9a3412; }
.json-colon { color: var(--ink-500); margin-right: 4px; }
.json-bracket { color: var(--ink-500); font-weight: 700; }
.json-count {
  display: none;
  color: var(--ink-500);
  font-style: italic;
  font-size: 0.8rem;
  margin: 0 4px;
}
.json-tree-row.collapsed > .json-summary .json-count { display: inline; }

.json-string { color: #0f7b3f; }
.json-number { color: #1a56db; }
.json-boolean { color: #a12ec2; }
.json-null { color: var(--ink-500); font-style: italic; }

.json-match { background: #fff6b7; border-radius: 4px; }
.json-dimmed { opacity: 0.35; }

.json-formatted-pre, .json-minified-pre {
  background: #101828;
  color: #e6edf7;
  padding: 16px 18px;
  border-radius: 8px;
  font-size: 0.82rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  overflow-y: auto;
}
.json-formatted-pre .json-string, .json-minified-pre .json-string { color: #7ee787; }
.json-formatted-pre .json-number, .json-minified-pre .json-number { color: #79c0ff; }
.json-formatted-pre .json-boolean, .json-minified-pre .json-boolean { color: #d2a8ff; }
.json-formatted-pre .json-null, .json-minified-pre .json-null { color: #8b949e; }
.json-formatted-pre .json-key, .json-minified-pre .json-key { color: #ffa657; }
