
  :root {
    box-sizing: border-box;
    --bg: #EFE7D3;
    --bg-2: #E6DCC1;
    --rail: #E8DEC4;
    --desk-line: rgba(33,28,21,0.11);
    --paper: #FBF7EC;
    --paper-2: #F1EADA;
    --ink: #211C15;
    --ink-soft: #62563F;
    --ink-faint: #6B614B;
    --text: #211C15;
    --text-soft: #5B5142;
    --text-faint: #675D48;
    --title-color: #8A2E2E;
    --title-on-paper: #8A2E2E;
    --accent-mentor: #7A2E2E;
    --accent-framework: #8B6B2E;
    --accent-mentoria: #33526B;
    --accent-caso: #446B4A;
    --accent-dr: #5E3A6B;
    --accent-viral: #2B6A6C;
    --a-mentor: #7A2E2E;
    --a-framework: #8B6B2E;
    --a-mentoria: #33526B;
    --a-caso: #446B4A;
    --a-dr: #5E3A6B;
    --a-viral: #2B6A6C;
    --on-accent: #FBF7EC;
    --scrim: rgba(24,19,12,0.82);
    --bar: rgba(239,231,211,0.9);
    --shadow: 0 1px 2px rgba(33,28,21,0.08), 0 8px 24px rgba(33,28,21,0.10);
    --shadow-lift: 0 2px 4px rgba(33,28,21,0.10), 0 16px 34px rgba(33,28,21,0.18);
    --gutter: 1rem;
    --tile-w: 138px;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #14161C;
      --bg-2: #1B1E26;
      --rail: #101217;
      --desk-line: rgba(231,225,210,0.10);
      --paper: #F3ECDC;
      --paper-2: #EAE1CC;
      --ink: #221D16;
      --ink-soft: #55492F;
      --ink-faint: #665B43;
      --text: #F2ECDD;
      --text-soft: #C6BEAA;
      --text-faint: #9A917C;
      --title-color: #E3B341;
      --a-mentor: #D4776D;
      --a-framework: #D1AA55;
      --a-mentoria: #7BA5CB;
      --a-caso: #86B18C;
      --a-dr: #B995CC;
      --a-viral: #6CBBBD;
      --scrim: rgba(6,7,10,0.88);
      --bar: rgba(20,22,28,0.9);
      --shadow: 0 1px 2px rgba(0,0,0,0.35), 0 12px 32px rgba(0,0,0,0.45);
      --shadow-lift: 0 2px 4px rgba(0,0,0,0.4), 0 20px 40px rgba(0,0,0,0.55);
      color-scheme: dark;
    }
  }
  :root[data-theme="dark"] {
    --bg: #14161C;
    --bg-2: #1B1E26;
    --rail: #101217;
    --desk-line: rgba(231,225,210,0.10);
    --paper: #F3ECDC;
    --paper-2: #EAE1CC;
    --ink: #221D16;
    --ink-soft: #55492F;
    --ink-faint: #665B43;
    --text: #F2ECDD;
    --text-soft: #C6BEAA;
    --text-faint: #9A917C;
    --title-color: #E3B341;
    --a-mentor: #D4776D;
    --a-framework: #D1AA55;
    --a-mentoria: #7BA5CB;
    --a-caso: #86B18C;
    --a-dr: #B995CC;
    --a-viral: #6CBBBD;
    --scrim: rgba(6,7,10,0.88);
    --bar: rgba(20,22,28,0.9);
    --shadow: 0 1px 2px rgba(0,0,0,0.35), 0 12px 32px rgba(0,0,0,0.45);
    --shadow-lift: 0 2px 4px rgba(0,0,0,0.4), 0 20px 40px rgba(0,0,0,0.55);
    color-scheme: dark;
  }
  html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 4rem); }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
  }
  [hidden] { display: none !important; }
  a { color: inherit; }
  button { font-family: inherit; }
  :focus-visible { outline: 2px solid var(--a-mentoria); outline-offset: 2px; }
  .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
  .cat-mentor { --acc: var(--accent-mentor); --acc-desk: var(--a-mentor); }
  .cat-framework { --acc: var(--accent-framework); --acc-desk: var(--a-framework); }
  .cat-mentoria { --acc: var(--accent-mentoria); --acc-desk: var(--a-mentoria); }
  .cat-caso { --acc: var(--accent-caso); --acc-desk: var(--a-caso); }
  .cat-dr { --acc: var(--accent-dr); --acc-desk: var(--a-dr); }
  .cat-viral { --acc: var(--accent-viral); --acc-desk: var(--a-viral); }

  /* ---------- casca do app ---------- */
  .app { min-height: 100vh; }
  .stage { min-width: 0; overflow-x: clip; }
  .view { max-width: 1240px; margin: 0 auto; padding: 0.9rem var(--gutter) calc(6.2rem + env(safe-area-inset-bottom, 0px)); }
  .view.enter { animation: view-in .26s ease both; }
  @keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

  .rail { display: none; }
  .topbar {
    position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem var(--gutter);
    background: var(--bar);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--desk-line);
  }
  .brand-m { display: flex; align-items: center; gap: 0.55rem; text-decoration: none; margin-right: auto; min-width: 0; min-height: 44px; }
  .brand-mark {
    width: 30px; height: 30px; border-radius: 9px; flex: none;
    background: var(--accent-mentor); color: var(--on-accent);
    display: grid; place-items: center;
    font-family: 'Fraunces', serif; font-weight: 700; font-size: 1.05rem; line-height: 1;
  }
  .brand-name { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.12rem; color: var(--title-color); white-space: nowrap; }
  .top-act {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    min-width: 42px; height: 42px; padding: 0 0.7rem; border-radius: 999px;
    border: 1px solid var(--desk-line); background: var(--paper); color: var(--ink);
    cursor: pointer; text-decoration: none; font-size: 0.84rem; font-weight: 500;
    box-shadow: var(--shadow);
  }
  .top-act .lbl { display: none; }
  body.is-sub .topbar { display: none; }

  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    background: var(--bar);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-top: 1px solid var(--desk-line);
  }
  .tab-i {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.18rem;
    min-height: 52px; border-radius: 14px; text-decoration: none;
    color: var(--text-faint); font-size: 0.68rem; font-weight: 500;
  }
  .tab-i[aria-current="page"] { color: var(--title-color); }
  .tab-i[aria-current="page"] .ico { stroke-width: 2.3; }
  .tab-i .ico { width: 23px; height: 23px; }

  @media (min-width: 900px) {
    :root { --gutter: 2.4rem; --tile-w: 172px; }
    .app { display: grid; grid-template-columns: 252px minmax(0, 1fr); }
    .rail {
      display: flex; flex-direction: column; gap: 1.4rem;
      position: sticky; top: 0; height: 100vh; overflow-y: auto;
      padding: 1.6rem 1.1rem 1.3rem;
      background: var(--rail); border-right: 1px solid var(--desk-line);
    }
    .tabbar { display: none; }
    .topbar { position: static; background: transparent; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 1.3rem var(--gutter) 0; max-width: 1240px; margin: 0 auto; }
    .brand-m { display: none; }
    .topbar { justify-content: flex-end; }
    .top-act .lbl { display: inline; }
    .top-act.wide { min-width: 280px; justify-content: flex-start; color: var(--ink-faint); }
    .top-act.wide kbd { margin-left: auto; font: inherit; font-size: 0.7rem; border: 1px solid var(--desk-line); border-radius: 6px; padding: 0.05rem 0.4rem; }
    body.is-sub .topbar { display: flex; }
    .view { padding-bottom: 4rem; padding-top: 0.6rem; }
    .view.inner { padding-top: 0; }
  }
  @media (min-width: 900px) and (hover: hover) { .topbar { min-height: 66px; } }

  .rail-brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; padding: 0 0.4rem; }
  .rail-brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 1.3rem; }
  .rail-brand b { display: block; font-family: 'Fraunces', serif; font-size: 1.22rem; line-height: 1.05; color: var(--title-color); font-weight: 600; }
  .rail-brand small { display: block; margin-top: 0.15rem; font-size: 0.68rem; line-height: 1.25; color: var(--text-faint); }
  .rail-nav { display: flex; flex-direction: column; gap: 0.15rem; }
  .rail-h { font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); padding: 0 0.7rem; margin: 0 0 0.35rem; }
  .rail-i {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.55rem 0.7rem; border-radius: 11px; text-decoration: none;
    color: var(--text-soft); font-size: 0.9rem; font-weight: 500;
  }
  .rail-i:hover { background: rgba(127,112,80,0.12); color: var(--text); }
  .rail-i[aria-current="page"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
  .rail-i .n { margin-left: auto; font-size: 0.74rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
  .rail-i[aria-current="page"] .n { color: var(--ink-faint); }
  .rail-i .dot { color: var(--acc-desk); }
  .rail-foot { margin-top: auto; padding: 0 0.7rem; font-size: 0.72rem; color: var(--text-faint); line-height: 1.4; }

  /* ---------- botoes e chips ---------- */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    min-height: 44px; padding: 0.5rem 1.1rem; border-radius: 999px;
    border: 1px solid var(--desk-line); background: var(--paper); color: var(--ink);
    font-size: 0.88rem; font-weight: 600; cursor: pointer; text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease;
  }
  .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
  .btn.primary { background: var(--acc, var(--accent-mentor)); color: var(--on-accent); border-color: transparent; }
  .btn.ghost { background: transparent; color: var(--text); border-color: var(--desk-line); }
  .btn[aria-pressed="true"] .ico { fill: currentColor; }
  .chips { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.15rem var(--gutter) 0.35rem; margin-inline: calc(var(--gutter) * -1); scrollbar-width: none; scroll-padding-inline: var(--gutter); }
  .chips::-webkit-scrollbar { display: none; }
  .chip {
    flex: none; display: inline-flex; align-items: center; gap: 0.45rem;
    min-height: 40px; padding: 0.35rem 0.95rem; border-radius: 999px;
    border: 1px solid var(--desk-line); background: transparent; color: var(--text-soft);
    font-size: 0.86rem; font-weight: 500; cursor: pointer;
  }
  .chip .dot { color: var(--acc-desk); }
  .chip .count { color: var(--text-faint); font-variant-numeric: tabular-nums; font-size: 0.78rem; }
  .chip.active { background: var(--paper); color: var(--ink); border-color: transparent; box-shadow: var(--shadow); }
  .chip.active .count { color: var(--ink-faint); }

  /* ---------- barra de app nas telas internas ---------- */
  .appbar {
    position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
    display: flex; align-items: center; gap: 0.5rem;
    margin: 0 calc(var(--gutter) * -1) 1rem; padding: 0.55rem var(--gutter);
    background: var(--bar);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--desk-line);
  }
  .ab-btn {
    flex: none; width: 42px; height: 42px; border-radius: 50%;
    display: inline-grid; place-items: center; cursor: pointer;
    border: 1px solid var(--desk-line); background: var(--paper); color: var(--ink);
    box-shadow: var(--shadow); padding: 0; text-decoration: none;
  }
  .ab-btn[disabled] { opacity: 0.35; cursor: default; }
  .ab-btn[aria-pressed="true"] .ico { fill: var(--accent-mentor); stroke: var(--accent-mentor); }
  .ab-crumb { flex: 1; min-width: 0; line-height: 1.2; }
  .ab-crumb small { display: block; font-size: 0.68rem; color: var(--text-faint); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ab-crumb b { display: block; font-family: 'Fraunces', serif; font-weight: 600; font-size: 0.98rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ab-pos { font-size: 0.74rem; color: var(--text-faint); font-variant-numeric: tabular-nums; white-space: nowrap; padding: 0 0.15rem; }
  @media (min-width: 900px) {
    .appbar { margin-top: 0; padding-top: 0.9rem; padding-bottom: 0.9rem; }
  }

  /* ---------- titulos de tela ---------- */
  .page-h { display: flex; flex-direction: column; gap: 0.35rem; margin: 0.6rem 0 1.2rem; }
  .page-h .kicker { font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }
  h1, .page-h h1 {
    font-family: 'Fraunces', serif; font-optical-sizing: auto; font-weight: 600;
    font-size: clamp(1.75rem, 5vw, 2.6rem); line-height: 1.06; margin: 0; color: var(--title-color); text-wrap: balance;
  }
  .sub { color: var(--text-soft); font-size: 0.96rem; max-width: 46em; line-height: 1.5; margin: 0.2rem 0 0; }
  .empty-state { text-align: center; padding: 3.2rem 1rem; color: var(--text-faint); font-size: 0.92rem; }

  /* ---------- pôsteres (acervos) ---------- */
  .poster { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; text-decoration: none; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .poster-art, .tile-art {
    position: relative; overflow: hidden; border-radius: 12px; background: var(--paper-2);
    box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease;
  }
  .poster-art { aspect-ratio: 3 / 4; }
  .tile-art { aspect-ratio: 4 / 5; }
  .poster:hover .poster-art, .poster:focus-visible .poster-art, .tile:hover .tile-art, .tile:focus-visible .tile-art { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
  .poster-art img, .tile-art img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; background: var(--paper-2); }
  .spine { position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--acc); z-index: 2; }
  .poster-art .badge {
    position: absolute; left: 10px; bottom: 10px; z-index: 2;
    font-size: 0.68rem; font-weight: 600; letter-spacing: 0.02em;
    padding: 0.22rem 0.6rem; border-radius: 999px;
    background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  }
  .poster-art.gen {
    background: var(--acc); color: var(--on-accent);
    padding: 0.95rem 0.9rem 0.85rem 1.1rem; display: flex; flex-direction: column; justify-content: space-between;
  }
  .poster-art.gen::before { content: ''; position: absolute; inset: 0; opacity: 0.16; pointer-events: none; }
  .poster-art.gen[data-p="0"]::before { background: repeating-linear-gradient(135deg, #fff 0 1px, transparent 1px 11px); }
  .poster-art.gen[data-p="1"]::before { background: radial-gradient(circle at 100% 0, #fff 0 34%, transparent 35%), radial-gradient(circle at 0 100%, #fff 0 22%, transparent 23%); opacity: 0.11; }
  .poster-art.gen[data-p="2"]::before { background: repeating-linear-gradient(0deg, #fff 0 1px, transparent 1px 15px); }
  .poster-art.gen[data-p="3"]::before { background: radial-gradient(#fff 1.2px, transparent 1.6px) 0 0 / 14px 14px; }
  .gen-k { position: relative; font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.85; }
  .gen-t { position: relative; font-family: 'Fraunces', serif; font-weight: 600; font-size: clamp(1.05rem, 2.6vw, 1.3rem); line-height: 1.1; text-wrap: balance; }
  .gen-f { position: relative; font-size: 0.72rem; opacity: 0.85; }
  .poster-meta h3, .tile-meta h3 {
    font-family: 'Fraunces', serif; font-weight: 600; margin: 0; color: var(--text);
    font-size: 0.97rem; line-height: 1.18; text-wrap: balance;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .poster-meta p, .tile-meta span { display: block; margin: 0.22rem 0 0; font-size: 0.75rem; color: var(--text-faint); line-height: 1.35; }
  .poster-meta .pc { display: flex; align-items: center; gap: 0.4rem; font-size: 0.7rem; color: var(--text-faint); margin-bottom: 0.3rem; }
  .poster-meta .pc .dot { color: var(--acc-desk); width: 6px; height: 6px; }

  /* ---------- tiles (pecas) ---------- */
  .tile { display: flex; flex-direction: column; gap: 0.55rem; min-width: 0; text-decoration: none; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tile-art.txt {
    background: var(--paper); color: var(--ink); padding: 0.85rem 0.8rem 0.7rem 1rem;
    display: flex; flex-direction: column; justify-content: space-between;
  }
  .tile-art.txt .t-q { font-family: 'Fraunces', serif; font-weight: 500; font-size: 0.98rem; line-height: 1.22; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
  .tile-art.txt .t-n { font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
  .tile-art.doc { background: var(--acc); color: var(--on-accent); padding: 0.9rem 0.85rem 0.8rem 1.1rem; display: flex; flex-direction: column; justify-content: space-between; }
  .tile-art.doc .t-q { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.12rem; line-height: 1.12; color: var(--on-accent); }
  .tile-art.doc .t-n { font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.85; }
  .tile-art .t-num { position: absolute; top: 8px; right: 8px; z-index: 2; font-size: 0.66rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 999px; background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,0.25); font-variant-numeric: tabular-nums; }
  .tile-meta h3 { font-size: 0.86rem; font-family: 'Inter', system-ui, sans-serif; font-weight: 600; line-height: 1.25; }
  .tile-more .tile-art { display: grid; place-items: center; background: transparent; border: 1.5px dashed var(--desk-line); box-shadow: none; color: var(--text-soft); text-align: center; padding: 0.8rem; font-size: 0.86rem; font-weight: 600; }
  .tile-more .tile-art b { display: block; font-family: 'Fraunces', serif; font-size: 1.4rem; color: var(--title-color); margin-bottom: 0.2rem; }

  /* ---------- fileiras ---------- */
  .row { margin-top: 2rem; }
  .row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
  .row-head h2 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.3rem; margin: 0; color: var(--text); }
  .row-head h2 small { font-family: 'Inter', system-ui, sans-serif; font-weight: 500; font-size: 0.78rem; color: var(--text-faint); margin-left: 0.5rem; }
  .row-head a { font-size: 0.82rem; font-weight: 600; color: var(--text-soft); text-decoration: none; white-space: nowrap; }
  .row-head a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
  .row-scroller { position: relative; }
  .row-track {
    display: flex; gap: 0.85rem; overflow-x: auto; scroll-snap-type: x proximity;
    padding: 0.5rem var(--gutter) 1.1rem; margin: -0.5rem calc(var(--gutter) * -1) 0;
    scroll-padding-inline: var(--gutter); scrollbar-width: none; overscroll-behavior-x: contain;
  }
  .row-track::-webkit-scrollbar { display: none; }
  .row-track > * { flex: 0 0 var(--tile-w); scroll-snap-align: start; }
  .row-arrow {
    display: none; position: absolute; top: calc(var(--tile-w) * 0.66); z-index: 5;
    width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--paper); color: var(--ink); box-shadow: var(--shadow-lift);
    place-items: center; opacity: 0; transition: opacity .18s ease;
  }
  .row-arrow.l { left: -14px; } .row-arrow.r { right: -14px; }
  @media (hover: hover) and (min-width: 900px) {
    .row-arrow { display: grid; }
    .row-scroller:hover .row-arrow:not([disabled]) { opacity: 1; }
  }

  /* ---------- destaque ---------- */
  .hero {
    position: relative; display: grid; gap: 1.1rem; grid-template-columns: minmax(0, 1fr);
    background: var(--paper); color: var(--ink); border-radius: 22px; box-shadow: var(--shadow);
    overflow: hidden; padding: 1.3rem 1.2rem 1.4rem 1.5rem; margin-top: 0.4rem;
  }
  .hero::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 7px; background: var(--acc); }
  .hero-k { display: flex; align-items: center; gap: 0.5rem; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
  .hero-k .dot { color: var(--acc); }
  .hero h2 { font-size: clamp(1.75rem, 5.4vw, 2.7rem); color: var(--acc); margin: 0.45rem 0 0.6rem; }
  .hero p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.55; max-width: 34em; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  .hero-last { margin-top: 0.7rem; font-size: 0.8rem; color: var(--ink-faint); }
  .hero-act { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.1rem; }
  .hero .btn.ghost { color: var(--ink); border-color: rgba(33,28,21,0.2); }
  .fan { position: relative; height: 176px; order: -1; }
  .fan img, .fan .fan-g {
    position: absolute; bottom: 0; width: 38%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top;
    border-radius: 10px; border: 3px solid var(--paper); box-shadow: 0 10px 26px rgba(33,28,21,0.28); background: var(--paper-2);
  }
  .fan img:nth-child(1) { left: 6%; transform: rotate(-7deg) translateY(6px); }
  .fan img:nth-child(2) { left: 31%; z-index: 2; transform: translateY(-4px); }
  .fan img:nth-child(3) { left: 56%; transform: rotate(7deg) translateY(6px); }
  .fan.n1 img { left: 31%; transform: none; z-index: 2; }
  .fan.n2 img:nth-child(1) { left: 14%; transform: rotate(-6deg) translateY(6px); }
  .fan.n2 img:nth-child(2) { left: 46%; z-index: 2; transform: rotate(5deg) translateY(0); }
  .fan .fan-g { left: 31%; z-index: 2; background: var(--acc); color: var(--on-accent); padding: 0.8rem; display: flex; align-items: flex-end; font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.1rem; line-height: 1.1; }
  .stats { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin: 1rem 0 0; font-size: 0.82rem; color: var(--text-faint); }
  .stats b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
  .stats a { color: inherit; text-decoration: none; border-radius: 4px; }
  .stats a:hover b, .stats a:focus-visible b { color: var(--accent-mentor); text-decoration: underline; text-underline-offset: 3px; }
  .stats.mine { align-items: baseline; }
  .stats-k { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin-right: 0.2rem; }
  @media (min-width: 760px) {
    .hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: center; padding: 2rem 2rem 2rem 2.3rem; gap: 1.5rem; }
    .fan { order: 0; height: 290px; }
  }

  /* ---------- explorar / listas ---------- */
  .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile-w), 1fr)); gap: 1.3rem 0.9rem; }
  .grid.wide-g { grid-template-columns: repeat(auto-fill, minmax(calc(var(--tile-w) + 18px), 1fr)); }
  .toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 0.4rem 0 1.4rem; }
  .field {
    position: relative; flex: 1 1 240px; min-width: 0;
  }
  .field svg { position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%); opacity: 0.55; pointer-events: none; }
  .field input {
    width: 100%; min-height: 48px; font-family: inherit; font-size: 1rem; color: var(--ink);
    background: var(--paper); border: 1px solid transparent; border-radius: 999px;
    padding: 0.6rem 1rem 0.6rem 2.8rem; box-shadow: var(--shadow);
  }
  .field input::placeholder { color: var(--ink-faint); }
  .count-pill { font-size: 0.8rem; color: var(--text-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }

  /* ---------- busca global ---------- */
  .res-h { font-family: 'Fraunces', serif; font-size: 1.1rem; font-weight: 600; margin: 1.6rem 0 0.6rem; color: var(--text); }
  .res-h small { font-family: 'Inter', system-ui, sans-serif; font-size: 0.76rem; font-weight: 500; color: var(--text-faint); margin-left: 0.4rem; }
  .res-list { display: flex; flex-direction: column; gap: 0.55rem; }
  .res {
    display: flex; gap: 0.85rem; align-items: center; text-decoration: none; color: var(--ink);
    background: var(--paper); border-radius: 14px; padding: 0.65rem 0.8rem 0.65rem 0.65rem; box-shadow: var(--shadow);
    transition: transform .15s ease;
  }
  .res:hover { transform: translateY(-2px); }
  .res-th { flex: none; width: 52px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--acc, var(--paper-2)); color: var(--on-accent); display: grid; place-items: center; font-family: 'Fraunces', serif; font-weight: 700; font-size: 1.1rem; }
  .res-th img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
  .res-tx { min-width: 0; }
  .res-tx b { display: block; font-family: 'Fraunces', serif; font-weight: 600; font-size: 0.98rem; line-height: 1.2; color: var(--ink); }
  .res-tx small { display: block; margin-top: 0.15rem; font-size: 0.72rem; color: var(--ink-faint); }
  .res-tx p { margin: 0.25rem 0 0; font-size: 0.8rem; line-height: 1.4; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .res mark { background: rgba(227,179,65,0.4); color: inherit; border-radius: 3px; padding: 0 0.08em; }
  .more-btn { margin: 0.8rem auto 0; display: flex; }
  .sugg { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }

  /* ---------- cabecalho de acervo ---------- */
  .acervo-h {
    position: relative; display: flex; flex-direction: column; gap: 0.5rem;
    background: var(--paper); color: var(--ink); border-radius: 20px; box-shadow: var(--shadow);
    padding: 1.3rem 1.2rem 1.3rem 1.5rem; margin-bottom: 1.4rem; overflow: hidden;
  }
  .acervo-h::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 7px; background: var(--acc); }
  .acervo-h .hero-k .dot { color: var(--acc); }
  .acervo-h h1 { color: var(--acc); font-size: clamp(1.7rem, 4.6vw, 2.4rem); }
  .acervo-h .sub { color: var(--ink-soft); }
  .acervo-h .tags { font-size: 0.78rem; color: var(--ink-faint); line-height: 1.5; }
  .acervo-h .hero-act { margin-top: 0.5rem; }
  .acervo-h .btn.ghost { color: var(--ink); border-color: rgba(33,28,21,0.2); }

  /* ---------- cards de edicao ---------- */
  .ed-card {
    position: relative; display: flex; flex-direction: column; gap: 0.5rem; text-decoration: none; color: var(--ink);
    background: var(--paper); border-radius: 14px; box-shadow: var(--shadow); padding: 1rem 1rem 0.9rem 1.2rem; overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease; cursor: pointer;
  }
  .ed-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--accent-mentor); }
  .ed-card:hover, .ed-card:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
  .ed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.9rem; }
  .ed-card-top { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
  .ed-card-num { font-family: 'Fraunces', serif; font-size: 0.8rem; font-weight: 600; color: var(--accent-mentor); letter-spacing: 0.02em; }
  .ed-card-date { font-size: 0.72rem; color: var(--ink-faint); }
  .ed-card h3 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.08rem; line-height: 1.18; margin: 0; color: var(--ink); }
  .ed-card p { margin: 0; font-size: 0.84rem; line-height: 1.45; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .ed-card-foot { margin-top: auto; padding-top: 0.4rem; font-size: 0.72rem; color: var(--ink-faint); display: flex; justify-content: space-between; gap: 0.5rem; }
  .ed-tile-a { max-width: 420px; }

  /* ---------- leitor ---------- */
  .panel { background: var(--paper); color: var(--ink); max-width: 760px; width: 100%; margin: 0 auto; border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; overflow: clip; }
  .panel.wide { max-width: 1020px; }
  .panel-tab { height: 8px; background: var(--acc); }
  .panel-head { padding: 1.5rem 1.4rem 1.1rem; border-bottom: 1px solid var(--desk-line); }
  .panel-head h1 { font-family: 'Fraunces', serif; font-size: clamp(1.5rem, 4.4vw, 1.95rem); font-weight: 600; margin: 0.3rem 0 0.4rem; line-height: 1.1; text-wrap: balance; color: var(--ink); }
  .panel-meta { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
  .card-cat { font-size: 0.74rem; color: var(--ink-faint); display: flex; align-items: center; gap: 0.4rem; }
  .card-cat .dot { width: 6px; height: 6px; color: var(--acc); }
  .status-pill { font-size: 0.7rem; padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--paper-2); color: var(--ink-soft); white-space: nowrap; }
  .status-pill:empty { display: none; }
  .panel-summary { font-size: 0.93rem; color: var(--ink-soft); line-height: 1.5; margin: 0.5rem 0 0; }
  .panel-body { padding: 0.4rem 1.4rem 1.75rem; }
  .piece-zoom { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
  .piece-zoom .zoom-hint {
    position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.72rem; font-weight: 600; padding: 0.3rem 0.65rem; border-radius: 999px;
    background: var(--scrim); color: #F6F0E0; pointer-events: none;
  }
  .piece-zoom .zoom-hint .ico { width: 14px; height: 14px; }
  .nextup { display: flex; gap: 0.6rem; margin-top: 1.4rem; }
  .nextup .btn { flex: 1; min-width: 0; justify-content: space-between; }
  .nextup .btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* ---------- lightbox ---------- */
  .lightbox { position: fixed; inset: 0; z-index: 100; background: var(--scrim); display: flex; flex-direction: column; animation: view-in .2s ease both; }
  .lb-bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem var(--gutter); padding-top: calc(0.6rem + env(safe-area-inset-top, 0px)); }
  .lb-bar .lb-t { flex: 1; min-width: 0; color: #F2ECDD; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lb-btn { min-height: 42px; padding: 0 0.95rem; border-radius: 999px; border: 1px solid rgba(255,255,255,0.25); background: rgba(255,255,255,0.1); color: #F6F0E0; font-size: 0.82rem; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem; }
  .lb-stage { flex: 1; min-height: 0; overflow: auto; display: flex; padding: 0 var(--gutter) calc(1rem + env(safe-area-inset-bottom, 0px)); -webkit-overflow-scrolling: touch; }
  .lb-stage img { margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: #fff; cursor: zoom-in; }
  .lb-stage.zoomed { display: block; }
  .lb-stage.zoomed img { margin: 0 auto; max-width: none; max-height: none; width: min(230%, 2200px); cursor: zoom-out; }
  @media (min-width: 900px) { .lb-stage.zoomed img { width: min(150%, 1800px); } }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  }

  /* ---------- carrossel de destaques ---------- */
  .billboard { position: relative; margin-top: 0.4rem; }
  .bb-track {
    position: relative; display: flex; gap: 0.75rem; overflow-x: auto; scroll-snap-type: x mandatory;
    scrollbar-width: none; overscroll-behavior-x: contain;
    margin: 0 calc(var(--gutter) * -1); padding: 0.3rem var(--gutter) 0.9rem; scroll-padding-inline: var(--gutter);
  }
  .bb-track::-webkit-scrollbar { display: none; }
  .bb-slide.hero { flex: 0 0 calc(100% - 1.4rem); scroll-snap-align: start; margin-top: 0; min-width: 0; }
  .hero-tx { min-width: 0; }
  @media (min-width: 760px) { .bb-slide.hero { flex-basis: 100%; } }
  .bb-dots { display: flex; justify-content: center; }
  .bb-dot { width: 34px; height: 40px; padding: 0; border: 0; background: none; cursor: pointer; position: relative; }
  .bb-dot::before {
    content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: 999px;
    background: var(--text-faint); opacity: 0.4; transform: translate(-50%, -50%);
    transition: width .22s ease, opacity .22s ease, background .22s ease;
  }
  .bb-dot.on::before { width: 22px; opacity: 1; background: var(--title-color); }
  .bb-arrow {
    display: none; position: absolute; top: calc(50% - 1rem); z-index: 5; width: 46px; height: 46px; border-radius: 50%;
    border: 0; cursor: pointer; background: var(--paper); color: var(--ink); box-shadow: var(--shadow-lift);
    place-items: center; opacity: 0; transition: opacity .18s ease;
  }
  .bb-arrow.l { left: -16px; } .bb-arrow.r { right: -16px; }
  @media (hover: hover) and (min-width: 900px) {
    .bb-arrow { display: grid; }
    .billboard:hover .bb-arrow:not([disabled]) { opacity: 1; }
  }

  /* faixa de banners que passa pro lado */
  .mq {
    order: -1; height: 172px; min-width: 0; overflow: hidden; border-radius: 14px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
  }
  .mq-in { display: flex; height: 100%; width: max-content; padding: 6px 0 14px; animation: mq-go var(--mq-dur, 60s) linear infinite; }
  .mq.static .mq-in { width: 100%; justify-content: center; animation: none; }
  .mq.static .mq-i { margin-right: 0; }
  .mq-i {
    position: relative; display: block; flex: none; height: 100%; aspect-ratio: 3 / 4; margin-right: 0.75rem;
    border-radius: 12px; overflow: hidden; background: var(--paper-2); box-shadow: 0 8px 22px rgba(33,28,21,0.24); text-decoration: none;
  }
  .mq-i img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
  .mq-poster .poster-art { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
  .mq-doc { background: var(--acc); color: var(--on-accent); padding: 0.8rem 0.75rem 0.7rem 0.95rem; display: flex; flex-direction: column; justify-content: space-between; }
  .mq-doc span { font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.85; }
  .mq-doc b { font-family: 'Fraunces', serif; font-weight: 600; font-size: 0.95rem; line-height: 1.12; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
  @keyframes mq-go { to { transform: translateX(-50%); } }
  .hero:hover .mq-in, .hero:focus-within .mq-in { animation-play-state: paused; }
  @media (prefers-reduced-motion: reduce) { .mq-in { animation: none; } .mq { overflow-x: auto; } }
  @media (min-width: 760px) { .mq { order: 0; height: 290px; } }

  /* ---------- fotos dos autores ---------- */
  .poster-art img.ph { object-position: center 14%; }
  .poster-art.round { justify-content: space-between; }
  .poster-art .ph-round {
    position: relative; flex: none; align-self: center; width: 66%; height: auto; aspect-ratio: 1; border-radius: 50%; object-fit: cover; object-position: center 15%;
    border: 3px solid rgba(251,247,236,0.92); box-shadow: 0 6px 18px rgba(0,0,0,0.3); background: var(--paper-2);
  }
  .acervo-id { display: flex; align-items: center; gap: 1rem; min-width: 0; }
  .acervo-id > div { min-width: 0; }
  .avatar { flex: none; width: 76px; height: 76px; border-radius: 50%; object-fit: cover; object-position: center 15%; border: 3px solid var(--paper); box-shadow: var(--shadow); background: var(--paper-2); }
  @media (min-width: 760px) { .avatar { width: 96px; height: 96px; } }
  .credit { font-size: 0.68rem; color: var(--ink-faint); margin-top: 0.1rem; }

/* ---------- conteudo lido ---------- */
  details.section {
    border-bottom: 1px solid var(--desk-line);
  }
  details.section:last-child { border-bottom: none; }
  details.section summary {
    list-style: none;
    cursor: pointer;
    padding: 0.95rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.96rem;
    color: var(--ink);
  }
  details.section summary::-webkit-details-marker { display: none; }
  details.section summary::after {
    content: '';
    width: 8px; height: 8px;
    border-right: 1.5px solid var(--ink-faint);
    border-bottom: 1.5px solid var(--ink-faint);
    transform: rotate(-45deg);
    transition: transform .18s ease;
    flex-shrink: 0;
    margin-left: 0.75rem;
  }
  details.section[open] summary::after { transform: rotate(45deg); }
  .section-content {
    padding-bottom: 1.1rem;
    font-size: 0.9rem;
    line-height: 1.62;
    color: var(--ink-soft);
  }
  .section-content p { margin: 0 0 0.7rem; }
  .section-content p:last-child { margin-bottom: 0; }
  .section-content ul, .section-content ol {
    margin: 0 0 0.7rem;
    padding-left: 1.15rem;
  }
  .section-content li { margin-bottom: 0.4rem; }
  .section-content li:last-child { margin-bottom: 0; }
  .section-content .quote {
    border-left: 2px solid var(--accent-framework);
    padding-left: 0.85rem;
    font-style: italic;
    color: var(--ink);
  }
  .section-content strong { color: var(--ink); font-weight: 600; }
  .section-content a { color: var(--accent-mentoria); text-decoration: underline; text-underline-offset: 2px; }
  .section-content a:hover { color: var(--accent-mentor); }
  .section-content .label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ink-faint);
    margin-bottom: 0.3rem;
  }

  .pieces-empty {
    font-size: 0.87rem;
    color: var(--ink-faint);
    font-style: italic;
    margin: 0;
  }
  .piece { margin-bottom: 1.7rem; }
  .piece:last-child { margin-bottom: 0; }
  .piece-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
  }
  .piece-head h2 {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0;
    color: var(--ink);
  }
  .piece-year {
    font-size: 0.72rem;
    color: var(--ink-faint);
    white-space: nowrap;
  }
  @media (max-width: 640px) {
    .piece-head { flex-wrap: wrap; }
    .piece-year { white-space: normal; }
  }
  .piece-img-link { display: block; }
  .piece-img {
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    object-position: top;
    border-radius: 8px;
    border: 1px solid var(--desk-line);
    background: var(--paper-2);
    display: block;
    cursor: zoom-in;
  }
  .piece-note-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ink-faint);
    margin: 0.65rem 0 0.3rem;
  }
  .piece-note {
    width: 100%;
    min-height: 74px;
    font-family: inherit;
    font-size: 0.87rem;
    color: var(--ink);
    background: var(--paper-2);
    border: 1px solid var(--desk-line);
    border-radius: 8px;
    padding: 0.6rem 0.7rem;
    resize: vertical;
  }
  .piece-note:focus {
    outline: 2px solid var(--accent-mentoria);
    outline-offset: 1px;
  }
  .piece-status {
    display: block;
    font-size: 0.7rem;
    color: var(--ink-faint);
    margin-top: 0.3rem;
    min-height: 1.1em;
  }
  .piece-transcript {
    max-height: 420px;
    overflow-y: auto;
    background: var(--paper-2);
    border: 1px solid var(--desk-line);
    border-radius: 8px;
    padding: 0.9rem 1rem;
    font-size: 0.86rem;
    line-height: 1.55;
    color: var(--ink);
  }
  .piece-transcript p { margin: 0 0 0.7rem; }
  .piece-transcript p:last-child { margin-bottom: 0; }
  .piece-transcript .ts {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--ink-faint);
    margin-right: 0.4rem;
  }
  .briefing-block {
    background: var(--paper);
    border: 1px solid var(--desk-line);
    border-radius: 10px;
    padding: 1.6rem 1.8rem;
    margin: 1rem 0;
  }
  .briefing-block .brf-title {
    font-size: 1.15rem;
    color: var(--accent-caso);
    margin: 0 0 1.3rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--accent-caso);
  }
  .briefing-block .brf-h1 {
    font-size: 1.05rem;
    color: var(--paper);
    background: var(--accent-caso);
    display: inline-block;
    padding: 0.35rem 0.9rem;
    border-radius: 6px;
    margin: 2.1rem 0 1rem;
  }
  .briefing-block .brf-h1:first-of-type { margin-top: 0; }
  .briefing-block .brf-h1 strong { color: inherit; }
  .briefing-block .brf-h2 {
    font-size: 0.98rem;
    color: var(--accent-mentor);
    margin: 1.3rem 0 0.5rem;
    padding-left: 0.7rem;
    border-left: 3px solid var(--accent-mentor);
  }
  .briefing-block .brf-p {
    font-size: 0.96rem;
    line-height: 1.75;
    color: var(--ink);
    margin: 0 0 0.85rem;
  }
  .briefing-block .brf-p strong {
    color: var(--accent-mentoria);
  }


  .briefing-block .brf-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 1.2rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--desk-line);
  }
  .briefing-block .brf-tag {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--ink-soft);
    background: var(--paper-2);
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    white-space: nowrap;
  }
  .section-content code {
    font-size: 0.82rem;
    background: var(--paper-2);
    border-radius: 4px;
    padding: 0.08rem 0.32rem;
    color: var(--ink);
  }
  /* --- Edicoes do Makepeace --- */
  .briefing-block .brf-h3 {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ink);
    margin: 1.05rem 0 0.4rem;
  }
  .briefing-block .brf-ul, .briefing-block .brf-ol {
    margin: 0 0 0.9rem;
    padding-left: 1.2rem;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--ink);
  }
  .briefing-block .brf-ul li, .briefing-block .brf-ol li { margin-bottom: 0.45rem; }
  .briefing-block .brf-ul li:last-child, .briefing-block .brf-ol li:last-child { margin-bottom: 0; }
  .briefing-block .brf-ul li strong, .briefing-block .brf-ol li strong { color: var(--accent-mentoria); }
  .ed-tese {
    font-family: 'Fraunces', serif;
    font-size: 1.05rem;
    line-height: 1.45;
    color: var(--ink);
    border-left: 3px solid var(--accent-mentor);
    padding: 0.15rem 0 0.15rem 0.9rem;
    margin: 1.1rem 0 0.4rem;
  }
  .pdf-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0.9rem 0 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--desk-line);
  }
  .pdf-btn {
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--ink-soft);
    background: var(--paper-2);
    border: 1px solid var(--desk-line);
    border-radius: 999px;
    padding: 0.33rem 0.75rem;
    cursor: pointer;
    text-decoration: none;
  }
  .pdf-btn.active { background: var(--accent-mentor); color: var(--paper); border-color: transparent; }
  .pdf-hint { font-size: 0.74rem; color: var(--ink-faint); margin-left: auto; }
  .pdfpages { overflow-x: auto; }
  .pdfpage {
    position: relative;
    background: #fff;
    border: 1px solid var(--desk-line);
    border-radius: 6px;
    margin: 0 auto 1rem;
    min-height: 220px;
    overflow: hidden;
  }
  .pdfpages[data-zoom="1"] .pdfpage { width: 100%; }
  .pdfpages[data-zoom="2"] .pdfpage { width: 140%; }
  .pdfpages[data-zoom="3"] .pdfpage { width: 190%; }
  .pdfpage canvas { display: block; width: 100%; height: auto; }
  .pdfpage-num {
    position: absolute;
    top: 6px; left: 8px;
    font-size: 0.66rem;
    color: #9a9484;
    background: rgba(255,255,255,0.85);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    z-index: 2;
  }

  .adv-details { margin: 1rem 0 0; border: 1px solid var(--desk-line); border-radius: 8px; background: var(--paper-2); }
  .adv-details > summary { cursor: pointer; padding: 0.7rem 0.9rem; font-size: 0.86rem; font-weight: 600; color: var(--ink); }
  .adv-details[open] > summary { border-bottom: 1px solid var(--desk-line); }
  .adv-ocr { border: 0; border-radius: 0 0 8px 8px; max-height: 480px; }
  .adv-toolbar { padding: 0.6rem 0.9rem 0; }
  .adv-stack { padding: 0.6rem 0.9rem 0.9rem; }
  .adv-stack img { width: 100%; display: block; border: 1px solid var(--desk-line); border-radius: 6px; margin: 0 0 6px; background: #fff; }
  .adv-stack video { width: 100%; display: block; border: 1px solid var(--desk-line); border-radius: 6px; margin: 0 0 6px; background: #000; aspect-ratio: 4 / 5; object-fit: cover; }
.brf-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; margin: 0.4rem 0 1rem; }
  .brf-table th, .brf-table td { text-align: left; vertical-align: top; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--desk-line); }
  .brf-table th { font-weight: 600; color: var(--ink-soft); }
  .brf-table-wrap { overflow-x: auto; }
  @media (max-width: 640px) {
    .brf-table, .brf-table tbody, .brf-table tr, .brf-table td { display: block; width: 100%; }
    .brf-table thead { display: none; }
    .brf-table tr { padding: 0.55rem 0; border-bottom: 1px solid var(--desk-line); }
    .brf-table td { padding: 0.1rem 0; border: 0; }
    .brf-table td:first-child, .brf-table td:nth-child(2) { display: inline-block; width: auto; margin-right: 0.5rem; font-weight: 600; color: var(--ink-soft); }
  }

  /* ---------- ajustes finos do conteudo lido ---------- */
  #view-detail .piece-head { display: none; }
  @media (max-width: 430px) { .ab-pos { display: none; } }
  .piece-note { font-size: 1rem; min-height: 96px; }
  .piece-head h2 { font-size: 1.02rem; }
  .pdf-toolbar { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 66px); z-index: 6; background: var(--paper); margin-top: 0; padding-top: 0.7rem; }
  .pdf-btn { min-height: 38px; display: inline-flex; align-items: center; }
  .pdf-btn.active { background: var(--accent-mentor); color: var(--on-accent); }
  .adv-stack img, .piece-img, .piece-zoom img { cursor: zoom-in; }
  .piece-img { max-height: 560px; }
  @media (min-width: 900px) {
    .panel-head { padding: 1.9rem 2.2rem 1.3rem; }
    .panel-body { padding: 0.5rem 2.2rem 2.2rem; }
    .pdf-toolbar { top: 76px; }
  }

  /* ---------- aviso rapido ---------- */
  .toast {
    position: fixed; left: 50%; bottom: calc(5.6rem + env(safe-area-inset-bottom, 0px)); z-index: 120;
    transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
    max-width: min(92vw, 420px); padding: 0.65rem 1.1rem; border-radius: 999px;
    background: var(--ink); color: #F6F0E0; font-size: 0.84rem; font-weight: 500; box-shadow: var(--shadow-lift);
    transition: opacity .2s ease, transform .2s ease;
  }
  .toast.on { opacity: 1; transform: translate(-50%, 0); }
  @media (min-width: 900px) { .toast { bottom: 2rem; } }

  /* ---------- video ads ---------- */
  .tile-art.vid img { object-position: center 26%; }
  .vid-play {
    position: absolute; left: 50%; top: 50%; z-index: 2; width: 46px; height: 46px; margin: -23px 0 0 -23px;
    border-radius: 50%; display: grid; place-items: center; background: rgba(24, 16, 8, 0.66); color: #F6F0E0;
    transition: transform .18s ease, background .18s ease;
  }
  .vid-play .ico { width: 20px; height: 20px; margin-left: 2px; }
  .tile:hover .vid-play, .tile:focus-visible .vid-play { transform: scale(1.1); background: rgba(24, 16, 8, 0.84); }
  .vid-dur {
    position: absolute; left: 8px; bottom: 8px; z-index: 2; font-size: 0.68rem; font-weight: 600; padding: 0.15rem 0.5rem;
    border-radius: 999px; background: rgba(24, 16, 8, 0.74); color: #F6F0E0; font-variant-numeric: tabular-nums;
  }
  .piece.has-video { display: block; }
  .vid-box { display: flex; flex-direction: column; gap: 0.65rem; align-items: center; margin-bottom: 1.1rem; }
  .vid-wrap {
    width: min(100%, 380px, calc(78vh * 9 / 16)); aspect-ratio: 9 / 16; background: #000; border-radius: 14px;
    overflow: hidden; box-shadow: var(--shadow);
  }
  .vid-wrap video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
  .vid-tools { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; justify-content: center; font-size: 0.74rem; color: var(--ink-faint); letter-spacing: 0.06em; text-transform: uppercase; }
  .vid-tools > span { margin-right: 0.25rem; }
  .vid-rate {
    min-height: 40px; min-width: 44px; padding: 0 0.8rem; border-radius: 999px; border: 1px solid var(--desk-line);
    background: var(--paper); color: var(--ink); font: 600 0.78rem/1 'Inter', system-ui, sans-serif; cursor: pointer;
  }
  .vid-rate.on { background: var(--accent-mentor); color: var(--on-accent); border-color: transparent; }
  .vid-hint { margin: 0; font-size: 0.74rem; color: var(--ink-faint); text-align: center; max-width: 36ch; line-height: 1.4; }
  .vid-tx .piece-transcript { border: 0; border-radius: 0 0 8px 8px; max-height: 460px; }
  .piece-transcript .ts[data-t] {
    cursor: pointer; padding: 0.12rem 0.4rem; border-radius: 5px; background: var(--paper); border: 1px solid var(--desk-line);
    color: var(--ink-soft, var(--ink)); font-variant-numeric: tabular-nums;
  }
  .piece-transcript .ts[data-t]:hover { color: var(--accent-mentor); border-color: var(--accent-mentor); }
  @media (min-width: 900px) {
    .piece.has-video { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 0 2.2rem; align-items: start; }
    .piece.has-video .vid-col { position: sticky; top: 92px; }
    .piece.has-video .vid-box { margin-bottom: 0; }
    .vid-wrap { width: min(100%, 340px, calc((100vh - 240px) * 9 / 16)); }
  }
  /* vídeos na horizontal (VSLs): player largo, empilhado sobre a ficha */
  .vid-wrap.wide { width: min(100%, 820px, calc((100vh - 220px) * var(--arn, 1.7778))); }
  @media (min-width: 900px) {
    .piece.has-video.wide { display: block; }
    .piece.has-video.wide .vid-col { position: static; }
    .piece.has-video.wide .vid-box { margin-bottom: 1.1rem; }
    .vid-wrap.wide { width: min(100%, 820px, calc((100vh - 220px) * var(--arn, 1.7778))); }
    .piece.has-video.wide .vid-hint { max-width: none; }
  }
  @media (max-width: 899px) {
    .piece.has-video .briefing-block { padding: 1.1rem 0.95rem; margin: 0.3rem 0 1rem; }
  }


  /* ---------- aulas em vídeo do YouTube (curso) ---------- */
  .tile-art.yt { aspect-ratio: 16 / 10; background: #14100c; }
  .tile-art.yt img { object-fit: cover; object-position: center; }
  .tile-yt .tile-meta h3 { -webkit-line-clamp: 3; }
  .grid .grp-h {
    grid-column: 1 / -1; margin: 1.1rem 0 -0.2rem; padding: 0 0 0.45rem; border-bottom: 1px solid var(--desk-line);
    font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.12rem; line-height: 1.2; color: var(--title-color, var(--text)); text-wrap: balance;
  }
  .grid .grp-h:first-child { margin-top: 0.2rem; }
  .grid .grp-h span {
    display: block; margin-bottom: 0.15rem; font-family: 'Inter', system-ui, sans-serif; font-size: 0.66rem; font-weight: 600;
    letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint);
  }
  .vid-wrap.yt { background: #000; }
  .vid-wrap iframe { width: 100%; height: 100%; display: block; border: 0; background: #000; }
  .vid-wrap .yt-off { position: relative; display: block; width: 100%; height: 100%; color: #fff; text-decoration: none; }
  .vid-wrap .yt-off img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.38; }
  .yt-off-msg { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 0.5rem; padding: 1rem 1.4rem; text-align: center; font-size: 0.86rem; line-height: 1.4; }
  .yt-off-msg b { font-family: 'Fraunces', serif; font-size: 1.15rem; font-weight: 600; }
  .yt-off-msg em { font-style: normal; font-weight: 600; margin-top: 0.3rem; padding: 0.55rem 1.1rem; border-radius: 999px; background: #fff; color: #14100c; }
  .yt-tools { gap: 0.7rem; justify-content: space-between; width: 100%; max-width: 820px; text-transform: none; letter-spacing: 0.01em; }
  .yt-tools > span { margin: 0; }
  .yt-tools a.vid-btn { display: inline-flex; align-items: center; text-decoration: none; }
  .piece.has-yt .briefing-block { margin-top: 0.4rem; }

  /* ---------- livros: capas, fichamento e leitor ---------- */
  .tile-art.book { aspect-ratio: 2 / 3; background: var(--bk, #14161C); }
  .tile-art.book img { object-fit: contain; object-position: center; background: transparent; }
  .tile-art.book .badge {
    position: absolute; left: 8px; bottom: 8px; top: auto; font-size: 0.64rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    padding: 0.18rem 0.55rem; border-radius: 999px; background: var(--acc); color: var(--on-accent); z-index: 2;
  }
  .grid.book-g { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .lib-note { margin-top: 1.6rem; }
  #view-library .page-h { margin-bottom: 0.4rem; }

  .book-hero { display: flex; gap: 1.6rem; align-items: flex-start; padding: 1.1rem 0 1.3rem; border-bottom: 1px solid var(--desk-line); }
  .book-cover { flex: none; width: min(230px, 38%); aspect-ratio: 2 / 3; border-radius: 6px 10px 10px 6px; overflow: hidden; background: var(--bk, #14161C); box-shadow: var(--shadow-lift); position: relative; }
  .book-cover::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 7px; background: linear-gradient(90deg, rgba(0,0,0,0.28), transparent); }
  .book-cover img { width: 100%; height: 100%; object-fit: contain; display: block; }
  .book-meta { min-width: 0; flex: 1; }
  .book-k { font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
  .book-sub { font-family: 'Fraunces', serif; font-size: 1.12rem; line-height: 1.3; color: var(--ink); margin: 0.45rem 0 0; text-wrap: balance; }
  .book-blurb { font-size: 0.9rem; line-height: 1.55; color: var(--ink-soft); margin: 0.7rem 0 0; max-width: 52ch; }
  .book-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6rem 1rem; margin: 1rem 0 0; }
  .book-dl dt { font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
  .book-dl dd { margin: 0.1rem 0 0; font-size: 0.86rem; color: var(--ink); line-height: 1.35; }
  .book-meta .hero-act { margin-top: 1.15rem; display: flex; flex-wrap: wrap; gap: 0.55rem; }
  @media (max-width: 560px) {
    .book-hero { flex-direction: column; align-items: stretch; gap: 1.1rem; }
    .book-cover { width: min(56%, 220px); align-self: center; }
  }
  .sum-n { margin-left: 0.5rem; margin-right: auto; font-size: 0.7rem; font-weight: 600; color: var(--ink-faint); background: var(--paper-2); border-radius: 999px; padding: 0.05rem 0.5rem; }

  .toc { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; }
  .toc li { margin: 0; border-bottom: 1px solid var(--desk-line); }
  .toc li:last-child { border-bottom: 0; }
  .section-content .toc a { display: flex; gap: 0.8rem; justify-content: space-between; align-items: baseline; padding: 0.55rem 0.1rem; text-decoration: none; color: var(--ink); }
  .section-content .toc a:hover { color: var(--accent-mentor); }
  .toc-t { min-width: 0; font-size: 0.9rem; line-height: 1.35; }
  .toc-p { flex: none; font-size: 0.76rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
  @media (min-width: 900px) { .toc { grid-template-columns: 1fr 1fr; column-gap: 2rem; } .toc li:nth-last-child(2):nth-child(odd) { border-bottom: 0; } }

  .section-content a.pg {
    display: inline-block; font-size: 0.74em; line-height: 1.5; padding: 0 0.42em; border-radius: 999px; background: var(--paper-2);
    border: 1px solid var(--desk-line); color: var(--accent-mentoria); text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums; vertical-align: 0.06em;
  }
  .section-content a.pg:hover { background: var(--accent-mentor); color: var(--on-accent); border-color: transparent; }
  .fich-h { font-family: 'Fraunces', serif; font-size: 1rem; margin: 1rem 0 0.4rem; color: var(--ink); }
  .fich-tbl-wrap { overflow-x: auto; margin: 0.4rem 0 0.9rem; border: 1px solid var(--desk-line); border-radius: 10px; -webkit-overflow-scrolling: touch; }
  .fich-tbl { width: 100%; border-collapse: collapse; font-size: 0.82rem; line-height: 1.45; min-width: 620px; }
  .fich-tbl th { position: sticky; top: 0; text-align: left; font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); background: var(--paper-2); padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--desk-line); white-space: nowrap; }
  .fich-tbl td { padding: 0.55rem 0.7rem; vertical-align: top; border-bottom: 1px solid var(--desk-line); color: var(--ink-soft); }
  .fich-tbl tr:last-child td { border-bottom: 0; }
  .fich-tbl td.c0 { color: var(--ink); font-weight: 600; }
  .fich-tbl tbody tr:nth-child(even) td { background: rgba(120, 100, 60, 0.045); }
  .pre-wrap { position: relative; margin: 0.4rem 0 0.4rem; }
  .pre-wrap .pre-copy { position: absolute; top: 0.5rem; right: 0.5rem; z-index: 1; }
  .fich-pre { margin: 0; padding: 1rem 1rem 1rem; padding-top: 3rem; background: var(--paper-2); border: 1px solid var(--desk-line); border-radius: 10px; font: 0.8rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
  .pdf-links { display: flex; flex-direction: column; gap: 0.4rem; }
  .pdf-links a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0.75rem; border: 1px solid var(--desk-line); border-radius: 10px; text-decoration: none; color: var(--ink); background: var(--paper); font-size: 0.86rem; }
  .pdf-links a span { color: var(--ink-faint); font-size: 0.76rem; white-space: nowrap; }

  /* leitor */
  #panel.reader .panel-head { display: none; }
  #panel.reader .panel-body { padding: 0 0.7rem 1.2rem; }
  @media (min-width: 900px) { #panel.reader .panel-body { padding: 0 1.4rem 1.6rem; } }
  .rd-bar {
    position: sticky; top: calc(env(safe-area-inset-top, 0px) + 66px); z-index: 7; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
    padding: 0.6rem 0; background: var(--paper); border-bottom: 1px solid var(--desk-line);
  }
  @media (min-width: 900px) { .rd-bar { top: 76px; } }
  .rd-nav { flex: none; width: 40px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--desk-line); background: var(--paper); color: var(--ink); cursor: pointer; }
  .rd-nav:disabled, .btn:disabled { opacity: 0.35; cursor: default; }
  .rd-pg { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.84rem; color: var(--ink-faint); }
  .rd-pg input { width: 4.2rem; height: 38px; text-align: center; border-radius: 10px; border: 1px solid var(--desk-line); background: var(--paper); color: var(--ink); font: 600 0.95rem 'Inter', system-ui, sans-serif; font-variant-numeric: tabular-nums; }
  .rd-toc { height: 38px; max-width: 12rem; border-radius: 10px; border: 1px solid var(--desk-line); background: var(--paper); color: var(--ink); font: 500 0.82rem 'Inter', system-ui, sans-serif; padding: 0 0.5rem; }
  .rd-sp { flex: 1; }
  .rd-zoom { display: inline-flex; gap: 0.3rem; }
  .rd-where { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; align-items: baseline; padding: 0.6rem 0.1rem 0.5rem; font-size: 0.78rem; color: var(--ink-faint); }
  .rd-where b { color: var(--ink); font-weight: 600; font-size: 0.86rem; }
  .rd-stage { display: flex; justify-content: center; align-items: flex-start; min-height: 46vh; padding: 0.6rem; background: var(--paper-2); border-radius: 12px; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y pinch-zoom; }
  .rd-stage canvas { display: block; min-width: 0; background: #fff; box-shadow: var(--shadow); height: auto; }
  .rd-stage[data-mode="fit"] canvas { width: auto; max-width: 100%; max-height: calc(100vh - 11rem); max-height: calc(100dvh - 11rem); }
  .rd-stage[data-mode="w"] canvas { width: 100%; max-width: 1200px; }
  .rd-stage[data-mode="z"] { justify-content: flex-start; touch-action: pan-x pan-y pinch-zoom; }
  .rd-stage[data-mode="z"] canvas { flex: none; width: 170%; max-width: none; }
  .rd-load { align-self: center; color: var(--ink-faint); font-size: 0.86rem; }
  .rd-text { margin-top: 0.9rem; border: 1px solid var(--desk-line); border-radius: 12px; overflow: hidden; }
  .rd-text-bar { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.7rem; background: var(--paper-2); border-bottom: 1px solid var(--desk-line); }
  .rd-hint { font-size: 0.76rem; color: var(--ink-faint); }
  .rd-text-body { padding: 0.9rem 1rem; white-space: pre-wrap; font-size: 0.92rem; line-height: 1.65; color: var(--ink); max-height: 60vh; overflow: auto; user-select: text; -webkit-user-select: text; }
  .rd-foot { display: flex; justify-content: space-between; gap: 0.6rem; margin-top: 0.9rem; }
  .rd-foot .btn { flex: 1; justify-content: center; max-width: 18rem; }
  @media (max-width: 560px) {
    .rd-toc { max-width: 100%; flex: 1 1 100%; order: 9; }
    .rd-sp { display: none; }
    .rd-zoom { order: 8; }
  }

  .toc li.toc-sub a { padding-left: 1.2rem; }
  .toc li.toc-sub .toc-t { font-size: 0.82rem; color: var(--ink-soft); }

  /* grupos de seções (uma sessão ou livro por grupo) */
  details.section.sgroup > summary { font-family: 'Fraunces', serif; font-size: 1.04rem; padding: 1.05rem 0; }
  .sgroup .sg-t { min-width: 0; margin-right: 0.5rem; }
  .sgroup > summary .sum-n { margin-left: auto; margin-right: 0.4rem; white-space: nowrap; }
  .sg-body { padding: 0 0 0.6rem 0.9rem; border-left: 2px solid var(--desk-line); margin-left: 0.15rem; }
  .sg-body details.section > summary { font-size: 0.9rem; font-weight: 500; padding: 0.7rem 0; }
  .sg-body details.section[open] > summary { font-weight: 600; }

  details.section[data-si] { scroll-margin-top: calc(env(safe-area-inset-top, 0px) + 76px); }
  @keyframes sec-flash { 0% { background: rgba(227, 179, 65, 0.35); } 100% { background: transparent; } }
  details.section.sec-flash { animation: sec-flash 1.6s ease-out 1; border-radius: 8px; }

  .book-k { display: flex; align-items: center; gap: 0.6rem; }
  .book-av { flex: none; width: 38px; height: 38px; border-radius: 50%; object-fit: cover; object-position: center 15%; border: 2px solid var(--paper); box-shadow: var(--shadow); background: var(--paper-2); }
  .panel-av { flex: none; width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: center 15%; border: 2px solid var(--paper); box-shadow: var(--shadow); background: var(--paper-2); }

  /* ---------- capa das edicoes do Makepeace ---------- */
  .ed-cov { position: absolute; inset: 0; display: block; overflow: hidden; background: #2a1d15; container-type: inline-size; }
  .ed-cov img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 10%; display: block; background: #2a1d15; }
  .ed-cov::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(24,16,10,0.66) 0%, rgba(24,16,10,0) 26%, rgba(24,16,10,0) 44%, rgba(24,16,10,0.92) 100%); }
  .ed-cov .ec-k { position: absolute; z-index: 1; top: 6px; left: 12px; right: 8px; font-size: 0.5rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: #fbf7ec; text-shadow: 0 1px 3px rgba(0,0,0,0.55); }
  .ed-cov .ec-b { position: absolute; z-index: 1; left: 12px; right: 8px; bottom: 7px; display: flex; flex-direction: column; gap: 2px; color: #fbf7ec; }
  .ed-cov .ec-n { font-family: 'Fraunces', serif; font-weight: 700; font-size: 1.9rem; line-height: 0.92; letter-spacing: -0.02em; text-shadow: 0 2px 8px rgba(0,0,0,0.45); font-variant-numeric: tabular-nums; }
  .ed-cov .ec-n small { font-size: 0.34em; font-weight: 600; margin-right: 0.14em; vertical-align: 0.85em; letter-spacing: 0; opacity: 0.85; }
  .ed-cov .ec-d { font-size: 0.56rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  @supports (width: 1cqw) {
    .ed-cov .ec-k { top: 5cqw; left: 9cqw; right: 6cqw; font-size: 5.2cqw; }
    .ed-cov .ec-b { left: 9cqw; right: 6cqw; bottom: 6cqw; gap: 1cqw; }
    .ed-cov .ec-n { font-size: 27cqw; }
    .ed-cov .ec-d { font-size: 6.2cqw; }
  }
  .ed-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
  .ed-card { flex-direction: row; align-items: flex-start; gap: 0.95rem; padding: 0.9rem 0.95rem 0.9rem 1.25rem; }
  .ed-card-cov { position: relative; flex: none; width: 92px; aspect-ratio: 3 / 4; border-radius: 9px; overflow: hidden; box-shadow: 0 3px 10px rgba(33,28,21,0.28); display: block; }
  .ed-card-body { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; flex: 1; align-self: stretch; }
  .ed-hero-cov { position: relative; flex: none; width: 84px; aspect-ratio: 3 / 4; border-radius: 9px; overflow: hidden; box-shadow: var(--shadow); display: block; }
  @media (min-width: 760px) { .ed-hero-cov { width: 112px; } }
  .tile-art.edc { background: #2a1d15; }
  .mq-ed .ed-cov { border-radius: 12px; }

  /* ---------- por nome ---------- */
  .grid-h { grid-column: 1 / -1; margin: 1.1rem 0 -0.3rem; }
  .grid-h:first-child { margin-top: 0.2rem; }

/* ---------- porta de entrada (login) ---------- */
.gate { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 1.25rem; background: var(--bg); color: var(--text); }
.gate[hidden] { display: none !important; }
.gate-card { width: 100%; max-width: 24rem; background: var(--paper); color: var(--ink); border-radius: 18px; padding: 2rem 1.6rem 1.6rem; box-shadow: var(--shadow-lift); text-align: center; }
.gate-card .brand-mark { display: inline-flex; width: 2.6rem; height: 2.6rem; font-size: 1.35rem; }
.gate-card h1 { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1.7rem; margin: .8rem 0 .1rem; color: var(--ink); }
.gate-sub { margin: 0 0 1.4rem; color: var(--ink-soft); font-size: .92rem; }
.gate-card form { display: flex; flex-direction: column; gap: .7rem; text-align: left; }
.gate-card label { font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.gate-card input[type=email], .gate-card input[type=password] { font: inherit; font-size: 1rem; padding: .75rem .85rem; border-radius: 10px; border: 1px solid rgba(33,28,21,.25); background: #fff; color: var(--ink); min-width: 0; }
.gate-card input[type=email]:focus, .gate-card input[type=password]:focus { outline: 2px solid var(--a-mentoria); outline-offset: 1px; }
.gate-card button { font: inherit; font-weight: 600; padding: .8rem 1rem; border-radius: 10px; border: 0; cursor: pointer; background: var(--ink); color: var(--paper); }
.gate-card [hidden] { display: none; }
.gate-card button:disabled { opacity: .55; cursor: default; }
.gate-card button.ghost { background: transparent; color: var(--ink-soft); border: 1px solid rgba(33,28,21,.25); }
.gate-msg { min-height: 1.3em; margin: 1rem 0 0; font-size: .92rem; color: var(--ink-soft); line-height: 1.45; }
.gate-msg.err { color: #8A2E2E; }
.gate-load { font-size: .95rem; color: var(--ink-soft); margin: 1.2rem 0 .2rem; }
#shell { display: contents; }
#shell[hidden] { display: none !important; }

/* ---------- tela Adicionar ---------- */
.add-wrap { position: fixed; inset: 0; z-index: 9000; background: var(--scrim); display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 1rem; }
.add-wrap[hidden] { display: none !important; }
.add-card { width: 100%; max-width: 40rem; margin: auto; background: var(--paper); color: var(--ink); border-radius: 16px; padding: 1.2rem 1.2rem 1rem; box-shadow: var(--shadow-lift); display: flex; flex-direction: column; gap: .35rem; }
.add-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .3rem; }
.add-top h2 { font-family: 'Fraunces', Georgia, serif; font-size: 1.35rem; margin: 0; color: var(--ink); }
.add-x { font: inherit; font-size: 1.6rem; line-height: 1; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; padding: .1rem .5rem; }
.add-l { font-size: .78rem; font-weight: 600; color: var(--ink-soft); margin-top: .55rem; }
.add-in { font: inherit; font-size: .95rem; padding: .6rem .7rem; border-radius: 10px; border: 1px solid rgba(33,28,21,.25); background: #fff; color: var(--ink); width: 100%; min-width: 0; box-sizing: border-box; }
textarea.add-in { resize: vertical; }
.add-in:focus { outline: 2px solid var(--a-mentoria); outline-offset: 1px; }
.add-new { display: flex; flex-direction: column; gap: .25rem; padding: .6rem .7rem .8rem; border-radius: 10px; background: var(--paper-2); }
.add-drop { margin-top: .7rem; border: 2px dashed rgba(33,28,21,.3); border-radius: 12px; padding: 1.2rem .8rem; text-align: center; cursor: pointer; display: flex; flex-direction: column; gap: .25rem; color: var(--ink); }
.add-drop span { font-size: .82rem; color: var(--ink-soft); }
.add-drop.on, .add-drop:focus-visible { border-color: var(--a-mentoria); background: var(--paper-2); outline: none; }
.add-list { display: flex; flex-direction: column; gap: .5rem; margin-top: .4rem; }
.add-it { border: 1px solid rgba(33,28,21,.18); border-radius: 10px; padding: .5rem .6rem .6rem; background: var(--paper-2); }
.add-it-h { display: flex; gap: .4rem; align-items: center; }
.add-rm { font: inherit; font-size: 1.3rem; line-height: 1; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; padding: .2rem .5rem; }
.add-it-m { display: flex; justify-content: space-between; gap: .6rem; font-size: .78rem; color: var(--ink-soft); margin: .35rem 0 .3rem; }
.add-st { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.add-bar { height: 5px; border-radius: 5px; background: rgba(33,28,21,.12); overflow: hidden; }
.add-bar i { display: block; height: 100%; width: 0; background: var(--a-caso); transition: width .2s; }
.add-log { min-height: 1.2em; margin: .6rem 0 0; font-size: .86rem; color: var(--ink-soft); }
.add-act { display: flex; justify-content: flex-end; gap: .6rem; margin-top: .6rem; }
.add-btn { font: inherit; font-weight: 600; padding: .7rem 1.3rem; border-radius: 10px; border: 0; cursor: pointer; background: var(--ink); color: var(--paper); }
.add-btn.ghost { background: transparent; color: var(--ink-soft); border: 1px solid rgba(33,28,21,.25); }
.add-btn:disabled { opacity: .5; cursor: default; }


  /* ---------- Meu estudo ---------- */
  .st-tabs { display: flex; gap: 0.3rem; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 66px); z-index: 6; background: var(--paper); padding: 0.55rem 0 0.6rem; margin-bottom: 0.5rem; border-bottom: 1px solid var(--desk-line); }
  @media (min-width: 900px) { .st-tabs { top: 76px; } }
  .st-tab { flex: 1 1 0; min-height: 42px; padding: 0 0.6rem; border-radius: 999px; border: 1px solid var(--desk-line); background: var(--paper-2); color: var(--ink-soft); font: 600 0.84rem/1 'Inter', system-ui, sans-serif; cursor: pointer; }
  .st-tab.on { background: var(--accent-mentor); color: var(--on-accent); border-color: transparent; }
  .st-pane[hidden] { display: none; }
  .vid-side .st-pane > .briefing-block:first-child { margin-top: 0.4rem; }
  .vid-btn {
    min-height: 40px; min-width: 44px; padding: 0 0.8rem; border-radius: 999px; border: 1px solid var(--desk-line);
    background: var(--paper); color: var(--ink); font: 600 0.78rem/1 'Inter', system-ui, sans-serif; cursor: pointer; letter-spacing: 0; text-transform: none;
  }
  .vid-btn.on { background: var(--accent-mentoria); color: var(--on-accent); border-color: transparent; }
  .vid-btn.st-vnote { background: var(--accent-caso); color: var(--on-accent); border-color: transparent; }
  .st-vt { margin-top: -0.2rem; }

  .study { margin: 0.4rem 0 0; }
  .st-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.7rem; }
  .st-hd h2 { margin: 0; font-family: 'Fraunces', serif; font-size: 1.15rem; font-weight: 600; color: var(--ink); }
  .st-saved { font-size: 0.72rem; color: var(--ink-faint); min-height: 1.1em; }
  .st-loading { margin: 0; font-size: 0.86rem; color: var(--ink-faint); font-style: italic; }
  .st-body { display: flex; flex-direction: column; gap: 1.15rem; color: var(--ink); }
  .st-top { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
  .st-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
  .st-chip {
    min-height: 40px; padding: 0 0.95rem; border-radius: 999px; border: 1px solid var(--desk-line); background: var(--paper-2); color: var(--ink);
    font: 600 0.82rem/1 'Inter', system-ui, sans-serif; cursor: pointer; transition: background .15s ease, color .15s ease;
  }
  .st-chip.sm { min-height: 38px; padding: 0 0.7rem; font-size: 0.76rem; }
  .st-chip:hover { border-color: var(--accent-mentoria); }
  .st-chip.on { background: var(--accent-caso); color: var(--on-accent); border-color: transparent; }
  .st-chip.st-model.on { background: var(--accent-framework); }
  .st-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
  .st-lab { font-size: 0.72rem; font-weight: 600; color: var(--ink-faint); letter-spacing: 0.02em; display: block; }
  .st-row .st-lab { display: inline; }
  .st-stars { display: inline-flex; gap: 0.1rem; }
  .st-s { width: 40px; height: 40px; border: 0; background: none; font-size: 1.5rem; line-height: 1; color: var(--desk-line); cursor: pointer; padding: 0; }
  .st-s.on { color: var(--accent-framework); }
  .st-s:hover { color: var(--accent-framework); }
  .st-rate-t { font-size: 0.78rem; color: var(--ink-soft); }
  .st-sec { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 0.5rem; }
  .st-sec > h3, .st-sec > legend { margin: 0; padding: 0; font-family: 'Fraunces', serif; font-size: 0.98rem; font-weight: 600; color: var(--ink); }
  .st-sec > h3 small, .st-sec > legend small { font-family: 'Inter', system-ui, sans-serif; font-size: 0.74rem; font-weight: 500; color: var(--ink-faint); margin-left: 0.4rem; }
  .st-check { gap: 0.35rem; }
  .st-bar { height: 6px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--desk-line); overflow: hidden; }
  .st-bar i { display: block; height: 100%; background: var(--accent-caso); transition: width .25s ease; }
  .st-ck { display: flex; align-items: flex-start; gap: 0.6rem; min-height: 38px; padding: 0.3rem 0; font-size: 0.9rem; line-height: 1.35; color: var(--ink); cursor: pointer; }
  .st-ck input { width: 20px; height: 20px; margin: 0.05rem 0 0; flex: none; accent-color: var(--accent-caso); }
  .st-lesson, .st-tag-in, .st-ntext-new, .st-mine-f {
    width: 100%; font-family: inherit; font-size: 1rem; color: var(--ink); background: var(--paper-2); border: 1px solid var(--desk-line); border-radius: 8px; padding: 0.6rem 0.7rem;
  }
  .st-ntext-new, .st-mine-f { resize: vertical; line-height: 1.5; }
  .st-lesson:focus, .st-tag-in:focus, .st-ntext-new:focus, .st-mine-f:focus, .st-nt:focus { outline: 2px solid var(--accent-mentoria); outline-offset: 1px; }
  .st-hint { margin: 0; font-size: 0.8rem; line-height: 1.45; color: var(--ink-faint); }
  .st-ref { margin: 0; font-size: 0.86rem; line-height: 1.5; color: var(--ink-soft); background: var(--paper-2); border-left: 3px solid var(--accent-framework); padding: 0.5rem 0.7rem; border-radius: 0 8px 8px 0; }
  .st-nform { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.7rem; border: 1px solid var(--desk-line); border-radius: 10px; background: var(--paper); }
  .st-nl { display: flex; flex-wrap: wrap; gap: 0.3rem; }
  .st-nact { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.7rem; }
  .st-tchip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; font-size: 0.8rem; color: var(--ink-soft); margin-right: auto; }
  .st-tchip b { font-variant-numeric: tabular-nums; color: var(--ink); }
  .st-lnk { border: 0; background: none; padding: 0.35rem 0; min-height: 34px; font: 500 0.78rem/1 'Inter', system-ui, sans-serif; color: var(--accent-mentoria); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
  .st-btn {
    min-height: 40px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--desk-line); background: var(--paper-2); color: var(--ink);
    font: 600 0.82rem/1 'Inter', system-ui, sans-serif; cursor: pointer; align-self: flex-start;
  }
  .st-btn.primary { background: var(--accent-mentor); color: var(--on-accent); border-color: transparent; margin-left: auto; }
  .st-btn.warn { background: var(--accent-framework); color: var(--on-accent); border-color: transparent; }
  .st-btn:hover { border-color: var(--accent-mentoria); }
  .st-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
  .st-note, .st-clip { border: 1px solid var(--desk-line); border-radius: 10px; background: var(--paper); padding: 0.55rem 0.7rem 0.6rem; }
  .st-nh { display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.25rem; }
  .st-lbl { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-mentor); }
  .st-x { margin-left: auto; width: 34px; height: 34px; border: 0; background: none; font-size: 1.25rem; line-height: 1; color: var(--ink-faint); cursor: pointer; border-radius: 8px; }
  .st-x:hover { color: var(--accent-mentor); background: var(--paper-2); }
  .st-tbtn { font: 600 0.72rem/1 'Inter', system-ui, sans-serif; cursor: pointer; padding: 0.3rem 0.5rem; border-radius: 6px; background: var(--paper-2); border: 1px solid var(--desk-line); color: var(--ink-soft); font-variant-numeric: tabular-nums; min-height: 28px; }
  .st-tbtn:hover { color: var(--accent-mentor); border-color: var(--accent-mentor); }
  .st-nt { font-size: 0.95rem; line-height: 1.5; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 6px; padding: 0.15rem 0.2rem; min-height: 1.5em; }
  .st-clip blockquote { margin: 0; font-size: 0.92rem; line-height: 1.5; color: var(--ink); border-left: 3px solid var(--accent-framework); padding-left: 0.7rem; }
  .st-mf { display: flex; flex-direction: column; gap: 0.3rem; }
  .st-cnt { font-size: 0.72rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
  .st-rv { margin: 0; font-size: 0.86rem; color: var(--ink); }
  .st-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
  .st-tag { display: inline-flex; align-items: center; gap: 0.1rem; font-size: 0.78rem; font-weight: 500; color: var(--ink-soft); background: var(--paper-2); border: 1px solid var(--desk-line); border-radius: 999px; padding: 0 0.25rem 0 0.7rem; min-height: 32px; }
  .st-tag .st-x { width: 28px; height: 28px; font-size: 1.05rem; }
  .st-free { margin-top: 1.15rem; padding-top: 0.2rem; border-top: 1px solid var(--desk-line); }
  .st-free .piece-note-label { font-family: 'Fraunces', serif; font-size: 0.98rem; font-weight: 600; color: var(--ink); margin: 0.9rem 0 0.4rem; }
  .st-star {
    display: inline-block; margin-left: 0.35rem; padding: 0 0.35rem; min-width: 38px; min-height: 38px; border: 0; background: none; cursor: pointer;
    font-size: 1.05rem; line-height: 1; color: var(--ink-faint); vertical-align: -0.1em;
  }
  .st-star.on, .st-star:hover { color: var(--accent-framework); }

  /* selos nos cards */
  .st-badges { position: absolute; top: 8px; left: 8px; z-index: 3; display: flex; gap: 3px; }
  .st-b { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 3px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; line-height: 1; background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
  .st-b.model { background: var(--accent-framework); color: var(--on-accent); }
  .st-b.ok { background: var(--accent-caso); color: var(--on-accent); }
  .st-b.doing { background: var(--accent-mentoria); color: var(--on-accent); }
  .st-b.due { background: var(--accent-mentor); color: var(--on-accent); }

  /* caderno */
  .st-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0.6rem; margin: 0 0 1rem; }
  .st-stat { background: var(--paper); color: var(--ink); border-radius: 12px; padding: 0.7rem 0.8rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 0.1rem; }
  .st-stat b { font-family: 'Fraunces', serif; font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
  .st-stat span { font-size: 0.74rem; color: var(--ink-faint); }
  .st-cad-act { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.4rem; }
  .st-lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
  .st-lessons a { display: flex; flex-direction: column; gap: 0.15rem; background: var(--paper); color: var(--ink); text-decoration: none; border-radius: 12px; padding: 0.7rem 0.9rem; box-shadow: var(--shadow); }
  .st-lessons a:hover { box-shadow: var(--shadow-lift); }
  .st-l-t { font-size: 0.74rem; font-weight: 600; color: var(--ink-faint); }
  .st-l-v { font-size: 0.95rem; line-height: 1.4; }

  /* ---------- Barra lateral interativa ---------- */
  .rail-top { display: flex; align-items: center; gap: 0.35rem; }
  .rail-top .rail-brand { flex: 1; min-width: 0; }
  .rail-tog {
    flex: none; width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--desk-line); background: transparent;
    color: var(--text-faint); display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s;
  }
  .rail-tog:hover { background: rgba(127,112,80,0.14); color: var(--text); }
  .rail-tog .ico { width: 17px; height: 17px; transition: transform .24s ease; }

  .rail-search {
    position: relative; display: flex; align-items: center; gap: 0.5rem; height: 40px; padding: 0 0.6rem 0 0.7rem; flex: none;
    border-radius: 12px; border: 1px solid var(--desk-line); background: rgba(127,112,80,0.09); color: var(--text-soft);
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  }
  .rail-search:hover { background: rgba(127,112,80,0.15); }
  .rail-search:focus-within { background: var(--paper); color: var(--ink-faint); border-color: var(--a-mentoria); box-shadow: 0 0 0 3px rgba(51,82,107,0.18); }
  .rail-search .ico { width: 17px; height: 17px; }
  .rail-search input {
    flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: inherit; font: inherit; font-size: 0.88rem;
    -webkit-appearance: none; appearance: none;
  }
  .rail-search:focus-within input { color: var(--ink); }
  .rail-search input::placeholder { color: var(--text-soft); }
  .rail-search:focus-within input::placeholder { color: var(--ink-faint); }
  .rail-search input::-webkit-search-cancel-button { display: none; }
  .rail-search kbd { font: inherit; font-size: 0.66rem; letter-spacing: 0.02em; border: 1px solid var(--desk-line); border-radius: 6px; padding: 0.05rem 0.38rem; color: var(--text-soft); white-space: nowrap; }
  .rail-search:focus-within kbd { display: none; }
  .rail-qx { width: 24px; height: 24px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-faint); cursor: pointer; display: grid; place-items: center; }
  .rail-qx:hover { background: rgba(127,112,80,0.18); }
  .rail-qx .ico { width: 14px; height: 14px; }

  .rail-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 1.2rem; margin: 0 -0.5rem; padding: 0.1rem 0.5rem 0.6rem; scrollbar-width: thin; scrollbar-color: rgba(127,112,80,0.35) transparent; }
  .rail-body > * { flex: none; }
  .rail-res { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -0.5rem; padding: 0 0.5rem 0.6rem; display: flex; flex-direction: column; gap: 0.15rem; scrollbar-width: thin; }
  .rail.searching .rail-body { display: none; }
  .rail-h { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
  .rail-h small { font-size: 0.7rem; letter-spacing: 0; color: var(--text-faint); font-variant-numeric: tabular-nums; }
  .rail-res .rail-h { margin-top: 0.55rem; }
  .rail-res .rail-h:first-child { margin-top: 0.1rem; }
  .rail-r { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.45rem; border-radius: 11px; text-decoration: none; color: var(--text-soft); }
  .rail-r.on, .rail-r:hover { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
  .rail-r .rs-x { display: flex; flex-direction: column; min-width: 0; gap: 0.1rem; }
  .rail-r b { font-size: 0.82rem; font-weight: 600; line-height: 1.22; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .rail-r small { font-size: 0.7rem; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rail-r.on small, .rail-r:hover small { color: var(--ink-faint); }
  .rail-r mark { background: rgba(224,160,40,0.38); color: inherit; border-radius: 3px; padding: 0 1px; }
  .rail-all { margin-top: 0.5rem; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.55rem 0.7rem; border-radius: 11px; border: 1px dashed var(--desk-line); text-decoration: none; color: var(--text-soft); font-size: 0.8rem; }
  .rail-all.on, .rail-all:hover { background: var(--paper); color: var(--ink); border-style: solid; }
  .rail-all kbd { font: inherit; font-size: 0.66rem; border: 1px solid var(--desk-line); border-radius: 6px; padding: 0.02rem 0.35rem; color: var(--text-faint); }
  .rail-empty { margin: 0.2rem 0.7rem; font-size: 0.78rem; line-height: 1.4; color: var(--text-faint); }

  .rs-th { width: 24px; height: 24px; border-radius: 7px; overflow: hidden; flex: none; display: grid; place-items: center; font-size: 0.58rem; font-weight: 700; letter-spacing: 0.02em; background: var(--bg-2); color: var(--text-faint); }
  .rs-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .rs-th.big { width: 38px; height: 38px; border-radius: 10px; font-size: 0.7rem; }

  .rail-resume {
    position: relative; display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.65rem; border-radius: 14px; overflow: hidden;
    background: var(--paper); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: transform .16s ease, box-shadow .16s ease;
  }
  .rail-resume:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
  .rail-resume .rs-th.big { width: 44px; height: 58px; border-radius: 9px; background: var(--paper-2); color: var(--ink-faint); }
  .rail-resume .rs-x { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
  .rail-resume small { font-size: 0.62rem; letter-spacing: 0.11em; text-transform: uppercase; color: var(--title-on-paper); font-weight: 600; }
  .rail-resume b { font-size: 0.82rem; line-height: 1.22; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .rail-resume em { font-style: normal; font-size: 0.72rem; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rail-resume .rs-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--title-color); border-radius: 0 3px 3px 0; }

  .rail-row { position: relative; display: flex; align-items: center; }
  .rail-row .rail-i { flex: 1; min-width: 0; padding-right: 2rem; }
  .rail-chev { position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border: 0; border-radius: 8px; background: transparent; color: var(--text-faint); cursor: pointer; display: grid; place-items: center; }
  .rail-chev:hover { background: rgba(127,112,80,0.18); color: var(--text); }
  .rail-chev .ico { width: 15px; height: 15px; transition: transform .22s ease; }
  .rail-chev[aria-expanded="true"] .ico { transform: rotate(90deg); }
  .rail-row .rail-i .n { margin-right: 0.15rem; }

  .rail-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .24s ease; }
  .rail-sub.open { grid-template-rows: 1fr; }
  .rail-sub-in { position: relative; overflow: hidden; min-height: 0; display: flex; flex-direction: column; gap: 0.1rem; }
  .rail-sub.open .rail-sub-in { overflow-y: auto; max-height: 16.5rem; scrollbar-width: thin; scrollbar-color: rgba(127,112,80,0.35) transparent; }
  .rail-sub.open .rail-sub-in { margin: 0.1rem 0 0.3rem 1.05rem; padding-left: 0.4rem; border-left: 1px solid var(--desk-line); }
  .rail-s { display: flex; align-items: center; gap: 0.55rem; padding: 0.34rem 0.45rem; border-radius: 9px; text-decoration: none; color: var(--text-soft); font-size: 0.82rem; line-height: 1.25; min-width: 0; transition: background .12s, color .12s; }
  .rail-s:hover { background: rgba(127,112,80,0.13); color: var(--text); }
  .rail-s.on { background: var(--paper); color: var(--ink); box-shadow: inset 3px 0 0 var(--acc-desk, var(--a-mentoria)), var(--shadow); font-weight: 600; }
  .rs-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rs-n { flex: none; font-size: 0.7rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
  .rail-s.on .rs-n { color: var(--ink-faint); }
  .rail-fv { position: relative; display: flex; align-items: center; }
  .rail-fv .rail-s { flex: 1; padding-right: 1.7rem; }
  .rail-x { position: absolute; right: 0.2rem; width: 22px; height: 22px; border: 0; border-radius: 7px; background: transparent; color: var(--text-faint); cursor: pointer; display: grid; place-items: center; opacity: 0; transition: opacity .12s; }
  .rail-fv:hover .rail-x, .rail-x:focus-visible { opacity: 1; }
  .rail-x:hover { background: rgba(127,112,80,0.2); color: var(--text); }
  .rail-x .ico { width: 13px; height: 13px; }
  .rail-more { padding: 0.3rem 0.5rem; font-size: 0.74rem; color: var(--text-faint); text-decoration: none; }
  .rail-more:hover { color: var(--text); text-decoration: underline; }

  .rail-pills { display: flex; flex-wrap: wrap; gap: 0.3rem; padding: 0.05rem 0.4rem 0.2rem 2.35rem; }
  .rail-pills:empty { display: none; }
  .rp { font-size: 0.7rem; line-height: 1; padding: 0.28rem 0.55rem; border-radius: 999px; border: 1px solid var(--desk-line); text-decoration: none; color: var(--text-soft); background: rgba(127,112,80,0.06); transition: background .12s, transform .12s; }
  .rp:hover { background: rgba(127,112,80,0.18); color: var(--text); transform: translateY(-1px); }
  .rp.due { border-color: #E0662F; color: #E0662F; font-weight: 600; }
  .rp.model { color: #C58F12; border-color: rgba(197,143,18,0.55); }
  :root[data-theme="dark"] .rp.model { color: #E3B341; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rp.model { color: #E3B341; } }

  .rail-sec .rail-h { margin-bottom: 0.4rem; }
  .rail-clr { display: inline-flex; align-items: center; gap: 0.3rem; border: 0; background: transparent; color: var(--text-faint); font: inherit; font-size: 0.7rem; letter-spacing: 0; text-transform: none; cursor: pointer; padding: 0.15rem 0.4rem; border-radius: 7px; }
  .rail-clr:hover { background: rgba(127,112,80,0.16); color: var(--text); }
  .rail-clr .ico { width: 13px; height: 13px; }
  .rail-cur-t { display: block; padding: 0 0.7rem; font-size: 0.84rem; font-weight: 600; line-height: 1.25; color: var(--text); text-decoration: none; }
  .rail-cur-t:hover { text-decoration: underline; }
  .rail-cur-n { margin: 0.15rem 0.7rem 0.5rem; font-size: 0.72rem; color: var(--text-faint); }
  .rail-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(31px, 1fr)); gap: 4px; max-height: 188px; overflow-y: auto; padding: 3px 0.35rem 3px 0.35rem; scrollbar-width: thin; }
  .rc { position: relative; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 0.7rem; font-variant-numeric: tabular-nums; text-decoration: none; color: var(--text-soft); background: rgba(127,112,80,0.11); transition: transform .12s, background .12s; }
  .rc:hover { background: rgba(127,112,80,0.24); color: var(--text); transform: translateY(-1px); }
  .rc.on { background: var(--paper); color: var(--ink); font-weight: 700; box-shadow: var(--shadow), inset 0 0 0 1.5px var(--title-color); }
  .rc[class*="s-"]::after { content: ''; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--a-mentoria); }
  .rc.s-due::after { background: #E0662F; box-shadow: 0 0 0 2px rgba(224,102,47,0.25); }
  .rc.s-model::after { background: #E0A828; }
  .rc.s-done::after { background: var(--a-caso); }
  .rc.s-queue::after { background: var(--text-faint); }
  .rc.s-doing::after { background: var(--a-mentoria); }

  .rail-rec-list { display: flex; flex-direction: column; gap: 0.1rem; }

  .rail-tip { position: fixed; z-index: 70; display: flex; gap: 0.6rem; align-items: flex-start; max-width: 270px; padding: 0.55rem 0.65rem; border-radius: 12px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow-lift); font-size: 0.78rem; line-height: 1.3; pointer-events: none; opacity: 0; transform: translateX(-5px); transition: opacity .12s, transform .12s; }
  .rail-tip.on { opacity: 1; transform: none; }
  .rail-tip img { width: 46px; height: 62px; object-fit: cover; border-radius: 8px; flex: none; background: var(--paper-2); }
  .rail-tip .rt-x { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
  .rail-tip b { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .rail-tip small { color: var(--ink-faint); font-size: 0.7rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .rail-tip em { font-style: normal; font-size: 0.7rem; color: var(--title-color); font-weight: 600; }

  @media (min-width: 900px) {
    .app { transition: grid-template-columns .24s ease; }
    .app.rail-min { grid-template-columns: 78px minmax(0, 1fr); }
    .rail { overflow: hidden; gap: 0.9rem; padding: 1.4rem 1.1rem 1rem; }
    .rail-foot { margin-top: 0; flex: none; }
    /* barra recolhida: só ícones */
    .rail-min .rail { padding: 1.2rem 0.55rem 0.9rem; align-items: stretch; }
    .rail-min .rail-top { flex-direction: column; gap: 0.6rem; align-items: center; }
    .rail-min .rail-top .rail-brand { flex: none; padding: 0; }
    .rail-min .rb-t, .rail-min .lb, .rail-min .rail-chev, .rail-min .rail-sub, .rail-min .rail-sec, .rail-min .rail-pills, .rail-min #rail-resume, .rail-min .rail-foot, .rail-min .rail-h, .rail-min .rail-search input, .rail-min .rail-search kbd, .rail-min .rail-qx, .rail-min .rail-res, .rail-min .rail-i .n { display: none !important; }
    .rail-min .rail-tog .ico { transform: rotate(180deg); }
    .rail-min .rail-search { justify-content: center; padding: 0; cursor: pointer; }
    .rail-min .rail-i { justify-content: center; padding: 0.62rem 0; }
    .rail-min .rail-row .rail-i { padding-right: 0; }
    .rail-min .rail-body { margin: 0; padding: 0.1rem 0 0.4rem; gap: 0.9rem; }
    .rail-min .rail-body nav + nav { border-top: 1px solid var(--desk-line); padding-top: 0.8rem; }
    .rail-min .rail-i .dot { width: 10px; height: 10px; }
    .rail-min .rail-i.has-due { position: relative; }
    .rail-min .rail-i.has-due::after { content: ''; position: absolute; top: 8px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: #E0662F; box-shadow: 0 0 0 2px var(--rail); }
  }
  @media (prefers-reduced-motion: reduce) {
    .app, .rail-sub, .rail-chev .ico, .rail-tog .ico, .rail-resume, .rc, .rp, .rail-tip { transition: none !important; }
  }

/* ================= visual v2: mosaicos, banner de acervo, peças de texto com cara própria ================= */
.poster-art.mosaic { display: grid; gap: 2px; background: var(--acc); }
.poster-art.mosaic img { width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: center 25%; }
.poster-art.mosaic.m4 { grid-template: 1fr 1fr / 1fr 1fr; }
.poster-art.mosaic.m3 { grid-template: 1fr 1fr / 1.15fr 1fr; }
.poster-art.mosaic.m3 img:first-of-type { grid-row: 1 / span 2; }
.poster-art.mosaic::after { content: ''; position: absolute; inset: auto 0 0 0; height: 44%; background: linear-gradient(to top, rgba(18,12,6,0.62), transparent); z-index: 1; pointer-events: none; }

.acervo-h::before { z-index: 2; }
.acervo-banner { position: absolute; top: 0; right: 0; bottom: 0; width: min(40%, 430px); z-index: 0; pointer-events: none; }
.acervo-banner.photo { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 44%); mask-image: linear-gradient(90deg, transparent 0, #000 44%); }
.acervo-banner.photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 12%; display: block; }
.acervo-banner.mosaic { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 6px; padding: 12px 12px 12px 0; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 42%); mask-image: linear-gradient(90deg, transparent 0, #000 42%); }
.acervo-banner.mosaic img { width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: center 22%; border-radius: 8px; box-shadow: var(--shadow); background: var(--paper-2); }
.acervo-banner.mosaic img:nth-child(3n+2) { transform: translateY(14px); }
.acervo-h.has-banner > :not(.acervo-banner) { position: relative; z-index: 1; max-width: 62%; }
.acervo-h.has-banner .avatar { display: none; }
@media (max-width: 720px) {
  .acervo-banner { position: relative; inset: auto; width: auto; height: 150px; margin: -1.3rem -1.2rem 0.2rem -1.5rem; }
  .acervo-banner.photo { -webkit-mask-image: linear-gradient(180deg, #000 50%, transparent); mask-image: linear-gradient(180deg, #000 50%, transparent); }
  .acervo-banner.mosaic { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 100%; padding: 12px 12px 18px 14px; -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent); mask-image: linear-gradient(180deg, #000 55%, transparent); }
  .acervo-banner.mosaic img:nth-child(n+4) { display: none; }
  .acervo-banner.mosaic img:nth-child(3n+2) { transform: none; }
  .acervo-h.has-banner > :not(.acervo-banner) { max-width: none; }
}
.kinds { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.kind { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.74rem; color: var(--ink-soft); background: rgba(33,28,21,0.06); padding: 0.24rem 0.65rem 0.24rem 0.5rem; border-radius: 999px; }
.kind .ico { width: 14px; height: 14px; color: var(--acc); }
.kind b { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

/* e-mail: linha da caixa de entrada */
.tile-art.txt.mail { justify-content: flex-start; gap: 0.38rem; padding: 0.7rem 0.75rem 0.6rem 1rem; border-top: 3px solid var(--acc); }
.mail .m-top { display: flex; align-items: center; gap: 0.45rem; min-width: 0; padding-right: 1.9rem; }
.mail .m-av { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 700 0.72rem/1 'Inter', system-ui, sans-serif; background: var(--acc); color: var(--on-accent); }
.mail .m-from { font: 600 0.74rem/1.2 'Inter', system-ui, sans-serif; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail .m-sub { font: 700 0.86rem/1.2 'Inter', system-ui, sans-serif; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 0.1rem; }
.mail .m-pre { flex: 1; min-height: 0; font: 400 0.76rem/1.38 'Inter', system-ui, sans-serif; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.mail .m-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.4rem; border-top: 1px dashed rgba(33,28,21,0.2); padding-top: 0.4rem; font-size: 0.64rem; color: var(--ink-faint); }
.mail .m-dt { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mail .m-tag { text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; color: var(--acc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* carta do Halbert: papel de máquina de escrever, carimbo e canto dobrado */
.tile-art.txt.letter { justify-content: flex-start; gap: 0.5rem; padding: 0.95rem 0.8rem 0.7rem 1.05rem; background-color: #F7F0DE; background-image: repeating-linear-gradient(180deg, transparent 0 18px, rgba(60,45,20,0.07) 18px 19px); }
.letter .l-stamp { align-self: flex-start; font: 700 0.58rem/1 'Courier Prime', 'Courier New', monospace; letter-spacing: 0.07em; text-transform: uppercase; color: var(--acc); border: 1.5px solid var(--acc); border-radius: 4px; padding: 0.24rem 0.42rem; transform: rotate(-3deg); opacity: 0.88; max-width: 118px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.letter .t-q { flex: 1; min-height: 0; font-family: 'Courier Prime', 'Courier New', monospace; font-weight: 400; font-size: 0.78rem; line-height: 1.38; -webkit-line-clamp: 6; }
.letter::after { content: ''; position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; background: linear-gradient(135deg, transparent 50%, rgba(33,28,21,0.16) 50%); border-top-left-radius: 4px; }

/* ficha de arquivo: etiqueta do tipo, linhas e margem */
.tile-art.txt.ficha { justify-content: flex-start; gap: 0.55rem; padding: 0 0.8rem 0.7rem 1.4rem; background-image: repeating-linear-gradient(180deg, transparent 0 21px, rgba(51,82,107,0.13) 21px 22px); background-position: 0 40px; }
.tile-art.txt.ficha::after { content: ''; position: absolute; left: 24px; top: 0; bottom: 0; width: 1.5px; background: rgba(176,58,58,0.32); pointer-events: none; }
.ficha .f-tab { position: relative; z-index: 1; align-self: flex-start; font: 700 0.58rem/1 'Inter', system-ui, sans-serif; letter-spacing: 0.06em; text-transform: uppercase; color: var(--on-accent); background: var(--acc); padding: 0.45rem 0.65rem 0.4rem; border-radius: 0 0 8px 8px; max-width: 118px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ficha .t-q { position: relative; z-index: 1; flex: 1; min-height: 0; line-height: 22px; font-size: 0.9rem; -webkit-line-clamp: 5; }
.ficha .t-n { position: relative; z-index: 1; }

/* aprendizados: pilha de folhas */
.tile-art.doc::before, .tile-art.doc::after { content: ''; position: absolute; border-radius: 6px; pointer-events: none; }
.tile-art.doc::before { right: -30px; bottom: 30px; width: 70px; height: 92px; background: rgba(255,255,255,0.10); transform: rotate(8deg); }
.tile-art.doc::after { right: -22px; bottom: 22px; width: 70px; height: 92px; background: repeating-linear-gradient(180deg, rgba(255,255,255,0.22) 0 2px, transparent 2px 10px), rgba(255,255,255,0.10); transform: rotate(-6deg); }
.tile-art.doc > :not(.spine) { position: relative; z-index: 1; }

/* ===== tags: barra de filtro (acervo e busca) e tags da peça ===== */
.tg-bar { display: flex; flex-direction: column; gap: 0.45rem; margin: 0.2rem 0 1.2rem; }
.tg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.tg-l { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); min-width: 4.6rem; }
.tg-chip { min-height: 32px; padding: 0.2rem 0.75rem; font-size: 0.82rem; }
.tg-chip.mine { border-style: dashed; }
.tg-clear { align-self: flex-start; background: none; border: 0; padding: 0.2rem 0; color: var(--title-color); font-size: 0.82rem; text-decoration: underline; cursor: pointer; }
.tg-piece { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0 0 1rem; }
.tg-tag { display: inline-flex; align-items: center; gap: 0.15rem; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--desk-line); font-size: 0.8rem; }
.tg-tag a { color: var(--ink-soft); text-decoration: none; padding: 0.22rem 0.2rem 0.22rem 0.7rem; }
.tg-tag a:only-child { padding-right: 0.7rem; }
.tg-tag a:hover { text-decoration: underline; }
.tg-tag.g-gancho { border-color: rgba(122,46,46,0.35); }
.tg-tag.g-nicho { border-color: rgba(51,82,107,0.35); }
.tg-tag.g-formato { border-color: rgba(139,107,46,0.4); }
.tg-x { background: none; border: 0; color: var(--text-faint); font-size: 1rem; line-height: 1; padding: 0.15rem 0.55rem 0.2rem 0.25rem; cursor: pointer; }
.tg-x:hover { color: var(--title-color); }
.tg-add { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.tg-in, .tg-sel { font: inherit; font-size: 0.82rem; padding: 0.3rem 0.6rem; border-radius: 8px; border: 1px solid var(--desk-line); background: var(--paper); color: var(--text); }
.tg-in { width: 15rem; max-width: 100%; }
.tg-ok { font: inherit; font-size: 0.8rem; font-weight: 600; padding: 0.32rem 0.75rem; border-radius: 8px; border: 0; background: var(--ink); color: var(--paper); cursor: pointer; }
.tg-ok:disabled { opacity: 0.5; }

/* ===== prévia de vídeo no card (preview.js) ===== */
.tile-art.vid .pv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 26%; opacity: 0; transition: opacity 0.25s ease; pointer-events: none; z-index: 1; }
.tile-art.vid.pv-on .pv { opacity: 1; }
.tile-art.vid.pv-on .vid-play { opacity: 0; }
.tile-art.vid .vid-dur, .tile-art.vid .t-num { z-index: 2; }

/* ===== adicionar por link (add.js) ===== */
.add-links { display: flex; gap: .5rem; align-items: stretch; }
.add-links textarea { flex: 1; min-width: 0; resize: vertical; }
.add-links .add-btn { flex: none; white-space: nowrap; }
@media (max-width: 520px) { .add-links { flex-direction: column; } }
