:root {
  --bg: #f1f3f6;
  --surface: #ffffff;
  --surface-subtle: #f7f8fa;
  --text: #20242c;
  --text-muted: #707783;
  --border: #dce0e6;
  --border-strong: #c8cdd5;
  --brand: #2f3748;
  --brand-dark: #242a38;
  --accent: #3d6fb6;
  --accent-soft: #edf3fc;
  --positive: #16845b;
  --warning: #b36b00;
  --danger: #c63e3e;
  --danger-soft: #fff1f1;
  --focus: #78a8ee;
  --topbar-text: #ffffff;
  --topbar-muted: #cfd4dd;
  --shadow: rgba(41, 47, 58, .06);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #14171d;
  --surface: #1d2129;
  --surface-subtle: #181c23;
  --text: #e8eaf0;
  --text-muted: #9ba2af;
  --border: #343a45;
  --border-strong: #454d5a;
  --brand: #202632;
  --brand-dark: #11151c;
  --accent: #79a9eb;
  --accent-soft: #26364c;
  --positive: #58c797;
  --warning: #e1a84e;
  --danger: #ff8585;
  --danger-soft: #392226;
  --focus: #79a9eb;
  --topbar-text: #f5f7fb;
  --topbar-muted: #b8c0cc;
  --shadow: rgba(0, 0, 0, .22);
  color-scheme: dark;
}

html[data-theme="black"] {
  --bg: #000000;
  --surface: #050505;
  --surface-subtle: #0a0a0a;
  --text: #f2f3f5;
  --text-muted: #989da6;
  --border: #1b1d21;
  --border-strong: #292c31;
  --brand: #000000;
  --brand-dark: #000000;
  --accent: #73aaf5;
  --accent-soft: #101c2c;
  --positive: #61d29f;
  --warning: #ebb052;
  --danger: #ff8585;
  --danger-soft: #241012;
  --focus: #73aaf5;
  --topbar-text: #ffffff;
  --topbar-muted: #a9adb5;
  --shadow: rgba(0, 0, 0, .72);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

button, textarea, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 3px solid rgba(120, 168, 238, .52);
  outline-offset: 2px;
}
a { color: inherit; text-decoration: none; }

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

.topbar { background: var(--brand); color: var(--topbar-text); border-bottom: 1px solid var(--brand-dark); }
.topbar-inner {
  width: min(1380px, calc(100% - 32px));
  min-height: 54px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
}
.brand { display: flex; align-items: center; gap: 10px; padding-right: 28px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--topbar-text);
  color: var(--brand);
  border-radius: 4px;
  font-size: 10px;
  letter-spacing: -.04em;
}
.primary-nav { min-width: 0; display: flex; align-items: stretch; overflow-x: auto; scrollbar-width: none; }
.primary-nav::-webkit-scrollbar { display: none; }
.primary-nav .nav-link { flex: 0 0 auto; }
.nav-link { display: flex; align-items: center; padding: 0 16px; color: var(--topbar-muted); border-bottom: 3px solid transparent; font-size: 13px; }
.nav-link:hover { color: var(--topbar-text); background: rgba(255,255,255,.05); }
.nav-link.active { color: var(--topbar-text); border-bottom-color: #88abe1; }
.language-picker { align-self: center; margin-left: auto; margin-right: 8px; }
.language-picker select {
  min-width: 94px;
  min-height: 34px;
  padding: 0 28px 0 9px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 3px;
  background: var(--brand);
  color: var(--topbar-text);
  cursor: pointer;
  font-size: 11px;
}
.language-picker option { background: var(--surface); color: var(--text); }
.theme-toggle {
  min-width: 82px;
  min-height: 34px;
  align-self: center;
  margin-left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 3px;
  background: rgba(255,255,255,.06);
  color: var(--topbar-text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.theme-toggle:hover { background: rgba(255,255,255,.12); }
.theme-icon { width: 14px; font-size: 16px; line-height: 1; }

.page-grid {
  width: min(1380px, calc(100% - 32px));
  flex: 1 0 auto;
  margin: 24px auto 56px;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 160px;
  gap: 20px;
}
.ad-rail { min-width: 160px; min-height: 600px; align-self: start; position: sticky; top: 20px; }
.adsense-rail-unit { width: 160px; height: 600px; }
.ad-slot {
  width: 160px;
  height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px dashed var(--border-strong);
  background: color-mix(in srgb, var(--surface) 48%, transparent);
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: .08em;
}
.ad-slot small { font-size: 9px; letter-spacing: 0; opacity: .7; }
.ad-link { text-decoration: none; transition: border-color .15s ease, background-color .15s ease, color .15s ease; }
.ad-link:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ads-disabled .page-grid { width: min(1020px, calc(100% - 32px)); grid-template-columns: minmax(0, 1fr); }
.ads-disabled .home-layout { width: min(1020px, calc(100% - 32px)); grid-template-columns: minmax(0, 1fr); }

.content { min-width: 0; }
.standalone-page { width: min(1020px, calc(100% - 32px)); flex: 1 0 auto; margin: 40px auto 56px; }
.standalone-action { display: inline-flex; margin-top: 18px; text-decoration: none; }
.request-id { color: var(--text-muted); }
.privacy-content { padding: 24px; color: var(--text-muted); line-height: 1.7; }
.privacy-content p { margin: 0; }
.privacy-content p + p { margin-top: 14px; }
.privacy-content a { color: var(--accent); }
.page-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 17px; }
.eyebrow { margin: 0 0 3px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.eyebrow { display: none; }
.page-heading h1 { margin: 0; font-size: clamp(22px, 3vw, 29px); line-height: 1.3; letter-spacing: -.035em; }
.page-heading p:not(.eyebrow) { margin: 7px 0 0; color: var(--text-muted); }

.converter { background: var(--surface); border: 1px solid var(--border-strong); box-shadow: 0 2px 9px var(--shadow); }
.converter-toolbar { min-height: 57px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--border); background: var(--surface-subtle); }
.mode-tabs { align-self: stretch; display: flex; }
.mode-tab { min-width: 172px; padding: 0 15px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--text-muted); text-align: left; cursor: pointer; font-weight: 700; }
.mode-tab span { display: block; margin-top: -2px; font-size: 10px; font-weight: 400; color: #9298a3; }
.mode-tab b { font-weight: 700; }
.mode-tab:hover { background: var(--bg); color: var(--text); }
.mode-tab.active { color: var(--accent); border-bottom-color: var(--accent); background: var(--surface); }
.option-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 8px; color: #555c68; font-size: 12px; cursor: pointer; }
.option-toggle > span { flex: 0 0 auto; white-space: nowrap; word-break: keep-all; }
.option-toggle input { accent-color: var(--accent); }
.option-toggle.disabled { color: #a3a8b0; cursor: not-allowed; }

.editor-grid { display: grid; grid-template-columns: minmax(0,1fr) 50px minmax(0,1fr); padding: 18px; }
.editor-panel { min-width: 0; }
.panel-heading { min-height: 30px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-heading label { font-weight: 800; font-size: 13px; }
.panel-heading span { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
textarea {
  width: 100%;
  min-height: 305px;
  display: block;
  resize: vertical;
  padding: 14px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--surface);
  color: var(--text);
  font-family: "Cascadia Code", Consolas, "Malgun Gothic", monospace;
  font-size: 13px;
  line-height: 1.7;
}
textarea::placeholder { color: #a5aab3; }
textarea:hover { border-color: #aeb5bf; }
textarea:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); }
.output-panel textarea { background: var(--surface-subtle); }
.output-panel.has-error textarea { border-color: var(--danger); background: var(--danger-soft); }
.error-message { margin: 8px 0 0; color: var(--danger); font-size: 12px; }
.swap-column { display: grid; place-items: center; padding-top: 30px; }
.swap-button { width: 38px; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--surface); color: var(--accent); cursor: pointer; }
.swap-button span { font-size: 18px; line-height: 1.1; }
.swap-button small { font-size: 10px; }
.swap-button:hover:not(:disabled) { background: var(--accent-soft); border-color: #a5bce0; }
.swap-button:disabled { opacity: .42; cursor: not-allowed; }

.action-bar { min-height: 58px; display: flex; align-items: center; justify-content: flex-end; padding: 10px 18px; border-top: 1px solid var(--border); background: var(--surface-subtle); }
.action-buttons { display: flex; gap: 7px; }
.button { min-width: 80px; min-height: 36px; padding: 0 15px; border-radius: 3px; cursor: pointer; font-weight: 700; font-size: 12px; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.secondary { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-muted); }
.button.secondary:hover:not(:disabled) { background: var(--bg); }
.button.primary { border: 1px solid #315f9f; background: var(--accent); color: #fff; }
.button.primary:hover:not(:disabled) { background: #315f9f; }

.file-converter { margin-top: 30px; }
.file-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--brand);
}
.file-section-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.file-section-heading > span { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.file-tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.file-tool-panel { min-width: 0; padding: 16px; border: 1px solid var(--border-strong); background: var(--surface); }
.file-tool-title { min-height: 35px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.file-tool-title > div { display: flex; align-items: center; gap: 8px; }
.file-tool-title h3 { margin: 0; font-size: 14px; }
.file-tool-title > span { color: var(--text-muted); font-size: 10px; text-align: right; }
.step-number { color: var(--accent); font: 700 10px/1.5 "Cascadia Code", Consolas, monospace; }
.drop-zone {
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 20px;
  border: 1px dashed var(--border-strong);
  border-radius: 3px;
  background: var(--surface-subtle);
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
}
.drop-zone:hover, .drop-zone.dragging { border-color: var(--accent); background: var(--accent-soft); }
.drop-zone input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.drop-zone strong { color: var(--text); font-size: 12px; }
.drop-zone small { font-size: 10px; }
.upload-icon { width: 28px; height: 28px; display: grid; place-items: center; margin-bottom: 3px; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--accent); font-size: 17px; }
.file-option { min-height: 37px; display: flex; align-items: center; gap: 7px; color: var(--text-muted); font-size: 11px; }
.file-option input { accent-color: var(--accent); }
.field-label { display: block; margin: 0 0 6px; font-size: 11px; font-weight: 800; }
textarea.file-textarea { min-height: 154px; font-size: 11px; }
textarea.decode-file-textarea { min-height: 213px; }
.file-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
.file-fields label span { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: 10px; font-weight: 700; }
.file-fields input, .file-fields select { width: 100%; min-height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--surface); color: var(--text); font-size: 11px; }
.file-fields select { padding-right: 30px; cursor: pointer; }
.file-fields input:focus, .file-fields select:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); }
.decoded-file-status { min-height: 35px; display: flex; align-items: center; margin-top: 10px; padding: 7px 10px; border: 1px solid var(--border); background: var(--surface-subtle); color: var(--text-muted); font-size: 10px; }
.file-error { margin: 8px 0 0; color: var(--danger); font-size: 11px; }
.file-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

.ico-converter { border: 1px solid var(--border-strong); background: var(--surface); box-shadow: 0 2px 9px var(--shadow); }
.ico-workspace { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr); }
.ico-source-panel, .ico-settings-panel { min-width: 0; padding: 18px; }
.ico-source-panel { border-right: 1px solid var(--border); }
.ico-panel-heading { min-height: 34px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ico-panel-heading h3 { margin: 0; font-size: 13px; }
.ico-panel-heading > span { color: var(--text-muted); font-size: 10px; text-align: right; }
.ico-drop-zone {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 24px;
  border: 1px dashed var(--border-strong);
  border-radius: 3px;
  background: var(--surface-subtle);
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
}
.ico-drop-zone:hover, .ico-drop-zone.dragging { border-color: var(--accent); background: var(--accent-soft); }
.ico-drop-zone input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.ico-drop-zone strong { color: var(--text); font-size: 12px; }
.ico-drop-zone small { font-size: 10px; }
.ico-upload-mark { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 4px; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--accent); font-size: 22px; font-weight: 300; }
.image-preview-wrap { margin-top: 12px; padding: 12px; border: 1px solid var(--border); background: var(--surface-subtle); }
.transparency-grid {
  min-height: 225px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background-color: #fff;
  background-image: linear-gradient(45deg, #e6e6e6 25%, transparent 25%), linear-gradient(-45deg, #e6e6e6 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e6e6e6 75%), linear-gradient(-45deg, transparent 75%, #e6e6e6 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.transparency-grid img { display: block; max-width: 100%; max-height: 310px; object-fit: contain; }
.size-fieldset { margin: 0; padding: 0; border: 0; }
.size-fieldset legend { margin-bottom: 8px; font-size: 11px; font-weight: 800; }
.size-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.size-options label { min-height: 39px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); color: var(--text-muted); cursor: pointer; font-size: 11px; }
.size-options label:has(input:checked) { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.size-options input { accent-color: var(--accent); }
.ico-setting-row { margin-top: 16px; }
.ico-setting-row > label { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 800; }
.ico-setting-row select, .file-name-control input { width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--surface); color: var(--text); font-size: 11px; }
.ico-setting-row select:focus, .file-name-control input:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); }
.file-name-control { display: flex; }
.file-name-control input { min-width: 0; border-radius: 3px 0 0 3px; }
.file-name-control span { min-width: 46px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 3px 3px 0; background: var(--surface-subtle); color: var(--text-muted); font-size: 11px; }
.ico-output-summary { min-height: 42px; display: flex; align-items: center; margin-top: 16px; padding: 8px 10px; border: 1px solid var(--border); background: var(--surface-subtle); color: var(--text-muted); font-size: 10px; }
.ico-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }

.mp3-converter { border: 1px solid var(--border-strong); background: var(--surface); box-shadow: 0 2px 9px var(--shadow); }
.mp3-workspace { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(330px, .92fr); }
.mp3-source-panel, .mp3-settings-panel { min-width: 0; padding: 18px; }
.mp3-source-panel { border-right: 1px solid var(--border); }
.video-drop-zone {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 24px;
  border: 1px dashed var(--border-strong);
  border-radius: 3px;
  background: var(--surface-subtle);
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
}
.video-drop-zone:hover, .video-drop-zone.dragging { border-color: var(--accent); background: var(--accent-soft); }
.video-drop-zone input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.video-drop-zone strong { color: var(--text); font-size: 12px; }
.video-drop-zone small { max-width: 390px; font-size: 10px; }
.video-drop-zone .upload-limit { margin-top: 5px; color: var(--accent); font-weight: 800; letter-spacing: .02em; }
.video-upload-mark { width: 36px; height: 36px; display: grid; place-items: center; margin-bottom: 4px; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--accent); font-size: 23px; font-weight: 300; }
.video-preview-wrap { margin-top: 12px; padding: 10px; border: 1px solid var(--border); background: #090a0d; }
.video-preview-wrap video { width: 100%; max-height: 350px; display: block; background: #000; }
.mp3-setting-row { margin-bottom: 14px; }
.mp3-setting-row > label { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 800; }
.mp3-setting-row select, .mp3-setting-row input { width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--surface); color: var(--text); font-size: 11px; }
.mp3-setting-row select:focus, .mp3-setting-row input:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); }
.conversion-progress { margin-top: 14px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--text-muted); font-size: 10px; }
.progress-track { height: 5px; overflow: hidden; background: var(--border); }
.progress-track span { width: 0; height: 100%; display: block; background: var(--accent); transition: width .18s ease; }
.mp3-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }

.utility-card { border: 1px solid var(--border-strong); background: var(--surface); box-shadow: 0 2px 9px var(--shadow); }
.utility-grid { display: grid; grid-template-columns: minmax(0,1.08fr) minmax(330px,.92fr); }
.utility-source, .utility-settings { min-width: 0; padding: 18px; }
.utility-source { border-right: 1px solid var(--border); }
.output-image-wrap { margin-top: 14px; }
.output-image-wrap .transparency-grid { min-height: 150px; }
.dimension-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-row { margin-top: 14px; }
.form-row > label { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 11px; font-weight: 800; }
.form-row input:not([type="range"]), .form-row select, .option-toggle select { width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--surface); color: var(--text); font-size: 11px; }
.form-row input[type="range"] { width: 100%; accent-color: var(--accent); }
.utility-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--border); }
.hash-body { padding: 18px; }
.hash-body textarea { min-height: 215px; }
.hash-output-block { margin-top: 16px; }
textarea.hash-output { min-height: 96px; resize: vertical; word-break: break-all; }
.qr-body { display: grid; grid-template-columns: minmax(0,1fr) minmax(260px,.72fr); gap: 16px; padding: 18px; }
.qr-input-panel textarea { min-height: 230px; }
.qr-style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qr-color-controls { min-height: 38px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.qr-color-control { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 5px 4px 9px; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--surface); color: var(--text-muted); cursor: pointer; font-size: 10px; font-weight: 700; }
.form-row .qr-color-control input[type="color"] { width: 28px; min-height: 28px; height: 28px; flex: 0 0 28px; padding: 2px; border: 0; border-radius: 3px; background: transparent; cursor: pointer; }
.qr-color-control:focus-within { border-color: var(--accent); outline: 3px solid var(--accent-soft); }
.qr-result-panel { min-height: 330px; display: grid; place-items: center; padding: 16px; border: 1px solid var(--border); background: var(--surface-subtle); }
.qr-placeholder { color: var(--text-muted); text-align: center; }
.qr-placeholder span { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 10px; border: 2px dashed var(--border-strong); font-weight: 800; }
.qr-placeholder p { max-width: 220px; margin: 0; font-size: 11px; }
.qr-result-panel img { max-width: 100%; max-height: 300px; }
.qr-result-panel textarea { min-height: 270px; }
.qr-backend { margin: 0 18px 18px; }

.home-layout { width: min(1380px, calc(100% - 32px)); flex: 1 0 auto; margin: 30px auto 56px; display: grid; grid-template-columns: 160px minmax(0,1fr) 160px; gap: 20px; }
.home-content { min-width: 0; }
.home-hero { padding: 28px 30px; border: 1px solid var(--border-strong); background: var(--surface); box-shadow: 0 2px 9px var(--shadow); }
.home-hero h1 { max-width: 720px; margin: 0; font-size: clamp(25px,4vw,38px); line-height: 1.2; letter-spacing: -.045em; }
.home-hero > p:last-child { max-width: 700px; margin: 11px 0 0; color: var(--text-muted); }
.tool-directory { margin-top: 28px; }
.directory-heading { display: flex; align-items: flex-end; justify-content: space-between; padding-bottom: 10px; border-bottom: 2px solid var(--brand); }
.directory-heading h2 { margin: 0; font-size: 18px; }
.directory-heading span { color: var(--text-muted); font-size: 11px; }
.tool-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.tool-card { min-width: 0; min-height: 142px; display: grid; grid-template-columns: 48px minmax(0,1fr) 18px; gap: 13px; align-items: start; padding: 17px; border: 1px solid var(--border); background: var(--surface); }
.tool-card:hover { border-color: var(--accent); box-shadow: 0 3px 12px var(--shadow); transform: translateY(-1px); }
.tool-card-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 4px; background: var(--brand); color: var(--topbar-text); font-size: 10px; font-weight: 800; }
.tool-card h3 { margin: 1px 0 5px; font-size: 14px; }
.tool-card p { min-height: 39px; margin: 0 0 10px; color: var(--text-muted); font-size: 11px; }
.tool-card > b { align-self: center; color: var(--accent); font-size: 18px; }

.video-converter-card { border: 1px solid var(--border-strong); background: var(--surface); box-shadow: 0 2px 9px var(--shadow); }
.video-converter-grid { display: grid; grid-template-columns: minmax(0,.9fr) minmax(420px,1.1fr); }
.video-source-column, .video-settings-column { min-width: 0; padding: 18px; }
.video-source-column { border-right: 1px solid var(--border); }
.video-format-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compression-method { margin: 18px 0 0; padding: 0; border: 0; }
.compression-method legend { margin-bottom: 8px; font-size: 11px; font-weight: 800; }
.compression-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border: 1px solid var(--border); }
.compression-tabs label { min-height: 70px; display: flex; gap: 8px; align-items: flex-start; padding: 10px; border-right: 1px solid var(--border); color: var(--text-muted); cursor: pointer; }
.compression-tabs label:last-child { border-right: 0; }
.compression-tabs label:has(input:checked) { background: var(--accent-soft); color: var(--accent); }
.compression-tabs input { margin-top: 3px; accent-color: var(--accent); }
.compression-tabs b, .compression-tabs small { display: block; }
.compression-tabs b { color: var(--text); font-size: 10px; }
.compression-tabs small { margin-top: 2px; font-size: 9px; line-height: 1.35; }
.size-mode-panel { padding: 0 12px 12px; border: 1px solid var(--border); border-top: 0; background: var(--surface-subtle); }
.unit-input { display: flex; }
.unit-input input { min-width: 0; border-radius: 3px 0 0 3px !important; }
.unit-input span { min-width: 54px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 3px 3px 0; background: var(--surface); color: var(--text-muted); font-size: 10px; }
.setting-hint { margin: 7px 0 0; color: var(--text-muted); font-size: 9px; }
.advanced-settings { margin-top: 12px; padding-top: 2px; }
.compression-summary { display: grid; grid-template-columns: repeat(3,1fr); margin-top: 16px; border: 1px solid var(--border); background: var(--surface-subtle); }
.compression-summary div { min-width: 0; padding: 9px 10px; border-right: 1px solid var(--border); }
.compression-summary div:last-child { border-right: 0; }
.compression-summary span, .compression-summary strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compression-summary span { color: var(--text-muted); font-size: 9px; }
.compression-summary strong { margin-top: 2px; font-size: 10px; }

.beautifier-card { border: 1px solid var(--border-strong); background: var(--surface); box-shadow: 0 2px 9px var(--shadow); }
.beautifier-toolbar { padding-right: 10px; }
.code-language-tabs .mode-tab { min-width: 112px; }
.load-code-button { min-height: 34px; display: inline-flex; align-items: center; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--surface); color: var(--text-muted); cursor: pointer; font-size: 10px; font-weight: 700; }
.load-code-button:hover { background: var(--bg); }
.load-code-button input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.style-options { display: grid; grid-template-columns: repeat(4,minmax(115px,1fr)) auto; gap: 10px; align-items: end; padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--surface-subtle); }
.style-options label > span { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: 9px; font-weight: 800; }
.style-options select { width: 100%; min-height: 34px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--surface); color: var(--text); font-size: 10px; }
.style-options .style-check { min-height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 8px; color: var(--text-muted); font-size: 10px; white-space: nowrap; }
.style-options .style-check span { display: inline; margin: 0; }
.style-check input { accent-color: var(--accent); }
.beautifier-editors { display: grid; grid-template-columns: minmax(0,1fr) 50px minmax(0,1fr); padding: 18px; }
textarea.code-editor { min-height: 430px; tab-size: 4; white-space: pre; overflow: auto; }
.code-highlight-wrap { position: relative; min-width: 0; }
.code-highlight { position: absolute; inset: 0; z-index: 0; margin: 0; padding: 14px 15px; overflow: hidden; border: 1px solid transparent; white-space: pre; pointer-events: none; color: var(--text); font-family: "Cascadia Code", Consolas, "Malgun Gothic", monospace; font-size: 13px; line-height: 1.7; tab-size: 4; }
textarea.highlighted-editor { position: relative; z-index: 1; background: transparent; color: transparent; caret-color: var(--text); -webkit-text-fill-color: transparent; }
.output-panel textarea.highlighted-editor { background: transparent; }
textarea.highlighted-editor::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.syntax-comment { color: #7b8492; font-style: italic; }
.syntax-string { color: #16815e; }
.syntax-number { color: #b46413; }
.syntax-keyword { color: #7b4fc9; font-weight: 700; }
.syntax-key { color: #196ab3; }
.syntax-tag { color: #196ab3; font-weight: 700; }
.syntax-attribute { color: #9a5a12; }
.syntax-selector { color: #7b4fc9; }
.syntax-property { color: #196ab3; }
.syntax-literal { color: #c14848; }
[data-theme="dark"] .syntax-comment, [data-theme="black"] .syntax-comment { color: #8d98a8; }
[data-theme="dark"] .syntax-string, [data-theme="black"] .syntax-string { color: #65c49b; }
[data-theme="dark"] .syntax-number, [data-theme="black"] .syntax-number { color: #e6a866; }
[data-theme="dark"] .syntax-keyword, [data-theme="dark"] .syntax-selector, [data-theme="black"] .syntax-keyword, [data-theme="black"] .syntax-selector { color: #c49af2; }
[data-theme="dark"] .syntax-key, [data-theme="dark"] .syntax-tag, [data-theme="dark"] .syntax-property, [data-theme="black"] .syntax-key, [data-theme="black"] .syntax-tag, [data-theme="black"] .syntax-property { color: #78b9ef; }
[data-theme="dark"] .syntax-attribute, [data-theme="black"] .syntax-attribute { color: #e7b36f; }
[data-theme="dark"] .syntax-literal, [data-theme="black"] .syntax-literal { color: #ef8b8b; }

.site-footer { border-top: 1px solid var(--border); background: var(--surface-subtle); }
.footer-inner {
  width: min(1380px, calc(100% - 32px));
  min-height: 56px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-muted);
  font-size: 11px;
}
.footer-inner p { margin: 0; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 12px; font-weight: 800; }
.footer-brand b { font-weight: 800; }
.footer-brand span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 3px; background: var(--brand); color: var(--topbar-text); font-size: 9px; }
.footer-link { color: var(--text-muted); }
.footer-link:hover { color: var(--accent); }
.footer-standard { margin-left: auto !important; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 10; transform: translateX(-50%); padding: 10px 16px; border-radius: 3px; background: #20242c; color: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.2); font-size: 12px; }

@media (max-width: 1120px) {
  .page-grid { width: min(960px, calc(100% - 32px)); grid-template-columns: 1fr; }
  .home-layout { width: min(960px, calc(100% - 32px)); grid-template-columns: 1fr; }
  .ad-rail { display: none; }
}

@media (max-width: 820px) {
  .page-grid { margin-top: 18px; }
  .editor-grid { grid-template-columns: 1fr; gap: 10px; }
  .swap-column { padding: 0; }
  .swap-button { width: 76px; min-height: 36px; flex-direction: row; gap: 5px; }
  textarea { min-height: 225px; }
  .file-tools-grid { grid-template-columns: 1fr; }
  .ico-workspace { grid-template-columns: 1fr; }
  .ico-source-panel { border-right: 0; border-bottom: 1px solid var(--border); }
  .mp3-workspace { grid-template-columns: 1fr; }
  .mp3-source-panel { border-right: 0; border-bottom: 1px solid var(--border); }
  .utility-grid { grid-template-columns: 1fr; }
  .utility-source { border-right: 0; border-bottom: 1px solid var(--border); }
  .qr-body { grid-template-columns: 1fr; }
  .tool-card-grid { grid-template-columns: 1fr; }
  .video-converter-grid { grid-template-columns: 1fr; }
  .video-source-column { border-right: 0; border-bottom: 1px solid var(--border); }
  .style-options { grid-template-columns: 1fr 1fr; }
  .style-options .style-check { align-self: end; }
  .beautifier-editors { grid-template-columns: 1fr; gap: 10px; }
  textarea.code-editor { min-height: 280px; }
}

@media (max-width: 600px) {
  .topbar-inner, .page-grid { width: min(100% - 20px, 1380px); }
  .home-layout { width: min(100% - 20px, 1380px); margin-top: 18px; }
  .home-hero { padding: 22px 18px; }
  .topbar-inner { min-height: 50px; }
  .brand { padding-right: 14px; }
  .nav-link { padding: 0 7px; }
  .theme-toggle { min-width: 42px; width: 42px; padding: 0; }
  .theme-label { display: none; }
  .language-picker { margin-right: 5px; }
  .language-picker select { min-width: 64px; width: 64px; padding-left: 6px; padding-right: 18px; }
  .page-heading { align-items: flex-start; }
  .converter-toolbar { align-items: stretch; padding: 0; flex-direction: column; }
  .mode-tabs { min-height: 58px; }
  .mode-tab { min-width: 0; flex: 1; padding: 0 12px; }
  .option-toggle { padding: 7px 14px; border-top: 1px solid var(--border); }
  .dimension-grid, .qr-style-grid { grid-template-columns: 1fr; }
  .editor-grid { padding: 13px; }
  .panel-heading { min-height: 28px; }
  textarea { min-height: 190px; }
  .action-bar { padding: 12px 13px; }
  .action-buttons { display: grid; grid-template-columns: 1fr 1fr; }
  .button { width: 100%; min-height: 42px; }
  .file-section-heading { align-items: flex-start; }
  .file-section-heading > span { display: none; }
  .file-tool-panel { padding: 13px; }
  .file-fields { grid-template-columns: 1fr; }
  .file-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .ico-source-panel, .ico-settings-panel { padding: 13px; }
  .ico-drop-zone { min-height: 180px; }
  .ico-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .mp3-source-panel, .mp3-settings-panel { padding: 13px; }
  .video-drop-zone { min-height: 190px; }
  .mp3-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .utility-source, .utility-settings { padding: 13px; }
  .utility-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .video-source-column, .video-settings-column { padding: 13px; }
  .compression-tabs { grid-template-columns: 1fr; }
  .compression-tabs label { min-height: 54px; border-right: 0; border-bottom: 1px solid var(--border); }
  .compression-tabs label:last-child { border-bottom: 0; }
  .compression-summary { grid-template-columns: 1fr; }
  .compression-summary div { border-right: 0; border-bottom: 1px solid var(--border); }
  .compression-summary div:last-child { border-bottom: 0; }
  .beautifier-toolbar { align-items: stretch; padding: 0; flex-direction: column; }
  .code-language-tabs { min-height: 58px; overflow-x: auto; }
  .code-language-tabs .mode-tab { min-width: 100px; }
  .load-code-button { margin: 8px 12px; justify-content: center; }
  .style-options { padding: 12px 13px; }
  .beautifier-editors { padding: 13px; }
  .footer-inner { width: min(100% - 20px, 1380px); min-height: 56px; gap: 10px; }
  .footer-inner > p:not(.footer-standard) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
