* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #f7f8fa;
    --fg: #1a1a1a;
    --muted: #666;
    --accent: #2563eb;
    --border: #e5e7eb;
    --card: #ffffff;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    background-color: var(--bg);
    color: var(--fg);
    line-height: 1.7;
    min-height: 100vh;
}

a { color: var(--accent); }
a:hover { text-decoration: underline; }

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    z-index: 10;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    padding-bottom: 16px;
}
.logo {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--accent);
}
.logo span { color: var(--muted); margin-left: 6px; font-weight: 600; }
.site-nav { display: flex; gap: 20px; }
.site-nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
}
.site-nav a:hover { color: var(--accent); text-decoration: none; }

/* Wallet area */
.wallet-area { display: flex; align-items: center; gap: 10px; }
.wallet-address {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 13px;
    color: var(--muted);
    background: #f1f5f9;
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: 999px;
}

/* Buttons */
.btn {
    display: inline-block;
    font: inherit;
    font-size: 14px;
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover { filter: brightness(0.95); text-decoration: none; }
.btn-outline {
    background: #fff;
    color: var(--accent);
    border-color: var(--accent);
}
.btn-outline:hover { background: #eff6ff; text-decoration: none; }

/* Hero */
.hero {
    padding: 72px 0 32px;
    text-align: center;
}
.hero h1 {
    font-size: clamp(24px, 4vw, 36px);
    margin-bottom: 16px;
}
.lead {
    color: var(--muted);
    font-size: 15px;
}

/* Section */
.section { padding: 32px 0 64px; }
.section h2 {
    font-size: 22px;
    margin-bottom: 16px;
}

/* Audience / Benefits lists */
.audience-list,
.benefit-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}
.audience-list li,
.benefit-list li {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 18px;
    font-size: 15px;
    line-height: 1.6;
}
.audience-list li strong,
.benefit-list li strong {
    display: block;
    margin-bottom: 4px;
    color: var(--accent);
    font-size: 15px;
}

/* Table */
.table-wrap {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-x: auto;
}
.invoice-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}
.invoice-table th,
.invoice-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.invoice-table th {
    background: #fafafa;
    font-weight: 600;
    color: var(--muted);
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.invoice-table tbody tr:last-child td { border-bottom: none; }
.invoice-table td a {
    font-family: 'SFMono-Regular', Consolas, monospace;
}

/* Wallet gate (search is locked until a Solana wallet is connected) */
.wallet-gate {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 28px 24px;
    text-align: center;
}
.wallet-gate-msg {
    font-size: 15px;
    color: var(--fg);
    margin-bottom: 14px;
}
.wallet-gate .btn { font-size: 15px; padding: 10px 20px; }
.wallet-gate-note {
    margin-top: 12px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
}

/* Search */
.search-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.search-input {
    flex: 1;
    font: inherit;
    font-size: 15px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    outline: none;
}
.search-input:focus { border-color: var(--accent); }
.search-count { font-size: 13px; color: var(--muted); }
.search-empty {
    padding: 24px;
    color: var(--muted);
    background: var(--card);
    border-top: 1px solid var(--border);
}
.search-empty-msg {
    text-align: center;
    margin-bottom: 12px;
}
.add-entry {
    max-width: 720px;
    margin: 0 auto;
}
.add-entry .muted-note { margin-bottom: 8px; }
.add-entry-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.add-entry-form .search-input { flex: 1 1 200px; }
.add-entry-form .btn { flex-shrink: 0; }
.add-entry-error {
    color: #dc2626;
    font-size: 13px;
    margin-top: 8px;
}

/* Pager */
.search-loading {
    padding: 20px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    border-top: 1px solid var(--border);
}
.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    background: #fafafa;
}
.pager .btn { padding: 6px 12px; font-size: 13px; }
.pager .btn:disabled { opacity: 0.4; }
.pager-info { font-size: 13px; color: var(--muted); min-width: 90px; text-align: center; }

/* Sponsored */
.sponsored-section h2 { margin-bottom: 6px; }
.muted-note { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.sponsored-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}
.sponsored-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    color: var(--fg);
    text-decoration: none;
    transition: border-color 0.15s, transform 0.15s;
}
.sponsored-card:hover {
    border-color: var(--accent);
    text-decoration: none;
    transform: translateY(-1px);
}
.sp-logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: contain;
    background: #f1f5f9;
    flex-shrink: 0;
}
.sp-logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}
.sp-body { flex: 1; min-width: 0; }
.sp-company { font-weight: 700; font-size: 15px; }
.sp-tagline { color: var(--muted); font-size: 13px; }
.sp-tag {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 10px;
    color: var(--muted);
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 999px;
    letter-spacing: 0.5px;
}

/* Promote form */
.promote-steps {
    margin: 0 0 20px 20px;
    color: var(--muted);
    font-size: 14px;
}
.promote-steps li { margin-bottom: 4px; }
.nowrap { white-space: nowrap; }
.promo-form {
    display: grid;
    gap: 12px;
    max-width: 640px;
}
.promo-form label {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: var(--muted);
    gap: 4px;
}
.promo-form input {
    font: inherit;
    font-size: 15px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--fg);
    outline: none;
}
.promo-form input:focus { border-color: var(--accent); }
.required { color: #dc2626; }
.optional { color: var(--muted); }
.promo-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 4px;
}
.promo-status {
    font-size: 13px;
    color: var(--muted);
}
.promo-success {
    margin-top: 28px;
    padding: 20px;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: 10px;
}
.promo-success h3 { margin-bottom: 8px; color: #065f46; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; margin: 14px 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd code { font-family: 'SFMono-Regular', Consolas, monospace; word-break: break-all; }
.small-note { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* Wallet picker modal */
.wpm-overlay {
    position: fixed; inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    z-index: 9999;
    padding: 16px;
}
.wpm-panel {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 380px;
    padding: 24px 22px 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.wpm-title { font-size: 18px; margin-bottom: 6px; }
.wpm-sub { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.wpm-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.wpm-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: border-color 0.15s, background 0.15s;
}
.wpm-item:hover, .wpm-item:focus {
    border-color: var(--accent);
    background: #f8faff;
    outline: none;
}
.wpm-icon { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; background: #f1f5f9; flex-shrink: 0; }
.wpm-icon-placeholder { display: inline-block; }
.wpm-name { font-weight: 600; font-size: 15px; }
.wpm-cancel-row { display: flex; justify-content: flex-end; margin-top: 16px; }

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}
