:root {
  --bg: #12100d; --surface: #1c1812; --text: #eee4d3; --accent: #6fe3c0;
  --border: #322c22; --radius: 10px; --font: ui-monospace, "SF Mono", Consolas, monospace;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f4ecd8; --surface: #fffaf0; --text: #2b241a; --border: #ddd0b0; }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); }
img { max-width: 100%; }
[hidden] { display: none !important; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 1.2rem 4rem; }
.top-nav {
  position: sticky; top: 0; z-index: 5; background: var(--bg);
  display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; gap: 1rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 1.05rem; }
.brand canvas { image-rendering: pixelated; width: 26px; height: 26px; }
.cta { background: var(--accent); color: #0b0f0c; padding: 0.5rem 1rem; border-radius: 999px; text-decoration: none; font-size: 0.85rem; font-weight: 600; }

.hero { text-align: center; padding: 3rem 0 2rem; }
.hero-sprite canvas { image-rendering: pixelated; width: 96px; height: 96px; }
.hero h1 { font-size: 2rem; line-height: 1.3; margin: 1rem 0; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 1rem; opacity: 0.85; max-width: 620px; margin: 0 auto 1.6rem; }
.hero-ctas { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }
.btn-hero { padding: 0.7rem 1.3rem; border-radius: 999px; text-decoration: none; font-weight: 600; border: 1px solid var(--border); }
.btn-hero.primary { background: var(--accent); color: #0b0f0c; border-color: var(--accent); }
.btn-hero.secondary { color: var(--text); }

h2.section-title { text-align: center; font-size: 1.3rem; margin: 3rem 0 0.5rem; }
p.section-sub { text-align: center; opacity: 0.7; max-width: 560px; margin: 0 auto 1.6rem; font-size: 0.9rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; }
.feature-card h3 { margin: 0 0 0.4rem; font-size: 0.95rem; color: var(--accent); }
.feature-card p { margin: 0; font-size: 0.82rem; opacity: 0.85; line-height: 1.5; }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1rem; }
.price-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; }
.price-card.featured { border-color: var(--accent); }
.price-card .plan-name { font-weight: 600; }
.price-card .plan-price { font-size: 1.5rem; font-weight: 700; margin: 0.3rem 0; }
.price-card ul { margin: 0.5rem 0 0; padding-left: 1.1rem; font-size: 0.8rem; opacity: 0.85; line-height: 1.6; }

footer { text-align: center; font-size: 0.75rem; opacity: 0.55; margin-top: 3rem; }

/* --- Auth form -------------------------------------------------------- */
.auth-box { max-width: 360px; margin: 2rem auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.auth-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.auth-tab { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 0.45rem; opacity: 0.7; cursor: pointer; font-family: inherit; color: var(--text); }
.auth-tab.active { opacity: 1; border-color: var(--accent); color: var(--accent); }
.auth-form { display: flex; flex-direction: column; gap: 0.6rem; }
.auth-form input { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.8rem; color: var(--text); font-size: 16px; font-family: inherit; }
.auth-form button[type=submit] { background: var(--accent); color: var(--bg); border: none; border-radius: 8px; padding: 0.65rem; font-weight: 600; cursor: pointer; }
.auth-error { color: #e88; font-size: 0.8rem; min-height: 1.1em; margin: 0; }

/* --- App shell ---------------------------------------------------------- */
#app-shell { max-width: 1100px; margin: 0 auto; padding: 0 1rem 3rem; }
.app-header { display: flex; align-items: center; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.app-tabs { display: flex; gap: 0.4rem; flex: 1; flex-wrap: wrap; }
.app-tab { background: none; border: 1px solid transparent; color: var(--text); opacity: 0.65; cursor: pointer; font-family: inherit; font-size: 0.88rem; padding: 0.45rem 0.85rem; border-radius: 999px; }
.app-tab.active { opacity: 1; background: var(--surface); border-color: var(--border); color: var(--accent); }
.plan-badge { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0.2rem 0.6rem; opacity: 0.8; }
.btn { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 0.5rem 0.9rem; font-family: inherit; font-size: 0.85rem; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); color: #0b0f0c; border-color: var(--accent); font-weight: 600; }
.btn-danger { color: #e88; }

.panel { padding: 1.5rem 0; }
.field-group { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.7rem; }
.field-group label { font-size: 0.75rem; opacity: 0.7; display: flex; flex-direction: column; gap: 0.3rem; }
.field-group input, .field-group textarea, .field-group select {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0.55rem 0.7rem; color: var(--text); font-family: inherit; font-size: 0.9rem;
}
.field-group label input, .field-group label textarea, .field-group label select { font-size: 0.9rem; opacity: 1; }
.form-row { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.form-row .field-group { flex: 1; min-width: 160px; }

.card-list { display: flex; flex-direction: column; gap: 0.6rem; }
.item-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.item-card .item-main { flex: 1; min-width: 180px; }
.item-card strong { display: block; }
.item-card .item-sub { font-size: 0.8rem; opacity: 0.65; }
.item-actions { display: flex; gap: 0.4rem; }

.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.8rem; align-items: start; }
.pipeline-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.7rem; min-height: 60px; }
.pipeline-col h4 { margin: 0 0 0.5rem; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.7; }
.deal-card { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.7rem; margin-bottom: 0.5rem; font-size: 0.85rem; }
.deal-card .deal-value { color: var(--accent); font-weight: 600; font-size: 0.8rem; }
.deal-card select { width: 100%; margin-top: 0.4rem; font-size: 0.72rem; }

.empty-msg { opacity: 0.6; font-size: 0.85rem; padding: 1rem 0; }
.task-row { display: flex; align-items: center; gap: 0.6rem; }
.task-row.done .task-title { text-decoration: line-through; opacity: 0.5; }
.task-title { flex: 1; }
.task-meta { font-size: 0.75rem; opacity: 0.6; }

#toast-region { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 0.4rem; z-index: 50; }
.toast { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0.6rem 1rem; font-size: 0.85rem; box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
