/* ============================================================
 * Meridian US — v2 additions
 * Markets toolbar/categories/search, Earn detail modal,
 * transaction detail modal, notices, community, support.
 * Loaded AFTER layout.css so it can extend or override safely.
 * ============================================================ */

/* ---------- Markets — category filter bar ---------- */
.mkt-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.mkt-cats {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.mkt-cats .chip {
  cursor: pointer; user-select: none; border: 1px solid var(--line-hi);
  background: transparent; color: var(--text-2);
  padding: 6px 12px; font-family: var(--font-mono); font-size: 12px;
  text-transform: none; letter-spacing: 0;
  transition: background .12s, color .12s, border-color .12s;
}
.mkt-cats .chip:hover { color: var(--text); border-color: var(--text-3); }
.mkt-cats .chip.chip-gold {
  background: var(--gold); color: #07090e; border-color: var(--gold);
}

.mkt-search {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px;
  color: var(--text-3); min-width: 240px;
}
.mkt-search input {
  border: 0; background: transparent; outline: none;
  color: var(--text); font: 14px var(--font-body);
  width: 100%;
}
.mkt-search input::placeholder { color: var(--text-3); }

.mkt-scroll { max-height: 720px; overflow-y: auto; }

/* ---------- Earn — product detail modal ---------- */
.earn-detail {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  padding: 24px;
}
@media (max-width: 820px) {
  .earn-detail { grid-template-columns: 1fr; }
}
.earn-detail .kpi-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin: 16px 0 18px;
}
.earn-detail .kpi-row .kpi {
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px;
}
.earn-detail .kpi-row .kpi .k {
  font-size: 11px; color: var(--text-3); text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 4px;
}
.earn-detail .kpi-row .kpi .v {
  font-family: var(--font-mono); font-size: 16px; font-weight: 700;
}
.earn-detail .kpi-row .kpi .v.up { color: var(--up); }
.earn-detail .amount-card {
  background: var(--gold-soft); border: 1px solid var(--gold);
  border-radius: 14px; padding: 18px; margin-bottom: 12px;
}
.earn-detail .amount-card .label {
  font-size: 11px; color: var(--text-3); text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 8px;
}
.earn-detail .amount-card .big {
  font-family: var(--font-mono); font-size: 28px; font-weight: 700;
  color: var(--gold-deep);
}

.earn-schedule {
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
  max-height: 360px; overflow-y: auto;
}
.earn-schedule table { width: 100%; border-collapse: collapse; }
.earn-schedule th {
  position: sticky; top: 0; background: var(--bg-1);
  text-align: left; font-size: 11px; color: var(--text-3);
  font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line);
  text-transform: uppercase; letter-spacing: .05em;
}
.earn-schedule td {
  padding: 11px 14px; border-bottom: 1px solid var(--line);
  font-size: 13px; font-family: var(--font-mono);
}
.earn-schedule tr:last-child td { border-bottom: 0; }
.earn-schedule td:nth-child(3),
.earn-schedule td:nth-child(4) { text-align: right; }
.earn-schedule th:nth-child(3),
.earn-schedule th:nth-child(4) { text-align: right; }
.earn-schedule .total-row td {
  background: var(--gold-soft); color: var(--gold-deep);
  font-weight: 700; border-top: 1px solid var(--gold);
}

/* ---------- Transaction detail modal ---------- */
.tx-detail { padding: 22px 26px 26px; }
.tx-detail .head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
}
.tx-detail .head .ic {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--bg-2); color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
}
.tx-detail .head .ic.up { background: var(--up-soft); color: var(--up); }
.tx-detail .head .ic.down { background: var(--down-soft); color: var(--down); }
.tx-detail .head .meta b {
  display: block; font-family: var(--font-display);
  font-weight: 700; font-size: 18px; letter-spacing: -.01em;
}
.tx-detail .head .meta span {
  display: block; font-size: 13px; color: var(--text-3);
  margin-top: 2px;
}
.tx-detail .amt-big {
  font-family: var(--font-mono); font-size: 32px; font-weight: 700;
  letter-spacing: -.01em; margin-bottom: 4px;
}
.tx-detail .amt-usd { font-size: 14px; color: var(--text-3); margin-bottom: 22px; }

.tx-detail .rows {
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
}
.tx-detail .rows .row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  gap: 16px;
}
.tx-detail .rows .row:last-child { border-bottom: 0; }
.tx-detail .rows .row .k {
  font-size: 13px; color: var(--text-3); flex: none;
}
.tx-detail .rows .row .v {
  font-family: var(--font-mono); font-size: 13px;
  text-align: right; word-break: break-all; color: var(--text);
}
.tx-detail .rows .row .v.copy {
  cursor: pointer; transition: color .12s;
}
.tx-detail .rows .row .v.copy:hover { color: var(--gold); }
.tx-detail .st-badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; font-family: var(--font-body);
}

/* ---------- Notices list ---------- */
.notice-list { display: flex; flex-direction: column; }
.notice-row {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
  cursor: pointer; transition: background .12s;
}
.notice-row:hover { background: var(--bg-1); }
.notice-row:last-child { border-bottom: 0; }
.notice-row .pin {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--gold-soft); color: var(--gold-deep);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.notice-row .body { flex: 1; min-width: 0; }
.notice-row .body b {
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  display: block; margin-bottom: 4px;
}
.notice-row .body span {
  display: block; font-size: 13px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notice-row .date {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-3); flex: none;
}
.notice-row .cat {
  font-family: var(--font-mono); font-size: 11px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--bg-2); color: var(--text-2);
  text-transform: uppercase; letter-spacing: .04em;
  flex: none;
}

/* ---------- Notice / community detail ---------- */
.post-detail {
  max-width: 760px; margin: 0 auto;
}
.post-detail .post-head {
  border-bottom: 1px solid var(--line); padding-bottom: 22px; margin-bottom: 26px;
}
.post-detail .post-head h1 {
  font-family: var(--font-display); font-size: 32px;
  letter-spacing: -.02em; margin: 12px 0 14px;
}
.post-detail .post-head .meta {
  display: flex; gap: 14px; font-size: 13px; color: var(--text-3);
  align-items: center;
}
.post-detail .post-body {
  font-size: 15.5px; line-height: 1.75; color: var(--text);
}
.post-detail .post-body p { margin: 0 0 1em; }
.post-detail .post-body h2 {
  font-family: var(--font-display); font-size: 22px; margin: 1.4em 0 .6em;
}

/* ---------- Community ---------- */
.community-grid {
  display: grid; grid-template-columns: 240px 1fr; gap: 24px;
}
@media (max-width: 820px) { .community-grid { grid-template-columns: 1fr; } }
.community-side {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 14px; height: fit-content;
}
.community-side .cat-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  cursor: pointer; font-size: 14px; color: var(--text-2);
  transition: background .12s, color .12s;
}
.community-side .cat-btn:hover { background: var(--bg-1); color: var(--text); }
.community-side .cat-btn.active {
  background: var(--gold-soft); color: var(--gold-deep); font-weight: 600;
}
.community-side .cat-btn .count {
  margin-left: auto; font-family: var(--font-mono); font-size: 12px;
  color: var(--text-3);
}

.thread-row {
  display: flex; gap: 14px; padding: 16px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.thread-row:hover .title { color: var(--gold); }
.thread-row .av {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg-2); color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  flex: none;
}
.thread-row .main { flex: 1; min-width: 0; }
.thread-row .title {
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  margin-bottom: 4px; transition: color .12s;
}
.thread-row .excerpt {
  font-size: 13px; color: var(--text-3); line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thread-row .stats {
  display: flex; gap: 14px; font-size: 12px; color: var(--text-3);
  font-family: var(--font-mono); align-items: center;
}

/* ---------- Support — ticket center ---------- */
.support-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
@media (max-width: 820px) { .support-grid { grid-template-columns: 1fr; } }
.ticket-row {
  display: flex; gap: 14px; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  cursor: pointer; transition: background .12s;
}
.ticket-row:hover { background: var(--bg-1); }
.ticket-row:last-child { border-bottom: 0; }
.ticket-row .id {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-3);
  flex: none; width: 80px;
}
.ticket-row .subject { flex: 1; min-width: 0; }
.ticket-row .subject b {
  display: block; font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ticket-row .subject span {
  display: block; font-size: 12px; color: var(--text-3); margin-top: 2px;
}
.ticket-row .status {
  font-family: var(--font-mono); font-size: 11px;
  padding: 4px 10px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .04em;
  flex: none;
}
.ticket-row .status.open { background: var(--gold-soft); color: var(--gold-deep); }
.ticket-row .status.answered { background: var(--up-soft); color: var(--up); }
.ticket-row .status.closed { background: var(--bg-3); color: var(--text-3); }

.thread-msg {
  display: flex; gap: 14px; padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.thread-msg:last-child { border-bottom: 0; }
.thread-msg .av {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-2); color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700;
  flex: none;
}
.thread-msg .av.op { background: var(--gold-soft); color: var(--gold-deep); }
.thread-msg .body { flex: 1; }
.thread-msg .body .by {
  font-size: 13px; font-weight: 600;
}
.thread-msg .body .when {
  font-size: 12px; color: var(--text-3); font-family: var(--font-mono);
}
.thread-msg .body .text {
  margin-top: 8px; font-size: 14.5px; line-height: 1.6; color: var(--text);
  white-space: pre-wrap;
}

/* ---------- Generic content page (footer pages) ---------- */
.content-page {
  max-width: 780px; margin: 0 auto;
}
.content-page h1 {
  font-family: var(--font-display); font-size: 38px;
  letter-spacing: -.02em; margin: 0 0 14px;
}
.content-page .lead {
  font-size: 17.5px; color: var(--text-2); line-height: 1.6;
  margin-bottom: 32px;
}
.content-page h2 {
  font-family: var(--font-display); font-size: 24px;
  letter-spacing: -.01em; margin: 1.8em 0 .6em;
}
.content-page p, .content-page li {
  font-size: 15.5px; line-height: 1.75; color: var(--text-2);
}
.content-page a { color: var(--gold-deep); text-decoration: underline; }

/* ---------- Admin v2: per-row TX edit ---------- */
.admin-tx-table {
  width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 13px;
}
.admin-tx-table th {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line);
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-3); font-weight: 600;
}
.admin-tx-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.admin-tx-table tr:hover td { background: var(--bg-1); }
.admin-tx-table .row-actions {
  display: flex; gap: 6px; justify-content: flex-end;
}
.admin-tx-table .row-actions button {
  width: 28px; height: 28px; border-radius: 6px; border: 0;
  background: var(--bg-2); color: var(--text-2); cursor: pointer;
}
.admin-tx-table .row-actions button:hover { background: var(--bg-3); color: var(--text); }
.admin-tx-table .row-actions button.danger:hover { background: var(--down-soft); color: var(--down); }
