/* =========================================================================
   DEAL VAULT PLATFORM — SHARED CYBER WEB SHELL
   Sidebar · top bar · Drive banner · glass tiles · tokens
   This file is the FOUNDATION for every page (dashboard, portfolio, entity,
   deal, diligence, permissions, settings). Page-specific CSS extends this.
   ========================================================================= */

/* -----------------------------------------------------------------------
   DARK THEME (default)
----------------------------------------------------------------------- */
:root, [data-theme="dark"] {
  /* backgrounds */
  --p-bg-0: #04060d;
  --p-bg-1: #080b18;
  --p-bg-2: #0d1224;
  --p-bg-3: #101a2f;

  /* electric blue palette (matches landing + AI Hub) */
  --p-cyan:      #93d2ff;
  --p-cyan-2:    #67baff;
  --p-cyan-3:    #38a0ff;
  --p-cyan-deep: #165ac8;
  --p-cyan-dim:  #1e50a0;

  /* on-cyan text — what goes on top of a cyan-filled button */
  --p-on-cyan:   #04102a;

  /* status colors */
  --p-iris:    #a6b8ff;
  --p-emerald: #7fe8c8;
  --p-gold:    #ffd79a;
  --p-rose:    #ffb7c9;
  --p-warn:    #ffb457;
  --p-danger:  #ff6b8f;

  /* text */
  --p-ink:   #f4f6ff;
  --p-ink-2: rgba(244,246,255,.72);
  --p-ink-3: rgba(244,246,255,.48);
  --p-ink-4: rgba(244,246,255,.28);

  /* hairlines — cyan-tinted */
  --p-hair:   rgba(147,210,255,.10);
  --p-hair-2: rgba(147,210,255,.20);
  --p-hair-3: rgba(147,210,255,.35);

  /* glass surface tokens (used by tiles + banner + rail) */
  --p-glass-1: rgba(12,20,42,.55);
  --p-glass-2: rgba(8,14,28,.55);
  --p-glass-strong-1: rgba(12,20,42,.85);
  --p-glass-strong-2: rgba(8,14,28,.85);
  --p-glass-mid-1: rgba(12,20,42,.65);
  --p-glass-mid-2: rgba(8,14,28,.60);

  /* rail specific */
  --p-rail-bg-1: rgba(8,14,28,.85);
  --p-rail-bg-2: rgba(4,8,18,.95);
  --p-rail-foot-fade: rgba(4,8,18,.6);

  /* topbar specific */
  --p-topbar-bg-1: rgba(8,14,28,.70);
  --p-topbar-bg-2: rgba(4,8,18,.60);

  /* inset highlights */
  --p-hl-strong: rgba(255,255,255,.15);
  --p-hl-soft:   rgba(255,255,255,.10);
  --p-hl-inner:  rgba(147,210,255,.14);

  /* text gradient for hero numbers */
  --p-value-gradient: linear-gradient(180deg, #fff, rgba(255,255,255,.65));

  /* button primary */
  --p-primary-shadow: 0 4px 14px rgba(56,160,255,.35);
  --p-primary-shadow-hover: 0 8px 22px rgba(56,160,255,.55);

  /* mesh backdrop opacity */
  --p-mesh-opacity: .55;

  /* layout */
  --p-rail-w: 240px;
  --p-top-h:  56px;

  /* type */
  --p-font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', system-ui, sans-serif;
  --p-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
}

/* -----------------------------------------------------------------------
   LIGHT THEME
   Pale off-white surface + saturated electric-blue accents. Keeps the
   Cyber Web signature (cyan hairlines, gradient mesh mark, blue CTAs)
   but on a bright background for daytime work.
----------------------------------------------------------------------- */
[data-theme="light"] {
  /* backgrounds — soft cool whites */
  --p-bg-0: #f2f6ff;
  --p-bg-1: #e8eef9;
  --p-bg-2: #dde6f5;
  --p-bg-3: #cdd8ee;

  /* electric blue palette — slightly deeper for contrast on light */
  --p-cyan:      #2680ff;
  --p-cyan-2:    #1e6de5;
  --p-cyan-3:    #165ac8;
  --p-cyan-deep: #0d3f9a;
  --p-cyan-dim:  #93b8f0;

  --p-on-cyan:   #ffffff;

  /* status colors — richer for contrast */
  --p-iris:    #4a5fd6;
  --p-emerald: #0d9670;
  --p-gold:    #b47800;
  --p-rose:    #d4436b;
  --p-warn:    #c56600;
  --p-danger:  #d63859;

  /* text */
  --p-ink:   #0b1327;
  --p-ink-2: rgba(11,19,39,.72);
  --p-ink-3: rgba(11,19,39,.55);
  --p-ink-4: rgba(11,19,39,.30);

  /* hairlines — cyan-tinted (slightly deeper) */
  --p-hair:   rgba(38,128,255,.14);
  --p-hair-2: rgba(38,128,255,.26);
  --p-hair-3: rgba(38,128,255,.42);

  /* glass surfaces — nearly-white with subtle blue tint */
  --p-glass-1: rgba(255,255,255,.72);
  --p-glass-2: rgba(248,251,255,.72);
  --p-glass-strong-1: rgba(255,255,255,.92);
  --p-glass-strong-2: rgba(248,251,255,.92);
  --p-glass-mid-1: rgba(255,255,255,.80);
  --p-glass-mid-2: rgba(248,251,255,.80);

  /* rail */
  --p-rail-bg-1: rgba(255,255,255,.85);
  --p-rail-bg-2: rgba(248,251,255,.90);
  --p-rail-foot-fade: rgba(240,245,255,.6);

  /* topbar */
  --p-topbar-bg-1: rgba(255,255,255,.75);
  --p-topbar-bg-2: rgba(248,251,255,.70);

  /* inset highlights — subtle on light */
  --p-hl-strong: rgba(255,255,255,.9);
  --p-hl-soft:   rgba(255,255,255,.6);
  --p-hl-inner:  rgba(38,128,255,.08);

  /* value-number gradient — deep-blue → ink */
  --p-value-gradient: linear-gradient(180deg, #0b1327 0%, rgba(11,19,39,.72) 100%);

  /* primary button shadow — softer on light */
  --p-primary-shadow: 0 4px 14px rgba(38,128,255,.28);
  --p-primary-shadow-hover: 0 8px 22px rgba(38,128,255,.42);

  /* mesh backdrop opacity — much dimmer on light so it stays background */
  --p-mesh-opacity: .18;
}

/* ============ RESET + BASE ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body.p-page {
  background: var(--p-bg-0);
  color: var(--p-ink);
  font-family: var(--p-font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;    /* app-shell scroll happens inside .p-main */
  opacity: .985;
}

body.p-page .p-app {
  opacity: .92;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .22s cubic-bezier(.16,1,.3,1), filter .18s ease;
  will-change: opacity, transform;
}
body.p-page.p-ready .p-app {
  opacity: 1;
  transform: none;
}
body.p-page.p-leaving .p-app {
  opacity: .82;
  transform: translateY(4px) scale(.995);
  filter: saturate(.96);
  pointer-events: none;
}
body.p-page.p-leaving .p-topbar,
body.p-page.p-leaving .p-rail,
body.p-page.p-leaving .p-main {
  cursor: progress;
}

/* Deep radial background — subtle */
body.p-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1100px 700px at 18% 20%, rgba(56,160,255,.05), transparent 60%),
    radial-gradient(900px 600px at 88% 84%, rgba(56,160,255,.03), transparent 60%),
    linear-gradient(180deg, var(--p-bg-0) 0%, var(--p-bg-1) 100%);
  pointer-events: none;
  z-index: 0;
}
[data-theme="light"] body.p-page::before {
  background:
    radial-gradient(1100px 700px at 18% 20%, rgba(38,128,255,.08), transparent 60%),
    radial-gradient(900px 600px at 88% 84%, rgba(38,128,255,.04), transparent 60%),
    linear-gradient(180deg, var(--p-bg-0) 0%, var(--p-bg-1) 100%);
}

/* Static mesh backdrop canvas */
.p-mesh {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  opacity: var(--p-mesh-opacity);
  transition: opacity .4s ease;
}
[data-theme="light"] .p-mesh { mix-blend-mode: multiply; }

/* ============ APP GRID ============ */
.p-app {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: var(--p-rail-w) 1fr;
  grid-template-rows: var(--p-top-h) 1fr;
  height: 100vh;
  width: 100vw;
}

.p-app .p-rail    { grid-column: 1; grid-row: 1 / 3; }
.p-app .p-topbar  { grid-column: 2; grid-row: 1; }
.p-app .p-main    { grid-column: 2; grid-row: 2; overflow-y: auto; overflow-x: hidden; }

/* ============ SIDEBAR ============ */
.p-rail {
  background: linear-gradient(180deg, var(--p-rail-bg-1) 0%, var(--p-rail-bg-2) 100%);
  border-right: 1px solid var(--p-hair);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 20;
}

/* Brand block */
.p-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--p-hair);
  text-decoration: none;
  color: var(--p-ink);
  flex-shrink: 0;
}
.p-brand .mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 35% 30%, #fff, var(--p-cyan) 40%, var(--p-cyan-deep));
  display: grid;
  place-items: center;
  color: var(--p-on-cyan);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -.02em;
  box-shadow: 0 0 12px rgba(38,128,255,.35);
  flex-shrink: 0;
}
.p-brand .name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.1;
}
.p-brand .sub {
  font-size: 9px;
  color: var(--p-ink-3);
  font-family: var(--p-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  margin-top: 2px;
  display: block;
}

/* Nav */
.p-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(147,210,255,.14) transparent;
}
.p-nav::-webkit-scrollbar { width: 6px }
.p-nav::-webkit-scrollbar-thumb { background: rgba(147,210,255,.14); border-radius: 3px }

.p-sect {
  padding: 14px 10px 6px;
  font-family: var(--p-mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--p-ink-3);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.p-sect::before {
  content: "▸";
  color: var(--p-cyan);
  font-size: 10px;
}

.p-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--p-ink-2);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: -.005em;
  transition: all .18s ease;
  cursor: pointer;
}
.p-link .ic {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--p-hl-inner);
  border: 1px solid transparent;
  display: grid;
  place-items: center;
  color: var(--p-ink-3);
  font-size: 11px;
  flex-shrink: 0;
  transition: all .18s ease;
}
.p-link .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-link .n {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--p-hl-inner);
  color: var(--p-cyan);
  font-family: var(--p-mono);
  font-size: 9.5px;
  font-weight: 600;
}
.p-link:hover { background: var(--p-hl-inner); color: var(--p-ink) }
.p-link:hover .ic { border-color: var(--p-hair-2); color: var(--p-cyan-2) }
.p-link.active {
  background: var(--p-hl-inner);
  color: var(--p-ink);
}
.p-link.active .ic {
  background: rgba(56,160,255,.16);
  border-color: var(--p-cyan);
  color: var(--p-cyan);
  box-shadow: 0 0 10px rgba(56,160,255,.25);
}
/* Active state — left scanline */
.p-link.active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: var(--p-cyan);
  box-shadow: 0 0 8px var(--p-cyan);
}

/* Entity list rows (companies, deals in sidebar) */
.p-erow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--p-ink-2);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: -.005em;
  transition: all .15s ease;
  cursor: pointer;
}
.p-erow .av {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-family: var(--p-mono);
  font-size: 8.5px;
  font-weight: 700;
  color: var(--p-on-cyan);
  flex-shrink: 0;
}
.p-erow .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.p-erow .tag {
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--p-mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: color-mix(in oklab, var(--p-emerald) 14%, transparent);
  color: var(--p-emerald);
  border: 1px solid color-mix(in oklab, var(--p-emerald) 28%, transparent);
}
.p-erow .tag.warn    { background: color-mix(in oklab, var(--p-warn) 14%, transparent);   color: var(--p-warn);   border-color: color-mix(in oklab, var(--p-warn) 28%, transparent); }
.p-erow .tag.danger  { background: color-mix(in oklab, var(--p-danger) 14%, transparent); color: var(--p-danger); border-color: color-mix(in oklab, var(--p-danger) 28%, transparent); }
.p-erow:hover { background: var(--p-hl-inner); color: var(--p-ink) }

/* Sidebar footer (user) */
.p-rail-foot {
  padding: 10px 12px;
  border-top: 1px solid var(--p-hair);
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, transparent, var(--p-rail-foot-fade));
  flex-shrink: 0;
}
.p-rail-foot .av {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--p-cyan-3), var(--p-cyan-deep));
  color: #fff;
  font-family: var(--p-mono);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
}
.p-rail-foot .av::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--p-emerald);
  border: 2px solid var(--p-bg-1);
  box-shadow: 0 0 4px var(--p-emerald);
}
.p-rail-foot .info { flex: 1; min-width: 0; }
.p-rail-foot .n {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--p-ink);
  letter-spacing: -.005em;
  line-height: 1.1;
}
.p-rail-foot .e {
  font-size: 10.5px;
  color: var(--p-ink-3);
  font-family: var(--p-mono);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.p-rail-foot .out {
  background: transparent;
  border: 0;
  color: var(--p-ink-3);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all .15s ease;
}
.p-rail-foot .out:hover { color: var(--p-cyan); background: var(--p-hl-inner) }

/* ============ TOP BAR ============ */
.p-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  border-bottom: 1px solid var(--p-hair);
  background: linear-gradient(180deg, var(--p-topbar-bg-1) 0%, var(--p-topbar-bg-2) 100%);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  position: relative;
  z-index: 10;
}
/* subtle cyan bottom-scanline */
.p-topbar::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--p-hair-3), transparent);
  pointer-events: none;
}

.p-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--p-ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.p-title .diamond {
  color: var(--p-cyan);
  font-size: 10px;
}

.p-topbar .spacer { flex: 1; }

.p-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--p-hl-inner);
  border: 1px solid var(--p-hair);
  color: var(--p-ink-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 13px;
  transition: all .18s ease;
  position: relative;
}
.p-icon-btn:hover { color: var(--p-ink); border-color: var(--p-hair-2); background: var(--p-hair) }
.p-icon-btn .dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--p-cyan);
  box-shadow: 0 0 6px var(--p-cyan);
}

.p-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -.005em;
  cursor: pointer;
  text-decoration: none;
  transition: all .18s cubic-bezier(.16,1,.3,1);
  font-family: inherit;
  border: 1px solid transparent;
  white-space: nowrap;
}
.p-btn i { font-size: 11px; }

.p-btn.ghost {
  background: var(--p-hl-inner);
  border-color: var(--p-hair-2);
  color: var(--p-cyan);
}
.p-btn.ghost:hover { background: var(--p-hair); border-color: var(--p-cyan); color: var(--p-ink) }

.p-btn.primary {
  background: linear-gradient(180deg, var(--p-cyan-3), var(--p-cyan-deep));
  color: var(--p-on-cyan);
  font-weight: 600;
  border-color: var(--p-hair-3);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.35),
    var(--p-primary-shadow);
}
.p-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.4),
    var(--p-primary-shadow-hover);
}

/* ============ MAIN CONTENT ============ */
.p-main {
  padding: 24px 24px 60px;
  scrollbar-width: thin;
  scrollbar-color: rgba(147,210,255,.14) transparent;
}
.p-main::-webkit-scrollbar { width: 8px }
.p-main::-webkit-scrollbar-thumb { background: rgba(147,210,255,.14); border-radius: 4px }

.p-inner {
  max-width: 1440px;
  margin: 0 auto;
}

/* ============ Drive banner ============ */
.p-drive-banner {
  position: relative;
  padding: 18px 20px 18px 22px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, var(--p-glass-strong-1) 0%, var(--p-glass-strong-2) 100%);
  border: 1px solid var(--p-hair-2);
  overflow: hidden;
  margin-bottom: 20px;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}
.p-drive-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--p-cyan), transparent);
  pointer-events: none;
}
.p-drive-banner .head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}
.p-drive-banner .cloud {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: color-mix(in oklab, var(--p-cyan) 16%, transparent);
  border: 1px solid var(--p-hair-2);
  display: grid;
  place-items: center;
  color: var(--p-cyan);
  font-size: 16px;
  flex-shrink: 0;
}
.p-drive-banner .title-block { flex: 1; }
.p-drive-banner h3 {
  margin: 0 0 4px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--p-ink);
  letter-spacing: -.015em;
}
.p-drive-banner p {
  margin: 0;
  font-size: 12.5px;
  color: var(--p-ink-2);
  line-height: 1.45;
}
.p-drive-banner .close {
  background: transparent;
  border: 0;
  color: var(--p-ink-3);
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
  transition: color .15s ease;
}
.p-drive-banner .close:hover { color: var(--p-ink) }

.p-drive-folders {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.p-drive-folder {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--p-hl-inner);
  border: 1px solid var(--p-hair);
  transition: all .15s ease;
  cursor: pointer;
}
.p-drive-folder:hover { border-color: var(--p-hair-2); background: var(--p-hair) }
.p-drive-folder input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--p-hair-2);
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: all .15s ease;
  flex-shrink: 0;
}
.p-drive-folder input[type="checkbox"]:checked {
  background: var(--p-cyan-3);
  border-color: var(--p-cyan);
}
.p-drive-folder input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--p-on-cyan);
  font-size: 12px;
  font-weight: 700;
}
.p-drive-folder .folder-ic {
  color: var(--p-cyan-2);
  font-size: 13px;
}
.p-drive-folder .folder-name {
  flex: 1;
  font-size: 13px;
  color: var(--p-ink);
  font-weight: 500;
}
.p-drive-folder .folder-id {
  font-family: var(--p-mono);
  font-size: 10px;
  color: var(--p-ink-3);
  letter-spacing: .04em;
}

.p-drive-banner .foot {
  display: flex;
  align-items: center;
  gap: 12px;
}
.p-drive-banner .hint {
  flex: 1;
  font-size: 11.5px;
  color: var(--p-ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.p-drive-banner .hint::before {
  content: "◆";
  color: var(--p-cyan);
  font-size: 8px;
}

/* ============ Status chip (Drive proxy OK) ============ */
.p-status-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.p-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--p-emerald) 12%, transparent);
  border: 1px solid color-mix(in oklab, var(--p-emerald) 30%, transparent);
  font-size: 11.5px;
  color: var(--p-emerald);
  font-weight: 500;
  letter-spacing: -.005em;
}
.p-status-chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  animation: pPulse 2s ease-in-out infinite;
}
@keyframes pPulse { 0%,100% { opacity: .55 } 50% { opacity: 1 } }
.p-status-chip .meta {
  color: var(--p-ink-3);
  font-family: var(--p-mono);
  font-size: 10.5px;
}
.p-status-link {
  color: var(--p-ink-2);
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color .15s ease;
}
.p-status-link:hover { color: var(--p-cyan) }
.p-status-link i { font-size: 10px }

/* ============ Section headings ============ */
.p-h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--p-ink);
  letter-spacing: -.025em;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.p-h2 .diamond {
  color: var(--p-cyan);
  font-size: 12px;
  filter: drop-shadow(0 0 6px currentColor);
}
.p-h2 .link {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--p-cyan);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color .15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.p-h2 .link:hover { color: var(--p-ink) }

/* ============ Generic glass tile ============ */
.p-tile {
  position: relative;
  padding: 18px 18px 16px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, var(--p-glass-1) 0%, var(--p-glass-2) 100%);
  border: 1px solid var(--p-hair);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  transition: all .28s cubic-bezier(.16,1,.3,1);
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.p-tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--p-hair-3), transparent);
  transition: opacity .3s ease;
  pointer-events: none;
}
.p-tile:hover {
  border-color: var(--p-hair-2);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 var(--p-hl-inner),
    0 20px 40px rgba(0,0,0,.20),
    0 0 30px rgba(56,160,255,.15);
}
.p-tile:hover::before { background: linear-gradient(90deg, transparent, var(--p-cyan), transparent); }

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  :root { --p-rail-w: 220px; }
  .p-main { padding: 20px 20px 40px; }
}
@media (max-width: 900px) {
  .p-app {
    grid-template-columns: 60px 1fr;
  }
  .p-rail .p-brand .name,
  .p-rail .p-brand .sub,
  .p-rail .p-link .lbl,
  .p-rail .p-link .n,
  .p-rail .p-erow .name,
  .p-rail .p-erow .tag,
  .p-rail .p-sect,
  .p-rail-foot .info,
  .p-rail-foot .out { display: none; }
  .p-rail .p-link { justify-content: center; padding: 9px 6px; }
  .p-rail .p-erow { justify-content: center; padding: 6px; }
  .p-brand { padding: 12px 6px; justify-content: center; }
  .p-rail-foot { justify-content: center; padding: 10px 6px; }
}
@media (max-width: 640px) {
  .p-topbar { padding: 0 12px; gap: 8px; }
  .p-title { font-size: 14px; }
  .p-btn { padding: 7px 10px; font-size: 11.5px; }
  .p-btn i { font-size: 10px; }
  .p-btn .lbl { display: none; }
}
