:root {
    --bg:        #F4F3EE;
    --surface:   #FFFFFF;
    --surface-2: #F9F8F3;

    --ink:        #0F0F0E;
    --ink-soft:   #2A2A28;
    --ink-muted:  #74726C;
    --ink-faint:  #A8A6A0;

    --line:       #E2DFD7;
    --line-soft:  #ECE9E1;

    --accent:        #5D6B4F;
    --accent-light:  #A8B098;
    --accent-soft:   #C2C7B5;
    --accent-tint:   rgba(93,107,79,.13);
    --accent-tint-2: rgba(168,176,152,.20);

    --crit:       #A8201A;
    --crit-tint:  #F6E5E4;
    --warn:       #A85610;
    --warn-tint:  #F6EAD9;
    --info:       #0E5E78;
    --info-tint:  #E0EDF2;
    --ok:         #2F6B3D;

    --serif:  'Instrument Serif', Georgia, serif;
    --sans:   'DM Sans', -apple-system, sans-serif;
    --mono:   'JetBrains Mono', ui-monospace, monospace;
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  html, body { height: 100%; }
  body {
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 64px; /* compensar topbar fija */
  }
  a { color: inherit; text-decoration: none; }
  img { display: block; max-width: 100%; height: auto; }
  .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
  .container { max-width: 1440px; margin: 0 auto; padding: 0 56px; }
  .wide-container { max-width: 1640px; margin: 0 auto; padding: 0 56px; }

  /* ============================================================
     TOP BAR
     ============================================================ */
  .topbar {
    background: rgba(244,243,238,.72);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-bottom: 1px solid var(--line);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
  }
  .topbar-inner {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 36px;
    padding: 16px 56px;
    max-width: 1640px;
    margin: 0 auto;
  }
  .brand-h {
    display: flex;
    align-items: baseline;
    gap: 4px;
  }
  .brand-h .neo {
    font-family: var(--sans);
    font-weight: 800;
    font-size: 26px;
    line-height: 1;
    letter-spacing: -.04em;
    color: var(--ink);
  }
  .brand-h .by {
    font-family: var(--serif);
    font-style: italic;
    font-size: 16px;
    color: var(--ink);
    margin: 0 1px 0 3px;
  }
  .brand-h .sdh {
    font-family: var(--sans);
    font-weight: 200;
    font-size: 11px;
    letter-spacing: .22em;
    color: var(--ink);
  }

  .top-nav {
    display: flex;
    justify-content: center;
    gap: 4px;
  }
  .top-nav a {
    padding: 8px 16px;
    font-size: 13.5px;
    color: var(--ink-soft);
    border-radius: 4px;
    transition: background .15s, color .15s;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .top-nav a .num-prefix {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--ink-faint);
    letter-spacing: .04em;
  }
  .top-nav a:hover { background: var(--bg); color: var(--ink); }
  .top-nav a:hover .num-prefix { color: var(--accent); }
  .top-nav a.active {
    color: var(--accent);
    background: var(--accent-tint);
  }
  .top-nav a.active .num-prefix { color: var(--accent); }
  .avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--surface);
    font-size: 10.5px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--mono);
  }

  /* ============================================================
     SECTION 1 — HI I AM NEO (THE BIG INTRO)
     ============================================================ */
  #neo {
    background: #FAF7F4;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 60px 0 0;
    position: relative;
  }
  .neo-hero {
    flex: 1;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 60px;
    padding: 60px 0 80px;
    align-items: center;
  }
  .neo-hero-left {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }
  .neo-eyebrow {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
  }
  .neo-eyebrow .live-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 0 rgba(47,107,61,.4);
    animation: pulse 2.4s infinite;
  }
  @keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(47,107,61,.4); }
    70%  { box-shadow: 0 0 0 8px rgba(47,107,61,0); }
    100% { box-shadow: 0 0 0 0 rgba(47,107,61,0); }
  }

  .massive-brand {
    font-family: var(--sans);
    font-weight: 900;
    font-size: clamp(140px, 22vw, 320px);
    line-height: .8;
    letter-spacing: -.06em;
    color: var(--ink);
    margin-left: 0;
    width: max-content;
    max-width: 100%;
  }
  .massive-brand .lockup {
    display: block;
    margin-top: 20px;
    font-size: 22px;
    font-weight: 200;
    letter-spacing: .04em;
  }
  .massive-brand .lockup .by {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: 28px;
    margin-right: 6px;
    letter-spacing: 0;
  }
  .massive-brand .lockup .sdh {
    letter-spacing: .22em;
    font-size: 42px;
  }

  .neo-hero-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0;
  }
  .neo-character {
    width: auto;
    max-width: 340px;
    max-height: 520px;
    height: auto;
    display: block;
  }
  .neo-greeting {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(56px, 7vw, 92px);
    line-height: 1;
    color: var(--ink);
    letter-spacing: -1px;
  }
  .neo-greeting .accent { color: var(--accent); }
  .neo-intro {
    font-size: 17px;
    line-height: 1.55;
    color: var(--ink-soft);
    max-width: 520px;
  }
  .neo-intro .strong { color: var(--ink); font-weight: 500; }

  .neo-cta-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
  }
  .btn-primary {
    background: var(--ink);
    color: var(--surface);
    padding: 14px 24px;
    border-radius: 999px;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: none;
    cursor: pointer;
    transition: background .2s;
  }
  .btn-primary:hover { background: var(--accent); }
  .btn-primary .arrow {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,.16);
    display: flex; align-items: center; justify-content: center;
  }
  .btn-secondary {
    color: var(--ink-soft);
    padding: 14px 24px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .18em;
    text-transform: uppercase;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    cursor: pointer;
    transition: border-color .2s, color .2s;
  }
  .btn-secondary:hover { border-color: var(--ink); color: var(--ink); }

  /* stats strip at bottom of section 1 */
  .neo-stats {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    padding: 28px 0;
  }
  .neo-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
  }
  .neo-stat {
    padding: 0 32px;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .neo-stat:last-child { border-right: none; }
  .neo-stat-label {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ink-muted);
  }
  .neo-stat-value {
    font-family: var(--serif);
    font-size: 56px;
    line-height: 1;
    color: var(--ink);
    letter-spacing: -.7px;
  }
  .neo-stat-value .ital { font-style: italic; color: var(--accent); }
  .neo-stat-meta {
    font-size: 12px;
    color: var(--ink-muted);
  }

  /* marquee bilingüe */
  .marquee {
    overflow: hidden;
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 22px 0;
    color: var(--ink);
  }
  .marquee-inner {
    display: flex;
    gap: 60px;
    white-space: nowrap;
    animation: scroll 38s linear infinite;
    font-family: var(--serif);
    font-style: italic;
    font-size: 28px;
  }
  .marquee-inner span:before {
    content: "·";
    margin-right: 60px;
    color: var(--accent);
  }
  @keyframes scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
  }

  /* ============================================================
     COMMON SECTION STYLES
     ============================================================ */
  .feature-section {
    padding: 120px 0 100px;
    border-bottom: 1px solid var(--line);
  }
  .feature-section.dark {
    background: var(--ink);
    color: rgba(255,255,255,.92);
    border-bottom: none;
  }
  .feature-section.dark .feature-eyebrow { color: #A8B098; }
  .feature-section.dark .feature-title { color: var(--surface); }
  .feature-section.dark .feature-lead { color: rgba(255,255,255,.78); }

  .section-label {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 30px;
  }
  .feature-section.dark .section-label { color: rgba(255,255,255,.5); }
  .section-label .num-big {
    font-family: var(--serif);
    font-style: italic;
    font-size: 28px;
    color: var(--accent);
    letter-spacing: 0;
  }
  .feature-section.dark .section-label .num-big { color: #A8B098; }
  .section-label .divider {
    flex: 1;
    height: 1px;
    background: var(--line);
    max-width: 200px;
  }
  .feature-section.dark .section-label .divider { background: rgba(255,255,255,.15); }

  .feature-head {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 80px;
    margin-bottom: 60px;
    align-items: end;
  }
  .feature-eyebrow {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
  }
  .feature-title {
    font-family: var(--sans);
    font-weight: 800;
    font-size: clamp(80px, 13vw, 180px);
    line-height: .85;
    letter-spacing: -.06em;
    color: var(--ink);
  }
  .feature-title .ital {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
    letter-spacing: -.02em;
  }
  .feature-lead {
    font-size: 17px;
    line-height: 1.55;
    color: var(--ink-soft);
    padding-bottom: 12px;
  }
  .feature-lead .strong { color: var(--ink); font-weight: 500; }
  .feature-section.dark .feature-lead .strong { color: var(--surface); }

  /* ============================================================
     SECTION 2 — BLUEPRINT
     ============================================================ */
  #blueprint { background: var(--surface); }

  .blueprint-flow {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 60px 0 80px;
  }
  .flow-step {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 36px 32px;
    background: var(--surface-2);
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: border-color .2s, transform .2s;
    position: relative;
  }
  .flow-step:hover { border-color: var(--accent); transform: translateY(-4px); }
  .flow-step-num {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .2em;
    color: var(--accent);
    margin-bottom: 8px;
  }
  .flow-step-icon {
    width: 56px; height: 56px;
    border-radius: 12px;
    background: var(--ink);
    color: var(--surface);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
  }
  .flow-step h4 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 30px;
    line-height: 1.05;
    color: var(--ink);
    letter-spacing: -.3px;
  }
  .flow-step h4 .ital { font-style: italic; color: var(--accent); }
  .flow-step p {
    font-size: 13.5px;
    color: var(--ink-muted);
    line-height: 1.55;
  }

  /* ============================================================
     SECTION 3 — NEO CHAT
     ============================================================ */
  #chat { background: var(--surface-2); }

  .chat-mockup {
    margin: 30px 0 60px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 0 rgba(0,0,0,.02);
  }
  .chat-mockup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
  }
  .chat-mockup-head .left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-muted);
  }
  .chat-status {
    display: flex; align-items: center; gap: 6px;
    color: var(--ok);
  }
  .chat-status .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--ok);
  }

  .chat-body {
    padding: 36px 40px;
    display: flex;
    flex-direction: column;
    gap: 28px;
  }
  .chat-msg { display: flex; gap: 16px; max-width: 80%; }
  .chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }
  .chat-msg .who {
    width: 32px; height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
  }
  .chat-msg .who.user-who { background: var(--ink); color: var(--surface); }
  .chat-msg .who.neo-who {
    background: var(--accent-tint);
    color: var(--accent);
    border: 1.5px solid var(--accent);
  }
  .chat-bubble {
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink);
  }
  .chat-msg.user .chat-bubble {
    background: var(--ink);
    color: var(--surface);
    border-radius: 14px 14px 4px 14px;
  }
  .chat-msg.neo .chat-bubble {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 4px 14px 14px 14px;
  }
  .chat-bubble .citation {
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--accent-tint);
    border-left: 3px solid var(--accent);
    border-radius: 0 4px 4px 0;
    font-size: 12.5px;
    color: var(--ink-soft);
  }
  .chat-bubble .citation .label {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 4px;
    display: block;
  }
  .chat-bubble strong { font-weight: 600; }
  .chat-bubble em {
    font-family: var(--serif);
    font-style: italic;
    color: var(--accent);
    font-size: 15px;
  }
  .chat-related {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 14px;
  }
  .chat-related-tag {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent);
    padding: 4px 9px;
    border: 1px solid var(--accent-tint-2);
    background: var(--surface);
    border-radius: 999px;
    cursor: pointer;
  }
  .chat-related-tag:hover { background: var(--accent); color: var(--surface); border-color: var(--accent); }

  .chat-input-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
  }
  .chat-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--sans);
    font-size: 14px;
    color: var(--ink);
    outline: none;
    resize: none;
    max-height: 120px;
    line-height: 1.5;
    padding: 6px 0;
    font-family: var(--sans);
  }
  .chat-input::placeholder { color: var(--ink-faint); }
  .chat-send {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--surface);
    border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: opacity .15s, background .15s;
    flex-shrink: 0;
  }
  .chat-send:disabled {
    background: var(--ink-faint);
    cursor: not-allowed;
    opacity: .6;
  }

  /* Attach image button */
  .chat-attach-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: transparent;
    color: var(--ink-muted);
    border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all .15s;
    flex-shrink: 0;
  }
  .chat-attach-btn:hover { color: var(--ink); border-color: var(--ink); }

  /* Attached image preview */
  .chat-attachment-preview {
    padding: 10px 24px 0;
    display: none;
  }
  .chat-attachment-preview.visible { display: block; }
  .chat-attachment-thumb {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 6px 10px 6px 6px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-soft);
  }
  .chat-attachment-thumb img {
    height: 36px;
    width: 36px;
    border-radius: 4px;
    object-fit: cover;
  }
  .chat-attachment-remove {
    background: transparent;
    border: none;
    color: var(--ink-muted);
    cursor: pointer;
    padding: 4px;
    margin-left: 4px;
    line-height: 1;
  }
  .chat-attachment-remove:hover { color: var(--crit); }

  /* Image inside a user message bubble */
  .chat-msg-image {
    max-width: 240px;
    max-height: 200px;
    display: block;
    border-radius: 6px;
    margin-bottom: 8px;
  }

  /* Loading dots while NEO is thinking */
  .chat-typing {
    display: inline-flex;
    gap: 4px;
    padding: 4px 0;
  }
  .chat-typing span {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--ink-faint);
    animation: chatTyping 1.2s infinite ease-in-out;
  }
  .chat-typing span:nth-child(2) { animation-delay: .15s; }
  .chat-typing span:nth-child(3) { animation-delay: .3s; }
  @keyframes chatTyping {
    0%, 60%, 100% { opacity: .3; transform: translateY(0); }
    30%           { opacity: 1;  transform: translateY(-4px); }
  }

  /* Mode toggle pill in chat header */
  .chat-mode-toggle {
    display: inline-flex;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
  }
  .chat-mode-toggle button {
    background: transparent;
    border: none;
    color: var(--ink-muted);
    padding: 5px 10px;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
  }
  .chat-mode-toggle button.active {
    background: var(--ink);
    color: var(--surface);
  }

  /* New conversation button */
  .chat-new-btn {
    background: transparent;
    color: var(--ink-muted);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 5px 10px;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all .15s;
  }
  .chat-new-btn:hover { color: var(--ink); border-color: var(--ink); }

  /* Header re-layout to fit new controls */
  .chat-mockup-head {
    flex-wrap: wrap;
    gap: 12px;
  }
  .chat-mockup-head .right {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  /* Empty state when no messages yet */
  .chat-empty-state {
    text-align: center;
    padding: 40px 24px;
    color: var(--ink-muted);
    font-family: var(--serif);
    font-size: 16px;
    font-style: italic;
  }
  .chat-empty-state .strong {
    display: block;
    color: var(--ink);
    font-style: normal;
    font-family: var(--sans);
    font-size: 13px;
    letter-spacing: .04em;
    margin-bottom: 8px;
    font-style: normal;
  }
  .chat-empty-suggestions {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
  }
  .chat-suggestion {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 14px;
    font-family: var(--sans);
    font-size: 12.5px;
    color: var(--ink-soft);
    cursor: pointer;
    font-style: normal;
    transition: all .15s;
  }
  .chat-suggestion:hover {
    background: var(--accent-tint);
    border-color: var(--accent);
    color: var(--accent);
  }

  /* Out-of-matrix banner */
  .chat-oom-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--warn-tint);
    color: var(--warn);
    border-radius: 4px;
    padding: 6px 10px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .08em;
    margin-bottom: 10px;
  }

  /* ============================================================
     SECTION 4 — TOOLBOX (DARK)
     ============================================================ */
  #toolbox {
    background: var(--surface);
    color: var(--ink);
  }

  /* Override the section title styles for toolbox-light variant */
  .toolbox-light .feature-eyebrow { color: var(--accent); }
  .toolbox-light .feature-title { color: var(--ink); }
  .toolbox-light .feature-lead { color: var(--ink-soft); }
  .toolbox-light .feature-lead .strong { color: var(--ink); }
  .toolbox-light .section-label { color: var(--ink-muted); }
  .toolbox-light .section-label .num-big { color: var(--accent); }
  .toolbox-light .section-label .divider { background: var(--line); }

  .toolbox-cta-row {
    display: flex;
    gap: 14px;
    margin-top: 30px;
    margin-bottom: 50px;
    flex-wrap: wrap;
  }

  /* ── Section divider for feed ─────────────────────────── */
  .tbx-feed-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 26px;
    flex-wrap: wrap;
  }
  .tbx-feed-head h3 {
    font-family: var(--serif);
    font-size: 36px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -.4px;
    line-height: 1.1;
  }
  .tbx-feed-head h3 .ital { font-style: italic; color: var(--accent); }
  .tbx-feed-head p {
    font-size: 14px;
    color: var(--ink-soft);
    max-width: 460px;
    line-height: 1.55;
  }
  .tbx-propose-btn {
    background: var(--ink);
    color: var(--surface);
    border: none;
    padding: 11px 22px;
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    flex-shrink: 0;
  }
  .tbx-propose-btn:hover { background: var(--accent); }

  /* ── Filter pills (light theme) ────────────────────── */
  .tbx-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 36px;
    flex-wrap: wrap;
    padding: 18px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  .tbx-filter {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink-soft);
    padding: 10px 20px;
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all .15s;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
  }
  .tbx-filter .ital {
    font-style: italic;
    font-family: var(--serif);
    text-transform: none;
    letter-spacing: 0;
    font-size: 14px;
    color: var(--accent);
    margin-left: 1px;
  }
  .tbx-filter:hover {
    border-color: var(--ink-muted);
    color: var(--ink);
  }
  .tbx-filter.active {
    background: var(--ink);
    color: var(--surface);
    border-color: var(--ink);
  }
  .tbx-filter.active .ital { color: var(--accent-light); }

  /* ── Editorial card grid (organic, light theme) ────── */
  .tbx-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 22px;
  }
  .tbx-card {
    grid-column: span 4;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all .25s ease;
    text-align: left;
    color: inherit;
    font: inherit;
    padding: 0;
  }
  .tbx-card.featured { grid-column: span 8; }
  .tbx-card.wide     { grid-column: span 6; }
  .tbx-card:hover {
    border-color: var(--ink-muted);
    box-shadow: 0 6px 24px rgba(0,0,0,.06);
    transform: translateY(-3px);
  }

  /* Hero image area */
  .tbx-card-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .tbx-card.featured .tbx-card-hero { aspect-ratio: 16/9; }
  .tbx-card-hero img,
  .tbx-card-hero svg.bg-svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s ease;
  }
  .tbx-card:hover .tbx-card-hero img,
  .tbx-card:hover .tbx-card-hero svg.bg-svg {
    transform: scale(1.04);
  }
  .tbx-card-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 65%, rgba(0,0,0,.35) 100%);
    pointer-events: none;
  }
  .tbx-card-hero-tag {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    display: flex;
    gap: 6px;
    align-items: center;
  }
  .tbx-card-hero-tag .type {
    background: rgba(255,255,255,.95);
    color: var(--ink);
    padding: 5px 9px;
    border-radius: 3px;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: .15em;
    text-transform: uppercase;
    font-weight: 700;
  }
  .tbx-card-hero-tag .status {
    padding: 5px 9px;
    border-radius: 3px;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: .15em;
    text-transform: uppercase;
    font-weight: 700;
  }
  .tbx-card-hero-tag .status.live   { background: #6FD088; color: #053B16; }
  .tbx-card-hero-tag .status.dev    { background: #E5A35E; color: #3B1F05; }
  .tbx-card-hero-tag .status.idea   { background: var(--accent); color: #fff; }

  /* Body */
  .tbx-card-body {
    padding: 22px 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
  }
  .tbx-card-title {
    font-family: var(--serif);
    font-size: 22px;
    line-height: 1.18;
    color: var(--ink);
    font-weight: 400;
    letter-spacing: -.2px;
  }
  .tbx-card.featured .tbx-card-title { font-size: 30px; line-height: 1.1; }
  .tbx-card-title .ital { font-style: italic; color: var(--accent); }
  .tbx-card-desc {
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.55;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .tbx-card.featured .tbx-card-desc { -webkit-line-clamp: 4; font-size: 14px; }
  .tbx-card-foot {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-faint);
  }
  .tbx-card-author {
    color: var(--ink-soft);
    letter-spacing: .04em;
    font-size: 10.5px;
    text-transform: none;
  }
  .tbx-card-arrow {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--surface-2);
    display: flex; align-items: center; justify-content: center;
    color: var(--ink-soft);
    transition: all .15s;
    flex-shrink: 0;
  }
  .tbx-card:hover .tbx-card-arrow {
    background: var(--ink);
    color: var(--surface);
  }

  /* ── Modal ────────────────────────────────────────────── */
  .tbx-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 24px;
    overflow-y: auto;
  }
  .tbx-modal-backdrop.visible {
    display: flex;
  }
  .tbx-modal {
    background: var(--surface);
    border-radius: 12px;
    max-width: 720px;
    width: 100%;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    position: relative;
    color: var(--ink);
  }
  .tbx-modal-close {
    position: absolute;
    top: 18px;
    right: 20px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--ink-soft);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    line-height: 1;
    z-index: 2;
    transition: all .15s;
  }
  .tbx-modal-close:hover {
    background: var(--ink); color: var(--surface); border-color: var(--ink);
  }
  .tbx-modal-hero {
    width: 100%;
    aspect-ratio: 16/8;
    background: var(--surface-2);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .tbx-modal-hero img,
  .tbx-modal-hero svg.bg-svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .tbx-modal-head {
    padding: 28px 40px 22px;
    border-bottom: 1px solid var(--line);
  }
  .tbx-modal-tag {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 16px;
  }
  .tbx-modal-tag .type { color: var(--accent); }
  .tbx-modal-tag .status {
    padding: 3px 8px;
    border-radius: 3px;
    font-weight: 600;
  }
  .tbx-modal-tag .status.active, .tbx-modal-tag .status.live {
    background: rgba(43,168,74,.12); color: #2BA84A;
  }
  .tbx-modal-tag .status.dev {
    background: rgba(168,86,16,.12); color: var(--warn);
  }
  .tbx-modal-tag .status.idea {
    background: var(--accent-tint); color: var(--accent);
  }
  .tbx-modal-title {
    font-family: var(--serif);
    font-size: 32px;
    font-weight: 400;
    line-height: 1.15;
    color: var(--ink);
    letter-spacing: -.3px;
  }
  .tbx-modal-title .ital { font-style: italic; color: var(--accent); }
  .tbx-modal-author {
    margin-top: 14px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .04em;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .tbx-modal-author .avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--surface);
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    letter-spacing: 0;
  }
  .tbx-modal-body {
    padding: 28px 40px 30px;
  }
  .tbx-modal-section {
    margin-bottom: 26px;
  }
  .tbx-modal-section:last-child { margin-bottom: 0; }
  .tbx-modal-section h5 {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 10px;
  }
  .tbx-modal-section p {
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--ink-soft);
  }
  .tbx-modal-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    word-break: break-all;
    border-bottom: 1px solid var(--accent);
    padding-bottom: 1px;
    transition: opacity .15s;
  }
  .tbx-modal-link:hover { opacity: .7; }
  .tbx-modal-comments {
    background: var(--surface-2);
    border-radius: 8px;
    padding: 18px 20px;
    margin-top: 8px;
  }
  .tbx-comment {
    padding: 12px 0;
    border-bottom: 1px dashed var(--line);
    display: flex;
    gap: 12px;
  }
  .tbx-comment:first-child { padding-top: 0; }
  .tbx-comment:last-child { border-bottom: none; padding-bottom: 0; }
  .tbx-comment-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--surface);
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .tbx-comment-body {
    flex: 1;
    min-width: 0;
  }
  .tbx-comment-head {
    display: flex;
    gap: 10px;
    align-items: baseline;
    margin-bottom: 4px;
    flex-wrap: wrap;
  }
  .tbx-comment-author {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink);
    font-weight: 600;
    letter-spacing: .02em;
  }
  .tbx-comment-date {
    font-family: var(--mono);
    font-size: 9.5px;
    color: var(--ink-faint);
    letter-spacing: .12em;
    text-transform: uppercase;
  }
  .tbx-comment-text {
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.55;
  }

  /* ============================================================
     FOOTER
     ============================================================ */
  .foot {
    padding: 70px 0 40px;
    background: var(--ink);
    color: rgba(255,255,255,.78);
  }
  .foot-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 50px;
    border-bottom: 1px solid rgba(255,255,255,.12);
  }
  .foot-brand .neo {
    font-family: var(--sans);
    font-weight: 800;
    font-size: 64px;
    line-height: .85;
    letter-spacing: -.04em;
    color: var(--surface);
    display: block;
  }
  .foot-brand .by-line {
    margin-top: 8px;
    display: flex;
    align-items: baseline;
    gap: 6px;
  }
  .foot-brand .by {
    font-family: var(--serif);
    font-style: italic;
    font-size: 18px;
    color: var(--surface);
  }
  .foot-brand .sdh {
    font-family: var(--sans);
    font-weight: 200;
    font-size: 13.5px;
    letter-spacing: .22em;
    color: var(--surface);
  }
  .foot-brand .meta {
    margin-top: 22px;
    font-size: 13px;
    color: rgba(255,255,255,.65);
    max-width: 320px;
    line-height: 1.55;
  }
  .foot-col h4 {
    font-family: var(--mono);
    font-weight: 400;
    font-size: 10.5px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: rgba(255,255,255,.5);
    margin-bottom: 18px;
  }
  .foot-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
  .foot-col a {
    font-size: 13px;
    color: rgba(255,255,255,.85);
    transition: color .15s;
  }
  .foot-col a:hover { color: var(--surface); }
  .foot-col p {
    font-size: 12.5px;
    color: rgba(255,255,255,.65);
    line-height: 1.5;
    margin-bottom: 6px;
  }
  .foot-col .label {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255,255,255,.5);
    margin-top: 12px;
  }
  .foot-bottom {
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255,255,255,.5);
    gap: 24px;
    flex-wrap: wrap;
  }
  .foot-bottom .quote {
    font-family: var(--serif);
    font-style: italic;
    font-size: 13.5px;
    text-transform: none;
    letter-spacing: 0;
    color: rgba(255,255,255,.7);
  }

  /* ============================================================
     BLUEPRINT INTERACTIVE APP
     ============================================================ */
  .blueprint-app {
    margin: 40px 0 80px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    overflow: hidden;
    min-height: 540px;
    display: flex;
    flex-direction: column;
  }
  .bp-state { display: none; flex: 1; }
  .blueprint-app[data-state="upload"]     .bp-state-upload     { display: block; }
  .blueprint-app[data-state="processing"] .bp-state-processing { display: flex; }
  .blueprint-app[data-state="results"]    .bp-state-results    { display: flex; flex-direction: column; }

  /* ---- UPLOAD STATE ---- */
  .bp-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    min-height: 540px;
  }
  .bp-upload-side {
    padding: 56px 48px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    border-right: 1px solid var(--line);
    background: var(--surface-2);
  }
  .bp-upload-eyebrow {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--accent);
  }
  .bp-upload-head {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 56px;
    line-height: .95;
    color: var(--ink);
    letter-spacing: -.7px;
  }
  .bp-upload-head .ital { font-style: italic; color: var(--accent); }
  .bp-upload-lead {
    font-size: 15px;
    color: var(--ink-soft);
    line-height: 1.55;
    max-width: 460px;
  }
  .bp-upload-mini {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
  }
  .bp-upload-mini .mini-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--ink-soft);
  }
  .bp-upload-mini .mini-row .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
  }

  /* ── Mode toggle ─────────────────────────────────────────── */
  .bp-mode-toggle {
    margin-top: 26px;
    padding: 16px 18px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 8px;
  }
  .bp-mode-toggle-label {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 12px;
  }
  .bp-mode-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .bp-mode-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    cursor: pointer;
    transition: all .15s;
  }
  .bp-mode-option:hover {
    border-color: var(--ink-muted);
  }
  .bp-mode-option input[type="radio"] {
    margin: 3px 0 0 0;
    accent-color: var(--accent);
    flex-shrink: 0;
    cursor: pointer;
  }
  .bp-mode-option input[type="radio"]:checked + .bp-mode-option-text .bp-mode-option-name {
    color: var(--accent);
  }
  .bp-mode-option:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-tint);
  }
  .bp-mode-option-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }
  .bp-mode-option-name {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink);
  }
  .bp-mode-option-desc {
    font-size: 11.5px;
    color: var(--ink-muted);
    line-height: 1.4;
  }
  .bp-mode-status {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .04em;
    color: var(--ink-muted);
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .bp-mode-status .live-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--ink-faint);
    flex-shrink: 0;
  }
  body[data-neo-mode="live"] .bp-mode-status .live-dot {
    background: #2BA84A;
    box-shadow: 0 0 0 0 rgba(43,168,74,.5);
    animation: livePulse 2s infinite;
  }
  @keyframes livePulse {
    0%   { box-shadow: 0 0 0 0 rgba(43,168,74,.5); }
    70%  { box-shadow: 0 0 0 8px rgba(43,168,74,0); }
    100% { box-shadow: 0 0 0 0 rgba(43,168,74,0); }
  }

  .bp-dropzone {
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    background: var(--surface);
    border: 2px dashed var(--line);
    margin: 24px;
    border-radius: 10px;
    transition: border-color .2s, background .2s;
    text-align: center;
  }
  .bp-dropzone:hover, .bp-dropzone.dragging {
    border-color: var(--accent);
    background: var(--accent-tint);
  }
  .bp-dropzone-icon-wrap {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--accent-tint);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 6px;
  }
  .bp-dropzone-title {
    font-family: var(--serif);
    font-size: 26px;
    line-height: 1.15;
    color: var(--ink);
    letter-spacing: -.2px;
  }
  .bp-dropzone-sub {
    font-size: 13.5px;
    color: var(--ink-muted);
    margin-bottom: 6px;
  }
  .bp-dropzone-divider {
    position: relative;
    width: 80%;
    max-width: 260px;
    margin: 14px 0 10px;
    text-align: center;
  }
  .bp-dropzone-divider:before {
    content: "";
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 1px;
    background: var(--line);
  }
  .bp-dropzone-divider span {
    position: relative;
    background: var(--surface);
    padding: 0 12px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink-muted);
  }
  .bp-demo-btn {
    background: var(--ink);
    color: var(--surface);
    padding: 12px 22px;
    border-radius: 999px;
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background .2s;
  }
  .bp-demo-btn:hover { background: var(--accent); }
  .bp-dropzone-meta {
    margin-top: 14px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink-faint);
  }

  /* ---- PROCESSING STATE ---- */
  .bp-state-processing {
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    min-height: 540px;
  }
  .bp-processing-inner {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 480px;
  }
  .bp-spinner {
    color: var(--accent);
    margin-bottom: 14px;
    animation: bp-spin 1.4s linear infinite;
  }
  @keyframes bp-spin {
    from { transform: rotate(0); }
    to   { transform: rotate(360deg); }
  }
  .bp-processing-title {
    font-family: var(--serif);
    font-size: 32px;
    font-weight: 400;
    line-height: 1.1;
    color: var(--ink);
    letter-spacing: -.3px;
  }
  .bp-processing-title .ital { font-style: italic; color: var(--accent); }
  .bp-processing-file {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .06em;
    color: var(--ink-muted);
    padding: 6px 14px;
    background: var(--surface-2);
    border-radius: 999px;
    margin-top: 4px;
  }
  .bp-processing-stages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 28px;
    padding: 22px 26px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    width: 100%;
  }
  .bp-stage {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13.5px;
    color: var(--ink-muted);
    text-align: left;
  }
  .bp-stage-marker {
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 1.5px solid var(--ink-faint);
    background: var(--surface);
    flex-shrink: 0;
    position: relative;
  }
  .bp-stage.done {
    color: var(--ok);
  }
  .bp-stage.done .bp-stage-marker {
    border-color: var(--ok);
    background: var(--ok);
  }
  .bp-stage.done .bp-stage-marker:after {
    content: "";
    position: absolute;
    top: 4px; left: 4px;
    width: 5px; height: 8px;
    border: 1.5px solid var(--surface);
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
    box-sizing: border-box;
  }
  .bp-stage.active {
    color: var(--accent);
    font-weight: 500;
  }
  .bp-stage.active .bp-stage-marker {
    border-color: var(--accent);
    background: var(--accent-tint);
    animation: bp-pulse 1.4s infinite;
  }
  @keyframes bp-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.18); }
  }

  /* ---- RESULTS STATE ---- */
  .bp-results-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    padding: 28px 32px 22px;
    border-bottom: 1px solid var(--line);
    gap: 20px;
  }
  .bp-result-file {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 8px;
  }
  .bp-result-title {
    font-family: var(--serif);
    font-size: 32px;
    font-weight: 400;
    line-height: 1.1;
    color: var(--ink);
    letter-spacing: -.3px;
  }
  .bp-result-title .ital.accent { font-style: italic; color: var(--accent); }
  .bp-result-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
  }
  .bp-btn-secondary, .bp-btn-primary {
    padding: 10px 18px;
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
  }
  .bp-btn-secondary {
    background: transparent;
    color: var(--ink-soft);
    border: 1px solid var(--line);
  }
  .bp-btn-secondary:hover { border-color: var(--ink); color: var(--ink); }
  .bp-btn-primary {
    background: var(--ink);
    color: var(--surface);
    border: 1px solid var(--ink);
  }
  .bp-btn-primary:hover { background: var(--accent); border-color: var(--accent); }

  .bp-summary-pills {
    display: flex;
    gap: 10px;
    padding: 20px 32px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
  }
  .bp-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-family: var(--mono);
    letter-spacing: .06em;
  }
  .bp-pill .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
  }
  .bp-pill strong {
    font-family: var(--sans);
    font-weight: 700;
    letter-spacing: 0;
    font-size: 13px;
  }
  .bp-pill.crit { background: var(--crit-tint); color: var(--crit); }
  .bp-pill.crit .dot { background: var(--crit); }
  .bp-pill.warn { background: var(--warn-tint); color: var(--warn); }
  .bp-pill.warn .dot { background: var(--warn); }
  .bp-pill.info { background: var(--info-tint); color: var(--info); }
  .bp-pill.info .dot { background: var(--info); }
  .bp-pill.time { background: var(--surface-2); color: var(--ink-muted); border: 1px solid var(--line); }

  .bp-workspace {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    min-height: 580px;
  }
  .bp-plan-area {
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    background: var(--surface-2);
  }
  .bp-plan-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .04em;
    color: var(--ink-muted);
  }
  .bp-plan-breadcrumb {
    text-transform: uppercase;
    letter-spacing: .12em;
  }
  .bp-plan-zoom {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .bp-zoom-btn {
    width: 24px; height: 24px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
    color: var(--ink-soft);
    cursor: pointer;
  }
  .bp-zoom-btn:hover { border-color: var(--ink); color: var(--ink); }
  .bp-zoom-level { min-width: 40px; text-align: center; }

  .bp-plan-container {
    position: relative;
    flex: 1;
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .bp-plan-bg {
    width: 100%;
    height: auto;
    max-height: 520px;
    display: block;
  }
  .bp-uploaded-img {
    max-width: 100%;
    max-height: 520px;
    display: block;
    border-radius: 4px;
  }

  /* ── Elevation group headers ──────────────────────────────── */
  .bp-elev-group {
    border-bottom: 1px solid var(--line);
  }
  .bp-elev-group:last-child {
    border-bottom: none;
  }
  .bp-elev-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 22px 12px;
    background: linear-gradient(to bottom, var(--surface-2), var(--surface));
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line-soft);
    position: sticky;
    top: 0;
    z-index: 2;
  }
  .bp-elev-group:first-child .bp-elev-header {
    border-top: none;
  }
  .bp-elev-header-main {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
  }
  .bp-elev-num {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    color: var(--surface);
    background: var(--ink);
    padding: 4px 10px;
    border-radius: 3px;
    flex-shrink: 0;
  }
  .bp-elev-num.general {
    background: var(--ink-muted);
  }
  .bp-elev-name {
    font-family: var(--serif);
    font-size: 17px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -.1px;
  }
  .bp-elev-count {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-muted);
    flex-shrink: 0;
  }
  .bp-elev-count strong {
    font-family: var(--sans);
    font-weight: 700;
    color: var(--ink);
    font-size: 12px;
    letter-spacing: 0;
    margin-right: 4px;
  }
  .bp-elev-sev-pills {
    display: flex;
    gap: 4px;
    margin-top: 8px;
  }
  .bp-elev-sev-pill {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 2px;
    font-weight: 600;
  }
  .bp-elev-sev-pill.crit { background: var(--crit-tint); color: var(--crit); }
  .bp-elev-sev-pill.warn { background: var(--warn-tint); color: var(--warn); }
  .bp-elev-sev-pill.info { background: var(--info-tint); color: var(--info); }
  .bp-elev-empty {
    padding: 60px 22px;
    text-align: center;
    color: var(--ink-muted);
    font-style: italic;
    font-family: var(--serif);
    font-size: 16px;
  }

  .bp-flag-panel {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    min-width: 0;
  }
  .bp-flag-panel-head {
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .bp-flag-panel-head-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
  }
  .bp-flag-panel-head h4 {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 400;
    color: var(--ink);
    line-height: 1.2;
  }
  .bp-flag-panel-head h4 .ital { font-style: italic; color: var(--accent); }
  .bp-flag-copy-btn {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
  }
  .bp-flag-copy-btn:hover { color: var(--ink); border-color: var(--ink); }
  .bp-filter-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }
  .bp-filter-tabs span {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-muted);
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--line);
    cursor: pointer;
    transition: all .15s;
  }
  .bp-filter-tabs span:hover { color: var(--ink); }
  .bp-filter-tabs span.active {
    background: var(--ink);
    color: var(--surface);
    border-color: var(--ink);
  }
  .bp-flag-items {
    flex: 1;
    overflow-y: auto;
    max-height: 620px;
  }
  .bp-flag-group-header {
    padding: 14px 22px 10px;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink-muted);
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .bp-flag-group-header:first-child { border-top: none; }
  .bp-flag-group-header .count {
    color: var(--ink-faint);
    letter-spacing: .08em;
  }

  .bp-flag-card {
    padding: 18px 22px;
    border-bottom: 1px solid var(--line-soft);
    transition: background .15s;
  }
  .bp-flag-card:hover { background: var(--surface-2); }
  .bp-flag-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }
  .bp-flag-sev-pill {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: 3px;
    font-weight: 600;
  }
  .bp-flag-sev-pill.crit { background: var(--crit-tint); color: var(--crit); }
  .bp-flag-sev-pill.warn { background: var(--warn-tint); color: var(--warn); }
  .bp-flag-sev-pill.info { background: var(--info-tint); color: var(--info); }
  .bp-flag-id-pill {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .08em;
    color: var(--ink-muted);
    background: var(--surface-2);
    padding: 3px 7px;
    border-radius: 3px;
    border: 1px solid var(--line);
  }
  .bp-flag-section-pill {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-left: auto;
  }
  .bp-flag-title {
    font-family: var(--serif);
    font-size: 17px;
    font-weight: 400;
    color: var(--ink);
    line-height: 1.3;
    margin-bottom: 12px;
  }
  .bp-flag-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
  }
  .bp-flag-row {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 12px;
    font-size: 12.5px;
    line-height: 1.5;
  }
  .bp-flag-row-label {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-faint);
    padding-top: 3px;
  }
  .bp-flag-row-value { color: var(--ink-soft); }
  .bp-flag-row-value.detected { color: var(--ink); font-weight: 500; }
  .bp-flag-row-value.required { color: var(--ink-soft); font-style: italic; }
  .bp-flag-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
  }
  .bp-flag-loc {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--ink-muted);
    letter-spacing: .03em;
    flex: 1;
    min-width: 0;
  }
  .bp-flag-action-btn {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 5px 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
  }
  .bp-flag-action-btn:hover { color: var(--ink); border-color: var(--ink); }
  .bp-flag-notes {
    margin-top: 4px;
    margin-bottom: 12px;
  }
  .bp-flag-notes summary {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-faint);
    cursor: pointer;
    padding: 4px 0;
    list-style: none;
    user-select: none;
  }
  .bp-flag-notes summary::-webkit-details-marker { display: none; }
  .bp-flag-notes summary::before {
    content: "↳ ";
    color: var(--ink-faint);
  }
  .bp-flag-notes summary:hover { color: var(--ink-muted); }
  .bp-flag-notes[open] summary::before { content: "↴ "; }
  .bp-flag-notes p {
    font-size: 12px;
    color: var(--ink-muted);
    line-height: 1.55;
    padding: 6px 0 0 14px;
    font-style: italic;
    border-left: 2px solid var(--line);
    margin-left: 4px;
    margin-top: 4px;
  }
  .bp-flag-empty {
    padding: 60px 22px;
    text-align: center;
    color: var(--ink-muted);
    font-style: italic;
    font-family: var(--serif);
    font-size: 16px;
  }

  @media (max-width: 1024px) {
    .container, .topbar-inner, .wide-container { padding: 0 28px; }
    .topbar-inner { padding: 14px 28px; }
    .top-nav { display: none; }
    .neo-hero { grid-template-columns: 1fr; gap: 30px; }
    .neo-hero-right { padding-top: 0; }
    .neo-stats-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
    .neo-stat { padding: 16px 20px; border-right: none; }
    .neo-stat:nth-child(1), .neo-stat:nth-child(2) { border-bottom: 1px solid var(--line); }
    .feature-head { grid-template-columns: 1fr; gap: 30px; }
    .blueprint-flow { grid-template-columns: 1fr; }
    .bp-upload-grid { grid-template-columns: 1fr; }
    .bp-upload-side { border-right: none; border-bottom: 1px solid var(--line); padding: 40px 32px; }
    .bp-upload-head { font-size: 44px; }
    .bp-workspace { grid-template-columns: 1fr; }
    .bp-plan-area { border-right: none; border-bottom: 1px solid var(--line); }
    .bp-flag-items { max-height: 400px; }
    .bp-results-head { flex-direction: column; align-items: flex-start; }
    .roadmap-grid { grid-template-columns: 1fr 1fr; }
    .foot-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  }
  @media (max-width: 700px) {
    .container, .topbar-inner, .wide-container { padding: 0 20px; }
    .massive-brand { font-size: clamp(100px, 30vw, 200px); }
    .neo-greeting { font-size: clamp(40px, 12vw, 64px); }
    .feature-title { font-size: clamp(56px, 18vw, 100px); }
    .neo-stats-grid { grid-template-columns: 1fr; gap: 0; }
    .neo-stat { padding: 16px 0; border-right: none; }
    .neo-stat:not(:last-child) { border-bottom: 1px solid var(--line); }
    .roadmap-grid { grid-template-columns: 1fr; }
    .chat-body { padding: 24px 20px; }
    .chat-msg { max-width: 95%; }
    .foot-grid { grid-template-columns: 1fr; }
    .foot-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
  }

  /* ===== NEW v24 — paste-from-clipboard + checklist mode ===== */

  /* keyboard hint in dropzone */
  .bp-kbd {
    display: inline-block;
    padding: 2px 6px;
    margin: 0 2px;
    font-family: var(--mono, monospace);
    font-size: 11px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow: 0 1px 0 var(--line);
    color: var(--ink-muted);
  }

  /* flash overlay when paste is detected */
  .bp-paste-flash {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--ink);
    color: var(--bg);
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
  }
  .bp-paste-flash.show { opacity: 1; }

  /* modal — plan type selector */
  .bp-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 22, 28, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: bpFadeIn .18s ease-out;
  }
  .bp-modal-backdrop.open { display: flex; }
  @keyframes bpFadeIn { from { opacity: 0; } to { opacity: 1; } }
  @keyframes bpSlideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

  .bp-modal {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 14px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: bpSlideUp .25s ease-out;
  }
  .bp-modal-head {
    padding: 24px 28px 18px;
    border-bottom: 1px solid var(--line);
  }
  .bp-modal-eyebrow {
    font-family: var(--mono, monospace);
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 6px;
  }
  .bp-modal-title {
    font-family: var(--serif);
    font-size: 26px;
    line-height: 1.15;
    color: var(--ink);
    margin: 0;
  }
  .bp-modal-title .ital { font-style: italic; color: var(--accent); }
  .bp-modal-sub {
    margin-top: 6px;
    font-size: 13px;
    color: var(--ink-muted);
  }
  .bp-modal-body { padding: 22px 28px; }
  .bp-modal-preview {
    margin: 0 0 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
  }
  .bp-modal-preview img {
    display: block;
    max-width: 100%;
    max-height: 220px;
    margin: 0 auto;
    object-fit: contain;
  }
  .bp-modal-preview-meta {
    padding: 8px 12px;
    font-family: var(--mono, monospace);
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--ink-muted);
    border-top: 1px solid var(--line);
    background: var(--bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .bp-modal-preview-meta .bp-paste-badge {
    background: var(--accent);
    color: var(--bg);
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 600;
  }

  .bp-plantype-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
  }
  .bp-plantype-card {
    border: 1px solid var(--line);
    background: var(--bg);
    border-radius: 8px;
    padding: 14px 16px;
    cursor: pointer;
    text-align: left;
    transition: all .15s;
    font-family: inherit;
    color: var(--ink);
  }
  .bp-plantype-card:hover {
    border-color: var(--accent);
    background: var(--surface);
  }
  .bp-plantype-card.selected {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--accent);
  }
  .bp-plantype-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 3px;
  }
  .bp-plantype-rules {
    font-family: var(--mono, monospace);
    font-size: 10.5px;
    letter-spacing: 0.5px;
    color: var(--ink-muted);
  }

  .bp-modal-context {
    margin-bottom: 14px;
  }
  .bp-modal-context-label {
    display: block;
    font-size: 12px;
    color: var(--ink-muted);
    margin-bottom: 6px;
  }
  .bp-modal-context-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    color: var(--ink);
    background: var(--bg);
    box-sizing: border-box;
  }
  .bp-modal-context-input:focus {
    outline: none;
    border-color: var(--accent);
  }

  .bp-modal-foot {
    padding: 18px 28px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: var(--surface);
  }
  .bp-modal-btn {
    padding: 10px 22px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg);
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
  }
  .bp-modal-btn:hover { background: var(--surface); }
  .bp-modal-btn.primary {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
  }
  .bp-modal-btn.primary:hover { opacity: .9; }
  .bp-modal-btn.primary:disabled {
    background: var(--ink-faint, #ccc);
    border-color: var(--ink-faint, #ccc);
    cursor: not-allowed;
  }

  /* ===== checklist mode renderer ===== */
  .bp-checklist {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  .bp-checklist-intro {
    padding: 14px 18px;
    background: var(--surface);
    border-left: 3px solid var(--accent);
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: var(--ink-muted);
    line-height: 1.5;
  }
  .bp-checklist-intro strong { color: var(--ink); }

  .bp-bucket {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg);
  }
  .bp-bucket-head {
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
  }
  .bp-bucket-icon {
    width: 22px; height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
  }
  .bp-bucket-icon.high   { background: #d4f4dd; color: #1e7a3c; }
  .bp-bucket-icon.review { background: #fff3cf; color: #8a6500; }
  .bp-bucket-icon.dim    { background: #d6e4ff; color: #2a4d8f; }
  .bp-bucket-count {
    margin-left: auto;
    font-family: var(--mono, monospace);
    font-size: 11px;
    color: var(--ink-muted);
    font-weight: 400;
  }
  .bp-bucket-body { padding: 4px 0; }
  .bp-bucket-empty {
    padding: 14px 18px;
    font-size: 12px;
    color: var(--ink-muted);
    font-style: italic;
  }

  .bp-check-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
  }
  .bp-check-item:last-child { border-bottom: none; }
  .bp-check-mark {
    width: 18px; height: 18px;
    border-radius: 4px;
    border: 1.5px solid var(--line);
    background: var(--bg);
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
    transition: all .15s;
    position: relative;
  }
  .bp-check-mark.checked {
    background: var(--ink);
    border-color: var(--ink);
  }
  .bp-check-mark.checked::after {
    content: '';
    position: absolute;
    top: 2px; left: 5px;
    width: 4px; height: 8px;
    border: solid var(--bg);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }
  .bp-check-body { min-width: 0; }
  .bp-check-row1 {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 4px;
  }
  .bp-check-rule {
    font-family: var(--mono, monospace);
    font-size: 11px;
    background: var(--surface);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--ink);
    letter-spacing: 0.5px;
  }
  .bp-check-sev {
    font-family: var(--mono, monospace);
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
  }
  .bp-check-sev.critical { background: #fce4e4; color: #a8252e; }
  .bp-check-sev.warning  { background: #fff3cf; color: #8a6500; }
  .bp-check-sev.info     { background: #d6e4ff; color: #2a4d8f; }
  .bp-check-text {
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--ink);
    margin-bottom: 4px;
  }
  .bp-check-meta {
    font-size: 12px;
    color: var(--ink-muted);
    line-height: 1.45;
  }
  .bp-check-meta b { color: var(--ink); font-weight: 600; }
  .bp-check-evidence {
    margin-top: 4px;
    padding: 6px 10px;
    background: var(--surface);
    border-radius: 4px;
    font-size: 12px;
    color: var(--ink-muted);
    border-left: 2px solid var(--line);
  }
  .bp-check-evidence.dim-discrepancy {
    border-left-color: #c46a13;
    background: #fff8ed;
    color: #6a3f00;
  }

  /* Elements detected pill row */
  .bp-elements-detected {
    padding: 12px 16px;
    background: var(--surface);
    border-radius: 8px;
    font-size: 12px;
    color: var(--ink-muted);
  }
  .bp-elements-detected b { color: var(--ink); }
  .bp-elements-pills {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .bp-element-pill {
    background: var(--bg);
    border: 1px solid var(--line);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    color: var(--ink);
    font-family: var(--mono, monospace);
  }

  @media (max-width: 700px) {
    .bp-plantype-grid { grid-template-columns: 1fr; }
    .bp-modal-head, .bp-modal-body, .bp-modal-foot { padding-left: 20px; padding-right: 20px; }
    .bp-modal-title { font-size: 22px; }
  }

  /* ===== NEW v25 — Reference library mode ===== */
  .blueprint-app.blueprint-ref {
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 1px 0 var(--line);
  }

  /* Toolbar with view-type tabs */
  .bp-ref-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .bp-ref-toolbar-label {
    font-family: var(--mono, monospace);
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ink-muted);
  }
  .bp-ref-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .bp-ref-tab {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    text-align: left;
    transition: all .15s;
    font-family: inherit;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 140px;
  }
  .bp-ref-tab:hover:not(.disabled) {
    border-color: var(--accent);
    background: var(--surface);
  }
  .bp-ref-tab.active {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--bg);
  }
  .bp-ref-tab.active .bp-ref-tab-meta {
    color: rgba(255,255,255,0.7);
  }
  .bp-ref-tab.disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }
  .bp-ref-tab-name {
    font-size: 13px;
    font-weight: 600;
  }
  .bp-ref-tab-meta {
    font-family: var(--mono, monospace);
    font-size: 10.5px;
    letter-spacing: 0.5px;
    color: var(--ink-muted);
  }

  /* Roadmap: escalable a otras disciplinas */
  .bp-ref-roadmap {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
  }
  .bp-ref-roadmap-label {
    font-family: var(--mono, monospace);
    font-size: 10px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .bp-ref-roadmap-badge {
    background: rgba(168, 130, 50, 0.15);
    color: #a88232;
    border: 1px solid rgba(168, 130, 50, 0.35);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 9px;
    letter-spacing: 0.8px;
  }
  .bp-ref-roadmap-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .bp-ref-roadmap-tab {
    background: transparent;
    border: 1px dashed var(--line);
    border-radius: 6px;
    padding: 7px 12px;
    cursor: not-allowed;
    text-align: left;
    font-family: inherit;
    color: var(--ink-muted);
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 100px;
    opacity: 0.7;
  }
  .bp-ref-roadmap-tab:hover {
    opacity: 0.9;
    background: rgba(168, 130, 50, 0.04);
  }
  .bp-ref-roadmap-tab-name {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
  }
  .bp-ref-roadmap-tab-meta {
    font-family: var(--mono, monospace);
    font-size: 9.5px;
    letter-spacing: 0.4px;
    color: var(--ink-muted);
  }

  /* Main 2-column layout */
  .bp-ref-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    align-items: start;
  }
  @media (max-width: 900px) {
    .bp-ref-layout { grid-template-columns: 1fr; }
  }

  /* LEFT: plan column */
  .bp-ref-plan-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .bp-ref-plan-head {
    padding-bottom: 8px;
  }
  .bp-ref-plan-title {
    font-family: var(--serif);
    font-size: 22px;
    line-height: 1.1;
    color: var(--ink);
    margin-bottom: 4px;
  }
  .bp-ref-plan-source {
    font-family: var(--mono, monospace);
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--ink-muted);
  }
  .bp-ref-plan-wrap {
    position: relative;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: hidden;
    aspect-ratio: 900 / 787;
  }
  .bp-ref-plan-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: none;
    outline: none;
    transition: transform .25s cubic-bezier(.4, 0, .2, 1);
  }

  /* Highlight overlay — marker style (solo fill, sin borde) */
  .bp-ref-highlight {
    position: absolute;
    border: none;
    background: rgba(168, 37, 46, 0.22); /* default: critical red */
    border-radius: 3px;
    pointer-events: none;
    transition: transform .25s cubic-bezier(.4, 0, .2, 1), all .15s ease-out;
    z-index: 2;
    animation: bpRefPulse 1.6s ease-in-out infinite;
  }
  .bp-ref-highlight.critical {
    background: rgba(168, 37, 46, 0.22);
  }
  .bp-ref-highlight.warning {
    background: rgba(196, 106, 19, 0.25);
  }
  .bp-ref-highlight.info {
    background: rgba(42, 77, 143, 0.22);
  }
  @keyframes bpRefPulse {
    0%, 100% { opacity: 0.95; }
    50% { opacity: 0.65; }
  }

  /* Tooltip — color matches severity */
  .bp-ref-tooltip {
    position: absolute;
    transform: translate(-50%, calc(-100% - 8px));
    background: #1a1a1a;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-family: var(--mono, monospace);
    font-size: 11px;
    letter-spacing: 0.3px;
    pointer-events: none;
    white-space: nowrap;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 3;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  }
  .bp-ref-tooltip.critical { background: #a8252e; }
  .bp-ref-tooltip.warning  { background: #8a6500; }
  .bp-ref-tooltip.info     { background: #2a4d8f; }

  .bp-ref-plan-foot {
    font-size: 12px;
    color: var(--ink-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 4px;
  }
  .bp-ref-foot-dot {
    width: 6px; height: 6px;
    background: var(--accent, #c46a13);
    border-radius: 50%;
    flex-shrink: 0;
  }

  /* RIGHT: checklist column */
  .bp-ref-list-col {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg);
    max-height: 720px;
  }
  .bp-ref-list-head {
    padding: 16px 18px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }
  .bp-ref-list-eyebrow {
    font-family: var(--mono, monospace);
    font-size: 10.5px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 4px;
  }
  .bp-ref-list-title {
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.2;
    color: var(--ink);
    margin-bottom: 10px;
  }
  .bp-ref-list-title .ital { font-style: italic; color: var(--accent, #c46a13); }
  .bp-ref-list-progress {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .bp-ref-progress-bar {
    flex: 1;
    height: 5px;
    background: var(--line);
    border-radius: 3px;
    overflow: hidden;
  }
  .bp-ref-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent, #c46a13), #1e7a3c);
    transition: width .3s ease-out;
  }
  .bp-ref-progress-text {
    font-family: var(--mono, monospace);
    font-size: 11px;
    color: var(--ink-muted);
    min-width: 50px;
    text-align: right;
  }

  .bp-ref-list-body {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
  }

  .bp-ref-item {
    padding: 12px 16px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
    border-bottom: 1px solid var(--line);
    cursor: default;
    transition: background .12s;
  }
  .bp-ref-item:last-child { border-bottom: none; }
  .bp-ref-item:hover {
    background: var(--surface);
  }
  .bp-ref-item.done {
    opacity: 0.55;
  }
  .bp-ref-item.done .bp-ref-item-short,
  .bp-ref-item.done .bp-ref-item-full {
    text-decoration: line-through;
    text-decoration-color: var(--ink-muted);
  }

  .bp-ref-check {
    width: 20px; height: 20px;
    border-radius: 5px;
    border: 1.5px solid var(--line);
    background: var(--bg);
    flex-shrink: 0;
    margin-top: 1px;
    cursor: pointer;
    transition: all .15s;
    position: relative;
  }
  .bp-ref-check:hover { border-color: var(--ink); }
  .bp-ref-check.checked {
    background: var(--ink);
    border-color: var(--ink);
  }
  .bp-ref-check.checked::after {
    content: '';
    position: absolute;
    top: 3px; left: 6px;
    width: 5px; height: 9px;
    border: solid var(--bg);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }

  .bp-ref-item-body { min-width: 0; }
  .bp-ref-item-head {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 5px;
  }
  .bp-ref-item-rule {
    font-family: var(--mono, monospace);
    font-size: 10.5px;
    background: var(--surface);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--ink);
    letter-spacing: 0.5px;
  }
  .bp-ref-item-sev {
    font-family: var(--mono, monospace);
    font-size: 9.5px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
  }
  .bp-ref-item-sev.critical { background: #fce4e4; color: #a8252e; }
  .bp-ref-item-sev.warning  { background: #fff3cf; color: #8a6500; }
  .bp-ref-item-sev.info     { background: #d6e4ff; color: #2a4d8f; }
  .bp-ref-item-short {
    font-size: 13.5px;
    line-height: 1.35;
    color: var(--ink);
    margin-bottom: 3px;
    font-weight: 500;
  }
  .bp-ref-item-full {
    font-size: 12px;
    color: var(--ink-muted);
    line-height: 1.45;
  }

  .bp-ref-list-foot {
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 11.5px;
  }
  .bp-ref-reset {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 12px;
    color: var(--ink);
    cursor: pointer;
    transition: all .15s;
  }
  .bp-ref-reset:hover {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
  }
  .bp-ref-foot-note {
    color: var(--ink-muted);
    font-style: italic;
  }

  /* ===== NEW v25 — Chat suggested-question chips ===== */
  .chat-suggested {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
  }
  .chat-suggested-label {
    font-family: var(--mono, monospace);
    font-size: 10.5px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 8px;
  }
  .chat-suggested-chips {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .chat-suggested-chip {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 8px 14px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    color: var(--ink);
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.3;
  }
  .chat-suggested-chip:hover {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
    transform: translateX(2px);
  }
  .chat-suggested-chip:hover .chat-suggested-arrow {
    color: var(--bg);
  }
  .chat-suggested-arrow {
    font-size: 14px;
    color: var(--accent, #c46a13);
    flex-shrink: 0;
    transition: color .15s;
  }

  /* ===== NEW v25 — Edit mode (coord picker) ===== */
  .bp-ref-toolbar {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
  }
  .bp-ref-toolbar-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .bp-ref-edit-toggle {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all .15s;
    white-space: nowrap;
  }
  .bp-ref-edit-toggle:hover {
    background: var(--surface);
  }
  .bp-ref-edit-toggle-icon {
    font-size: 14px;
    color: var(--ink-muted);
  }
  /* When edit mode active */
  .blueprint-app[data-edit="on"] .bp-ref-edit-toggle {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
  }
  .blueprint-app[data-edit="on"] .bp-ref-edit-toggle-icon {
    color: #fff;
  }

  /* Hide regular checklist hover behavior in edit mode (visual cue) */
  .blueprint-app[data-edit="on"] .bp-ref-plan-wrap {
    cursor: grab;
    outline: 2px dashed #1a1a1a;
    outline-offset: 4px;
  }

  /* Editable rectangles — visible only in edit mode */
  .bp-ref-edit-rect {
    position: absolute;
    background: rgba(168, 37, 46, 0.10);
    border: 2px dashed #a8252e;
    cursor: move;
    z-index: 4;
    user-select: none;
    box-sizing: border-box;
  }
  .bp-ref-edit-rect.warning {
    background: rgba(196, 106, 19, 0.10);
    border-color: #c46a13;
  }
  .bp-ref-edit-rect.info {
    background: rgba(42, 77, 143, 0.10);
    border-color: #2a4d8f;
  }
  .bp-ref-edit-rect:hover {
    background-color: rgba(0, 0, 0, 0.06);
  }
  .bp-ref-edit-rect.active {
    background-color: rgba(0, 0, 0, 0.12);
    border-style: solid;
    z-index: 5;
  }
  .bp-ref-edit-label {
    position: absolute;
    top: -22px;
    left: 0;
    background: #1a1a1a;
    color: #fff;
    padding: 2px 7px;
    border-radius: 3px;
    font-family: var(--mono, monospace);
    font-size: 10px;
    letter-spacing: 0.3px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 5;
  }
  .bp-ref-edit-handle {
    position: absolute;
    bottom: -7px;
    right: -7px;
    width: 14px;
    height: 14px;
    background: #1a1a1a;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: nwse-resize;
    z-index: 6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  }

  /* Coords panel */
  .bp-ref-coords-panel {
    margin-top: 16px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
  }
  .bp-ref-coords-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
  }
  .bp-ref-coords-eyebrow {
    font-family: var(--mono, monospace);
    font-size: 10.5px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 3px;
  }
  .bp-ref-coords-title {
    font-family: var(--serif);
    font-size: 16px;
    color: var(--ink);
  }
  .bp-ref-copy-coords {
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12.5px;
    transition: opacity .15s;
    white-space: nowrap;
  }
  .bp-ref-copy-coords:hover { opacity: 0.85; }
  .bp-ref-copy-coords.copied {
    background: #1e7a3c;
  }
  .bp-ref-coords-output {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px;
    font-family: var(--mono, monospace);
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--ink);
    max-height: 240px;
    overflow: auto;
    margin: 0;
    white-space: pre;
  }
  .bp-ref-coords-help {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--ink-muted);
  }

  @media (max-width: 700px) {
    .bp-ref-toolbar { flex-direction: column; align-items: stretch; }
    .bp-ref-coords-head { flex-direction: column; }
  }

  /* Sub-selector — chips compactos para múltiples planos dentro de una tab */
  .bp-ref-sub-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: -8px;
    padding: 10px 0 0;
    border-top: 1px dashed var(--line);
  }
  .bp-ref-sub-tab {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 5px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    color: var(--ink-muted);
    transition: all .15s;
    white-space: nowrap;
  }
  .bp-ref-sub-tab:hover {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--ink);
  }
  .bp-ref-sub-tab.active {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
  }

  /* ===== PDF Cropper Modal ===== */
  .bp-ref-coords-actions {
    display: flex;
    gap: 8px;
  }
  .bp-ref-pdf-btn {
    background: var(--bg);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 14px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12.5px;
    transition: all .15s;
    white-space: nowrap;
  }
  .bp-ref-pdf-btn:hover {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
  }

  .bp-pdf-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .bp-pdf-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
  }
  .bp-pdf-dialog {
    position: relative;
    background: var(--bg);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 1100px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .bp-pdf-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
  }
  .bp-pdf-eyebrow {
    font-family: var(--mono, monospace);
    font-size: 10.5px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ink-muted);
  }
  .bp-pdf-title {
    font-family: var(--serif);
    font-size: 22px;
    color: var(--ink);
    margin-top: 2px;
  }
  .bp-pdf-close {
    background: var(--surface);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    color: var(--ink-muted);
    transition: all .15s;
  }
  .bp-pdf-close:hover {
    background: var(--ink);
    color: var(--bg);
  }

  /* Upload state */
  .bp-pdf-state-upload {
    padding: 40px;
    display: flex;
    justify-content: center;
  }
  .bp-pdf-drop-zone {
    width: 100%;
    max-width: 500px;
    padding: 60px 30px;
    border: 2.5px dashed var(--line);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: var(--surface);
  }
  .bp-pdf-drop-zone:hover {
    border-color: var(--ink);
    background: var(--bg);
  }
  .bp-pdf-drop-icon {
    font-size: 48px;
    margin-bottom: 12px;
  }
  .bp-pdf-drop-text {
    font-family: var(--serif);
    font-size: 18px;
    color: var(--ink);
    margin-bottom: 8px;
  }
  .bp-pdf-drop-sub {
    font-size: 13px;
    color: var(--ink-muted);
    line-height: 1.4;
  }

  /* Crop state */
  .bp-pdf-state-crop {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
  }
  /* Force hidden attribute to win over display:flex */
  .bp-pdf-state-crop[hidden],
  .bp-pdf-state-upload[hidden],
  .bp-pdf-modal[hidden],
  .bp-pdf-selection[hidden] {
    display: none !important;
  }
  .bp-pdf-toolbar {
    padding: 12px 22px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
  }
  .bp-pdf-page-controls {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .bp-pdf-page-btn {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 18px;
    font-family: inherit;
    color: var(--ink);
    transition: all .15s;
  }
  .bp-pdf-page-btn:hover:not(:disabled) {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
  }
  .bp-pdf-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }
  .bp-pdf-page-info {
    font-family: var(--mono, monospace);
    font-size: 12px;
    color: var(--ink-muted);
  }
  .bp-pdf-page-info strong {
    color: var(--ink);
    font-weight: 600;
  }
  .bp-pdf-actions {
    display: flex;
    gap: 8px;
  }
  .bp-pdf-reset-btn {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 7px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    color: var(--ink);
    transition: all .15s;
  }
  .bp-pdf-reset-btn:hover {
    background: var(--surface);
  }
  .bp-pdf-download-btn {
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 7px 14px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12.5px;
    transition: opacity .15s;
  }
  .bp-pdf-download-btn:hover:not(:disabled) {
    opacity: 0.85;
  }
  .bp-pdf-download-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }
  .bp-pdf-download-btn.downloaded {
    background: #1e7a3c;
  }

  .bp-pdf-canvas-wrap {
    flex: 1;
    overflow: auto;
    background: #f4f4f4;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
  }
  .bp-pdf-canvas-wrap canvas {
    display: block;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    cursor: crosshair;
    user-select: none;
  }
  .bp-pdf-selection {
    position: absolute;
    border: 2px solid #1a1a1a;
    background: rgba(196, 106, 19, 0.15);
    pointer-events: none;
    z-index: 5;
    box-shadow: 0 0 0 2000px rgba(255, 255, 255, 0.4);
  }

  .bp-pdf-foot {
    padding: 12px 22px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--ink-muted);
    flex-shrink: 0;
    background: var(--surface);
  }

  @media (max-width: 700px) {
    .bp-pdf-dialog { max-height: 95vh; }
    .bp-pdf-toolbar { flex-direction: column; align-items: stretch; }
    .bp-ref-coords-actions { flex-direction: column; }
  }