:root {
  color-scheme: light;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --blue: #0066cc;
  --teal: #59d9c7;
  --green: #3aa56d;
  --white: #ffffff;
  --soft: #f5f5f7;
  --silver: #e8ebf0;
  --line: rgba(0, 0, 0, 0.08);
  --nav: rgba(250, 250, 252, 0.84);
  --shadow: 0 28px 80px rgba(24, 35, 52, 0.12);
  --max: 1440px;
  --nav-height: 48px;
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--soft);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  font-size: 17px;
  line-height: 1.47059;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.global-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 5vw, 72px);
  padding: 0 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--nav);
  color: rgba(0, 0, 0, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
}

.brand-mark {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 42% 34%, #ffffff 0 12%, transparent 13%),
    linear-gradient(145deg, #1d1d1f, #7d8794 56%, #bdeee6);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 42px);
  font-size: 0.76rem;
  font-weight: 400;
}

.nav-links a {
  color: rgba(0, 0, 0, 0.72);
}

.nav-links a:hover {
  color: #000000;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.locale-picker {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  width: 190px;
}

.locale-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 32px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 0 30px 0 10px;
  background: rgba(255, 255, 255, 0.78);
  color: rgba(0, 0, 0, 0.78);
  font-size: 0.76rem;
  font-weight: 600;
}

.workspace {
  width: min(var(--max), 100%);
  min-height: calc(100svh - var(--nav-height));
  display: grid;
  align-content: center;
  gap: clamp(18px, 2.4vw, 30px);
  margin: 0 auto 12px;
  padding: clamp(22px, 3.8vw, 44px) 24px 28px;
  background: linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 100%);
}

.workspace-copy {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: auto minmax(220px, 0.72fr) minmax(260px, 1fr);
  gap: 18px clamp(22px, 4vw, 52px);
  align-items: center;
  margin: 0 auto;
  padding: 8px 8px 0;
  text-align: left;
}

.kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: clamp(0.92rem, 1.2vw, 1.08rem);
  font-weight: 650;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.5rem, 2.2vw, 2.35rem);
  line-height: 1.08;
  font-weight: 750;
  letter-spacing: 0;
  word-break: keep-all;
  overflow-wrap: break-word;
}

h1 span {
  display: block;
}

html[lang="th-TH"] h1,
html[lang="hi-IN"] h1,
html[lang="ru-RU"] h1 {
  font-size: clamp(1.36rem, 2vw, 2.08rem);
  line-height: 1.08;
}

.lede {
  width: min(580px, 100%);
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.96rem, 1.18vw, 1.08rem);
  line-height: 1.36;
  font-weight: 500;
}

.lede span {
  display: block;
}

.converter-shell {
  width: min(1220px, 100%);
  display: grid;
  gap: 12px;
  margin: 0 auto;
}

.flow-rail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 42px rgba(24, 35, 52, 0.08);
  backdrop-filter: blur(18px);
}

.flow-step {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #5f6368;
  font-size: 0.92rem;
  font-weight: 650;
  text-align: center;
}

.flow-step.is-active {
  background: #1d1d1f;
  color: #ffffff;
}

.flow-step.is-complete {
  background: rgba(58, 165, 109, 0.12);
  color: #19734a;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.12fr) minmax(280px, 0.82fr) minmax(320px, 1fr);
  gap: 12px;
  align-items: stretch;
}

.drop-panel,
.settings-panel,
.results-panel,
.results-section,
.info-panel,
.faq-panel,
.document-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.drop-panel {
  min-height: 468px;
  display: grid;
  padding: 18px;
}

.drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  min-height: 100%;
  padding: clamp(26px, 4vw, 42px);
  border: 1px dashed rgba(0, 102, 204, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.028) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0, 0, 0, 0.028) 1px, transparent 1px),
    radial-gradient(circle at 50% 56%, rgba(89, 217, 199, 0.22), transparent 34%),
    #f7fbff;
  background-size: 36px 36px, 36px 36px, auto, auto;
  text-align: center;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    background-color 160ms ease;
}

.drop-zone.is-dragging,
.drop-zone:focus-visible {
  outline: none;
  border-color: var(--blue);
  background-color: #eff7ff;
  transform: translateY(-1px);
}

.drop-zone.has-files {
  border-color: rgba(58, 165, 109, 0.52);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.022) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0, 0, 0, 0.022) 1px, transparent 1px),
    #f2fbf6;
  background-size: 36px 36px, 36px 36px, auto;
}

.drop-zone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  position: relative;
  width: 92px;
  height: 74px;
  border: 1px solid rgba(29, 29, 31, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 102, 204, 0.2), rgba(89, 217, 199, 0.28)),
    #ffffff;
  box-shadow: 0 20px 55px rgba(0, 102, 204, 0.13);
}

.drop-icon::before,
.drop-icon::after {
  content: "";
  position: absolute;
  background: #1d1d1f;
}

.drop-icon::before {
  left: 25px;
  right: 25px;
  top: 35px;
  height: 6px;
  border-radius: 999px;
}

.drop-icon::after {
  width: 6px;
  height: 30px;
  left: calc(50% - 3px);
  top: 23px;
  border-radius: 999px;
}

.drop-zone h2,
.settings-panel h2,
.results-panel h2,
.section-heading h2,
.info-panel h2,
.faq-panel h2 {
  font-size: clamp(1.72rem, 3vw, 2.7rem);
  line-height: 1.04;
  font-weight: 730;
  letter-spacing: 0;
  word-break: keep-all;
}

.drop-zone p {
  width: min(560px, 100%);
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.38;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 700;
  letter-spacing: 0;
  transition:
    transform 160ms ease,
    opacity 160ms ease,
    background 160ms ease;
}

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

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

.button.primary,
.button.convert {
  background: #0066cc;
  color: #ffffff;
}

.button.convert {
  width: 100%;
}

.button.secondary {
  border: 1px solid var(--line);
  background: #ffffff;
  color: #1d1d1f;
}

.button.secondary:not(:disabled) {
  border-color: #1d1d1f;
  background: #1d1d1f;
  color: #ffffff;
}

.settings-panel {
  display: grid;
  gap: 16px;
  align-content: start;
  min-height: 468px;
  padding: 24px;
}

.panel-heading {
  display: grid;
  gap: 2px;
}

.field {
  display: grid;
  gap: 8px;
  color: #4e5358;
  font-size: 0.94rem;
  font-weight: 650;
}

.format-segments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.format-option {
  min-height: 56px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: #ffffff;
  color: #1d1d1f;
  font-weight: 780;
  transition:
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    opacity 160ms ease;
}

.format-option.is-selected {
  border-color: #1d1d1f;
  background: #1d1d1f;
  color: #ffffff;
}

.format-option:disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

.field input:not([type="range"]),
.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: #1d1d1f;
}

.field input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

.split-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4e5358;
  font-size: 0.95rem;
  font-weight: 650;
}

.check-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.color-field input[type="color"] {
  min-height: 44px;
  padding: 4px;
}

.setting-note {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.results-panel {
  min-height: 468px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 24px;
}

.result-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.results-section,
.info-grid,
.faq-panel {
  width: min(var(--max), 100%);
  margin: 0 auto 12px;
}

.results-section {
  padding: clamp(24px, 4vw, 42px);
}

.section-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.section-heading .kicker {
  grid-column: 1 / -1;
  margin: 0;
}

.empty-state {
  min-height: 150px;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 1px dashed rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-state span {
  width: 48px;
  height: 36px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 102, 204, 0.2), rgba(89, 217, 199, 0.26)),
    #ffffff;
  box-shadow: inset 0 0 0 1px rgba(29, 29, 31, 0.08);
}

.file-list {
  display: grid;
  gap: 12px;
  align-content: start;
  overflow: auto;
  padding-right: 2px;
}

.file-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.thumb {
  width: 72px;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  background:
    linear-gradient(45deg, #e4e8ef 25%, transparent 25%),
    linear-gradient(-45deg, #e4e8ef 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e4e8ef 75%),
    linear-gradient(-45deg, transparent 75%, #e4e8ef 75%);
  background-color: #ffffff;
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
  background-size: 20px 20px;
}

.file-meta {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.file-name {
  overflow: hidden;
  font-weight: 740;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-detail,
.file-status {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.file-status.is-ready {
  color: var(--green);
  font-weight: 700;
}

.file-status.is-error {
  color: #b42318;
  font-weight: 700;
}

.file-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #1d1d1f;
  font-weight: 800;
}

.download-link {
  min-height: 42px;
  min-width: min(100%, 210px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 14px;
  background: #1d1d1f;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.info-panel {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 6vw, 74px);
}

.info-panel.dark {
  background:
    radial-gradient(circle at 50% 100%, rgba(89, 217, 199, 0.22), transparent 42%),
    linear-gradient(180deg, #141517 0%, #000000 100%);
  color: #f5f5f7;
}

.info-panel.dark .kicker,
.info-panel.dark p {
  color: rgba(245, 245, 247, 0.7);
}

.locale-panel {
  grid-column: 1 / -1;
  min-height: 320px;
}

.info-panel h2,
.faq-panel h2 {
  max-width: 760px;
}

.info-panel p {
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.14rem;
  line-height: 1.4;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.path-grid span {
  min-height: 54px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: #ffffff;
  color: #1d1d1f;
  font-weight: 750;
}

.faq-panel {
  padding: clamp(42px, 7vw, 86px) clamp(24px, 6vw, 74px);
  background: #ffffff;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 34px;
}

.faq-grid article {
  min-height: 178px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: #f8f9fb;
}

.faq-grid h3 {
  font-size: 1.08rem;
  line-height: 1.22;
}

.faq-grid p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.footer {
  width: min(var(--max), 100%);
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin: 0 auto;
  color: #86868b;
  font-size: 0.82rem;
}

.footer a {
  color: #515154;
}

.document-page {
  width: min(var(--max), 100%);
  min-height: calc(100svh - var(--nav-height) - 72px);
  margin: 0 auto 12px;
  padding: clamp(42px, 8vw, 92px) 24px;
  background: linear-gradient(180deg, #fbfbfd, #f5f5f7);
}

.document-panel {
  width: min(880px, 100%);
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px);
}

.document-panel h1 {
  font-size: clamp(2.7rem, 6vw, 5.8rem);
}

.document-panel h2 {
  margin-top: 34px;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
}

.document-panel p {
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.document-panel a {
  color: var(--blue);
}

@media (max-width: 1068px) {
  .global-nav {
    justify-content: space-between;
  }

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

  .drop-panel,
  .settings-panel,
  .results-panel {
    min-height: auto;
  }

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

  .panel-heading,
  .format-field,
  .button.convert,
  .setting-note,
  .results-panel {
    grid-column: 1 / -1;
  }

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

@media (max-width: 760px) {
  :root {
    --nav-height: 52px;
  }

  body {
    font-size: 16px;
  }

  .global-nav {
    padding: 0 16px;
    gap: 12px;
  }

  .nav-links {
    gap: 18px;
  }

  .locale-picker {
    width: 132px;
  }

  .locale-select {
    font-size: 0.72rem;
  }

  .nav-links a:nth-child(2),
  .nav-links a:nth-child(3),
  .nav-links a:nth-child(4) {
    display: none;
  }

  .workspace {
    min-height: auto;
    padding: 14px 14px 18px;
  }

  .workspace-copy {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 0 4px;
  }

  h1 {
    font-size: clamp(1.44rem, 7vw, 2rem);
  }

  .lede {
    font-size: 0.98rem;
  }

  .flow-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .flow-step {
    min-height: 38px;
    padding: 0 5px;
    font-size: 0.78rem;
  }

  .drop-panel {
    min-height: auto;
    padding: 12px;
  }

  .drop-zone {
    min-height: 314px;
    padding: 26px 16px;
  }

  .drop-zone h2,
  .settings-panel h2,
  .results-panel h2,
  .section-heading h2,
  .info-panel h2,
  .faq-panel h2 {
    font-size: clamp(1.58rem, 7vw, 2.18rem);
  }

  .settings-panel {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .results-panel {
    padding: 20px;
  }

  .split-fields,
  .path-grid {
    grid-template-columns: 1fr;
  }

  .results-section {
    padding: 24px 14px;
  }

  .section-heading {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .file-card {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .thumb {
    width: 72px;
  }

  .file-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .download-link {
    min-width: 0;
    max-width: 100%;
  }

  .info-panel,
  .faq-panel {
    min-height: auto;
    padding: 34px 18px;
  }

  .footer {
    flex-wrap: wrap;
    gap: 14px 22px;
    padding: 18px;
  }

  .document-page {
    padding: 32px 14px;
  }

  .document-panel {
    padding: 28px 18px;
  }
}

@media (max-width: 390px) {
  .brand {
    font-size: 0.8rem;
  }

  .nav-links {
    gap: 14px;
    font-size: 0.72rem;
  }

  .locale-picker {
    width: 108px;
  }

  html[lang="th-TH"] h1,
  html[lang="hi-IN"] h1,
  html[lang="ru-RU"] h1 {
    font-size: clamp(1.3rem, 6.8vw, 1.8rem);
  }

  .button {
    width: 100%;
  }

  .file-actions {
    display: grid;
    grid-template-columns: 1fr 42px;
  }

  .result-heading {
    grid-template-columns: 1fr;
  }
}
