/* Prompt Hub PRO v8.0 – Top Tier Design System */

/* ── Theme Variables ── */
:root {
  --ph-bg: #f4f6fb;
  --ph-surface: #ffffff;
  --ph-surface-alt: #f0f2f7;
  --ph-surface-glass: rgba(255,255,255,.72);
  --ph-border: #e0e4ed;
  --ph-border-subtle: #eaecf2;
  --ph-text: #111827;
  --ph-text-mid: #374151;
  --ph-text-muted: #6b7280;
  --ph-accent: #6366f1;
  --ph-accent-hover: #4f46e5;
  --ph-accent-bg: #eef2ff;
  --ph-accent-text: #4338ca;
  --ph-accent-glow: rgba(99,102,241,.18);
  --ph-success: #10b981;
  --ph-success-bg: #ecfdf5;
  --ph-danger: #ef4444;
  --ph-gold: #f59e0b;
  --ph-gold-bg: #fffbeb;
  --ph-radius: 10px;
  --ph-radius-lg: 16px;
  --ph-radius-xl: 22px;
  --ph-shadow: 0 1px 3px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.04);
  --ph-shadow-lg: 0 12px 40px rgba(0,0,0,.08);
  --ph-shadow-glow: 0 0 24px var(--ph-accent-glow);
  --ph-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ph-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ph-transition: .18s ease;
  --ph-blur: blur(14px);
}

[data-ph-theme="dark"] {
  --ph-bg: #0f1117;
  --ph-surface: #1a1d27;
  --ph-surface-alt: #22252f;
  --ph-surface-glass: rgba(26,29,39,.82);
  --ph-border: #2d313d;
  --ph-border-subtle: #252832;
  --ph-text: #f1f3f7;
  --ph-text-mid: #c8ccd6;
  --ph-text-muted: #8b92a5;
  --ph-accent: #818cf8;
  --ph-accent-hover: #6366f1;
  --ph-accent-bg: rgba(129,140,248,.12);
  --ph-accent-text: #a5b4fc;
  --ph-accent-glow: rgba(129,140,248,.22);
  --ph-success-bg: rgba(16,185,129,.1);
  --ph-gold-bg: rgba(245,158,11,.1);
  --ph-shadow: 0 2px 6px rgba(0,0,0,.25);
  --ph-shadow-lg: 0 12px 40px rgba(0,0,0,.4);
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── Base ── */
.ph-app, .ph-single, .ph-form-wrap { font-family: var(--ph-font); color: var(--ph-text); line-height: 1.55; -webkit-font-smoothing: antialiased; }
.ph-app { max-width: 1280px; margin: 0 auto; padding: 24px 20px 56px; }
h1.entry-title { display: none; }

/* ── Inputs ── */
.ph-input, .ph-select, .ph-textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--ph-border); border-radius: var(--ph-radius);
  background: var(--ph-surface); font-size: 14px; font-family: var(--ph-font); color: var(--ph-text);
  transition: border-color var(--ph-transition), box-shadow var(--ph-transition); box-sizing: border-box;
}
.ph-input:focus, .ph-select:focus, .ph-textarea:focus { outline: none; border-color: var(--ph-accent); box-shadow: 0 0 0 3px var(--ph-accent-glow); }
.ph-textarea { resize: vertical; min-height: 80px; font-family: var(--ph-font); }
.ph-select { cursor: pointer; appearance: auto; }
.ph-select-sm { width: auto; padding: 6px 10px; font-size: 13px; }

/* ── Buttons ── */
.ph-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px;
  border: 1.5px solid var(--ph-border); border-radius: var(--ph-radius); background: var(--ph-surface);
  color: var(--ph-text); font-size: 13px; font-weight: 600; font-family: var(--ph-font); cursor: pointer;
  transition: all var(--ph-transition); text-decoration: none; line-height: 1.3; white-space: nowrap; user-select: none;
}
.ph-btn:hover { background: var(--ph-surface-alt); transform: translateY(-1px); }
.ph-btn:active { transform: translateY(0) scale(.98); }

.ph-btn-primary { background: var(--ph-accent); border-color: var(--ph-accent); color: #fff; box-shadow: 0 2px 10px var(--ph-accent-glow); }
.ph-btn-primary:hover { background: var(--ph-accent-hover); border-color: var(--ph-accent-hover); box-shadow: var(--ph-shadow-glow); }
.ph-btn-ghost { background: transparent; border-color: transparent; }
.ph-btn-ghost:hover { background: var(--ph-surface-alt); }
.ph-btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.ph-btn-lg { padding: 12px 28px; font-size: 15px; }
.ph-btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 10px; }
.ph-btn.voted { background: var(--ph-gold-bg); border-color: var(--ph-gold); color: #92400e; }
[data-ph-theme="dark"] .ph-btn.voted { color: var(--ph-gold); }
.ph-btn.starred, .ph-btn.fav-toggle.starred { background: var(--ph-gold-bg); border-color: var(--ph-gold); color: #92400e; }

/* ── Toolbar (glass) ── */
.ph-toolbar {
  background: var(--ph-surface-glass); backdrop-filter: var(--ph-blur); -webkit-backdrop-filter: var(--ph-blur);
  border: 1px solid var(--ph-border-subtle); border-radius: var(--ph-radius-xl); padding: 20px 24px;
  margin-bottom: 24px; box-shadow: var(--ph-shadow); display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px 20px; position: sticky; top: 8px; z-index: 30;
}
.ph-search-group { position: relative; }
.ph-search-group .ph-input {
  padding-left: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2394a3b8' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 16px; background-position: 13px center;
}
.ph-kbd-hint {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: var(--ph-surface-alt); border: 1px solid var(--ph-border); border-radius: 5px;
  padding: 2px 7px; font-size: 11px; font-weight: 600; color: var(--ph-text-muted); pointer-events: none;
}


.ph-filter-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: 10px;
  justify-content: start;
}
.ph-filter-row .ph-select {
  background: var(--ph-surface);
}

/* Chips */
.ph-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; }
.ph-chips:empty { display: none; }
.ph-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
  background: var(--ph-accent-bg); color: var(--ph-accent-text); border-radius: 999px;
  font-size: 12px; font-weight: 600; animation: ph-pop .2s cubic-bezier(.34,1.56,.64,1);
}
.ph-chip button { all: unset; cursor: pointer; font-size: 14px; line-height: 1; opacity: .6; }
.ph-chip button:hover { opacity: 1; }
@keyframes ph-pop { from { transform: scale(.8); opacity: 0; } }

/* Dropdown */
.ph-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--ph-surface); border: 1px solid var(--ph-border); border-radius: var(--ph-radius);
  box-shadow: var(--ph-shadow-lg); max-height: 240px; overflow-y: auto; z-index: 50;
}
.ph-dropdown-item { padding: 9px 14px; cursor: pointer; font-size: 13px; transition: background .08s; }
.ph-dropdown-item:hover, .ph-dropdown-item.active { background: var(--ph-accent-bg); color: var(--ph-accent-text); }
.ph-dropdown-empty { padding: 10px 14px; color: var(--ph-text-muted); font-size: 13px; }

/* Tabs */
.ph-tabs { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ph-tab {
  all: unset; padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--ph-text-muted); cursor: pointer; border: 1.5px solid transparent;
  background: transparent; transition: all var(--ph-transition);
}
.ph-tab:hover { color: var(--ph-text); background: var(--ph-surface-alt); }
.ph-tab.active { background: var(--ph-accent); border-color: var(--ph-accent); color: #fff; box-shadow: 0 2px 8px var(--ph-accent-glow); }

/* Meta Row */
.ph-meta-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.ph-meta-row-left, .ph-meta-row-right { display: flex; align-items: center; gap: 6px; }

/* Dark Toggle */
.ph-theme-toggle {
  all: unset; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; cursor: pointer; font-size: 18px; border: 1.5px solid var(--ph-border);
  background: var(--ph-surface); transition: all var(--ph-transition);
}
.ph-theme-toggle:hover { background: var(--ph-surface-alt); transform: rotate(15deg); }

/* Stats */
.ph-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.ph-stat {
  background: var(--ph-surface); border: 1px solid var(--ph-border-subtle); border-radius: var(--ph-radius-lg);
  padding: 18px 14px; text-align: center; box-shadow: var(--ph-shadow); transition: transform .2s, box-shadow .2s;
  position: relative; overflow: hidden;
}
.ph-stat::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--ph-accent), #a78bfa, #ec4899); opacity: 0; transition: opacity .2s;
}
.ph-stat:hover { transform: translateY(-3px); box-shadow: var(--ph-shadow-lg); }
.ph-stat:hover::after { opacity: 1; }
.ph-stat-val {
  display: block; font-size: 1.8rem; font-weight: 800; letter-spacing: -.5px;
  background: linear-gradient(135deg, var(--ph-accent), #a78bfa); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.ph-stat-lbl { display: block; font-size: 12px; color: var(--ph-text-muted); margin-top: 3px; font-weight: 500; }

/* View Toggle */
.ph-view-btn {
  all: unset; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 16px; cursor: pointer; color: var(--ph-text-muted);
  border: 1.5px solid var(--ph-border); background: var(--ph-surface); transition: all var(--ph-transition);
}
.ph-view-btn:hover { background: var(--ph-surface-alt); }
.ph-view-btn.active { background: var(--ph-accent); color: #fff; border-color: var(--ph-accent); }

/* Loading */
.ph-loading { text-align: center; padding: 72px 0; }
.ph-spinner { width: 34px; height: 34px; border: 3px solid var(--ph-border); border-top-color: var(--ph-accent); border-radius: 50%; animation: ph-spin .65s linear infinite; margin: 0 auto 12px; }
.ph-loading-text { font-size: 13px; color: var(--ph-text-muted); }
@keyframes ph-spin { to { transform: rotate(360deg); } }

/* ═══ TABLE ═══ */
.ph-table-wrap { border-radius: var(--ph-radius-lg); background: var(--ph-surface); border: 1px solid var(--ph-border-subtle); box-shadow: var(--ph-shadow); overflow: hidden; }
.ph-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ph-table th {
  padding: 10px 16px; text-align: left; font-weight: 700; font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ph-text-muted); background: var(--ph-surface-alt);
  border-bottom: 1px solid var(--ph-border); white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.ph-table td { padding: 14px 16px; border-bottom: 1px solid var(--ph-border-subtle); vertical-align: top; word-break: break-word; }
.ph-table tr:last-child td { border-bottom: none; }
.ph-table tbody tr { transition: background .1s; cursor: pointer; }
.ph-table tbody tr:hover td { background: var(--ph-accent-bg); }
.ph-table .ph-col-name { min-width: 180px; max-width: 260px; }
.ph-table .ph-col-prompt { min-width: 200px; max-width: 380px; }
.ph-table .ph-col-why { min-width: 140px; max-width: 220px; }
.ph-table .ph-col-tags { min-width: 100px; }
.ph-table .ph-col-actions { width: 130px; text-align: center; white-space: nowrap; }

.ph-prompt-title-link { font-weight: 700; color: var(--ph-text); text-decoration: none; transition: color var(--ph-transition); font-size: 14px; }
.ph-prompt-title-link:hover { color: var(--ph-accent); }
.ph-excerpt { color: var(--ph-text-muted); font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ph-excerpt.locked { font-style: italic; opacity: .6; }
.ph-why-text { font-size: 12px; color: var(--ph-text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Expand Row */
.ph-expand-row td { padding: 0 !important; border-bottom: 2px solid var(--ph-accent) !important; }
.ph-expand-inner { padding: 20px 24px; background: var(--ph-accent-bg); animation: ph-slide .2s ease-out; }
@keyframes ph-slide { from { opacity: 0; max-height: 0; } to { opacity: 1; max-height: 600px; } }
.ph-expand-prompt {
  font-family: var(--ph-mono); font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere;
  margin-bottom: 14px; padding: 16px; background: var(--ph-surface); border-radius: var(--ph-radius);
  border: 1px solid var(--ph-border); max-height: 300px; overflow-y: auto;
}
.ph-expand-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ph-prompt-meta-inline { font-size: 11px; color: var(--ph-text-muted); margin-left: auto; display: flex; gap: 10px; }

/* Variable Highlight */
.ph-var {
  background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; padding: 1px 5px; border-radius: 4px;
  font-weight: 600; font-size: .92em; cursor: help; border: 1px solid #fcd34d;
}
[data-ph-theme="dark"] .ph-var { background: rgba(251,191,36,.18); color: #fbbf24; border-color: rgba(251,191,36,.3); }

/* Variable Fill Modal */
.ph-var-modal {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.4); backdrop-filter: blur(4px); animation: ph-fade .15s;
}
.ph-var-modal-box {
  background: var(--ph-surface); border: 1px solid var(--ph-border); border-radius: var(--ph-radius-lg);
  padding: 28px; width: 90%; max-width: 480px; box-shadow: var(--ph-shadow-lg); max-height: 80vh; overflow-y: auto;
}
.ph-var-modal h3 { margin: 0 0 6px; font-size: 18px; font-weight: 800; }
.ph-var-modal p { margin: 0 0 18px; font-size: 13px; color: var(--ph-text-muted); }
.ph-var-field { margin-bottom: 12px; }
.ph-var-field label { display: block; font-size: 12px; font-weight: 700; color: var(--ph-accent); margin-bottom: 4px; font-family: var(--ph-mono); }
.ph-var-actions { display: flex; gap: 10px; margin-top: 18px; }
@keyframes ph-fade { from { opacity: 0; } to { opacity: 1; } }

/* ═══ CARDS ═══ */
.ph-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ph-card {
  background: var(--ph-surface); border: 1px solid var(--ph-border-subtle); border-radius: var(--ph-radius-lg);
  padding: 18px; box-shadow: var(--ph-shadow); display: flex; flex-direction: column; gap: 10px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.ph-card:hover { transform: translateY(-3px); box-shadow: var(--ph-shadow-lg); border-color: var(--ph-accent); }
.ph-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ph-card-title { font-weight: 700; font-size: 15px; color: var(--ph-text); text-decoration: none; line-height: 1.3; }
.ph-card-title:hover { color: var(--ph-accent); }
.ph-card-excerpt { font-size: 13px; color: var(--ph-text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.ph-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.ph-card-footer { display: flex; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--ph-border-subtle); flex-wrap: wrap; }
.ph-card-footer .ph-btn { font-size: 12px; padding: 5px 10px; }
.ph-card-meta-right { margin-left: auto; font-size: 11px; color: var(--ph-text-muted); display: flex; gap: 8px; align-items: center; }

/* Tags & Pills */
.ph-tag {
  display: inline-block; padding: 3px 8px; background: var(--ph-accent-bg); color: var(--ph-accent-text);
  border-radius: 999px; font-size: 11px; font-weight: 600; cursor: pointer; transition: all var(--ph-transition); white-space: nowrap;
}
.ph-tag:hover { background: var(--ph-accent); color: #fff; }
.ph-pill { display: inline-flex; align-items: center; padding: 2px 7px; background: var(--ph-surface-alt); border: 1px solid var(--ph-border); border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--ph-text-muted); white-space: nowrap; }
.ph-pill-sm { font-size: 10px; padding: 1px 5px; }
.ph-lock-pill { background: var(--ph-gold-bg); border-color: var(--ph-gold); color: #92400e; }

/* Star */
.ph-star { all: unset; cursor: pointer; font-size: 20px; transition: transform .12s; opacity: .4; line-height: 1; }
.ph-star:hover { transform: scale(1.25); opacity: .7; }
.ph-star.starred { opacity: 1; color: var(--ph-gold); }
.ph-star[disabled] { cursor: not-allowed; opacity: .2; }

/* Pagination */
.ph-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; flex-wrap: wrap; gap: 12px; }
.ph-pagination { display: flex; gap: 4px; }
.ph-page-btn {
  all: unset; padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--ph-surface); border: 1.5px solid var(--ph-border); transition: all var(--ph-transition);
}
.ph-page-btn:hover { background: var(--ph-surface-alt); }
.ph-page-btn.active { background: var(--ph-accent); color: #fff; border-color: var(--ph-accent); }

/* Toast */
.ph-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  padding: 10px 22px; border-radius: var(--ph-radius); color: #fff; font-weight: 600; font-size: 13px;
  background: #334155; box-shadow: var(--ph-shadow-lg); opacity: 0;
  transition: opacity .15s, transform .2s cubic-bezier(.34,1.56,.64,1); z-index: 9999; pointer-events: none;
}
.ph-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.ph-toast.success { background: var(--ph-success); }
.ph-toast.error { background: var(--ph-danger); }

.ph-empty { text-align: center; padding: 56px 20px; color: var(--ph-text-muted); font-size: 14px; }
.hidden { display: none !important; }

/* ═══ COMMAND PALETTE ═══ */
.ph-cmd-overlay {
  position: fixed; inset: 0; z-index: 9000; background: rgba(0,0,0,.35); backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center; padding-top: min(20vh, 160px); animation: ph-fade .12s;
}
.ph-cmd-box {
  width: 90%; max-width: 560px; background: var(--ph-surface); border: 1px solid var(--ph-border);
  border-radius: var(--ph-radius-xl); box-shadow: var(--ph-shadow-lg), 0 0 60px var(--ph-accent-glow); overflow: hidden;
}
.ph-cmd-input {
  width: 100%; padding: 18px 22px; border: none; outline: none; font-size: 17px; font-family: var(--ph-font);
  font-weight: 500; background: transparent; color: var(--ph-text); box-sizing: border-box;
}
.ph-cmd-input::placeholder { color: var(--ph-text-muted); }
.ph-cmd-results { max-height: 340px; overflow-y: auto; border-top: 1px solid var(--ph-border-subtle); }
.ph-cmd-item {
  padding: 12px 22px; cursor: pointer; display: flex; align-items: center; gap: 12px; transition: background .06s; font-size: 14px;
}
.ph-cmd-item:hover, .ph-cmd-item.active { background: var(--ph-accent-bg); }
.ph-cmd-item-title { font-weight: 600; color: var(--ph-text); }
.ph-cmd-item-sub { font-size: 12px; color: var(--ph-text-muted); margin-left: auto; }
.ph-cmd-hint {
  padding: 10px 22px; font-size: 11px; color: var(--ph-text-muted); border-top: 1px solid var(--ph-border-subtle); display: flex; gap: 12px;
}
.ph-cmd-hint kbd { background: var(--ph-surface-alt); border: 1px solid var(--ph-border); border-radius: 4px; padding: 1px 5px; font-size: 10px; font-weight: 600; }


.ph-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.ph-related-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--ph-border);
  border-radius: 16px;
  background: var(--ph-surface);
  text-decoration: none;
  color: var(--ph-text);
  box-shadow: var(--ph-shadow);
  transition: transform var(--ph-transition), box-shadow var(--ph-transition), border-color var(--ph-transition);
}
.ph-related-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ph-shadow-lg);
  border-color: var(--ph-accent);
}
.ph-related-title { font-weight: 700; }
.ph-related-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--ph-text-muted);
}
.ph-related-meta span {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--ph-surface-alt);
}
.ph-related-excerpt {
  font-size: 13px;
  color: var(--ph-text-muted);
  line-height: 1.5;
}

/* ═══ SINGLE PROMPT ═══ */
.ph-single {
  background: var(--ph-surface); border: 1px solid var(--ph-border-subtle); border-radius: var(--ph-radius-xl);
  box-shadow: var(--ph-shadow-lg); padding: 40px 40px 48px; max-width: 780px; margin: 32px auto 60px;
}
.ph-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ph-single-title { margin: 0; font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 900; color: var(--ph-text); line-height: 1.15; letter-spacing: -.02em; }
.ph-single-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ph-meta-chip { padding: 5px 12px; background: var(--ph-surface-alt); border: 1px solid var(--ph-border-subtle); border-radius: 8px; font-size: 13px; color: var(--ph-text-muted); }
.ph-meta-chip strong { color: var(--ph-text); margin-right: 3px; }
.ph-single-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.ph-single-header { padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--ph-border); }
.ph-single-actions { display: flex; gap: 10px; margin-bottom: 24px; }

.ph-prompt-block { margin-bottom: 20px; border-radius: var(--ph-radius-lg); overflow: hidden; border: 2px solid var(--ph-accent); box-shadow: 0 4px 20px var(--ph-accent-glow); }
.ph-prompt-label {
  padding: 8px 18px; background: var(--ph-text); color: #fff; font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; display: flex; align-items: center; justify-content: space-between;
}
.ph-prompt-label .ph-word-count { font-weight: 400; opacity: .6; text-transform: none; letter-spacing: 0; }
.ph-prompt-body {
  padding: 22px; background: var(--ph-accent-bg); font-family: var(--ph-mono);
  font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere;
}
.ph-prompt-body p { margin: 0 0 .75em; }
.ph-prompt-body p:last-child { margin-bottom: 0; }
.ph-single-bar { display: flex; gap: 8px; margin-bottom: 28px; flex-wrap: wrap; }

/* AI deep link */
.ph-ai-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--ph-radius);
  font-size: 13px; font-weight: 600; text-decoration: none; transition: all var(--ph-transition);
  border: 1.5px solid var(--ph-border); background: var(--ph-surface); color: var(--ph-text); cursor: pointer;
}
.ph-ai-btn:hover { transform: translateY(-1px); box-shadow: var(--ph-shadow); }
.ph-ai-btn.chatgpt { border-color: #10a37f; color: #10a37f; }
.ph-ai-btn.chatgpt:hover { background: #10a37f; color: #fff; }
.ph-ai-btn.claude { border-color: #d97706; color: #d97706; }
.ph-ai-btn.claude:hover { background: #d97706; color: #fff; }

/* Sections */
.ph-section { margin-top: 28px; padding: 22px; border: 1px solid var(--ph-border-subtle); border-radius: var(--ph-radius-lg); background: var(--ph-surface-alt); }
.ph-section h3 { margin: 0 0 12px; font-size: 16px; font-weight: 700; color: var(--ph-text); display: flex; align-items: center; gap: 8px; }
.ph-section h3::before { content: ''; width: 4px; height: 18px; background: linear-gradient(180deg, var(--ph-accent), #a78bfa); border-radius: 2px; flex-shrink: 0; }
.ph-section h3 small { font-weight: 400; color: var(--ph-text-muted); font-size: 12px; }
.ph-section-body { font-size: 14px; line-height: 1.65; color: var(--ph-text-mid); }
.ph-section-body p { margin: 0 0 .8em; }
.ph-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ph-section-head h3 { margin-bottom: 0; }
.ph-changelog { display: flex; flex-direction: column; gap: 6px; }
.ph-cl-item { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ph-text-muted); }
.ph-cl-item small { margin-left: auto; font-size: 11px; opacity: .7; }
.ph-success-inline { padding: 10px 14px; background: var(--ph-success-bg); border: 1px solid #6ee7b7; border-radius: var(--ph-radius); color: #065f46; font-size: 13px; margin-bottom: 14px; }

/* ═══ FORMS ═══ */
.ph-form-wrap { max-width: 680px; margin: 32px auto; font-family: var(--ph-font); }
.ph-form-title { font-size: 1.5rem; font-weight: 900; margin: 0 0 20px; letter-spacing: -.02em; }
.ph-form { display: flex; flex-direction: column; gap: 14px; }
.ph-label { font-size: 13px; font-weight: 600; color: var(--ph-text); margin-bottom: 4px; display: block; }
.ph-suggest-form { display: flex; flex-direction: column; gap: 12px; }
.ph-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ph-form-col { display: flex; flex-direction: column; gap: 4px; }
.ph-model-selector { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-model-opt { all: unset; padding: 6px 14px; border: 1.5px solid var(--ph-border); border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all var(--ph-transition); }
.ph-model-opt:hover { border-color: var(--ph-accent); }
.ph-model-opt.active { background: var(--ph-accent); border-color: var(--ph-accent); color: #fff; }
.ph-success-card, .ph-login-card { text-align: center; padding: 48px 24px; background: var(--ph-surface); border: 1px solid var(--ph-border); border-radius: var(--ph-radius-xl); box-shadow: var(--ph-shadow); }
.ph-success-card h3, .ph-login-card h3 { margin: 0 0 10px; font-size: 1.4rem; }

/* Bulk Upload */
.ph-dropzone { border: 2px dashed var(--ph-border); border-radius: var(--ph-radius-xl); padding: 44px 24px; text-align: center; transition: border-color .2s, background .2s; background: var(--ph-surface-alt); }
.ph-dropzone.dragging { border-color: var(--ph-accent); background: var(--ph-accent-bg); }
.ph-or { display: block; margin: 10px 0; color: var(--ph-text-muted); font-size: 12px; }
.ph-file-info { margin-top: 12px; font-size: 13px; color: var(--ph-text-muted); }
.ph-status-row { margin-top: 16px; display: flex; align-items: center; gap: 8px; justify-content: center; }
.ph-template-link { margin-top: 14px; text-align: center; }
.ph-template-link a { color: var(--ph-accent); font-weight: 600; text-decoration: none; font-size: 13px; }
.ph-processing { text-align: center; padding: 32px 0; }

/* POD */
.ph-pod { background: var(--ph-surface); border: 1px solid var(--ph-border-subtle); border-radius: var(--ph-radius-xl); padding: 28px; box-shadow: var(--ph-shadow); text-align: center; max-width: 600px; margin: 0 auto 24px; }
.ph-pod-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ph-accent); font-weight: 700; margin: 0 0 8px; }
.ph-pod-title { margin: 0 0 8px; font-size: 1.2rem; }
.ph-pod-title a { color: var(--ph-text); text-decoration: none; }
.ph-pod-title a:hover { color: var(--ph-accent); }
.ph-pod-brief { color: var(--ph-text-muted); font-size: 13px; margin: 0 0 12px; }
.ph-pod-link { color: var(--ph-accent); font-weight: 600; text-decoration: none; font-size: 13px; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
  .ph-toolbar { grid-template-columns: 1fr; position: sticky; top: 0; border-radius: 0 0 var(--ph-radius-lg) var(--ph-radius-lg); }
  .ph-stats { grid-template-columns: repeat(2, 1fr); }
  .ph-single { padding: 24px 20px 32px; margin: 16px auto 32px; }
  .ph-form-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ph-app { padding: 0 0 48px; }
  .ph-stats { grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 12px; }
  .ph-stat { padding: 14px 10px; }
  .ph-stat-val { font-size: 1.4rem; }
  .ph-meta-row { padding: 0 12px; }
  .ph-cards { grid-template-columns: 1fr; padding: 0 12px; }
  .ph-table-wrap { border-radius: 0; border-left: none; border-right: none; }
  .ph-table, .ph-table thead, .ph-table tbody, .ph-table tr, .ph-table th, .ph-table td { display: block; min-width: unset; max-width: unset; }
  .ph-table thead { display: none; }
  .ph-table tr { background: var(--ph-surface); border: 1px solid var(--ph-border-subtle); border-radius: var(--ph-radius-lg); margin: 8px 12px; box-shadow: var(--ph-shadow); overflow: hidden; }
  .ph-table td { border-bottom: 1px solid var(--ph-border-subtle); padding: 10px 16px; }
  .ph-table td::before { content: attr(data-label); display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ph-text-muted); margin-bottom: 3px; }
  .ph-single { border-radius: var(--ph-radius-lg); padding: 20px 16px 28px; margin: 12px 8px 32px; }
  .ph-footer { flex-direction: column; align-items: center; padding: 0 12px; }
  .ph-cmd-box { max-width: 96%; }
  .ph-kbd-hint { display: none; }
}
