/* ============================
   Aranyn / ARI - dark theme
   ============================ */

:root {
  --bg-main: #0b0e11;
  --bg-elevated: #181a20;
  --border-subtle: #2b3139;

  --text-main: #eaecef;
  --text-muted: #848e9c;

  --accent-gold: #f0b90b;
  --accent-green: #0ecb81;
  --accent-red: #f6465d;
}

/* Basic reset-ish */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
}

.gold {
  color: var(--accent-gold);
}

.heart {
  color: var(--accent-gold);
  margin-left: 0.15rem;
  font-size: 0.9em;
}

a.heart,
a.heart:visited,
a.heart:hover,
a.heart:focus {
  color: var(--accent-gold);
}

/* optional: only underline on hover/focus */
a.heart {
  text-decoration: none;
}

a.heart:hover,
a.heart:focus {
  text-decoration: underline;
}

/* ============================
   Top bar / header
   ============================ */

.top-bar {
  background: #0b0e11;
  border-bottom: 1px solid var(--border-subtle);
}

.top-bar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ARANYN brand */

.brand-title,
.brand-title:visited {
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--accent-gold);
  text-decoration: none;
  font-size: 1rem;
}

/* Right side (account + balance + logout) */

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Account pill in header – gold */

.brand-account,
.brand-account:visited {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--accent-gold);
  background: #10121a;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
}

.brand-account:hover {
  border-color: #ffe58a;
  color: #ffe58a;
}

/* Additional tweaks when the pill is used for "Free: ..." balance */

.brand-balance {
  font-weight: 500;
}

.brand-balance-fiat {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
}

/* Logout button – similar outer size to account pill */

.logout-form {
  margin: 0;
}

.pill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;

  background: var(--accent-gold);
  color: #0b0e11;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5),
              0 8px 18px rgba(0, 0, 0, 0.6);
  transition: background 0.15s ease, transform 0.1s ease,
              box-shadow 0.15s ease;
}

.pill-button:hover {
  background: #f8d94a;
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5),
              0 12px 22px rgba(0, 0, 0, 0.8);
}

.pill-button:active {
  transform: translateY(0);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7),
              0 5px 12px rgba(0, 0, 0, 0.7);
}

.pill-button:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 3px;
}

.logout-button {
  /* same padding/size as brand-account via pill-button base */
}

/* Header: mobile layout */

@media (max-width: 720px) {
  .top-bar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .top-bar-right {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .top-bar-right .logout-form {
    margin-left: auto;
  }

  /* allow the Free: pill to wrap text inside on narrow screens */
  .brand-balance {
    white-space: normal;
    font-size: 0.75rem;
  }

  .brand-account,
  .brand-account:visited {
    max-width: 100%;
  }
}

/* ============================
   Main horizontal navigation
   ============================ */

.main-nav {
  background: #0b0e11; /* same as header */
  border-bottom: 1px solid var(--border-subtle);
}

.main-nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.4rem 1rem 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Default nav pill: outline style */
.main-nav-link,
.main-nav-link:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-main);
  white-space: nowrap;
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
              box-shadow 0.15s ease, transform 0.1s ease;
}

.main-nav-link:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* Permanent highlight for Buy Aranyn, but softer than active */
.main-nav-link--primary,
.main-nav-link--primary:visited {
  border-color: rgba(240, 185, 11, 0.55);
  background: rgba(240, 185, 11, 0.10);
  color: var(--accent-gold);
  box-shadow: inset 0 0 0 1px rgba(240, 185, 11, 0.08);
}

.main-nav-link--primary:hover {
  border-color: var(--accent-gold);
  background: rgba(240, 185, 11, 0.18);
  color: var(--accent-gold);
}

/* Active page = real gold highlight */
.main-nav-link.active,
.main-nav-link.active:visited {
  border-color: var(--accent-gold);
  background: var(--accent-gold);
  color: #0b0e11;
  font-weight: 600;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 6px 16px rgba(0, 0, 0, 0.6);
}

.main-nav-link.active:hover {
  background: #f8d94a;
  color: #0b0e11;
}

/* Stack nicely on very small screens */
@media (max-width: 600px) {
  .main-nav-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .main-nav-link,
  .main-nav-link--primary {
    justify-content: flex-start;
  }
}

/* ============================
   Layout
   ============================ */

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem 0;
}

/* ============================
   Hero / main ARI section
   ============================ */

.hero {
  margin-bottom: 2rem;
}

.hero-main h1 {
  font-size: 1.6rem;
  margin: 0 0 0.5rem;
}

.hero-subtitle {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.hero-subtitle.error {
  color: var(--accent-red);
}

/* Bubble row */

.hero-bubbles {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
  margin-bottom: 1.25rem;
}

.bubble-card {
  background: var(--bg-elevated);
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 0.9rem 1.4rem;
  min-width: 220px;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.bubble-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.bubble-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem;
}

.bubble-unit {
  font-size: 0.95rem;
}

.bubble-eq {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.bubble-value {
  font-size: 1.05rem;
  font-weight: 600;
}

.bubble-note {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.bubble-gold {
  border-color: var(--accent-gold);
}

.bubble-usd {
  border-color: var(--border-subtle);
}

.bubble-btc {
  border-color: #f7931a;
}

/* Small text under bubbles */

.hero-note {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================
   Cards
   ============================ */

.card {
  background: var(--bg-elevated);
  border-radius: 0.5rem;
  border: 1px solid var(--border-subtle);
  padding: 0.9rem;
  flex: 1 1 185px;
}

.card.primary {
  border-color: var(--accent-gold);
}

.card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.card-value {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.card-note {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Blocks inside cards */

.card-block {
  margin-top: 1.5rem;
}

/* ============================
   Generic sections
   ============================ */

.section {
  margin-bottom: 1.75rem;
}

.section h2,
.section h1 {
  font-size: 1.2rem;
  margin: 0 0 0.75rem;
}

.section-title {
  font-size: 1.3rem;
  margin: 1.4rem 0 0.6rem;
  color: var(--accent-gold);
  border-left: 3px solid var(--accent-gold);
  padding-left: 0.5rem;
}  

.section-note {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ============================
   Tables
   ============================ */

.table-wrapper {
  overflow-x: auto;
}

.simple-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.simple-table th,
.simple-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
}

.simple-table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-muted);
}

.simple-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.01);
}

/* ============================
   Links / main CTA button
   ============================ */

.btn-link {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  text-decoration: none;
  font-size: 0.9rem;
}

.btn-link:hover {
  background: rgba(240, 185, 11, 0.1);
}

/* Signup CTA */

.form {
  margin-top: 1.75rem;
  text-align: center;
}

.bubble-button {
  display: inline-block;
  padding: 0.75rem 1.8rem;
  border-radius: 999px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;

  background: var(--accent-gold);
  color: #0b0e11;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5),
              0 10px 25px rgba(0, 0, 0, 0.6);
  transition: background 0.15s ease, transform 0.1s ease,
              box-shadow 0.15s ease;
}

.bubble-button:hover {
  background: #f8d94a;
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5),
              0 14px 30px rgba(0, 0, 0, 0.8);
}

.bubble-button:active {
  transform: translateY(0);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7),
              0 6px 15px rgba(0, 0, 0, 0.7);
}

.bubble-button:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 3px;
}

.bubble-primary {
  /* hook for variants */
}

/* Warning text emphasis */

.warn {
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: #f9a825;
}

/* ============================
   Token / PIN display
   ============================ */

.token-box {
  margin-top: 0.8rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: #111318;
  border: 1px solid #2a2f3a;
  font-size: 0.85rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-all;
}

.token-mono {
  font-family: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono",
               "Courier New", monospace;
}

.pin-box {
  margin-top: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.5rem;
  border-radius: 999px;
  background: var(--accent-gold);
  color: #0b0e11;
  font-weight: 700;
  letter-spacing: 0.2em;
  font-size: 1.1rem;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5),
              0 10px 25px rgba(0, 0, 0, 0.6);
}

/* Recovery phrase grid */

.recovery-grid {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;

  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0.4rem 0.6rem;
}

.recovery-word {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
  background: #141820;
  border: 1px solid #2a2f3a;
  font-size: 0.8rem;
}

.recovery-word-index {
  display: inline-block;
  min-width: 1.4rem;
  margin-right: 0.4rem;
  padding: 0.05rem 0.25rem;
  border-radius: 999px;
  background: #1f2430;
  color: #9da5c0;
  text-align: center;
  font-size: 0.7rem;
}

.recovery-word-text {
  color: #e5e9f0;
}

/* ============================
   Forms (login / recover)
   ============================ */

.form-vertical {
  max-width: 535px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #e5e9f0;
  margin-bottom: 0.4rem;
}

.form-help {
  margin-top: 0.9rem;
  font-size: 0.8rem;
  color: #9da5c0;
}

.form-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
}

.token-input {
  width: 100%;
  margin-top: 0.1rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #2a2f3a;
  background: #111318;
  color: #e5e9f0;
  font-family: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono",
               "Courier New", monospace;
  font-size: 0.9rem;
  resize: vertical;
}

.token-input:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

.text-input {
  width: 100%;
  margin-top: 0.1rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #2a2f3a;
  background: #111318;
  color: #e5e9f0;
  font-size: 0.9rem;
}

.text-input:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

.form-error {
  margin-top: 0.8rem;
  font-size: 0.85rem;
  color: #f66;
}

/* ============================
   Footer
   ============================ */

.footer {
  border-top: 1px solid var(--border-subtle);
  background: #0b0e11;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* main line: © + links */

.footer-main {
  margin-bottom: 0;              /* remove extra margin */
}

.footer-inner.footer-main {
  padding-bottom: 0.3rem;        /* slightly smaller bottom padding */
}

.footer-inner.footer-note-row {
  padding-top: 0.2rem;           /* smaller top padding */
}

.footer-links-row {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;          /* allow wrapping */
}

/* footer links: always white, gold on hover, no visited color */

.footer-link,
.footer-link:visited {
  color: #e5e9f0;
  text-decoration: none;
  white-space: nowrap;
}

.footer-link:hover {
  color: var(--accent-gold);
}

/* second line: note */

.footer-note-row .footer-note {
  text-align: center;
  max-width: 640px;
}

/* Footer: mobile layout */
@media (max-width: 600px) {
  .footer-inner {
    padding: 0.85rem 0.75rem 1.1rem;
  }

  .footer-links-row {
    justify-content: center;
    row-gap: 0.35rem;
    column-gap: 0.8rem;
  }

  /* Make the © line its own row on mobile */
  .footer-links-row .footer-link:first-child {
    flex-basis: 100%;
    text-align: center;
  }
}

/* ============================
   Whitepaper styling
   ============================ */

.whitepaper {
  background: var(--bg-elevated);
  border-radius: 0.6rem;
  border: 1px solid var(--border-subtle);
  padding: 1.25rem 1.1rem 1.4rem;
}

.whitepaper-header h1 {
  font-size: 1.4rem;
  margin: 0 0 0.25rem;
  color: var(--accent-gold);
}

.wp-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.wp-separator {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: 0.9rem 0 1rem;
}

.wp-section {
  margin-bottom: 1.5rem;
}

.wp-section h2 {
  font-size: 1.3rem;
  margin: 1.4rem 0 0.6rem;
  color: var(--accent-gold);
  border-left: 3px solid var(--accent-gold);
  padding-left: 0.5rem;
}

.wp-section h3 {
  font-size: 1.05rem;
  margin: 1rem 0 0.4rem;
  color: var(--accent-gold);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.2rem;
}

.wp-section h4 {
  font-size: 0.95rem;
  margin: 0.8rem 0 0.3rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wp-section p {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 0.5rem;
}

.wp-section ul,
.wp-section ol {
  margin: 0.2rem 0 0.7rem 1.3rem;
  padding-left: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  list-style-position: outside;
}

.wp-section li {
  margin-bottom: 0.25rem;
}

.wp-note {
  margin: 0.6rem 0;
  padding: 0.6rem 0.8rem;
  border-radius: 0.4rem;
  border: 1px dashed var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Whitepaper version list */

.version-list {
  list-style: none;
  padding-left: 0;
  margin: 0.4rem 0 0;
}

.version-list li {
  margin-bottom: 0.25rem;
}

.version-list a {
  color: var(--accent-gold);
  text-decoration: none;
  font-size: 0.9rem;
}

.version-list a:hover {
  text-decoration: underline;
}

/* error */
.error-center {
  text-align: center;
}

/* ============================
   Account page
   ============================ */

.account-grid {
  display: grid;
  gap: 1.5rem;
}

/* right-hand column (Actions + Use Aranyn) */
.account-columns {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* hook if you want extra spacing inside the side sections later */
.account-section {
  /* currently inherits .card styling */
}

/* row of golden buttons inside each section */
.account-actions-row {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (min-width: 768px) {
  .account-grid {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    align-items: flex-start;
  }
}

/* whole bubble is button/link */

.account-action-card,
.account-action-card:visited {
  background: var(--accent-gold);
  border-radius: 0.5rem;
  border: 1px solid var(--accent-gold);
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b0e11;
  text-decoration: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5),
              0 10px 25px rgba(0, 0, 0, 0.6);
  transition: background 0.15s ease, transform 0.1s ease,
              box-shadow 0.15s ease;
}

.account-action-card:hover {
  background: #f8d94a;
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5),
              0 14px 30px rgba(0, 0, 0, 0.8);
}

.account-action-card:active {
  transform: translateY(0);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7),
              0 6px 15px rgba(0, 0, 0, 0.7);
}

.account-action-card:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.account-action-title {
  font-size: 1.1rem;
  font-weight: 700;
}

/* ============================
   Account history
   ============================ */

.history-event-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.history-event-bubble {
  border-radius: 0.75rem;
  border: 1px solid var(--border-subtle);
  background: #111318;
  padding: 0.75rem 0.9rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.history-event-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.history-event-kind {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* time stamp in mono */
.history-event-time {
  font-family: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono",
               "Courier New", monospace;
}

/* main content: stack each field on its own line */
.history-event-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

/* one logical row: label + value; can wrap if needed */
.history-event-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.history-event-line--fiat small {
  opacity: 0.75;
  font-size: 0.9em;
}

.history-label {
  color: var(--text-muted);
}

.history-value {
  font-weight: 600;
}

.history-event-note {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* mobile: place USER under timestamp */
@media (max-width: 600px) {
  .history-event-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }
}

/* highlight the newest history event */
.history-event-bubble--recent {
  border-color: #ffffff;
}

/* paylink token styling (used both on <span> and <a>) */
.history-value-token {
  font-family: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono",
               "Courier New", monospace;
  font-size: 0.8rem;
  color: var(--accent-gold);
  word-break: break-all;
}

/* clickable paylink (for reusable links) */
.history-paylink-link {
  text-decoration: none;
}

.history-paylink-link:hover {
  text-decoration: underline;
}

/* Inline radio group (Payment links) */

.form-inline-options {
  margin-top: 0.15rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-main);
}

.form-inline-option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.form-inline-option input[type="radio"] {
  accent-color: var(--accent-gold);
}

/* QR */
.paylink-qr-image {
  width: 120px;
  height: 120px;
  image-rendering: pixelated;
  border-radius: 0.5rem;
  border: 1px solid var(--border-subtle);
  background: #fff;
}

/* Paylinks layout */

/* Paylinks layout */

.paylinks-list {
  display: grid;
  gap: 0.65rem;
}

.paylinks-list--market {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  justify-content: stretch;
  justify-items: center;
  align-items: stretch;
}

.paylink-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: center;
}

.paylink-card--market {
  width: 100%;
  max-width: 240px;
  min-width: 0;
  height: 100%;
  align-items: center;
  padding: 0.65rem;
  overflow: hidden;
}

.paylink-card-meta {
  width: 100%;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.2;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.15rem;
  min-height: 2.4em;
  text-align: center;
}

.paylink-card-date,
.paylink-card-kind {
  display: block;
  max-width: 100%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.paylink-card-qr-link {
  display: block;
  width: 100%;
  text-decoration: none;
  color: inherit;
}

.paylink-card-qr-wrap {
  width: 160px;
  height: 160px;
  max-width: 100%;
  margin: 0 auto 0.55rem auto;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(212, 175, 55, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
}

.paylink-card-qr {
  width: 160px;
  height: 160px;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  image-rendering: pixelated;
  border: none;
  border-radius: 0;
  background: #ffffff;
}

.paylink-card-label-row {
  width: 100%;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  color: var(--accent-gold);
  font-weight: 600;
  line-height: 1.2;
  min-height: 1.2em;
  display: flex;
  justify-content: center;
  align-items: center;
}

.paylink-card-label {
  display: block;
  max-width: 100%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.paylink-card-amount {
  width: 100%;
  text-align: center;
  line-height: 1.25;
  margin-bottom: 0.45rem;
}

.paylink-card-amount-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.paylink-card-helper {
  margin-top: 0.15rem;
  font-size: 0.82rem;
}

.paylink-card-token-row {
  width: 100%;
  margin-bottom: 0.5rem;
  text-align: center;
}

.paylink-card-token {
  display: inline-block;
  max-width: 100%;
  word-break: break-all;
  text-decoration: none;
  color: var(--accent-gold);
}

.paylink-card-token:hover,
.paylink-card-token:focus-visible,
.paylink-card-token:visited {
  color: var(--accent-gold);
}

.paylink-card-actions {
  width: 100%;
  margin-top: auto;
  text-align: center;
}

.paylink-disable-form {
  display: inline-block;
  margin-right: 0.4rem;
}

.paylink-disable-help {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================
   Sponsors (list + tiers)
   ============================ */

/* Sponsors list page: 4 cards in a row on desktop */
.sponsor-list-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.sponsor-card {
  flex: 1 1 calc(25% - 1rem);
  text-align: center;
  padding: 0.9rem 0.75rem;
  border-radius: 0.7rem;
  background-color: var(--accent-gold);
  border: 1px solid rgba(0, 0, 0, 0.3);
  color: #111111;
}

.sponsor-card-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.2rem;
  color: #111111;
}

.sponsor-card-tier {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.1rem;
  color: #222222;
}

.sponsor-card-amount {
  font-size: 0.85rem;
  color: #333333;
}

.sponsor-card-hearts {
  margin-top: 0.4rem;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
}

.sponsor-card-hearts span {
  color: red;
}

.sponsor-card-since {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: black;
  opacity: 0.9;
}

.sponsor-input {
  padding: 0.35rem 0.55rem;
  border-radius: 0.4rem;
  border: 1px solid var(--accent-gold);
  background: #0f1217;
  color: var(--text-main);
  font-size: 0.85rem;
  line-height: 1.2;
  max-width: 100%;
}

.sponsor-input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.sponsor-input:focus,
.sponsor-input:focus-visible {
  border-color: #ffe58a;
  outline: none;
  box-shadow: 0 0 0 2px rgba(240, 185, 11, 0.2);
}

.sponsor-input-64 {
  width: 64ch;
}

.sponsor-input-32 {
  width: 32ch;
}

/* Stack sponsor cards on small screens */
@media (max-width: 720px) {
  .sponsor-card {
    flex: 1 1 100%;
  }
}

/* Sponsor selection tiers on sponsor_manage */

.sponsor-tier-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Each tier uses the golden account-action-card base, but we override layout */
.sponsor-tier-card {
  position: relative;
  cursor: pointer;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;

  flex: 1 1 calc(25% - 0.75rem);
  max-width: calc(25% - 0.75rem);
}

/* hide the radio itself; whole card is the control */
.sponsor-tier-card input[type="radio"] {
  display: none;
}

/* Highlight the currently selected sponsor tier */
.sponsor-tier-card:has(input[type="radio"]:checked) {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.9);
}

/* Small checkmark badge on the selected tile */
.sponsor-tier-card:has(input[type="radio"]:checked)::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  background: #ffffff;
  color: #0b0e11;
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
}

.sponsor-tier-card:hover {
  transform: translateY(-1px);
}

/* Stack tiers vertically on small screens */
@media (max-width: 720px) {
  .sponsor-tier-card {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* Bigger main sponsor CTA */
.sponsor-cta-button {
  padding: 0.6rem 1.8rem;
  font-size: 0.95rem;
  min-width: 220px;
}


/* ============================
   Inline gold link
   ============================ */

.inline-gold-link {
  display: inline-block;
  padding: 0.08rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-gold);
  color: #0b0e11;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
}

.inline-gold-link:hover {
  background: #f8d94a;
}

.inline-gold-link:visited {
  color: #0b0e11;
}

/* ============================
   Marketplace category filters
   ============================ */

.market-filter-bar {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.market-filter,
.market-filter:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: none;
  text-decoration: none;
  background: #181a20;
  color: var(--text-muted);
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.market-filter:hover {
  background: #20232b;
  color: var(--text-main);
}

.market-filter--active,
.market-filter--active:visited {
  background: var(--accent-gold);
  color: #0b0e11;
  border-color: rgba(0, 0, 0, 0.7);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 6px 14px rgba(0, 0, 0, 0.7);
}

/* Desktop: force user items to full width. */

.paylinks-list--full {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.paylinks-list--full .paylink-card--full {
  width: 100%;
}

/* If your base .paylinks-list uses flex-wrap and fixed widths, override on wider screens */
@media (min-width: 768px) {
  .paylinks-list--full {
    flex-wrap: nowrap;
  }

  .paylinks-list--full .paylink-card--full {
    max-width: 100%;
  }
}

/* Item card header: stack lines vertically and center them */
.item-card-header {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.15rem;
}

/* Category / status lines in item cards */
.item-card-line {
  font-size: 0.85rem;
  color: var(--accent-gold);
}

/* images */
.item-card-image-row {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.item-card-image {
  display: block;
  max-width: 100%;
  max-height: 160px;
  border-radius: 0.5rem;
  border: 1px solid var(--border-subtle);
  object-fit: cover;
  background: #111318;
}

.item-card-image--placeholder {
  opacity: 0.6;
}

/* Marketplace items list: single line per item */

.market-items-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.market-item-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

/* title: golden link, same “feel” as other gold CTAs */
.market-item-title,
.market-item-title:visited {
  color: var(--accent-gold);
  text-decoration: none;
  font-weight: 600;
}

.market-item-title:hover,
.market-item-title:focus-visible {
  text-decoration: underline;
}

.market-item-price {
  font-size: 0.85rem;
  white-space: nowrap;
  color: var(--text-main);
}

.market-item-helper {
  color: var(--text-muted);
}

/* On mobile, stack title and price vertically */
@media (max-width: 600px) {
  .market-item-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .market-item-price {
    white-space: normal;
  }
}

/* ============================
   Marketplace item detail
   ============================ */

.market-item-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
}

.market-item-detail-image {
  flex: 0 0 40%;
  max-width: 360px;
}

.market-item-detail-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  border: 1px solid var(--border-subtle);
}

/* Reuse text styling from history bubbles but without card chrome */
.market-item-detail-body {
  flex: 1 1 240px;
  font-size: 0.9rem;
}

.market-item-detail-line {
  margin: 0 0 0.4rem;
}

.market-item-detail-warning {
  margin: 0.8rem 0 0.9rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Mobile: stack image on top */
@media (max-width: 700px) {
  .market-item-detail {
    flex-direction: column;
  }

  .market-item-detail-image {
    flex: 0 0 auto;
    max-width: 100%;
    align-self: center;
  }
}

/* ============================
   My items – compact rows
   ============================ */

.myitems-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.myitems-list .market-item-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

/* left side: title + meta */
.myitems-list .market-item-main {
  flex: 1 1 260px;
  min-width: 0;
}

.myitems-list .market-item-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* small grey text under title */
.myitems-list .market-item-meta,
.myitems-list .market-item-meta-small {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* middle: price */
.myitems-list .market-item-price {
  flex: 0 0 auto;
  min-width: 150px;
  text-align: right;
  font-size: 0.9rem;
}

.myitems-list .market-item-price small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* right: buttons */
.myitems-list .market-item-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 0.4rem;
}

.myitems-list .market-item-actions .pill-button {
  padding: 0.25rem 0.9rem;
  font-size: 0.75rem;
}

/* mobile: let things wrap, but tidy */
@media (max-width: 640px) {
  .myitems-list .market-item-row {
    align-items: flex-start;
  }

  .myitems-list .market-item-price {
    text-align: left;
  }

  .myitems-list .market-item-actions {
    width: 100%;
    margin-top: 0.25rem;
  }
}

/* item detail */
.item-detail-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.item-detail-image-img {
  max-width: 260px;
  border-radius: 0.5rem;
  display: block;
}

.item-detail-main {
  flex: 1 1 auto;
  font-size: 0.9rem;
  line-height: 1.5;
}

.item-detail-line {
  margin: 0 0 0.5rem;
}

@media (max-width: 720px) {
  .item-detail-layout {
    flex-direction: column;
  }

  .item-detail-image-img {
    max-width: 100%;
  }
}


/* ============================
   Small mobile viewport hardening
   ============================ */

/* Note: for true mobile viewport behavior, HTML should include:
   <meta name="viewport" content="width=device-width, initial-scale=1">
*/

:root {
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;

  --radius-sm: 0.4rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-pill: 999px;

  --font-xs: 0.75rem;
  --font-sm: 0.8rem;
  --font-md: 0.9rem;
  --font-lg: 0.95rem;
  --font-xl: 1.05rem;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
  height: auto;
}

.top-bar-inner,
.main-nav-inner,
.page,
.footer-inner,
.market-item-detail,
.item-detail-layout,
.account-grid,
.account-columns,
.hero-bubbles,
.account-actions-row,
.footer-links-row,
.top-bar-right {
  min-width: 0;
}

.brand-account,
.brand-account:visited,
.main-nav-link,
.main-nav-link:visited,
.pill-button,
.bubble-button,
.btn-link,
.inline-gold-link,
.history-value-token,
.paylink-link-token,
.token-box,
.token-input,
.text-input,
.item-card-image,
.item-detail-image-img {
  max-width: 100%;
}

.recovery-grid,
.paylinks-list,
.sponsor-grid,
.sponsor-tier-grid,
.market-grid,
.myitems-list,
.history-event-list {
  min-width: 0;
}

@media (min-width: 601px) {
  body {
    overflow-x: visible;
  }
}

/* ============================
   Paylinks tabs
   ============================ */

/* fallback: everything visible */
.paylinks-tab-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.paylinks-tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.paylinks-tab-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: #181a20;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.paylinks-tab-label:hover {
  background: #20232b;
  color: var(--text-main);
}

.paylinks-tab-panel + .paylinks-tab-panel {
  margin-top: 0.75rem;
}

/* enhanced tabs behavior */
@supports selector(#paylinks-tab-list:checked ~ .paylinks-tab-panels .paylinks-tab-panel-list) {
  .paylinks-tab-panel {
    display: none;
    margin-top: 0;
  }

  #paylinks-tab-list:checked ~ .paylinks-tab-panels .paylinks-tab-panel-list,
  #paylinks-tab-new:checked ~ .paylinks-tab-panels .paylinks-tab-panel-new {
    display: block;
  }

  #paylinks-tab-list:checked ~ .paylinks-tab-nav label[for="paylinks-tab-list"],
  #paylinks-tab-new:checked ~ .paylinks-tab-nav label[for="paylinks-tab-new"] {
    background: var(--accent-gold);
    color: #0b0e11;
    border-color: rgba(0, 0, 0, 0.7);
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.5),
      0 6px 14px rgba(0, 0, 0, 0.7);
  }

  #paylinks-tab-list:focus-visible ~ .paylinks-tab-nav label[for="paylinks-tab-list"],
  #paylinks-tab-new:focus-visible ~ .paylinks-tab-nav label[for="paylinks-tab-new"] {
    outline: 2px solid var(--accent-gold);
    outline-offset: 3px;
  }
}

.amount-mode-tabs {
  margin-top: 0.5rem;
}

.amount-mode-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.amount-mode-nav {
  display: inline-flex;
  gap: 0.25rem;           /* reduced gap */
  margin: 0.4rem 0;
  padding: 0.2rem;        /* smaller padding */
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  flex-wrap: wrap;        /* wrap if needed on small screens */
}

.amount-mode-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;       /* slightly smaller */
  padding: 0.3rem 0.4rem; /* less padding */
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;     /* smaller font for mobile */
  line-height: 1;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

#kind-one-time:checked ~ .amount-mode-nav label[for="kind-one-time"],
#kind-reusable:checked ~ .amount-mode-nav label[for="kind-reusable"],
#amount-mode-helper:checked ~ .amount-mode-nav label[for="amount-mode-helper"],
#amount-mode-ga:checked ~ .amount-mode-nav label[for="amount-mode-ga"],
#amount-mode-A:checked ~ .amount-mode-nav label[for="amount-mode-A"],
#amount-mode-on-demand:checked ~ .amount-mode-nav label[for="amount-mode-on-demand"] {
  background: rgba(255,255,255,0.12);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.amount-mode-panels {
  margin-bottom: 0.4rem;
}

.amount-mode-panel {
  display: none;
}

#amount-mode-helper:checked ~ .amount-mode-panels .amount-mode-panel-helper,
#amount-mode-ga:checked ~ .amount-mode-panels .amount-mode-panel-ga,
#amount-mode-A:checked ~ .amount-mode-panels .amount-mode-panel-A,
#amount-mode-on-demand:checked ~ .amount-mode-panels .amount-mode-panel-on-demand {
  display: block;
}

/* Inputs full width with compact padding */
.amount-mode-panel input.text-input {
  width: 100%;
  box-sizing: border-box;
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
}

/* Items paylink tabs – reuse paylinks.html styling */
.paylinks-tabs {
  margin-top: 1rem;
}

.paylinks-tab-panels {
  margin-top: 0.75rem;
}

.paylinks-tab-panel {
  display: none;
}

#paylinks-tab-existing:checked ~ .paylinks-tab-panels .paylinks-tab-panel-list,
#paylinks-tab-new:checked ~ .paylinks-tab-panels .paylinks-tab-panel-new {
  display: block;
}

.paylinks-tab-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: #181a20;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  margin-right: 0.5rem;
}

#paylinks-tab-existing:checked ~ .paylinks-tab-panels ~ .paylinks-tab-nav label[for="paylinks-tab-existing"],
#paylinks-tab-new:checked ~ .paylinks-tab-panels ~ .paylinks-tab-nav label[for="paylinks-tab-new"] {
  background: var(--accent-gold);
  color: #0b0e11;
  border-color: rgba(0, 0, 0, 0.7);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 6px 14px rgba(0,0,0,0.7);
}

/* Outer! */
.outer-tab-input {
  display: none;
}

.outer-tab-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.outer-tab-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: #181a20;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.outer-tab-label:hover {
  background: #20232b;
  color: var(--text-main);
}

/* Active tab using general sibling (~) */
#outer-tab-myitems:checked ~ .outer-tab-nav label[for="outer-tab-myitems"],
#outer-tab-newitem:checked ~ .outer-tab-nav label[for="outer-tab-newitem"] {
  background: var(--accent-gold);
  color: #0b0e11;
  border-color: rgba(0,0,0,0.7);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 6px 14px rgba(0,0,0,0.7);
}

/* Panels */
.outer-tab-panels {
  display: block;
  margin-top: 0.75rem;
}

.outer-tab-panel {
  display: none;
}

#outer-tab-myitems:checked ~ .outer-tab-panels #panel-myitems,
#outer-tab-newitem:checked ~ .outer-tab-panels #panel-newitem {
  display: block;
}

/* Cards display of existing items */
