/* 1994양과점 인스타 DM 스튜디오 — 크림/에스프레소 톤 */

:root {
  --cream: #faf6f0;
  --cream-2: #f3ece1;
  --cream-3: #ede2d3;
  --card: #fffdfa;
  --espresso: #2e231d;
  --espresso-2: #4a372c;
  --muted: #8b7a6b;
  --line: #e7dccd;
  --accent: #c87d4b;
  --accent-deep: #a8623a;
  --accent-soft: #f4e2d2;
  --green: #3f7a5a;
  --green-soft: #e2efe6;
  --amber: #a9741f;
  --amber-soft: #fbeed3;
  --red: #b4523e;
  --red-soft: #f8e2dc;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(46, 35, 29, 0.05), 0 10px 30px rgba(46, 35, 29, 0.06);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--espresso);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body { min-height: 100dvh; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
b { font-weight: 650; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
}
svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ───────────── 잠금 화면 ───────────── */

.lock-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
  background:
    radial-gradient(1100px 500px at 50% -10%, #fffaf2 0%, rgba(255, 250, 242, 0) 65%),
    linear-gradient(180deg, #f7f0e5 0%, #efe4d5 100%);
}
.lock-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 32px 26px 24px;
  box-shadow: 0 24px 60px rgba(46, 35, 29, 0.12);
  text-align: center;
}
.lock-mark {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  color: var(--espresso);
  background: var(--cream-2);
  border-radius: 18px;
  padding: 11px;
}
.mark-cake { fill: var(--accent-soft); stroke: var(--espresso-2); }
.mark-cream { stroke: var(--espresso-2); }
.mark-cherry { stroke: var(--accent-deep); }
.mark-cherry-dot { fill: var(--accent); stroke: none; }
.mark-line { stroke: var(--accent); }
.lock-card h1 { margin: 0 0 4px; font-size: 21px; letter-spacing: -0.02em; }
.lock-sub { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; }
.lock-card form { display: grid; gap: 10px; }
.lock-card input {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  letter-spacing: 0.18em;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--espresso);
  font-family: var(--font);
}
.lock-card input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.lock-msg {
  margin: 12px 0 0;
  color: var(--red);
  background: var(--red-soft);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}
.lock-note { margin: 18px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ───────────── 버튼 · 입력 ───────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-family: var(--font);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.06s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary { background: var(--espresso); color: #fdf8f1; }
.btn.primary:hover:not(:disabled) { background: #231a15; }
.btn.ghost { background: var(--cream); color: var(--espresso-2); border-color: var(--line); }
.btn.ghost:hover:not(:disabled) { background: var(--cream-2); }
.btn.sm { padding: 8px 12px; font-size: 13.5px; }
.btn.is-busy { opacity: 0.7; }
.btn.primary.sm { padding: 8px 16px; }

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  padding: 8px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--espresso-2);
  cursor: pointer;
}
.icon-btn:hover { background: var(--cream-2); }
.icon-btn.small { width: 30px; height: 30px; padding: 6px; }

.link-btn {
  background: none; border: 0; padding: 0;
  color: var(--accent-deep);
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

input[type="text"], input[type="password"], textarea, select {
  font-family: var(--font);
  font-size: 14.5px;
  color: var(--espresso);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  width: 100%;
}
textarea { resize: vertical; line-height: 1.6; min-height: 74px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field-label { font-size: 13px; font-weight: 650; color: var(--espresso-2); }
.field-label small { font-weight: 500; color: var(--muted); margin-left: 4px; }

/* ───────────── 헤더 · 탭 ───────────── */

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 246, 240, 0.96);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark {
  width: 38px; height: 38px;
  flex: none;
  padding: 7px;
  border-radius: 12px;
  background: var(--cream-2);
  color: var(--espresso);
}
.brand-text { display: grid; line-height: 1.2; }
.brand-text b { font-size: 15px; letter-spacing: -0.01em; }
.brand-text small { color: var(--muted); font-size: 11.5px; }
.header-actions { display: flex; align-items: center; gap: 4px; }

.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 5px 11px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--espresso-2);
  cursor: pointer;
}
.mode-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.mode-chip.is-live .dot { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.mode-chip.is-demo .dot { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.mode-chip.is-error .dot { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }

.tabs {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 12px 12px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab.is-on { color: var(--espresso); border-bottom-color: var(--accent); }
.tab-count { font-size: 11.5px; color: var(--accent-deep); background: var(--accent-soft); border-radius: 999px; padding: 1px 7px; }
.tab-count:empty { display: none; }

.banner {
  max-width: 1180px;
  margin: 12px auto 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  background: var(--amber-soft);
  color: #6b4a12;
  border: 1px solid #f0dcb4;
}
.banner.is-error { background: var(--red-soft); color: #7d2f20; border-color: #efc9c0; }
.banner strong { font-weight: 700; }

#appRoot { display: flex; flex-direction: column; height: 100dvh; min-height: 100dvh; overflow: hidden; }
#appRoot[hidden] { display: none !important; }

.main {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 16px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}
.panel { min-height: 0; }
#panelInbox { flex: 1; display: flex; flex-direction: column; }
#panelAuto, #panelSetup { flex: 1; overflow-y: auto; }

/* ───────────── 인박스 ───────────── */

.inbox {
  display: grid;
  grid-template-columns: 336px minmax(0, 1fr);
  gap: 14px;
  flex: 1;
  min-height: 0;
  height: auto;
  grid-template-rows: minmax(0, 1fr);
}

.conv-pane, .thread-pane {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px 10px 12px;
  border-bottom: 1px solid var(--line);
}
.filter-row { display: flex; gap: 6px; }
.filter {
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 11px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.filter.is-on { background: var(--espresso); border-color: var(--espresso); color: #fdf8f1; }
.filter span { opacity: 0.8; font-weight: 500; }

.conv-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.conv-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 13.5px; }

.conv-item {
  width: 100%;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid var(--cream-3);
  background: none;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.conv-item:hover { background: var(--cream); }
.conv-item.is-on { background: var(--accent-soft); }
.conv-item.is-unread .conv-snippet { color: var(--espresso); font-weight: 600; }
.conv-body { min-width: 0; display: grid; gap: 2px; }
.conv-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.conv-name { font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { font-size: 11.5px; color: var(--muted); flex: none; margin-left: auto; }
.conv-snippet {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conv-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.unread-dot {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
}

.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #f0dcc6, #dcc0a2);
  color: #6b4a2f;
  font-weight: 700;
  font-size: 15px;
  flex: none;
  text-transform: uppercase;
  border: 1px solid rgba(107, 74, 47, 0.12);
}
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }

.window-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 650;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.window-badge.open { background: var(--green-soft); color: #2c6448; border-color: #cfe4d7; }
.window-badge.soon { background: var(--amber-soft); color: #7d5713; border-color: #f0dcb4; }
.window-badge.closed { background: var(--red-soft); color: #7d2f20; border-color: #efc9c0; }
.window-badge.unknown { background: var(--cream-2); color: var(--muted); border-color: var(--line); }

.thread-empty { flex: 1; display: grid; place-items: center; padding: 30px; }
.thread-empty-inner { max-width: 380px; text-align: center; }
.thread-empty h2 { font-size: 17px; line-height: 1.5; margin: 6px 0 8px; letter-spacing: -0.01em; }
.eyebrow { font-size: 11px; letter-spacing: 0.18em; font-weight: 700; color: var(--accent-deep); margin: 0; }

.thread-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.thread-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
}
.thread-who { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.thread-who-text { display: grid; min-width: 0; line-height: 1.25; }
.thread-who-text b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-who-text small { color: var(--muted); font-size: 11.5px; }

.thread-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background:
    radial-gradient(600px 240px at 80% -40%, #fff8ee 0%, rgba(255, 248, 238, 0) 70%),
    var(--cream);
}
.thread-body > *:first-child { margin-top: auto; }
.day-sep { align-self: center; font-size: 11.5px; color: var(--muted); background: var(--cream-2); border-radius: 999px; padding: 3px 10px; margin: 6px 0; }
.msg { display: flex; gap: 8px; max-width: 86%; }
.msg.them { align-self: flex-start; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg-stack { display: grid; gap: 3px; min-width: 0; }
.bubble {
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid transparent;
}
.msg.them .bubble { background: var(--card); border-color: var(--line); border-top-left-radius: 5px; }
.msg.me .bubble { background: var(--espresso); color: #fdf8f1; border-top-right-radius: 5px; }
.msg-time { font-size: 11px; color: var(--muted); padding: 0 3px; }
.msg.me .msg-time { text-align: right; }
.msg-attach {
  display: grid;
  place-items: center;
  min-height: 72px;
  border-radius: 10px;
  background: var(--cream-2);
  color: var(--muted);
  font-size: 12.5px;
  border: 1px dashed var(--line);
  padding: 8px;
}
.thread-note {
  align-self: center;
  font-size: 12px;
  color: #7d5713;
  background: var(--amber-soft);
  border: 1px solid #f0dcb4;
  border-radius: 10px;
  padding: 7px 11px;
  max-width: 92%;
  text-align: center;
}
.thread-note.is-error { color: #7d2f20; background: var(--red-soft); border-color: #efc9c0; }
.thread-loading { align-self: center; color: var(--muted); font-size: 13px; padding: 20px; }

.composer {
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
}
.tpl-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
}
.tpl-strip::-webkit-scrollbar { display: none; }
.tpl-chip {
  flex: none;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--espresso-2);
  border-radius: 999px;
  padding: 5px 11px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tpl-chip:hover { background: var(--accent-soft); border-color: #e3c8ae; }
.tpl-chip.is-empty { color: var(--muted); }

.composer-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream);
  padding: 6px 6px 6px 4px;
}
.composer-box textarea {
  border: 0;
  background: transparent;
  min-height: 58px;
  padding: 6px 8px;
  font-size: 14.5px;
}
.composer-box textarea:focus { outline: none; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 2px 6px; }
.composer-right { display: flex; align-items: center; gap: 8px; }
.char-count { font-size: 11.5px; color: var(--muted); }
.char-count.is-over { color: var(--red); font-weight: 700; }
.composer-hint { margin: 6px 2px 0; font-size: 11.5px; color: var(--muted); }
.composer-hint.is-warn { color: #7d5713; }
.tpl-manage { margin-top: 4px; }
.tpl-editor { margin-top: 8px; display: grid; gap: 8px; }
.tpl-edit-row {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px;
  background: var(--cream);
}
.tpl-edit-row .row { display: flex; gap: 6px; align-items: center; }
.tpl-edit-row input { font-size: 13px; padding: 6px 8px; }
.tpl-edit-row textarea { font-size: 13px; padding: 6px 8px; min-height: 56px; }
.tpl-edit-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ───────────── 카드 공통 ───────────── */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.card-head { margin-bottom: 12px; }
.card-head.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-head h2 { margin: 0 0 4px; font-size: 16.5px; letter-spacing: -0.01em; }
.card-head h3 { margin: 0; font-size: 14.5px; }
.card-head p { margin: 0; font-size: 13px; line-height: 1.55; }
.empty-note { text-align: center; color: var(--muted); font-size: 13.5px; padding: 18px 8px; margin: 0; }

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

/* 규칙 */
.rule-list { display: grid; gap: 10px; }
.rule-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--cream);
  display: grid;
  gap: 8px;
}
.rule-item.is-off { opacity: 0.62; background: #f7f2ea; }
.rule-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kw-chips { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; min-width: 0; }
.kw-chip {
  font-size: 12px;
  font-weight: 600;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  color: var(--espresso-2);
}
.match-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.rule-reply { font-size: 13px; color: var(--espresso-2); white-space: pre-wrap; line-height: 1.55; margin: 0; }
.rule-actions { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.rule-actions .left { display: flex; gap: 8px; align-items: center; }

.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 40px; height: 23px;
  border-radius: 999px;
  background: #d9cdbd;
  transition: background 0.15s;
  position: relative;
  flex: none;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2.5px; left: 2.5px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s;
}
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(17px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-line { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--espresso-2); }

.rule-form {
  margin-top: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}
.rule-form h3 { margin: 0 0 10px; font-size: 14px; }
.rule-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* 로그 */
.log-list { display: grid; gap: 8px; max-height: 620px; overflow-y: auto; }
.log-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  background: var(--cream);
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.log-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.status-tag { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 7px; border: 1px solid transparent; }
.status-tag.sent { background: var(--green-soft); color: #2c6448; border-color: #cfe4d7; }
.status-tag.demo { background: var(--amber-soft); color: #7d5713; border-color: #f0dcb4; }
.status-tag.failed { background: var(--red-soft); color: #7d2f20; border-color: #efc9c0; }
.status-tag.skipped { background: var(--cream-2); color: var(--muted); border-color: var(--line); }
.log-quote { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.log-reply { color: var(--espresso-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.log-when { font-size: 11.5px; color: var(--muted); margin-left: auto; }

/* 연동 상태 */
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.health-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  background: var(--cream);
  font-size: 13.5px;
}
.health-item .mark {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex: none;
  background: var(--cream-2);
  color: var(--muted);
}
.health-item.is-on .mark { background: var(--green-soft); color: #2c6448; }
.health-item.is-off .mark { background: var(--red-soft); color: #7d2f20; }
.health-item .name { display: grid; line-height: 1.25; min-width: 0; }
.health-item .name b { font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.health-item .name small { color: var(--muted); font-size: 11.5px; }
.health-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; }

.copy-field { margin-bottom: 12px; }
.copy-row { display: flex; gap: 6px; }
.copy-row input { font-size: 13px; background: var(--cream); }

.steps { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.steps li { font-size: 14px; }
.steps li b { display: block; margin-bottom: 2px; }
.steps li p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.note-line { margin: 12px 0 0; }

/* 토스트 */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--espresso);
  color: #fdf8f1;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(46, 35, 29, 0.28);
  z-index: 60;
  max-width: min(92vw, 480px);
  text-align: center;
}
.toast.is-error { background: #8c3423; }

.only-mobile { display: none !important; }

/* ───────────── 반응형 ───────────── */

@media (max-width: 1000px) {
  .auto-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .inbox {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    flex: 1;
  }
  .banner { font-size: 12.5px; }
  .conv-pane, .thread-pane { border-radius: var(--radius); }
  .inbox.is-thread .conv-pane { display: none; }
  .inbox:not(.is-thread) .thread-pane { display: none; }
  .only-mobile { display: grid !important; }
  .main { padding: 10px 10px calc(18px + env(safe-area-inset-bottom)); }
  .tab { font-size: 13.5px; padding: 9px 10px 11px; }
  .brand-text small { display: none; }
  .msg { max-width: 92%; }
  .card { padding: 14px; border-radius: 14px; }
}

@media (max-width: 420px) {
  .mode-chip { padding: 4px 9px; font-size: 12px; }
  .header-inner { padding: 8px 12px; }
  .tabs { padding: 0 10px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-text b { font-size: 14px; }
}
