/* Metre2 free file tools - shared base (27 Nov 2026). Same family as Compress Video: flat, square, white panels on grey.
   Each tool sets --acc/--accd/--accbg in its own app.css. */
@font-face { font-family: 'InterKT'; src: url('fonts/inter-var.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
:root {
  --ink: #14161a; --acc: #333; --accd: #111; --accbg: #f1f1f1; --bg: #f4f5f7; --panel: #fff; --line: #e1e4e8; --line2: #eef0f3;
  --tx: #17191d; --tx2: #5d6470; --tx3: #8d94a0; --ok: #16884a; --okbg: #e5f5ec; --warn: #b4560b; --warnbg: #fff4e5; --bad: #c0392b; --badbg: #fdecea;
  --mono: 'Cascadia Mono', Consolas, ui-monospace, monospace; color-scheme: light;
}
* { box-sizing: border-box }
html, body { height: 100%; margin: 0 }
body { background: var(--bg); color: var(--tx); font: 14px/1.45 InterKT, 'Segoe UI', system-ui, sans-serif; }
button, input, select { font: inherit; color: inherit }
[hidden] { display: none !important }
.app { min-height: 100vh; display: flex; flex-direction: column }
.top { height: 56px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 22px; gap: 14px; flex: none; position: sticky; top: 0; z-index: 20 }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; color: inherit; text-decoration: none; white-space: nowrap }
.logo { width: 30px; height: 30px; background: var(--acc); display: grid; place-items: center; flex: none }
.top .sp { flex: 1 }
.top .meta { font-size: 12.5px; color: var(--tx2); display: flex; gap: 18px; align-items: center }
.top .meta b { color: var(--ok); font-weight: 600 }
.tabs { display: flex; align-self: stretch; margin-left: 18px }
.tabs button { border: 0; background: none; padding: 0 16px; font-weight: 600; color: var(--tx2); cursor: pointer; border-bottom: 3px solid transparent; border-top: 3px solid transparent }
.tabs button.on { color: var(--tx); border-bottom-color: var(--acc) }
.btn { height: 40px; padding: 0 18px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none; color: var(--tx); white-space: nowrap }
.btn:hover { background: #f7f8fa }
.btn.pri { background: var(--acc); border-color: var(--acc); color: #fff } .btn.pri:hover { background: var(--accd) }
.btn.big { height: 52px; font-size: 16px; padding: 0 28px }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px }
.btn.ghost { border-color: transparent; background: transparent; color: var(--tx2) } .btn.ghost:hover { color: var(--tx); background: #f0f1f4 }
.btn:disabled { opacity: .45; cursor: default }
.main { flex: 1; display: flex; min-height: 0 }
/* start */
.hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 40px 20px }
.hero h1 { margin: 0; font-size: 44px; letter-spacing: -.03em; text-align: center; line-height: 1.1 }
.hero p.l { margin: 0; font-size: 17px; color: var(--tx2); text-align: center; max-width: 660px }
.drop { width: min(860px, 100%); height: 280px; border: 2px dashed #c3c8d0; background: var(--panel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; cursor: pointer; text-align: center; padding: 20px }
.drop:hover, .drop.over, body.over .drop { border-color: var(--acc); background: var(--accbg) }
.drop .ic { width: 64px; height: 64px; background: var(--accbg); display: grid; place-items: center }
.drop:hover .ic, .drop.over .ic { background: #fff }
.drop b { font-size: 20px } .drop span { color: var(--tx2) } .drop u { color: var(--tx) }
.opts { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; align-items: flex-end }
.opts .k { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--tx3); margin-bottom: 6px; font-weight: 600 }
.ticks { display: flex; gap: 28px; color: var(--tx2); font-size: 13.5px; flex-wrap: wrap; justify-content: center }
.ticks span::before { content: '\2713  '; color: var(--ok); font-weight: 700 }
.strip { background: var(--panel); border-top: 1px solid var(--line); padding: 14px 22px; display: flex; gap: 26px; align-items: center; font-size: 13px; color: var(--tx2); flex: none; flex-wrap: wrap }
.strip b { color: var(--tx); font-size: 11px; letter-spacing: .08em; text-transform: uppercase }
.strip a { color: var(--tx); text-decoration: none; font-weight: 600 } .strip a:hover { color: var(--accd) }
.strip a small { display: block; font-weight: 400; color: var(--tx3) }
.err { background: var(--badbg); color: var(--bad); padding: 12px 16px; max-width: 860px; width: 100%; border: 1px solid #f3c2bc }
.disc { font-size: 11.5px; color: var(--tx3); text-align: center; max-width: 700px; margin: 0 }
/* controls */
.seg { display: flex; border: 1px solid var(--line); background: var(--panel) }
.seg button { flex: 1; border: 0; border-right: 1px solid var(--line); background: var(--panel); height: 38px; font-weight: 600; color: var(--tx2); cursor: pointer; white-space: nowrap; padding: 0 10px; min-width: 0 }
.seg button:last-child { border-right: 0 } .seg button.on { background: var(--ink); color: #fff } .seg button:disabled { opacity: .4; cursor: default }
select.sel, input.inp { height: 38px; border: 1px solid var(--line); background: var(--panel); padding: 0 10px; min-width: 0 }
input.inp:focus, select.sel:focus { outline: 2px solid var(--acc); outline-offset: -2px }
.chk { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-weight: 600; height: 38px }
.chk input { width: 16px; height: 16px; accent-color: var(--acc) }
.target { display: flex; align-items: stretch; border: 2px solid var(--ink); background: var(--panel) }
.target input { flex: 1; border: 0; font: 800 30px InterKT, system-ui; padding: 4px 14px; width: 100px; outline: none; min-width: 0 }
.target span { display: flex; align-items: center; padding: 0 6px; font-weight: 700; font-size: 16px; background: var(--bg); border-left: 1px solid var(--line) }
.target select { border: 0; background: var(--bg); font-weight: 700; font-size: 16px; padding: 0 10px; border-left: 1px solid var(--line); cursor: pointer }
.quick { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap }
.quick button { border: 1px solid var(--line); background: var(--panel); padding: 6px 10px; font-size: 12.5px; font-weight: 600; color: var(--tx2); cursor: pointer }
.quick button:hover { border-color: var(--ink); color: var(--tx) }
/* work view: board + side panel */
.board { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 22px; gap: 14px; overflow: auto }
.bar2 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap }
.bar2 .t { font-weight: 700; font-size: 15px } .bar2 .s { color: var(--tx2); font-size: 13px }
.bar2 .sp { flex: 1 }
.side { width: 380px; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; flex: none; overflow: auto }
.side > * { flex-shrink: 0 }
.side .sec { padding: 18px 22px; border-bottom: 1px solid var(--line2) }
.side h4 { margin: 0 0 10px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--tx3) }
.row { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 10px; margin-top: 10px }
.row:first-of-type { margin-top: 0 }
.row > label { font-size: 13px; color: var(--tx2) }
.est { background: var(--accbg); padding: 16px 22px; border-bottom: 1px solid var(--line2) }
.est .k { font-size: 12px; color: var(--tx2); font-weight: 600 }
.est .n { font-size: 28px; font-weight: 800; letter-spacing: -.02em } .est .s { font-size: 12.5px; color: var(--tx2) }
.go { padding: 18px 22px; margin-top: auto; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line2) }
.go .btn { width: 100% }
.note { font-size: 12px; color: var(--tx3); text-align: center }
.pbar { height: 10px; background: var(--line2) } .pbar i { display: block; height: 100%; width: 0; background: var(--acc); transition: width .2s }
.plab { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px } .plab b { font-family: var(--mono) }
/* result list */
.card { background: var(--panel); border: 1px solid var(--line); padding: 20px }
.big2 { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap } .big2 .a { font-size: 20px; color: var(--tx3); text-decoration: line-through; font-weight: 700 } .big2 .b { font-size: 44px; font-weight: 800; letter-spacing: -.03em }
.saved { display: inline-block; background: var(--okbg); color: var(--ok); font-weight: 700; padding: 4px 10px } .saved.warn { background: var(--warnbg); color: var(--warn) }
.flist .f { display: flex; gap: 12px; align-items: center; padding: 8px 10px; margin: 0 -10px; border-left: 3px solid transparent }
.flist .f.sel { background: var(--accbg); border-left-color: var(--acc) }
.flist .f .w { flex: 1; min-width: 0 } .flist .f b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.flist .f span { font-size: 12px; color: var(--tx2); font-family: var(--mono) }
.flist .f .x { border: 0; background: none; color: var(--tx3); cursor: pointer; font-size: 16px; padding: 4px 6px } .flist .f .x:hover { color: var(--bad) }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; z-index: 60; font-size: 13px; max-width: 90vw }
.spin { width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--acc); border-radius: 50%; animation: sp .8s linear infinite; display: inline-block }
@keyframes sp { to { transform: rotate(360deg) } }
@media (max-width: 1000px) {
  .main { flex-direction: column } .side { width: auto; border-left: 0; border-top: 1px solid var(--line) }
  .hero h1 { font-size: 32px } .drop { height: 200px } .top .meta span + span { display: none } .tabs { margin-left: 0 }
}
@media (max-width: 640px) { .top { padding: 0 12px; gap: 8px } .top .meta { display: none } .ticks { gap: 10px 18px } .board { padding: 14px } .tabs button { padding: 0 8px; font-size: 13px } }
