:root {
  --page-bg: #ffffff;
  --text: #4b4f56;
  --text-strong: #474a50;
  --muted: #a8adb6;
  --line: #ececec;
  --line-soft: #f4f4f4;
  --card-border: #e8e8e8;
  --green: #68bf2a;
  --green-dark: #2d9a17;
  --green-soft: #f5fbef;
  --gray-soft: #f7f7f7;
  --danger: #C61A12;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
}

button,
select,
input {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  padding: 10px 16px 12px;
}

.page {
  max-width: 1128px;
  margin: 0 auto;
  min-height: calc(100vh - 22px);
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 86px;
  padding: 6px 28px 4px 18px;
}

.brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.brand-logo {
  display: block;
  width: auto;
  height: 44px;
  max-width: 200px;
}

.doc-btn {
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: #4d5056;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.doc-btn:hover {
  color: #3c9f00;
  text-decoration: underline;
}

.hero {
  padding: 0 0 14px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  width: min(758px, 100%);
  margin: 0 auto;
  color: #4d4d4d;
  font-size: clamp(36px, 4vw, 44px);
  line-height: 1.28;
  font-weight: 600;
  letter-spacing: 0;
}

.hero p {
  width: min(820px, 100%);
  margin: 8px auto 0;
  color: #4d4d4d;
  font-size: 15px;
  line-height: 1.15;
}

.content {
  display: grid;
  grid-template-columns: 520px 396px;
  gap: 8px;
  padding-top: 16px;
  align-items: start;
  justify-content: center;
  flex: 1;
}

.flow-column {
  width: 520px;
}

.step-section {
  width: 520px;
}

.flow-section:last-child {
  width: 520px;
}

.step-section + .flow-section,
.flow-section + .flow-section {
  margin-top: 10px;
}

.flow-section .step-head + .step-body {
  margin-top: 8px;
}

.flow-section:last-child .step-body {
  width: 540px;
  max-width: 100%;
  padding-left: 16px;
  padding-right: 30px;
  padding-bottom: 14px;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 35px;
}

.step-head h2 {
  margin: 0;
  color: #4d4d4d;
  font-size: 16px;
  font-weight: 700;
}

.step-badge {
  width: 35px;
  height: 35px;
  border-radius: 999px;
  background: #ececec;
  color: #8a8f96;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.step-badge.active,
.step-badge.complete {
  background: #e0f2cc;
  color: var(--green-dark);
}

.step-badge.disabled {
  background: #ededed;
  color: #9ca1a8;
}

.step-badge.disabled + h2 {
  color: #888888;
  font-weight: 400;
}

.step-body {
  margin-left: 17px;
  padding-left: 14px;
}

.connector {
  position: relative;
  padding-bottom: 6px;
  min-height: 102px;
}

.connector::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  width: 1px;
  height: 120px;
  background: #bdbdbd;
}

.field-stack {
  width: 448px;
  max-width: 100%;
  padding: 4px 0 0 10px;
}

.field-row {
  display: grid;
  grid-template-columns: 29px 1fr;
  gap: 12px;
  align-items: center;
}

.field-row + .field-row {
  margin-top: 8px;
}

.field-label {
  color: #5f646c;
  font-size: 14px;
}

.select {
  width: 100%;
  height: 34px;
  padding: 0 34px 0 12px;
  border: 1px solid #d7d7d7;
  border-radius: 4px;
  background: #fff;
  background-image: url("./image/ArrowDropDownFilled.svg");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px 18px;
  color: #5a5f66;
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
}

.native-select {
  display: none;
}

.custom-select {
  position: relative;
  width: 100%;
}

.select-trigger {
  width: 100%;
  height: 32px;
  padding: 0 12px 0 14px;
  border: 1px solid #cfd4da;
  border-radius: 4px;
  background: #fff;
  color: #4d4d4d;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.select-trigger:disabled {
  color: rgba(0, 0, 0, 0.38);
  cursor: not-allowed;
}

.select-trigger:disabled .select-trigger-label,
.select-trigger:disabled .select-trigger-label.placeholder {
  color: rgba(0, 0, 0, 0.38);
}

.select-trigger:disabled .select-trigger-icon {
  opacity: 0.38;
}

.custom-select.open .select-trigger {
  border-top: 2px solid #64be00;
  border-left: 2px solid #64be00;
  border-right: 2px solid #64be00;
  border-bottom: 2px solid #64be00;
  padding: 0 12px 0 14px;
  box-shadow: 0 0 0 1px rgba(100, 190, 0, 0.08);
  position: relative;
  z-index: 21;
}

.select-trigger-label.placeholder {
  color: #b3b8be;
}

.select-trigger-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  opacity: 0.9;
}

.custom-select.open .select-trigger-icon {
  transform: rotate(180deg);
}

.select-menu {
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 360px;
  overflow: auto;
  padding: 8px 0 10px;
  border: 1px solid #d9dee3;
  border-top: 0;
  border-radius: 0 0 4px 4px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.select-group-title {
  padding: 10px 16px 6px;
  color: #4d4d4d;
  font-size: 14px;
  font-weight: 700;
}

.select-option {
  width: 100%;
  min-height: 32px;
  padding: 6px 16px 6px 36px;
  border: 0;
  background: transparent;
  color: #5a5f66;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.select-option.selected {
  background: #64be00;
  color: #fff;
}

.select-option:hover,
.select-option:focus-visible {
  background: #64be00;
  color: #fff;
  outline: none;
}

.field-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.clear-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.clear-btn:disabled {
  color: #888888;
  font-size: 14px;
  font-weight: 700;
  cursor: not-allowed;
}

.drop-zone {
  position: relative;
  width: 448px;
  max-width: 100%;
  min-height: 178px;
  padding: 24px 16px;
  border: 0;
  border-radius: 4px;
  text-align: center;
  background: #fff;
  color: #62666e;
  transition: border-color 0.2s ease, background 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.drop-zone::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px dashed #b8b8b8;
  border-radius: 4px;
  pointer-events: none;
}

.drop-zone.disabled {
  color: #888888;
}

.drop-zone.disabled::before {
  border-color: #d8d8d8;
}

.drop-zone.drag::before,
.drop-zone.ready::before {
  border-color: #64be00;
}

.drop-zone.disabled {
  color: #888888;
}

.drop-zone.disabled .drop-icon {
  color: #bcbfc6;
}

.drop-zone.drag {
  background: #fbfef8;
}

.drop-icon {
  width: 20px;
  height: 20px;
  margin: 2px auto 12px;
}

.drop-icon img {
  width: 100%;
  height: 100%;
  display: block;
}

.drop-title {
  max-width: 378px;
  margin: 0 auto;
  color: #4d4d4d;
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0.15px;
}

.drop-or {
  margin-top: 0;
  color: #4d4d4d;
  font-size: 16px;
  line-height: 1.45;
}

.browse-btn {
  min-width: 112px;
  height: 35px;
  margin-top: 6px;
  border: 0;
  border-radius: 4px;
  background: #248f18;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.browse-btn:disabled {
  background: #e5e5e5;
  color: #b4b4b4;
  cursor: not-allowed;
}

.browse-btn:disabled,
.upload-btn:disabled,
.convert-btn:disabled {
  background: #e5e5e5;
  color: #b4b4b4;
  cursor: not-allowed;
}

.file-card {
  width: 448px;
  max-width: 100%;
  min-height: 88px;
  margin-top: 12px;
  padding: 24px 16px;
  border: 1px solid #3c9f00;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.file-card-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.file-card-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.file-card-icon img {
  width: 100%;
  height: 100%;
  display: block;
}

.file-name {
  display: block;
  width: 230px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #4d4d4d;
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.15px;
}

.remove-file-btn {
  padding: 0;
  border: 0;
  background: transparent;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.remove-file-btn:disabled {
  cursor: not-allowed;
}

.remove-file-btn:disabled img {
  opacity: 0.38;
}

.remove-file-btn img {
  width: 24px;
  height: 24px;
  display: block;
}

.inline-error {
  width: fit-content;
  max-width: 100%;
  margin: 14px auto 0;
  color: var(--danger);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  text-align: left;
  overflow-wrap: anywhere;
}

.action-error {
  width: fit-content;
  max-width: 100%;
  margin: 10px auto 0;
  color: var(--danger);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  text-align: left;
  overflow-wrap: anywhere;
}

.error-icon,
.error-icon-svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.status-box {
  width: 100%;
  max-width: none;
  margin-top: 10px;
  color: #666a72;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.primary-status,
.debug-status {
  display: none;
}

.status-box a {
  color: var(--green-dark);
  font-weight: 700;
}

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

.status-box.success {
  color: var(--green-dark);
}

.debug-status {
  max-height: 120px;
  overflow: auto;
  padding-top: 6px;
  color: #70757d;
  font-size: 12px;
}

.status-title {
  margin-bottom: 6px;
  font-weight: 700;
}

.status-line {
  margin-top: 4px;
}

.debug-section + .debug-section {
  margin-top: 8px;
}

.debug-section-title {
  font-weight: 700;
}

.upload-actions {
  width: 448px;
  max-width: 100%;
  margin-top: 10px;
}

.upload-btn,
.convert-btn {
  width: 100%;
  height: 33px;
  border: 0;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.upload-btn {
  margin-top: 10px;
  background: #e9e9e9;
  color: #6b7078;
}

.upload-btn:not(:disabled) {
  background: var(--green);
  color: #fff;
}

.convert-btn {
  margin-top: 0;
  background: #dcdcdc;
  color: #f8f8f8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 10px 0 5px;
}

.convert-btn.ready {
  background: #288719;
  color: #fff;
}

.convert-btn.processing {
  background: #b4b4b4;
  color: #e5e5e5;
}

.convert-spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  opacity: 0.95;
  transform-origin: center;
}

.convert-btn.processing .convert-spinner {
  animation: spin 1.4s linear infinite;
}

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

.side-column {
  display: grid;
  align-content: start;
  width: 396px;
  gap: 6px;
}

.support-stack {
  margin-top: 8px;
  display: grid;
  gap: 10px;
}

.side-card {
  border: 1px solid var(--card-border);
  border-radius: 4px;
  background: #fff;
  padding: 10px 14px;
}

.version-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #5e6269;
  min-height: 44px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.version-card strong {
  font-weight: 400;
}

.feature-card {
  width: 396px;
  min-height: 122px;
  background: #e0f2cc4d;
  border-color: transparent;
  padding: 10px;
}

.excluded-card {
  width: 396px;
  min-height: 97px;
  background: #f9f9f9;
  padding: 10px;
}

.side-card-title {
  margin-bottom: 8px;
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 700;
}

.convert-title {
  color: #64be00;
  line-height: 1;
}

.feature-card .side-card-title,
.excluded-card .side-card-title {
  margin-bottom: 6px;
}

.excluded-card .side-card-title {
  color: #808080;
  line-height: 1;
}

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

.feature-grid ul,
.checklist {
  margin: 0;
  padding-left: 18px;
}

.feature-grid li,
.checklist li {
  margin: 0 0 6px;
  line-height: 1.25;
}

.feature-grid li {
  color: #4d4d4d;
  font-size: 14px;
  line-height: 1.8;
  font-weight: 400;
}

.checklist-note,
.summary-note {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
}

.checklist-card {
  min-height: 226px;
}

.checklist {
  font-size: 14px;
  list-style: disc;
}

.inline-doc-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green-dark);
  font-weight: 700;
  cursor: pointer;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
  min-height: 24px;
}

.summary-card {
  display: grid;
  width: 396px;
  min-height: 353px;
  padding: 15px;
  gap: 10px;
  border-radius: 5px;
  background: #f9f9f9;
  border-color: transparent;
  align-content: start;
}

.summary-card.compact {
  min-height: 138px;
  gap: 8px;
}

.summary-card .side-card-title {
  margin: 0;
  color: #4d4d4d;
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
}

.summary-row span,
.summary-row strong {
  color: #4d4d4d;
  font-size: 14px;
  line-height: 24px;
  font-weight: 400;
}

.summary-row strong {
  text-align: right;
}

.summary-value-with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.summary-indicator {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.summary-indicator.ok {
  display: block;
}

.summary-indicator.warn {
  display: block;
  width: 18px;
  height: 18px;
}

.summary-note {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #bcbcbc;
  color: #4d4d4d;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.summary-card.compact .summary-note {
  margin-top: 0;
}

.summary-card.success .summary-status-ok {
  color: #4d4d4d;
}

.summary-card.error .summary-status-bad {
  color: #4d4d4d;
}

.footer {
  padding-top: 10px;
  text-align: center;
  color: #979ba3;
  font-size: 12px;
  margin-top: auto;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
}

.docs-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 478px;
  height: 100vh;
  max-width: 92vw;
  padding: 14px 14px 24px;
  background: #ffffff;
  box-shadow: 0 2px 4px 0 #00000040;
  transform: translateX(100%);
  transition: transform 0.22s ease;
  overflow: auto;
}

.docs-drawer.open {
  transform: translateX(0);
}

.docs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 4px 2px 6px 10px;
}

.docs-header h2 {
  margin: 0;
  color: #4d4d4d;
  font-size: 20px;
  line-height: 1.4;
  font-weight: 600;
}

.docs-close {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.docs-close img {
  display: block;
  width: 16px;
  height: 16px;
}

.docs-section {
  margin-top: 30px;
}

.docs-section-title {
  padding: 0 0 8px 10px;
  border-bottom: 1px solid #3c9f00;
  color: #4d4d4d;
  font-size: 0.875rem;
  line-height: 24px;
  letter-spacing: 0.17px;
  font-weight: 600;
}

.docs-link {
  display: block;
  margin-top: 10px;
  padding-left: 10px;
  color: #4d4d4d;
  font-size: 0.875rem;
  line-height: 1.43;
  letter-spacing: 0.17px;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 1px;
}

.docs-link.emphasis {
  color: #4d4d4d;
  font-size: 0.875rem;
  line-height: 1.43;
  letter-spacing: 0.17px;
  font-weight: 600;
  text-decoration: underline;
}

.docs-link:hover,
.docs-link:focus-visible {
  color: #3c9f00;
  outline: none;
}

@media (max-width: 900px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .page-shell,
  .page {
    min-height: auto;
  }

  .content {
    grid-template-columns: 1fr;
    gap: 16px;
    justify-content: stretch;
  }

  .flow-column,
  .step-section,
  .flow-section:last-child,
  .side-column,
  .support-stack,
  .feature-card,
  .excluded-card,
  .checklist-card,
  .summary-card,
  .summary-card.compact {
    width: 100%;
  }

  .flow-section:last-child .step-body,
  .field-stack,
  .drop-zone,
  .file-card,
  .upload-actions,
  .primary-status,
  .debug-status {
    width: 100%;
  }

  .side-column {
    order: 0;
  }

  .support-stack {
    margin-top: 0;
  }

  .feature-card,
  .excluded-card,
  .checklist-card,
  .summary-card {
    min-height: auto;
  }

  .flow-section:last-child .step-body {
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 12px 10px 20px;
  }

  .topbar {
    align-items: center;
    min-height: auto;
    padding: 8px 0 0;
  }

  .brand-logo {
    height: 36px;
    max-width: 180px;
  }

  .hero {
    text-align: left;
    padding-bottom: 12px;
  }

  .hero h1 {
    font-size: 28px;
    line-height: 1.2;
  }

  .hero p {
    font-size: 14px;
    line-height: 1.35;
  }

  .step-body {
    margin-left: 0;
    padding-left: 0;
  }

  .connector {
    min-height: auto;
  }

  .connector::before {
    display: none;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .field-stack {
    padding: 4px 0 0;
  }

  .field-actions {
    justify-content: flex-end;
  }

  .drop-zone {
    min-height: 180px;
    padding: 20px 14px;
  }

  .drop-title {
    width: 100%;
    max-width: 360px;
    font-size: 16px;
    line-height: 1.35;
  }

  .file-card {
    padding: 16px 14px;
  }

  .file-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .summary-card,
  .summary-card.compact {
    padding: 14px;
  }

  .summary-row {
    gap: 12px;
  }

  .docs-drawer {
    width: 100vw;
    max-width: 100vw;
    padding: 14px 12px 24px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
