:root {
  --paper: #efe6d6;
  --paper-2: #e7dcc8;
  --card: #fffaf3;
  --ink: #221910;
  --muted: #6d6258;
  --line: #e0d3c0;
  --stamp: #8f3224;
  --stamp-ink: #fff8f4;
  --pine: #1e6b52;
  --pine-soft: #e7f4ee;
  --fail: #9c2433;
  --fail-soft: #fdecee;
  --warn: #8a5a12;
  --warn-soft: #fff4df;
  --shadow: 0 16px 40px rgba(70, 42, 18, 0.08);
  color: var(--ink);
  background: var(--paper);
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 280px at 0% -10%, #f7f1e4, transparent 60%),
    var(--paper);
}

button, input, textarea, select { font: inherit; color: inherit; }

button { cursor: pointer; }

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

.app { min-height: 100vh; }

.wrap {
  width: min(920px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.mast {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--stamp);
  font-weight: 700;
}

h1 {
  margin: 0;
  font-family: Palatino, "Iowan Old Style", "Times New Roman", serif;
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.95;
}

.sub { margin: 8px 0 0; color: var(--muted); max-width: 38em; }

.ghost, .primary, .tiny {
  border-radius: 999px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
}

.primary {
  background: var(--stamp);
  color: var(--stamp-ink);
  font-weight: 700;
}

.primary:disabled, .tiny:disabled { opacity: 0.55; cursor: wait; }

.ghost {
  background: transparent;
  border-color: var(--line);
}

.tiny {
  min-height: 36px;
  background: var(--card);
  border: 1px solid var(--line);
}

a.tiny {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  margin-bottom: 8px;
}

.nav button {
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  min-height: 40px;
  padding: 0 14px;
}

.nav button[aria-current="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

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

.panel h2 { margin: 0 0 6px; font-size: 24px; }

.help { margin: 0 0 16px; color: var(--muted); }

label { display: block; font-weight: 700; margin: 14px 0 6px; }

textarea, input[type="text"], input[type="password"], select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
}

textarea { min-height: 120px; resize: vertical; }

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.row > * { flex: 1 1 180px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.checkline { display: flex; gap: 8px; align-items: center; font-weight: 600; margin-top: 12px; }

.banner, .usage, .error, .okline {
  border-radius: 14px;
  padding: 12px 14px;
  margin: 14px 0 0;
}

.banner { background: var(--warn-soft); color: var(--warn); }
.usage { background: var(--pine-soft); color: #144838; }
.error { background: var(--fail-soft); color: var(--fail); }
.okline { background: var(--pine-soft); color: #144838; }

.filecard, .scene, .issue, .keycard {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  margin-top: 10px;
  background: #fff;
}

.filecard header, .keycard header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.pill {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 700;
}

.pill.pass { background: var(--pine-soft); color: var(--pine); }
.pill.fail { background: var(--fail-soft); color: var(--fail); }
.pill.na { background: var(--paper-2); color: var(--muted); }

.check { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); }
.check b { font-weight: 700; }
.check b.fail { color: var(--fail); }
.check span { color: var(--muted); text-align: right; }

.scene { font-family: inherit; white-space: pre-wrap; }

.copygrid { display: grid; gap: 12px; }

.copyfield { border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: #fff; }
.copyfield strong { display: block; margin-bottom: 6px; }
.copyfield p { margin: 0; white-space: pre-wrap; }
.counter { margin-top: 6px; font-size: 13px; color: var(--muted); }
.counter.over { color: var(--fail); font-weight: 700; }

.preview {
  margin-top: 12px;
  background:
    linear-gradient(45deg, #efe6d6 25%, transparent 25%),
    linear-gradient(-45deg, #efe6d6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #efe6d6 75%),
    linear-gradient(-45deg, transparent 75%, #efe6d6 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-color: #fff;
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}

.preview img { max-width: min(100%, 360px); height: auto; }

.login-card { margin-top: 28px; }

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

.names { margin: 8px 0 0; color: var(--muted); font-size: 14px; word-break: break-all; }

@media (min-width: 800px) {
  .copygrid { grid-template-columns: 1fr 1fr 1fr; }
  .split { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
}
