:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-soft: #f6f7f9;
  --surface-blue: #f3f7ff;
  --ink: #111827;
  --muted: #667085;
  --line: #e5e7eb;
  --line-strong: #d7dce3;
  --blue: #1769e8;
  --blue-2: #2678f3;
  --blue-soft: #e8f1ff;
  --green: #11a772;
  --amber: #e6a000;
  --violet: #6d56db;
  --rose: #d74875;
  --danger: #b42318;
  --danger-bg: #fff2f0;
  --success-bg: #ecfdf3;
  --success: #027a48;
  --shadow: 0 18px 50px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 8px 30px rgba(16, 24, 40, 0.06);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --max: 1380px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 50% 0%, rgba(23, 105, 232, 0.045), transparent 26rem),
    linear-gradient(180deg, #faf8f4 0%, var(--bg) 65%, #f8f6f2 100%);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
.drop-zone:focus-visible {
  outline: 3px solid rgba(23, 105, 232, 0.24);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

.page-shell {
  min-height: 100vh;
}

.site-header {
  min-height: 72px;
  padding: 0 5vw;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(229, 231, 235, 0.85);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  justify-self: start;
}

.brand-mark,
.login-mark {
  display: inline-grid;
  place-items: center;
  color: var(--blue);
}

.brand-mark {
  width: 34px;
  height: 34px;
}

.brand-mark svg,
.login-mark svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.brand-name {
  font-size: 23px;
  font-weight: 850;
  letter-spacing: -0.035em;
}

.brand-product {
  color: #111827;
  font-weight: 600;
  border-left: 1px solid var(--line);
  padding-left: 14px;
  white-space: nowrap;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 34px;
  font-size: 14px;
  font-weight: 650;
  color: #303746;
}

.top-nav a:hover {
  color: var(--blue);
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.session-user {
  color: var(--muted);
  font-size: 13px;
}

.button {
  border: 0;
  border-radius: 13px;
  min-height: 46px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 750;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, opacity 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  box-shadow: 0 10px 24px rgba(23, 105, 232, 0.2);
}

.button--primary:hover:not(:disabled) {
  box-shadow: 0 14px 30px rgba(23, 105, 232, 0.26);
}

.button--ghost {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
}

.button--small {
  min-height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  font-size: 14px;
}

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

.hero {
  padding: 54px 24px 28px;
}

.hero-copy {
  max-width: 980px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.13em;
}

.hero h1 {
  margin: 7px 0 10px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.045em;
  font-weight: 850;
}

.hero h1 span {
  color: var(--blue);
}

.hero p {
  max-width: 760px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(16px, 1.7vw, 20px);
}

.converter-wrap,
.benefits,
.ad-slot,
.info-grid,
.site-footer {
  width: min(var(--max), calc(100% - 48px));
  margin-left: auto;
  margin-right: auto;
}

.converter-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(229, 231, 235, 0.92);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.converter-main {
  min-width: 0;
}

.drop-zone {
  min-height: 294px;
  border: 1.6px dashed #6da5f5;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 40%, rgba(23, 105, 232, 0.08), transparent 17rem),
    var(--surface-blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 34px;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragover {
  border-color: var(--blue);
  background: #edf4ff;
}

.drop-zone.is-dragover {
  transform: scale(1.003);
}

.upload-icon {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  color: var(--blue);
  margin-bottom: 3px;
}

.upload-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-zone strong {
  font-size: 24px;
  letter-spacing: -0.025em;
}

.drop-zone > span {
  color: var(--muted);
}

.drop-zone .button {
  margin-top: 5px;
  min-width: 160px;
}

.drop-zone small {
  color: var(--muted);
  margin-top: 7px;
}

.selection-panel {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.selection-heading,
.jobs-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.selection-heading > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.selection-heading span {
  color: var(--muted);
  font-size: 13px;
}

.link-button {
  padding: 4px 0;
  background: transparent;
  border: 0;
  color: var(--blue);
  font-weight: 700;
  font-size: 13px;
}

.file-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 220px;
  overflow: auto;
}

.file-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 30px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}

.file-type-chip {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 850;
  font-size: 10px;
}

.file-meta {
  min-width: 0;
}

.file-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: 14px;
}

.file-detail,
.file-size {
  color: var(--muted);
  font-size: 12px;
}

.remove-file {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #7b8494;
  font-size: 18px;
}

.remove-file:hover {
  background: #f2f4f7;
  color: var(--danger);
}

.conversion-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 32px minmax(190px, 1fr) minmax(220px, auto);
  align-items: end;
  gap: 12px;
  padding: 18px 0 0;
}

.field-group label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 760;
}

.select-shell {
  position: relative;
}

.select-shell select {
  width: 100%;
  height: 52px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  padding: 0 42px 0 48px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #6b7280 50%),
    linear-gradient(135deg, #6b7280 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 22px,
    calc(100% - 15px) 22px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.select-shell select:disabled {
  background-color: #f8fafc;
  color: #667085;
  cursor: default;
}

.field-icon {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 1;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #7b8494;
  pointer-events: none;
}

.field-icon--accent {
  color: var(--blue);
}

.field-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.conversion-arrow {
  height: 52px;
  display: grid;
  place-items: center;
  color: #475467;
  font-size: 25px;
}

.button--convert {
  min-height: 52px;
  white-space: nowrap;
  padding: 0 25px;
}

.button-icon {
  font-size: 20px;
}

.formats-panel {
  padding: 20px 20px 16px;
  background: linear-gradient(180deg, #f7f7f7 0%, #f3f4f6 100%);
  border-radius: 18px;
  border: 1px solid #eceef1;
}

.formats-panel h2 {
  margin: 1px 0 20px;
  font-size: 19px;
  letter-spacing: -0.025em;
}

.format-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.format-item strong,
.format-item small {
  display: block;
}

.format-item strong {
  font-size: 14px;
}

.format-item small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.format-badge {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 850;
  font-size: 12px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14);
}

.format-badge--word { background: #1f6fd1; }
.format-badge--excel { background: #159b65; }
.format-badge--ppt { background: #df5b38; }
.format-badge--pdf { background: #d93a31; font-size: 9px; }
.format-badge--image { background: #7053d7; font-size: 9px; }
.format-badge--odf { background: #687386; font-size: 9px; }

.format-note {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #dde1e7;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(17, 167, 114, 0.1);
}

.notice {
  margin-top: 15px;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.notice.is-error {
  border-color: #f4c7c3;
  background: var(--danger-bg);
  color: var(--danger);
}

.notice.is-success {
  border-color: #abeac8;
  background: var(--success-bg);
  color: var(--success);
}

.jobs-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.jobs-heading h2 {
  margin: 3px 0 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.job-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.job-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.job-title {
  font-weight: 750;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.job-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.job-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  font-size: 12px;
  font-weight: 720;
}

.job-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #98a2b3;
}

.job-status[data-status="accepted"]::before,
.job-status[data-status="processing"]::before {
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(23, 105, 232, 0.09);
}

.job-status[data-status="done"]::before {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(17, 167, 114, 0.09);
}

.job-status[data-status="failed"]::before {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.08);
}

.download-link {
  min-height: 38px;
  border-radius: 10px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 760;
  font-size: 13px;
}

.download-link:hover {
  background: #dceaff;
}

.benefits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 32px 0 28px;
}

.benefits article {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 8px;
}

.benefit-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 22px;
  font-weight: 900;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.benefit-icon--green { color: var(--green); }
.benefit-icon--amber { color: var(--amber); }
.benefit-icon--violet { color: var(--violet); }
.benefit-icon--rose { color: var(--rose); }

.benefits h3 {
  margin: 1px 0 4px;
  font-size: 15px;
}

.benefits p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.ad-slot {
  margin-top: 8px;
}

.ad-slot-inner {
  min-height: 126px;
  border: 1.5px dashed #c9bda9;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #727987;
  background: rgba(255,255,255,0.32);
}

.ad-slot-inner > span {
  color: #98a2b3;
  font-size: 10px;
  letter-spacing: 0.14em;
  font-weight: 800;
}

.ad-slot-inner strong {
  margin-top: 3px;
  color: #667085;
}

.ad-slot-inner small {
  margin-top: 2px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  padding: 28px 0 44px;
}

.info-grid article {
  padding: 22px;
  background: rgba(255,255,255,0.58);
  border: 1px solid rgba(229,231,235,0.8);
  border-radius: var(--radius-lg);
}

.info-grid h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.info-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.site-footer {
  min-height: 90px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-footer strong {
  color: var(--ink);
  font-size: 18px;
  letter-spacing: -0.025em;
}

.footer-links {
  display: flex;
  gap: 22px;
}

.footer-links a:hover {
  color: var(--blue);
}

.footer-copy {
  justify-self: end;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(17, 24, 39, 0.32);
  backdrop-filter: blur(12px);
}

.login-card {
  width: min(430px, 100%);
  padding: 30px;
  border-radius: 24px;
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: 0 30px 80px rgba(17,24,39,0.22);
}

.login-mark {
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
}

.login-card h2 {
  margin: 4px 0 6px;
  font-size: 27px;
  letter-spacing: -0.035em;
}

.login-card > p {
  margin: 0 0 20px;
  color: var(--muted);
}

.login-card label {
  display: block;
  margin: 12px 0 6px;
  font-size: 13px;
  font-weight: 760;
}

.login-card input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 0 13px;
  background: #fff;
}

.login-card input:focus {
  border-color: #8ab7f7;
}

.login-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
}

.login-card .button {
  margin-top: 18px;
}

/* Embed mode: append ?embed=1 when used inside huuluc.com */
html.embed-mode body {
  background: transparent;
}

html.embed-mode .site-header,
html.embed-mode .site-footer,
html.embed-mode .hero,
html.embed-mode .info-grid {
  display: none;
}

html.embed-mode .converter-wrap,
html.embed-mode .benefits,
html.embed-mode .ad-slot {
  width: 100%;
}

html.embed-mode .converter-wrap {
  margin-top: 0;
}

html.embed-mode .converter-card {
  border-radius: 20px;
  box-shadow: none;
}

html.embed-mode .benefits {
  padding-bottom: 18px;
}

html.embed-mode .ad-slot {
  margin-bottom: 0;
}

html.hide-ads .ad-slot {
  display: none;
}

@media (max-width: 1080px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .top-nav {
    display: none;
  }

  .converter-card {
    grid-template-columns: 1fr;
  }

  .formats-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px 16px;
  }

  .formats-panel h2,
  .format-note {
    grid-column: 1 / -1;
  }

  .conversion-row {
    grid-template-columns: 1fr 32px 1fr;
  }

  .button--convert {
    grid-column: 1 / -1;
  }

  .benefits {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-footer {
    grid-template-columns: 1fr auto;
  }

  .footer-links {
    display: none;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 15px;
  }

  .site-header {
    min-height: 64px;
    padding: 0 18px;
  }

  .brand-product {
    display: none;
  }

  .brand-name {
    font-size: 21px;
  }

  .hero {
    padding: 34px 18px 20px;
  }

  .hero h1 {
    font-size: 35px;
  }

  .converter-wrap,
  .benefits,
  .ad-slot,
  .info-grid,
  .site-footer {
    width: min(100% - 24px, var(--max));
  }

  .converter-card {
    padding: 12px;
    border-radius: 20px;
  }

  .drop-zone {
    min-height: 260px;
    padding: 24px 14px;
  }

  .drop-zone strong {
    font-size: 21px;
  }

  .conversion-row {
    grid-template-columns: 1fr;
  }

  .conversion-arrow {
    display: none;
  }

  .button--convert {
    grid-column: auto;
    width: 100%;
  }

  .formats-panel {
    grid-template-columns: repeat(2, 1fr);
  }

  .benefits,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .benefits {
    gap: 2px;
  }

  .file-row {
    grid-template-columns: 34px minmax(0, 1fr) 30px;
  }

  .file-size {
    display: none;
  }

  .job-card {
    grid-template-columns: 1fr;
  }

  .download-link {
    justify-self: start;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .footer-copy {
    justify-self: start;
  }

  .session-user {
    display: none;
  }

  html.embed-mode .converter-card {
    border-radius: 14px;
  }
}
