/* =============================================================
   IVE Marketplace — marketplace UI (Carousell-style)
   Student ID : 250377839
   ============================================================= */

:root {
  --red: #f5333f;
  --red-dark: #d9242f;
  --teal: #0e7c72;
  --teal-dark: #0a5f57;
  --teal-link: #0a9d92;
  --ink: #1b1b1b;
  --ink-2: #4a4a4a;
  --muted: #767676;
  --line: #e9e9e9;
  --chip: #f4f4f4;
  --chip-2: #ececec;
  --white: #ffffff;
  --radius: 8px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.10);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --max: 1240px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background: var(--white);
  color: var(--ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: none; color: var(--teal-dark); }
img { max-width: 100%; display: block; }

h1, h2, h3, h4 { margin: 0 0 12px; line-height: 1.3; font-weight: 600; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }

main { flex: 1; }
.container {
  width: min(var(--max), 100% - 40px);
  margin: 0 auto;
  padding: 22px 0 56px;
}

/* ------------------------------------------------------------- top bar */
.site-header {
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 60;
}

.header-inner {
  width: min(var(--max), 100% - 40px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
  height: 64px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); flex: 0 0 auto; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--red);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 17px;
  letter-spacing: -0.5px;
}
.brand-text { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.4px; color: #2b2b2b; }
.brand-text span { color: #2b2b2b; }

.all-cats {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink-2); font-weight: 500; font-size: 0.95rem;
  background: none; border: none; cursor: pointer; padding: 6px 4px;
  font-family: inherit;
}
.all-cats:hover { color: var(--ink); }
.all-cats .grid-icon { display: grid; grid-template-columns: repeat(2, 4px); gap: 3px; }
.all-cats .grid-icon i { width: 4px; height: 4px; background: #2b2b2b; border-radius: 1px; display: block; }

.site-nav {
  margin-left: auto;
  display: flex; align-items: center; gap: 20px;
  font-size: 0.95rem;
}
.site-nav a:not(.btn), .link-button {
  color: var(--ink-2);
  font-weight: 500;
  background: none; border: none; padding: 0;
  font: inherit; font-size: 0.95rem; cursor: pointer;
}
.site-nav a:hover, .link-button:hover { color: var(--ink); }
.site-nav a.active { color: var(--ink); font-weight: 600; }

.sid-chip {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.2px;
  white-space: nowrap;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.sid-chip strong { color: var(--ink-2); font-weight: 600; }

/* ------------------------------------------------------------- search bar */
.searchbar {
  border-bottom: 1px solid var(--line);
  background: var(--white);
  position: sticky;
  top: 64px;
  z-index: 50;
}
.searchbar-inner {
  width: min(var(--max), 100% - 40px);
  margin: 0 auto;
  display: flex;
  gap: 8px;
  padding: 10px 0;
}
.search-field {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  background: var(--chip);
  border-radius: var(--radius);
  height: 46px;
  padding: 0 14px;
  gap: 10px;
}
.search-field svg { flex: 0 0 auto; color: #9a9a9a; }
.searchbar .search-field input {
  border: none; background: transparent; outline: none;
  font: inherit; font-size: 0.98rem; width: 100%; color: var(--ink);
  padding: 0; margin: 0; box-shadow: none; height: auto; border-radius: 0;
}
.searchbar .search-field input:focus { border: none; box-shadow: none; }
.search-field input::placeholder { color: #9a9a9a; }
.location-field {
  flex: 0 0 260px;
  display: flex; align-items: center; gap: 10px;
  background: var(--chip); border-radius: var(--radius);
  height: 46px; padding: 0 14px; color: var(--muted); font-size: 0.95rem;
}
.location-field svg { color: #9a9a9a; }
.btn-search {
  flex: 0 0 auto;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0 30px;
  height: 46px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-search:hover { background: var(--teal-dark); }

/* ------------------------------------------------------------- hero */
.hero {
  background: linear-gradient(115deg, #ffecec 0%, #fdf3e8 45%, #e8f6f2 100%);
  border-radius: 12px;
  padding: 26px 30px;
  margin-bottom: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.hero h1 { font-size: 1.7rem; margin-bottom: 6px; letter-spacing: -0.3px; }
.hero p { margin: 0; color: var(--ink-2); max-width: 560px; font-size: 0.95rem; }
.hero .hero-actions { display: flex; gap: 10px; align-items: center; }
.hero-steps {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.hero-step {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  padding: 12px 16px;
  min-width: 132px;
  font-size: 0.84rem;
  color: var(--ink-2);
}
.hero-step b { display: block; font-size: 0.9rem; color: var(--ink); margin-bottom: 2px; }
.hero .sid-inline {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #e6ded6;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.8rem;
  color: var(--ink-2);
  white-space: nowrap;
}

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 20px;
  font: inherit; font-size: 0.95rem; font-weight: 600;
  cursor: pointer;
  background: var(--chip-2); color: var(--ink);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-dark); color: #fff; }
.btn-outline { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }
.btn-danger { background: #fff; border-color: #f5c6c0; color: #c0392b; }
.btn-danger:hover { background: #fdecea; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-sell {
  background: var(--red); color: #fff;
  border-radius: var(--radius);
  padding: 9px 22px;
  font-weight: 600;
}
.btn-sell:hover { background: var(--red-dark); color: #fff; }

/* ------------------------------------------------------------- sections */
.section { margin-bottom: 34px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: 16px;
}
.section-head h2 { font-size: 1.35rem; margin: 0; letter-spacing: -0.2px; }
.section-head .see-all {
  color: var(--teal-link); font-weight: 500; font-size: 0.95rem;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.section-head .see-all:hover { color: var(--teal-dark); }

/* ------------------------------------------------------------- category tiles */
.cat-tiles {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 14px;
}
.cat-tile {
  background: var(--chip);
  border-radius: 10px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px 10px;
  text-align: center;
  color: var(--ink-2);
  font-size: 0.86rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.cat-tile:hover { background: var(--chip-2); text-decoration: none; color: var(--ink); }
.cat-tile.active { background: #e6f5f3; border-color: var(--teal); color: var(--teal-dark); }
.cat-tile .cat-emoji { font-size: 1.6rem; margin-bottom: auto; }

/* ------------------------------------------------------------- chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.chip:hover { border-color: var(--teal); color: var(--teal-dark); }
.chip.active { background: #e6f5f3; border-color: var(--teal); color: var(--teal-dark); }

/* ------------------------------------------------------------- listing grid */
.grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 26px 18px;
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: inherit;
}
.card-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  background: var(--chip);
  margin-bottom: 10px;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-badge {
  position: absolute; left: 8px; top: 8px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.card-badge.sold { background: #444; }
.card-badge.reserved { background: #b26a00; }
.card-badge.hidden { background: #8a2b22; }

.card-title {
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
  margin-bottom: 4px;
}
.card-price { font-size: 0.95rem; font-weight: 700; color: var(--ink); }
.card-price .old { font-size: 0.82rem; font-weight: 400; color: #a0a0a0; text-decoration: line-through; margin-left: 6px; }
.card-meta { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.card-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; font-size: 0.8rem; color: var(--muted);
}
.like-btn {
  border: none; background: none; padding: 2px;
  cursor: pointer; color: var(--muted);
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: 0.8rem;
}
.like-btn:hover { color: var(--ink); }
.like-btn.liked { color: var(--red); }
.card:hover .card-thumb img { transform: scale(1.02); transition: transform 0.25s; }

.img-placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  background: var(--chip);
  color: #bdbdbd;
  font-size: 1.7rem; font-weight: 700;
}

.badge {
  display: inline-block; border-radius: 4px;
  padding: 3px 9px; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.3px; text-transform: uppercase;
}
.badge-available { background: #e6f5f3; color: var(--teal-dark); }
.badge-reserved { background: #fff3e0; color: #b26a00; }
.badge-sold { background: #eee; color: #666; }
.badge-hidden { background: #fdecea; color: #c0392b; }

/* ------------------------------------------------------------- filters line */
.filter-line {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.filter-line select {
  width: auto;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; font: inherit; font-size: 0.9rem; color: var(--ink-2);
  background: #fff;
}
.result-count { color: var(--muted); font-size: 0.9rem; margin-left: auto; }

/* ------------------------------------------------------------- pagination */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; flex-wrap: wrap; }
.pagination button {
  min-width: 38px; height: 38px;
  border: 1px solid var(--line); background: #fff;
  border-radius: var(--radius); cursor: pointer; font: inherit; font-size: 0.9rem;
  color: var(--ink-2);
}
.pagination button:hover { border-color: var(--teal); color: var(--teal-dark); }
.pagination button.active { background: var(--teal); color: #fff; border-color: var(--teal); }
.pagination button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ------------------------------------------------------------- detail page */
.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.gallery { border-radius: 10px; overflow: hidden; background: var(--chip); }
.gallery-main { aspect-ratio: 1 / 1; background: var(--chip); }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; background: #fafafa; }
.gallery-thumbs { display: flex; gap: 8px; padding: 10px; flex-wrap: wrap; background: #fff; }
.gallery-thumbs button {
  width: 58px; height: 58px; padding: 0; border: 2px solid transparent;
  border-radius: 6px; overflow: hidden; cursor: pointer; background: var(--chip);
}
.gallery-thumbs button.active { border-color: var(--teal); }

.detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.price-tag { font-size: 1.9rem; font-weight: 700; margin: 6px 0 4px; letter-spacing: -0.5px; }
.detail h1 { font-size: 1.25rem; font-weight: 500; line-height: 1.4; }
.spec-list { list-style: none; padding: 0; margin: 18px 0; border-top: 1px solid var(--line); }
.spec-list li {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.spec-list li span:first-child { color: var(--muted); }
.description { white-space: pre-wrap; color: var(--ink-2); font-size: 0.93rem; margin: 6px 0 0; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.detail-actions .btn { flex: 1 1 150px; }
.seller-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-top: 1px solid var(--line); margin-top: 18px;
}
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #ffd9d9, #d6f0ec);
  display: grid; place-items: center;
  font-weight: 700; color: #86412f; font-size: 1rem;
}
.seller-card .who { font-weight: 600; font-size: 0.95rem; }
.seller-card .sub { color: var(--muted); font-size: 0.82rem; }

/* ------------------------------------------------------------- forms / panels */
.panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  background: #fff;
}
.panel + .panel { margin-top: 18px; }
.panel-narrow { max-width: 440px; margin: 40px auto; }
.panel h1 { font-size: 1.4rem; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 7px; color: var(--ink-2); }
.field .hint { font-size: 0.78rem; color: var(--muted); margin-top: 5px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="file"], select, textarea {
  width: 100%;
  border: 1px solid #dcdcdc;
  border-radius: var(--radius);
  padding: 11px 13px;
  font: inherit; font-size: 0.94rem;
  background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 124, 114, 0.12);
}
textarea { resize: vertical; min-height: 130px; }
input.invalid, select.invalid, textarea.invalid { border-color: var(--red); background: #fffafa; }
.field-error { color: var(--red); font-size: 0.8rem; min-height: 1.05em; margin-top: 4px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row > .field { flex: 1 1 170px; }

/* ------------------------------------------------------------- tables */
.table-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead th {
  text-align: left; padding: 12px 14px; background: #fafafa;
  border-bottom: 1px solid var(--line);
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--muted); font-weight: 600;
}
tbody td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fcfcfc; }

/* ------------------------------------------------------------- stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat {
  border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px;
}
.stat .value { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.4px; }
.stat .label { font-size: 0.76rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin-top: 2px; }

/* ------------------------------------------------------------- messages */
.chat-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.conv-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.conv-item {
  display: block; width: 100%; text-align: left;
  padding: 13px 16px; border: none; border-bottom: 1px solid var(--line);
  background: #fff; font: inherit; cursor: pointer; color: inherit;
}
.conv-item:last-child { border-bottom: none; }
.conv-item:hover { background: #fafafa; }
.conv-item.active { background: #e6f5f3; }
.conv-item .who { font-weight: 600; font-size: 0.9rem; display: flex; gap: 8px; align-items: center; }
.conv-item .preview { font-size: 0.8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-box { border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; min-height: 460px; }
.chat-head { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 0.95rem; }
.chat-messages { padding: 18px; flex: 1; overflow-y: auto; max-height: 48vh; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 76%; padding: 10px 14px; border-radius: 14px; font-size: 0.9rem; background: var(--chip); }
.bubble.mine { align-self: flex-end; background: var(--teal); color: #fff; }
.bubble .time { display: block; font-size: 0.68rem; opacity: 0.65; margin-top: 4px; }
.chat-form { display: flex; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; border-radius: 999px; }

/* ------------------------------------------------------------- misc */
.alert { border-radius: 8px; padding: 12px 15px; font-size: 0.9rem; margin-bottom: 16px; border: 1px solid transparent; }
.alert-error { background: #fdecea; border-color: #f5c6c0; color: #c0392b; }
.alert-info { background: #e6f5f3; border-color: #bfe6e1; color: var(--teal-dark); }
.alert-ok { background: #e8f6ee; border-color: #bfe6d2; color: #1f8a55; }

.empty { text-align: center; padding: 56px 16px; color: var(--muted); font-size: 0.95rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.muted { color: var(--muted); font-size: 0.88rem; }
.sid-note { font-size: 0.78rem; color: var(--muted); }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 20px 32px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}
.site-footer p { margin: 4px 0; }
.site-footer strong { color: var(--ink-2); }

#toast-box { position: fixed; right: 20px; bottom: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 90; }
.toast {
  padding: 12px 18px; border-radius: 8px; color: #fff; font-size: 0.88rem;
  background: #2b2b2b; box-shadow: var(--shadow); max-width: 320px;
  animation: toastIn 0.2s ease-out;
}
.toast-success { background: var(--teal); }
.toast-error { background: var(--red); }
.toast-hide { opacity: 0; transform: translateY(6px); transition: all 0.3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- mobile bottom nav */
.bottom-nav { display: none; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cat-tiles { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; }
  .location-field { display: none; }
  .hero { padding: 20px; }
  .all-cats { display: none; }
}

@media (max-width: 720px) {
  body { padding-bottom: 64px; }
  .container { width: calc(100% - 28px); padding: 16px 0 32px; }
  .header-inner { width: calc(100% - 28px); height: 56px; gap: 12px; }
  .brand-text { font-size: 1.12rem; }
  .brand-mark { width: 30px; height: 30px; font-size: 15px; border-radius: 8px; }
  .site-nav { gap: 14px; font-size: 0.9rem; }
  .site-nav a:not(.btn-sell), .link-button { display: none; }
  .sid-chip { display: none; }
  .searchbar { top: 56px; }
  .searchbar-inner { width: calc(100% - 28px); gap: 6px; }
  .search-field { height: 42px; }
  .btn-search { height: 42px; padding: 0 16px; font-size: 0.9rem; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .cat-tiles { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .cat-tile { aspect-ratio: 1 / 1; font-size: 0.74rem; padding: 8px; }
  .hero h1 { font-size: 1.3rem; }
  .hero { padding: 18px; gap: 14px; }
  .hero-steps { display: none; }
  .section-head h2 { font-size: 1.15rem; }
  .site-footer { font-size: 0.76rem; padding-bottom: 78px; }
  .price-tag { font-size: 1.5rem; }

  .bottom-nav {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0;
    background: #fff; border-top: 1px solid var(--line);
    z-index: 70;
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 0.66rem; color: var(--muted); padding: 4px 0;
  }
  .bottom-nav a.active { color: var(--teal); }
  .bottom-nav a.sell-tab span.icon {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--red); color: #fff;
    display: grid; place-items: center; font-size: 1.3rem; line-height: 1;
    margin-top: -14px; box-shadow: 0 3px 10px rgba(245, 51, 63, 0.35);
  }
  .bottom-nav a.sell-tab { color: var(--red); }
  .bottom-nav svg { width: 20px; height: 20px; }
}

/* ------------------------------------------------------------- two-factor */
.qr-box {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  min-width: 180px;
  min-height: 180px;
  display: grid;
  place-items: center;
}
.qr-box img { width: 168px; height: 168px; }
.secret-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  letter-spacing: 1px;
  background: var(--chip);
  border-radius: 6px;
  padding: 8px 12px;
  display: inline-block;
  word-break: break-all;
  max-width: 320px;
}
.twofa-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.backup-codes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}
.backup-codes li {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--chip);
  border-radius: 6px;
  padding: 9px 10px;
  text-align: center;
  letter-spacing: 1px;
  font-size: 0.88rem;
}
