:root {
  --gold: #ffbb00;
  --gold-light: #d4b460;
  --surface-0: #0d0d0d;
  --surface-1: #111111;
  --surface-3: #1c1c1c;
  --border: #242424;
  --border-hover: #333333;
  --text-primary: #e0d9c8;
  --text-secondary: #888880;
  --text-muted: #555550;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-family: 'Inter', sans-serif;
    display: flex; flex-direction: column; color: var(--text-primary); background: rgb(51, 51, 51); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
a { color: inherit; }
.hidden { display: none !important; }

/* HEADER */
.page-header { position: sticky; top: 0; z-index: 50; margin: 1.25rem auto 0; max-width: 1250px; background: rgba(0, 0, 0, 0.808); border: 1px solid rgb(29, 26, 26); border-radius: 1rem;min-height: 6rem; }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: 0 1.5rem; min-height: 5.5rem;}
.logo-badge { display: flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; padding: 2px; border-radius: 9999px; background: linear-gradient(to right,#fde68a,#eab308,#fef08a); box-shadow: 0 0 5px rgba(234,179,8,.7); flex-shrink: 0; }
.logo-image { width: 100%; height: 100%; border-radius: 9999px; }
.brand { display: flex; flex-direction: column; line-height: 1; margin-right: .5rem; }
.brand-title { font-family: 'Inter',sans-serif; font-weight: 700; font-size: 1.1rem; color: #fff; padding: .5rem; margin-bottom: 1px; }
.brand-subtitle { font-family: 'Inter',sans-serif; font-size: .55rem; color: var(--text-secondary); letter-spacing: .12em; text-transform: uppercase; margin-top: 1px; padding-left: .5rem; }
.nav-bar { display: flex; align-items: center; gap: .40rem; background: rgba(128, 128, 128, 0.164); border-radius: .375rem; margin-left: 3rem; }
.nav-link { display: inline-flex; align-items: center; gap: .35rem; padding: .40rem 1.25rem; border-radius: .375rem; font-size: 0.9rem; color: #fff; background: transparent; cursor: pointer; text-decoration: none; border: none; transition: color .15s, background .15s; }
.nav-link:hover { color: var(--text-primary); background: var(--surface-3); }
.nav-link.active { background: var(--gold); color: var(--surface-0); font-weight: 700; box-shadow: 0 0 8px rgba(234,179,8,.55); }
.header-actions { margin-left:23.5rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

@media(max-width:768px) {
  .header-inner { flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: .75rem; padding: 1rem; min-height: auto; margin-left: 0; }
  .header-actions { margin-left: 0; justify-content: center; width: 100%; }
  .nav-bar { justify-content: center; width: 100%; flex-wrap: wrap; }
  .page-header { margin: 1.25rem .5rem; }
}

/* BUTTONS */
.wallet-btn { display: inline-flex; align-items: center; gap: .5rem; border-radius: .375rem; padding: .45rem 1rem; font-family: 'Inter',sans-serif; font-size: .75rem; color: var(--text-secondary); border: 1px solid #fff; background: transparent; cursor: pointer; }
.wallet-dot { width: .375rem; height: .375rem; border-radius: 9999px; background: #34d399; flex-shrink: 0; }
.btn-gold { display: inline-flex; align-items: center;padding: 0.5rem 0.5rem; justify-content: center; gap: .4rem; background: var(--gold); color: var(--surface-0); font-weight: 650; border-radius: .500rem; ; border: none; cursor: pointer; font-size: .75rem; transition: background .15s, transform .1s; }
.btn-gold:hover { background: #ffcc33;}
.btn-gold:active { transform: scale(.99); }
.btn-gold:disabled { opacity: .5; cursor: not-allowed; }
.btn-deploy{ display: inline-flex; align-items: center; justify-content: center; gap: .4rem; background: var(--gold);padding:0.4rem 2.8rem; color: var(--surface-0); font-weight: 700; border-radius: .375rem; ; border: none; cursor: pointer; font-size: .85rem; transition: background .15s, transform .1s; }
.btn-deploy:hover { background: #ffcc33;}
.btn-deploy:active { transform: scale(.99); }
.btn-deploy:disabled { opacity: .5; cursor: not-allowed; }
.btn-neutral { flex: 1; background: #222; color: #aaa; border: 1px solid #444; border-radius: .75rem; padding: .5rem; cursor: pointer; font-weight: 600; }
.btn-full { width: 100%; border-radius: 8px; padding: .6rem 1rem; }
.btn-danger { width: 100%; display: flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid rgba(248,113,113,.3); border-radius: 8px; padding: .6rem 1rem; background: transparent; color: #f87171;  font-size: .875rem; cursor: pointer; transition: all .15s; }
.btn-danger:hover { border-color: rgba(248,113,113,.6); color: #fca5a5; }

/* PAGES */
.page { display: none;background: rgb(51, 51, 51); }
.page.active { display: block; }

/* CREATE PAGE */
.page-main { max-width: 1280px; margin: .3rem auto; padding: 0 1rem;flex: 1; }
.panel { background: #000; border-radius: 1rem 1rem 0 0; border: 1px solid var(--border); overflow:hidden ; }
.deploy-section { display: flex; justify-content: flex-end;  }

/* CHECKLIST */
.checklist-wrap {background:#000;border-radius: 0 0 1rem 1rem ;padding: .95rem 2rem 3rem;}
.checklist-heading { font-weight: 700; font-size: 1.6rem; color:var(--gold); }
.checklist-sub {  font-size: .8rem; color: #fdfbfb; margin-top: .25rem; }
.checklist-list { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; }
.cl-item { border-radius: .5rem; overflow: hidden; border: 1px solid rgb(253, 253, 252); background: var(--surface-3); transition: border-color .2s; }
.cl-item.open { border-color: rgba(255, 187, 0, 0.466); }
.cl-header { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; background: transparent; border: none; cursor: pointer; }
.cl-header-left { display: flex; align-items: center; gap: .5rem; }
.cl-dot { width: .4rem; height: .4rem; border-radius: 9999px; background: var(--border-hover); transition: background .2s; flex-shrink: 0; }
.cl-item.saved .cl-dot { background: var(--gold); }
.cl-item.open .cl-dot { background: rgba(255,187,0,.6); }
.cl-title {  font-size: .875rem; font-weight: 600; color: var(--text-primary); transition: color .2s; }
.cl-item.open .cl-title, .cl-item:hover .cl-title { color: var(--text-primary); }
.cl-item.saved .cl-title { color: var(--gold); }
.cl-saved-badge {  font-size: .6rem; color: rgba(0, 255, 85, 0.6); border: 1px solid rgba(255,187,0,.2); border-radius: .25rem; padding: .1rem .4rem; letter-spacing: .1em; text-transform: uppercase; display: none; }
.cl-item.saved .cl-saved-badge { display: inline-block; }
.cl-chevron { transition: transform .2s; color: var(--text-muted); }
.cl-item.open .cl-chevron { transform: rotate(180deg); color: rgba(255,187,0,.6); }
.cl-body { display: none; padding: 0 1rem 1rem; border-top: 1px solid rgba(36,36,36,.6); }
.cl-item.open .cl-body { display: block; }
.cl-body-inner { padding-top: .75rem; }
.cl-desc { font-size: .74rem; color:aliceblue; margin-bottom: .75rem; line-height: 1.5; }
.cl-field { margin-bottom: .75rem; }
.cl-label {  font-size: .6rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #e5e5e5; margin-bottom: .35rem; display: block; }
.cl-input, .cl-textarea { width: 100%; background: var(--surface-0); border: 1px solid var(--border); border-radius: .375rem; padding: .5rem .75rem; color: var(--text-primary); font-size: .8rem;  outline: none; transition: border-color .15s; }
.cl-input::placeholder, .cl-textarea::placeholder { color: var(--text-muted); }
.cl-input:focus, .cl-textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255,187,0,.1); }
.cl-textarea { resize: none; min-height: 72px; }
.cl-hint {  font-size: .65rem; color: var(--text-muted); margin-top: .3rem; }
.cl-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.cl-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .6rem; }
.cl-grid-social { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.cl-option-list { background: var(--surface-3); border: 1px solid var(--border); border-radius: .375rem; overflow: hidden; }
.cl-option { display: flex; align-items: center; gap: .5rem; padding: .6rem 1rem; font-size: .8rem; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.cl-option:last-child { border-bottom: none; }
.cl-option.active { background: rgba(37,99,235,.15); color: #93c5fd; }
.cl-option.disabled { color: var(--text-muted); opacity: .5; }
.cl-option-dot { width: .4rem; height: .4rem; border-radius: 9999px; background: #60a5fa; flex-shrink: 0; }
.cl-save-row { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid rgba(36,36,36,.5); display: flex; justify-content: flex-end; }
.cl-save-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem 1.1rem; border-radius: .375rem; font-size: .72rem; font-weight: 600; background: rgba(255,187,0,.08); border: 1px solid rgba(255,187,0,.22); color: var(--gold); cursor: pointer; transition: background .15s, border-color .15s; }
.cl-save-btn:hover { background: rgba(255,187,0,.16); border-color: rgba(255,187,0,.4); }
.cl-save-btn.done { background: rgba(52,211,153,.08); border-color: rgba(52,211,153,.22); color: #34d399; cursor: default; }

/* MANAGE PAGE */
.manage-wrap { max-width: 1280px; margin: .3rem auto; padding: 0 1rem; }
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem; }
.card-title {  font-weight: 700; font-size: 1.1rem; color: var(--text-primary); }
.card-sub { font-size: .7rem; color: var(--text-muted); margin-top: .25rem; }
.f-label { display: block; font-size: .6rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .4rem; }
.f-input, .f-select { width: 100%; background: var(--surface-0); border: 1px solid var(--border); border-radius: .375rem; padding: .6rem 1rem; color: var(--text-primary); font-size: .875rem; outline: none; transition: border-color .15s; margin-bottom: 1rem; }
.f-input::placeholder { color: var(--text-muted); }
.f-input:focus, .f-select:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255,187,0,.1); }
.f-select { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23555550' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; }
.f-select option { background: var(--surface-1); }
.f-error { color: #f87171; font-size: .7rem;  margin-top: -.75rem; margin-bottom: .75rem; display: none; }
.err { font-size: .7rem; color: #f87171; margin-top: .25rem; display: none; }
.token-info-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; margin-bottom: 1.25rem; }
.token-info-cell { background: var(--surface-0); border: 1px solid var(--border); border-radius: .375rem; padding: .5rem .75rem; }
.token-info-key {  font-size: .55rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-muted); margin-bottom: .2rem; }
.token-info-val {  font-size: .78rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider { border: none; border-top: 1px solid var(--border); margin: 0 0 1.25rem; }
.action-tabs { display: flex; gap: .5rem; margin-bottom: 1.25rem; }
.action-tab { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem 1rem; border-radius: .375rem;  font-size: .78rem; border: 1px solid var(--border); color: var(--text-muted); background: transparent; cursor: pointer; transition: all .15s; }
.action-tab:hover { border-color: var(--border-hover); color: var(--text-secondary); }
.action-tab.active-transfer { border-color: var(--border-hover); background: var(--surface-3); color: #60a5fa; }
.action-tab.active-mint { border-color: var(--border-hover); background: var(--surface-3); color: #34d399; }
.action-tab.active-burn { border-color: var(--border-hover); background: var(--surface-3); color: #f87171; }
.status-banner { margin-top: 1rem; padding: .75rem 1rem; border-radius: .5rem; font-size: .75rem; }
.status-banner.pending { background: rgba(234,179,8,.08); border: 1px solid rgba(234,179,8,.2); color: #eab308; }
.status-banner.success { background: rgba(52,211,153,.08); border: 1px solid rgba(52,211,153,.2); color: #34d399; }
.status-banner.error   { background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.2); color: #f87171; }
.empty-state { padding: 2rem 0; text-align: center; color: var(--text-muted); font-size: .78rem; }

/* TOKENS PAGE */
.tokens-wrap { max-width: 1280px; margin: 0.3rem auto; padding: 0 1rem; }
.token-row { display: flex; align-items: center; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.token-row:last-child { border-bottom: none; }
.token-avatar { width: 2rem; height: 2rem; border-radius: 9999px; background: rgba(255,187,0,.1); border: 1px solid rgba(255,187,0,.2); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .65rem; color: var(--gold); flex-shrink: 0; }
.token-info { flex: 1; min-width: 0; }
.token-name-row { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.token-name { font-size: .85rem; font-weight: 600; color: var(--text-primary); }
.badge { display: inline-block; padding: .1rem .4rem; border-radius: .25rem; font-size: .6rem; font-weight: 600; }
.badge-gold { background: rgba(255,187,0,.1); border: 1px solid rgba(255,187,0,.22); color: var(--gold); }
.badge-default { background: var(--surface-3); border: 1px solid var(--border); color: var(--text-muted); }
.token-addr { font-size: .68rem; color: var(--text-muted); margin-top: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
.token-actions { display: flex; align-items: center; gap: .2rem; opacity: 0; transition: opacity .15s; }
.token-row:hover .token-actions { opacity: 1; }
.icon-btn { padding: .35rem; border-radius: .25rem; background: transparent; border: none; cursor: pointer; color: var(--text-muted); transition: color .15s, background .15s; display: flex; align-items: center; }
.icon-btn:hover { color: var(--gold); background: rgba(255,187,0,.08); }
.icon-btn.danger:hover { color: #f87171; background: rgba(248,113,113,.08); }
.import-row { display: flex; gap: .5rem; margin-bottom: .75rem; }
.import-input { flex: 1; background: var(--surface-0); border: 1px solid var(--border); border-radius: .375rem; padding: .55rem .9rem; color: var(--text-primary); font-size: .82rem; outline: none; transition: border-color .15s; }
.import-input::placeholder { color: var(--text-muted); }
.import-input:focus { border-color: var(--gold); }
.import-btn { display: flex; align-items: center; justify-content: center; padding: .55rem .9rem; background: var(--surface-3); border: 1px solid var(--border); border-radius: .375rem; color: var(--text-secondary); cursor: pointer; transition: all .15s; }
.import-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.import-btn:disabled { opacity: .4; cursor: not-allowed; }
.refresh-btn { display: flex; align-items: center; gap: .35rem; padding: .35rem .75rem; border: 1px solid var(--border); border-radius: .375rem; background: transparent; color: var(--text-muted); font-size: .72rem; cursor: pointer; transition: all .15s; }
.refresh-btn:hover { border-color: var(--border-hover); color: var(--text-secondary); }
.refresh-btn:disabled { opacity: .4; cursor: not-allowed; }
.spinning { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Hide scrollbar utility */
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* MODAL */
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 1000; align-items: center; justify-content: center; background: rgba(0,0,0,.75); }
.modal-overlay.open { display: flex; }
.modal-box { background: #111; border: 1px solid #d4a017; border-radius: 1rem; padding: 2rem; width: 90%; max-width: 480px; color: #e5e5e5; max-height: 90vh; overflow-y: auto; }
.modal-box h2 { color: #d4a017; font-size: 1.25rem; font-weight: 700; margin-bottom: 1.2rem; }
.field-group { margin-bottom: 1rem; }
.field-group label { display: block; color: #d4a017; font-size: .75rem; font-weight: 600; margin-bottom: .3rem; }
.field-group input { width: 100%; background: #1a1a1a; border: 1px solid #333; border-radius: .4rem; padding: .45rem .75rem; color: #e5e5e5; font-size: .9rem; outline: none; transition: border-color .15s; }
.field-group input:focus { border-color: #d4a017; }
.hint { font-size: .72rem; color: #666; margin-top: .25rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.info-label { color: #d4a017; font-size: .72rem; font-weight: 600; margin-bottom: .2rem; }
.info-label.spaced { margin-top: .8rem; }
.info-val { font-size: .82rem; color: #aaa; word-break: break-all; margin: 0 0 .6rem; }
.status-badge { display: inline-block; padding: 3px 12px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.status-badge.pending { background: #333; color: #aaa; }
.status-badge.signing { background: #1a1a00; color: #eab308; }
.status-badge.mining  { background: #001a1a; color: #06b6d4; }
.status-badge.success { background: #001a00; color: #22c55e; }
.status-badge.error   { background: #1a0000; color: #ef4444; }
#progress-bar-wrap { width: 100%; background: #222; border-radius: 99px; height: 5px; margin-top: .75rem; display: none; }
#progress-bar { height: 5px; border-radius: 99px; background: linear-gradient(90deg,#ffd873,#e6a400); width: 0%; transition: width .4s ease; }
#tx-section { margin-top: 1rem; display: none; }
.text-link { text-decoration: underline; }
.modal-btns { display: flex; gap: .75rem; margin-top: 1.5rem; }
.modal-deploy-btn { flex: 1; border-radius: 8px; padding: .55rem 1rem; }

/* FOOTER */
.page-footer { border-top: 1px solid var(--border); margin-top: auto; color: var(--text-muted); }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 1.5rem 1rem; font-size: .8rem; color: var(--text-muted); display: flex; justify-content: space-between; }
/* .page-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    border-top: 1px solid var(--border);
    background: var(--bg);
    z-index: 1500;  
} */

/* ═══════════════════════════════════════
   RESPONSIVE — MOBILE FIXES
═══════════════════════════════════════ */

/* ── Header: fix fixed margin-left on actions ── */
@media (max-width: 900px) {
  .header-actions { margin-left: auto; }
  .nav-bar { margin-left: 1rem; }
}

/* ── Mobile (<= 768px) ── */
@media (max-width: 768px) {

  /* Header */
  .page-header { margin: .5rem .5rem 0; border-radius: .75rem; min-height: auto; }
  .header-inner { flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: .75rem 1rem; min-height: auto; }
  .brand { align-items: center; }

  .nav-bar { margin-left: 0; width: 60%; font-size:2rem; justify-content: center; flex-wrap: wrap; gap: .35rem; }
  .nav-link { padding: .35rem .9rem; font-size: .82rem; }
  .header-actions { margin-left: 0; justify-content: center; width: 100%; }

  /* Page main */
  .page-main { padding: 0 .5rem; }
  .manage-wrap { padding: 0 .5rem; }
  .tokens-wrap { padding: 0 .5rem; }

  /* Checklist grids → single column */
  .cl-grid-2 { grid-template-columns: 1fr; }
  .cl-grid-3 { grid-template-columns: 1fr; }
  .cl-grid-social { grid-template-columns: 1fr; }
  .checklist-wrap { padding: .75rem 1rem 2rem; }
  .checklist-heading { font-size: 1.2rem; }

  /* Manage page */
  .token-info-grid { grid-template-columns: 1fr 1fr; }
  .action-tabs { flex-wrap: wrap; }
  .action-tab { flex: 1; justify-content: center; }

  /* Token list — address truncation */
  .token-addr { max-width: calc(100vw - 140px); }

  /* Token actions always visible on mobile (no hover) */
  .token-actions { opacity: 1; }

  /* Modal */
  .modal-box { padding: 1.25rem; width: 95%; }
  .two-col { grid-template-columns: 1fr; }

  /* Deploy button full width on mobile */
  .deploy-section { padding: 0 .5rem .5rem; }
  .btn-deploy { width: 40%; padding: .4rem 1rem; justify-content: center; }

  /* Card */
  .card { padding: 1rem; border-radius: 10px; }
}

/* ── Very small screens (<= 400px) ── */
@media (max-width: 400px) {
  .nav-link { padding: .3rem .6rem; font-size: .75rem; }
  .brand-title { font-size: .95rem; }
  .token-info-grid { grid-template-columns: 1fr; }
}