:root {
    color-scheme: dark;
    --bg: #111827;
    --panel: #1f2937;
    --panel-2: #182131;
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .14);
    --text: #e5e7eb;
    --muted: #9ca3af;
    --blue: #3b82f6;
    --cyan: #facc15;
    --green: #4ade80;
    --yellow: #facc15;
    --red: #f87171;
    --radius: 16px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--text); line-height: 1.5; background: radial-gradient(circle at top, rgba(59, 130, 246, .12), transparent 38%), radial-gradient(circle at 85% 20%, rgba(250, 204, 21, .08), transparent 30%), var(--bg); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--panel); }
::-webkit-scrollbar-thumb { border-radius: 4px; background: #374151; }
::-webkit-scrollbar-thumb:hover { background: #4b5563; }

.site-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; min-height: 80px; padding: 0 max(1rem, calc((100vw - 1240px) / 2)); border-bottom: 1px solid rgba(255, 255, 255, .06); background: rgba(17, 24, 39, .84); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.brand em { color: var(--cyan); font-style: normal; }
.brand b { padding: 4px 8px; border: 1px solid rgba(74, 222, 128, .3); border-radius: 999px; color: var(--green); background: rgba(74, 222, 128, .1); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.version-pill { padding: 5px 8px; border: 1px solid rgba(250, 204, 21, .28); border-radius: 999px; color: var(--yellow); background: rgba(250, 204, 21, .08); font-size: 10px; letter-spacing: .09em; text-transform: uppercase; }
nav { display: flex; align-items: center; gap: 18px; }
nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
nav a:hover { color: var(--text); }
.tools-label-short { display: none; }
#connect-wallet { display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; padding: 8px 20px; color: #fff; background: var(--blue); box-shadow: 0 8px 24px rgba(59, 130, 246, .2); font-weight: 500; transition: background .2s ease, border-color .2s ease, transform .2s ease; }
#connect-wallet svg { flex: none; width: 20px; height: 20px; }
#connect-wallet:hover { background: #60a5fa; transform: translateY(-1px); }
#connect-wallet.bg-dark-card { border-color: #374151; background: var(--panel); box-shadow: none; }
.ac-wallet-dot { width: 8px; height: 8px; border-radius: 999px; background: #22c55e; }

main { width: min(1240px, calc(100% - 2rem)); margin: 0 auto; }
.hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr); align-items: end; gap: 60px; padding: 64px 0 42px; }
.eyebrow { margin: 0 0 10px; color: var(--cyan); font-size: 11px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
h1 { max-width: 900px; margin: 0; color: #fff; font-size: clamp(40px, 5vw, 64px); line-height: 1.02; letter-spacing: -.04em; }
h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.hero-copy { max-width: 760px; margin: 25px 0 0; color: var(--muted); font-size: 18px; line-height: 1.7; }
.safety-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); }
.safety-grid div { padding: 18px; background: rgba(31, 41, 55, .86); }
.safety-grid dt { margin-bottom: 7px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.safety-grid dd { margin: 0; font-size: 14px; font-weight: 700; }

#status-banner { margin-bottom: 22px; padding: 14px 17px; border: 1px solid rgba(59, 130, 246, .35); border-radius: 12px; color: #bfdbfe; background: rgba(59, 130, 246, .1); }
#status-banner[data-kind="success"] { border-color: rgba(74, 222, 128, .35); color: #bbf7d0; background: rgba(74, 222, 128, .1); }
#status-banner[data-kind="error"] { border-color: rgba(248, 113, 113, .4); color: #fecaca; background: rgba(248, 113, 113, .1); }
.claim-panel { display: flex; align-items: center; justify-content: space-between; gap: 26px; margin-bottom: 24px; padding: 24px; border: 1px solid rgba(250, 204, 21, .3); border-radius: var(--radius); background: linear-gradient(105deg, rgba(250, 204, 21, .09), rgba(59, 130, 246, .08)); }
.claim-panel p:last-child { margin-bottom: 0; color: var(--muted); }
.claim-actions, .modal-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.workspace { display: grid; grid-template-columns: minmax(560px, 600px) minmax(0, 1fr); gap: 24px; align-items: start; }
.creator-panel, .dashboard-panel { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(31, 41, 55, .72); box-shadow: 0 18px 44px rgba(0, 0, 0, .22); backdrop-filter: blur(10px); }
.creator-panel { position: sticky; top: 94px; overflow: hidden; }
.dashboard-panel { min-height: 720px; padding-bottom: 20px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px; border-bottom: 1px solid var(--line); }
.dashboard-heading { align-items: flex-end; }
.dashboard-heading p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.dashboard-controls { display: flex; gap: 8px; }

form { padding: 0 24px 24px; }
fieldset { min-width: 0; margin: 0; padding: 23px 0; border: 0; border-bottom: 1px solid var(--line); }
legend { margin-bottom: 17px; color: var(--text); font-size: 14px; font-weight: 800; }
label { display: block; margin: 15px 0 7px; color: #d1d5db; font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #374151; border-radius: 8px; outline: 0; padding: 11px 12px; color: var(--text); background: var(--bg); }
#coin-type, #token-amount, #unlock-frequency { width: min(100%, 420px); }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59, 130, 246, .14); }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two-columns > * { min-width: 0; }
.two-columns input, .two-columns select { min-width: 0; }
.field-help, .input-note { display: block; margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
#token-preview[data-kind="loading"] { color: #bfdbfe; }
#token-preview[data-kind="ok"] { color: #86efac; }
#token-preview[data-kind="error"] { color: #fca5a5; }
.trigger-fields { margin-top: 14px; padding: 0 15px 15px; border: 1px solid rgba(59, 130, 246, .22); border-radius: 12px; background: rgba(17, 24, 39, .48); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented label { margin: 0; }
.segmented input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); text-align: center; }
.segmented input:checked + span { border-color: var(--blue); color: #fff; background: rgba(59, 130, 246, .18); }
.check-row { display: flex; gap: 12px; margin: 22px 0; }
.check-row input { width: auto; margin-top: 4px; }
.check-row strong, .check-row small { display: block; }
.check-row small { margin-top: 4px; color: var(--muted); font-weight: 400; line-height: 1.4; }
.notice { margin: 16px 24px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(17, 24, 39, .48); font-size: 12px; line-height: 1.5; }
.notice.warning { border-color: rgba(250, 204, 21, .3); color: #fde68a; background: rgba(250, 204, 21, .08); }

.button, .small-button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-weight: 750; transition: background .2s ease, border-color .2s ease, transform .2s ease; }
.button { min-height: 40px; padding: 9px 14px; }
.button.primary, .small-button.primary { border-color: transparent; color: #fff; background: var(--blue); box-shadow: 0 8px 24px rgba(59, 130, 246, .16); }
.button.primary:hover, .small-button.primary:hover { background: #60a5fa; transform: translateY(-1px); }
.button.secondary { color: var(--text); background: #374151; }
.button.secondary:hover { border-color: var(--line-strong); background: #4b5563; }
.button.full { width: 100%; }
.small-button { min-height: 34px; padding: 7px 10px; color: #d1d5db; background: #374151; font-size: 11px; }
.small-button.danger { border-color: rgba(248, 113, 113, .35); color: #fca5a5; background: rgba(248, 113, 113, .08); }

.schedule-list { display: grid; gap: 14px; padding: 20px; }
.schedule-card { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, rgba(31, 41, 55, .96), rgba(17, 24, 39, .9)); }
.schedule-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.schedule-head strong, .schedule-id { display: block; }
.schedule-head strong { font-size: 18px; }
.schedule-id { margin-top: 6px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.status { flex: none; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(145, 167, 184, .06); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.status-1 { border-color: rgba(74, 222, 128, .3); color: var(--green); background: rgba(74, 222, 128, .08); }
.status-0 { border-color: rgba(250, 204, 21, .3); color: var(--yellow); background: rgba(250, 204, 21, .08); }
.schedule-grid { display: grid; grid-template-columns: max-content 1fr max-content 1fr; gap: 8px 14px; margin: 20px 0; }
.schedule-grid dt { color: var(--muted); font-size: 11px; }
.schedule-grid dd { overflow: hidden; margin: 0; color: #e5e7eb; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.observation-note, .legacy-note { margin: 14px 0 0; padding: 10px 12px; border-radius: 9px; color: #bfdbfe; background: rgba(59, 130, 246, .08); font-size: 11px; line-height: 1.5; }
.legacy-note { color: #fde68a; background: rgba(250, 204, 21, .08); }
.schedule-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.empty-state { padding: 80px 24px; color: var(--muted); text-align: center; }

.details-section { display: grid; grid-template-columns: 320px 1fr; gap: 60px; padding: 90px 0; }
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.feature-grid article { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: rgba(31, 41, 55, .7); backdrop-filter: blur(10px); }
.feature-grid h3 { margin: 0 0 10px; font-size: 15px; }
.feature-grid p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px clamp(20px, 5vw, 72px); border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

.modal { width: min(520px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 18px; color: var(--text); background: var(--panel); box-shadow: 0 30px 100px rgba(0, 0, 0, .5); }
.modal::backdrop { background: rgba(17, 24, 39, .82); backdrop-filter: blur(8px); }
.modal-card { padding: 26px; }
.modal-card p { color: var(--muted); line-height: 1.6; }
.ac-wallet-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .72); }
.ac-wallet-dialog { width: 100%; max-width: 448px; border: 1px solid #374151; border-radius: 16px; padding: 20px; background: var(--panel); box-shadow: 0 24px 70px rgba(0, 0, 0, .45); }
.ac-wallet-dialog-title { margin: 0; color: #fff; font-size: 18px; font-weight: 700; }
.ac-wallet-dialog-copy { margin: 4px 0 16px; color: var(--muted); font-size: 14px; }
.ac-wallet-choice-list { display: grid; gap: 8px; }
.ac-wallet-choice, .ac-wallet-cancel { width: 100%; border: 1px solid #4b5563; border-radius: 10px; padding: 12px 16px; color: #fff; background: transparent; text-align: left; transition: border-color .18s, background .18s; }
.ac-wallet-choice:hover { border-color: var(--blue); background: rgba(59, 130, 246, .08); }
.ac-wallet-cancel { margin-top: 8px; color: var(--muted); text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
[hidden] { display: none !important; }

@media (max-width: 1050px) {
    .hero { grid-template-columns: 1fr; gap: 28px; }
    .workspace { grid-template-columns: 1fr; }
    .creator-panel { position: static; }
    .details-section { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 680px) {
    main { width: min(100% - 24px, 1240px); }
    .site-header { padding: 0 12px; }
    .site-header nav > a { display: none; }
    .site-header nav > .tools-portal-link { display: inline-flex; }
    .tools-label-full { display: none; }
    .tools-label-short { display: inline; }
    .site-header nav { gap: 10px; }
    .site-header .brand b { display: none; }
    #connect-wallet { padding-inline: 12px; }
    .brand { font-size: 16px; }
    .hero { padding-top: 48px; }
    .safety-grid, .feature-grid { grid-template-columns: 1fr; }
    .two-columns { grid-template-columns: 1fr; gap: 0; }
    .dashboard-heading, .claim-panel { align-items: stretch; flex-direction: column; }
    .dashboard-controls { flex-direction: column; }
    .schedule-grid { grid-template-columns: max-content 1fr; }
    footer { flex-direction: column; }
}
