/* ---------- 토큰 (홈페이지 site/styles.css 와 같은 팔레트) ---------- */
:root {
  --navy: #102a43;
  --navy-soft: #1c3a5e;
  --coral: #e05a47;
  --coral-soft: #fbe9e5;
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #f1eee7;
  --text: #151515;
  --muted: #52525b;
  --faint: #8a8a93;
  --border: #ddd8cc;
  --ok: #1f7a4d;
  --ok-soft: #e3f3ea;
  --warn: #9a5b00;
  --warn-soft: #fdf1dc;
  --bad: #b3261e;
  --bad-soft: #fbe4e2;

  --serif: 'Noto Serif KR', Georgia, serif;
  --sans: 'Pretendard Variable', Pretendard, 'Noto Sans KR', -apple-system, 'Apple SD Gothic Neo', sans-serif;

  --w: 560px;
  --r: 14px;
  --tab-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --navy: #cfe0f5;
    --navy-soft: #a9c4e6;
    --coral: #ff7c66;
    --coral-soft: #3a211c;
    --bg: #131519;
    --surface: #1c1f25;
    --surface-2: #24282f;
    --text: #f1efe9;
    --muted: #b3b1ab;
    --faint: #7d7c78;
    --border: #33373f;
    --ok: #6ccf98;
    --ok-soft: #14301f;
    --warn: #f0b653;
    --warn-soft: #33260c;
    --bad: #ff8a80;
    --bad-soft: #3a1815;
    color-scheme: dark;
  }
}

/* ---------- 기본 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tab-h) + var(--safe-b));
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3 {
  margin: 0;
  line-height: 1.3;
  text-wrap: balance;
}
p {
  margin: 0;
}

/* ---------- 상단 바 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.topbar-seal {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.02em;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .topbar-seal {
    color: var(--bg);
  }
}
.topbar-title {
  font-weight: 700;
  letter-spacing: -0.01em;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.topbar-right .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

/* ---------- 본문 컨테이너 ---------- */
.view {
  width: min(100%, var(--w));
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.screen-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 2px 2px;
}
.screen-head h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.screen-head p {
  color: var(--muted);
  font-size: 14px;
}
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--coral);
}

/* ---------- 카드 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card.tap {
  cursor: pointer;
  transition: transform 0.08s ease;
}
.card.tap:active {
  transform: scale(0.99);
}
.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-title {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.35;
}
.card-meta {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  border: 1px solid transparent;
  transition:
    background 0.12s ease,
    opacity 0.12s ease;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--coral);
  color: #fff;
}
.btn-primary:not(:disabled):active {
  background: #c94a38;
}
.btn-navy {
  background: var(--navy);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .btn-navy {
    color: var(--bg);
  }
}
.btn-outline {
  background: var(--surface);
  border-color: var(--border);
}
.btn-ghost {
  color: var(--muted);
  min-height: 40px;
  font-size: 14px;
}
.btn-danger {
  background: var(--bad-soft);
  color: var(--bad);
}
.btn-ok {
  background: var(--ok);
  color: #fff;
}
.btn-block {
  width: 100%;
}
.btn-google {
  background: var(--surface);
  border-color: var(--border);
  gap: 12px;
}
.btn-google svg {
  width: 20px;
  height: 20px;
}
.btn-row {
  display: flex;
  gap: 10px;
}
.btn-row > .btn {
  flex: 1;
}

/* ---------- 폼 ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.field .hint {
  font-size: 12px;
  color: var(--faint);
}
.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 16px;
}
.textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: 2px solid var(--coral);
  outline-offset: 0;
  border-color: transparent;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
}
.chip[aria-pressed='true'] {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .chip[aria-pressed='true'] {
    color: var(--bg);
  }
}
.form-error {
  color: var(--bad);
  font-size: 14px;
}

/* ---------- 상태 배지 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-interview,
.badge-photo,
.badge-composing {
  background: var(--surface-2);
  color: var(--muted);
}
.badge-pending {
  background: var(--warn-soft);
  color: var(--warn);
}
.badge-published {
  background: var(--ok-soft);
  color: var(--ok);
}
.badge-rejected {
  background: var(--bad-soft);
  color: var(--bad);
}
.badge-cat {
  background: var(--coral-soft);
  color: var(--coral);
}
.badge-cat::before {
  display: none;
}
.badge-role {
  background: var(--surface-2);
  color: var(--muted);
}
.badge-role::before {
  display: none;
}

/* ---------- 로그인 ---------- */
.login {
  min-height: calc(100vh - 54px - var(--tab-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  padding: 24px 8px;
}
.login-mark {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 38px;
  letter-spacing: -0.02em;
  color: var(--navy);
  line-height: 1.1;
}
.login-mark small {
  display: block;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 0;
}
.login-note {
  font-size: 13px;
  color: var(--faint);
  text-align: center;
}
.dev-login {
  border-top: 1px dashed var(--border);
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- 분야 선택 ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.cat-tile {
  min-height: 84px;
  padding: 14px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  transition: transform 0.08s ease;
}
.cat-tile:active {
  transform: scale(0.98);
}
.cat-tile .cat-name {
  font-weight: 700;
  font-size: 18px;
}
.cat-tile .cat-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.cat-tile.mine {
  border-color: var(--coral);
}
.cat-tile.mine .cat-name::after {
  content: ' · 담당';
  font-size: 12px;
  color: var(--coral);
  font-weight: 600;
}

/* ---------- 인터뷰 (채팅) ---------- */
.interview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 96px;
}
.progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}
.progress-dots {
  display: flex;
  gap: 5px;
}
.progress-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}
.progress-dots i.on {
  background: var(--coral);
}
.bubble {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 16px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: keep-all;
}
.bubble-q {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 6px;
}
.bubble-q .who {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--coral);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}
.bubble-q .hint {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--faint);
}
.bubble-a {
  align-self: flex-end;
  background: var(--navy);
  color: #fff;
  border-bottom-right-radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .bubble-a {
    color: var(--bg);
  }
}
.bubble-sys {
  align-self: center;
  font-size: 13px;
  color: var(--faint);
  text-align: center;
}
.composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tab-h) + var(--safe-b));
  z-index: 15;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.composer-inner {
  width: min(100%, var(--w));
  margin: 0 auto;
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.composer .input {
  flex: 1;
  min-height: 46px;
  max-height: 120px;
  resize: none;
  line-height: 1.4;
  padding: 11px 14px;
}
.composer .send {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--coral);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}
.composer .send:disabled {
  opacity: 0.4;
}
.composer-tools {
  width: min(100%, var(--w));
  margin: 0 auto;
  padding: 0 12px 8px;
  display: flex;
  justify-content: space-between;
}

/* ---------- 사진 단계 ---------- */
.drop {
  border: 2px dashed var(--border);
  border-radius: var(--r);
  background: var(--surface);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 20px;
  cursor: pointer;
}
.drop .big {
  font-size: 40px;
  line-height: 1;
}
.drop .t {
  font-weight: 600;
}
.drop .s {
  font-size: 13px;
  color: var(--muted);
}
.drop input {
  display: none;
}
.preview {
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.preview img {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
}

/* ---------- 기사 상세 ---------- */
.article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.article-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.article h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.32;
  letter-spacing: -0.01em;
  word-break: keep-all;
}
.article .sub {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.45;
  word-break: keep-all;
}
.article .byline {
  font-size: 13px;
  color: var(--faint);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.article figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.article figure img {
  width: 100%;
  border-radius: 10px;
}
.article figcaption {
  font-size: 13px;
  color: var(--muted);
}
.article .summary {
  background: var(--surface-2);
  border-left: 3px solid var(--coral);
  padding: 10px 12px;
  border-radius: 0 10px 10px 0;
  font-size: 15px;
  line-height: 1.55;
  word-break: keep-all;
}
.article .body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 16.5px;
  line-height: 1.75;
  word-break: keep-all;
}
.article .body p:first-child::first-letter {
  font-weight: 600;
}
.article .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.article .tags span {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
}
.reason {
  background: var(--bad-soft);
  color: var(--bad);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
}
.review {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.transcript {
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.transcript .q {
  color: var(--muted);
}
.transcript .a {
  font-weight: 500;
}
details.fold {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  padding: 0 16px;
}
details.fold summary {
  padding: 14px 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
}
details.fold summary::after {
  content: '▾';
  color: var(--faint);
}
details.fold[open] summary::after {
  content: '▴';
}
details.fold .transcript {
  padding-bottom: 16px;
}

/* ---------- 목록 ---------- */
.date-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.date-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 2px 0;
  display: flex;
  justify-content: space-between;
}
.date-label b {
  color: var(--coral);
  font-weight: 600;
}
.empty {
  text-align: center;
  color: var(--faint);
  padding: 40px 12px;
  font-size: 14px;
  line-height: 1.6;
}
.seg {
  display: flex;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}
.seg button {
  flex: 1;
  min-height: 38px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.seg button[aria-selected='true'] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.user-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
}
.user-row .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}
.user-row .name {
  font-weight: 600;
}
.user-row .email {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.user-row .select {
  min-height: 40px;
  padding: 6px 10px;
  font-size: 14px;
  width: auto;
}

/* ---------- 하단 탭 ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}
.tabbar-inner {
  width: min(100%, var(--w));
  display: flex;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
  position: relative;
}
.tab svg {
  width: 22px;
  height: 22px;
}
.tab[aria-current='page'] {
  color: var(--coral);
}
.tab .dot {
  position: absolute;
  top: 8px;
  right: calc(50% - 16px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--coral);
  color: #fff;
  font-size: 10px;
  display: grid;
  place-items: center;
}

/* ---------- 토스트 · 오버레이 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + var(--safe-b) + 14px);
  transform: translateX(-50%);
  z-index: 40;
  max-width: min(92vw, 480px);
  background: var(--navy);
  color: #fff;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .toast {
    color: var(--bg);
  }
}
.toast.bad {
  background: var(--bad);
  color: #fff;
}
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(16, 42, 67, 0.55);
  display: grid;
  place-items: center;
  backdrop-filter: blur(2px);
}
.overlay-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 300px;
  text-align: center;
}
.overlay-text {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
}
.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--coral);
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
