:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #dde4eb;
  --blue: #2251f2;
  --green: #12876f;
  --red: #e24141;
  --soft-blue: #eef3ff;
  --shadow: 0 18px 50px rgba(18, 32, 55, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, Pretendard, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 22px;
  background: #101828;
  color: #fff;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 34px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 10px;
  background: #2f6bff;
  font-weight: 800;
}

.brand strong,
.brand small,
.status-card strong,
.status-card small {
  display: block;
}

.brand small,
.status-card small {
  margin-top: 3px;
  color: #aab4c2;
  font-size: 13px;
}

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

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 13px 14px;
  background: transparent;
  color: #d7deea;
  text-align: left;
  cursor: pointer;
}

.nav-item.active,
.nav-item:hover {
  background: #1f2a44;
  color: #fff;
}

.status-card {
  position: absolute;
  right: 22px;
  bottom: 24px;
  left: 22px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.14);
}

.content {
  min-width: 0;
  padding: 38px;
}

.topbar {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
}

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

h1 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.25;
}

h2 {
  margin-bottom: 5px;
  font-size: 19px;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.grid {
  display: grid;
  gap: 22px;
}

.grid.two {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

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

.section-title {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.section-title span {
  display: grid;
  min-width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: var(--soft-blue);
  color: var(--blue);
  font-weight: 900;
}

.section-title p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.section-title.compact {
  margin-bottom: 12px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: #344054;
  font-size: 14px;
  font-weight: 800;
}

.check-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #f8fbff;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.check-row span,
.check-row small {
  display: block;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(34, 81, 242, 0.12);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.advanced {
  margin: 8px 0 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.advanced summary {
  margin-bottom: 14px;
  color: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 900;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.primary-button {
  background: var(--blue);
  color: #fff;
}

.secondary-button {
  background: var(--green);
  color: #fff;
}

.danger-button {
  background: var(--red);
  color: #fff;
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.wide {
  width: 100%;
}

.empty-state {
  display: grid;
  min-height: 360px;
  place-items: center;
  border: 1px dashed #cad3df;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.draft-grid {
  display: grid;
  gap: 14px;
}

.draft-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfe;
}

.draft-box h3 {
  margin: 0 0 10px;
  font-size: 17px;
}

.draft-box p {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.6;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill {
  border-radius: 999px;
  padding: 6px 10px;
  background: #eef2f7;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

.post-list {
  display: grid;
  gap: 10px;
  max-height: 68vh;
  overflow: auto;
}

.post-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
}

.post-item a {
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.post-item a:hover {
  color: var(--blue);
}

.post-item p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.post-meta {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.naver-result {
  display: grid;
  gap: 14px;
}

.result-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfe;
}

.result-box h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.result-meta,
.copy-row,
.history-item,
.history-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.result-meta {
  justify-content: flex-start;
  margin-bottom: 12px;
}

.result-meta span {
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef2f7;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.copy-row,
.history-item {
  justify-content: space-between;
}

.title-options {
  display: grid;
  gap: 8px;
}

.title-option {
  width: 100%;
  border: 1px solid #cfd8e3;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.title-option:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.generated-body {
  min-height: 330px;
  resize: vertical;
  line-height: 1.75;
  font-weight: 500;
}

.hashtag-line {
  margin: 0 0 10px;
  color: var(--blue);
  line-height: 1.7;
  font-weight: 800;
}

.mini-button {
  padding: 8px 10px;
  font-size: 13px;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fbfcfe;
}

.history-item strong {
  display: block;
  margin-bottom: 4px;
}

.history-item p,
.empty-mini {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.log-card {
  margin-top: 22px;
}

pre {
  min-height: 300px;
  max-height: 430px;
  margin: 0;
  overflow: auto;
  border-radius: 8px;
  padding: 16px;
  background: #101828;
  color: #d9e3f0;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  max-width: 420px;
  transform: translateY(20px);
  border-radius: 8px;
  padding: 14px 16px;
  background: #101828;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

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

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .status-card {
    position: static;
    margin-top: 20px;
  }

  .content {
    padding: 24px;
  }

  .grid.two,
  .row {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }
}
