:root {
  --bg: #07070a;
  --ink: #f4f4f5;
  --ink-2: #a1a1aa;
  --ink-3: #71717a;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --glass: rgba(18, 18, 22, .66);
  --good: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }

body {
  background:
    radial-gradient(900px 500px at 70% -10%, rgba(255, 255, 255, .07), transparent 60%),
    radial-gradient(700px 400px at 0% 100%, rgba(120, 130, 170, .08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100vh;
  padding: 24px 16px 64px;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.boot { text-align: center; color: var(--ink-3); margin-top: 20vh; }

/* ---- faixa do modo demonstracao ---- */
.demo-bar {
  max-width: 1120px; margin: 0 auto 14px; padding: 10px 14px;
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline;
  border: 1px dashed rgba(251, 191, 36, .45); border-radius: 12px;
  background: rgba(251, 191, 36, .06); color: var(--ink-2); font-size: 13.5px;
}
.demo-bar b { color: var(--warn); font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; }

/* ---- moldura e vidro ---- */
.shell {
  position: relative; max-width: 1120px; margin: 0 auto; padding: 20px 20px 28px;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
}
.shell::before, .shell::after {
  content: ""; position: absolute; top: -3px; width: 7px; height: 7px; border: 1px solid rgba(255, 255, 255, .28);
}
.shell::before { left: -4px; }
.shell::after { right: -4px; }

.glass {
  position: relative; border-radius: 18px; padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .05) 40%, rgba(255, 255, 255, .08));
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8);
}
.glass > .in {
  border-radius: 17px; background: var(--glass); height: 100%;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}

.mono { font: 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }

/* ---- navegacao ---- */
.nav { max-width: 760px; margin: 0 auto 22px; border-radius: 999px; }
.nav > .in {
  border-radius: 999px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 12px 10px 20px; flex-wrap: wrap;
}
.brand { font-weight: 600; font-size: 14px; }
.brand small { font: 10px var(--mono); color: var(--ink-3); margin-left: 8px; letter-spacing: .1em; }
.nav-right { display: flex; gap: 6px; align-items: center; }
.pill {
  font-size: 13px; color: var(--ink-2); padding: 7px 14px; border-radius: 999px;
  border: 1px solid transparent; background: none;
}
.pill.on { color: var(--ink); background: rgba(255, 255, 255, .07); border-color: var(--line); }
button.pill:hover { color: var(--ink); }

/* ---- cabecalho da lista ---- */
.head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.sub { font-size: 13px; color: var(--ink-2); margin-top: 4px; }

.btn {
  font-weight: 500; font-size: 13px; border-radius: 999px; padding: 10px 18px;
  border: 1px solid var(--line-2); background: none; color: var(--ink);
}
.btn:hover { background: rgba(255, 255, 255, .06); }
.btn.main { background: var(--ink); color: #09090b; border-color: transparent; }
.btn.main:hover { background: #fff; }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: default; }

/* ---- cartoes ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card { padding: 18px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; }
.glass.clickable:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .08) 40%, rgba(255, 255, 255, .14)); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.name { font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }

.status {
  font-size: 12px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; white-space: nowrap;
}
.status i { font-style: normal; font-size: 11px; }
.status.good i { color: var(--good); }
.status.warn i { color: var(--warn); }
.badge {
  font: 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px;
}

.price { font-size: 30px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.price small { font-size: 12px; font-weight: 400; color: var(--ink-3); margin-left: 6px; letter-spacing: 0; }
.price.none { font-size: 18px; font-weight: 500; color: var(--ink-3); }

svg.spark { width: 100%; height: auto; display: block; overflow: visible; }
.spark-empty {
  height: 56px; display: grid; place-items: center; font-size: 12px; color: var(--ink-3);
  border: 1px dashed var(--line-2); border-radius: 8px;
}
.foot { display: flex; justify-content: space-between; font: 10px var(--mono); color: var(--ink-3); letter-spacing: .06em; }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.kv b { display: block; font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; margin-top: 3px; }

.add {
  min-height: 280px; border: 1px dashed rgba(255, 255, 255, .18); border-radius: 18px; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--ink-2); font-size: 14px;
}
.add span { font-size: 26px; color: var(--ink); }
.add:hover { border-color: rgba(255, 255, 255, .34); color: var(--ink); }

.empty { text-align: center; color: var(--ink-2); padding: 48px 12px; line-height: 1.6; }

/* ---- janela (modal) ---- */
.overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .66); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center; padding: 24px 12px; overflow-y: auto; z-index: 10;
}
.dialog { width: 100%; max-width: 600px; margin: auto; }
.dialog .in { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.dialog h2 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.field-label { display: block; }
.field {
  margin-top: 6px; width: 100%; background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 14px; font-size: 14px;
}
.field.url { font: 12px var(--mono); color: var(--ink-2); }
.field:focus { border-color: var(--line-2); }
.hint { margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.hint b { color: var(--ink); font-weight: 500; }
.link-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.link-row { display: flex; gap: 8px; }
.link-row .field { margin-top: 0; }
.x { border: 1px solid var(--line); background: none; border-radius: 12px; width: 42px; color: var(--ink-2); flex: none; }
.x:hover { color: var(--bad); border-color: var(--line-2); }
.linkbtn { font-size: 13px; color: var(--ink-2); background: none; border: 0; padding: 6px 0; text-align: left; }
.linkbtn:hover { color: var(--ink); }
.seg {
  margin-top: 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px;
  border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .03);
}
.seg button { font-weight: 500; font-size: 14px; color: var(--ink-2); background: none; border: 1px solid transparent; border-radius: 10px; padding: 10px; }
.seg button[aria-pressed="true"] { color: var(--ink); background: rgba(255, 255, 255, .08); border-color: var(--line-2); }
.actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.error { color: var(--bad); font-size: 13px; min-height: 1em; }

.section-title { margin-bottom: 8px; }
.offers { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.offer { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.offer:first-child { border-top: 0; }
.offer .t { font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.offer .t a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.offer .p { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.offer .m { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.offer .m .s { font-size: 12px; color: var(--ink-3); }
.muted { color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.refs { display: flex; flex-direction: column; gap: 6px; font: 12px var(--mono); }
.refs a { color: var(--ink-2); overflow-wrap: anywhere; }

/* ---- login ---- */
.login { max-width: 380px; margin: 14vh auto 0; }
.login .in { padding: 28px; display: flex; flex-direction: column; gap: 18px; }

/* ---- aviso ---- */
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(24, 24, 28, .96); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 10px 18px; font-size: 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, .6);
}
.toast.bad { border-color: rgba(248, 113, 113, .5); }

@media (max-width: 560px) {
  .shell { padding: 14px 0 24px; border: 0; }
  .shell::before, .shell::after { display: none; }
  .dialog .in { padding: 18px; }
}
@media (prefers-reduced-motion: no-preference) {
  .glass { transition: background .15s; }
}

.warn-text { color: var(--warn); }
