
:root {
  --ink: #171711;
  --ink-soft: #343126;
  --paper: #e8dcc3;
  --paper-light: #f3ead8;
  --paper-deep: #cfbea0;
  --wine: #5a1e2d;
  --wine-dark: #36131d;
  --green: #173b34;
  --green-soft: #285448;
  --gold: #b9944f;
  --gold-light: #d7bd7b;
  --line: rgba(72, 55, 34, 0.28);
  --shadow: 0 26px 70px rgba(26, 21, 13, 0.22);
  --serif: "Cormorant Garamond", Georgia, serif;
  --mono: "IBM Plex Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 15%, rgba(185, 148, 79, 0.14), transparent 34rem),
    radial-gradient(circle at 80% 30%, rgba(90, 30, 45, 0.09), transparent 36rem),
    linear-gradient(120deg, #d7c8ac 0%, var(--paper) 46%, #d9caaf 100%);
  font-family: var(--serif);
}

button, textarea, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: multiply;
  background-image:
    repeating-radial-gradient(circle at 0 0, transparent 0 2px, rgba(35, 29, 19, .05) 2px 3px),
    repeating-linear-gradient(90deg, transparent 0 3px, rgba(255,255,255,.08) 3px 4px);
  background-size: 8px 8px, 11px 11px;
}

.shell { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }

.home-page {
  --home-header-height: 112px;
  --home-gutter: clamp(24px, calc(10vw - 96px), 80px);
  overflow-x: clip;
}
.home-page .shell {
  width: min(1800px, calc(100% - var(--home-gutter) * 2));
}
.home-page .site-header { min-height: var(--home-header-height); }
.home-page .brand { font-size: 24px; }
.home-page .brand-mark { width: 38px; height: 38px; font-size: 17px; }
.home-page .header-status { font-size: 12px; }
.home-page .status-dot { width: 9px; height: 9px; }
.home-page .section-heading { font-size: 11px; }

.site-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .085em;
  font-size: 19px;
  font-weight: 700;
}

.brand em { color: var(--wine); font-style: normal; }
.brand-mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  transform: rotate(45deg);
  font-size: 14px;
}
.brand-mark::first-letter { transform: rotate(-45deg); }

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-soft);
  box-shadow: 0 0 0 4px rgba(40, 84, 72, .12);
}

.home-shell {
  min-height: calc(100svh - var(--home-header-height));
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(28px, 3.6vw, 72px);
  padding-block: clamp(56px, 5vw, 80px) clamp(56px, 5vw, 90px);
}
.home-shell .eyebrow { font-size: 12px; }

.eyebrow,
.chat-kicker {
  margin: 0 0 20px;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.7;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--wine);
}

.hero-copy {
  min-width: 0;
}

.hero-copy h1 {
  margin: 0;
  max-width: 700px;
  font-size: clamp(90px, 7.8vw, 118px);
  font-weight: 500;
  line-height: .82;
  letter-spacing: -.045em;
}
.hero-copy h1 span { font-style: italic; color: var(--wine); }

.hero-description {
  max-width: 700px;
  margin: 32px 0 0;
  font-size: 24px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.hero-actions { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; }
.hero-actions .button { min-height: 58px; padding-inline: 25px; gap: 30px; font-size: 13px; }

.button {
  border: 0;
  cursor: pointer;
  min-height: 47px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-family: var(--mono);
  font-size: 11px;
  transition: transform .18s ease, background .18s ease, color .18s ease;
}
.button:hover { transform: translateY(-2px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-primary { background: var(--wine); color: var(--paper-light); box-shadow: 0 10px 30px rgba(90,30,45,.18); }
.button-primary:hover { background: var(--wine-dark); }
.button-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.button-ghost:hover { background: rgba(255,255,255,.2); }

.recent-block { margin-top: 54px; max-width: 700px; }
.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.section-heading.centered { justify-content: center; }
.section-line { height: 1px; flex: 1; background: var(--line); }
.recent-list { margin-top: 12px; }
.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  font-size: 17px;
}
.recent-item:hover { color: var(--wine); }

.oracle-stage {
  /* Uma mesma medida dimensiona a ilustração sem aplicar zoom à página. */
  --palm-card-width: clamp(360px, 31vw, 425px);
  min-width: 0;
  position: relative;
  min-height: calc(var(--palm-card-width) * 1.6);
  display: grid;
  place-items: center;
  isolation: isolate;
}
.oracle-stage::before {
  content: "";
  position: absolute;
  width: calc(var(--palm-card-width) * 1.147059);
  height: calc(var(--palm-card-width) * 1.147059);
  border: 1px solid rgba(90, 30, 45, .22);
  border-radius: 50%;
  z-index: -2;
}
.oracle-stage::after {
  content: "✦     ☾     ✧     ☉     ✦";
  position: absolute;
  top: calc(var(--palm-card-width) * .067647);
  font-size: calc(var(--palm-card-width) * .035294);
  letter-spacing: calc(var(--palm-card-width) * .058824);
  color: var(--wine);
}
.halo { position: absolute; border: 1px solid rgba(185,148,79,.45); border-radius: 50%; z-index: -1; }
.halo-one { width: calc(var(--palm-card-width) * 1.382353); height: calc(var(--palm-card-width) * 1.382353); }
.halo-two { width: calc(var(--palm-card-width) * 1.514706); height: calc(var(--palm-card-width) * 1.514706); border-style: dashed; opacity: .5; }

.palm-card,
.tarot-card {
  position: absolute;
  background:
    linear-gradient(rgba(248,239,219,.92), rgba(229,215,187,.92)),
    var(--paper-light);
  border: 1px solid rgba(62, 49, 29, .55);
  box-shadow: var(--shadow);
}
.palm-card {
  position: relative;
  width: var(--palm-card-width);
  min-height: calc(var(--palm-card-width) * 1.397059);
  z-index: 4;
  padding: calc(var(--palm-card-width) * .052941);
  transform: rotate(-1.2deg);
}
.palm-card::before,
.tarot-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(90,30,45,.28);
  pointer-events: none;
}
.palm-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--mono);
  font-size: calc(var(--palm-card-width) * .023529);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.palm-svg { width: 100%; height: calc(var(--palm-card-width) * 1.088235); margin-top: calc(var(--palm-card-width) * .023529); }
.palm-outline { fill: none; stroke: var(--ink); stroke-width: 2; }
.palm-line { fill: none; stroke: var(--wine); stroke-width: 1.3; stroke-dasharray: 2 1.7; }
.palm-line-life { stroke-width: 1.8; }
.palm-line-faint { opacity: .55; }
.palm-node { fill: var(--gold); stroke: var(--wine); stroke-width: 1; }
.palm-caption {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: calc(var(--palm-card-width) * .023529);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.palm-caption i { height: 1px; background: var(--line); flex: 1; }

.tarot-card {
  width: calc(var(--palm-card-width) * .558824);
  height: calc(var(--palm-card-width) * .911765);
  padding: calc(var(--palm-card-width) * .052941);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}
.tarot-card-left { left: 0; top: 28%; transform: rotate(-12deg); }
.tarot-card-right { right: 0; top: 24%; transform: rotate(11deg); }
.card-corner { align-self: stretch; font-family: var(--mono); font-size: calc(var(--palm-card-width) * .026471); }
.moon-glyph { font-size: calc(var(--palm-card-width) * .258824); line-height: 1; color: var(--wine); }
.card-stars { font-size: calc(var(--palm-card-width) * .035294); color: var(--gold); }
.card-label { font-size: calc(var(--palm-card-width) * .052941); font-style: italic; }
.eye-glyph { width: calc(var(--palm-card-width) * .294118); height: calc(var(--palm-card-width) * .170588); border: 1px solid var(--wine); border-radius: 70% 15%; transform: rotate(45deg); display: grid; place-items: center; }
.eye-ring { width: calc(var(--palm-card-width) * .126471); height: calc(var(--palm-card-width) * .126471); border: 1px solid var(--wine); border-radius: 50%; display: grid; place-items: center; }
.eye-dot { width: calc(var(--palm-card-width) * .038235); height: calc(var(--palm-card-width) * .038235); background: var(--wine); border-radius: 50%; }

.tech-seal {
  position: absolute;
  right: calc(var(--palm-card-width) * .070588);
  bottom: 0;
  width: calc(var(--palm-card-width) * .352941);
  height: calc(var(--palm-card-width) * .352941);
  border: 1px solid var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--green);
  transform: rotate(-6deg);
}
.tech-seal span { font-size: calc(var(--palm-card-width) * .123529); font-weight: 700; }
.tech-seal small { font-family: var(--mono); font-size: calc(var(--palm-card-width) * .020588); line-height: 1.4; text-transform: uppercase; }

.omens { padding-block: 30px 90px; }
.omen-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 24px; }
.omen-card {
  min-height: 180px;
  padding: 22px;
  border: 1px solid var(--line);
  background: rgba(245,237,220,.28);
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 10px;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.omen-card:hover { transform: translateY(-4px); background: rgba(245,237,220,.58); border-color: rgba(90,30,45,.45); }
.omen-number { font-family: var(--mono); color: var(--wine); font-size: 9px; }
.omen-card strong { font-size: 24px; font-weight: 600; }
.omen-card > span:last-child { font-size: 16px; line-height: 1.35; color: var(--ink-soft); }

.site-footer {
  min-height: 86px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 30px);
  opacity: 0;
  pointer-events: none;
  max-width: min(540px, calc(100% - 40px));
  padding: 12px 16px;
  background: var(--ink);
  color: var(--paper-light);
  font-family: var(--mono);
  font-size: 10px;
  transition: .2s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Chat */
.chat-page { overflow: hidden; }
.chat-layout { height: 100dvh; min-height: 0; display: grid; grid-template-columns: 296px minmax(0, 1fr); }
.chat-sidebar {
  position: relative;
  z-index: 20;
  height: 100dvh;
  padding: 30px 22px 24px;
  background:
    linear-gradient(rgba(20,39,33,.97), rgba(16,31,27,.98)),
    var(--green);
  color: #e9dec7;
  border-right: 1px solid rgba(215,189,123,.22);
  display: flex;
  flex-direction: column;
}
.sidebar-brand { color: #f0e6d1; font-size: 18px; }
.sidebar-brand em { color: var(--gold-light); }
.sidebar-brand .brand-mark { border-color: var(--gold-light); color: var(--gold-light); }
.new-chat-button { width: 100%; min-height: 52px; margin-top: 36px; background: transparent; border: 1px solid rgba(215,189,123,.58); color: var(--gold-light); justify-content: flex-start; font-size: 12px; }
.new-chat-button:hover { background: rgba(215,189,123,.08); }
.sidebar-label { margin: 36px 8px 10px; font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: rgba(233,222,199,.55); }
.conversation-list { display: grid; gap: 2px; overflow-y: auto; scrollbar-width: thin; }
.conversation-link {
  display: grid;
  grid-template-columns: 18px minmax(0,1fr);
  gap: 8px;
  padding: 10px 8px;
  text-decoration: none;
  font-size: 17px;
  color: rgba(240,230,209,.76);
}
.conversation-link span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-link > span:first-child { color: rgba(215,189,123,.4); font-size: 8px; padding-top: 5px; }
.conversation-link:hover,
.conversation-link.is-active { background: rgba(255,255,255,.05); color: #fff8e8; }
.conversation-link.is-active > span:first-child { color: var(--gold-light); }
.sidebar-oracle { margin-top: auto; display: flex; align-items: center; gap: 14px; color: rgba(233,222,199,.52); font-size: 14px; font-style: italic; }
.mini-eye { width: 42px; height: 24px; flex: 0 0 auto; border: 1px solid rgba(215,189,123,.45); border-radius: 70% 15%; transform: rotate(45deg); display: grid; place-items: center; }
.mini-eye span { width: 8px; height: 8px; border-radius: 50%; background: var(--gold-light); }

.chat-main { min-width: 0; min-height: 0; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: rgba(232,220,195,.72); }
.chat-header {
  min-height: 92px;
  padding: 20px 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(240,231,211,.62);
  backdrop-filter: blur(10px);
}
.chat-header > div { flex: 1 1 200px; min-width: 0; }
.chat-header h1 { overflow-wrap: anywhere; margin: 0; font-size: 28px; font-weight: 600; }
.chat-kicker { margin: 0 0 2px; font-size: 9px; }
.header-home { margin-left: auto; font-family: var(--mono); font-size: 9px; text-transform: uppercase; text-decoration: none; letter-spacing: .1em; border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.sidebar-toggle { display: none; border: 0; background: transparent; font-size: 22px; color: var(--ink); cursor: pointer; }

.message-scroll { min-width: 0; min-height: 0; overflow-y: auto; padding: 46px clamp(24px, 5vw, 84px); scrollbar-width: thin; }
.messages { width: min(980px, 100%); margin-inline: auto; display: grid; gap: 32px; }
.chat-empty { min-height: 100%; width: min(690px, 100%); margin: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 0 60px; }
.chat-empty[hidden] { display: none; }
.empty-symbol { min-width: 160px; display: flex; align-items: center; gap: 14px; justify-content: center; color: var(--wine); margin-bottom: 22px; }
.empty-symbol i { width: 70px; height: 1px; background: var(--line); position: relative; }
.empty-symbol i::after { content: ""; width: 6px; height: 6px; border: 1px solid var(--wine); background: var(--paper); position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) rotate(45deg); }
.chat-empty .eyebrow { margin-bottom: 8px; }
.chat-empty h2 { margin: 0; font-size: clamp(46px, 6vw, 68px); font-weight: 500; }
.chat-empty > p:not(.eyebrow) { max-width: 600px; font-size: 20px; line-height: 1.45; color: var(--ink-soft); }
.empty-suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.empty-suggestions button { border: 1px solid var(--line); background: rgba(255,255,255,.18); padding: 9px 14px; cursor: pointer; color: var(--ink-soft); font-family: var(--mono); font-size: 11px; }
.empty-suggestions button:hover { border-color: var(--wine); color: var(--wine); }

.message { display: grid; gap: 6px; }
.message-user { justify-items: end; }
.message-assistant { justify-items: start; }
.message-meta { font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; color: rgba(52,49,38,.6); padding-inline: 10px; }
.message-bubble { max-width: min(800px, 92%); padding: 20px 22px; border: 1px solid var(--line); position: relative; }
.message-bubble > p { overflow-wrap: anywhere; margin: 0; white-space: pre-wrap; font-size: 20px; line-height: 1.5; }
.message-user .message-bubble { background: var(--wine); color: var(--paper-light); border-color: var(--wine); }
.message-assistant .message-bubble { background: rgba(247,239,220,.62); box-shadow: 0 12px 32px rgba(42,32,21,.07); }
.message-assistant .message-bubble::before { content: "✦"; position: absolute; left: -25px; top: 18px; color: var(--wine); font-size: 10px; }
.message.is-pending .message-bubble { opacity: .68; }
.message.is-pending .message-bubble > p::after { content: ""; display: inline-block; width: 4px; height: 4px; border-radius: 50%; margin-left: 8px; background: var(--wine); box-shadow: 8px 0 var(--wine), 16px 0 var(--wine); animation: pulse-dots 1.1s infinite ease-in-out; }
@keyframes pulse-dots { 0%,100% { opacity:.28; } 50% { opacity:1; } }

.evidence-trigger-shell { margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); }
.evidence-trigger {
  width: 100%; min-height: 47px; padding: 0 14px; border: 1px solid rgba(90,30,45,.34); background: rgba(90,30,45,.035); color: var(--wine); cursor: pointer;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; text-align: left; font-family: var(--mono); text-transform: uppercase; letter-spacing: .09em; font-size: 9px;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.evidence-trigger:hover { background: rgba(90,30,45,.08); border-color: rgba(90,30,45,.58); transform: translateY(-1px); }
.evidence-trigger-mark { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid rgba(90,30,45,.34); transform: rotate(45deg); }
.evidence-trigger-mark::first-letter { transform: rotate(-45deg); }
.evidence-trigger small { font-size: 8px; color: rgba(52,49,38,.57); white-space: nowrap; }

.evidence-table {
  width: min(1280px, calc(100vw - 38px)); max-width: none; max-height: calc(100vh - 38px); padding: 0; border: 1px solid rgba(215,189,123,.58); color: var(--paper-light); background: transparent; box-shadow: 0 35px 100px rgba(5,4,3,.6); overflow: hidden;
}
.evidence-table::backdrop { background: rgba(14,12,10,.76); backdrop-filter: blur(7px) sepia(.2); }
.evidence-table-shell {
  min-height: min(780px, calc(100vh - 40px)); max-height: calc(100vh - 40px); overflow-y: auto; padding: 28px clamp(18px, 3vw, 42px) 24px;
  background:
    radial-gradient(circle at 50% 42%, rgba(185,148,79,.11), transparent 31rem),
    repeating-linear-gradient(0deg, rgba(255,255,255,.015) 0 1px, transparent 1px 5px),
    linear-gradient(135deg, #101d1a 0%, #152c26 46%, #24151a 100%);
  position: relative;
}
.evidence-table-shell::before,
.evidence-table-shell::after { content: ""; position: absolute; pointer-events: none; inset: 13px; border: 1px solid rgba(215,189,123,.22); }
.evidence-table-shell::after { inset: 20px; border-color: rgba(215,189,123,.08); }
.evidence-table-header { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 3px 3px 24px; border-bottom: 1px solid rgba(215,189,123,.22); }
.evidence-table-header .eyebrow { margin: 0 0 5px; color: var(--gold-light); font-size: 8px; }
.evidence-table-header h2 { margin: 0; font-size: clamp(33px, 4vw, 48px); font-weight: 500; line-height: 1; }
.evidence-table-hint { margin: 9px 0 0; color: rgba(243,234,216,.65); font-size: 15px; }
.evidence-table-close { position: relative; z-index: 2; width: 42px; height: 42px; flex: 0 0 auto; border: 1px solid rgba(215,189,123,.35); background: rgba(255,255,255,.02); color: var(--gold-light); cursor: pointer; font-family: var(--mono); font-size: 22px; line-height: 1; }
.evidence-table-close:hover { background: rgba(215,189,123,.08); }

.evidence-spread { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: clamp(13px, 1.7vw, 23px); padding: clamp(24px, 4vh, 42px) 3px; perspective: 1400px; }
.evidence-card { aspect-ratio: 2 / 3; min-width: 0; padding: 0; border: 0; background: transparent; cursor: pointer; perspective: 1200px; opacity: 0; transform: translateY(-22px) rotate(-1.5deg) scale(.96); transition: opacity .34s ease, transform .34s ease; transition-delay: calc(var(--deal-order) * 18ms); }
.evidence-card:nth-child(even) { transform: translateY(-22px) rotate(1.5deg) scale(.96); }
.evidence-card.is-dealt { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
.evidence-card-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .62s cubic-bezier(.2,.7,.2,1); }
.evidence-card.is-flipped .evidence-card-inner { transform: rotateY(180deg); }
.evidence-card-face { position: absolute; inset: 0; display: flex; backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 1px solid rgba(215,189,123,.62); box-shadow: 0 16px 35px rgba(0,0,0,.22); overflow: hidden; }

.evidence-card-back {
  padding: 12px; align-items: center; justify-content: space-between; flex-direction: column; color: var(--gold-light);
  background:
    linear-gradient(45deg, transparent 47%, rgba(215,189,123,.12) 48% 52%, transparent 53%),
    linear-gradient(-45deg, transparent 47%, rgba(215,189,123,.08) 48% 52%, transparent 53%),
    radial-gradient(circle at center, rgba(215,189,123,.10), transparent 38%),
    var(--wine-dark);
  background-size: 24px 24px, 24px 24px, auto, auto;
}
.evidence-card-back::before { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(215,189,123,.42); }
.evidence-card-back::after { content: ""; position: absolute; inset: 13px; border: 1px solid rgba(215,189,123,.18); }
.evidence-card-number { position: relative; z-index: 1; align-self: flex-start; font-family: var(--mono); font-size: 8px; letter-spacing: .12em; }
.evidence-card-sigil { position: relative; z-index: 1; width: 80%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.evidence-card-sigil i { height: 1px; background: rgba(215,189,123,.5); position: relative; }
.evidence-card-sigil i::after { content: ""; width: 7px; height: 7px; position: absolute; top: 50%; transform: translateY(-50%) rotate(45deg); border: 1px solid var(--gold-light); background: var(--wine-dark); }
.evidence-card-sigil i:first-child::after { right: 0; }
.evidence-card-sigil i:last-child::after { left: 0; }
.evidence-card-sigil b { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid var(--gold-light); border-radius: 50%; font-size: 17px; font-weight: 400; box-shadow: 0 0 0 6px rgba(215,189,123,.05); }
.evidence-card-back-label { position: relative; z-index: 1; font-family: var(--mono); font-size: 7px; letter-spacing: .22em; }

.evidence-card-front {
  transform: rotateY(180deg); padding: 15px 14px 13px; flex-direction: column; text-align: left; color: var(--ink);
  background:
    radial-gradient(circle at 90% 8%, rgba(185,148,79,.20), transparent 9rem),
    linear-gradient(150deg, #f1e6d0, #ddcdb0);
}
.evidence-card-front::before { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(90,30,45,.18); pointer-events: none; }
.evidence-card-front-number { position: relative; z-index: 1; font-family: var(--mono); text-transform: uppercase; letter-spacing: .12em; font-size: 7px; color: var(--wine); }
.evidence-card-front strong { position: relative; z-index: 1; display: block; margin-top: 8px; padding-bottom: 9px; border-bottom: 1px solid rgba(72,55,34,.2); font-size: clamp(13px, 1.2vw, 16px); line-height: 1.05; font-weight: 600; }
.evidence-card-excerpt { position: relative; z-index: 1; display: block; flex: 1; min-height: 0; overflow-y: auto; margin: 10px 0 8px; padding-right: 4px; font-size: clamp(11px, 1vw, 13px); line-height: 1.35; color: var(--ink-soft); scrollbar-width: thin; }
.evidence-card-metadata { position: relative; z-index: 1; display: grid; gap: 3px; padding-top: 8px; border-top: 1px solid rgba(72,55,34,.2); font-family: var(--mono); font-size: 6px; line-height: 1.3; color: rgba(52,49,38,.62); overflow-wrap: anywhere; }
.evidence-card:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 4px; }

.evidence-table-footer { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 18px; padding: 13px 3px 2px; border-top: 1px solid rgba(215,189,123,.22); color: rgba(243,234,216,.55); font-family: var(--mono); font-size: 7px; text-transform: uppercase; letter-spacing: .1em; }

.composer-shell { padding: 16px clamp(24px, 5vw, 84px) 22px; background: linear-gradient(0deg, rgba(225,211,184,.96), rgba(232,220,195,.77)); border-top: 1px solid var(--line); }
.composer { width: min(980px, 100%); margin-inline: auto; display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 12px; padding: 10px 10px 10px 14px; background: rgba(247,239,220,.8); border: 1px solid rgba(72,55,34,.35); box-shadow: 0 15px 35px rgba(42,32,21,.09); }
.composer-ornament { color: var(--wine); padding: 9px 2px; align-self: start; }
.composer textarea { min-width: 0; resize: none; overflow-y: auto; width: 100%; min-height: 46px; max-height: 180px; border: 0; outline: 0; background: transparent; color: var(--ink); padding: 9px 4px; line-height: 1.35; font-size: 19px; }
.composer textarea::placeholder { color: rgba(52,49,38,.52); }
.send-button { min-height: 46px; align-self: end; padding: 0 18px; border: 0; background: var(--green); color: var(--paper-light); cursor: pointer; display: inline-flex; gap: 20px; align-items: center; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .09em; }
.send-button:disabled { opacity: .5; cursor: wait; }
.composer-meta { width: min(980px, 100%); margin: 8px auto 0; display: flex; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; color: rgba(52,49,38,.58); }
#runtime-status { display: inline-flex; align-items: center; gap: 6px; }
#runtime-status i { width: 5px; height: 5px; border-radius: 50%; background: var(--green-soft); }

@media (min-width: 1041px) {
  .home-shell { align-items: start; }
  .oracle-stage {
    /* Compensa a folga interna para alinhar a carta central à linha da chamada. */
    margin-block-start: calc(var(--palm-card-width) * -.08);
  }
}

@media (max-width: 1040px) {
  .home-shell { grid-template-columns: 1fr; }
  .hero-copy { text-align: center; }
  .hero-copy h1 { margin-inline: auto; font-size: clamp(76px, 9vw, 104px); }
  .hero-description, .recent-block { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .oracle-stage { --palm-card-width: clamp(360px, 43vw, 425px); width: min(780px, 100%); margin-inline: auto; }
  .omen-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1120px) {
  .evidence-spread { grid-template-columns: repeat(4, minmax(145px, 1fr)); }
}

@media (max-width: 900px) {
  .evidence-spread { grid-template-columns: repeat(3, minmax(145px, 1fr)); }
}

@media (max-width: 760px) {
  .shell { width: min(100% - 28px, 1180px); }
  .home-page { --home-header-height: 88px; --home-gutter: 16px; }
  .home-page .brand { font-size: 20px; }
  .home-page .brand-mark { width: 32px; height: 32px; font-size: 15px; }
  .site-header { min-height: 72px; }
  .header-status { display: none; }
  .home-shell { padding-top: 40px; gap: 24px; }
  .hero-copy h1 { font-size: clamp(58px, 17vw, 84px); }
  .hero-description { font-size: 20px; }
  .oracle-stage { --palm-card-width: min(340px, 74vw); width: 100%; }
  .site-footer { align-items: flex-start; flex-direction: column; justify-content: center; }

  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { position: fixed; left: 0; top: 0; width: min(82vw, 310px); transform: translateX(-105%); transition: transform .22s ease; box-shadow: 20px 0 60px rgba(0,0,0,.22); }
  .chat-sidebar.is-open { transform: translateX(0); }
  .sidebar-toggle { display: block; }
  .chat-header { padding-inline: 18px; }
  .header-home { display: none; }
  .message-scroll { padding: 28px 18px; }
  .composer-shell { padding: 10px 14px 14px; }
  .composer { grid-template-columns: 1fr auto; }
  .composer-ornament { display: none; }
  .send-button span:first-child { display: none; }
  .send-button { gap: 0; }
  .composer-meta span:first-child { display: none; }
  .composer-meta { justify-content: flex-end; }
  .message-bubble { max-width: 94%; }
  .chat-empty h2 { font-size: 48px; }
  .evidence-table { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .evidence-table-shell { min-height: calc(100vh - 18px); max-height: calc(100vh - 18px); padding: 20px 14px 18px; }
  .evidence-table-header { padding-inline: 5px; }
  .evidence-table-hint { font-size: 13px; }
  .evidence-spread { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 22px 5px; }
  .evidence-card-front { padding: 12px 11px 10px; }
  .evidence-card-front strong { font-size: 12px; }
  .evidence-card-excerpt { font-size: 10px; }
  .evidence-table-footer { padding-inline: 5px; flex-direction: column; gap: 5px; }
}



/* ==========================================================
   LEITURA GRATUITA · RECOMENDAÇÃO DE OBRAS
   ========================================================== */
.free-reading { padding-block: 18px 96px; }
.reading-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .72fr);
  gap: 54px;
  align-items: end;
  margin-bottom: 22px;
}
.reading-intro .eyebrow { margin-bottom: 10px; }
.reading-intro h2 {
  margin: 0;
  font-size: clamp(39px, 5vw, 62px);
  font-weight: 500;
  line-height: .95;
  letter-spacing: -.035em;
}
.reading-intro > p {
  margin: 0 0 3px;
  max-width: 500px;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.45;
}

.reading-table {
  position: relative;
  overflow: hidden;
  padding: 30px clamp(22px, 4vw, 54px) 20px;
  border: 1px solid rgba(215,189,123,.42);
  box-shadow: 0 24px 65px rgba(29,24,15,.2), inset 0 0 0 7px rgba(215,189,123,.035);
  background:
    radial-gradient(circle at 50% 35%, rgba(215,189,123,.10), transparent 19rem),
    linear-gradient(135deg, rgba(31,66,58,.98), rgba(14,43,37,.99));
}
.reading-table::before,
.reading-table::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid rgba(215,189,123,.16);
  border-radius: 50%;
}
.reading-table::before { width: 520px; height: 520px; left: 50%; top: 48%; transform: translate(-50%,-50%); }
.reading-table::after { width: 650px; height: 650px; left: 50%; top: 48%; transform: translate(-50%,-50%); border-style: dashed; opacity: .45; }
.reading-table-ornament {
  position: relative;
  z-index: 2;
  margin-bottom: 20px;
  text-align: center;
  color: rgba(215,189,123,.72);
  font-size: 12px;
  letter-spacing: .7em;
}

.reading-deck {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 220px));
  justify-content: center;
  gap: clamp(20px, 5vw, 58px);
  perspective: 1500px;
}
.reading-card {
  width: 100%;
  aspect-ratio: 2 / 3;
  min-width: 0;
  position: relative;
  cursor: pointer;
  perspective: 1200px;
  opacity: 0;
  transform: translateY(-24px) rotate(-2deg) scale(.965);
  transition: opacity .34s ease, transform .34s ease, filter .24s ease;
  transition-delay: calc(var(--reading-order, 0) * 75ms);
  outline: none;
}
.reading-card:nth-child(2) { transform: translateY(-24px) rotate(1.2deg) scale(.965); }
.reading-card:nth-child(3) { transform: translateY(-24px) rotate(-.8deg) scale(.965); }
.reading-card.is-dealt { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
.reading-card:not(.is-locked):not(.is-flipped):hover { transform: translateY(-8px) rotate(-.5deg) scale(1.015); }
.reading-card:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 6px; }
.reading-card.is-locked { cursor: default; filter: saturate(.65) brightness(.78); opacity: .62; }
.reading-card.is-locked .reading-card-inner { transform: scale(.975); }
.reading-card-placeholder { cursor: wait; }
.reading-card-placeholder .reading-card-back-label { animation: readingPulse 1.2s ease-in-out infinite alternate; }
@keyframes readingPulse { from { opacity: .42; } to { opacity: 1; } }

.reading-card-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform .72s cubic-bezier(.2,.72,.2,1);
}
.reading-card.is-flipped .reading-card-inner { transform: rotateY(180deg); }
.reading-card-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 1px solid rgba(215,189,123,.72);
  box-shadow: 0 22px 42px rgba(0,0,0,.30);
}
.reading-card-back {
  padding: 15px;
  align-items: center;
  justify-content: space-between;
  flex-direction: column;
  color: var(--gold-light);
  background:
    linear-gradient(45deg, transparent 47%, rgba(215,189,123,.12) 48% 52%, transparent 53%),
    linear-gradient(-45deg, transparent 47%, rgba(215,189,123,.07) 48% 52%, transparent 53%),
    radial-gradient(circle at center, rgba(215,189,123,.13), transparent 38%),
    var(--wine-dark);
  background-size: 28px 28px, 28px 28px, auto, auto;
}
.reading-card-back::before,
.reading-card-front::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(215,189,123,.50);
  pointer-events: none;
}
.reading-card-back::after,
.reading-card-front::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(215,189,123,.17);
  pointer-events: none;
}
.reading-card-number,
.reading-card-back-label {
  position: relative;
  z-index: 1;
  align-self: stretch;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.reading-card-back-label { text-align: center; font-size: 7px; letter-spacing: .25em; }
.reading-card-sigil {
  position: relative;
  z-index: 1;
  width: 82%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
}
.reading-card-sigil i { position: relative; height: 1px; background: rgba(215,189,123,.58); }
.reading-card-sigil i::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translateY(-50%) rotate(45deg);
  border: 1px solid var(--gold-light);
  background: var(--wine-dark);
}
.reading-card-sigil i:first-child::after { right: 0; }
.reading-card-sigil i:last-child::after { left: 0; }
.reading-card-sigil b {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold-light);
  border-radius: 50%;
  box-shadow: 0 0 0 8px rgba(215,189,123,.045), 0 0 0 16px rgba(215,189,123,.025);
  font-size: 21px;
  font-weight: 400;
}

.reading-card-front {
  transform: rotateY(180deg);
  padding: 28px 24px 22px;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--gold-light);
  background:
    radial-gradient(circle at 50% 29%, rgba(215,189,123,.10), transparent 9rem),
    linear-gradient(155deg, #4b1927 0%, var(--wine-dark) 72%);
}
.reading-card-front-kicker {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(215,189,123,.65);
}
.reading-card-title {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: auto 0 10px;
  color: var(--gold-light);
  font-family: "Cormorant Garamond", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-size: clamp(24px, 2.5vw, 37px);
  line-height: .98;
  font-weight: 500;
  font-style: italic;
  letter-spacing: -.025em;
  text-wrap: balance;
  text-shadow: 0 1px 0 rgba(0,0,0,.22);
}
.reading-card-author {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(243,234,216,.58);
}
.reading-card-front-ornament {
  position: relative;
  z-index: 1;
  margin: auto 0 16px;
  color: rgba(215,189,123,.72);
  font-size: 11px;
  letter-spacing: .2em;
}
.reading-card-link {
  position: relative;
  z-index: 3;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 2px 2px;
  border-top: 1px solid rgba(215,189,123,.42);
  color: var(--gold-light);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 7px;
  line-height: 1.35;
  letter-spacing: .10em;
  text-transform: uppercase;
}
.reading-card-link:hover { color: #f0d795; }

.reading-footer {
  position: relative;
  z-index: 2;
  min-height: 51px;
  margin-top: 22px;
  padding-top: 15px;
  border-top: 1px solid rgba(215,189,123,.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.reading-status {
  color: rgba(243,234,216,.63);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.45;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.reading-again {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(215,189,123,.48);
  background: rgba(215,189,123,.05);
  color: var(--gold-light);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .10em;
  text-transform: uppercase;
}
.reading-again:hover { background: rgba(215,189,123,.12); }
.reading-again:disabled { opacity: .45; cursor: wait; }
.reading-again[hidden] { display: none !important; }

@media (max-width: 760px) {
  .free-reading { padding-block: 30px 68px; }
  .reading-intro { grid-template-columns: 1fr; gap: 14px; text-align: center; }
  .reading-intro > p { margin-inline: auto; font-size: 16px; }
  .reading-table { padding: 24px 10px 16px; }
  .reading-table-ornament { margin-bottom: 14px; letter-spacing: .42em; }
  .reading-deck { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .reading-card-front { padding: 19px 11px 14px; }
  .reading-card-title { font-size: clamp(16px, 5.2vw, 24px); }
  .reading-card-author, .reading-card-front-kicker, .reading-card-link { font-size: 5.5px; }
  .reading-card-sigil b { width: 42px; height: 42px; font-size: 15px; box-shadow: 0 0 0 5px rgba(215,189,123,.04); }
  .reading-card-number { font-size: 6px; }
  .reading-card-back-label { font-size: 5.5px; }
  .reading-card-front-ornament { margin-bottom: 8px; font-size: 8px; }
  .reading-card-link { padding-top: 8px; }
  .reading-footer { align-items: flex-start; flex-direction: column; }
}

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


/* LEITURA EM PÁGINA PRÓPRIA · v3 */
.reading-page-main {
  min-height: calc(100vh - 170px);
  padding-block: 58px 76px;
}
.reading-page .free-reading { padding-block: 0; }
.reading-page-intro { margin-bottom: 30px; }
.reading-page-intro h1 {
  margin: 0;
  font-size: clamp(46px, 6vw, 76px);
  font-weight: 500;
  line-height: .9;
  letter-spacing: -.04em;
}
.reading-back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .11em;
  text-transform: uppercase;
  transition: color .18s ease, transform .18s ease;
}
.reading-back-link:hover { color: var(--wine); transform: translateX(-2px); }
.reading-page .reading-table { min-height: 430px; }
.reading-page .reading-deck:empty {
  min-height: 330px;
}
.reading-page .reading-deck:empty::before {
  content: "✦";
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: auto;
  border: 1px solid rgba(215,189,123,.34);
  border-radius: 50%;
  color: rgba(215,189,123,.68);
  font-size: 17px;
  animation: readingShuffle 1.25s ease-in-out infinite alternate;
}
@keyframes readingShuffle {
  from { opacity: .35; transform: rotate(-18deg) scale(.92); }
  to { opacity: 1; transform: rotate(18deg) scale(1.04); }
}
@media (max-width: 760px) {
  .reading-page-main { padding-block: 34px 54px; }
  .reading-page-intro h1 { font-size: clamp(40px, 12vw, 58px); }
  .reading-page .reading-table { min-height: 360px; }
  .reading-page .reading-deck:empty { min-height: 270px; }
  .reading-back-link span:last-child { display: none; }
}


/* LEITURA · mesa fullscreen e dimensões contínuas */
.reading-page {
  --reading-header-height: 92px;
  min-height: 100svh;
  overflow-x: clip;
  color: var(--paper);
  background:
    radial-gradient(circle at 50% 38%, rgba(215,189,123,.105), transparent 26rem),
    radial-gradient(circle at 18% 76%, rgba(215,189,123,.045), transparent 18rem),
    linear-gradient(135deg, #21463d 0%, #123a32 52%, #0d2f29 100%);
}

.reading-page .grain {
  opacity: .5;
}

.reading-page .site-header {
  position: relative;
  z-index: 10;
  background: transparent;
}

.reading-page .brand {
  color: var(--paper);
}

.reading-page .brand em,
.reading-page .brand-mark {
  color: var(--gold-light);
}

.reading-page .reading-back-link {
  color: rgba(243,234,216,.72);
}

.reading-page .reading-back-link:hover {
  color: var(--gold-light);
}

/* A mesa passa a ocupar o viewport, em vez de aparecer como um quadro. */
.reading-page-main.shell {
  width: 100%;
  max-width: none;
  min-height: calc(100svh - var(--reading-header-height));
  padding: 34px clamp(24px, 5vw, 78px) 48px;
}

.reading-page .free-reading {
  width: 100%;
  min-height: calc(100svh - var(--reading-header-height) - 82px);
  padding: 0;
  display: flex;
  flex-direction: column;
}

.reading-page .reading-intro {
  width: min(1180px, 100%);
  margin: 0 auto 22px;
}

.reading-page .reading-intro .eyebrow {
  color: rgba(215,189,123,.78);
}

.reading-page .reading-page-intro h1 {
  color: var(--paper);
  text-shadow: 0 1px 0 rgba(0,0,0,.18);
}

.reading-page .reading-intro > p {
  color: rgba(243,234,216,.72);
}

/* A página inteira já é a mesa. */
.reading-page .reading-table {
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: visible;
  padding: 20px 0 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.reading-page .reading-table::before {
  width: min(58vw, 740px);
  height: min(58vw, 740px);
  top: 48%;
  border-color: rgba(215,189,123,.11);
}

.reading-page .reading-table::after {
  width: min(72vw, 920px);
  height: min(72vw, 920px);
  top: 48%;
  border-color: rgba(215,189,123,.08);
}

.reading-page .reading-table-ornament {
  margin-bottom: 24px;
  color: rgba(215,189,123,.66);
}


.reading-page .reading-footer {
  width: min(980px, 100%);
  margin: 30px auto 0;
  border-top-color: rgba(215,189,123,.18);
}

.reading-page .reading-status {
  color: rgba(243,234,216,.64);
}

.reading-page .site-footer {
  display: none;
}

/* Loading sem desenhar cartas falsas. */
.reading-page .reading-deck:empty {
  min-height: 372px;
  align-items: center;
}

@media (max-width: 760px) {
  .reading-page { --reading-header-height: 72px; }
  .reading-page-main.shell {
    min-height: calc(100svh - var(--reading-header-height));
    padding: 24px 14px 30px;
  }

  .reading-page .free-reading {
    min-height: calc(100svh - var(--reading-header-height) - 54px);
  }

  .reading-page .reading-intro {
    margin-bottom: 8px;
  }

  .reading-page .reading-table {
    padding-top: 14px;
    justify-content: flex-start;
  }

  .reading-page .reading-deck:empty {
    min-height: 275px;
  }

  .reading-page .reading-table::before {
    width: 94vw;
    height: 94vw;
  }

  .reading-page .reading-table::after {
    width: 118vw;
    height: 118vw;
  }

  .reading-page .reading-footer {
    margin-top: 22px;
  }
}


.reading-page .reading-card-face {
  box-shadow:
    0 28px 58px rgba(0,0,0,.34),
    0 4px 12px rgba(0,0,0,.18);
}

.reading-page .reading-card-link:focus-visible {
  outline: 2px solid #fff0c5;
  outline-offset: 3px;
}

/* Três cartas no desktop; a grade usa a largura disponível sem saltos. */

.reading-page .reading-deck {
  grid-template-columns: repeat(3, minmax(0, 324px));
  gap: clamp(16px, 4vw, 64px);
  width: min(1100px, 100%);
  margin-inline: auto;
}

.reading-page .reading-card {
  max-width: 324px;
}

.reading-page .reading-card-front {
  padding: 36px 29px 27px;
  background:
    radial-gradient(circle at 50% 24%, rgba(242,219,159,.18), transparent 10rem),
    linear-gradient(155deg, #682538 0%, #3b1421 68%, #2d1018 100%);
}

.reading-page .reading-card-front-ornament {
  margin-bottom: 20px;
  color: rgba(245,219,159,.92);
}

.reading-page .reading-card-front-kicker {
  font-size: 8.5px;
  letter-spacing: .26em;
  color: rgba(245,223,172,.90);
}

.reading-page .reading-card-title {
  margin: 10px 0 12px;
  font-size: clamp(26px, 3.2vw, 50px);
  overflow-wrap: anywhere;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  line-height: 1.04;
  letter-spacing: .015em;
  color: #f6dfaa;
  text-shadow:
    0 1px 0 rgba(0,0,0,.46),
    0 2px 8px rgba(0,0,0,.20),
    0 0 18px rgba(232,200,121,.12);
  text-wrap: balance;
}

.reading-page .reading-card-author {
  font-size: 8.5px;
  color: rgba(252,245,229,.84);
}

.reading-page .reading-card-link {
  min-height: 46px;
  padding: 12px 14px;
  font-size: 9.2px;
  letter-spacing: .09em;
  background: linear-gradient(180deg, rgba(246,224,171,.98) 0%, rgba(236,207,142,.98) 100%);
  border-color: rgba(249,227,176,.92);
  color: #301019;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.28),
    0 7px 16px rgba(0,0,0,.17);
}

.reading-page .reading-card-link:hover {
  background: linear-gradient(180deg, #fae5b7 0%, #f3d792 100%);
  color: #230a12;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.34),
    0 10px 20px rgba(0,0,0,.22);
}

@media (max-width: 760px) {
  /* Cartas legíveis em vez de três miniaturas na tela estreita. */
  .reading-page .reading-deck {
    grid-template-columns: minmax(0, 324px);
    gap: 24px;
  }
  .reading-page .reading-card-front { padding: 30px 24px 28px; }
  .reading-page .reading-card-title { font-size: clamp(28px, 8vw, 38px); }
  .reading-page .reading-card-sigil b { width: 66px; height: 66px; font-size: 21px; }
  .reading-page .reading-card-number { font-size: 8px; }
  .reading-page .reading-card-back-label { font-size: 7px; }
  .reading-page .reading-card-front-ornament { font-size: 11px; }
}

/* LEITURA · ficha de acesso ao Domínio Público */

/*
 * Em vez de um botão genérico, o acesso ao Domínio Público passa a parecer
 * uma pequena ficha de acervo/bookplate presa ao rodapé da carta.
 */
.reading-page .reading-card-link {
  position: relative;
  width: 100%;
  min-height: 76px;
  margin-top: 18px;
  padding:
    30px
    58px
    13px
    18px;

  display: flex;
  align-items: flex-end;
  justify-content: flex-start;

  overflow: hidden;
  isolation: isolate;

  border:
    2px
    solid
    #e6bd68;
  border-radius: 4px;

  background:
    linear-gradient(
      180deg,
      #fff2cf 0%,
      #f3dca6 56%,
      #e8c985 100%
    );

  color: #2d0c16;

  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: 17px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: .035em;
  text-transform: none;
  text-decoration: none;

  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.58),
    inset 0 -12px 28px rgba(101,58,16,.08),
    0 8px 18px rgba(0,0,0,.22);

  transition:
    transform .18s ease,
    box-shadow .18s ease,
    background .18s ease,
    border-color .18s ease;
}

/* Rótulo editorial, separado do verbo principal. */
.reading-page .reading-card-link::before {
  content: "DOMÍNIO PÚBLICO  ·  ACERVO OFICIAL";
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 18px;
  right: 60px;

  color: #6c352c;

  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  font-size: 8px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* Selo/saída externa. */
.reading-page .reading-card-link::after {
  content: "↗";
  position: absolute;
  z-index: 3;
  top: 50%;
  right: 14px;
  width: 34px;
  height: 34px;

  display: grid;
  place-items: center;

  transform: translateY(-50%);

  border:
    1px
    solid
    rgba(247,222,164,.88);
  border-radius: 50%;

  background: #3a1020;
  color: #f6dfa9;

  font-family:
    Georgia,
    "Times New Roman",
    serif;
  font-size: 18px;
  line-height: 1;

  box-shadow:
    0 3px 8px rgba(40,7,16,.24),
    inset 0 0 0 1px rgba(255,255,255,.06);
}

/* Filete ornamental de ficha antiga. */
.reading-page .reading-card-link > * {
  position: relative;
  z-index: 2;
}

.reading-page .reading-card-link:hover {
  transform: translateY(-2px);
  border-color: #f2d38f;

  background:
    linear-gradient(
      180deg,
      #fff7df 0%,
      #f7e1ad 56%,
      #edce8b 100%
    );

  color: #240811;

  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.7),
    inset 0 -12px 28px rgba(101,58,16,.07),
    0 13px 24px rgba(0,0,0,.28);
}

.reading-page .reading-card-link:hover::after {
  background: #53172c;
  color: #ffe8b4;
}

.reading-page .reading-card-link:focus-visible {
  outline: 3px solid #fff0c4;
  outline-offset: 4px;
}

/*
 * Um pequeno vinco/gravura de papel no canto inferior esquerdo deixa o bloco
 * menos parecido com um botão de aplicação comum e mais com parte da carta.
 */
.reading-page .reading-card-link {
  background-image:
    linear-gradient(
      115deg,
      transparent 0 72%,
      rgba(111,63,28,.045) 72% 74%,
      transparent 74% 100%
    ),
    linear-gradient(
      180deg,
      #fff2cf 0%,
      #f3dca6 56%,
      #e8c985 100%
    );
}

.reading-page .reading-card-link:hover {
  background-image:
    linear-gradient(
      115deg,
      transparent 0 72%,
      rgba(111,63,28,.04) 72% 74%,
      transparent 74% 100%
    ),
    linear-gradient(
      180deg,
      #fff7df 0%,
      #f7e1ad 56%,
      #edce8b 100%
    );
}

/* O rodapé da carta ganha respiro para o bookplate. */
.reading-page .reading-card-front {
  padding-bottom: 28px;
}

/* GUIA INTERPRETATIVO · cabeçalho enxuto, em linha */
.chat-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
}
.persona-controls {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
}
.persona-guide-label {
  font-family: var(--serif);
  color: var(--ink-soft);
  font-size: 16px;
  white-space: normal;
}
.persona-toggle {
  position: relative;
  min-height: 32px;
  padding: 6px 0 9px;
  border: 0;
  background: none;
  color: var(--ink-soft);
  opacity: .68;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: color .16s ease, opacity .16s ease;
}
.persona-toggle:hover { opacity: 1; color: var(--wine); }
.persona-toggle.is-active { opacity: 1; color: var(--ink); }
.persona-toggle.is-active::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--wine);
}
.persona-toggle:focus-visible,
.header-help:focus-visible,
.chat-header-actions .header-home:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 3px;
}
.persona-toggle:disabled { opacity: .35; cursor: wait; }
.chat-header-separator {
  flex: 0 0 auto;
  color: rgba(52, 49, 38, .40);
  font-family: var(--mono);
  font-size: 11px;
  user-select: none;
}
.chat-header-actions .header-help,
.chat-header-actions .header-home {
  flex: 0 0 auto;
  margin: 0;
  padding: 4px 0 5px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.chat-header-actions .header-help:hover,
.chat-header-actions .header-home:hover {
  color: var(--wine);
  border-bottom-color: var(--wine);
}
.home-header-actions { display: flex; align-items: center; gap: 22px; }

/* AJUDA · diálogo editorial, sem cards na página principal */
.help-dialog {
  width: min(610px, calc(100vw - 32px));
  max-height: min(82vh, 760px);
  padding: 28px clamp(20px, 3vw, 34px) 26px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper-light);
  color: var(--ink);
  box-shadow: var(--shadow);
  overflow-y: auto;
}
.help-dialog::backdrop { background: rgba(19, 25, 20, .56); backdrop-filter: blur(3px); }
.help-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.help-dialog-kicker { margin: 0 0 5px; color: var(--wine); font: 9px var(--mono); letter-spacing: .13em; text-transform: uppercase; }
.help-dialog h2 { margin: 0; font-size: clamp(30px, 4vw, 39px); font-weight: 500; }
.help-dialog-close {
  width: 32px; height: 32px; padding: 0; border: 1px solid var(--line);
  background: transparent; color: var(--ink); font-size: 24px; line-height: 1;
  cursor: pointer;
}
.help-dialog-close:hover { border-color: var(--wine); color: var(--wine); }
.help-dialog-intro { margin: 12px 0 20px; color: var(--ink-soft); font-size: 16px; line-height: 1.45; }
.help-dialog-section { padding: 13px 0 12px; border-top: 1px solid var(--line); }
.help-dialog-section h3 { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
.help-dialog-section p { margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.45; }

@media (max-width: 760px) {
  .chat-header { padding-block: 12px; }
  .chat-header-actions { flex-basis: 100%; margin-left: 0; justify-content: flex-start; gap: 7px 10px; }
  .persona-controls { flex-wrap: wrap; gap: 7px 10px; }
  .persona-guide-label { flex-basis: 100%; }
  .persona-toggle { min-height: 32px; font-size: 16px; }
  .chat-header-actions .header-home { display: inline-block; }
  .home-header-actions { gap: 10px; }
}


/* ACARTOMANTE_V7_MINIMAL_HELP: ajuda sem cartões e tipografia uniforme. */
.chat-header-actions .persona-guide-label,
.chat-header-actions .persona-toggle,
.chat-header-actions .header-help,
.chat-header-actions .header-home {
  font-size: 16px;
}

/* Na home, Ajuda é apenas um link editorial no cabeçalho, sublinhado em vinho. */
.home-page .site-header .header-help {
  display: inline-block;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 4px 0 5px;
  border: 0;
  border-bottom: 1px solid var(--wine);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.15;
  text-transform: none;
  cursor: pointer;
}
.home-page .site-header .header-help:hover { color: var(--wine); }
.home-page .site-header .header-help:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 4px;
}

/* Evita o antigo painel branco inserido pelos patches v1-v4. */
.home-oracle-help, #homeOracleHelp {
  display: none !important;
}

/* Respostas Markdown e guia inicial por sessão. */
.markdown-body { min-width: 0; white-space: normal; overflow-wrap: anywhere; font-size: 20px; line-height: 1.5; }
.message-bubble .markdown-body p { white-space: normal; margin: 0 0 1em; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { font-size: 1.2em; line-height: 1.3; margin: 1em 0 .5em; }
.markdown-body ul, .markdown-body ol { padding-left: 1.4em; margin: .65em 0; }
.markdown-body li + li { margin-top: .35em; }
.markdown-body blockquote { margin: 1em 0; padding-left: 1em; border-left: 3px solid var(--wine); }
.markdown-body pre { max-width: 100%; overflow-x: auto; padding: 14px; background: rgba(0,0,0,.06); white-space: pre; }
.markdown-body code { font-family: var(--mono); font-size: .85em; }
.markdown-body :not(pre) > code { padding: 2px 4px; background: rgba(0,0,0,.06); }
.markdown-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.markdown-body th, .markdown-body td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.markdown-body a { color: var(--wine); text-decoration: underline; }
.help-dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
.help-dialog-start { margin-top: 10px; }
.help-privacy-note { color: var(--ink-soft); font-size: 14px; line-height: 1.4; }
.help-dialog-error { color: var(--wine); font-size: 14px; }

/* Tiragem por conversa: cartas em HTML/CSS e selo vetorial compartilhado. */
.guide-draw {
  width: min(640px, calc(100vw - 24px)); max-width: none;
  max-height: calc(100dvh - 24px); margin: auto; padding: 0;
  border: 1px solid var(--gold); color: var(--paper-light);
  background: var(--green); box-shadow: var(--shadow); overflow-y: auto;
}
.guide-draw::backdrop { background: rgba(14,12,10,.76); backdrop-filter: blur(6px); }
.guide-draw [hidden], .chat-startup-retry[hidden] { display: none !important; }
.guide-draw-shell {
  padding: 27px clamp(20px, 5vw, 40px) 23px; text-align: center;
  background: radial-gradient(ellipse at 50% 42%, rgba(215,189,123,.12), transparent 70%),
    linear-gradient(135deg, var(--green), #142821 60%, #2c1720);
  box-shadow: inset 0 0 0 7px var(--green), inset 0 0 0 8px rgba(215,189,123,.22);
}
.guide-draw .eyebrow { margin: 0 0 8px; color: var(--gold-light); font-size: 9px; }
.guide-draw h2 { margin: 0; font-size: clamp(30px, 5vw, 42px); font-weight: 500; line-height: 1.05; }
.guide-draw-description { max-width: 450px; margin: 12px auto 0; font-size: 17px; line-height: 1.35; color: #e1d5be; }
.guide-draw-cards {
  width: min(100%, 418px); margin: 23px auto 20px; display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 4vw, 30px);
}
.guide-card {
  aspect-ratio: 2 / 3; min-width: 0; padding: 0; border: 0;
  background: transparent; color: inherit; cursor: pointer; perspective: 1000px;
  transition: opacity .3s ease, transform .3s ease;
}
.guide-card:not(:disabled):hover { transform: translateY(-5px); }
.guide-card:disabled { cursor: default; }
.guide-card.is-unselected { opacity: .4; transform: scale(.94); }
.guide-card-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .65s cubic-bezier(.2,.7,.2,1); }
.guide-card.is-revealed .guide-card-inner { transform: rotateY(180deg); }
.guide-card-face {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: space-between; border: 1px solid var(--gold-light); padding: 15px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 14px 30px rgba(0,0,0,.24); overflow: hidden;
}
.guide-card-face::before { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(215,189,123,.4); pointer-events: none; }
.guide-card-back {
  color: var(--gold-light); background:
    linear-gradient(45deg, transparent 47%, rgba(215,189,123,.10) 48% 52%, transparent 53%),
    linear-gradient(-45deg, transparent 47%, rgba(215,189,123,.08) 48% 52%, transparent 53%),
    var(--wine-dark);
  background-size: 24px 24px;
}
.guide-card-corner { align-self: flex-start; font-size: 22px; line-height: 1; }
.guide-card-corner:last-child { align-self: flex-end; transform: rotate(180deg); }
.guide-card-seal { width: 90%; display: flex; align-items: center; gap: 8px; }
.guide-card-seal i { flex: 1; height: 1px; background: var(--gold); }
.guide-card-seal b { width: 64px; aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--gold-light); border-radius: 50%; box-shadow: 0 0 0 6px rgba(215,189,123,.06); font-size: 26px; font-weight: 400; }
.guide-card-back-label { margin-top: -18px; font-family: var(--mono); font-size: 8px; text-transform: uppercase; letter-spacing: .15em; }
.guide-card-front {
  --saint-paper: #f5f0e5;
  --saint-ink: #262923;
  --saint-gold: #a18a58;
  --saint-edge: #c6b895;
  transform: rotateY(180deg); gap: 0; padding: 14px 14px 23px;
  color: var(--saint-ink); background: var(--saint-paper);
  border-color: var(--saint-edge); border-radius: 2px;
}
.guide-card-front::before { inset: 8px; border-color: var(--saint-edge); opacity: .65; }
.guide-card-front strong {
  position: relative; margin: 9px 0 0; padding-top: 11px; max-width: 100%;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: clamp(14px, 4vw, 20px); line-height: 1.25; font-weight: 400;
  letter-spacing: .14em; text-transform: uppercase;
}
.guide-card-front strong::before { content: ""; position: absolute; top: 0; left: calc(50% - 13px); width: 26px; height: 1px; background: var(--saint-gold); opacity: .7; }
.guide-card-front strong::after { content: ""; position: absolute; bottom: -10px; left: calc(50% - 18px); width: 36px; height: 2px; }
.saint-portrait[data-saint="cosmo"] + strong::after { background: #315348; }
.saint-portrait[data-saint="damiao"] + strong::after { background: #7b3b40; }
.guide-card-front-corner { position: absolute; width: 5px; height: 5px; border: 1px solid var(--saint-gold); transform: rotate(45deg); background: var(--saint-paper); }
.guide-card-front-corner-top { top: 6px; left: 6px; }
.guide-card-front-corner-bottom { bottom: 6px; right: 6px; }
.saint-portrait { display: grid; place-items: center; width: 100%; flex: 1; min-height: 0; margin: 0; }
.saint-emblem { display: block; width: 100%; height: 100%; max-width: 216px; min-height: 0; }
.saint-solid { fill: currentColor; }
.saint-cutout { fill: var(--saint-paper); }
.saint-halo { fill: none; stroke: var(--saint-gold); stroke-width: 1.1; opacity: .55; }
.saint-feature { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.saint-mouth { fill: none; stroke: var(--saint-paper); stroke-width: 1.8; stroke-linecap: round; }
.saint-fold { fill: none; stroke: var(--saint-gold); stroke-width: 1.15; stroke-linecap: round; }
.saint-medallion { fill: none; stroke: var(--saint-gold); stroke-width: 1.15; }

.guide-draw-result { min-height: 72px; }
.guide-draw-result p { margin: 6px auto; max-width: 440px; font-size: 16px; line-height: 1.3; }
.guide-draw-result .guide-draw-result-title { color: var(--gold-light); font-size: 22px; }
.guide-draw-error { margin: 6px 0; color: #ffcebb; font-size: 16px; }
.guide-draw-error:empty { display: none; }
.guide-draw-actions { display: flex; flex-direction: column; align-items: center; gap: 13px; margin-top: 13px; }
.guide-draw .button-primary { background: var(--gold-light); color: var(--green); min-height: 44px; }
.guide-neutral { padding: 5px; border: 0; border-bottom: 1px solid var(--gold); background: transparent; color: var(--paper-light); cursor: pointer; font-size: 17px; }
.guide-draw button:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 5px; }
.guide-draw-actions button:disabled { opacity: .6; cursor: wait; }
.guide-draw-note { margin: 16px 0 0; font-size: 13px; line-height: 1.3; color: #c9bba1; }
.chat-startup-retry { display: block; margin: 8px auto 0; padding: 7px; border: 1px solid var(--wine); color: var(--wine); background: var(--paper-light); cursor: pointer; }
@media (max-width: 420px) {
  .guide-draw-shell { padding: 24px 20px 20px; }
  .guide-draw-description { font-size: 16px; }
  .guide-card-face { padding: 12px; }
  .guide-card-front { padding: 12px 10px 18px; }
  .guide-card-front strong { margin-top: 6px; padding-top: 8px; }
  .guide-card-seal b { width: 48px; font-size: 22px; }
  .guide-card-back-label { font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  .guide-card, .guide-card-inner { transition: none; }
}
