:root {
  color-scheme: light;
  --primary: #173f35;
  --primary-hover: #0e3129;
  --on-primary: #fff;
  --accent: #e9683b;
  --surface: #fff;
  --surface-subtle: #f5f3ed;
  --surface-strong: #e7e3d8;
  --ink: #17211d;
  --muted: #65706a;
  --border: #d5d9d2;
  --focus: #1d6f5c;
  --success: #167153;
  --success-bg: #e9f6f0;
  --warning: #875118;
  --warning-bg: #fff5df;
  --error: #b33a31;
  --error-bg: #fff0ed;
  --shadow: 0 18px 52px rgba(31, 44, 38, 0.09);
  --font: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --container: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 10% 15%, rgba(233, 104, 59, 0.09), transparent 26rem),
    var(--surface-subtle);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
}

a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, input[type="file"], summary { touch-action: manipulation; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.site-header,
.site-footer {
  width: min(calc(100% - 40px), var(--container));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  border-bottom: 1px solid rgba(23, 63, 53, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px 4px 10px 4px;
  background: var(--primary);
  color: white;
  font-size: 15px;
}

.header-note,
.site-footer { color: var(--muted); font-size: 14px; }

.site-footer {
  padding: 36px 0;
  text-align: center;
}

main { min-height: calc(100dvh - 160px); }

.page-shell,
.content-shell,
.workspace-shell {
  width: min(calc(100% - 40px), var(--container));
  margin-inline: auto;
}

.narrow-shell { width: min(calc(100% - 40px), 820px); margin-inline: auto; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(500px, 1.22fr);
  gap: clamp(40px, 7vw, 92px);
  align-items: start;
  padding-block: clamp(52px, 8vw, 96px);
}

.hero-copy { position: sticky; top: 32px; padding-top: 28px; }

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1, h2, h3, p { overflow-wrap: anywhere; }

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.12;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

h2 { margin: 0; font-size: clamp(22px, 3vw, 28px); line-height: 1.25; letter-spacing: -0.025em; }
h3 { margin: 0; font-size: 16px; line-height: 1.45; }

.lede {
  max-width: 58ch;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
  text-wrap: pretty;
}

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 34px 0 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
  font-size: 14px;
  font-weight: 700;
}

.steps li { display: flex; align-items: center; gap: 7px; }
.steps span { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--primary); font-size: 12px; }

.panel {
  border: 1px solid rgba(23, 63, 53, 0.11);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.share-form,
.workspace-grid > .panel,
.management-files { padding: clamp(22px, 4vw, 38px); }

.form-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.privacy-note,
.optional,
.view-only {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.privacy-note { padding: 5px 9px; border: 1px solid var(--border); border-radius: 999px; white-space: nowrap; }

.field { display: grid; gap: 7px; margin-bottom: 20px; }
.field label, legend { font-size: 14px; font-weight: 750; }
.field small { color: var(--muted); font-size: 12px; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}

input, select { min-height: 46px; padding: 10px 12px; }
textarea { min-height: 110px; padding: 12px; line-height: 1.6; resize: vertical; }
input::placeholder, textarea::placeholder { color: #87908b; }
input:hover, textarea:hover, select:hover { border-color: #aeb8b1; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(29, 111, 92, 0.35);
  outline-offset: 2px;
}

.dropzone {
  position: relative;
  margin-bottom: 20px;
  border: 1.5px dashed #aab7b0;
  border-radius: 16px;
  background: #fafbf8;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.dropzone.is-dragging { border-color: var(--focus); background: #eef7f3; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone-action { display: grid; justify-items: center; gap: 6px; padding: 30px 20px 24px; cursor: pointer; text-align: center; }
.dropzone-title { font-weight: 800; }
.dropzone-help { color: var(--muted); font-size: 13px; }
.dropzone-action .button { margin-top: 10px; }

.selected-files { display: grid; gap: 7px; margin: 0; padding: 0 18px 18px; list-style: none; }
.selected-files:empty { display: none; }
.selected-files li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 8px; background: var(--surface-strong); font-size: 13px; }
.selected-files span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-files span:last-child { color: var(--muted); white-space: nowrap; }

.permission-group { margin: 0 0 20px; padding: 0; border: 0; }
.permission-group legend { margin-bottom: 9px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice { position: relative; min-width: 0; cursor: pointer; }
.choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice > span { display: flex; min-height: 82px; flex-direction: column; justify-content: center; gap: 2px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.choice small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.choice input:checked + span { border-color: var(--primary); background: #eef4f1; box-shadow: inset 0 0 0 1px var(--primary); }
.choice input:focus-visible + span { outline: 3px solid rgba(29, 111, 92, 0.35); outline-offset: 2px; }

.advanced { margin: 4px 0 24px; border-block: 1px solid var(--border); }
.advanced summary { display: flex; align-items: center; justify-content: space-between; min-height: 62px; cursor: pointer; list-style: none; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary > span:first-child { display: flex; flex-direction: column; }
.advanced summary small { color: var(--muted); font-size: 12px; font-weight: 400; }
.advanced summary > span:last-child { color: var(--muted); font-size: 12px; }
.advanced[open] summary > span:last-child { font-size: 0; }
.advanced[open] summary > span:last-child::after { content: "접기"; font-size: 12px; }
.advanced-body { padding: 8px 0 2px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.password-field { position: relative; }
.password-field input { padding-right: 58px; }
.text-button { position: absolute; top: 50%; right: 6px; min-width: 44px; min-height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--primary); cursor: pointer; font-size: 13px; font-weight: 750; transform: translateY(-50%); }

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, transform 100ms ease;
}
.button:active { transform: translateY(1px); }
.button:disabled { cursor: wait; opacity: 0.62; }
.button-primary { background: var(--primary); color: var(--on-primary); }
.button-primary:hover { background: var(--primary-hover); }
.button-secondary { border-color: var(--border); background: var(--surface); color: var(--ink); }
.button-secondary:hover { border-color: #aeb8b1; background: #fafbf8; }
.button-quiet { color: var(--primary); background: transparent; }
.button-danger { background: var(--error); color: white; }
.button-danger-quiet { min-height: 38px; padding: 7px 11px; background: var(--error-bg); color: var(--error); }
.submit-button, .full-button { width: 100%; min-height: 50px; }
.form-footnote { margin: 12px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

.progress-wrap { display: grid; gap: 7px; margin-bottom: 14px; }
.progress-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
progress { width: 100%; height: 8px; border: 0; border-radius: 999px; overflow: hidden; }
progress::-webkit-progress-bar { background: var(--surface-strong); }
progress::-webkit-progress-value { background: var(--primary); }
progress::-moz-progress-bar { background: var(--primary); }

.alert { display: grid; gap: 2px; margin: 0 0 24px; padding: 14px 16px; border: 1px solid; border-radius: 12px; font-size: 14px; }
.alert-error { border-color: #efc3bd; background: var(--error-bg); color: #7e2922; }
.alert-success { border-color: #b8decf; background: var(--success-bg); color: #0f6046; }
.alert-warning { border-color: #ead3a5; background: var(--warning-bg); color: #754713; }
.alert-neutral { border-color: var(--border); background: var(--surface-subtle); color: var(--muted); }

.result-page { padding-block: clamp(52px, 8vw, 90px); }
.result-page > h1 { font-size: clamp(38px, 6vw, 58px); }
.success-seal { display: grid; width: 62px; height: 62px; place-items: center; margin-bottom: 26px; border-radius: 50%; background: var(--success-bg); color: var(--success); font-size: 13px; font-weight: 900; }
.result-page > .alert { margin-top: 32px; }

.link-section { display: grid; grid-template-columns: minmax(0, 1fr) 156px; gap: 26px; align-items: center; margin-top: 18px; padding: 26px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.primary-link { border-color: rgba(23, 63, 53, 0.34); }
.secret-link { border-style: dashed; }
.link-copy { min-width: 0; }
.link-copy > p:not(.section-kicker) { margin: 8px 0 16px; color: var(--muted); }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { min-width: 0; color: var(--muted); font-size: 13px; }
.copy-row .button { flex: 0 0 auto; }
.qr { width: 156px; height: 156px; border: 1px solid var(--border); border-radius: 10px; image-rendering: pixelated; }
.page-actions { display: flex; gap: 10px; margin-top: 28px; }
.copy-feedback { min-height: 24px; color: var(--success); font-size: 14px; text-align: center; }

.auth-shell { width: min(calc(100% - 40px), 480px); margin: clamp(60px, 10vw, 120px) auto; padding: clamp(26px, 5vw, 42px); }
.auth-shell h1 { font-size: clamp(30px, 6vw, 42px); }
.auth-shell > p:not(.eyebrow) { margin: 14px 0 26px; color: var(--muted); }
.error-page { text-align: center; }

.content-shell { padding-block: clamp(50px, 7vw, 84px); }
.share-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 0.45fr); gap: 52px; align-items: end; padding-bottom: 40px; border-bottom: 1px solid var(--border); }
.share-meta { display: grid; gap: 9px; margin: 0; }
.share-meta div { display: flex; justify-content: space-between; gap: 18px; }
.share-meta dt { color: var(--muted); }
.share-meta dd { margin: 0; font-weight: 750; text-align: right; }
.content-section { padding-block: 38px; border-bottom: 1px solid var(--border); }
.section-heading { margin-bottom: 18px; }
.shared-text { max-width: 76ch; padding: 22px; border-left: 3px solid var(--accent); background: var(--surface); white-space: pre-wrap; overflow-wrap: anywhere; }

.file-list, .compact-file-list { display: grid; gap: 10px; }
.file-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 16px; align-items: center; min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.file-preview, .file-type { width: 72px; height: 58px; border-radius: 8px; background: var(--surface-strong); object-fit: cover; }
.file-type { display: grid; place-items: center; color: var(--primary); font-size: 11px; font-weight: 900; letter-spacing: .04em; }
.file-info { min-width: 0; }
.file-info h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

.workspace-shell { padding-block: clamp(46px, 7vw, 76px); }
.workspace-header { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.workspace-header h1 { font-size: clamp(32px, 5vw, 50px); }
.workspace-header p:not(.eyebrow) { margin: 10px 0 0; color: var(--muted); }
.workspace-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.compact-choices .choice > span { min-height: 54px; }
.compact-file-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; padding: 12px 0; border-bottom: 1px solid var(--border); }
.compact-file-row > div { display: grid; min-width: 0; }
.compact-file-row strong { overflow-wrap: anywhere; }
.compact-file-row small { color: var(--muted); }
.upload-inline { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border); }
.empty-state { display: grid; gap: 3px; padding: 24px; border-radius: 12px; background: var(--surface-subtle); color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); }
.management-files { margin-top: 18px; }

.stats-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 18px; padding: 18px 22px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.stats-strip div { padding: 0 18px; border-right: 1px solid var(--border); }
.stats-strip div:first-child { padding-left: 0; }
.stats-strip div:last-child { padding-right: 0; border: 0; }
.stats-strip dt { color: var(--muted); font-size: 12px; }
.stats-strip dd { margin: 3px 0 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.check-row { display: flex; align-items: center; gap: 9px; min-height: 44px; margin-top: 4px; cursor: pointer; }
.check-row input { width: 20px; min-height: 20px; }

.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-top: 18px; padding: 26px; border: 1px solid #e5c2bd; border-radius: 16px; background: #fff9f7; }
.danger-zone p:not(.section-kicker) { margin: 6px 0 0; color: var(--muted); }
.danger-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

[hidden] { display: none !important; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { position: static; padding-top: 0; }
  .hero-copy .lede { max-width: 70ch; }
  .workspace-grid { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); row-gap: 18px; }
  .stats-strip div:nth-child(2) { border-right: 0; }
  .stats-strip div:nth-child(3) { padding-left: 0; }
}

@media (max-width: 720px) {
  .site-header, .site-footer, .page-shell, .content-shell, .workspace-shell, .narrow-shell { width: min(calc(100% - 28px), var(--container)); }
  .site-header { min-height: 66px; }
  .header-note { display: none; }
  .hero { gap: 34px; padding-block: 38px; }
  .share-form, .workspace-grid > .panel, .management-files { padding: 20px; }
  .choice-grid, .form-grid { grid-template-columns: 1fr; }
  .choice > span { min-height: 58px; }
  .choice small { font-size: 12px; }
  .link-section { grid-template-columns: 1fr; }
  .qr { justify-self: center; }
  .copy-row { align-items: stretch; flex-direction: column; }
  .copy-row .button { width: 100%; }
  .page-actions { flex-direction: column; }
  .share-heading { grid-template-columns: 1fr; gap: 26px; }
  .file-row { grid-template-columns: 56px minmax(0, 1fr); }
  .file-preview, .file-type { width: 56px; height: 52px; }
  .file-row > .button, .file-row > .view-only { grid-column: 1 / -1; width: 100%; }
  .workspace-header, .danger-zone { align-items: stretch; flex-direction: column; }
  .workspace-header .button { width: 100%; }
  .danger-actions { justify-content: stretch; }
  .danger-actions form, .danger-actions .button { width: 100%; }
}

@media (max-width: 430px) {
  h1 { font-size: 34px; }
  .steps { gap: 10px; }
  .steps li { width: calc(50% - 5px); }
  .form-heading { flex-direction: column; gap: 8px; }
  .privacy-note { align-self: flex-start; }
  .stats-strip { grid-template-columns: 1fr; }
.clipboard-helper { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
  .stats-strip div { padding: 10px 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .stats-strip div:last-child { border-bottom: 0; }
  .compact-file-row { align-items: stretch; flex-direction: column; }
  .compact-file-row form, .compact-file-row .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

@media (min-width: 901px) and (min-height: 760px) {
  .hero { padding-block: 48px; }
  .share-form { padding: 28px; }
  .share-form .form-heading { margin-bottom: 18px; }
  .share-form .field { margin-bottom: 14px; }
  .share-form textarea { min-height: 90px; }
  .share-form .dropzone { margin-bottom: 14px; }
  .share-form .dropzone-action { padding-block: 18px 16px; }
  .share-form .choice > span { min-height: 68px; }
  .share-form .advanced { margin-bottom: 14px; }
  .share-form .advanced summary { min-height: 50px; }
}

.desktop-create-button { display: none; }
@media (min-width: 901px) {
  .desktop-create-button { display: inline-flex; min-height: 40px; padding-inline: 14px; }
  .share-form .form-heading { align-items: center; }
}
