:root {
  --bg: #0b0d11;
  --panel: #13161d;
  --panel-2: #171b23;
  --line: #242a35;
  --line-soft: #1c212a;
  --text: #dde2ea;
  --muted: #7d8798;
  --dim: #5b6474;
  --accent: #4dd6c1;
  --accent-dim: #1d4a45;
  --up: #3ecf8e;
  --down: #f0616d;
  --warn: #e8b45c;
  /* Neo surfaces: raised things catch light top-left and drop shadow bottom-right;
     inset things do the reverse. One recipe, so every control reads as the same
     material. */
  --sh-card:  0 12px 28px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .055);
  --sh-tile:  4px 4px 11px rgba(0, 0, 0, .5), -3px -3px 8px rgba(255, 255, 255, .03);
  --sh-small: 3px 3px 8px rgba(0, 0, 0, .45), -2px -2px 6px rgba(255, 255, 255, .03);
  --sh-inset: inset 3px 3px 8px rgba(0, 0, 0, .5), inset -2px -2px 6px rgba(255, 255, 255, .025);
  --grad-card: linear-gradient(150deg, #191d24, #12151a);
  --grad-sunk: linear-gradient(145deg, #12151a, #1a1e26);
  --grad-raised: linear-gradient(145deg, #232833, #161a20);
  --grad-accent: linear-gradient(145deg, #6ee7d2, #2fb8a3);

  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* ---------- top bar ----------
   Glass bar, centred link cluster, gradient underline on the active item.
   Translucency is the whole point: the table scrolls under it and stays
   readable, so the bar cannot be an opaque slab. */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  letter-spacing: -0.011em;
  background: rgba(19, 22, 29, .58);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 14px 30px -6px rgba(0, 0, 0, .5);
}

.topbar-inner {
  position: relative;
  display: flex;
  align-items: center;
  height: 64px;
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  position: relative;
  z-index: 1;
}

.brand-mark { display: block; width: 24px; height: 24px; }

.brand-name { font-weight: 600; letter-spacing: .2px; font-size: 15.5px; }
.brand-name em { font-style: normal; color: var(--muted); font-weight: 400; }

/* Centred independently of the brand and the right cluster, so none of the
   three can push the others around. */
.nav {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  height: 64px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 64px;
  padding: 0 12px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  color: rgba(255, 255, 255, .45);
  transition: color .2s ease;
}

.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-link:hover { color: rgba(255, 255, 255, .9); }
.nav-link.on { color: #fff; }

/* Inset by the link's own padding on both sides, so the underline sits under
   icon+label rather than under the empty padding. */
.nav-link.on::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  border-radius: 9999px;
  background: linear-gradient(90deg, #7fe8d6, var(--accent));
  box-shadow: 0 0 16px -1px rgba(77, 214, 193, .75);
  transform-origin: left center;
  animation: navUnderline .3s cubic-bezier(.4, 0, .2, 1);
}

@keyframes navUnderline {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

.nav-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, .09);
  margin: 0 6px;
}

.topbar-right {
  margin-left: auto;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-right form { margin: 0; }

.nav-icon {
  position: relative;
  display: flex;
  align-items: center;
  height: 64px;
  color: rgba(255, 255, 255, .45);
  transition: color .2s ease;
}

.nav-icon svg { width: 18px; height: 18px; }
.nav-icon:hover { color: rgba(255, 255, 255, .9); }
.nav-icon.on { color: #fff; }

.nav-icon.on::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 9999px;
  background: linear-gradient(90deg, #7fe8d6, var(--accent));
  box-shadow: 0 0 16px -1px rgba(77, 214, 193, .75);
  transform-origin: left center;
  animation: navUnderline .3s cubic-bezier(.4, 0, .2, 1);
}

.btn-refresh {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .72);
}

.btn-refresh svg { width: 15px; height: 15px; }

.btn-refresh:hover {
  color: var(--accent);
  border-color: rgba(77, 214, 193, .35);
  background: rgba(77, 214, 193, .07);
}

/* Below this the centred cluster would collide with the brand, so it stops
   being centred and the bar becomes an ordinary scrolling row. */
@media (max-width: 1280px) {
  .topbar-inner { gap: 18px; overflow-x: auto; }
  .nav { position: static; transform: none; margin-right: auto; }
  .nav-link { padding: 0 9px; font-size: 14px; }
  .nav-link.on::after { left: 9px; right: 9px; }
  .nav-divider { margin: 0 2px; }
}

@media (max-width: 980px) {
  .nav-link span { display: none; }
  .nav-link { padding: 0 11px; }
  .nav-link.on::after { left: 11px; right: 11px; }
  .btn-refresh span { display: none; }
}

/* ---------- layout ---------- */

.page { padding: 24px 18px 40px; max-width: 1560px; margin: 0 auto; }

.page-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 18px;
}

.page-head h1 { font-size: 19px; font-weight: 600; margin: 0; letter-spacing: .2px; }
.page-head .sub { color: var(--muted); font-size: 13px; }

.grid { display: grid; gap: 14px; }
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.panel {
  background: var(--grad-card);
  border-radius: 22px;
  box-shadow: var(--sh-card);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.panel-body { padding: 6px 24px 22px; }

/* ---------- stat cards ---------- */

.card { background: var(--grad-card); border-radius: 18px; box-shadow: var(--sh-card); padding: 18px 20px; }
.card .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.card .value { font: 600 24px/1.2 var(--mono); margin-top: 7px; }
.card .hint { color: var(--dim); font-size: 12px; margin-top: 5px; }

/* ---------- strategy cards ---------- */

.strat-card .panel-body { padding-top: 20px; }
.strat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.strat-head h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); }
.strat-tags { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }

.strat-spark { height: 56px; margin: 16px 0; }
.strat-spark svg { width: 100%; height: 100%; display: block; }
.strat-spark-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  font-size: 12px;
  border-radius: 10px;
  background: var(--grad-sunk);
}

.strat-stats {
  display: flex;
  border-radius: 12px;
  background: var(--grad-sunk);
  box-shadow: var(--sh-inset);
  overflow: hidden;
  margin: 14px 0;
}
.strat-stat { flex: 1; padding: 11px 10px; text-align: center; border-right: 1px solid var(--line-soft); }
.strat-stat:last-child { border-right: none; }
.strat-stat .n { font: 600 15px var(--mono); }
.strat-stat .n.up { color: var(--up); }
.strat-stat .n.down { color: var(--down); }
.strat-stat .l { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }

.strat-params { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); margin: 12px 0 0; }
.strat-params b { color: var(--text); font-family: var(--mono); font-weight: 600; }

.strat-rules { margin-top: 12px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.strat-rules summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  list-style: none;
  font-weight: 500;
}
.strat-rules summary::-webkit-details-marker { display: none; }
.strat-rules summary::before { content: '▸ '; }
.strat-rules[open] summary::before { content: '▾ '; }
.strat-rules .rule-block { margin-top: 8px; font-size: 12.5px; color: var(--text); line-height: 1.5; white-space: pre-wrap; }

.strat-footer { margin-top: 14px; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

thead th {
  text-align: left;
  padding: 10px 14px;
  color: var(--muted);
  font-weight: 500;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .6px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
  background: rgba(255, 255, 255, .015);
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

tbody tr:hover td { background: rgba(255, 255, 255, .022); }
tbody tr:last-child td { border-bottom: 0; }

.num { font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.sym { font-family: var(--mono); font-weight: 600; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.up { color: var(--up); }
.down { color: var(--down); }

/* ---------- bits ---------- */

.tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.tag.long { color: var(--up); background: rgba(62, 207, 142, .1); border-color: rgba(62, 207, 142, .28); }
.tag.short { color: var(--down); background: rgba(240, 97, 109, .1); border-color: rgba(240, 97, 109, .28); }
.tag.flat { color: var(--muted); background: var(--panel-2); border-color: var(--line); }
.tag.ok { color: var(--up); background: rgba(62, 207, 142, .1); border-color: rgba(62, 207, 142, .28); }
.tag.error { color: var(--down); background: rgba(240, 97, 109, .1); border-color: rgba(240, 97, 109, .28); }

/* strength of the coil, drawn as a bar so the ranking reads at a glance */
.coilbar { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.coilbar .track { width: 74px; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; position: relative; }
.coilbar .fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.coilbar .fill.pos { left: 50%; background: var(--down); }
.coilbar .fill.neg { right: 50%; background: var(--up); }

.btn {
  font: 600 12.5px var(--sans);
  padding: 9px 16px;
  border: none;
  border-radius: 11px;
  background: var(--grad-raised);
  box-shadow: var(--sh-small);
  color: var(--text);
  cursor: pointer;
  transition: transform .09s ease, color .15s ease, filter .09s ease;
}

.btn:hover { color: var(--accent); }
.btn:active { transform: scale(.96); filter: brightness(.9); }

.btn-ghost { background: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { color: var(--accent); }

/* The one action per form that commits something. */
.btn-primary {
  background: var(--grad-accent);
  box-shadow: var(--sh-small);
  color: #06231f;
}

.btn-primary:hover { color: #06231f; filter: brightness(1.06); }

.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.field select, .field input, .field textarea {
  background: var(--grad-sunk);
  box-shadow: var(--sh-inset);
  border: none;
  color: var(--text);
  border-radius: 12px;
  padding: 11px 13px;
  font: 13.5px var(--sans);
  min-width: 130px;
}

.field textarea { resize: vertical; font-family: inherit; }

.field select:focus, .field input:focus, .field textarea:focus {
  outline: none;
  box-shadow: var(--sh-inset), inset 0 0 0 1px rgba(77, 214, 193, .45);
}

.field input::placeholder { color: var(--dim); }

.input-cell, textarea.input-cell {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 5px;
  padding: 4px 7px;
  font: 12.5px var(--mono);
  width: 88px;
}
.input-cell:focus { outline: none; border-color: var(--accent-dim); }
textarea.input-cell { width: 100%; min-width: 160px; resize: vertical; font-family: inherit; }

.note.error { color: var(--down); }

.empty { padding: 44px 16px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); margin-bottom: 6px; font-size: 15px; }

.note {
  border-left: 2px solid var(--accent-dim);
  padding: 10px 14px;
  color: var(--muted);
  font-size: 13px;
  background: var(--panel-2);
  border-radius: 0 8px 8px 0;
}

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--mono); }

.foot { padding: 0 20px 30px; color: var(--dim); font-size: 12px; }
.foot code { font-family: var(--mono); color: var(--muted); }


/* ---------- login ----------
   Standalone page: no bar, no card. A big mark, the fields, and nothing else
   competing with them. */

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
  letter-spacing: -0.012em;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #04060a 50%, #080b11 100%),
    var(--bg);
}

.login-glow {
  position: absolute;
  bottom: -140px;
  left: 50%;
  width: 560px;
  height: 320px;
  pointer-events: none;
  filter: blur(16px);
  background: radial-gradient(ellipse, rgba(77, 214, 193, .13) 0%, transparent 70%);
  animation: loginFloat 12s ease-in-out infinite;
}

@keyframes loginFloat {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, -16px); }
}

@media (prefers-reduced-motion: reduce) {
  .login-glow { animation: none; transform: translateX(-50%); }
}

/* Two equal spacers centre the block vertically while the footer stays pinned. */
.login-spacer { flex: 1; min-height: 24px; }

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 26px;
  z-index: 2;
}

.login-brand img { border-radius: 22px; display: block; margin-bottom: 16px; }

.login-wordmark {
  font-size: 39px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.login-wordmark em { font-style: normal; color: var(--muted); font-weight: 400; }

.login-form {
  width: 100%;
  max-width: 410px;
  padding: 0 32px;
  z-index: 2;
}

.login-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 8px;
}

/* Border and background sit on the WRAPPER, never the input: Chrome's autofill
   restyles the <input> itself, and with the frame here it cannot repaint the
   field into a white box. */
.login-field {
  position: relative;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .1);
  transition: border-color .18s ease;
}

.login-field:focus-within { border-color: rgba(77, 214, 193, .45); }

.login-field input {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 0 15px;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
}

.login-field input::placeholder { color: rgba(255, 255, 255, .3); }
.login-field input[type="password"],
.login-field input[type="text"]#password { padding-right: 46px; }

/* Chrome paints its own background on autofilled inputs and ignores
   `background: transparent`; only an inset shadow this large covers it. */
.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:hover,
.login-field input:-webkit-autofill:focus,
.login-field input:-webkit-autofill:active {
  -webkit-text-fill-color: #fff !important;
  caret-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px #12151c inset !important;
  box-shadow: 0 0 0 1000px #12151c inset !important;
  transition: background-color 9999s ease-in-out 0s;
}

.login-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, .35);
  transition: color .18s ease;
}

.login-eye:hover { color: rgba(255, 255, 255, .7); }
.login-eye svg { width: 18px; height: 18px; }

/* Only one eye at a time, switched by a class on the button. Not the `hidden`
   attribute: SVGElement has no `hidden` IDL property, so JS could never toggle
   it back, and the UA's `[hidden]{display:none}` is HTML-namespace only. */
.login-eye .eye-off { display: none; }
.login-eye.shown .eye-on { display: none; }
.login-eye.shown .eye-off { display: block; }

.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 13px;
  border-radius: 11px;
  font-size: 13px;
  color: #ff8a94;
  background: rgba(229, 4, 24, .26);
  border: 1px solid rgba(255, 92, 106, .28);
}

.login-error svg { width: 15px; height: 15px; flex-shrink: 0; }

.login-submit {
  width: 100%;
  height: 49px;
  margin-top: 4px;
  border: none;
  border-radius: 12px;
  font-size: 15.5px;
  font-weight: 600;
  font-family: inherit;
  color: #06231f;
  cursor: pointer;
  background: linear-gradient(140deg, #6ee7d2 0%, #2fb8a3 100%);
  transition: transform .12s ease, filter .12s ease;
}

.login-submit:hover { transform: translateY(-1px); filter: brightness(1.05); }
.login-submit:active { transform: translateY(0); }

.login-foot {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 15px;
  color: #fff;
}

.login-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent);
}

.login-foot-sub { color: rgba(255, 255, 255, .5); font-weight: 300; }

.empty a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(77, 214, 193, .35); }
.empty a:hover { border-bottom-color: var(--accent); }

/* ---------- profile ----------
   EdgeGuard's card language: soft raised panels, inset fields, a hero banner.
   Same shadow recipe, CoilDesk's teal instead of the violet. */

.profile { max-width: 712px; margin: 0 auto; }

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 28px 30px;
  background: linear-gradient(135deg, #16403c 0%, #14212a 55%, #101318 100%);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, .55),
    inset 0 1px 0 rgba(127, 232, 214, .22);
}

.hero-blob {
  position: absolute;
  top: -60px;
  right: -40px;
  width: 260px;
  height: 260px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(77, 214, 193, .32) 0%, transparent 70%);
}

.hero-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.hero-avatar {
  width: 82px;
  height: 82px;
  border-radius: 26px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
  color: #06231f;
  background: linear-gradient(145deg, #7fe8d6, #2fb8a3);
  box-shadow:
    8px 8px 24px rgba(0, 0, 0, .5),
    -4px -4px 14px rgba(255, 255, 255, .06),
    inset 0 1px 0 rgba(255, 255, 255, .28);
}

.hero-id { flex: 1; min-width: 220px; }
.hero-name { font-size: 24px; font-weight: 600; color: #fff; letter-spacing: -.02em; }

.hero-email {
  font-family: var(--mono);
  font-size: 13px;
  color: rgba(255, 255, 255, .6);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-chips { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: #d6f5ef;
}

.chip svg { width: 12px; height: 12px; }

.hero-signout { align-self: flex-start; margin: 0; }

.btn-signout {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 15px;
  border: none;
  border-radius: 13px;
  font: 600 12.5px var(--sans);
  white-space: nowrap;
  cursor: pointer;
  color: rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(8px);
  transition: transform .09s ease, background .15s ease;
}

.btn-signout svg { width: 15px; height: 15px; }
.btn-signout:hover { background: rgba(255, 92, 106, .28); }
.btn-signout:active { transform: scale(.94); }

.pcards { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }

.pcard {
  border-radius: 22px;
  padding: 24px;
  background: linear-gradient(150deg, #191d24, #12151a);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, .5),
    inset 0 1px 0 rgba(255, 255, 255, .055);
}

.pcard-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }

.pcard-tile {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .62);
  background: linear-gradient(145deg, #232833, #161a20);
  box-shadow: 4px 4px 11px rgba(0, 0, 0, .5), -3px -3px 8px rgba(255, 255, 255, .03);
}

.pcard-tile svg { width: 18px; height: 18px; }
.pcard-title { font-size: 15px; font-weight: 600; color: #fff; }
.pcard-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.plabel {
  display: block;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 9px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .42);
}

/* Inset, so a field reads as carved into the card rather than sitting on it. */
.pinput {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 15px;
  font: 14px var(--sans);
  color: #eef2f7;
  border: none;
  border-radius: 14px;
  outline: none;
  background: linear-gradient(145deg, #12151a, #1a1e26);
  box-shadow:
    inset 3px 3px 8px rgba(0, 0, 0, .5),
    inset -2px -2px 6px rgba(255, 255, 255, .025);
}

.pinput:focus { box-shadow: inset 0 0 0 1px rgba(77, 214, 193, .45); }
.pinput-locked { color: var(--muted); cursor: not-allowed; }
select.pinput { appearance: none; cursor: pointer; }

.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* ---------- setup wizard: category cards + repeatable criteria rows ---------- */

.cat-cards { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.cat-card {
  flex: 1;
  min-width: 140px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--grad-raised);
  box-shadow: var(--sh-small);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.cat-card input { accent-color: var(--accent); flex-shrink: 0; }
.cat-card:has(input:checked) {
  box-shadow: var(--sh-small), inset 0 0 0 1px var(--accent-dim);
  background: linear-gradient(145deg, rgba(77, 214, 193, .16), rgba(77, 214, 193, .04));
  color: var(--text);
}

.crit-row { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 8px; }
.crit-row select.pinput { padding: 8px 10px; border-radius: 9px; font-size: 12.5px; }

.phint { font-size: 12px; color: var(--dim); margin: 9px 0 0; line-height: 1.5; }
.phint-warn { color: var(--warn); }

.pactions { display: flex; justify-content: flex-end; margin-top: 20px; }

.pbtn {
  padding: 13px 24px;
  border: none;
  border-radius: 15px;
  font: 600 13.5px var(--sans);
  color: #06231f;
  cursor: pointer;
  background: linear-gradient(145deg, #6ee7d2, #2fb8a3);
  transition: transform .09s ease, filter .09s ease;
}

.pbtn:hover { filter: brightness(1.05); }
.pbtn:active { transform: scale(.97); }

.pcard-ok {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  padding: 10px 14px;
  border-radius: 11px;
  font-size: 13px;
  color: var(--up);
  background: rgba(62, 207, 142, .1);
  border: 1px solid rgba(62, 207, 142, .28);
}

.pcard-ok svg { width: 15px; height: 15px; flex-shrink: 0; }

@media (max-width: 620px) {
  .pgrid { grid-template-columns: 1fr; }
  .hero { padding: 22px; }
}

/* Navbar sign-out is a plain text link, matching EdgeGuard's — the pill button
   belongs to the profile hero, and two of them on one page read as a mistake. */
.nav-signout {
  font: 12px var(--sans);
  color: rgba(255, 255, 255, .35);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color .15s ease;
}

.nav-signout:hover { color: #ff5c6a; }

/* appearance:none removes the native arrow, so draw one back. */
select.pinput {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d8798' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 13px;
}

/* Inline close/delete form inside a table row — has to stay on one line so the
   row height does not jump between open and closed trades. */
.row-form { display: flex; align-items: center; gap: 6px; margin: 0; }

.row-form input {
  width: 86px;
  padding: 7px 10px;
  font: 12px var(--mono);
  color: var(--text);
  background: var(--grad-sunk);
  box-shadow: var(--sh-inset);
  border: none;
  border-radius: 9px;
  outline: none;
}

.row-form input:focus { box-shadow: var(--sh-inset), inset 0 0 0 1px rgba(77, 214, 193, .45); }
.row-form .btn { padding: 6px 12px; font-size: 11.5px; }

.row-actions { display: flex; gap: 6px; white-space: nowrap; }

/* Sector rows carry editable text; the cells must not squeeze names to ellipsis. */
.input-cell { min-width: 72px; }

/* ---------- neo dropdown ----------
   Replaces <select> because the OS draws a native option list: its highlight
   colour and hard corners cannot be themed, so one control on every screen
   would look like it came from a different app. The real value lives in a
   hidden input, so forms submit exactly as before. */

.neo-select { position: relative; display: inline-block; min-width: 150px; }

.neo-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 11px 13px;
  border: none;
  border-radius: 12px;
  font: 13.5px var(--sans);
  text-align: left;
  color: var(--text);
  cursor: pointer;
  background: var(--grad-sunk);
  box-shadow: var(--sh-inset);
}

.neo-select-trigger:focus-visible { outline: none; box-shadow: var(--sh-inset), inset 0 0 0 1px rgba(77, 214, 193, .45); }
.neo-select-trigger .caret { flex-shrink: 0; width: 11px; height: 11px; color: var(--dim); transition: transform .2s ease; }
.neo-select.open .caret { transform: rotate(180deg); }
.neo-select-trigger .value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.neo-select-trigger .value.placeholder { color: var(--dim); }

/* Fixed, not absolute: these live inside rounded panels and scrollable table
   wrappers, both of which clip. Position is set from the trigger's rect on open. */
.neo-select-menu {
  position: fixed;
  z-index: 200;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 14px;
  background: var(--grad-raised);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .14) transparent;
}

.neo-select-menu::-webkit-scrollbar { width: 6px; }
.neo-select-menu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 3px; }

.neo-select-opt {
  display: block;
  width: 100%;
  padding: 9px 11px;
  margin-bottom: 2px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font: 13px var(--sans);
  text-align: left;
  white-space: nowrap;
  color: var(--text);
  cursor: pointer;
  transition: background .12s ease;
}

.neo-select-opt:hover { background: var(--accent-dim); }
.neo-select-opt[data-on="1"] { background: rgba(255, 255, 255, .07); font-weight: 600; }
.neo-select-opt[data-on="1"]:hover { background: var(--accent-dim); }

/* In a table cell the control has to match the row's density. */
.input-cell.neo-select { min-width: 0; display: block; }
.input-cell.neo-select .neo-select-trigger { padding: 7px 10px; font-size: 12.5px; border-radius: 9px; }

/* Timezone lists a few hundred zones — the trigger needs room for the label. */
.neo-select-wide { display: block; width: 100%; }
.neo-select-wide .neo-select-trigger { padding: 13px 15px; border-radius: 14px; font-size: 14px; }

/* Demo banner — warns without shouting, and carries its own way out. */
.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  padding: 16px 20px;
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(232, 180, 92, .12), rgba(232, 180, 92, .04));
  box-shadow: inset 0 0 0 1px rgba(232, 180, 92, .22);
}

.demo-banner strong { display: block; color: var(--warn); font-size: 13.5px; margin-bottom: 4px; }
.demo-banner span { color: var(--muted); font-size: 13px; }
.demo-banner code { font-family: var(--mono); color: var(--text); }
.demo-banner form { margin: 0; flex-shrink: 0; }

/* ---------- dialog ----------
   A real <dialog>, so Esc and the backdrop come from the browser rather than
   from hand-written focus trapping. */

.neo-dialog {
  width: min(560px, calc(100vw - 40px));
  padding: 26px 28px;
  border: none;
  border-radius: 22px;
  color: var(--text);
  background: var(--grad-card);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.neo-dialog::backdrop { background: rgba(4, 6, 10, .68); backdrop-filter: blur(3px); }
.neo-dialog h2 { margin: 0 0 10px; font-size: 17px; font-weight: 600; color: #fff; }
.neo-dialog code { font-family: var(--mono); color: var(--accent); font-size: 12.5px; }
.neo-dialog input[type="file"] { width: 100%; cursor: pointer; font-size: 13px; }
.neo-dialog input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 7px 13px;
  border: none;
  border-radius: 9px;
  font: 600 12px var(--sans);
  color: var(--text);
  background: var(--grad-raised);
  box-shadow: var(--sh-small);
  cursor: pointer;
}

.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* The shape of the file, shown rather than described. */
.sample-table { font-size: 12px; border-collapse: collapse; }
.sample-table th, .sample-table td { padding: 6px 12px; border: 1px solid var(--line); }
.sample-table th { background: rgba(255, 255, 255, .03); color: var(--muted); font-weight: 500; }
.sample-table td { font-family: var(--mono); }

/* Rows the importer could not use — visible, but never submittable. */
.row-error td { opacity: .55; }
.row-error .input-cell { box-shadow: var(--sh-inset), inset 0 0 0 1px rgba(240, 97, 109, .3); }
