:root {
  --ink: #1f2328;
  --muted: #6b7280;
  --paper: #faf7f1;
  --surface: #ffffff;
  --soft: #fff4e6;
  --line: #e4ded5;
  --orange: #ff7424;
  --orange-dark: #d85c12;
  --teal: #087f7b;
  --gold: #c27803;
  --charcoal: #171717;
  --shadow: 0 18px 46px rgba(31, 35, 40, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.035) 1px, transparent 1px) 0 0 / 36px 36px,
    var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans KR", "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(255, 116, 36, 0.25);
  outline-offset: 2px;
}

.shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  padding: 26px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--orange-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 4.6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0;
}

.lead {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.mode-tabs {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--surface);
  padding: 10px 12px 0;
}

.mode-tab {
  min-height: 48px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--muted);
  padding: 0 18px;
  font-weight: 800;
}

.mode-tab.active {
  border-color: var(--line);
  background: #fbfbfa;
  color: var(--ink);
}

.mode-view {
  display: none;
}

.mode-view.active {
  display: grid;
}

.tool-grid {
  grid-template-columns: minmax(380px, 0.9fr) minmax(460px, 1.1fr);
  min-height: 720px;
  border: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel {
  padding: 24px;
}

.input-panel {
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.output-panel {
  background: #fbfaf8;
}

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

.panel-head > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.label-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--orange);
  box-shadow: 0 0 0 6px rgba(255, 116, 36, 0.12);
}

.label-dot.teal {
  background: var(--teal);
  box-shadow: 0 0 0 6px rgba(8, 127, 123, 0.1);
}

.label-dot.gold {
  background: var(--gold);
  box-shadow: 0 0 0 6px rgba(194, 120, 3, 0.12);
}

h2 {
  margin: 0;
  font-size: 1.08rem;
}

form {
  display: grid;
  gap: 15px;
}

label {
  display: grid;
  gap: 7px;
  color: #252525;
  font-size: 0.9rem;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #d8d0c7;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 12px 13px;
  font-size: 0.96rem;
  font-weight: 600;
}

textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.65;
}

input[type="file"] {
  padding: 10px;
}

.language-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid #d8d0c7;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.language-checks span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #252525;
  font-size: 0.9rem;
  font-weight: 800;
}

.language-checks input {
  width: auto;
}

.field-row {
  display: grid;
  gap: 12px;
}

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

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

.hint {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
}

.actions,
.output-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.ghost-button,
.copy-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 15px;
  font-weight: 800;
}

.primary-button {
  flex: 1;
  min-width: 190px;
  background: var(--orange);
  color: #ffffff;
}

.secondary-button {
  background: #f8f6f3;
  border-color: #d8d0c7;
  color: #252525;
}

.ghost-button {
  background: #ffffff;
  border-color: #d8d0c7;
  color: #252525;
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  margin-bottom: 18px;
  overflow: hidden;
}

.score-strip div {
  padding: 14px;
  border-right: 1px solid var(--line);
}

.score-strip div:last-child {
  border-right: 0;
}

.score-strip strong,
.score-strip span {
  display: block;
}

.score-strip strong {
  font-size: 1.34rem;
  line-height: 1;
}

.score-strip span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.empty-state {
  display: grid;
  min-height: 280px;
  place-items: center;
  border: 1px dashed #c9c1b8;
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.empty-state.hidden {
  display: none;
}

.review-list {
  display: grid;
  gap: 14px;
}

.review-card {
  border: 1px solid #e4ded5;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.review-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #ece7e1;
  background: #fbfaf8;
}

.review-meta strong {
  font-size: 0.88rem;
}

.keyword-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.keyword-pills span {
  border: 1px solid rgba(255, 116, 36, 0.24);
  border-radius: 999px;
  background: rgba(255, 116, 36, 0.08);
  color: var(--orange-dark);
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 800;
}

.review-body {
  margin: 0;
  padding: 16px;
  color: #1f1f1f;
  font-size: 0.98rem;
  line-height: 1.78;
  white-space: pre-wrap;
}

.review-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid #ece7e1;
}

.review-footer span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.copy-button {
  background: var(--charcoal);
  color: white;
}

.post-output-layout {
  display: grid;
  gap: 18px;
}

.post-output-layout.hidden {
  display: none;
}

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

.thumb-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

#postCanvas,
#postCanvasClean {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  border: 1px solid #d8d0c7;
  border-radius: 8px;
  background: #2f2b27;
  box-shadow: 0 14px 34px rgba(31, 35, 40, 0.12);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  border-radius: 8px;
  background: var(--charcoal);
  color: #ffffff;
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 800;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 980px) {
  .shell {
    padding: 14px;
  }

  .tool-grid,
  .mode-view.active,
  .thumbnail-grid {
    grid-template-columns: 1fr;
  }

  .input-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 0;
  }

  .topbar,
  .mode-tabs,
  .tool-grid {
    border-radius: 0;
  }

  .panel,
  .topbar {
    padding: 20px;
  }

  .mode-tabs {
    overflow-x: auto;
  }

  .mode-tab {
    white-space: nowrap;
  }

  .field-row.two,
  .field-row.three,
  .score-strip {
    grid-template-columns: 1fr;
  }

  .score-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .score-strip div:last-child {
    border-bottom: 0;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .output-actions,
  .actions {
    width: 100%;
  }

  .ghost-button,
  .secondary-button,
  .primary-button {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
