:root {
  --ink: #0b2545;
  --muted: #58728f;
  --paper: #edf8ff;
  --surface: #ffffff;
  --line: #c8dfef;
  --sky: #83dcff;
  --blue: #1769c2;
  --danger: #b84035;
  --mono: "DM Mono", monospace;
  --sans: "Manrope", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); }
button, input, textarea { font: inherit; }
button, .dropzone { -webkit-tap-highlight-color: transparent; }

.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 0 4.5vw; }
.brand { color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 11px; font-size: 18px; font-weight: 600; letter-spacing: -.5px; }
.brand b { font-weight: 600; color: var(--blue); }
.brand-mark { width: 28px; height: 28px; border: 1.5px solid var(--ink); border-radius: 50%; display: grid; place-items: center; }
.brand-mark span { width: 8px; height: 8px; background: var(--sky); border: 1px solid var(--ink); border-radius: 50%; box-shadow: 6px 0 0 -1px var(--paper), 6px 0 0 0 var(--blue); }
.top-actions { display: flex; align-items: center; gap: 30px; font-size: 12px; }
.top-actions a { color: var(--ink); text-decoration: none; font-weight: 600; }
.privacy { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.privacy i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px rgba(23,105,194,.13); }

main { overflow: hidden; }
.hero { max-width: 1180px; margin: 0 auto; padding: 78px 28px 70px; }
.eyebrow, .section-label { font-family: var(--mono); font-size: 11px; letter-spacing: 1.6px; display: flex; align-items: center; gap: 13px; color: #294b70; }
.eyebrow span, .section-label span { border: 1px solid var(--ink); border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; letter-spacing: 0; font-size: 9px; }
h1 { font-size: clamp(52px, 7.2vw, 104px); line-height: .94; letter-spacing: -6px; margin: 34px 0 28px; font-weight: 500; max-width: 1100px; }
h1 em { font-family: Georgia, serif; font-weight: 400; color: var(--blue); }
.lede { font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 660px; margin: 0 0 42px; }

.dropzone { min-height: 176px; border: 1.5px dashed #8bb8d8; background: rgba(255,255,255,.55); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 26px; padding: 34px 40px; cursor: pointer; position: relative; transition: .2s ease; outline: none; }
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragging { border-color: var(--blue); background: #f5fbff; transform: translateY(-2px); box-shadow: 0 12px 35px rgba(23,105,194,.10); }
.upload-icon { width: 76px; height: 76px; border-radius: 50%; background: var(--sky); display: grid; place-items: center; border: 1px solid var(--ink); }
.upload-icon svg { width: 29px; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.drop-copy { display: flex; flex-direction: column; gap: 7px; }
.drop-copy strong { font-size: 21px; font-weight: 600; letter-spacing: -.4px; }
.drop-copy span { color: var(--muted); font-size: 14px; }
.drop-copy u { color: var(--ink); text-underline-offset: 3px; }
.limit { font-family: var(--mono); font-size: 10px; color: var(--muted); align-self: end; }
.format-row { display: flex; gap: 30px; align-items: center; margin-top: 22px; font-family: var(--mono); font-size: 9px; letter-spacing: 1px; color: var(--muted); }
.format-row > div { display: flex; gap: 9px; flex-wrap: wrap; }
.format-row b { font-weight: 400; border: 1px solid var(--line); border-radius: 20px; padding: 7px 12px; color: #315574; background: rgba(255,255,255,.72); }

.workspace { width: calc(100% - 36px); max-width: 1680px; height: min(760px, calc(100vh - 115px)); min-height: 580px; margin: 28px auto 70px; border: 1px solid var(--ink); background: var(--surface); display: grid; grid-template-columns: 270px minmax(470px, 1.35fr) minmax(300px, .9fr); grid-template-areas: "queue editor preview"; overflow: hidden; box-shadow: 8px 8px 0 var(--sky); }
.queue-panel { grid-area: queue; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; position: relative; border-right: 1px solid var(--line); }
.queue-panel.drop-ready { box-shadow: inset 0 0 0 2px var(--blue); }
.panel-head { height: 74px; display: flex; align-items: center; justify-content: space-between; padding: 0 19px 0 23px; border-bottom: 1px solid var(--line); }
.panel-head > div { display: flex; gap: 10px; align-items: center; font-family: var(--mono); font-size: 10px; letter-spacing: 1px; }
.panel-head b { display: grid; place-items: center; background: var(--ink); color: white; font-size: 9px; border-radius: 50%; width: 20px; height: 20px; }
.icon-button { border: 1px solid var(--line); background: transparent; width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; }
.icon-button:hover { background: var(--sky); border-color: var(--ink); }
.queue { flex: 1; overflow-y: auto; padding: 12px; }
.queue-drop-hint { position: absolute; left: 12px; right: 12px; top: 88px; bottom: 130px; min-height: 110px; z-index: 4; display: grid; place-items: center; align-content: center; gap: 7px; border: 1.5px dashed var(--blue); background: rgba(240,249,255,.95); color: var(--ink); opacity: 0; pointer-events: none; transform: translateY(6px); transition: .15s ease; }
.queue-drop-hint.show { opacity: 1; transform: translateY(0); }
.queue-drop-hint strong { font-size: 15px; letter-spacing: -.2px; }
.queue-drop-hint span { font-family: var(--mono); font-size: 8px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.queue-item { width: 100%; border: 1px solid transparent; background: transparent; padding: 10px 8px 10px 11px; display: grid; grid-template-columns: 35px minmax(0, 1fr) 10px 26px; gap: 8px; align-items: center; text-align: left; cursor: pointer; margin-bottom: 4px; color: var(--ink); }
.queue-item:hover { background: #edf7fd; }
.queue-item.active { background: white; border-color: var(--line); }
.file-icon { width: 35px; height: 39px; background: #e1f2fb; display: grid; place-items: center; font-family: var(--mono); font-size: 7px; border-radius: 2px; color: #315574; }
.queue-item.active .file-icon { background: var(--sky); color: var(--ink); }
.queue-copy { min-width: 0; }
.queue-copy strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 600; }
.queue-copy small { color: var(--muted); font-size: 10px; }
.remove-file { width: 25px; height: 25px; border: 0; border-radius: 50%; background: transparent; color: #8d8980; display: grid; place-items: center; cursor: pointer; opacity: .25; transition: .15s ease; }
.remove-file svg { width: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.queue-item:hover .remove-file, .remove-file:focus-visible { opacity: 1; }
.remove-file:hover { background: #f5ded9; color: var(--danger); }
.queue-state { width: 9px; height: 9px; border: 1px solid var(--muted); border-radius: 50%; }
.queue-state.done { background: var(--blue); border-color: var(--blue); }
.queue-state.error { background: var(--danger); border-color: var(--danger); }
.queue-state.loading { border-color: var(--blue); border-top-color: transparent; animation: spin .8s linear infinite; }
.queue-footer { padding: 12px; border-top: 1px solid var(--line); }
.global-savings { margin-bottom: 10px; padding: 11px 12px; border: 1px solid var(--line); background: #edf7fd; }
.global-savings > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.global-savings span { font-family: var(--mono); font-size: 8px; letter-spacing: .8px; color: var(--muted); }
.global-savings strong { font-size: 15px; letter-spacing: -.4px; }
.global-savings small { display: block; margin-top: 6px; font-family: var(--mono); font-size: 8px; line-height: 1.5; color: var(--muted); }
.bulk-button { width: 100%; border: 1px solid var(--ink); background: var(--sky); padding: 12px 13px; display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 9px; font-size: 11px; font-weight: 700; text-align: left; cursor: pointer; }
.bulk-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.bulk-button small { font-family: var(--mono); font-size: 8px; font-weight: 500; }
.bulk-button:hover:not(:disabled) { background: var(--ink); color: white; }
.bulk-button:disabled { opacity: .4; cursor: not-allowed; }
.combined-button { margin-top: 7px; background: var(--surface); }
.text-button { width: 100%; border: 0; background: transparent; padding: 14px 10px 2px; text-align: left; font-family: var(--mono); font-size: 9px; letter-spacing: 1px; color: var(--muted); cursor: pointer; }
.text-button:hover { color: var(--danger); }

.preview-panel { grid-area: preview; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; background: #eaf5fc; }
.preview-head { min-height: 74px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 12px 18px 12px 23px; gap: 16px; background: var(--surface); }
.preview-head span { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 1px; }
.preview-head small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.preview-top { width: 34px; height: 34px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; font-size: 16px; }
.preview-top:hover, .preview-top:focus-visible { background: var(--sky); border-color: var(--ink); }
.preview-scroll { flex: 1 1 0; min-height: 0; overflow: auto; padding: 28px 24px 44px; outline: none; scroll-behavior: smooth; }
.preview-scroll:focus-visible { box-shadow: inset 0 0 0 2px var(--blue); }
.preview-empty { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: var(--muted); }
.preview-empty strong { color: var(--ink); font-size: 14px; }
.preview-empty small { max-width: 210px; font-size: 11px; line-height: 1.5; }
.preview-content { width: 100%; min-height: 100%; padding: 36px clamp(24px, 3vw, 48px) 54px; background: #fff; color: #18334f; box-shadow: 0 1px 12px rgba(11,37,69,.09); overflow-wrap: anywhere; font-family: Georgia, "Times New Roman", serif; font-size: 15px; line-height: 1.72; }
.preview-content > :first-child { margin-top: 0; }
.preview-content > :last-child { margin-bottom: 0; }
.preview-content h1, .preview-content h2, .preview-content h3, .preview-content h4, .preview-content h5, .preview-content h6 { color: var(--ink); font-family: var(--sans); font-weight: 650; line-height: 1.2; letter-spacing: -.035em; margin: 1.65em 0 .65em; }
.preview-content h1 { padding-bottom: .38em; border-bottom: 2px solid var(--ink); font-size: 2em; }
.preview-content h2 { padding-bottom: .3em; border-bottom: 1px solid var(--line); font-size: 1.55em; }
.preview-content h3 { font-size: 1.25em; }
.preview-content h4, .preview-content h5, .preview-content h6 { font-size: 1em; letter-spacing: 0; }
.preview-content p, .preview-content ul, .preview-content ol, .preview-content blockquote, .preview-content pre, .preview-content table { margin: 0 0 1.15em; }
.preview-content ul, .preview-content ol { padding-left: 1.55em; }
.preview-content li + li { margin-top: .3em; }
.preview-content a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.preview-content blockquote { margin-left: 0; padding: .15em 0 .15em 1.1em; border-left: 3px solid var(--blue); color: #4e6984; }
.preview-content code { padding: .12em .35em; border: 1px solid #d3e6f2; border-radius: 3px; background: #edf7fd; font-family: var(--mono); font-size: .82em; }
.preview-content pre { overflow: auto; padding: 15px 17px; border: 1px solid #bdd8e9; background: var(--ink); color: #f5fbff; line-height: 1.55; }
.preview-content pre code { padding: 0; border: 0; background: transparent; color: inherit; }
.preview-content table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; font-family: var(--sans); font-size: .82em; }
.preview-content th, .preview-content td { min-width: 90px; padding: 8px 10px; border: 1px solid #c9dfec; text-align: left; vertical-align: top; }
.preview-content th { background: #eaf6fd; font-weight: 700; }
.preview-content hr { margin: 2em 0; border: 0; border-top: 1px solid #b8d3e5; }
.preview-image-placeholder { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 8px 10px; border: 1px dashed #9bbfd7; background: #eef8fe; color: var(--muted); font-family: var(--sans); font-size: 11px; }

.editor-panel { grid-area: editor; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.editor-head { min-height: 74px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 12px 18px 12px 25px; gap: 20px; }
.active-file span { display: block; font-family: var(--mono); font-size: 12px; margin-bottom: 5px; }
.active-file small { color: var(--muted); font-size: 10px; }
.editor-actions { display: flex; gap: 8px; }
.button { border: 1px solid var(--ink); padding: 10px 15px; font-size: 11px; font-weight: 600; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.button.secondary { background: transparent; }
.button.primary { background: var(--ink); color: white; }
.button:hover { background: var(--sky); color: var(--ink); }
.button:disabled { opacity: .35; cursor: not-allowed; }
.metrics-strip { display: grid; grid-template-columns: 1.2fr 1.35fr repeat(3, 1fr); border-bottom: 1px solid var(--line); background: #edf8ff; }
.metric { min-width: 0; padding: 12px 15px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric span, .metric small { display: block; font-family: var(--mono); color: var(--muted); }
.metric span { font-size: 8px; letter-spacing: .9px; margin-bottom: 6px; }
.metric strong { display: block; font-size: 15px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric small { font-size: 7px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.storage-metric strong { color: var(--blue); }
.quality-value { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quality-value strong { color: var(--blue); }
.quality-value b { font-family: var(--mono); font-size: 7px; font-weight: 500; padding: 4px 6px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); text-transform: uppercase; letter-spacing: .35px; }
.quality-value b.excellent, .quality-value b.high { color: #0d579c; border-color: #7fc9ef; background: #eaf7ff; }
.quality-value b.medium { color: #295d88; border-color: #a5cee6; background: #f2faff; }
.quality-value b.review { color: var(--danger); border-color: #d7a59f; background: #fff0ed; }
.quality-track { height: 3px; margin-top: 7px; background: #d1e5f1; overflow: hidden; }
.quality-track i { display: block; width: 0; height: 100%; background: var(--blue); transition: width .35s ease; }
.quality-track i.excellent, .quality-track i.high { background: var(--blue); }
.quality-track i.medium { background: #58bde8; }
.quality-track i.review { background: var(--danger); }
.editor-wrap { min-height: 0; overflow: hidden; flex: 1 1 0; display: grid; grid-template-columns: 50px minmax(0, 1fr); position: relative; background: #fbfdff; }
.editor-wrap.large-document { grid-template-columns: minmax(0, 1fr); }
.editor-wrap.large-document .line-numbers { display: none; }
.line-numbers { font-family: var(--mono); font-size: 12px; line-height: 1.75; color: #91a9bc; padding: 25px 12px; text-align: right; overflow: hidden; border-right: 1px solid #dfedf6; white-space: pre; user-select: none; }
#markdownEditor { border: 0; outline: 0; resize: none; padding: 25px 28px; width: 100%; height: 100%; min-width: 0; min-height: 0; display: block; background: transparent; color: #173652; font-family: var(--mono); font-size: 12px; line-height: 1.75; tab-size: 2; overflow: auto; }
.empty-editor { position: absolute; inset: 0; background: rgba(251,253,255,.95); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; }
.empty-editor[hidden] { display: none; }
.empty-editor strong { font-size: 14px; }
.empty-editor small { color: var(--muted); }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--blue); animation: spin .8s linear infinite; margin-bottom: 8px; }
.statusbar { height: 36px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 17px; color: var(--muted); font-family: var(--mono); font-size: 9px; letter-spacing: .3px; }
.statusbar > span:first-child { display: flex; align-items: center; gap: 8px; }
.status-dot { width: 6px; height: 6px; background: var(--blue); border-radius: 50%; }

.features { border-top: 1px solid var(--line); padding: 74px max(5vw, 28px) 105px; background: #e3f3fc; }
.features .section-label { max-width: 1180px; margin: 0 auto 52px; }
.feature-grid { max-width: 1180px; margin: auto; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #a9cada; }
.feature-grid article { padding: 32px 45px 10px 0; min-height: 270px; border-right: 1px solid #a9cada; position: relative; }
.feature-grid article:not(:first-child) { padding-left: 38px; }
.feature-grid article:last-child { border: 0; }
.feature-number { font-family: var(--mono); color: var(--muted); font-size: 10px; }
.feature-grid h2 { font-size: 28px; line-height: 1.13; letter-spacing: -1.2px; font-weight: 500; margin: 43px 0 18px; }
.feature-grid p { color: var(--muted); font-size: 13px; line-height: 1.65; max-width: 290px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: white; padding: 12px 18px; font-size: 12px; opacity: 0; pointer-events: none; transition: .25s ease; z-index: 10; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }
.drop-overlay { position: fixed; inset: 16px; z-index: 9; display: grid; place-items: center; align-content: center; gap: 8px; border: 2px dashed var(--blue); background: rgba(237,248,255,.92); color: var(--ink); opacity: 0; pointer-events: none; transform: scale(.98); transition: .15s ease; }
.drop-overlay.show { opacity: 1; transform: scale(1); }
.drop-overlay strong { font-size: 22px; letter-spacing: -.4px; }
.drop-overlay span { color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .topbar { height: 66px; padding: 0 20px; }
  .privacy { display: none; }
  .hero { padding: 55px 20px; }
  h1 { letter-spacing: -3px; }
  .dropzone { grid-template-columns: auto 1fr; padding: 27px 22px; gap: 18px; }
  .upload-icon { width: 58px; height: 58px; }
  .limit { display: none; }
  .format-row { align-items: flex-start; }
  .workspace { margin: 18px 12px 60px; height: auto; min-height: 1120px; grid-template-columns: 1fr; grid-template-rows: 175px 545px 400px; grid-template-areas: "queue" "editor" "preview"; box-shadow: 5px 5px 0 var(--sky); }
  .preview-panel { border-bottom: 0; }
  .preview-scroll { padding: 18px; }
  .preview-content { padding: 30px 25px 42px; }
  .editor-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .queue-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .panel-head { height: 55px; }
  .queue { display: flex; overflow-x: auto; padding: 8px; }
  .queue-drop-hint { top: 58px; bottom: 8px; right: 8px; left: 8px; min-height: 70px; }
  .queue-item { min-width: 215px; margin: 0 4px 0 0; }
  .queue-footer { position: absolute; right: 52px; top: 8px; border: 0; padding: 0; }
  .queue-footer { display: flex; gap: 4px; }
  .global-savings { display: none; }
  .bulk-button { width: auto; grid-template-columns: 17px auto; padding: 9px 10px; }
  .combined-button { margin-top: 0; }
  .bulk-button small { display: none; }
  .text-button { display: block; width: auto; padding: 9px 7px; font-size: 8px; }
  .editor-head { align-items: flex-start; padding: 12px; }
  .active-file { max-width: 125px; overflow: hidden; }
  .button { padding: 9px 10px; }
  .button.secondary { font-size: 0; gap: 0; }
  .metrics-strip { grid-template-columns: repeat(3, 1fr); }
  .quality-metric, .storage-metric { grid-column: span 3; border-right: 0; border-bottom: 1px solid var(--line); }
  .metric { padding: 8px 10px; }
  .metric strong { font-size: 12px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid article, .feature-grid article:not(:first-child) { border-right: 0; border-bottom: 1px solid #a9cada; padding: 30px 0; min-height: 220px; }
}

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