:root {
  --paper: #f4f1ea;
  --paper-deep: #ece7dc;
  --sheet: #fffdf8;
  --ink: #1e1c18;
  --ink-soft: #4a463e;
  --muted: #7c7568;
  --line: #ded6c6;
  --line-soft: #ebe5d9;
  --accent: #b0472b;
  --accent-deep: #8e3822;
  --accent-soft: #f3e2d8;
  --ok: #3f6b4f;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Consolas, "Liberation Mono", Menlo, monospace;
  --shadow-soft: 0 1px 2px rgba(30, 28, 24, 0.05), 0 14px 34px -22px rgba(30, 28, 24, 0.4);
  --shadow-lift: 0 2px 4px rgba(30, 28, 24, 0.06), 0 20px 42px -24px rgba(30, 28, 24, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.is-app {
  min-height: 100dvh;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 14% -8%, rgba(176, 71, 43, 0.08), transparent 46%),
    radial-gradient(circle at 96% 4%, rgba(107, 124, 88, 0.09), transparent 42%);
  background-attachment: fixed;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.icon-xs {
  width: 13px;
  height: 13px;
}

.icon-xl {
  width: 46px;
  height: 46px;
}

/* ---------------------------------------------------------------- brand */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex: 0 0 auto;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1;
  padding-bottom: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.brand-mark i {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.brand-text {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-text strong {
  font-weight: 700;
  color: var(--ink);
}

.brand-text em {
  font-weight: 400;
  font-style: italic;
  color: var(--accent);
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--sheet);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease,
    box-shadow 0.16s ease, color 0.16s ease;
}

.btn:hover {
  border-color: #c9bfab;
  background: #fff;
  box-shadow: 0 2px 8px rgba(30, 28, 24, 0.08);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  box-shadow: 0 8px 20px -14px rgba(30, 28, 24, 0.9);
}

.btn-primary .icon {
  color: #f6ece2;
}

.btn-primary:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #fff;
  box-shadow: 0 10px 24px -14px rgba(142, 56, 34, 0.9);
}

.btn-primary:hover .icon {
  color: #fff;
}

.btn-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  box-shadow: none;
}

.btn-quiet:hover {
  background: rgba(30, 28, 24, 0.05);
  border-color: transparent;
  color: var(--ink);
  box-shadow: none;
}

.btn-small {
  height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 12px;
}

.btn-dashed {
  width: 100%;
  margin-top: 20px;
  border-style: dashed;
  background: transparent;
  color: var(--muted);
}

.btn-dashed:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(176, 71, 43, 0.04);
}

.btn-file {
  height: 42px;
  font-size: 12.5px;
}

.btn-file .icon {
  color: var(--muted);
  transition: color 0.16s ease;
}

.btn-file:hover .icon {
  color: var(--accent);
}

/* --------------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 22px;
  height: 72px;
  padding: 0 clamp(16px, 4vw, 44px);
  background: rgba(244, 241, 234, 0.86);
  border-bottom: 1px solid rgba(30, 28, 24, 0.08);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
}

.topbar-note {
  margin-left: auto;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.topbar-note span {
  color: var(--accent);
  font-style: italic;
  font-family: var(--serif);
  font-size: 13px;
}

/* ------------------------------------------------------------ empty stage */

.shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) clamp(14px, 3.5vw, 28px) 96px;
}

.stage-empty {
  max-width: 920px;
  margin: 0 auto;
  padding-top: clamp(8px, 3vh, 34px);
  animation: rise 0.4s ease both;
}

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 350px;
  padding: clamp(34px, 5vw, 58px) clamp(20px, 4vw, 48px);
  border: 1.5px dashed #cfc7b6;
  border-radius: 20px;
  background-color: var(--sheet);
  background-image: radial-gradient(rgba(30, 28, 24, 0.045) 1px, transparent 1px);
  background-size: 20px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease,
    box-shadow 0.2s ease;
}

.dropzone:hover,
.dropzone.is-over {
  border-color: var(--accent);
  background-color: #fffaf3;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.dropzone-badge {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-deep);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.dropzone-badge .icon {
  width: 25px;
  height: 25px;
}

.dropzone:hover .dropzone-badge,
.dropzone.is-over .dropzone-badge {
  transform: translateY(-3px) scale(1.04);
  background: #eed6c8;
}

.dropzone h1 {
  font-family: var(--serif);
  font-size: clamp(27px, 3.4vw, 38px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.dropzone h1 em {
  font-style: italic;
  color: var(--accent);
}

.dropzone-lead {
  font-size: 14px;
  color: var(--muted);
}

.dropzone-hint {
  max-width: 47ch;
  margin-top: 14px;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.dropzone-formats {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #9b9385;
}

.paste-block {
  margin-top: 22px;
  padding: 18px clamp(16px, 2.4vw, 22px) 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--sheet);
  box-shadow: var(--shadow-soft);
}

.paste-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.paste-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.paste-hint {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.paste-input {
  width: 100%;
  min-height: 140px;
  max-height: 52vh;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf9;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  resize: vertical;
  tab-size: 4;
  overflow: auto;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.paste-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.paste-input::placeholder {
  color: #a39b8c;
}

.paste-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.paste-count {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9b9385;
}

.paste-actions .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.paste-actions .btn:disabled:hover {
  border-color: var(--line);
  background: var(--sheet);
}

@media (max-width: 640px) {
  .paste-head {
    flex-direction: column;
    gap: 3px;
  }
  .paste-hint {
    text-align: left;
  }
  .paste-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .paste-count {
    text-align: center;
  }
}

.feature-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 34px);
  margin-top: clamp(26px, 4vw, 44px);
  padding: 0;
  list-style: none;
}

.feature-row li {
  display: flex;
  gap: 13px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.feature-num {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding-top: 2px;
}

.feature-row strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 3px;
}

.feature-row p {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* ------------------------------------------------------------- doc stage */

.stage-doc {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  gap: clamp(18px, 2.4vw, 28px);
  align-items: start;
  animation: rise 0.35s ease both;
}

.panel {
  position: sticky;
  top: 96px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--sheet);
  box-shadow: var(--shadow-soft);
}

.file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.file-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.file-card-text {
  min-width: 0;
}

.file-name {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.action-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.file-card + .action-block {
  margin-top: 16px;
  padding-top: 0;
  border-top: 0;
}

.action-title {
  margin-bottom: 9px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.action-block .btn {
  width: 100%;
}

.action-block .btn + .btn {
  margin-top: 8px;
}

.action-hint {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: #918a7c;
}

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

.download-grid .btn + .btn {
  margin-top: 0;
}

/* -------------------------------------------------------------- preview */

.preview-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--sheet);
  box-shadow: var(--shadow-soft);
}

.preview-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbf8f1;
}

.tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 9px;
  background: #f0ebe0;
}

.tab {
  padding: 7px 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tab:hover {
  color: var(--ink);
}

.tab.is-active {
  background: var(--sheet);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(30, 28, 24, 0.12);
}

.preview-note {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
}

.preview-body {
  background: #fff;
}

#preview-frame {
  display: block;
  width: 100%;
  height: clamp(520px, calc(100dvh - 240px), 940px);
  border: 0;
  background: #fff;
}

.code-body {
  background: #201e1a;
}

#html-code {
  height: clamp(520px, calc(100dvh - 240px), 940px);
  margin: 0;
  padding: 22px 24px 40px;
  overflow: auto;
  background: #201e1a;
  color: #efe9dd;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
  scrollbar-width: thin;
  scrollbar-color: #4a463e transparent;
}

#html-code::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

#html-code::-webkit-scrollbar-thumb {
  background: #4a463e;
  border-radius: 6px;
}

/* -------------------------------------------------------------- overlays */

.processing {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(244, 241, 234, 0.74);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.processing-card {
  width: min(340px, 100%);
  padding: 30px 32px 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--sheet);
  box-shadow: var(--shadow-lift);
  text-align: center;
}

.spinner {
  display: inline-block;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid var(--line-soft);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.processing-title {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
}

.processing-sub {
  margin-top: 4px;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.progress {
  position: relative;
  height: 3px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--line-soft);
}

.progress span {
  position: absolute;
  top: 0;
  left: 0;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  animation: slide 1.15s ease-in-out infinite;
}

.drag-veil {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 22, 19, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.drag-frame {
  display: grid;
  place-items: center;
  gap: 6px;
  width: min(640px, 100%);
  padding: clamp(38px, 6vw, 68px) 24px;
  border: 2px dashed rgba(244, 241, 234, 0.45);
  border-radius: 24px;
  background: rgba(23, 22, 19, 0.28);
  color: var(--paper);
  text-align: center;
}

.drag-frame .icon {
  color: #e7a58d;
  margin-bottom: 8px;
}

.drag-frame p {
  font-family: var(--serif);
  font-size: clamp(21px, 3vw, 28px);
}

.drag-frame span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(244, 241, 234, 0.62);
}

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(92vw, 520px);
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 18px 38px -20px rgba(0, 0, 0, 0.8);
  animation: toast-in 0.24s ease both;
}

.toast .icon {
  color: #e7a58d;
}

.toast.is-error {
  background: #7d2f1f;
}

.toast.is-error .icon {
  color: #ffd9c8;
}

.toast.is-out {
  animation: toast-out 0.22s ease both;
}

.noscript {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99;
  padding: 10px;
  background: var(--accent);
  color: #fff;
  text-align: center;
  font-size: 13px;
}

/* ------------------------------------------------------------ lock screen */

body.is-lock {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-x: hidden;
  background: #161512;
  color: var(--paper);
}

body.is-lock::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(60% 55% at 50% -10%, rgba(176, 71, 43, 0.26), transparent 70%),
    radial-gradient(45% 45% at 88% 105%, rgba(107, 124, 88, 0.18), transparent 70%);
  pointer-events: none;
}

body.is-lock::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(244, 241, 234, 0.055) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.7;
  pointer-events: none;
}

.lock {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 396px;
}

.lock-card {
  padding: 32px 30px 24px;
  border-radius: 22px;
  background: #f7f3ea;
  color: var(--ink);
  text-align: center;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.lock-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 26px;
}

.lock-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 20px;
}

.lock-brand .brand-text {
  font-size: 16.5px;
}

.lock-card h1 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.lock-sub {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--muted);
}

.pin-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  min-height: 20px;
  margin: 24px 0 4px;
}

.pin-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid #c9c0ae;
  background: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.pin-dot.is-filled {
  background: var(--ink);
  border-color: var(--ink);
  transform: scale(1.12);
}

.pin-error {
  min-height: 34px;
  padding-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-deep);
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.key {
  height: 56px;
  border: 1px solid #e2dbcc;
  border-radius: 13px;
  background: #fffdf8;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, box-shadow 0.15s ease;
}

.key:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: #fff;
  box-shadow: 0 6px 16px -12px rgba(30, 28, 24, 0.7);
}

.key:active {
  transform: scale(0.97);
}

.key-fn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: #f1ece1;
}

.key-fn .icon {
  width: 19px;
  height: 19px;
}

.key:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  border-color: #e2dbcc;
  color: var(--muted);
}

.lock-foot {
  margin-top: 20px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.lock-foot .icon {
  vertical-align: -2px;
  margin-right: 5px;
}

.lock-card.is-error {
  animation: shake 0.4s ease;
}

.lock-card.is-error .pin-dot {
  border-color: var(--accent);
}

/* ------------------------------------------------------------- animations */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

@keyframes slide {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(280%);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-7px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(4px);
  }
}

/* ------------------------------------------------------------- responsive */

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

  .panel {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 22px;
  }

  .file-card,
  .btn-dashed {
    grid-column: 1 / -1;
  }

  .action-block {
    margin-top: 16px;
    padding-top: 0;
    border-top: 0;
  }

  .btn-dashed {
    margin-top: 18px;
  }

  #preview-frame,
  #html-code {
    height: 68vh;
  }
}

@media (max-width: 760px) {
  .topbar-note {
    display: none;
  }

  .feature-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .feature-row li {
    padding-top: 12px;
  }

  .panel {
    display: block;
  }

  .action-block {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
  }

  .file-card + .action-block {
    margin-top: 16px;
    padding-top: 0;
    border-top: 0;
  }

  .preview-note {
    display: none;
  }
}

@media (max-width: 560px) {
  .topbar {
    height: 62px;
    gap: 10px;
    padding: 0 14px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 20px;
  }

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

  .topbar .btn-small span {
    display: none;
  }

  .topbar .btn-small {
    width: 36px;
    padding: 0;
    margin-left: auto;
  }

  .shell {
    padding: 22px 12px 64px;
  }

  .dropzone {
    min-height: 300px;
    padding: 32px 18px;
  }

  .dropzone-hint {
    font-size: 14px;
  }

  .preview-bar {
    padding: 9px 10px;
    gap: 8px;
  }

  .tab {
    padding: 7px 11px;
  }

  .lock-card {
    padding: 26px 18px 20px;
  }

  .key {
    height: 52px;
  }
}

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