:root {
  --bg: #09090a;
  --bg-soft: #121214;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-solid: #ffffff;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f5f5f7;
  --text-soft: rgba(245, 245, 247, 0.7);
  --text-faint: rgba(245, 245, 247, 0.45);
  --ink: #111214;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Display",
    "SF Pro Text",
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), transparent 28%),
    linear-gradient(180deg, #101113 0%, var(--bg) 52%, #050506 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

#app,
.admin-shell,
.login-shell {
  min-height: 100vh;
}

.login-shell {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card,
.editor-section,
.json-panel,
.side-panel,
.toolbar {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.login-card {
  width: min(560px, 100%);
  padding: 28px;
  border-radius: var(--radius-xl);
  display: grid;
  gap: 22px;
}

.eyebrow {
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-card h1,
.admin-topbar h1 {
  font-size: clamp(32px, 4vw, 52px);
  line-height: 0.92;
  letter-spacing: -0.06em;
}

.muted,
.field-help,
.status-note,
.sidebar-copy {
  color: var(--text-soft);
}

.login-form,
.editor-stack,
.collection-stack,
.field-grid {
  display: grid;
  gap: 14px;
}

.field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 15px;
  outline: none;
}

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

.button-row,
.toolbar-actions,
.section-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button,
.ghost-button,
.link-button,
.mini-button {
  appearance: none;
  border-radius: 999px;
  min-height: 44px;
  padding: 0 16px;
  cursor: pointer;
}

.button {
  border: 0;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.ghost-button,
.link-button,
.mini-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mini-button.is-danger {
  color: #ffb1b1;
}

.status-banner {
  min-height: 22px;
  font-size: 14px;
  color: var(--text-soft);
}

.status-banner.is-error {
  color: #ffb1b1;
}

.admin-shell {
  width: min(1600px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 20px 0 32px;
  display: grid;
  gap: 18px;
}

.admin-topbar,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-radius: var(--radius-xl);
}

.admin-topbar {
  align-items: flex-end;
}

.admin-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
}

.side-panel {
  position: sticky;
  top: 18px;
  align-self: start;
  border-radius: var(--radius-xl);
  padding: 22px;
  display: grid;
  gap: 18px;
}

.sidebar-stats {
  display: grid;
  gap: 10px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.stat-row:last-child {
  border-bottom: 0;
}

.editor-section,
.json-panel {
  border-radius: var(--radius-xl);
  padding: 22px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.collection-card,
.social-group,
.json-panel textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
}

.collection-card,
.social-group {
  padding: 16px;
}

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

.row-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.json-panel textarea {
  min-height: 420px;
  padding: 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
}

.footer-note,
.word-safe {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1100px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .admin-shell {
    width: min(100vw, calc(100vw - 16px));
    padding-top: 12px;
  }

  .admin-topbar,
  .toolbar,
  .editor-section,
  .json-panel,
  .side-panel,
  .login-card {
    padding: 18px;
    border-radius: 24px;
  }

  .admin-topbar,
  .toolbar,
  .section-head,
  .group-head {
    flex-direction: column;
    align-items: stretch;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .button,
  .ghost-button,
  .link-button,
  .mini-button {
    width: 100%;
  }
}
