:root {
  --bg: #faf7f4;
  --surface: #ffffff;
  --surface-soft: #f4efeb;
  --ink: #2a2523;
  --ink-soft: #5b524d;
  --muted: #938781;
  --line: #ece4de;
  --line-strong: #ddd1c9;
  --accent: #b26f63;
  --accent-deep: #96584d;
  --accent-soft: #f7ece8;
  --ok: #5d8a6a;
  --danger: #b4544a;
  --drawer-width: min(520px, 100vw);
  --tabbar-h: 58px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(60, 42, 36, .04), 0 12px 32px rgba(60, 42, 36, .05);
  --serif: "Noto Serif KR", "Nanum Myeongjo", Georgia, serif;
  --sans: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: break-word;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -.01em; }

.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;
}
.hidden { display: none !important; }

/* ---------- authentication gate ---------- */

body.auth-locked .app-header,
body.auth-locked .page,
body.auth-locked .tabbar { display: none; }

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
body:not(.auth-locked) .auth-screen { display: none; }

.auth-card {
  width: min(100%, 380px);
  padding: 40px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}
.auth-card h1 {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 30px;
}
.auth-card p:not(.auth-error) {
  margin: 12px 0 24px;
  color: var(--ink-soft);
  font-size: 13px;
}
.naver-login-button {
  display: block;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: #03c75a;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.naver-login-button:hover { background: #02b351; }
.auth-error {
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 12px;
}

/* ---------- header ---------- */

.app-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: -.02em;
}
.wordmark em {
  font-style: normal;
  color: var(--accent);
}

.profile-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.profile-avatar {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
  object-fit: cover;
}
.profile-name {
  max-width: 180px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.business-name {
  max-width: 180px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-add-designer {
  border: 1px solid var(--line-strong);
  padding: 7px 11px;
  color: var(--ink-soft);
  font-size: 12px;
}
.btn-add-designer:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent-deep);
}

/* ---------- add designer modal ---------- */

.designer-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow-y: auto;
  padding: 82px 18px 24px;
  background: rgba(42, 37, 35, .26);
}
.designer-modal-card {
  position: relative;
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(42, 37, 35, .16);
}
.designer-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.eyebrow {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: .14em;
}
.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 25px;
  line-height: 1;
}
.modal-close:hover { background: var(--surface-soft); color: var(--ink); }
.designer-modal-card h2 {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
}
.designer-modal-copy {
  margin: 7px 0 22px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}
.designer-modal .status { margin-bottom: 0; }

/* ---------- page ---------- */

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 44px 24px calc(80px + var(--tabbar-h));
}

.page-intro {
  margin-bottom: 40px;
}
.page-intro h1 {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.4;
  font-weight: 400;
}
.page-intro p {
  margin: 12px 0 0;
  color: var(--ink-soft);
  max-width: 46ch;
}

.profile-empty {
  max-width: 520px;
  margin: 48px auto 0;
  padding: 42px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.profile-empty h1 {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
}
.profile-empty p {
  margin: 14px auto 24px;
  color: var(--ink-soft);
  max-width: 38ch;
}

/* ---------- steps ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.step {
  scroll-margin-top: 80px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.step[data-state="open"] {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.step[data-state="locked"] {
  opacity: .55;
  background: transparent;
}

.step-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  text-align: left;
}
.step[data-state="locked"] .step-head { cursor: default; }

.step-num {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 12px;
  display: grid;
  place-items: center;
  line-height: 1;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.step[data-state="open"] .step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.step[data-state="done"] .step-num {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--accent-deep);
}
.step[data-state="done"] .step-digit { display: none; }
.step[data-state="done"] .step-num::after {
  content: "✓";
  font-size: 13px;
}

.step-title {
  font-size: 15px;
  font-weight: 500;
}
.step-optional {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 6px;
}

.step-summary {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
  text-align: right;
  max-width: 44%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-body {
  padding: 0 22px 22px;
  border-top: 1px solid var(--line);
  margin: 0 22px;
  padding-left: 0;
  padding-right: 0;
}
.step-body > :first-child { margin-top: 20px; }

/* ---------- form controls ---------- */

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

input[type="url"],
input[type="text"],
textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  color: var(--ink);
  resize: vertical;
  transition: border-color .15s ease, background .15s ease;
}
input[type="url"]::placeholder,
input[type="text"]::placeholder,
textarea::placeholder { color: #b6aaa3; }
input[type="url"]:focus,
input[type="text"]:focus,
textarea:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--accent);
}

textarea { min-height: 108px; line-height: 1.7; }

.input-row {
  display: flex;
  gap: 10px;
}
.input-row input { flex: 1; min-width: 0; }

.btn {
  border-radius: var(--radius-sm);
  padding: 13px 22px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:disabled { opacity: .5; cursor: default; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-deep); }

.btn-quiet {
  background: var(--surface-soft);
  color: var(--ink-soft);
}
.btn-quiet:hover:not(:disabled) { background: var(--line); }

.btn-text {
  padding: 8px 4px;
  font-size: 13px;
  color: var(--accent);
}
.btn-text:hover { color: var(--accent-deep); }

.btn-wide { width: 100%; padding: 15px 22px; }

.hint {
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0 0;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
}
.status[data-kind="error"] { color: var(--danger); }
.status[data-kind="ready"] { color: var(--ok); }

.spinner {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  opacity: .6;
  animation: spin .7s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}

.counter {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  margin-top: 8px;
}

/* ---------- review picker ---------- */

.picker-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.picker-bar span { font-size: 13px; color: var(--muted); }

.review-list {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
}

.review-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  background: var(--bg);
  transition: border-color .15s ease, background .15s ease;
}
.review-item:hover { border-color: var(--line-strong); background: var(--surface); }
.review-item.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.review-meta {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 7px;
}
.review-meta strong {
  color: var(--ink-soft);
  font-weight: 500;
}

.review-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.review-item.selected .review-text { -webkit-line-clamp: unset; }

.empty-note {
  font-size: 14px;
  color: var(--muted);
  padding: 22px 0;
  text-align: center;
}

/* ---------- selected review recap ---------- */

.recap {
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  padding: 15px 17px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-height: 132px;
  overflow-y: auto;
}
.recap-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}
.recap-label {
  font-size: 12px;
  color: var(--muted);
  flex: none;
}
.recap-meta {
  font-size: 12px;
  color: var(--ink-soft);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- mic ---------- */

.include-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.mic {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: all .15s ease;
}
.mic:hover { color: var(--accent); border-color: var(--accent); }
.mic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.mic.listening {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.mic.unsupported { opacity: .4; }

/* ---------- result ---------- */

.result {
  scroll-margin-top: 80px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 20px 22px;
}
.result-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.result-text {
  font-size: 15px;
  line-height: 1.85;
  white-space: pre-wrap;
  color: var(--ink);
}
.result-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.error-box {
  margin-top: 16px;
  border-radius: var(--radius-sm);
  background: #fbeeec;
  color: var(--danger);
  padding: 13px 16px;
  font-size: 14px;
}

/* ---------- library ---------- */

.library {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}
.library > summary {
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-soft);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.library > summary::-webkit-details-marker { display: none; }
.library > summary::before {
  content: "＋";
  color: var(--muted);
  font-size: 13px;
}
.library[open] > summary::before { content: "－"; }

.library-body { padding-top: 18px; }

.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 15px;
  margin-bottom: 14px;
}
.search-input:focus { outline: none; border-color: var(--accent); }

.library-list {
  display: grid;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.library-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.7;
}
.library-item .q { color: var(--ink-soft); }
.library-item .a {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.library-item .tag {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}

/* ---------- footer ---------- */

.page-footer {
  margin-top: 36px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--tabbar-h));
  transform: translate(-50%, 16px);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  padding: 12px 20px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  max-width: calc(100vw - 40px);
  z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- mobile ---------- */

@media (max-width: 600px) {
  .app-header-inner { padding: 14px 18px; align-items: center; flex-wrap: wrap; }
  .profile-switcher { flex-basis: 100%; justify-content: flex-end; gap: 6px; }
  .profile-name, .business-name { display: none; }
  .profile-avatar { width: 26px; height: 26px; }
  .btn-add-designer { padding: 7px 9px; font-size: 11px; }
  .designer-modal { padding: 68px 14px 18px; }
  .designer-modal-card { padding: 20px 18px; }
  .page { padding: 30px 18px calc(52px + var(--tabbar-h)); }
  .step, .result { scroll-margin-top: 68px; }
  .page-intro { margin-bottom: 28px; }
  .page-intro h1 { font-size: 24px; }
  .step-head { padding: 17px 18px; gap: 12px; }
  .step-body { margin: 0 18px; padding-bottom: 18px; }
  .step-summary { max-width: 38%; }
  .input-row { flex-direction: column; }
  .review-list { max-height: none; }
  .result-actions { flex-direction: column; }
  .result-actions .btn { width: 100%; }
}

/* collapsed steps hide their body; only the open step is editable */
.step:not([data-state="open"]) .step-body { display: none; }

/* ---------- designer lookup (shop name -> stylist name) ---------- */

.lookup { margin-bottom: 4px; }

.lookup-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  max-height: 232px;
  overflow-y: auto;
}

.lookup-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color .15s, background .15s;
}

.lookup-item:hover { border-color: var(--line-strong); background: var(--surface-soft); }

.lookup-person { flex-direction: row; align-items: center; gap: 11px; }

.lookup-person-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.lookup-avatar {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  object-fit: cover;
}

.lookup-avatar.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 15px;
}

.lookup-item.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.lookup-item strong { font-size: 14px; color: var(--ink); font-weight: 600; }

.lookup-item span {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lookup-stylists { margin-top: 14px; }

.lookup-stylists input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  color: var(--ink);
}

.lookup-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 16px;
  color: var(--muted);
  font-size: 12px;
}

.lookup-divider::before,
.lookup-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- naver drawer ---------- */

.naver-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: var(--drawer-width);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 44px rgba(60, 42, 36, .1);
}

.naver-drawer-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.naver-drawer-title { flex: 1; min-width: 0; }
.naver-drawer-title strong { display: block; font-size: 15px; color: var(--ink); }

.naver-drawer-title span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.naver-frame-wrap { flex: 1; min-height: 0; background: var(--surface-soft); }
.naver-frame-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }

.naver-drawer-foot {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.naver-drawer-foot .btn { flex: 1; text-align: center; text-decoration: none; }
.naver-drawer-foot #naver-open-tab { flex: 0 0 auto; display: grid; place-items: center; }

@media (max-width: 900px) {
  .naver-drawer { width: 100vw; }
}

@media (min-width: 1280px) {
  body.drawer-open { padding-right: var(--drawer-width); }
  body.drawer-open .tabbar { right: var(--drawer-width); }
}

.source-current {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 14px;
}

.source-current-label {
  font-size: 11px;
  color: var(--muted);
}

.source-current strong { font-size: 15px; color: var(--ink); }
.source-current span:last-child { font-size: 12px; color: var(--muted); }

.review-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.review-row .review-item { flex: 1; min-width: 0; }

.review-origin {
  flex: 0 0 auto;
  align-self: flex-start;
  margin-top: 2px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}

.review-origin:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}

/* ---------- collection progress ---------- */

.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width .25s ease;
}

.progress-bar span.indeterminate {
  width: 35%;
  animation: progress-slide 1.1s ease-in-out infinite;
}

@keyframes progress-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}

.progress-text {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- review stats ---------- */

.stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin: 12px 0 0;
  font-variant-numeric: tabular-nums;
}

.stats > div {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.stats dt {
  font-size: 11px;
  color: var(--muted);
}

.stats dd {
  margin: 0;
  font-size: 13px;
  color: var(--ink);
}

.stats .stat-pending {
  margin-left: 2px;
  font-size: 11px;
  color: var(--accent-deep);
}

.stats .stat-note {
  flex-basis: 100%;
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
}

/* ---------- review picker filter ---------- */

.picker-filter {
  display: flex;
  gap: 6px;
  margin: 0 0 10px;
}

.chip {
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}

.chip:hover { border-color: var(--accent); }

.chip.is-on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.library-item .meta {
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- bottom tab bar ---------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  display: flex;
  justify-content: center;
  gap: 4px;
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}

.tab {
  flex: 1 1 0;
  max-width: 140px;
  min-width: 0;
  height: var(--tabbar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  transition: color .15s;
}

.tab svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab span {
  font-size: 10.5px;
  line-height: 1.2;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.tab:hover { color: var(--ink-soft); }
.tab.is-on { color: var(--accent-deep); }
.tab.is-on svg { stroke-width: 1.9; }

/* ---------- watch list ---------- */

.watch-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.watch-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.watch-card.is-me { border-color: var(--line-strong); background: var(--accent-soft); }

.watch-avatar {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  object-fit: cover;
}

.watch-avatar.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 16px;
}

.watch-text { flex: 1; min-width: 0; }
.watch-text strong { display: block; font-size: 15px; }
.watch-text span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-text .watch-count { white-space: normal; overflow: visible; }

.watch-text .watch-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  vertical-align: middle;
}

.tab-note {
  margin: 14px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- not built yet ---------- */

.account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.account-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.account-card strong { display: block; margin-top: 2px; font-size: 15px; }

.soon-card {
  position: relative;
  padding: 16px 18px;
  margin-bottom: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.soon-card strong { display: block; font-size: 15px; }
.soon-card p { margin: 4px 0 0; padding-right: 56px; color: var(--muted); font-size: 13px; }

.soon-tag {
  position: absolute;
  top: 15px;
  right: 16px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
}

/* ---------- blog writer ---------- */

.blog-source {
  padding: 16px 18px 14px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.blog-samples { margin-top: 12px; }

.blog-samples summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-soft);
}

.blog-sample-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 10px;
  max-height: 240px;
  overflow-y: auto;
}

.blog-sample {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
}

.blog-sample:hover { background: var(--surface-soft); }
.blog-sample strong { display: block; font-size: 13px; font-weight: 400; }
.blog-sample span { font-size: 11.5px; color: var(--muted); }

.blog-title-input {
  margin-bottom: 10px;
  font-family: var(--serif);
  font-size: 17px;
}

.blog-body-input { min-height: 320px; }

/* ---------- customer-named strengths ---------- */

.strengths {
  padding: 16px 18px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.strengths-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.strengths-title { flex: 1; min-width: 0; }
.strengths-title strong { display: block; font-size: 15px; }
.strengths-title span { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.strengths-head .btn { flex: none; padding: 9px 14px; font-size: 13px; }
.strengths .status { margin-top: 12px; }

.strength-summary {
  margin: 16px 0 0;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 13.5px;
  line-height: 1.7;
}

.strength-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.strength-list:empty { margin-top: 0; }

.strength-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.strength-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.strength-top strong { font-size: 15px; }

.strength-count {
  flex: none;
  color: var(--muted);
  font-size: 11.5px;
}

.strength-card p { margin: 6px 0 0; color: var(--ink-soft); font-size: 13.5px; }

.strength-card blockquote {
  margin: 10px 0 0;
  padding-left: 11px;
  border-left: 2px solid var(--line-strong);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

/* ---------- saved drafts ---------- */

.drafts { margin-top: 22px; }

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

.drafts-head strong { font-size: 14px; }
.drafts-head span { color: var(--muted); font-weight: 400; font-size: 12.5px; }

.draft-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.draft-row {
  display: flex;
  align-items: stretch;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color .15s, background .15s;
}

.draft-row:hover { border-color: var(--line-strong); }
.draft-row.is-open { border-color: var(--accent); background: var(--accent-soft); }

.draft-open {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  text-align: left;
}

.draft-open strong {
  display: block;
  font-size: 13.5px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-open span { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; }

.draft-delete {
  flex: none;
  width: 40px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.draft-delete:hover { background: var(--surface-soft); color: var(--danger); }

/* ---------- reusable "must include" notes ---------- */

.snippet-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.snippet-row:empty { display: none; }

.snippet {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
  max-width: 100%;
}

.snippet-use {
  padding: 5px 4px 5px 12px;
  color: var(--ink-soft);
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snippet:hover { border-color: var(--accent); }
.snippet:hover .snippet-use { color: var(--accent-deep); }

.snippet-del {
  padding: 0 10px 0 6px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}

.snippet-del:hover { color: var(--danger); }

.snippet-add {
  padding: 5px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.snippet-add:hover { border-color: var(--accent); color: var(--accent-deep); }

/* ---------- my place in the neighbourhood ---------- */

.rank-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.rank-head .status { flex: 1; min-width: 0; margin: 0; }
.rank-head .btn { flex: none; padding: 9px 14px; font-size: 13px; }

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rank-card {
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.rank-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.rank-label { font-size: 13.5px; color: var(--ink-soft); }

.rank-value {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -.01em;
}

.rank-bar {
  height: 6px;
  margin: 11px 0 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
}

.rank-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.rank-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.rank-place strong { color: var(--accent-deep); font-weight: 500; }

.rank-hint {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- neighbourhood top five ---------- */

.rank-top5 {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.rank-top5-head {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11.5px;
}

.rank-top5 ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rank-top5 li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.rank-top5 li.is-me { background: var(--accent-soft); }

.rank-num {
  flex: none;
  width: 15px;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

.rank-top5 li strong { font-weight: 500; white-space: nowrap; }

.rank-shop {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-top5-value {
  flex: none;
  font-variant-numeric: tabular-nums;
}

.rank-top5 li.is-me strong,
.rank-top5 li.is-me .rank-top5-value { color: var(--accent-deep); }

/* ---------- monthly reply challenge ---------- */

.waiting-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 17px;
  margin-bottom: 12px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.waiting-text { flex: 1; min-width: 0; }
.waiting-text strong { display: block; font-size: 15px; color: var(--accent-deep); }
.waiting-text span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-soft); }
.waiting-card .btn { flex: none; padding: 10px 14px; font-size: 13px; }

.contacts { margin-top: 22px; }

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-row {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13.5px;
}

.contact-row.is-me { border-color: var(--accent); background: var(--accent-soft); }
.contact-row.is-me strong, .contact-row.is-me .contact-hours { color: var(--accent-deep); }
.contact-row strong { font-weight: 500; white-space: nowrap; }

.contact-note {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.contact-shop {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-hours { flex: none; font-variant-numeric: tabular-nums; }

/* ---------- faces in the ranking ---------- */

.rank-face,
.contact-face {
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  object-fit: cover;
  align-self: center;
}

.rank-face { width: 24px; height: 24px; }
.contact-face { width: 30px; height: 30px; }

.rank-face.is-empty,
.contact-face.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.rank-face.is-empty { font-size: 11px; }
.contact-face.is-empty { font-size: 13px; }
