.tool-page {
  --paper: #f0f1f2;
  --ink: #243440;
  --muted: #5e6f7b;
  --accent: #416b87;
  --line: #d4dde3;
  --soft: #e3e9ed;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.tool-page [hidden] { display: none !important; }
.tool-page .wrap { width: 100%; max-width: none; margin-inline: 0; padding-inline: clamp(32px, 2.5vw, 48px); }
.tool-page .nav { height: 64px; min-height: 64px; border-bottom: 1px solid var(--line); gap: 16px; background: var(--soft); }
.tool-page .nav .brand { font-size: 21px; letter-spacing: -.8px; }
.tool-page .language select { min-height: 44px; max-width: 140px; font-size: 13px; padding: 8px; }
.tool-page :is(a, button, input, select, summary):focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.tool-page .tool-main { flex: 1 0 auto; display: grid; align-items: center; padding-block: 32px; }
.tool-page .tool-scene { width: 100%; max-width: none; margin-inline: 0; padding-block: 16px; min-width: 0; }
.tool-page .dropzone { display: flex; flex-direction: column; gap: 16px; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; text-align: center; }
.tool-page .dropzone.dragover { background: none; }
.tool-page .dropzone.dragover .choose-files { background: #edf3f7; border-color: #243440; outline: 3px solid var(--accent); outline-offset: 4px; }
.tool-page .choose-files { width: 100%; min-height: 240px; border: 2px solid var(--accent); border-radius: 10px; background: #fff; color: var(--ink); display: flex; flex-direction: row; align-items: center; justify-content: center; gap: clamp(24px, 4vw, 72px); padding: 24px; font-size: 20px; font-weight: 650; line-height: 1.5; text-align: center; transition: background .15s; }
.tool-page .choose-files:hover:not(:disabled) { background: #f5f8fa; }
.tool-page .choose-files:active:not(:disabled) { background: #edf3f7; }
.tool-page .choose-files:disabled { opacity: 1; cursor: not-allowed; background: #f6f8f9; border-color: #8b9eac; color: #4b606e; }
.tool-page .choose-copy { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.tool-page .choose-action { display: inline-block; border-radius: 8px; background: var(--accent); color: #fff; padding: 10px 18px; }
.tool-page .choose-files:disabled .choose-action { background: #dce4e9; color: #4b606e; }
.tool-page .choose-hint { font-size: 15px; font-weight: 400; color: var(--muted); }
.tool-page .choose-art { display: block; width: 420px; height: 150px; max-width: 100%; object-fit: contain; flex: 0 1 420px; pointer-events: none; }
.tool-page .choose-media { width: 100%; min-height: 56px; border: 2px solid var(--accent); border-radius: 10px; background: #fff; color: var(--accent); font-size: 17px; font-weight: 650; cursor: pointer; transition: background .15s; }
.tool-page .choose-media:hover:not(:disabled) { background: #f5f8fa; }
.tool-page .choose-media:active:not(:disabled) { background: #edf3f7; }
.tool-page .choose-media:disabled { opacity: 1; cursor: not-allowed; background: #f6f8f9; border-color: #8b9eac; color: #4b606e; }
.tool-page .tool-instruction h1, .tool-page .tool-download > h1, .tool-page h2 { font-size: 30px; line-height: 1.3; letter-spacing: -.8px; margin: 0 0 12px; max-width: none; }
.tool-page h2 { font-size: 24px; }
.tool-page .tool-instruction h1 { margin-bottom: 0; }
.tool-page .tool-limits { font-size: 13px; line-height: 1.8; color: var(--muted); margin: 0; }
.tool-page .tool-panel { width: 100%; max-width: none; margin-inline: 0; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-width: 0; }
.tool-page .tool-panel h2 { margin-bottom: 20px; }
.tool-page .file-list { max-height: 240px; margin-block: 0 24px; }
.tool-page .file-list li { font-size: 14px; }
.tool-page .file-list small { font-size: 12px; }
.tool-page .file-list .filename { unicode-bidi: isolate; }
.tool-page .file-list a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: underline; }
.tool-page .progress-details { gap: 12px; font-size: 12px; flex-wrap: wrap; }
.tool-page progress { display: block; height: 10px; }
.tool-page .button { font-size: 14px; min-height: 46px; white-space: normal; text-align: center; }
.tool-page .primary { background: var(--accent); color: #fff; }
.tool-page .primary:hover { background: #34566d; }
.tool-page .text-button { min-height: 44px; font-size: 14px; padding: 10px 6px; }
.tool-page input:not([type=file]) { min-height: 48px; font-size: 15px; background: #f6f8f9; border-color: #8b9eac; }
.tool-page .muted { font-size: 13px; margin-block: 12px 0; }
.tool-page .tool-copy-status { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.tool-page .tool-copy-status:empty { display: none; }
.tool-page .storage-status { color: #795329; background: #f6ecdc; border: 1px solid #d8c5a7; border-radius: 8px; width: fit-content; max-width: 100%; margin: 16px auto 0; padding: 9px 14px; font-size: 13px; line-height: 1.6; text-align: center; }
.tool-page .error { max-width: none; margin: 16px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.tool-page #retry { max-width: none; margin-inline: 0; }
.tool-page .tool-consent { max-width: none; margin: 20px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; text-align: center; }
.tool-page .tool-consent a, .tool-page .tool-detail-body a { text-decoration: underline; text-underline-offset: 3px; }
.tool-page .tool-download > h1 { text-align: center; margin-bottom: 28px; }
.tool-page .tool-download .file-list { max-height: 360px; }
.tool-page .back { display: block; width: fit-content; margin: 20px auto 0; min-height: 44px; padding-block: 12px; font-size: 14px; text-decoration: underline; }
.tool-page .tool-footer { --muted: #4b606e; padding-block: 16px 24px; border-top: 1px solid #c6d2da; background: #dce4e9; }
.tool-page .tool-details { display: flex; flex-wrap: wrap; column-gap: 28px; align-items: start; }
.tool-page .tool-details > details { min-width: 0; }
.tool-page .tool-details > details[open] { flex-basis: 100%; }
.tool-page .tool-details summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding-block: 10px; font-size: 13px; color: var(--ink); line-height: 1.6; }
.tool-page .tool-details summary::before { content: '+'; color: var(--accent); flex: 0 0 12px; text-align: center; }
.tool-page .tool-details details[open] > summary::before { content: '−'; }
.tool-page #legal { margin: 0; font-size: inherit; color: inherit; }
.tool-page #legal p { margin: 0; max-width: none; }
.tool-page .tool-detail-body { max-width: 760px; padding: 8px 0 20px; color: var(--muted); }
.tool-page .tool-detail-body p { font-size: 14px; line-height: 1.8; margin: 0 0 16px; overflow-wrap: anywhere; }
.tool-page .tool-detail-body details { border-top: 1px solid var(--line); }
.tool-page .locale-links { gap: 4px 20px; font-size: 13px; }
.tool-page .locale-links a { min-height: 44px; display: inline-flex; align-items: center; }
.tool-page .tool-footer-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.tool-page .tool-footer-meta a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; }
.tool-page .tool-guide { flex: 1; }
.tool-page .tool-guide article { width: 100%; max-width: 760px; margin-inline: auto; }
.tool-page .tool-guide h1 { max-width: none; font-size: 36px; line-height: 1.25; letter-spacing: -.8px; }
.tool-page .tool-guide h2 { margin-top: 32px; }
.tool-page .tool-guide nav { margin-bottom: 28px; font-size: 13px; }
.tool-page .tool-guide nav a { display: inline-flex; align-items: center; min-height: 44px; }
.tool-page .tool-guide .lead { font-size: 18px; }
html[lang=ar] .tool-page :is(h1, h2) { letter-spacing: 0; }
@media (max-width: 800px) {
  .tool-page .choose-files { flex-direction: column; gap: 16px; }
  .tool-page .choose-art { width: 260px; height: 95px; flex: 0 0 auto; }
}
@media (max-width: 600px) {
  .tool-page .wrap { padding-inline: 20px; }
  .tool-page .nav { height: 60px; min-height: 60px; gap: 8px; }
  .tool-page .nav .brand { font-size: 18px; letter-spacing: -.7px; }
  .tool-page .nav .language select { max-width: 112px; font-size: 12px; }
  .tool-page .tool-main { padding-block: 24px; }
  .tool-page .tool-scene { padding-block: 8px; }
  .tool-page .dropzone { gap: 14px; }
  .tool-page .choose-files { min-height: 230px; padding: 18px; gap: 16px; font-size: 18px; }
  .tool-page .tool-instruction h1, .tool-page .tool-download > h1 { font-size: 26px; line-height: 1.35; }
  .tool-page h2 { font-size: 23px; }
  .tool-page .choose-hint { font-size: 14px; }
  .tool-page .tool-limits { font-size: 12px; }
  .tool-page .tool-panel { padding: 20px 16px; }
  .tool-page .tool-consent { margin-top: 16px; font-size: 11px; }
  .tool-page .tool-details { column-gap: 20px; }
  .tool-page .tool-footer-meta { font-size: 11px; }
  .tool-page .tool-guide h1 { font-size: 28px; }
  .tool-page .tool-guide .lead { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .tool-page .choose-files, .tool-page .dropzone { transition: none; }
}
