:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #edf4f6;
  --text: #18212f;
  --muted: #657184;
  --line: #d9e1ea;
  --accent: #0f7b7f;
  --accent-strong: #0b6266;
  --focus: #ffb020;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(22, 33, 47, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Noto Sans KR", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 5vw, 72px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.top-nav,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.top-nav a,
.site-footer a {
  text-decoration: none;
}

.language-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 132px;
}

.language-control select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 0;
  min-height: 36px;
  padding: 0 4px;
  background: transparent;
  font-size: 14px;
  font-weight: 800;
}

.language-control select::-ms-expand {
  display: none;
}

.language-flag {
  display: inline-block;
  width: 24px;
  height: 16px;
  flex: 0 0 24px;
  overflow: hidden;
  border-radius: 3px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(24, 33, 47, 0.14);
}

.flag-ko {
  background-image: url("flags/ko.svg");
}

.flag-en {
  background-image: url("flags/us.svg");
}

.flag-es {
  background-image: url("flags/es.svg");
}

.flag-pt {
  background-image: url("flags/br.svg");
}

.flag-hi {
  background-image: url("flags/in.svg");
}

.flag-id {
  background-image: url("flags/id.svg");
}

.flag-ja {
  background-image: url("flags/jp.svg");
}

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

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.tool-hero {
  padding: 48px 0 24px;
}

.hero-copy h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1.08;
}

.hero-copy p {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 10px !important;
  color: var(--accent-strong) !important;
  font-size: 14px !important;
  font-weight: 800;
}

.converter-panel {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.drop-zone {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 42px 18px;
  text-align: center;
  border: 2px dashed #9eb2bf;
  border-radius: 8px;
  background: var(--surface-soft);
}

.drop-zone.is-dragover {
  border-color: var(--accent);
  background: #e4f4f2;
}

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

.drop-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 34px;
  line-height: 1;
}

.drop-zone h2 {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.3;
}

.drop-zone p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

select,
input[type="number"],
input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

select,
input[type="number"],
input[type="text"],
input[type="email"],
textarea {
  padding: 0 12px;
}

textarea {
  min-height: 160px;
  padding-top: 10px;
  resize: vertical;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  font: inherit;
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
  white-space: normal;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-strong);
}

.secondary-button {
  background: #e9eef4;
  color: var(--text);
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.same-format-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.same-format-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 800;
}

.same-format-control[hidden] {
  display: none;
}

.same-format-control input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.progress-panel {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.progress-panel[hidden] {
  display: none;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.progress-head strong {
  color: var(--text);
}

progress {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #dfe7ef;
}

progress::-webkit-progress-bar {
  background: #dfe7ef;
}

progress::-webkit-progress-value {
  background: var(--accent);
}

progress::-moz-progress-bar {
  background: var(--accent);
}

.file-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.file-card {
  display: grid;
  grid-template-columns: 72px minmax(220px, 1fr) minmax(180px, 260px) 190px 76px 40px;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.file-card img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  background: #eef2f6;
}

.file-preview {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: #eef2f6;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 900;
}

.file-preview-pdf {
  background: #fff0ec;
  color: #b42318;
}

.file-meta strong {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

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

.status {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.status.error {
  color: var(--danger);
}

.format-control {
  min-width: 0;
}

.file-detail {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.file-detail.error {
  color: var(--danger);
}

.file-state {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.icon-button:hover {
  background: #ffe7e3;
  color: var(--danger);
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  background: #18212f;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
}

.content-section {
  padding: 34px 0;
  border-top: 1px solid var(--line);
}

.content-section h2 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.25;
}

.content-section p {
  max-width: 860px;
  color: var(--muted);
}

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

.info-grid article,
.policy-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.info-grid h3,
.policy-card h2 {
  margin: 0 0 8px;
}

.policy-page {
  padding: 42px 0;
}

.policy-page h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.12;
}

.policy-card {
  margin-top: 16px;
}

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.full-field {
  grid-column: 1 / -1;
}

.consent-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 700;
}

.consent-field input {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: var(--accent);
}

.attachment-field {
  display: grid;
  gap: 10px;
}

.attachment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
}

.attachment-drop {
  display: grid;
  min-height: 76px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  border: 1px dashed #b8c7d8;
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--muted);
  text-align: center;
}

.attachment-drop.has-attachments {
  justify-content: stretch;
  text-align: left;
}

.attachment-drop-text {
  display: block;
}

.attachment-drop.has-attachments .attachment-drop-text {
  color: #6c7d91;
  font-size: 13px;
}

.attachment-drop:focus-visible,
.attachment-drop.is-dragover {
  outline: 3px solid rgba(20, 132, 132, .18);
  border-color: var(--accent);
  background: #eefafa;
}

.attachment-preview-list {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.attachment-preview {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.attachment-preview img {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  background: #eef2f6;
}

.attachment-preview strong,
.attachment-preview span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview strong {
  color: var(--text);
  font-size: 14px;
}

.attachment-preview span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.form-status {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.form-status.success {
  color: var(--accent-strong);
}

.form-status.error {
  color: var(--danger);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 38px;
  padding: 24px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 840px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

  .file-card img {
    width: 58px;
    height: 58px;
  }

  .file-preview {
    width: 58px;
    height: 58px;
  }

  .file-detail,
  .format-control,
  .file-state,
  .download-link {
    grid-column: 1 / -1;
  }

  .remove-file {
    grid-column: 3;
    grid-row: 1;
  }

  .file-state {
    justify-content: stretch;
  }

  .download-link {
    width: 100%;
  }

  .action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .same-format-row {
    justify-content: flex-start;
  }

  .contact-form {
    grid-template-columns: 1fr;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
