/* MoneroMarket — application stylesheet. No inline styles are used anywhere (strict CSP). */
:root {
  --bg: #0f1115;
  --bg-elev: #171a21;
  --bg-elev-2: #1e222b;
  --border: #2a2f3a;
  --text: #e6e8ee;
  --text-muted: #8b93a7;
  --accent: #f26822;      /* Monero orange */
  --accent-hover: #ff7a33;
  --blue: #4c8dff;
  --green: #2fbf71;
  --red: #e5484d;
  --yellow: #f5b14c;
  --radius: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9; --bg-elev: #ffffff; --bg-elev-2: #f0f2f5; --border: #d9dde5;
    --text: #1b1f27; --text-muted: #5c667a;
  }
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.5; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6rem; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; } h4 { font-size: 1rem; }
p { margin: 0 0 .8rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.2rem 0; }
code { font-family: var(--mono); font-size: .9em; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.page { padding: 1.5rem 16px 3rem; min-height: 60vh; }
.muted { color: var(--text-muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); }
.break { word-break: break-all; }
.center { text-align: center; }
.text-right { text-align: right; }
.hidden { display: none !important; }
.prewrap { white-space: pre-wrap; }
.empty { padding: 1.2rem; border: 1px dashed var(--border); border-radius: var(--radius); text-align: center; }
.pos { color: var(--green); } .neg { color: var(--red); }

/* Header */
.site-header { background: var(--bg-elev); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 58px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); display: flex; align-items: center; gap: .4rem; }
/*.brand-mark { color: var(--accent); font-size: 1.4rem; background-image: url('../logo-lockup-light-800.png')}*/
.brand-mark {background-image: url('../logo-lockup-light-800.png');
  width: 224px;
  height: 7vh;
  background-size: cover;
  background-repeat: no-repeat;
  background-position-y: center;}
.nav-links { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav-links a { color: var(--text-muted); font-weight: 500; }
.nav-links a.active, .nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links .nav-user { color: var(--accent); }
.nav-links .nav-admin { color: var(--yellow); }
.nav-toggle, .nav-burger { display: none; }
.notif-link { position: relative; }
.notif-badge { display: inline-block; background: var(--accent); color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 .4rem; margin-left: .2rem; min-width: 1.2rem; text-align: center; }
@media (max-width: 860px) {
  .nav-burger { display: flex; flex-direction: column; gap: 4px; cursor: pointer; padding: 8px; }
  .nav-burger span { width: 22px; height: 2px; background: var(--text); display: block; }
  .nav-links { display: none; width: 100%; flex-direction: column; align-items: flex-start; padding: .6rem 0 1rem; }
  .nav-toggle:checked ~ .nav-links { display: flex; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 1.2rem 0; color: var(--text-muted); font-size: .85rem; }
.site-footer .container { display: flex; flex-direction: column; gap: .3rem; }

/* Layout helpers */
.grid-2, .grid-3 { display: grid; gap: 1.2rem; margin-bottom: 1.2rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1.2rem; }
.card.narrow, .auth-card { max-width: 560px; margin-left: auto; margin-right: auto; }
.auth-card { margin-top: 2rem; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 1.2rem 0 .6rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .8rem; }
.actions-cell { white-space: nowrap; }
.actions-cell form, .actions-cell a { margin-left: .25rem; }
.inline-form { display: inline; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.kv dt { color: var(--text-muted); } .kv dd { margin: 0; }
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--border); margin-bottom: 1.2rem; flex-wrap: wrap; }
.tabs a { padding: .5rem .9rem; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.tab-active, .tabs a:hover { color: var(--text); border-bottom-color: var(--accent); text-decoration: none; }

/* Buttons */
.btn { display: inline-block; padding: .5rem 1rem; border-radius: var(--radius); border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; background: var(--bg-elev-2); color: var(--text); text-align: center; line-height: 1.3; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--blue); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); }
.btn-sm { padding: .3rem .7rem; font-size: .85rem; }
.btn-lg { padding: .75rem 1.4rem; font-size: 1.05rem; }
.btn-block { display: block; width: 100%; }

/* Forms */
.form-group { margin-bottom: .95rem; }
.form-group label, fieldset legend { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .92rem; }
.form-group.check label, label.radio { font-weight: 400; display: flex; gap: .5rem; align-items: flex-start; }
label.radio { margin-bottom: .4rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .9rem; }
.form-actions { align-self: end; }
.input, .select, .textarea { width: 100%; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text); font: inherit; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.input-sm { padding: .3rem .5rem; font-size: .85rem; }
.input-code { font-family: var(--mono); font-size: 1.3rem; letter-spacing: .3rem; text-align: center; }
.textarea { resize: vertical; }
.help { color: var(--text-muted); font-size: .82rem; margin-top: .3rem; }
.error { color: var(--red); font-size: .85rem; margin-top: .3rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; }
.hp { position: absolute; left: -9999px; top: -9999px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem; align-items: end; }
.filters .form-group { margin: 0; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; align-items: end; }

/* Flash / alerts */
.flash, .alert { padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid; display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.alert { display: block; }
.flash-success, .alert-success { background: rgba(47,191,113,.12); border-color: rgba(47,191,113,.5); }
.flash-error, .alert-error { background: rgba(229,72,77,.12); border-color: rgba(229,72,77,.5); }
.flash-warning, .alert-warning { background: rgba(245,177,76,.12); border-color: rgba(245,177,76,.5); }
.flash-info, .alert-info { background: rgba(76,141,255,.12); border-color: rgba(76,141,255,.5); }
.flash-close { background: none; border: 0; color: inherit; font-size: 1.2rem; cursor: pointer; line-height: 1; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); background: var(--bg-elev-2); }
.table tr:last-child td { border-bottom: 0; }
.table.small td, .table.small th { padding: .45rem .6rem; font-size: .85rem; }

/* Badges & tags */
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; background: var(--bg-elev-2); color: var(--text); vertical-align: middle; }
.badge-green { background: rgba(47,191,113,.2); color: var(--green); }
.badge-red { background: rgba(229,72,77,.2); color: var(--red); }
.badge-orange { background: rgba(242,104,34,.2); color: var(--accent); }
.badge-blue { background: rgba(76,141,255,.2); color: var(--blue); }
.badge-grey { background: var(--bg-elev-2); color: var(--text-muted); }
.tag { display: inline-block; padding: .1rem .5rem; border-radius: 4px; font-size: .8rem; background: var(--bg-elev-2); border: 1px solid var(--border); }
.tag-cash { border-color: rgba(47,191,113,.5); } .tag-gift_card { border-color: rgba(245,177,76,.5); } .tag-crypto { border-color: rgba(76,141,255,.5); }
.online-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--text-muted); margin-right: .3rem; vertical-align: middle; }
.online-dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(47,191,113,.2); }
.trader { color: var(--text); display: inline-flex; flex-direction: column; line-height: 1.3; }
.trader strong { display: inline; }
.trader:hover { text-decoration: none; }
.trader:hover strong { text-decoration: underline; }

/* Home */
.hero { text-align: center; padding: 2.5rem 0 2rem; }
.hero h1 { font-size: 2.3rem; }
.hero .lead { font-size: 1.15rem; color: var(--text-muted); max-width: 720px; margin: 0 auto 1.2rem; }
.hero .actions { justify-content: center; }
.lead { font-size: 1.1rem; }
.ticker { margin-top: 1.4rem; display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; font-size: .95rem; color: var(--text-muted); }
.ticker.stale { opacity: .6; }
.how .card h3 { color: var(--accent); }
.stats-row { display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; padding: 1rem 0 2rem; }
.stat { text-align: center; }
.stat-value { font-size: 1.7rem; font-weight: 700; }
.stat-label { color: var(--text-muted); font-size: .85rem; }
.stat-alert { border-color: var(--red); }
.price-big { font-size: 1.5rem; font-weight: 700; }
.price-big small { font-size: .9rem; font-weight: 400; color: var(--text-muted); }

/* Notifications */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { padding: .55rem 0; border-bottom: 1px solid var(--border); display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.notif-list li:last-child { border-bottom: 0; }
.notif-list li.unread { font-weight: 600; }
.feedback-list { list-style: none; padding: 0; margin: 0; }
.feedback-list li { padding: .5rem 0; border-bottom: 1px solid var(--border); }

/* Trade */
.timeline { display: flex; list-style: none; padding: 0; margin: 0 0 1.2rem; counter-reset: step; }
.timeline li { flex: 1; text-align: center; position: relative; padding-top: 1.8rem; color: var(--text-muted); font-size: .9rem; }
.timeline li::before { counter-increment: step; content: counter(step); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--bg-elev-2); border: 2px solid var(--border); font-size: .8rem; line-height: 1.3rem; }
.timeline li.done { color: var(--green); } .timeline li.done::before { background: var(--green); border-color: var(--green); color: #fff; content: "✓"; }
.timeline li.current { color: var(--text); font-weight: 600; } .timeline li.current::before { border-color: var(--accent); color: var(--accent); }
.countdown.urgent { color: var(--red); }
.payment-box { border-color: rgba(76,141,255,.5); }
.staff-box { border-color: var(--yellow); }
.dispute-box summary { list-style: none; }
.dispute-box summary::-webkit-details-marker { display: none; }
.dispute-box form { margin-top: .8rem; }
.rating-row { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.chat { display: flex; flex-direction: column; }
.chat-messages { max-height: 520px; min-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; padding: .5rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .8rem; }
.msg { max-width: 85%; padding: .45rem .7rem; border-radius: var(--radius); background: var(--bg-elev-2); align-self: flex-start; }
.msg-mine { align-self: flex-end; background: rgba(242,104,34,.18); }
.msg-system { align-self: center; max-width: 100%; background: transparent; color: var(--text-muted); font-size: .85rem; text-align: center; border: 1px dashed var(--border); }
.msg-meta { font-size: .72rem; color: var(--text-muted); margin-bottom: .15rem; }
.msg-body { white-space: pre-wrap; word-wrap: break-word; }
.chat-form { display: flex; gap: .6rem; align-items: flex-end; }
.chat-form .textarea { flex: 1; }

/* Wallet */
.qr-row { display: flex; gap: 1.2rem; align-items: flex-start; flex-wrap: wrap; margin-bottom: 1rem; }
.qr { width: 180px; min-height: 60px; background: #fff; padding: 6px; border-radius: var(--radius); flex: 0 0 auto; }
.qr svg { width: 100%; height: auto; display: block; }
.qr img { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.qr:empty { display: none; }
.address-box { padding: .6rem .8rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .5rem; font-size: .9rem; }

/* Misc */
.pagination { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1.2rem 0; }
.error-page { text-align: center; padding: 4rem 0; }
.error-page h1 { font-size: 4rem; color: var(--accent); }
.profile-head { display: flex; gap: .8rem; align-items: center; margin-bottom: 1rem; }
.ad-detail .kv dd { word-break: break-word; }
