/* =====================================================================
   NitidAI - Design System
   ===================================================================== */

:root {
  --bg: #0a0e17;
  --bg-soft: #0f1526;
  --surface: #131a2e;
  --surface-2: #1a2340;
  --border: #232c4a;
  --text: #eef1fb;
  --text-muted: #9aa4c4;
  --text-dim: #6c76a0;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-gradient: linear-gradient(135deg, #7c5cff 0%, #22d3ee 100%);
  --success: #2ee6a8;
  --danger: #ff5c7a;
  --warning: #ffb84d;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 20px 60px -20px rgba(0,0,0,.6);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px circle at 15% -10%, rgba(124,92,255,.25), transparent 60%),
    radial-gradient(500px circle at 90% 10%, rgba(34,211,238,.15), transparent 55%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; font-weight: 700; letter-spacing: -0.02em; }
p { color: var(--text-muted); margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Navbar ---------- */
.topbar-accent {
  position: sticky; top: 0; z-index: 51; height: 3px; width: 100%;
  background: var(--accent-gradient);
}
.navbar {
  position: sticky;
  top: 3px;
  z-index: 50;
  background: rgba(10,14,23,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-gradient);
  box-shadow: 0 0 0 1px rgba(124,92,255,.35), 0 6px 16px -4px rgba(124,92,255,.6);
  display: grid; place-items: center; color: #fff; font-size: 1rem;
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.55), transparent 60%);
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--text-muted); font-weight: 600; font-size: .95rem; transition: color .15s; padding: 26px 0; border-bottom: 2px solid transparent; }
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); border-bottom-color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.5rem; cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, opacity .15s ease, background .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent-gradient); color: #fff; box-shadow: 0 10px 30px -10px rgba(124,92,255,.6); }
.btn-primary:hover { opacity: .92; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface); }
.btn-outline { background: transparent; color: var(--accent-2); border-color: var(--accent-2); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 64px; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--border); color: var(--accent-2); font-size: .8rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; margin-bottom: 24px;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); max-width: 780px; margin: 0 auto .4em; }
.hero h1 span { background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.15rem; max-width: 620px; margin: 0 auto 2em; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.hero-note { color: var(--text-dim); font-size: .85rem; }

/* ---------- Hero v2 (home) ---------- */
.new-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 16px 6px 6px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-size: .82rem; color: var(--text-muted); margin-bottom: 28px;
  transition: border-color .15s;
}
.new-pill:hover { border-color: var(--accent); color: var(--text); }
.new-pill .new-tag {
  background: var(--accent-gradient); color: #fff; font-weight: 800; font-size: .66rem;
  padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em;
}
.new-pill .arrow { color: var(--accent-2); }

.hero-v2 { padding: 76px 0 40px; }
.hero-v2-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.hero-v2-content h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.1rem); text-align: left; margin: 0 0 34px; max-width: 560px;
}
.hero-v2-content h1 span { background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

.feature-row { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.feature-row .feature-icon {
  flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 1.15rem;
}
.feature-row strong { display: block; margin-bottom: 2px; font-size: .98rem; }
.feature-row p { margin: 0; font-size: .88rem; }

.btn-lg { padding: 15px 30px; font-size: 1rem; margin-top: 10px; }
.hero-v2-content .hero-note { margin-top: 16px; }

.hero-v2-drop {
  position: relative; aspect-ratio: 1; max-width: 400px; margin: 0 auto; display: grid; place-items: center;
  border-radius: 50%;
}
.hero-v2-drop .ring { position: absolute; border: 1px solid var(--border); border-radius: 50%; transition: border-color .2s; }
.hero-v2-drop .ring-1 { inset: 0; }
.hero-v2-drop .ring-2 { inset: 16%; }
.hero-v2-drop .ring-3 { inset: 32%; background: var(--surface); }
.hero-v2-drop:hover .ring-1, .hero-v2-drop:hover .ring-2 { border-color: rgba(124,92,255,.5); }
.hero-v2-drop .drop-content { position: relative; z-index: 1; text-align: center; padding: 0 30px; }
.hero-v2-drop .drop-icon { display: block; font-size: 2.2rem; margin-bottom: 10px; }
.hero-v2-drop .drop-text { font-size: .9rem; color: var(--text-muted); }
.hero-v2-drop .drop-text span { color: var(--accent-2); font-weight: 700; }

@media (max-width: 860px) {
  .hero-v2-grid { grid-template-columns: 1fr; }
  .hero-v2-content h1 { text-align: center; margin-left: auto; margin-right: auto; }
  .hero-v2-content { text-align: center; }
  .feature-row { text-align: left; }
  .hero-v2-drop { max-width: 280px; }
}

/* ---------- Before/After ---------- */
#showcase .compare { margin-top: 0; }
.compare {
  position: relative; max-width: 880px; margin: 56px auto 0;
  border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow); aspect-ratio: 16/9; background: var(--surface);
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; user-select: none; }
.compare .after-wrap { position: absolute; inset: 0; clip-path: inset(0 0 0 50%); }
.compare .divider {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.2); transform: translateX(-50%); pointer-events: none;
}
.compare .handle {
  position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; border-radius: 50%;
  background: #fff; color: #0a0e17; display: grid; place-items: center; transform: translate(-50%,-50%);
  box-shadow: 0 8px 20px rgba(0,0,0,.35); pointer-events: none; font-size: 1.1rem;
}
.compare input[type="range"] {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0;
  cursor: ew-resize; appearance: none;
}
.compare .tag { position: absolute; top: 14px; padding: 5px 12px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: rgba(10,14,23,.75); backdrop-filter: blur(4px); }
.compare .tag-before { left: 14px; }
.compare .tag-after { right: 14px; }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 52px; }
.section-head h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }

.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px;
}
.feature-card .icon {
  width: 46px; height: 46px; border-radius: 12px; background: var(--surface-2);
  display: grid; place-items: center; font-size: 1.3rem; margin-bottom: 18px;
}
.feature-card h3 { font-size: 1.1rem; }
.feature-card p { margin: 0; font-size: .92rem; }

.steps { counter-reset: step; }
.step { display: flex; gap: 18px; align-items: flex-start; }
.step .num {
  counter-increment: step; flex: none; width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent-gradient); color: #fff; font-weight: 800; display: grid; place-items: center;
}

/* ---------- Pricing ---------- */
.pricing-toggle { display: flex; justify-content: center; margin-bottom: 40px; color: var(--text-dim); font-size: .9rem; }
.plan-card { display: flex; flex-direction: column; position: relative; }
.plan-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.plan-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--accent-gradient); color: #fff; font-size: .72rem; font-weight: 800;
  padding: 5px 14px; border-radius: 999px; letter-spacing: .03em;
}
.plan-name { font-size: 1.1rem; margin-bottom: 4px; }
.plan-price { font-size: 2.4rem; font-weight: 800; margin: 10px 0 2px; }
.plan-price small { font-size: 1rem; color: var(--text-dim); font-weight: 500; }
.plan-desc { font-size: .88rem; min-height: 40px; }
.plan-features { list-style: none; padding: 0; margin: 20px 0 28px; display: flex; flex-direction: column; gap: 12px; }
.plan-features li { display: flex; gap: 10px; font-size: .9rem; color: var(--text); }
.plan-features li .check { color: var(--success); flex: none; }

/* ---------- Auth forms ---------- */
.auth-wrap { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: 60px 20px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.6rem; text-align: center; }
.auth-card > p.lead { text-align: center; margin-bottom: 28px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
.field input, .field select {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text); font-size: .95rem; font-family: var(--font);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.auth-foot { text-align: center; margin-top: 20px; font-size: .9rem; color: var(--text-muted); }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 18px; border: 1px solid transparent; }
.alert-error { background: rgba(255,92,122,.1); color: #ff8fa3; border-color: rgba(255,92,122,.3); }
.alert-success { background: rgba(46,230,168,.1); color: #6df3c8; border-color: rgba(46,230,168,.3); }

/* ---------- App shell (dashboard) ---------- */
.app-shell { display: flex; min-height: calc(100vh - 72px); }
.app-sidebar {
  width: 240px; flex: none; border-right: 1px solid var(--border); padding: 28px 16px; background: var(--bg-soft);
}
.app-sidebar a {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-weight: 600; font-size: .92rem; margin-bottom: 4px;
}
.app-sidebar a:hover { background: var(--surface); color: var(--text); }
.app-sidebar a.active { background: var(--surface-2); color: var(--text); }
.app-main { flex: 1; padding: 36px 40px; max-width: 1100px; }
.app-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 16px; }
.app-header h1 { font-size: 1.5rem; margin: 0; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 32px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.stat-card .label { font-size: .8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.stat-card .value { font-size: 1.7rem; font-weight: 800; }
.stat-card .value.accent { background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Uploader ---------- */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 48px 24px;
  text-align: center; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone.dragover { border-color: var(--accent); background: var(--surface-2); }
.dropzone .dz-icon { font-size: 2.2rem; margin-bottom: 12px; }
.dropzone input[type=file] { display: none; }

.mode-select { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0; }
.mode-chip {
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); font-size: .85rem; font-weight: 600; cursor: pointer;
}
.mode-chip input { display: none; }
.mode-chip.active { background: var(--accent-gradient); color: #fff; border-color: transparent; }

.result-panel { margin-top: 28px; }
.progress-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 18px 0; }
.progress-bar .fill { height: 100%; width: 0%; background: var(--accent-gradient); transition: width .3s; }

.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-top: 20px; }
.history-item { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); cursor: pointer; position: relative; }
.history-item .thumb { aspect-ratio: 1; overflow: hidden; background: var(--bg-soft); }
.history-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.history-item .meta { padding: 10px 12px; font-size: .78rem; color: var(--text-dim); display: flex; justify-content: space-between; align-items: center; }
.history-item .dims-line { padding: 0 12px 10px; font-size: .72rem; color: var(--text-dim); line-height: 1.5; }
.history-item .dl-btn {
  position: absolute; right: 10px; bottom: 46px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(10,14,23,.75); backdrop-filter: blur(4px); color: #fff; display: grid; place-items: center;
  font-size: .85rem; border: 1px solid rgba(255,255,255,.15);
}

/* ---------- Format badge (thumb overlay in queue) ---------- */
.format-badge { display: inline-block; margin-top: 4px; font-size: .65rem; font-weight: 800; letter-spacing: .03em; color: var(--text-dim); background: var(--surface-2); padding: 2px 7px; border-radius: 5px; }

.dz-link { color: var(--accent-2); font-weight: 700; cursor: pointer; }
.badge { padding: 3px 9px; border-radius: 999px; font-size: .7rem; font-weight: 700; }
.badge-completed { background: rgba(46,230,168,.15); color: var(--success); }
.badge-failed { background: rgba(255,92,122,.15); color: var(--danger); }
.badge-processing { background: rgba(255,184,77,.15); color: var(--warning); }

/* ---------- Credit pill (navbar) ---------- */
.credit-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(124,92,255,.16); border: 1px solid rgba(124,92,255,.4);
  font-size: .82rem; font-weight: 700; color: #cfc4ff;
  white-space: nowrap;
}
.credit-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); flex: none; }

/* ---------- Tool tabs (Operacoes / Predefinicoes) ---------- */
.tool-tabs { display: flex; gap: 24px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.tool-tab {
  background: none; border: 0; padding: 0 0 14px; color: var(--text-dim); font-weight: 700;
  font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tool-tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- Toggle switch ---------- */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider { position: absolute; inset: 0; background: var(--surface-2); border-radius: 999px; transition: .15s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + .slider { background: var(--accent-gradient); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:disabled + .slider { opacity: .45; cursor: not-allowed; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toggle-row .toggle-label { display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 700; }

/* ---------- Segmented control (tamanho / fator) ---------- */
.segmented { display: flex; gap: 6px; flex-wrap: wrap; }
.segmented button {
  flex: 1; min-width: 44px; padding: 9px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text-muted); font-weight: 700; font-size: .82rem; cursor: pointer;
}
.segmented button.active { background: var(--accent-gradient); color: #fff; border-color: transparent; }
.segmented button:disabled { opacity: .4; cursor: not-allowed; }

.advanced-toggle {
  display: block; width: 100%; text-align: center; background: none; border: 0; color: var(--text-dim);
  font-size: .78rem; font-weight: 700; cursor: pointer; padding: 10px 0; text-transform: uppercase; letter-spacing: .04em;
}
.advanced-toggle:hover { color: var(--text); }
.advanced-panel { font-size: .82rem; color: var(--text-muted); padding: 4px 2px 14px; }

/* ---------- Tool shell (aprimorador de imagens) ---------- */
.tool-shell { display: flex; gap: 28px; align-items: flex-start; padding: 32px 0 64px; }
.tool-main { flex: 1; min-width: 0; }
.tool-sidebar { width: 320px; flex: none; position: sticky; top: 92px; }
.tool-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.tool-toolbar h1 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); margin: 0; font-weight: 700; }
.tool-toolbar-actions { display: flex; align-items: center; gap: 14px; }
.tool-toolbar-actions button { background: none; border: 0; color: var(--text-muted); cursor: pointer; font-size: .85rem; }
.tool-toolbar-actions button:hover { color: var(--text); }

.signup-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px 20px; border-radius: var(--radius); margin: 18px 0;
  background: linear-gradient(135deg, rgba(124,92,255,.15), rgba(34,211,238,.1));
  border: 1px solid rgba(124,92,255,.35);
}

/* ---------- Queue table ---------- */
.queue-table { width: 100%; border-collapse: collapse; margin-top: 22px; font-size: .88rem; }
.queue-table th { text-align: left; color: var(--text-dim); font-weight: 700; text-transform: uppercase; font-size: .7rem; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.queue-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.queue-table tr:last-child td { border-bottom: none; }
.queue-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--bg-soft); flex: none; }
.queue-name { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.queue-dims { color: var(--text-dim); font-size: .8rem; }
.queue-remove { background: none; border: 0; color: var(--text-dim); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.queue-remove:hover { color: var(--danger); }
.queue-download { color: var(--accent-2); font-weight: 700; font-size: .82rem; }

/* ---------- Operations sidebar ---------- */
.op-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.op-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; gap: 10px; }
.op-card-head strong { font-size: .9rem; }
.op-card p.hint { font-size: .78rem; margin: 4px 0 0; }

.soon-badge { font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--text-dim); background: var(--surface-2); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }

.mode-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.mode-option {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-soft); cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--text-muted);
  transition: border-color .15s, color .15s, background .15s;
}
.mode-option input { display: none; }
.mode-option .lock { font-size: .68rem; color: var(--text-dim); font-weight: 700; }
.mode-option.active { border-color: var(--accent); color: var(--text); background: rgba(124,92,255,.1); }
.mode-option.locked { opacity: .65; }

/* ---------- Comparison modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(5,7,14,.75); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.modal-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; max-width: 760px; width: 100%; max-height: 90vh; overflow: auto; position: relative; }
.modal-close { position: absolute; top: 14px; right: 18px; background: none; border: 0; color: var(--text-dim); font-size: 1.6rem; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 48px 0; color: var(--text-dim); font-size: .85rem; }
footer .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .tool-shell { flex-direction: column; }
  .tool-sidebar { width: 100%; position: static; }
}
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stat-row { grid-template-columns: 1fr; }
  .app-shell { flex-direction: column; }
  .app-sidebar { width: 100%; display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .app-main { padding: 24px 20px; }
}
@media (max-width: 640px) {
  .nav-links { position: fixed; inset: 72px 0 0 0; background: var(--bg); flex-direction: column; padding: 24px; display: none; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
