/* 최소 레이아웃 CSS. 카드 본문 디자인은 post-card.css 가 담당한다 (CLAUDE.md §9.3). */

:root {
  --ink: #1f2328;
  --muted: #6b7280;
  --line: #e3e6ea;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --accent: #2f6feb;
  --danger: #d1242f;
  --ok: #1a7f37;
  --warn: #9a6700;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo",
    "Noto Sans KR", sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

a {
  color: var(--accent);
}

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
}

.brand {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
}

.topbar nav a {
  margin-right: 14px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.topbar nav a:hover,
.topbar nav a.active {
  color: var(--accent);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.whoami {
  color: var(--muted);
  font-size: 13px;
}

.logout-form {
  margin: 0;
}

.login-wrap {
  max-width: 380px;
  margin: 8vh auto 0;
}

.login-wrap .field {
  margin-bottom: 16px;
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 20px 80px;
}

h1 {
  margin: 0 0 6px;
  font-size: 22px;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
}

.field {
  margin-bottom: 22px;
}

.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.field label {
  font-weight: 700;
  font-size: 14px;
}

.field .hint {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.counter {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--danger);
  white-space: nowrap;
}

.counter.ok {
  color: var(--ok);
}

/* 새 input type 을 쓸 때는 여기에 추가한다. 빠뜨리면 그 칸만 브라우저 기본 스타일로 나온다. */
input[type="text"],
input[type="url"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="number"],
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  background: #fff;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(47, 111, 235, 0.35);
  border-color: var(--accent);
}

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

textarea.short {
  min-height: 96px;
}

textarea.tall {
  min-height: 200px;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.btn:disabled {
  background: #c7cdd6;
  cursor: not-allowed;
}

.btn.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  font-weight: 400;
}

.btn.secondary:disabled {
  color: #a9b0ba;
  cursor: not-allowed;
}

.btn.small {
  padding: 6px 12px;
  font-size: 13px;
}

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

.notice {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
}

.notice.error {
  background: #ffeef0;
  color: var(--danger);
}

.notice.warn {
  background: #fff8dc;
  color: var(--warn);
}

.notice.ok {
  background: #e7f6ec;
  color: var(--ok);
}

.notice.info {
  background: #eef3fd;
  color: #1c4faf;
}

.hidden {
  display: none !important;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.marker {
  background: #fff3bf;
  color: var(--warn);
}

.badge.clean {
  background: #e7f6ec;
  color: var(--ok);
}

.badge.status {
  background: #eef1f5;
  color: var(--muted);
}

.meta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--muted);
}

.chip {
  padding: 4px 10px;
  background: #eef1f5;
  border-radius: 999px;
  font-size: 12.5px;
  color: #414a56;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.tab {
  padding: 8px 14px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab.active {
  color: var(--accent);
  font-weight: 700;
  border-bottom-color: var(--accent);
}

pre.code {
  margin: 0;
  padding: 16px;
  max-height: 560px;
  overflow: auto;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

textarea.json-editor {
  min-height: 420px;
  font-family: Consolas, "D2Coding", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}

table.history {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.history th,
table.history td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

table.history th {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

table.history td.num {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filters a {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.filters a.active {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(47, 111, 235, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -2px;
  margin-right: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.preview-frame {
  padding: 22px;
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-height: 720px;
  overflow: auto;
}

@media (max-width: 720px) {
  .topbar-inner,
  main {
    padding-left: 14px;
    padding-right: 14px;
  }

  .panel {
    padding: 16px;
  }
}
