:root {
  --ink: #f4f4f1;
  --muted: rgba(221, 221, 216, 0.76);
  --line: rgba(239, 193, 144, 0.16);
  --line-strong: rgba(244, 216, 183, 0.32);
  --panel: rgba(10, 10, 10, 0.76);
  --panel-strong: rgba(6, 6, 6, 0.9);
  --surface: linear-gradient(160deg, rgba(19, 19, 19, 0.9), rgba(6, 6, 6, 0.96));
  --accent: #ffb97a;
  --accent-strong: #ff9a42;
  --accent-soft: rgba(255, 185, 122, 0.16);
  --accent-blue: #6aa8ff;
  --accent-blue-soft: rgba(106, 168, 255, 0.16);
  --shadow-lg: 0 22px 48px rgba(0, 0, 0, 0.46);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --button-height: 46px;
  --button-radius: 16px;
  --button-gap: 0.62rem;
  --tool-stage-height: clamp(236px, 30vh, 292px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: "IBM Plex Sans", "Segoe UI", "Aptos", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.03), transparent 48%),
    radial-gradient(circle at 14% -2%, rgba(255, 154, 72, 0.26), transparent 36%),
    radial-gradient(circle at 84% 6%, rgba(106, 168, 255, 0.14), transparent 26%),
    linear-gradient(180deg, #111111 0%, #060606 100%);
  padding: 18px 16px 18px;
}

body.has-site-footer {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

body.has-site-footer .app {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  min-height: calc(100svh - 36px);
  padding-bottom: 26px;
}

.app {
  width: min(94vw, 1320px);
  max-width: 1320px;
  margin: 18px auto 0;
}

.hero {
  margin-bottom: 18px;
  text-align: left;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffbf86;
}

.hero h1 {
  margin: 0;
  font-family: "Sora", "IBM Plex Sans", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.subtitle {
  margin: 12px 0 0;
  max-width: 70ch;
  color: var(--muted);
  line-height: 1.6;
  font-size: clamp(0.98rem, 1.2vw, 1.08rem);
}

.workflow_strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.workflow_step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 209, 165, 0.12);
  border-radius: 20px;
  background:
    linear-gradient(155deg, rgba(14, 16, 20, 0.82), rgba(8, 10, 14, 0.92)),
    radial-gradient(circle at 18% 10%, rgba(255, 185, 122, 0.08), transparent 42%);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.workflow_step--primary {
  border-color: rgba(255, 209, 165, 0.36);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 185, 122, 0.18), transparent 46%),
    linear-gradient(155deg, rgba(46, 31, 22, 0.92), rgba(11, 14, 19, 0.96));
}

.workflow_icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffd39f;
  font-size: 1.28rem;
  flex: 0 0 auto;
}

.workflow_label {
  margin: 0 0 4px;
  color: #ffbe81;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.workflow_title {
  margin: 0;
  font-family: "Sora", "IBM Plex Sans", sans-serif;
  font-size: 0.98rem;
  line-height: 1.25;
}

.tool_shell {
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  flex: 1 1 auto;
  min-height: 0;
}

.upload_panel,
.list_panel {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(238, 184, 128, 0.26);
  border-top-color: rgba(255, 220, 186, 0.36);
  background:
    linear-gradient(160deg, rgba(14, 15, 20, 0.9), rgba(5, 5, 7, 0.96)),
    radial-gradient(circle at 10% 0%, rgba(255, 185, 122, 0.11), transparent 38%),
    radial-gradient(circle at 100% 4%, rgba(106, 168, 255, 0.1), transparent 34%);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  min-height: 0;
}

.upload_panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  min-height: 100%;
}

.list_panel {
  padding: 18px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100%;
}

.panel_head,
.list_head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 2px;
}

.panel_kicker,
.drop_kicker,
.list_kicker {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 191, 134, 0.76);
}

.panel_head h2,
.list_head h2 {
  margin: 0;
  font-family: "Sora", "IBM Plex Sans", sans-serif;
  line-height: 1.2;
}

.panel_head h2,
.list_head h2 {
  font-size: 1.22rem;
}

.panel_text,
.list_text {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}

.drop_zone {
  min-height: var(--tool-stage-height);
  display: grid;
  place-items: center;
  border-radius: 22px;
  border: 1px dashed rgba(242, 197, 145, 0.44);
  background:
    radial-gradient(circle at top, rgba(255, 185, 122, 0.11), transparent 44%),
    radial-gradient(circle at 86% 18%, rgba(106, 168, 255, 0.11), transparent 32%),
    linear-gradient(180deg, rgba(12, 18, 29, 0.9), rgba(6, 8, 13, 0.96));
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  outline: none;
  flex: 0 0 auto;
}

.file_input_proxy {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.drop_zone:hover,
.drop_zone:focus-visible,
.drop_zone.is-dragover {
  transform: translateY(-1px);
  border-color: rgba(255, 214, 167, 0.74);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.28),
    0 0 24px rgba(255, 154, 66, 0.1),
    inset 0 0 0 1px rgba(255, 214, 167, 0.06);
}

.drop_inner {
  width: min(100%, 280px);
  text-align: center;
}

.drop_inner h2,
.list_head h2 {
  margin: 0;
  font-family: "Sora", "IBM Plex Sans", sans-serif;
  font-size: 1.34rem;
  line-height: 1.2;
}

.drop_text {
  margin: 10px 0 18px;
  color: var(--muted);
  line-height: 1.55;
}

.button,
.primary_button,
.ghost_button,
.item_button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--button-gap);
  min-height: var(--button-height);
  width: fit-content;
  max-width: 100%;
  padding: 0.72rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--button-radius);
  font: inherit;
  font-weight: 600;
  font-size: 0.94rem;
  line-height: 1.2;
  text-align: center;
  vertical-align: middle;
  white-space: normal;
  text-wrap: balance;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.button .material-symbols-outlined,
.primary_button .material-symbols-outlined,
.ghost_button .material-symbols-outlined,
.item_button .material-symbols-outlined {
  font-size: 1.05rem;
}

.button--primary,
.primary_button {
  border-color: rgba(247, 208, 170, 0.5);
  background:
    radial-gradient(circle at 26% 18%, rgba(255, 236, 213, 0.22), transparent 46%),
    linear-gradient(150deg, rgba(44, 29, 21, 0.96), rgba(16, 26, 40, 0.92));
  color: #fff0da;
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 228, 200, 0.14);
}

.button:hover,
.primary_button:hover,
.item_button:hover,
.ghost_button:hover {
  transform: translateY(-1px);
}

.button--secondary,
.secondary_tone {
  border-color: rgba(130, 177, 255, 0.44);
  background:
    radial-gradient(circle at 24% 18%, rgba(191, 219, 255, 0.18), transparent 44%),
    linear-gradient(155deg, rgba(14, 26, 44, 0.96), rgba(8, 12, 22, 0.94));
  color: #eaf3ff;
}

.button--ghost,
.ghost_button {
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(160deg, rgba(16, 16, 18, 0.9), rgba(8, 8, 10, 0.94)),
    radial-gradient(circle at 88% 12%, rgba(255, 185, 122, 0.08), transparent 44%);
  color: var(--ink);
}

.button--wide {
  width: 100%;
}

.button--icon {
  justify-content: center;
}

.drop_inner .button,
.drop_inner .primary_button {
  margin-top: 18px;
}

.button:disabled,
.primary_button:disabled,
.ghost_button:disabled,
.item_button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.engine_status {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0.4rem 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(14, 16, 20, 0.92), rgba(8, 10, 14, 0.96)),
    radial-gradient(circle at 20% 20%, rgba(106, 168, 255, 0.08), transparent 44%);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.engine_status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(221, 221, 216, 0.5);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.03);
}

.engine_status[data-state="ready"] {
  color: #e8f0ff;
  border-color: rgba(106, 168, 255, 0.34);
}

.engine_status[data-state="ready"]::before {
  background: #7ab0ff;
}

.engine_status[data-state="loading"],
.engine_status[data-state="working"] {
  color: #ffd7b0;
  border-color: rgba(255, 185, 122, 0.34);
}

.engine_status[data-state="loading"]::before,
.engine_status[data-state="working"]::before {
  background: #ffb97a;
}

.engine_status[data-state="error"] {
  color: #ffb6b1;
}

.engine_status[data-state="error"]::before {
  background: #ff8d85;
}

.list_head {
  align-items: flex-start;
}

.list_meta_group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.list_meta {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 200, 150, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(244, 244, 241, 0.74);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

.empty_state {
  min-height: var(--tool-stage-height);
  height: var(--tool-stage-height);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  text-align: center;
  border-radius: 22px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background:
    linear-gradient(160deg, rgba(12, 14, 18, 0.82), rgba(8, 8, 10, 0.92)),
    radial-gradient(circle at 84% 0%, rgba(106, 168, 255, 0.08), transparent 40%);
}

.empty_state[hidden] {
  display: none !important;
}

.empty_state .material-symbols-outlined {
  font-size: 2.8rem;
  margin-bottom: 0.35rem;
}

.file_list {
  display: grid;
  gap: 12px;
  min-height: 0;
  flex: 1 1 auto;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  overscroll-behavior: contain;
  align-content: start;
  scrollbar-width: thin;
  scrollbar-color: rgba(236, 177, 109, 0.64) rgba(10, 16, 28, 0.72);
}

.file_list::-webkit-scrollbar {
  width: 10px;
}

.file_list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(10, 16, 28, 0.72);
  border: 1px solid rgba(236, 177, 109, 0.2);
}

.file_list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  background: linear-gradient(180deg, rgba(255, 199, 135, 0.86), rgba(156, 100, 54, 0.86));
}

.file_list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 214, 161, 0.92), rgba(186, 120, 66, 0.92));
}

.file_card {
  border-radius: 18px;
  border: 1px solid rgba(238, 184, 128, 0.22);
  background:
    linear-gradient(180deg, rgba(13, 15, 19, 0.94), rgba(7, 7, 9, 0.98)),
    radial-gradient(circle at 92% 0%, rgba(255, 185, 122, 0.1), transparent 38%),
    radial-gradient(circle at 8% 100%, rgba(106, 168, 255, 0.08), transparent 30%);
  padding: 15px;
}

.file_card_head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.file_name {
  margin: 0;
  font-family: "Sora", "IBM Plex Sans", sans-serif;
  font-size: 1rem;
  line-height: 1.35;
  word-break: break-word;
}

.file_meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.status_badge {
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status_badge[data-status="ready"] {
  color: #f1e6d6;
}

.status_badge[data-status="converting"] {
  color: #ffd4ab;
  border-color: rgba(255, 185, 122, 0.36);
}

.status_badge[data-status="done"] {
  color: #ebf3ff;
  border-color: rgba(106, 168, 255, 0.34);
}

.status_badge[data-status="error"] {
  color: #ffb9b1;
}

.conversion_row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 12px;
  color: rgba(244, 244, 241, 0.74);
  font-size: 0.86rem;
}

.format_chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(238, 184, 128, 0.18);
  background:
    linear-gradient(160deg, rgba(15, 18, 25, 0.94), rgba(8, 8, 10, 0.98)),
    radial-gradient(circle at 20% 18%, rgba(255, 185, 122, 0.09), transparent 42%);
}

.progress_track {
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.progress_fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-blue) 100%);
  transition: width 0.15s linear;
}

.file_footer {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.item_hint {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.item_actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.item_button {
  width: 100%;
  border: 1px solid rgba(238, 184, 128, 0.22);
  background:
    linear-gradient(160deg, rgba(14, 16, 22, 0.94), rgba(8, 8, 10, 0.98)),
    radial-gradient(circle at 84% 0%, rgba(255, 185, 122, 0.09), transparent 40%);
  color: var(--ink);
  min-width: 0;
}

.item_button.button--primary,
.item_button.primary {
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 236, 213, 0.22), transparent 46%),
    linear-gradient(150deg, rgba(44, 29, 21, 0.96), rgba(16, 26, 40, 0.92));
  color: #fff0da;
  border-color: rgba(247, 208, 170, 0.44);
}

.item_button.download_ready {
  background:
    radial-gradient(circle at 26% 18%, rgba(226, 238, 255, 0.22), transparent 46%),
    linear-gradient(155deg, rgba(14, 26, 44, 0.96), rgba(8, 12, 22, 0.94));
  color: #edf5ff;
  border-color: rgba(130, 177, 255, 0.42);
}

.item_error {
  margin-top: 10px;
  color: #ffb5ae;
  font-size: 0.9rem;
  line-height: 1.5;
}

body.tool-subpage #site-footer.site-footer {
  width: min(94vw, 1320px) !important;
  max-width: 1320px !important;
  margin: 1.4rem auto 1rem !important;
  align-self: center !important;
}

@media (max-width: 1040px) {
  body.has-site-footer .app {
    min-height: auto;
    padding-bottom: 0;
  }

  .workflow_strip {
    grid-template-columns: 1fr;
  }

  .tool_shell {
    grid-template-columns: 1fr;
  }

  .drop_zone,
  .empty_state {
    min-height: clamp(220px, 34vh, 280px);
    height: auto;
  }

  .file_list {
    max-height: 44vh;
  }
}

@media (max-width: 1024px) {
  body {
    padding: 18px 8px 24px;
  }

  .app {
    width: min(100%, calc(100% - 10px));
    margin-top: 74px;
    margin-bottom: 0;
  }

  .list_head,
  .panel_head,
  .file_card_head {
    flex-direction: column;
    align-items: stretch;
  }

  .engine_status,
  .button,
  .primary_button,
  .ghost_button,
  .item_button {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .app {
    width: min(100%, calc(100% - 8px));
    margin-top: 66px;
    margin-bottom: 0;
  }

  body.has-site-footer .app {
    min-height: auto;
  }

  body.tool-subpage #site-footer.site-footer {
    width: min(100%, calc(100% - 8px)) !important;
    max-width: min(100%, calc(100% - 8px)) !important;
  }

  .tool_shell,
  .workflow_strip,
  .file_card_head,
  .list_head {
    gap: 12px;
  }

  .list_head,
  .panel_head,
  .file_card_head {
    flex-direction: column;
    align-items: stretch;
  }

  .file_list {
    max-height: 40vh;
  }

  .engine_status,
  .button,
  .primary_button,
  .ghost_button {
    width: 100%;
  }

  .button,
  .primary_button,
  .ghost_button,
  .item_button {
    width: 100%;
  }
}
