/* AllInOneTool shared styles — Manrope + teal design system */
:root {
  --ink: #182430;
  --muted: #5c6b7a;
  --faint: #9aa4b2;
  --bg: #f7f9fa;
  --surface: #ffffff;
  --line: #e3e8ed;
  --accent: #0d7a6c;
  --accent-hover: #0a5f55;
  --danger: #b3423a;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 22px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand-name { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.brand-sub { font-size: 12.5px; font-weight: 600; color: var(--muted); border-left: 1px solid var(--line); padding-left: 8px; margin-left: 2px; }
.topnav { display: flex; gap: 18px; font-size: 14px; font-weight: 600; }
.topnav a { color: var(--muted); transition: color .15s ease; }
.topnav a:hover { color: var(--accent); text-decoration: none; }

/* ads */
.ad-wrap { display: flex; justify-content: center; padding: 8px 14px; background: #eef2f4; }
.ad-slot { max-width: 970px; width: 100%; text-align: center; min-height: 40px; }
.ad-placeholder { border: 1px dashed #ccd5dc; border-radius: var(--radius); min-height: 90px; display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 12px; letter-spacing: .06em; }

/* layout */
main { max-width: 860px; margin: 0 auto; padding: 30px 20px 10px; }

/* Side ad rails (injected by ads.js): 3-column layout on wide screens only */
.ad-rail { display: none; }
@media (min-width: 1100px) {
  .layout { display: grid; grid-template-columns: 160px minmax(0, 1fr) 160px; gap: 28px; max-width: 1240px; margin: 0 auto; padding: 0 20px; align-items: start; }
  .layout > main { max-width: none; margin: 0; padding-left: 0; padding-right: 0; }
  .ad-rail { display: block; position: sticky; top: 16px; }
}
.ad-rail-slot { min-height: 0 !important; max-width: 160px; width: 160px; margin: 0 auto; overflow: hidden; }
h1 { font-size: 25px; line-height: 1.3; letter-spacing: -0.02em; margin: 0 0 8px; }
.sub { color: var(--muted); font-size: 15.5px; margin: 0 0 20px; max-width: 64ch; }

/* tool card */
.tool-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }

/* dropzone */
.dropzone {
  border: 2px dashed #c3cedb; border-radius: var(--radius); padding: 34px 20px; text-align: center;
  color: var(--muted); cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: #f2f8f7; }
.dropzone b { color: var(--ink); }

/* buttons */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; border: none; border-radius: 9px; padding: 11px 20px;
  font: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer; min-width: 160px; justify-content: center;
  transition: background .15s ease, transform .1s ease;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:active:not(:disabled) { transform: scale(.98); }
.btn-primary:disabled { background: #b9c2d0; cursor: not-allowed; }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); color: var(--ink); border: 1.5px solid #cdd6e4; border-radius: 9px; padding: 10px 18px;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.btn-secondary:hover { background: #eef4f3; border-color: var(--accent); }

/* forms */
select, input[type="text"], input[type="number"], textarea {
  padding: 9px 12px; border-radius: 8px; border: 1.5px solid #d4dde3; background: var(--surface);
  font: inherit; font-size: 14.5px; color: var(--ink); min-width: 0;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13,122,108,.12); }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--muted); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab-btn {
  background: none; border: none; padding: 9px 15px; font: inherit; font-size: 14.5px; font-weight: 700;
  color: var(--muted); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -2px; transition: color .15s ease;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* file list */
.file-list { display: grid; gap: 8px; margin-top: 14px; }
.file-row {
  display: flex; align-items: center; gap: 10px; background: #f2f5f7; border-radius: 8px; padding: 9px 13px; font-size: 14px;
}
.file-row .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .fsize { color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.file-row button { background: none; border: none; color: var(--faint); font-size: 18px; cursor: pointer; line-height: 1; padding: 2px 4px; }
.file-row button:hover { color: var(--danger); }

/* result / status */
.status { margin-top: 14px; font-size: 14.5px; min-height: 22px; }
.status.ok { color: #1d6b4f; font-weight: 700; }
.status.err { color: var(--danger); font-weight: 600; }

/* tables */
table.conv { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 15px; }
table.conv td, table.conv th { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
table.conv tr:last-child td, table.conv tr:last-child th { border-bottom: none; }
table.conv td.val { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14.5px; word-break: break-all; }

/* content / SEO */
.content-section { max-width: 860px; margin: 26px auto 0; padding: 20px 20px 30px; color: #3c4658; line-height: 1.7; font-size: 15px; }
.content-section h2 { font-size: 19px; letter-spacing: -0.01em; margin-top: 24px; }
.content-section ul { padding-left: 22px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 30px; padding-bottom: 18px; }
.foot-copy { text-align: center; font-size: 13px; color: var(--muted); margin: 12px auto; max-width: 970px; padding: 0 16px; }

@media (max-width: 640px) { h1 { font-size: 21px; } .tool-card { padding: 15px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- Full-width layout toggle (ui.js adds body.fullwidth) ---- */
.fw-toggle { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 700; color: var(--muted); background: #f2f5f7; border: 1px solid var(--line); border-radius: 8px; padding: 5px 11px; cursor: pointer; white-space: nowrap; transition: color .15s ease, background .15s ease, border-color .15s ease; }
.fw-toggle:hover { color: var(--accent); border-color: var(--accent); background: #eef4f3; text-decoration: none; }
.fw-toggle[aria-pressed="true"] { color: #fff; background: var(--accent); border-color: var(--accent); }
.fw-float { position: fixed; top: 12px; right: 16px; z-index: 900; box-shadow: 0 2px 10px rgba(15,30,40,.14); }

body.fullwidth main { max-width: none; padding-left: clamp(20px, 4vw, 72px); padding-right: clamp(20px, 4vw, 72px); }
body.fullwidth .layout { max-width: none; grid-template-columns: 1fr; padding-left: clamp(16px, 3vw, 56px); padding-right: clamp(16px, 3vw, 56px); }
body.fullwidth .ad-rail { display: none !important; }
body.fullwidth .content-section { max-width: none; padding-left: clamp(20px, 4vw, 72px); padding-right: clamp(20px, 4vw, 72px); }

@media (max-width: 560px) { .fw-toggle .fw-lbl { display: none; } .fw-toggle { padding: 5px 8px; } }
