:root {
  --paper: #f4f1ea;
  --surface: #fffdf8;
  --ink: #17211c;
  --muted: #68706b;
  --line: #d8d8cf;
  --green: #165f45;
  --green-dark: #0d4733;
  --lime: #c9f36b;
  --danger: #a2382f;
  --radius: 24px;
  --shadow: 0 24px 70px rgba(32, 46, 38, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; padding-bottom: 130px; background: radial-gradient(circle at 82% 6%, rgba(201,243,107,.16), transparent 28rem), var(--paper); }
button, input { font: inherit; }
button { color: inherit; }

.topbar {
  width: min(1280px, calc(100% - 72px));
  height: 92px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 780; letter-spacing: -.03em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--lime); font-family: Georgia, serif; font-style: italic; }
.privacy-pill { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #32a971; box-shadow: 0 0 0 4px rgba(50,169,113,.12); }

.shell { width: min(1280px, calc(100% - 72px)); margin: 64px auto 0; }
.intro { max-width: 820px; margin-bottom: 54px; }
.eyebrow { margin: 0 0 17px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; font: 650 clamp(52px, 5.6vw, 82px)/.98 Georgia, "Times New Roman", serif; letter-spacing: -.055em; }
h1 em { color: var(--green); font-weight: 400; }
.lede { max-width: 610px; margin: 25px 0 0; color: var(--muted); font-size: 17px; line-height: 1.65; }

.workspace { display: grid; grid-template-columns: minmax(410px, .92fr) minmax(560px, 1.08fr); gap: 28px; align-items: stretch; }
.workspace:has(.queue[hidden]) { display: flex; justify-content: center; }
.workspace:has(.queue[hidden]) .dropzone { width: min(720px, 100%); }
.dropzone {
  min-height: 460px;
  padding: 52px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1.5px dashed #a8afa7;
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255,253,248,.78), rgba(239,243,231,.62));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--green); background: var(--surface); transform: translateY(-2px); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-icon { width: 76px; height: 76px; margin-bottom: 24px; display: grid; place-items: center; border-radius: 24px; background: var(--lime); color: var(--green-dark); box-shadow: 0 12px 24px rgba(111,151,51,.18); }
.drop-icon svg { width: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dropzone strong { font-size: 21px; letter-spacing: -.02em; }
.dropzone > span.desktop-copy { margin-top: 5px; color: var(--muted); font-size: 14px; }
.dropzone small { margin-top: 18px; color: #8a918d; font-size: 12px; }

.queue { min-height: 460px; border: 1px solid rgba(216,216,207,.9); border-radius: var(--radius); background: rgba(255,253,248,.86); box-shadow: var(--shadow); overflow: hidden; }
.queue-head { padding: 26px 30px 21px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.queue-label { margin: 0 0 5px; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.queue h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.text-button { padding: 8px 0; border: 0; background: none; color: var(--danger); font-size: 13px; font-weight: 700; cursor: pointer; }
.file-list { max-height: 540px; padding: 12px 14px; overflow: auto; }
.file-card { min-width: 0; padding: 14px; display: grid; grid-template-columns: 64px minmax(0,1fr) auto 30px; gap: 15px; align-items: center; border-radius: 17px; transition: background .18s ease; }
.file-card:hover { background: #f5f5ef; }
.file-card + .file-card { border-top: 1px solid #e7e6df; border-radius: 0; }
.thumb { width: 64px; height: 64px; border-radius: 15px; object-fit: cover; background: #e5e3dc; }
.file-info { min-width: 0; }
.file-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.file-meta { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.file-status { padding: 6px 9px; border-radius: 999px; background: #eeede7; color: var(--muted); font-size: 11px; font-weight: 750; white-space: nowrap; }
.file-card.clean .file-status { background: #e2f3e9; color: var(--green); }
.file-card.error .file-status { background: #fae9e6; color: var(--danger); }
.progress-track { height: 3px; margin-top: 9px; border-radius: 3px; background: #e8e7e0; overflow: hidden; opacity: 0; }
.processing .progress-track { opacity: 1; }
.progress-track span { display: block; width: 35%; height: 100%; background: var(--green); animation: loading 1s ease-in-out infinite alternate; }
@keyframes loading { to { transform: translateX(185%); } }
.remove-button { width: 30px; height: 30px; padding: 7px; border: 0; border-radius: 50%; background: transparent; color: #929793; cursor: pointer; }
.remove-button:hover { background: #ecebe5; color: var(--ink); }
.remove-button svg { width: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; }

.action-dock {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  width: min(900px, calc(100% - 32px));
  padding: 12px 12px 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 20px;
  background: rgba(23,33,28,.95);
  color: white;
  box-shadow: 0 16px 50px rgba(17,27,21,.3);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}
.format-picker { margin: 0; padding: 0; display: flex; gap: 3px; border: 0; }
.format-picker legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.format-picker label { cursor: pointer; }
.format-picker input { position: absolute; opacity: 0; pointer-events: none; }
.format-picker span { min-width: 48px; height: 38px; padding: 0 11px; display: grid; place-items: center; border-radius: 10px; color: #aeb9b2; font-size: 12px; font-weight: 750; transition: .18s ease; }
.format-picker input:checked + span { background: rgba(255,255,255,.13); color: var(--lime); }
.format-picker input:focus-visible + span { outline: 2px solid var(--lime); outline-offset: 2px; }
.dock-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dock-copy strong { font-size: 14px; }
.dock-copy span { overflow: hidden; color: #aeb9b2; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.primary-button { min-height: 50px; padding: 0 20px; display: flex; align-items: center; justify-content: center; gap: 13px; border: 0; border-radius: 14px; background: var(--lime); color: var(--green-dark); font-weight: 800; cursor: pointer; white-space: nowrap; }
.primary-button:hover { filter: brightness(.96); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.primary-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 800px) {
  body { padding-bottom: 122px; }
  .topbar { width: calc(100% - 32px); height: 68px; }
  .privacy-pill { font-size: 0; }
  .privacy-pill::after { content: "Riêng tư"; font-size: 12px; }
  .shell { width: calc(100% - 28px); margin-top: 32px; }
  .intro { margin-bottom: 30px; }
  h1 { font-size: clamp(42px, 13vw, 62px); }
  .lede { margin-top: 20px; font-size: 15px; line-height: 1.55; }
  .workspace { display: flex; flex-direction: column; }
  .workspace:has(.queue[hidden]) .dropzone { width: 100%; }
  .dropzone { width: 100%; min-height: 220px; padding: 30px 18px; }
  .desktop-copy { display: none; }
  .queue { width: 100%; }
  .file-list { max-height: none; }
  .file-card { grid-template-columns: 52px minmax(0,1fr) 30px; gap: 11px; }
  .thumb { width: 52px; height: 52px; }
  .file-status { grid-column: 2; justify-self: start; margin-top: -4px; }
  .remove-button { grid-column: 3; grid-row: 1 / span 2; }
  .action-dock { bottom: max(10px, env(safe-area-inset-bottom)); width: calc(100% - 20px); padding: 10px; border-radius: 18px; }
  .dock-copy { display: none; }
  .format-picker { flex: 0 0 auto; }
  .format-picker span { min-width: 43px; height: 46px; padding: 0 8px; }
  .primary-button { flex: 1; min-width: 0; min-height: 54px; padding-inline: 14px; }
  .primary-button svg { display: none; }
}

@media (min-width: 801px) and (max-width: 1180px) {
  .topbar, .shell { width: calc(100% - 48px); }
  .workspace { grid-template-columns: minmax(340px, .88fr) minmax(440px, 1.12fr); gap: 20px; }
  .dropzone, .queue { min-height: 420px; }
}

@media (max-width: 390px) {
  .action-dock { gap: 6px; }
  .format-picker span { min-width: 37px; padding: 0 6px; font-size: 11px; }
  .primary-button { font-size: 13px; }
}

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