* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --navy: #0c2348;
  --ink: #142033;
  --blue: #2f6bff;
  --blue-dark: #1d54e0;
  --muted: #6d7d92;
  --line: #e5edf6;
  --card: #ffffff;
  --bg: #eef3fb;
  --success: #16803c;
  --success-soft: #e8f8ef;
  --error: #d12626;
  --error-soft: #fdecec;
  --shadow: 0 1px 2px rgba(16, 42, 80, 0.04), 0 18px 40px rgba(20, 48, 90, 0.08);
}

html,
body {
  height: 100%;
}

body {
  font-family: Manrope, "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(125deg, #f2f8fe 0%, #dcebfb 42%, #e8f2fb 100%);
  color: var(--ink);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.backdrop {
  position: absolute;
  left: 0;
  right: 0;
  top: 64px;
  height: 250px;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.streak {
  position: absolute;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));
  transform: rotate(-28deg);
  border-radius: 999px;
}

.streak-1 {
  width: 720px;
  height: 90px;
  top: -30px;
  right: 8%;
}

.streak-2 {
  width: 560px;
  height: 54px;
  top: 70px;
  right: -6%;
  opacity: 0.65;
}

.backdrop-truck {
  position: absolute;
  right: 6%;
  top: 6px;
  width: min(480px, 42vw);
  height: 228px;
  object-fit: contain;
  object-position: right center;
  pointer-events: none;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, #000 14%, #000 72%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 16%, #000 78%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0%, #000 14%, #000 72%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 16%, #000 78%, transparent 100%);
  mask-composite: intersect;
}

.site-header {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 8px 24px rgba(8, 24, 56, 0.16);
}

.brand,
.header-actions,
.header-chip,
.signout-btn,
.crumb,
.hero-title,
.panel-head,
.field-control,
.btn,
.saved-item,
.ready-badge,
.file-status {
  display: flex;
  align-items: center;
}

.brand { gap: 12px; min-width: 0; }
.header-actions { gap: 10px; }

.logo,
.logo svg {
  width: 36px;
  height: 36px;
  display: block;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.brand-text span { font-size: 12px; color: #b7c6dc; font-weight: 600; }

.header-chip,
.signout-btn {
  gap: 8px;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.header-chip { text-transform: uppercase; }

.header-chip {
  color: #fff;
  background: var(--blue);
  padding: 9px 14px;
}

.signout-btn {
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  padding: 8px 14px;
  cursor: pointer;
}

.signout-btn:hover { background: rgba(255, 255, 255, 0.08); }

.header-chip svg,
.signout-btn svg,
.crumb svg,
.head-icon svg,
.field-control > svg,
.drop-icon,
.btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-chip svg,
.signout-btn svg { width: 16px; height: 16px; }

.page {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 22px auto 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero {
  position: relative;
  min-height: 210px;
  padding: 8px 8px 6px;
}

.hero-copy { position: relative; z-index: 1; max-width: 680px; }

.crumb {
  gap: 8px;
  color: #7b8da3;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}

.crumb svg { width: 16px; height: 16px; }

.hero-title { gap: 14px; align-items: flex-start; }

.hero-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(47, 107, 255, 0.14);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.hero-mark svg { width: 36px; height: 36px; display: block; }

.hero h1 {
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 800;
  color: #172033;
  margin-bottom: 6px;
}

.lede {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
  max-width: 62ch;
}

.desk {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 16px;
  align-items: stretch;
}

.panel {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 22px;
  min-width: 0;
}

.panel-head { gap: 12px; align-items: flex-start; margin-bottom: 16px; }

.head-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e8f1ff;
  color: var(--blue);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.head-icon svg { width: 18px; height: 18px; }
.head-icon-folder { background: #e8f1ff; }

.panel-head h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.panel-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.saved-head { align-items: center; }
.saved-head > div { flex: 1; min-width: 0; }

.ready-badge {
  gap: 6px;
  margin-left: auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.ready-badge[hidden] { display: none; }

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.ready-badge.is-processing {
  background: #e8f1ff;
  color: var(--blue);
}

.form-row { display: flex; flex-direction: column; margin-bottom: 14px; }

.form-row label {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 7px;
}

.field-control { position: relative; }

.field-control > svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  color: #93a3b8;
  transform: translateY(-50%);
  pointer-events: none;
}

.field-notes > svg { top: 14px; transform: none; }

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid #dbe5f0;
  border-radius: 12px;
  padding: 12px 13px;
  outline: none;
}

.field-control input,
.field-control textarea { padding-left: 38px; }

.form-row select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236d7d92' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-row input::placeholder,
.form-row textarea::placeholder { color: #9aabbd; font-weight: 600; }

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.12);
}

.form-row textarea { resize: vertical; min-height: 84px; }

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 210px;
  padding: 22px 16px;
  margin-bottom: 14px;
  border: 1.5px dashed #b9cce6;
  border-radius: 16px;
  background: #f7fbff;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: var(--blue);
  background: #f3f8ff;
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.08);
}

.drop-zone input[type="file"] { display: none; }

.drop-badge {
  width: 54px;
  height: 54px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: #e7f0ff;
  color: var(--blue);
  display: grid;
  place-items: center;
}

.drop-icon { width: 26px; height: 26px; }
.drop-title { font-size: 18px; font-weight: 800; letter-spacing: -0.03em; }
.drop-sub { font-size: 14px; color: var(--muted); }
.drop-sub strong { color: var(--blue); font-weight: 800; }

.type-chips {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.mini-type {
  min-width: 34px;
  padding: 5px 6px;
  border-radius: 5px;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-align: center;
}

.mini-type.pdf,
.type-badge.pdf { background: #ef4444; }
.mini-type.doc,
.type-badge.doc { background: #3b82f6; }
.mini-type.xls,
.type-badge.xls { background: #22a35a; }
.mini-type.img,
.type-badge.img { background: #8b5cf6; }
.type-badge.ppt { background: #f59e0b; }
.type-badge.txt,
.type-badge.file { background: #64748b; }

.drop-limit { margin-top: 8px; color: #8b9bb0; font-size: 12px; font-weight: 700; }

.file-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.file-list:empty { display: none; margin: 0; }

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}

.file-ext {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
  color: var(--blue);
  border: 1px solid #e3edf8;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-name { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size,
.saved-meta { font-size: 12px; color: var(--muted); font-weight: 600; }

.file-status {
  gap: 6px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
}

.file-status:empty { display: none; }
.file-status.uploading,
.file-status.processing { background: #e8f1ff; color: #1d4ed8; }
.file-status.done,
.file-status.ready { background: var(--success-soft); color: var(--success); }
.file-status.failed { background: var(--error-soft); color: var(--error); }

.file-status.processing::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 1.6px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.file-status.ready::before,
.file-status.done::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.remove-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  padding: 4px 8px;
}

.remove-btn:hover { background: var(--error-soft); color: var(--error); }

.actions { display: flex; justify-content: flex-end; gap: 10px; }

.btn {
  gap: 8px;
  justify-content: center;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 11px 16px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(47, 107, 255, 0.28);
}
.btn-primary:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}
.btn-secondary { background: #fff; color: var(--ink); border-color: #d5e0ee; }
.btn-secondary:hover { background: #f8fbff; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.message { margin-top: 12px; font-size: 13.5px; font-weight: 700; }
.message:empty { display: none; }
.message.success,
.message.error { margin-top: 14px; padding: 10px 12px; border-radius: 12px; }
.message.success { color: var(--success); background: var(--success-soft); }
.message.error { color: var(--error); background: var(--error-soft); }

.saved-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.saved-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 220px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.5;
  padding: 28px 16px;
  text-align: center;
  border: 1px dashed #d5e0ec;
  border-radius: 16px;
  background: #fbfcfe;
}

.saved-empty::before {
  content: "";
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #e8f1ff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f6bff' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z'/%3E%3C/svg%3E") center / 26px no-repeat;
}

.saved-empty[hidden] { display: none; }

.saved-list {
  list-style: none;
  min-height: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.saved-list:empty { display: none; }

.saved-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px 8px;
  border-radius: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.saved-item:last-child { border-bottom: none; }
.saved-item:hover { background: #f7faff; }

.type-badge {
  width: 36px;
  height: 40px;
  border-radius: 7px;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
  display: grid;
  place-items: center;
}

.saved-time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.row-menu { position: relative; }

.menu-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #7d8da1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.menu-btn svg { width: 16px; height: 16px; fill: currentColor; }
.menu-btn:hover,
.menu-btn[aria-expanded="true"] { background: #eef3f9; }
.menu-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.menu-pop {
  position: fixed;
  z-index: 40;
  min-width: 128px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 35, 70, 0.16);
}

.menu-pop[hidden] { display: none; }

.delete-btn {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--error);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.delete-btn:hover { background: var(--error-soft); }
.delete-btn:disabled { opacity: 0.6; cursor: not-allowed; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .backdrop-truck,
  .streak { display: none; }
  .desk { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
  .ready-badge { white-space: normal; }
  .saved-head { flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .site-header { padding: 12px 16px; }
  .header-chip { display: none; }
  .page { width: min(1180px, calc(100% - 24px)); }
  .saved-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .saved-item .file-status,
  .saved-time { grid-column: 2; }
  .saved-time { grid-row: 2; }
  .saved-item .file-status { grid-row: 3; justify-self: start; }
  .row-menu { grid-row: 1; grid-column: 3; }
  .actions { flex-direction: column-reverse; }
  .btn { width: 100%; }
}
