:root {
  --accent: #16c47f;
  --accent-2: #2dd4bf;
  --accent-rgb: 22, 196, 127;
  --radius: 16px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", "Noto Sans JP", "Noto Sans Thai", "Malgun Gothic", sans-serif;
  --shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] {
  --bg: #0a0e14;
  --bg-soft: #11161f;
  --panel: rgba(22, 28, 38, 0.82);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #eef2f7;
  --muted: #9ba7ba;
  --input-bg: rgba(8, 12, 18, 0.68);
  --chip: rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] {
  --bg: #f5f7fb;
  --bg-soft: #ffffff;
  --panel: rgba(255, 255, 255, 0.92);
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.2);
  --text: #0f1b2d;
  --muted: #5b6b82;
  --input-bg: rgba(255, 255, 255, 0.92);
  --chip: rgba(15, 23, 42, 0.05);
  --shadow: 0 20px 42px -30px rgba(20, 40, 80, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at 10% -10%, rgba(var(--accent-rgb), 0.12), transparent 34rem),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

.appbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px clamp(16px, 5vw, 56px);
}

.appbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-weight: 800;
  font-size: 22px;
  color: #04130c;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px -12px rgba(var(--accent-rgb), 0.8);
}

.brand-mark.sm {
  width: 36px;
  height: 36px;
  font-size: 18px;
  border-radius: 10px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 16px;
}

.brand-text small {
  color: var(--muted);
  font-size: 12px;
}

.mainnav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.mainnav::-webkit-scrollbar {
  display: none;
}

.mainnav a {
  white-space: nowrap;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  padding: 8px 13px;
  border-radius: 999px;
}

.mainnav a:hover,
.mainnav a.active {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
}

.appbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select-wrap .icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.lang-flag {
  position: absolute;
  left: 36px;
  width: 22px;
  height: 15px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--border-strong);
  pointer-events: none;
}

#langSelect {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--chip);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 16px 9px 66px;
  cursor: pointer;
}

#langSelect option {
  color: #111;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--chip);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle .icon {
  width: 20px;
  height: 20px;
}

html[data-theme="dark"] .theme-toggle .sun,
html[data-theme="light"] .theme-toggle .moon {
  display: block;
}

html[data-theme="dark"] .theme-toggle .moon,
html[data-theme="light"] .theme-toggle .sun {
  display: none;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px clamp(16px, 5vw, 56px) 40px;
}

.hero {
  text-align: center;
  max-width: 740px;
  margin: 22px auto 36px;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.16;
  margin: 0 0 14px;
}

.hero p,
.section-sub {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.panel,
.feature,
.faq-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: 26px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.panel-head h2 {
  margin: 0;
  font-size: 19px;
}

.pill {
  min-width: 34px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.14);
  padding: 4px 12px;
  border-radius: 999px;
}

.muted {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 4px 0 16px;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 132px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.18);
}

.section-label {
  font-size: 13px;
  font-weight: 750;
  color: var(--muted);
  margin: 24px 0 12px;
}

.options {
  display: grid;
  gap: 10px;
}

.toggle-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--chip);
  cursor: pointer;
}

.toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-text strong {
  font-size: 14.5px;
}

.toggle-text small {
  color: var(--muted);
  font-size: 12px;
}

.toggle-row input {
  position: absolute;
  opacity: 0;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--border-strong);
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.toggle-row input:checked ~ .switch {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.toggle-row input:checked ~ .switch::after {
  transform: translateX(18px);
}

.notice,
.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 20px 0 4px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 184, 0, 0.1);
  border: 1px solid rgba(255, 184, 0, 0.24);
}

.notice .icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: #f0a500;
}

.notice p,
.callout p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.primary {
  width: 100%;
  margin-top: 22px;
  padding: 15px 20px;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 750;
  color: #04130c;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.primary:disabled {
  opacity: 0.6;
  cursor: progress;
}

.progress-wrap {
  height: 6px;
  border-radius: 999px;
  background: var(--chip);
  margin: 16px 0 10px;
  overflow: hidden;
}

#progressBar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s ease;
}

.status {
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.ghost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 650;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}

.ghost .icon {
  width: 16px;
  height: 16px;
}

.file-list {
  display: grid;
  gap: 10px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 20px;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}

.empty-state .icon-lg {
  width: 52px;
  height: 52px;
  opacity: 0.55;
}

.empty-state p {
  margin: 0;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--chip);
}

.file-thumb {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  border-radius: 10px;
}

.file-thumb svg,
.file-dl svg {
  width: 20px;
  height: 20px;
}

.kind-image { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.kind-video { background: linear-gradient(135deg, #ef4444, #f97316); }
.kind-pdf { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.kind-file { background: linear-gradient(135deg, #64748b, #475569); }

.file-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.file-name,
.file-sub {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-name {
  font-size: 13.5px;
  font-weight: 650;
}

.file-sub {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 2px;
}

.file-dl {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: 10px;
  text-decoration: none;
}

.log-details {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.log-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  list-style: none;
}

.log-details summary::-webkit-details-marker {
  display: none;
}

.log-details summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  color: var(--accent);
}

.log-details[open] summary::before {
  content: "▾";
}

#logBox {
  margin: 12px 0 0;
  padding: 14px;
  max-height: 220px;
  overflow: auto;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--input-bg);
  border-radius: var(--radius-sm);
}

.home-extra {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 8px auto 0;
  padding: 36px clamp(16px, 5vw, 56px) 0;
}

.section-title {
  text-align: center;
  font-size: clamp(22px, 3vw, 30px);
  margin: 0 0 8px;
}

.section-sub {
  text-align: center;
  max-width: 660px;
  margin: 0 auto 28px;
}

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

.feature {
  padding: 22px;
}

.feature .ficon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 12px;
  margin-bottom: 14px;
}

.feature .ficon svg {
  width: 22px;
  height: 22px;
}

.feature h3 {
  margin: 0 0 6px;
  font-size: 16.5px;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.feature a,
.prose a {
  color: var(--accent);
  text-underline-offset: 2px;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 840px;
  margin: 0 auto;
  padding: 8px clamp(16px, 5vw, 56px) 56px;
}

.breadcrumb {
  color: var(--muted);
  font-size: 12.5px;
  margin: 18px 0 10px;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.page h1 {
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.2;
  margin: 8px 0;
}

.page .lead {
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.7;
  margin: 0 0 28px;
}

.prose h2 {
  font-size: 21px;
  margin: 34px 0 12px;
}

.prose h3 {
  font-size: 17px;
  margin: 24px 0 8px;
}

.prose p,
.prose li {
  font-size: 15.5px;
  line-height: 1.8;
}

.prose p {
  margin: 0 0 16px;
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.prose li {
  margin: 6px 0;
}

.faq-item {
  padding: 4px 18px;
  margin: 10px 0;
}

.faq-item summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  font-size: 15.5px;
  font-weight: 650;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--accent);
  font-weight: 800;
}

.faq-item[open] summary::after {
  content: "-";
}

.faq-item p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.75;
  margin: 0 0 16px;
}

.contact-line {
  font-size: 18px;
  font-weight: 700;
}

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  margin-top: 56px;
  background: var(--bg-soft);
}

.foot-cols {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px clamp(16px, 5vw, 56px) 24px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 28px;
}

.foot-col h4 {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 12px;
}

.foot-col p {
  max-width: 340px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
  margin: 12px 0 0;
}

.foot-col a {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  padding: 5px 0;
}

.foot-col a:hover {
  color: var(--accent);
}

.foot-base {
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  padding: 18px;
}

@media (max-width: 900px) {
  .columns,
  .feature-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .appbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .mainnav {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
  }

  .brand-text small {
    display: none;
  }

  .foot-cols {
    grid-template-columns: 1fr;
  }
}
