@font-face {
  font-family: "GyeonggiMillenniumTitle";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2410-3@1.0/Title_Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

: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 {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  padding: 26px;
}

.topbar-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 260px;
}

.auth-panel {
  display: grid;
  justify-items: end;
  gap: 7px;
  min-width: 230px;
}

.auth-panel p {
  max-width: 260px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: right;
}

.auth-account {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 5px 6px 5px 8px;
}

.auth-account img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.auth-account span {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.ghost-button.compact {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.78rem;
}

.hidden {
  display: none !important;
}

.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;
}

.admin-view {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(440px, 1.1fr);
  gap: 18px;
  margin-top: 18px;
}

.admin-panel,
.business-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.business-list {
  display: grid;
  gap: 12px;
}

.business-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px;
}

.business-card[draggable="true"] {
  cursor: grab;
}

.business-card.dragging {
  opacity: 0.55;
}

.business-card.drag-over {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(255, 117, 35, 0.18);
}

.drag-handle {
  width: 32px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: grab;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
}

.business-card strong {
  display: block;
  margin-bottom: 10px;
}

.business-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.compact-panel {
  align-content: start;
}

.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;
}

.template-box {
  display: grid;
  gap: 12px;
  border: 1px solid #d8d0c7;
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.template-box legend,
.language-checks legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.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;
}

.google-profile-field {
  display: grid;
  gap: 8px;
}

.google-profile-field > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.google-profile-button {
  min-height: 46px;
  border: 1px solid #4285f4;
  border-radius: 8px;
  background: #4285f4;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.google-profile-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(66, 133, 244, 0.24);
}

.google-profile-button:focus-visible {
  outline: 3px solid rgba(66, 133, 244, 0.3);
  outline-offset: 3px;
}

.google-profile-empty {
  margin: 0;
  border: 1px dashed #d8d0c7;
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.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;
}

.post-link-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 14px 12px;
  border: 1px solid #e4ded5;
  border-radius: 8px;
  background: #fbfaf8;
  padding: 10px 12px;
}

.post-link-box span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.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;
}

.site-footer {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 28px 30px;
  color: #6d655c;
  font-size: 0.82rem;
}

.business-info {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  line-height: 1.6;
}

.business-info strong {
  color: var(--charcoal);
  margin-right: 4px;
}

.business-info span {
  white-space: normal;
}

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

  .tool-grid,
  .mode-view.active,
  .thumbnail-grid,
  .admin-view {
    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;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar-actions,
  .auth-panel {
    width: 100%;
    justify-items: stretch;
    justify-content: stretch;
  }

  .auth-panel p {
    text-align: left;
  }

  .auth-account {
    justify-content: space-between;
  }

  .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;
  }

  .site-footer {
    padding: 0 20px 26px;
  }

  .business-info {
    display: grid;
    gap: 4px;
  }
}

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