@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --ink-900: #08090c;
  --ink-800: #0c0d10;
  --ink-750: #0f1216;
  --ink-700: #111318;
  --ink-500: #23262d;
  --ink-400: #2e333b;

  --text-strong: #f2f5fb;
  --text-1: #e9ecf2;
  --text-2: rgba(233,236,242,0.72);
  --text-3: rgba(233,236,242,0.55);
  --text-4: rgba(233,236,242,0.35);

  --line-1: rgba(255,255,255,0.08);
  --line-2: rgba(255,255,255,0.14);
  --fill-1: rgba(255,255,255,0.015);
  --fill-2: rgba(255,255,255,0.04);

  --ok: #3CBE78;
  --warn: #F3B63C;
  --danger: #ff6d6d;
  --purple: #8368E0;
  --purple-2: #9A82F0;
  --blue: #5C7CF2;
  --blue-2: #7E97F6;
  --film: #F17A5A;
  --sub: rgba(233,236,242,0.4);

  --font-sans: 'Space Grotesk', Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --r-sm: 9px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-pill: 999px;

  --shadow-sm: 0 8px 24px -12px rgba(0,0,0,0.5);
  --shadow-md: 0 30px 60px -20px rgba(0,0,0,0.7);
  --wash-top: radial-gradient(1200px 700px at 70% -10%, rgba(88,150,255,0.10), transparent 60%);
  --wash-bl: radial-gradient(900px 600px at 0% 100%, rgba(80,120,200,0.06), transparent 55%);

  --dur-fast: 120ms;
  --dur: 200ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink-900); }
body { font-family: var(--font-sans); color: var(--text-1); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.09); border-radius: var(--r-pill); }
::-webkit-scrollbar-track { background: transparent; }

@keyframes pm-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

#app { height: 100vh; min-height: 640px; }

.pm-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--wash-top), var(--wash-bl), var(--ink-900);
  overflow: hidden;
}

/* ---- Top bar ---- */
.pm-topbar {
  flex-shrink: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--line-1);
  background: rgba(11,13,17,0.6);
  backdrop-filter: blur(18px);
}
.pm-brand { display: flex; align-items: center; gap: 12px; }
.pm-logo {
  width: 34px; height: 34px; border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 6px 18px -6px rgba(124,108,224,0.7);
  flex-shrink: 0;
}
.pm-wordmark-box { display: flex; flex-direction: column; line-height: 1; }
.pm-wordmark { font-size: 16px; font-weight: 600; letter-spacing: -0.4px; }
.pm-wordmark span { background: linear-gradient(90deg,#9A82F0,#7E97F6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pm-tagline { font-family: var(--font-mono); font-size: 9px; letter-spacing: 2.5px; color: var(--text-4); margin-top: 3px; }
.pm-topbar-right { display: flex; align-items: center; gap: 14px; }
.pm-status { display: flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 11px; color: var(--ok); white-space: nowrap; }
.pm-status.pm-status-off { color: var(--danger); }
.pm-status-dot { width: 7px; height: 7px; border-radius: var(--r-pill); background: currentColor; box-shadow: 0 0 8px currentColor; }

/* ---- Body layout ---- */
.pm-body { flex: 1; display: flex; min-height: 0; }

/* ---- Explorer (left) ---- */
.pm-explorer { width: 460px; flex-shrink: 0; border-right: 1px solid var(--line-1); display: flex; flex-direction: column; background: rgba(12,13,16,0.5); min-height: 0; }
.pm-explorer-header { flex-shrink: 0; padding: 16px 18px 12px; display: flex; align-items: center; justify-content: space-between; }
.pm-explorer-kicker { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.5px; color: var(--text-3); }
.pm-explorer-count { font-family: var(--font-mono); font-size: 10px; color: var(--text-4); }

.pm-search-box { flex-shrink: 0; margin: 0 18px 12px; display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--fill-2); }
.pm-search-box svg { flex-shrink: 0; color: rgba(233,236,242,0.5); }
.pm-search-box input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-family: var(--font-sans); font-size: 13.5px; color: var(--text-1); }
.pm-search-box input::placeholder { color: var(--text-4); }
.pm-search-clear { display: flex; cursor: pointer; padding: 2px; border-radius: 6px; color: var(--text-3); }
.pm-search-clear:hover { background: var(--fill-2); color: var(--text-1); }


.pm-tree-scroll { flex: 1; overflow-y: auto; padding: 2px 10px 18px; min-height: 0; position: relative; }
.pm-tree-spacer { position: relative; width: 100%; }

.pm-row {
  position: absolute; left: 0; right: 0; height: 36px;
  display: flex; align-items: center; gap: 9px;
  padding-right: 10px; border-radius: var(--r-sm); cursor: pointer; user-select: none;
  transition: background var(--dur-fast) var(--ease);
  color: var(--text-2);
}
.pm-row:hover { background: var(--fill-2); }
.pm-row.pm-row-selected { background: rgba(124,108,224,0.16); box-shadow: inset 0 0 0 1px rgba(124,108,224,0.4); color: var(--text-strong); }
.pm-row-chevron { display: flex; flex-shrink: 0; transition: transform var(--dur-fast) var(--ease); color: var(--text-3); }
.pm-row-chevron.pm-open { transform: rotate(90deg); }
.pm-row-spacer { display: inline-block; width: 12px; flex-shrink: 0; }
.pm-row-icon { display: flex; flex-shrink: 0; }
.pm-row-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.pm-row-name.pm-weight-600 { font-weight: 600; }
.pm-row-name.pm-weight-400 { font-weight: 400; }
.pm-row-tag { font-family: var(--font-mono); font-size: 10px; color: var(--text-4); flex-shrink: 0; }
.pm-row-muted { cursor: default; color: var(--text-4); font-family: var(--font-mono); font-size: 11px; }
.pm-row-muted:hover { background: transparent; }

.pm-empty-state { padding: 34px 14px; text-align: center; color: var(--text-4); }
.pm-empty-state svg { margin-bottom: 10px; }
.pm-empty-state .pm-empty-title { font-size: 13.5px; color: var(--text-3); }
.pm-empty-state .pm-empty-query { font-family: var(--font-mono); font-size: 11px; margin-top: 5px; }

/* ---- Detail (right) ---- */
.pm-detail { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.pm-detail-inner { flex: 1; min-height: 0; display: flex; flex-direction: column; animation: pm-rise var(--dur) var(--ease); }
.pm-detail-placeholder { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-4); font-family: var(--font-mono); font-size: 13px; }

.pm-preview-top { flex: 1; min-height: 0; width: 100%; background: var(--ink-800); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pm-preview-top img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.pm-preview-top iframe { width: 100%; height: 100%; border: none; display: block; }

.pm-info-row { flex-shrink: 0; display: flex; align-items: center; gap: 16px; padding: 14px 22px; border-top: 1px solid var(--line-1); background: rgba(12,13,16,0.5); }
.pm-info-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; margin: 0; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-info-date { font-family: var(--font-mono); font-size: 11px; color: var(--text-4); flex-shrink: 0; white-space: nowrap; }

.pm-btn { display: flex; align-items: center; gap: 9px; height: 46px; padding: 0 22px; border-radius: 12px; cursor: pointer; font-family: var(--font-sans); font-size: 14px; font-weight: 600; text-decoration: none; border: none; flex-shrink: 0; }
.pm-btn-primary { color: #fff; background: linear-gradient(140deg,#8368E0,#5C7CF2); box-shadow: 0 12px 30px -10px rgba(124,108,224,0.7); }
.pm-btn-primary:hover { filter: brightness(1.08); }
.pm-btn-compact { height: 36px; padding: 0 16px; font-size: 13px; gap: 7px; border-radius: 9px; }

@media (max-width: 900px) {
  .pm-explorer { width: 340px; }
  .pm-info-title { font-size: 13px; }
}
