/* 클립사이즈 — dark editing desk: preview stage left, settings rail right, stacks on phones */
:root {
  --bg: #141518; --bar: #18191D; --panel: #1C1E22; --raised: #25282E; --line: #2E3138; --line-2: #3A3E47;
  --fg: #EDEEF0; --fg-2: #C9CCD2; --muted: #9EA3AD; --accent: #F5A524; --accent-ink: #1A1206; --accent-soft: #2E2615;
  --ok: #5FD38D; --ok-soft: #1F3A2A; --err: #FF8A7A; --stage: #0E0F11; --shade: rgba(6,7,9,.66);
  --sans: 'IBM Plex Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 14px; line-height: 1.5; }
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--accent); }
a:hover { color: #FFC163; }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

.app { min-height: 100vh; display: flex; flex-direction: column; }
header.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px;
  background: var(--bar); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--fg); text-decoration: none; }
.brand:hover { color: var(--fg); }
.filechip { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--raised); border-radius: 8px; color: var(--fg-2); min-width: 0; max-width: 100%; }
.filechip .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.filechip .meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.top-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-width: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--fg); font-weight: 500; text-decoration: none; }
.btn:hover { background: var(--raised); color: var(--fg); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn.primary:hover { background: #FFB840; color: var(--accent-ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.big { min-height: 52px; font-size: 16px; border-radius: 12px; width: 100%; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; }

/* empty state */
.welcome { display: flex; flex-direction: column; align-items: center; gap: 32px; padding-block: 48px 24px; }
.welcome h1 { margin: 0; font-size: clamp(26px, 4vw, 38px); letter-spacing: -0.5px; text-align: center; text-wrap: balance; line-height: 1.25; }
.welcome p.lead { margin: 10px auto 0; color: var(--muted); font-size: 16px; text-align: center; text-wrap: balance; max-width: 640px; }
.drop { width: 100%; max-width: 720px; border: 2px dashed var(--accent); border-radius: 20px; background: var(--panel);
  padding: 52px 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; transition: background .15s; }
.drop.over { background: var(--accent-soft); }
.drop .ico { width: 72px; height: 72px; border-radius: 20px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; }
.drop .t { font-size: 20px; font-weight: 600; margin: 0; }
.drop .or { color: var(--muted); margin: 0; }
.drop .fmts { color: var(--muted); font-size: 13px; margin: 6px 0 0; line-height: 1.6; }
.features { width: 100%; max-width: 720px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.feature b { font-size: 15px; font-weight: 600; }
.feature span { color: var(--muted); font-size: 13px; }
.err { color: var(--err); font-size: 14px; margin: 0; }

/* editor */
.editor { display: flex; flex-wrap: wrap; min-height: 0; border-bottom: 1px solid var(--line); }
.stagecol { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px;
  padding-block: 20px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.stagehead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); }
.stagehead .dims { color: var(--fg-2); font-size: 13px; }
.stagehead .dims em { color: var(--accent); font-style: normal; }
.modeseg { display: inline-grid; grid-template-columns: repeat(2, auto); gap: 4px; padding: 4px; background: var(--raised); border-radius: 10px; }
.modeseg button { min-height: 38px; padding: 0 14px; border: none; border-radius: 8px; background: transparent; color: var(--fg-2); display: inline-flex; align-items: center; gap: 6px; }
.modeseg button[aria-pressed=true] { background: var(--fg); color: var(--bg); font-weight: 600; }
.stagetip { margin: 0; color: var(--muted); font-size: 12px; }
.stage { position: relative; height: min(58vh, 520px); min-height: 260px; background: var(--stage); border: 1px solid var(--raised); border-radius: 14px;
  display: flex; align-items: center; justify-content: center; padding: 22px; overflow: hidden;
  background-image: radial-gradient(#22252B 1px, transparent 1px); background-size: 16px 16px; }

.frame { position: relative; max-width: 100%; max-height: 100%; outline: 2px solid var(--accent); outline-offset: 0; }
.frame canvas { display: block; width: 100%; height: 100%; }
.h, .ch { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; touch-action: none; z-index: 3; display: flex; align-items: center; justify-content: center; }
.h::after, .ch::after { content: ""; width: 12px; height: 12px; background: var(--accent); border: 2px solid var(--stage); border-radius: 3px; transition: transform .12s; }
.ch::after { background: #fff; }
.h:hover::after, .ch:hover::after, .on::after { transform: scale(1.35); }
.h.e::after, .h.w::after, .ch.e::after, .ch.w::after { width: 8px; height: 20px; border-radius: 4px; }
.h.n::after, .h.s::after, .ch.n::after, .ch.s::after { width: 20px; height: 8px; border-radius: 4px; }
.nw { left: 0; top: 0; cursor: nwse-resize; } .ne { left: 100%; top: 0; cursor: nesw-resize; }
.sw { left: 0; top: 100%; cursor: nesw-resize; } .se { left: 100%; top: 100%; cursor: nwse-resize; }
.n { left: 50%; top: 0; cursor: ns-resize; } .s { left: 50%; top: 100%; cursor: ns-resize; }
.w { left: 0; top: 50%; cursor: ew-resize; } .e { left: 100%; top: 50%; cursor: ew-resize; }
.badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 6px 12px; border-radius: 8px; background: rgba(10,11,13,.82); color: var(--fg);
  font-family: var(--mono); font-size: 15px; font-weight: 500; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 2; }
.dragging .badge { opacity: 1; }
body.resizing, body.resizing * { user-select: none; }

.cframe { position: relative; max-width: 100%; max-height: 100%; touch-action: none; cursor: crosshair; }
.cframe canvas { display: block; width: 100%; height: 100%; }
.cclip { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.cshade { position: absolute; box-shadow: 0 0 0 99999px var(--shade); }
.cbox { position: absolute; outline: 2px solid #fff; cursor: move; touch-action: none; }
.cbox .g { position: absolute; background: rgba(255,255,255,.35); pointer-events: none; }
.g.v1 { left: 33.333%; top: 0; bottom: 0; width: 1px; } .g.v2 { left: 66.666%; top: 0; bottom: 0; width: 1px; }
.g.h1 { top: 33.333%; left: 0; right: 0; height: 1px; } .g.h2 { top: 66.666%; left: 0; right: 0; height: 1px; }

/* transport + trim timeline */
.transport { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.trow { display: flex; align-items: center; gap: 12px; }
.play { width: 44px; height: 44px; flex: none; border-radius: 50%; border: none; background: var(--fg); color: var(--bg); display: flex; align-items: center; justify-content: center; }
.time { font-size: 13px; color: var(--fg-2); min-width: 44px; }
.time.end { color: var(--muted); text-align: right; }
.tl { position: relative; flex: 1; min-width: 0; height: 44px; touch-action: none; cursor: pointer; }
.tl-track { position: absolute; left: 0; right: 0; top: 12px; height: 20px; border-radius: 6px; background: repeating-linear-gradient(90deg, #2A3036 0 10px, #252A30 10px 12px); }
.tl-out { position: absolute; top: 12px; height: 20px; background: var(--shade); pointer-events: none; }
.tl-out.l { left: 0; border-radius: 6px 0 0 6px; } .tl-out.r { right: 0; border-radius: 0 6px 6px 0; }
.tl-range { position: absolute; top: 10px; height: 24px; border: 2px solid var(--accent); border-radius: 6px; pointer-events: none; }
.tl-handle { position: absolute; top: 4px; width: 28px; height: 36px; margin-left: -14px; display: flex; align-items: center; justify-content: center; touch-action: none; cursor: ew-resize; z-index: 2; }
.tl-handle::after { content: ""; width: 10px; height: 32px; border-radius: 4px; background: var(--accent); border: 2px solid var(--panel); }
.tl-handle:focus-visible { outline: none; }
.tl-handle:focus-visible::after { box-shadow: 0 0 0 2px var(--fg); }
.tl-head { position: absolute; top: 2px; width: 2px; height: 40px; margin-left: -1px; background: var(--fg); pointer-events: none; z-index: 1; }
.trimrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--muted); font-size: 13px; }
.trimrow .sum { color: var(--fg-2); }
.trimrow .sum em { color: var(--accent); font-style: normal; }
.trimrow .spacer { flex: 1; }

aside.rail { flex: 1 1 340px; max-width: 100%; background: var(--panel); border-inline-start: 1px solid var(--line);
  padding-block: 22px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 22px; }
@media (max-width: 960px) { aside.rail { border-inline-start: none; border-top: 1px solid var(--line); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); } }
.sec { display: flex; flex-direction: column; gap: 10px; }
.sec h2 { margin: 0; font-size: 15px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.preset { text-align: left; min-height: 56px; padding: 9px 12px; border-radius: 10px; background: var(--raised); border: 1.5px solid var(--raised); }
.preset:hover { border-color: var(--line-2); }
.preset[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent); }
.preset b { display: block; font-weight: 600; }
.preset small { display: block; margin-top: 2px; color: var(--muted); font-family: var(--mono); font-size: 12px; }
.dimrow { display: flex; align-items: flex-end; gap: 8px; }
.field { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.field input, .field select { height: 44px; padding: 0 12px; background: var(--raised); border: 1px solid var(--line-2); border-radius: 8px; color: var(--fg); width: 100%; }
.field input { font-family: var(--mono); }
.lock { width: 44px; height: 44px; flex: none; border-radius: 8px; border: 1px solid var(--line-2); background: var(--raised); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.lock[aria-pressed=true] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.hint { margin: 0; color: var(--muted); font-size: 12px; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--raised); border-radius: 10px; }
.seg button { min-height: 40px; border: none; border-radius: 8px; background: transparent; color: var(--fg-2); }
.seg button[aria-pressed=true] { background: var(--fg); color: var(--bg); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--raised); color: var(--fg-2); font-size: 13px; }
.chip[aria-pressed=true] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.grid4 .field input { padding: 0 8px; font-size: 13px; }
.swatches { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.swb { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line-2); padding: 0; }
.swb[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--bg) inset; }
.swb.blur { background: linear-gradient(135deg, #3D6A80, #24414F); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.est { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.est span:last-child { color: var(--fg); }
.rail .go { margin-top: auto; }
.cropsec.active { outline: 1.5px solid var(--accent); outline-offset: 8px; border-radius: 6px; }

/* ads: reserved space so the page does not jump when an ad loads */
.adslot { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.adslot .adlabel { font-size: 11px; color: var(--muted); letter-spacing: .08em; }
.adslot .adbox { width: 100%; min-height: 100px; }
.adslot.wide { max-width: 970px; margin-inline: auto; }
.adslot.rail .adbox { min-height: 250px; }

/* content below the tool */
.content { max-width: 920px; margin-inline: auto; width: 100%; padding-block: 48px; display: flex; flex-direction: column; gap: 44px; }
.content h2 { margin: 0 0 14px; font-size: 22px; letter-spacing: -0.3px; text-wrap: balance; }
.content p { margin: 0; color: var(--fg-2); max-width: 68ch; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; counter-reset: s; }
.steps li { counter-increment: s; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.steps li::before { content: counter(s); font-family: var(--mono); color: var(--accent); font-weight: 500; }
.steps b { font-size: 15px; }
.steps span { color: var(--muted); font-size: 13px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table.sizes { width: 100%; border-collapse: collapse; min-width: 480px; }
table.sizes th, table.sizes td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
table.sizes th { color: var(--muted); font-weight: 500; font-size: 13px; background: var(--panel); }
table.sizes tr:last-child td { border-bottom: none; }
table.sizes td.mono { color: var(--accent); }
.faq { display: flex; flex-direction: column; gap: 8px; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; }
.faq summary { cursor: pointer; min-height: 52px; display: flex; align-items: center; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-inline-start: auto; color: var(--muted); font-family: var(--mono); font-size: 18px; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding-bottom: 16px; color: var(--fg-2); }

footer.site { border-top: 1px solid var(--line); background: var(--bar); padding-block: 24px max(24px, env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: 13px; }
footer.site .in { max-width: 920px; margin-inline: auto; display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
footer.site a { color: var(--fg-2); text-decoration: none; }
footer.site a:hover { color: var(--fg); text-decoration: underline; }

/* export overlay */
.overlay { position: fixed; inset: 0; background: rgba(8,9,11,.78); display: flex; align-items: center; justify-content: center; z-index: 10;
  padding-block: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.sheet { width: 100%; max-width: 880px; max-height: 100%; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 28px;
  display: flex; flex-wrap: wrap; gap: 28px; align-items: center; }
.sheet .thumb { flex: 0 1 260px; max-width: 100%; display: flex; justify-content: center; }
.sheet .thumb video, .sheet .thumb canvas, .sheet .thumb img { max-width: 100%; max-height: 420px; border-radius: 12px; background: #000; display: block; }
.sheet .info { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.sheet h2 { margin: 0; font-size: 26px; display: flex; align-items: center; gap: 12px; text-wrap: balance; }
.sheet .adslot { flex-basis: 100%; }
.okdot { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--ok-soft); display: flex; align-items: center; justify-content: center; }
.bar { height: 8px; border-radius: 4px; background: var(--raised); overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); width: 0%; transition: width .2s linear; }
.barlabel { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
dl.meta { margin: 0; display: grid; grid-template-columns: 96px minmax(0, 1fr); row-gap: 10px; column-gap: 14px; padding: 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; overflow-wrap: anywhere; }
dl.meta em { color: var(--accent); font-style: normal; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn.primary { flex: 1 1 200px; min-height: 52px; font-size: 16px; }
.actions .btn { min-height: 52px; }
.note { margin: 0; color: var(--muted); font-size: 13px; }
.status { margin: 0; font-size: 13px; }
.status.ok { color: var(--ok); } .status.bad { color: var(--err); }

.hiddenvid { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: 0; top: 0; }

/* policy pages */
.doc { max-width: 760px; margin-inline: auto; padding-block: 48px; }
.doc h1 { font-size: 30px; margin: 0 0 8px; letter-spacing: -0.4px; }
.doc .updated { color: var(--muted); margin: 0 0 32px; }
.doc h2 { font-size: 18px; margin: 32px 0 10px; }
.doc p, .doc li { color: var(--fg-2); max-width: 68ch; }
.doc ul, .doc ol { padding-inline-start: 22px; }
.doc .fill { color: var(--accent); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- languages ---- */
html[lang="en"], html[lang="fr"] { --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; }
html[lang="ja"] { --sans: 'IBM Plex Sans JP', 'Hiragino Sans', 'Yu Gothic UI', Meiryo, sans-serif; }
html[lang="zh-Hans"] { --sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif; }
html[lang="ar"] { --sans: 'IBM Plex Sans Arabic', 'Noto Sans Arabic', Tahoma, 'Segoe UI', sans-serif; }
html[lang="ar"] body { line-height: 1.7; }
html[lang="ar"] .welcome h1, html[lang="ar"] .content h2 { letter-spacing: 0; }
.top-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topacts { display: flex; gap: 10px; flex-wrap: wrap; }
.dropbtns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.dropbtns .btn { min-height: 48px; }
.dropbtns .btn.primary { padding: 0 28px; font-size: 16px; }
.langmenu { position: relative; }
.langmenu summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; color: var(--fg-2); }
.langmenu summary::-webkit-details-marker { display: none; }
.langmenu summary:hover { background: var(--raised); color: var(--fg); }
.langlist { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 20; min-width: 168px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; box-shadow: 0 12px 32px rgba(0,0,0,.45); }
.langlist a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: 8px; color: var(--fg); text-decoration: none; }
.langlist a:hover { background: var(--raised); color: var(--fg); }
.langlist a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.langlist a small { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.langbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-block: 8px; background: var(--accent-soft); border-bottom: 1px solid #4a3a17; color: var(--fg); font-size: 13px; }
.langbar a { font-weight: 600; }
.langbar-x { margin-inline-start: auto; width: 32px; height: 32px; border: none; border-radius: 8px; background: transparent; color: var(--fg-2); font-size: 18px; }
.langbar-x:hover { background: rgba(255,255,255,.08); }
.imgq { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--raised); border-radius: 12px; }
.imgq .qrow { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--fg-2); }
.imgq .qrow output { color: var(--accent); font-size: 15px; font-weight: 500; }
.imgq input[type=range] { width: 100%; }
.imgq input[type=range]:disabled { opacity: .4; }
.imgq .targetrow { display: flex; align-items: flex-end; gap: 8px; }
.imgq .targetrow .field input { background: var(--bg); }
.imgq .targetrow .btn { flex: none; }
.est em { font-style: normal; font-weight: 600; }
.est em.down { color: var(--ok); }
.est em.up { color: var(--err); }
.est span:last-child { text-align: end; }

/* ---- GIF settings panel ---- */
.gifq { display: flex; flex-direction: column; gap: 14px; padding: 14px; background: var(--raised); border-radius: 12px; }
.gifhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.gifhead b { font-size: 14px; font-weight: 600; }
.gifinfo { font-family: var(--mono); font-size: 12px; color: var(--accent); white-space: nowrap; }
.grow { display: flex; flex-direction: column; gap: 6px; }
.grow.two { display: flex; flex-direction: column; gap: 14px; }
.grow.two > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.glabel, .grow .qrow label { font-size: 12px; color: var(--fg-2); }
.grow .qrow { display: flex; justify-content: space-between; align-items: center; }
.grow .qrow output { color: var(--accent); font-size: 14px; font-weight: 500; }
.grow input[type=range] { width: 100%; height: 24px; }
.ticks { display: flex; justify-content: space-between; padding: 0 4px; margin-top: -4px; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.seg.flex { display: flex; gap: 3px; padding: 3px; background: var(--bg); border-radius: 9px; }
.seg.flex button { flex: 1 1 0; min-width: 0; min-height: 36px; padding: 0 4px; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg.flex button svg { flex: none; }
#gifWidth { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
#gifWidth .chip { background: var(--bg); padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#gifWidth .chip:disabled { opacity: .4; cursor: not-allowed; }
.gifwarn { margin: 0; padding: 8px 10px; border-radius: 8px; background: rgba(255,138,122,.1); color: var(--err); font-size: 12px; }

/* ---- feature menu in the header ---- */
.toolnav { display: flex; gap: 4px; flex: 1 1 auto; justify-content: center; min-width: 0; }
.toolnav a { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 10px; color: var(--fg-2); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.toolnav a:hover { background: var(--raised); color: var(--fg); }
.toolnav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.toolnav a svg { flex: none; }
body:not([data-tool="home"]) header.top:has(#filechip:not([hidden])) .toolnav { display: none; }
@media (max-width: 1100px) {
  header.top { row-gap: 8px; }
  .toolnav { order: 3; flex-basis: 100%; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin-inline: -4px; padding-bottom: 2px; }
  .toolnav::-webkit-scrollbar { display: none; }
}

/* ---- home: hero + feature cards ---- */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding-block: 56px 28px; }
.hero h1 { margin: 0; font-size: clamp(28px, 4.4vw, 44px); letter-spacing: -0.6px; line-height: 1.2; text-wrap: balance; max-width: 18ch; }
.hero .lead { margin: 0; color: var(--muted); font-size: 16px; max-width: 620px; text-wrap: balance; }
.trust { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; color: var(--fg-2); font-size: 13px; }
.trust li { display: inline-flex; align-items: center; gap: 6px; }
.trust svg { color: var(--ok); }
.hub { padding-block: 8px 40px; }
.tools { max-width: 1040px; margin-inline: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 720px) { .tools { grid-template-columns: minmax(0, 1fr); } }
.tool { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 6px 16px; align-items: start; padding: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; color: var(--fg); text-decoration: none; transition: border-color .15s, transform .15s, background .15s; }
.tool:hover { border-color: var(--accent); background: #202227; color: var(--fg); transform: translateY(-2px); }
.tool .ti { grid-row: span 3; width: 56px; height: 56px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.tool h3 { margin: 2px 0 0; font-size: 19px; letter-spacing: -0.2px; }
.tool p { margin: 0; color: var(--muted); font-size: 14px; }
.tool .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tool .tags span { font-family: var(--mono); font-size: 11px; color: var(--fg-2); background: var(--raised); border-radius: 6px; padding: 3px 7px; }
.tool .go { position: absolute; inset-inline-end: 20px; top: 22px; color: var(--muted); font-size: 18px; transition: color .15s, transform .15s; }
.tool:hover .go { color: var(--accent); transform: translateX(3px); }
html[dir="rtl"] .tool .go { transform: scaleX(-1); }
html[dir="rtl"] .tool:hover .go { transform: scaleX(-1) translateX(3px); }
.tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- per-feature pages: hide controls that don't belong to the feature ---- */
body[data-tool="compress"] #cropSec, body[data-tool="compress"] #presetSec, body[data-tool="compress"] #fitSec,
body[data-tool="compress"] #modeSeg, body[data-tool="compress"] .sizes-sec { display: none !important; }
body[data-tool="gif"] #fmtField { display: none; }
body[data-tool="gif"] .grid2 { grid-template-columns: minmax(0, 1fr); }
body[data-tool="image"] #sample, body[data-tool="compress"] #sample { display: none; }
.err a { color: var(--accent); font-weight: 600; white-space: nowrap; }
html[lang="ko"] { word-break: keep-all; overflow-wrap: anywhere; }
.hero h1 { max-width: 20ch; }
