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

:root {
  --bg-primary: #0a0a10;
  --bg-surface: #131320;
  --bg-card: rgba(255, 255, 255, 0.02);
  --bg-card-hover: rgba(255, 255, 255, 0.05);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-border: rgba(255, 255, 255, 0.08);
  --bg-glass-border-hover: rgba(255, 255, 255, 0.14);
  --bg-deep: rgba(2, 6, 23, 0.85);
  --border: rgba(255, 255, 255, 0.08);
  --text-primary: #f5f5f5;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent: #0ea5e9;
  --accent-muted: rgba(14, 165, 233, 0.15);
  --accent-glow: rgba(14, 165, 233, 0.3);
  --accent-auto: #10b981;
  --accent-manual: #f97316;
  --accent-pink: #ec4899;
  --accent-cta: #c4f233;
  --accent-cta-hover: #d4ff44;
  --accent-cta-text: #0a0a10;
  --control-bg: rgba(7, 10, 24, 0.96);
  --control-bg-hover: rgba(11, 15, 34, 0.98);
  --control-bg-disabled: rgba(15, 18, 28, 0.72);
  --control-border: rgba(255, 255, 255, 0.10);
  --control-text: #f5f5f5;
  --control-placeholder: #6b7280;
  --control-disabled-text: #858b9a;
  /* Luz da câmara — chiaroscuro maçônico (usado só na tela de login) */
  --gold: #d8b15a;
  --gold-bright: #f2d68a;
  --gold-brightest: #f7e1a0;
  --gold-deep: #8a6a2e;
  --gold-text: #1f1606;
  --gold-glow: rgba(216, 177, 90, 0.32);
  --warning: #f59e0b;
  --danger: #ef4444;
  --success: #10b981;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --space-3: 12px;
  --space-4: 16px;
}

:root[data-theme="aura"] {
  --bg-primary: #f0ece6;
  --bg-surface: #e6e2db;
  --bg-card: rgba(0, 0, 0, 0.03);
  --bg-card-hover: rgba(0, 0, 0, 0.06);
  --bg-glass: rgba(0, 0, 0, 0.025);
  --bg-glass-border: rgba(0, 0, 0, 0.10);
  --bg-glass-border-hover: rgba(0, 0, 0, 0.18);
  --border: rgba(0, 0, 0, 0.10);
  --text-primary: #1a1a2e;
  --text-secondary: #555562;
  --text-muted: #8a8a96;
  --accent: #0369a1;
  --accent-muted: rgba(3, 105, 161, 0.10);
  --accent-cta: #4d7c0f;
  --accent-cta-hover: #65a30d;
  --accent-cta-text: #ffffff;
  --control-bg: rgba(255, 253, 247, 0.92);
  --control-bg-hover: rgba(255, 255, 255, 0.98);
  --control-bg-disabled: rgba(36, 38, 52, 0.08);
  --control-border: rgba(24, 28, 44, 0.18);
  --control-text: #1a1a2e;
  --control-placeholder: #777987;
  --control-disabled-text: #787b89;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(14, 165, 233, 0.04), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(16, 185, 129, 0.03), transparent 50%);
  background-attachment: fixed;
}

@keyframes scene-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.scene-enter { animation: scene-enter 0.4s cubic-bezier(0.16, 1, 0.3, 1); }

/* --- Header --- */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg-deep);
  backdrop-filter: blur(18px); z-index: 50;
}
.brand { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 20px; letter-spacing: 0.14em; }
.brand small { display: block; font-size: 9px; letter-spacing: 0.34em; color: var(--text-muted); font-weight: 500; margin-top: 2px; }
.header-right { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.icon-btn { min-height: 40px; background: transparent; border: 1px solid var(--bg-glass-border); color: var(--text-secondary); border-radius: var(--radius-sm); padding: 8px 12px; cursor: pointer; transition: all .15s ease; }
.icon-btn:hover { border-color: var(--bg-glass-border-hover); background: var(--bg-glass); color: var(--text-primary); }
.balance-pill { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--accent-auto); border: 1px solid rgba(16,185,129,0.2); background: rgba(16,185,129,0.08); padding: 5px 10px; border-radius: 999px; }
.stub-flag { font-size: 10px; color: var(--warning); border: 1px solid rgba(245,158,11,0.3); padding: 3px 7px; border-radius: 999px; letter-spacing: .04em; }

main { max-width: 880px; margin: 0 auto; padding: 28px 24px 80px; }
body.admin-mode main { max-width: 1180px; }

.headline { font-family: "Space Grotesk", sans-serif; font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.12; margin-bottom: 8px; }
.headline .light { font-weight: 400; } .headline .bold { font-weight: 700; }
.subtext { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; max-width: 620px; }

/* --- Section / card --- */
.section { padding: var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--bg-glass-border); border-left: 2px solid var(--accent); background: var(--bg-card); margin-bottom: var(--space-3); transition: all .15s ease; }
.section:hover { border-color: var(--bg-glass-border-hover); border-left-color: var(--accent); background: var(--bg-card-hover); }
.section.auto { border-left-color: var(--accent-auto); }
.section.manual { border-left-color: var(--accent-manual); }
.section.warn { border-left-color: var(--warning); }
.section.pink { border-left-color: var(--accent-pink); }
.section h3 { font-family: "Space Grotesk", sans-serif; font-size: 14px; margin-bottom: 10px; }
.lodge-section {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  border-left-color: var(--gold); background:
    linear-gradient(135deg, rgba(216, 177, 90, 0.08), transparent 52%),
    var(--bg-card);
}
.lodge-section h3 { margin-bottom: 4px; }
.lodge-section .muted { max-width: 680px; }
.lodge-select { min-width: min(420px, 100%); }
.brother-create-form { display: grid; grid-template-columns: minmax(220px, 1.4fr) minmax(110px, .7fr) minmax(170px, .9fr) minmax(210px, 1fr) auto; gap: 10px; align-items: center; }
.brother-create-form input,
.brother-create-form select { min-height: 42px; }
.brother-create-form button { min-height: 42px; white-space: nowrap; }
.label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }

textarea, input[type="text"], input[type="email"], input[type="password"], input[type="search"] {
  width: 100%; background: var(--control-bg); border: 1px solid var(--control-border);
  color: var(--control-text); border-radius: var(--radius-sm); padding: 12px 14px;
  font-family: inherit; font-size: 15px; transition: border-color .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--control-placeholder); }
select {
  min-height: 44px;
  background: var(--control-bg); border: 1px solid var(--control-border); color: var(--control-text);
  border-radius: var(--radius-sm); padding: 9px 12px; font-family: inherit; font-size: 14px; cursor: pointer;
}
select:hover { background: var(--control-bg-hover); }
select option { background: var(--control-bg); color: var(--control-text); }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 92px; resize: vertical; }

.cta { min-height: 46px; background: var(--accent-cta); color: var(--accent-cta-text); font-weight: 600; font-size: 15px; padding: 12px 28px; border-radius: 999px; border: none; cursor: pointer; transition: all .2s ease; }
.cta:hover { background: var(--accent-cta-hover); transform: translateY(-1px); }
.cta:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; border: 1px solid var(--bg-glass-border); color: var(--text-secondary); border-radius: 999px; padding: 8px 16px; font-size: 13px; cursor: pointer; transition: all .15s ease; }
.btn-ghost:hover { background: var(--bg-glass); color: var(--text-primary); }

/* --- Login — Câmara de Reflexão (cena cinematográfica) --- */
/* A câmara é sempre na penumbra, independente do tema (espaço ritual/limiar). */
.login-stage {
  position: fixed; inset: 0; z-index: 40; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 58% 48% at 50% -4%, rgba(216, 177, 90, 0.10), transparent 60%),
    radial-gradient(ellipse 80% 60% at 50% 122%, rgba(14, 165, 233, 0.05), transparent 60%),
    #050509;
}
#login-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.stone-glow {
  position: absolute; top: 40%; left: 50%; width: 520px; height: 520px;
  transform: translate(-50%, -50%); z-index: 1; pointer-events: none;
  background: radial-gradient(circle, var(--gold-glow), transparent 62%);
  filter: blur(8px); opacity: .9;
}
.light-beam {
  position: absolute; top: -6%; left: 50%; transform: translateX(-50%);
  width: 72vw; max-width: 920px; height: 116vh; z-index: 2; pointer-events: none;
  background: linear-gradient(to bottom, rgba(242, 214, 138, 0.18), rgba(242, 214, 138, 0.05) 52%, transparent 80%);
  clip-path: polygon(43% 0, 57% 0, 82% 100%, 18% 100%);
  filter: blur(28px); mix-blend-mode: screen; opacity: .9;
}
.mosaic-floor {
  position: absolute; bottom: 0; left: 50%; z-index: 1; pointer-events: none;
  width: 200vw; height: 48vh;
  transform: translateX(-50%) perspective(440px) rotateX(70deg);
  transform-origin: bottom center;
  background-image: repeating-conic-gradient(rgba(255, 255, 255, 0.055) 0deg 90deg, transparent 90deg 180deg);
  background-size: 72px 72px; opacity: .55;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 76%);
  mask-image: linear-gradient(to top, #000 0%, transparent 76%);
}
.login-vignette {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(ellipse 82% 72% at 50% 40%, transparent 28%, rgba(2, 3, 8, 0.5) 76%, rgba(2, 3, 8, 0.94) 100%);
}

.login-wrap { position: relative; z-index: 5; width: 100%; max-width: 408px; padding: 0 20px; text-align: center; }
.emblem { width: 52px; height: 52px; color: var(--gold); margin: 0 auto 18px; display: block; filter: drop-shadow(0 0 10px var(--gold-glow)); }
.sigil-mark { font-family: "Space Grotesk", sans-serif; font-size: clamp(38px, 9vw, 54px); font-weight: 700; letter-spacing: 0.06em; line-height: 1; margin-bottom: 14px; white-space: nowrap; }
.sigil-mark .ltr { background: linear-gradient(135deg, var(--accent), var(--accent-auto) 70%, var(--gold-bright)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.sigil-mark .dot { font-style: normal; color: var(--gold); opacity: .55; font-size: 0.5em; vertical-align: middle; margin: 0 0.02em; }
.sigil-latin { font-family: "JetBrains Mono", monospace; font-size: 10px; letter-spacing: 0.18em; color: var(--gold); opacity: .62; text-transform: uppercase; margin-bottom: 8px; }
.sigil-sub { font-size: 11px; letter-spacing: 0.26em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 30px; }

.login-card {
  position: relative; padding: 26px; border-radius: var(--radius-lg); text-align: left;
  border: 1px solid rgba(216, 177, 90, 0.16);
  background: linear-gradient(180deg, rgba(20, 18, 28, 0.66), rgba(10, 9, 15, 0.72));
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.login-card input { background: rgba(2, 4, 10, 0.6); }
.login-card input + input { margin-top: 10px; }
.login-card input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216, 177, 90, 0.12); }

/* CTA do limiar — latão/dourado em vez do lima do interior do app */
.cta-temple { background: linear-gradient(135deg, var(--gold-bright), var(--gold)); color: var(--gold-text); box-shadow: 0 6px 22px rgba(216, 177, 90, 0.28); }
.cta-temple:hover { background: linear-gradient(135deg, var(--gold-brightest), var(--gold-bright)); box-shadow: 0 10px 30px rgba(216, 177, 90, 0.42); transform: translateY(-1px); }

/* Mensagem do gate da loja (CIM fora do quadro) — visível, não some sozinha. */
.login-error { margin-top: 14px; padding: 11px 13px; color: #fca5a5; font-size: 13.5px; line-height: 1.5; border: 1px solid rgba(248, 113, 113, 0.35); border-radius: 10px; background: rgba(248, 113, 113, 0.08); }

.master-link { min-height: 46px; display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; background: none; border: none; color: var(--text-muted); font-family: inherit; font-size: 12px; letter-spacing: 0.04em; cursor: pointer; padding: 9px 0; transition: color .2s ease; }
.master-link:hover { color: var(--gold-bright); }
.master-link .key { color: var(--gold); font-size: 14px; }
.master-card { border-color: rgba(216, 177, 90, 0.28); }

/* Telas pequenas — evita estouro da marca e ajusta a coluna de luz */
@media (max-width: 480px) {
  .sigil-mark { font-size: 32px; letter-spacing: 0.01em; }
  .sigil-mark .dot { margin: 0; }
  .sigil-latin { font-size: 9px; letter-spacing: 0.10em; }
  .sigil-sub { font-size: 10px; letter-spacing: 0.16em; }
  .light-beam { width: 96vw; }
  .login-card { padding: 22px; }
}

/* --- Dossier --- */
.dossier { font-size: 14px; line-height: 1.65; }
.dossier .claim { padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--bg-glass-border); margin-bottom: 8px; background: transparent; transition: all .15s ease; }
.dossier .claim:hover { background: var(--bg-glass); }
.cite { font-family: "JetBrains Mono", monospace; font-size: 11.5px; color: var(--accent); background: var(--accent-muted); padding: 2px 7px; border-radius: 6px; margin-left: 4px; white-space: nowrap; }
.gap { color: var(--warning); }
.socratic li { margin: 6px 0 6px 18px; color: var(--text-secondary); }
.biblio { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--text-secondary); }

/* --- Tabs --- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tab { border: 1px solid var(--bg-glass-border); background: transparent; color: var(--text-secondary); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s ease; }
.tab:hover { background: var(--bg-glass); color: var(--text-primary); }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* --- Table --- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.brother-table-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.brother-table-head h3 { margin-bottom: 3px; }
.brother-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.search-field {
  width: 190px; height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 10px;
  border: 1px solid var(--control-border); border-radius: 999px; background: var(--control-bg);
  color: var(--text-muted); transition: border-color .15s ease, background .15s ease;
}
.search-field:focus-within { border-color: var(--accent); background: var(--control-bg-hover); }
.search-field span { font-size: 15px; line-height: 1; transform: translateY(-1px); }
.search-field input {
  width: 100%; min-width: 0; border: 0; background: transparent; padding: 0; border-radius: 0;
  color: var(--control-text); font-size: 13px;
}
.search-field input:focus { border: 0; }
.degree-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  min-height: 30px; border: 1px solid var(--bg-glass-border); border-radius: 999px;
  background: transparent; color: var(--text-secondary); padding: 5px 10px;
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s ease;
}
.filter-chip:hover { background: var(--bg-glass); color: var(--text-primary); }
.filter-chip.is-active { border-color: var(--accent); background: var(--accent-muted); color: var(--accent); }
th { text-align: left; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
td { padding: 10px; border-bottom: 1px solid var(--border); }
tr:hover td { background: var(--bg-glass); }
tr.hidden-by-filter { display: none; }
.mono { font-family: "JetBrains Mono", monospace; }
.degree-badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--accent-muted); color: var(--accent); }
.degree-editor { min-width: 150px; max-width: 260px; padding: 7px 9px; font-size: 12.5px; }
.philosophical-editor { min-width: 250px; }
.degree-editor:disabled { opacity: 1; cursor: not-allowed; background: var(--control-bg-disabled); color: var(--control-disabled-text); }
.brother-row.saving td { background: rgba(216, 177, 90, 0.06); }
.brother-row.error td { background: rgba(239, 68, 68, 0.07); }

/* --- Stat grid --- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-3); }
.stat { padding: 14px; border-radius: var(--radius-md); border: 1px solid var(--bg-glass-border); border-left: 2px solid var(--accent); background: var(--bg-card); }
.stat .num { font-family: "JetBrains Mono", monospace; font-size: 1.6rem; color: var(--text-primary); }
.stat .lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }

/* --- Cérebro da IA (porte do RockZ) --- */
.brain-subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.brain-tab { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--bg-glass-border); background: transparent; color: var(--text-secondary); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s ease; font-family: inherit; }
.brain-tab:hover { background: var(--bg-glass); color: var(--text-primary); }
.brain-tab.active { background: var(--accent-muted); border-color: var(--accent); color: var(--accent); }

.bigstat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.bigstat { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: var(--radius-lg); border: 1px solid var(--bg-glass-border); border-left: 3px solid var(--accent); background: var(--bg-card); transition: all .2s ease; }
.bigstat.clickable { cursor: pointer; } .bigstat.clickable:hover { transform: translateY(-2px); background: var(--bg-card-hover); }
.bigstat.green { border-left-color: var(--accent-auto); } .bigstat.amber { border-left-color: var(--warning); } .bigstat.sky { border-left-color: var(--accent); } .bigstat.gold { border-left-color: var(--gold); }
.bigstat .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; border: 1px solid var(--bg-glass-border); background: var(--bg-glass); flex-shrink: 0; }
.bigstat .v { font-family: "JetBrains Mono", monospace; font-size: 1.8rem; line-height: 1; color: var(--text-primary); }
.bigstat .l { font-size: 13px; font-weight: 600; margin-top: 4px; } .bigstat .s { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--bg-glass-border); border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.chip.green { border-color: rgba(16,185,129,.4); background: rgba(16,185,129,.12); color: var(--accent-auto); }
.chip.amber { border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.12); color: var(--warning); }
.chip.sky   { border-color: rgba(14,165,233,.4); background: rgba(14,165,233,.12); color: var(--accent); }
.chip.red   { border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.12); color: var(--danger); }
.chip.muted { border-color: var(--border); background: var(--bg-glass); color: var(--text-muted); }

.tech-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-secondary); user-select: none; }
.tech-toggle:hover { color: var(--text-primary); }
.tech-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 18px; margin-top: 14px; }
.tech-grid .row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.tech-grid .row .k { color: var(--text-muted); } .tech-grid .row .val { font-family: "JetBrains Mono", monospace; color: var(--text-primary); }

.brain-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid var(--bg-glass-border); background: var(--bg-card); margin-bottom: 8px; transition: all .15s ease; }
.brain-row:hover { background: var(--bg-card-hover); }
.brain-row .info { min-width: 0; } .brain-row .info .t { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brain-row .info .sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.brain-row .acts { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.mini-btn { min-height: 38px; background: transparent; border: 1px solid var(--bg-glass-border); color: var(--text-secondary); border-radius: var(--radius-sm); padding: 7px 11px; font-size: 12px; cursor: pointer; transition: all .15s ease; font-family: inherit; }
.mini-btn:hover { border-color: var(--bg-glass-border-hover); background: var(--bg-glass); color: var(--text-primary); }
.mini-btn.danger:hover { border-color: rgba(239,68,68,.5); color: var(--danger); }
.mini-btn:disabled { opacity: .5; cursor: not-allowed; }

.probe-row { display: flex; gap: 10px; align-items: stretch; margin-bottom: 14px; }
.probe-row input { flex: 1; }
.probe-match { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--bg-glass-border); background: var(--bg-card); margin-bottom: 8px; }
.probe-match .body { min-width: 0; } .probe-match .ttl { font-size: 13px; font-weight: 600; }
.probe-match .ctx { font-size: 11px; color: var(--text-muted); } .probe-match .snip { font-size: 12px; color: var(--text-secondary); margin-top: 4px; line-height: 1.5; }

.graph-wrap { position: relative; height: 520px; border-radius: var(--radius-lg); border: 1px solid var(--bg-glass-border); overflow: hidden; background: #07080d; }
.graph-wrap canvas { display: block; }
.graph-legend { position: absolute; bottom: 12px; left: 12px; display: flex; flex-direction: column; gap: 4px; pointer-events: none; font-size: 11px; }
.graph-legend .lg { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.graph-legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.graph-empty { display: grid; place-items: center; height: 100%; color: var(--text-muted); font-size: 13px; text-align: center; padding: 24px; }

.confirm-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(2,3,8,.6); backdrop-filter: blur(4px); display: grid; place-items: center; }
.confirm-card { width: min(92vw, 380px); padding: 22px; border-radius: var(--radius-lg); border: 1px solid var(--bg-glass-border); background: var(--bg-surface); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.confirm-card h4 { font-family: "Space Grotesk", sans-serif; font-size: 16px; margin-bottom: 8px; }
.confirm-card p { font-size: 13px; color: var(--text-secondary); margin-bottom: 18px; }
.confirm-card .row { display: flex; gap: 10px; justify-content: flex-end; }
.btn-danger { background: var(--danger); color: #fff; border: none; border-radius: 999px; padding: 8px 18px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-danger:hover { filter: brightness(1.1); }

.muted { color: var(--text-muted); font-size: 13px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--accent-muted); border-top-color: var(--accent); border-radius: 50%; animation: rot .7s linear infinite; vertical-align: middle; }
@keyframes rot { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--bg-surface); border: 1px solid var(--bg-glass-border); border-left: 2px solid var(--accent); padding: 12px 18px; border-radius: var(--radius-md); font-size: 13px; box-shadow: 0 22px 44px rgba(0,0,0,.25); z-index: 100; }
.toast.error { border-left-color: var(--danger); color: var(--danger); }
.file-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

@media (max-width: 980px) {
  .lodge-section { align-items: stretch; flex-direction: column; }
  .lodge-select { width: 100%; }
  .brother-create-form { grid-template-columns: 1fr 1fr; }
  .brother-create-form input:first-child,
  .brother-create-form button { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  main { padding-left: 16px; padding-right: 16px; }
  .brother-table-head { flex-direction: column; align-items: stretch; }
  .brother-tools { justify-content: flex-start; }
  .search-field { width: 100%; }
  .brother-create-form { grid-template-columns: 1fr; }
  .brother-create-form input:first-child,
  .brother-create-form button { grid-column: auto; }
}

@keyframes emblem-breathe {
  0%, 100% { filter: drop-shadow(0 0 8px var(--gold-glow)); }
  50% { filter: drop-shadow(0 0 18px var(--gold-glow)); }
}
.emblem { animation: emblem-breathe 4.2s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .scene-enter, .spin, .emblem { animation: none; }
  .cta:hover, .cta-temple:hover { transform: none; }
}

/* --- Painel do Mestre — prancheta ritual --- */
body.admin-mode {
  --bg-primary: #060504;
  --bg-surface: #120d0a;
  --bg-card: rgba(20, 14, 11, 0.78);
  --bg-card-hover: rgba(30, 20, 15, 0.88);
  --bg-glass: rgba(216, 183, 100, 0.07);
  --bg-glass-border: rgba(216, 183, 100, 0.18);
  --bg-glass-border-hover: rgba(240, 217, 150, 0.36);
  --bg-deep: rgba(6, 5, 4, 0.9);
  --border: rgba(216, 183, 100, 0.15);
  --text-primary: #eadfca;
  --text-secondary: rgba(234, 223, 202, 0.72);
  --text-muted: rgba(234, 223, 202, 0.48);
  --accent: #d8b764;
  --accent-muted: rgba(216, 183, 100, 0.15);
  --accent-glow: rgba(216, 183, 100, 0.26);
  --accent-auto: #4f9b8d;
  --accent-manual: #c37a3a;
  --accent-pink: #8f3b2d;
  --accent-cta: #d8b764;
  --accent-cta-hover: #f0d996;
  --accent-cta-text: #1f1606;
  --control-bg: rgba(8, 7, 6, 0.88);
  --control-bg-hover: rgba(20, 14, 11, 0.96);
  --control-bg-disabled: rgba(72, 66, 58, 0.32);
  --control-border: rgba(216, 183, 100, 0.24);
  --control-text: #eadfca;
  --control-placeholder: rgba(234, 223, 202, 0.42);
  --control-disabled-text: rgba(234, 223, 202, 0.42);
  background:
    linear-gradient(rgba(216, 183, 100, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 183, 100, 0.018) 1px, transparent 1px),
    radial-gradient(ellipse at 16% 10%, rgba(143, 59, 45, 0.22), transparent 34rem),
    radial-gradient(ellipse at 88% 70%, rgba(79, 155, 141, 0.12), transparent 34rem),
    linear-gradient(145deg, #050403 0%, #13080c 50%, #07100e 100%);
  background-size: 38px 38px, 38px 38px, auto, auto, auto;
}

body.admin-mode::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 52% 22%, transparent 0 18rem, rgba(0, 0, 0, 0.2) 38rem, rgba(0, 0, 0, 0.56) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.42));
}

body.admin-mode header,
body.admin-mode main,
body.admin-mode .toast {
  position: relative;
  z-index: 1;
}

body.admin-mode header {
  padding: 12px clamp(18px, 2.4vw, 34px);
  border-bottom: 1px solid rgba(216, 183, 100, 0.2);
  background:
    linear-gradient(90deg, rgba(143, 59, 45, 0.18), transparent 44%),
    rgba(7, 5, 4, 0.86);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

body.admin-mode .brand {
  color: var(--gold-bright);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-shadow: 0 0 24px rgba(216, 177, 90, 0.22);
}

body.admin-mode .brand small {
  color: rgba(234, 223, 202, 0.52);
  letter-spacing: 0.28em;
}

body.admin-mode #theme-toggle { display: none; }

body.admin-mode .icon-btn,
body.admin-mode .btn-ghost,
body.admin-mode .mini-btn {
  min-height: 36px;
  border-color: rgba(216, 183, 100, 0.22);
  border-radius: 999px;
  color: rgba(234, 223, 202, 0.72);
  background: rgba(20, 14, 11, 0.72);
}

body.admin-mode .icon-btn:hover,
body.admin-mode .btn-ghost:hover,
body.admin-mode .mini-btn:hover {
  border-color: rgba(240, 217, 150, 0.48);
  color: var(--gold-bright);
  background: rgba(216, 183, 100, 0.1);
}

body.admin-mode .stub-flag {
  color: #f0d996;
  border-color: rgba(240, 217, 150, 0.36);
  background: rgba(216, 183, 100, 0.1);
}

body.admin-mode main {
  max-width: 1480px;
  padding: 24px clamp(16px, 2vw, 32px) 72px;
}

body.admin-mode #admin-view {
  min-height: calc(100vh - 96px);
}

.admin-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.admin-rail {
  position: sticky;
  top: 78px;
  min-height: calc(100vh - 108px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(216, 183, 100, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(216, 183, 100, 0.09), transparent 34%),
    linear-gradient(145deg, rgba(15, 10, 8, 0.94), rgba(8, 6, 5, 0.82));
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.admin-rail::after {
  content: "";
  position: absolute;
  inset: auto -20% -34% -20%;
  height: 52%;
  pointer-events: none;
  background: linear-gradient(45deg, transparent 48%, rgba(216, 183, 100, 0.08) 49% 51%, transparent 52%);
  opacity: 0.8;
}

.rail-emblem {
  position: relative;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  margin: 2px auto 0;
  color: var(--gold-bright);
  filter: drop-shadow(0 0 18px rgba(216, 177, 90, 0.22));
}

.rail-compass {
  font-size: 82px;
  line-height: 1;
  transform: translateY(-1px);
}

.rail-g {
  position: absolute;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 700;
}

.rail-title {
  display: grid;
  gap: 3px;
  text-align: center;
}

.rail-title span,
.admin-kicker {
  color: var(--gold);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.rail-title strong {
  color: var(--text-primary);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  letter-spacing: 0.04em;
}

body.admin-mode .tabs {
  display: grid;
  gap: 8px;
  margin: 6px 0 0;
}

body.admin-mode .tab {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  padding: 11px 13px;
  border-radius: 8px;
  border-color: rgba(216, 183, 100, 0.16);
  background: rgba(7, 5, 4, 0.42);
  color: rgba(234, 223, 202, 0.68);
  font-size: 13px;
}

body.admin-mode .tab span {
  width: 22px;
  color: var(--gold);
  text-align: center;
}

body.admin-mode .tab:hover {
  border-color: rgba(216, 183, 100, 0.34);
  background: rgba(216, 183, 100, 0.08);
  color: var(--text-primary);
}

body.admin-mode .tab.active {
  border-color: rgba(240, 217, 150, 0.46);
  background:
    linear-gradient(135deg, rgba(216, 183, 100, 0.24), rgba(143, 59, 45, 0.14)),
    rgba(16, 11, 8, 0.88);
  color: var(--gold-bright);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 30px rgba(0, 0, 0, 0.24);
}

.rail-note {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(216, 183, 100, 0.14);
}

.rail-note p {
  margin-top: 6px;
  color: rgba(234, 223, 202, 0.68);
  font-size: 12px;
  line-height: 1.5;
}

.admin-workbench {
  min-width: 0;
}

.admin-hero {
  min-height: 164px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(22px, 3vw, 34px);
  margin-bottom: 18px;
  border: 1px solid rgba(216, 183, 100, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(143, 59, 45, 0.2), transparent 44%),
    radial-gradient(ellipse at 88% 20%, rgba(216, 183, 100, 0.14), transparent 28rem),
    rgba(10, 7, 6, 0.76);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

body.admin-mode .headline {
  margin: 3px 0 8px;
  color: var(--text-primary);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

body.admin-mode .headline .light {
  color: rgba(234, 223, 202, 0.76);
  font-weight: 400;
}

body.admin-mode .headline .bold {
  color: var(--gold-bright);
  font-weight: 700;
}

body.admin-mode .subtext {
  max-width: 660px;
  margin-bottom: 0;
  color: rgba(234, 223, 202, 0.66);
  line-height: 1.6;
}

.admin-sigil {
  position: relative;
  width: clamp(96px, 12vw, 140px);
  height: clamp(96px, 12vw, 140px);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: rgba(240, 217, 150, 0.76);
}

.sigil-ring {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(216, 183, 100, 0.24);
  border-radius: 50%;
  box-shadow: 0 0 34px rgba(216, 177, 90, 0.12);
  animation: admin-sigil-turn 22s linear infinite;
}

.sigil-ring::before,
.sigil-ring::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(79, 155, 141, 0.18);
  transform: rotate(45deg);
}

.sigil-triangle {
  font-size: clamp(78px, 10vw, 116px);
  line-height: 1;
}

.sigil-center {
  position: absolute;
  font-size: 26px;
  color: var(--gold-bright);
}

@keyframes admin-sigil-turn {
  to { transform: rotate(360deg); }
}

.lodge-orient {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: 14px;
  margin-bottom: 14px;
}

.lodge-stone,
.lodge-picker,
.metric-card,
.rite-drawer,
body.admin-mode .section {
  border: 1px solid rgba(216, 183, 100, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 42%),
    rgba(15, 11, 9, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.lodge-stone {
  padding: 17px 18px;
}

.lodge-stone strong {
  display: block;
  margin-top: 6px;
  color: var(--text-primary);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.28;
}

.lodge-stone p {
  margin-top: 8px;
  color: rgba(234, 223, 202, 0.52);
  font-size: 13px;
}

.lodge-picker {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 14px;
}

.lodge-picker span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.temple-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric-card {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 14px;
}

.metric-card span {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
}

.metric-card strong {
  color: var(--text-primary);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  line-height: 1;
}

.metric-card small {
  color: rgba(234, 223, 202, 0.56);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rite-console {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.rite-drawer {
  padding: 0;
  overflow: hidden;
}

.rite-drawer summary {
  min-height: 58px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
}

.rite-drawer summary::-webkit-details-marker { display: none; }

.rite-drawer summary > span {
  grid-row: span 2;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(216, 183, 100, 0.22);
  border-radius: 50%;
  color: var(--gold-bright);
  background: rgba(216, 183, 100, 0.08);
}

.rite-drawer summary strong {
  color: var(--text-primary);
  font-size: 14px;
}

.rite-drawer summary small {
  color: rgba(234, 223, 202, 0.52);
  font-size: 12px;
}

.rite-drawer[open] summary {
  border-bottom: 1px solid rgba(216, 183, 100, 0.14);
  background: rgba(216, 183, 100, 0.045);
}

body.admin-mode .brother-create-form {
  grid-template-columns: minmax(180px, 1fr) minmax(100px, 0.48fr) minmax(150px, 0.72fr) minmax(180px, 0.92fr);
  gap: 10px;
  padding: 14px;
}

body.admin-mode .brother-create-form button {
  grid-column: 1 / -1;
  justify-self: end;
}

.btn-temple {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(240, 217, 150, 0.44);
  border-radius: 999px;
  color: #1f1606;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  box-shadow: 0 10px 28px rgba(216, 177, 90, 0.18);
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.btn-temple:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(216, 177, 90, 0.28);
  filter: brightness(1.04);
}

.btn-temple:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
}

body.admin-mode .file-row {
  padding: 14px;
}

body.admin-mode input[type="file"] {
  color: rgba(234, 223, 202, 0.62);
  font-size: 12px;
}

body.admin-mode input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 1px solid rgba(216, 183, 100, 0.22);
  border-radius: 999px;
  color: rgba(234, 223, 202, 0.76);
  background: rgba(8, 7, 6, 0.76);
  padding: 7px 12px;
  cursor: pointer;
}

body.admin-mode .section {
  padding: 16px;
  border-left: 1px solid rgba(216, 183, 100, 0.18);
  margin-bottom: 12px;
}

body.admin-mode .section:hover {
  border-color: rgba(216, 183, 100, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 42%),
    rgba(18, 12, 9, 0.84);
}

.roster-section {
  min-height: 0;
}

body.admin-mode .brother-table-head {
  align-items: center;
  margin-bottom: 12px;
}

body.admin-mode .brother-table-head h3 {
  color: var(--gold-bright);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 700;
}

body.admin-mode .brother-tools {
  gap: 8px;
}

body.admin-mode .search-field {
  width: 220px;
  height: 38px;
  border-color: rgba(216, 183, 100, 0.22);
  background: rgba(8, 7, 6, 0.86);
}

body.admin-mode .search-field span {
  color: var(--gold);
}

body.admin-mode .degree-filters {
  padding: 4px;
  border: 1px solid rgba(216, 183, 100, 0.14);
  border-radius: 999px;
  background: rgba(8, 7, 6, 0.46);
}

body.admin-mode .filter-chip {
  min-height: 28px;
  border: 0;
  color: rgba(234, 223, 202, 0.62);
  background: transparent;
}

body.admin-mode .filter-chip:hover {
  color: var(--text-primary);
  background: rgba(216, 183, 100, 0.08);
}

body.admin-mode .filter-chip.is-active {
  color: #1f1606;
  background: var(--gold);
}

.roster-scroll {
  max-height: min(68vh, 720px);
  border: 1px solid rgba(216, 183, 100, 0.14);
  border-radius: 8px;
  background: rgba(5, 4, 3, 0.42);
}

body.admin-mode table {
  font-size: 12.5px;
}

body.admin-mode .roster-scroll table,
body.admin-mode .wide-table {
  min-width: 860px;
}

body.admin-mode th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 11px 10px;
  border-bottom-color: rgba(216, 183, 100, 0.18);
  color: rgba(240, 217, 150, 0.72);
  background: rgba(12, 8, 6, 0.98);
}

body.admin-mode td {
  padding: 9px 10px;
  border-bottom-color: rgba(216, 183, 100, 0.08);
  color: rgba(234, 223, 202, 0.78);
}

body.admin-mode tr:hover td {
  background: rgba(216, 183, 100, 0.07);
}

body.admin-mode .mono {
  color: rgba(240, 217, 150, 0.72);
}

body.admin-mode select,
body.admin-mode textarea,
body.admin-mode input[type="text"],
body.admin-mode input[type="email"],
body.admin-mode input[type="password"],
body.admin-mode input[type="search"] {
  border-color: rgba(216, 183, 100, 0.22);
  color: var(--control-text);
  background: rgba(8, 7, 6, 0.86);
}

body.admin-mode select:hover,
body.admin-mode input:hover {
  border-color: rgba(216, 183, 100, 0.34);
}

body.admin-mode textarea:focus,
body.admin-mode input:focus,
body.admin-mode select:focus {
  border-color: rgba(240, 217, 150, 0.78);
  box-shadow: 0 0 0 3px rgba(216, 183, 100, 0.13);
}

body.admin-mode select option {
  background: #0d0907;
  color: var(--text-primary);
}

body.admin-mode .degree-editor {
  min-width: 156px;
  max-width: 260px;
  padding: 7px 9px;
}

body.admin-mode .philosophical-editor {
  min-width: 250px;
}

body.admin-mode .degree-editor:disabled {
  border-color: rgba(216, 183, 100, 0.1);
  background: rgba(67, 58, 46, 0.28);
  color: rgba(234, 223, 202, 0.36);
}

body.admin-mode .brother-row.saving td {
  background: rgba(216, 183, 100, 0.12);
}

body.admin-mode .brother-row.error td {
  background: rgba(143, 59, 45, 0.18);
}

body.admin-mode .stat-grid,
body.admin-mode .bigstat-grid {
  gap: 12px;
}

body.admin-mode .stat,
body.admin-mode .bigstat,
body.admin-mode .brain-row,
body.admin-mode .probe-match {
  border-color: rgba(216, 183, 100, 0.16);
  border-left-color: rgba(216, 183, 100, 0.34);
  border-radius: 8px;
  background: rgba(15, 11, 9, 0.76);
}

body.admin-mode .bigstat .ic {
  border-radius: 8px;
  color: var(--gold);
  background: rgba(216, 183, 100, 0.08);
}

body.admin-mode .graph-wrap {
  border-color: rgba(216, 183, 100, 0.18);
  border-radius: 8px;
  background: #070504;
}

body.admin-mode .toast {
  border-color: rgba(216, 183, 100, 0.24);
  border-left-color: var(--gold);
  background: rgba(12, 8, 6, 0.94);
  color: var(--text-primary);
}

@media (max-width: 1100px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-rail {
    position: relative;
    top: auto;
    min-height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }
  .rail-emblem {
    width: 54px;
    height: 54px;
    margin: 0;
  }
  .rail-compass {
    font-size: 52px;
  }
  .rail-g {
    font-size: 18px;
  }
  .rail-title {
    text-align: left;
  }
  body.admin-mode .tabs {
    flex: 1 1 460px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  body.admin-mode .tab {
    justify-content: center;
  }
  .rail-note {
    display: none;
  }
  .lodge-orient,
  .rite-console {
    grid-template-columns: 1fr;
  }
  .temple-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  body.admin-mode .brother-create-form {
    grid-template-columns: 1fr 1fr;
  }
  body.admin-mode .brother-create-form input:first-child,
  body.admin-mode .brother-create-form button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  body.admin-mode header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  body.admin-mode .header-right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  body.admin-mode .icon-btn,
  body.admin-mode .mini-btn,
  body.admin-mode .brain-tab,
  body.admin-mode .filter-chip {
    min-height: 44px;
  }
  body.admin-mode main {
    padding: 16px 12px 52px;
  }
  .admin-hero {
    align-items: flex-start;
    flex-direction: column;
  }
  .admin-sigil {
    display: none;
  }
  body.admin-mode .tabs {
    grid-template-columns: 1fr 1fr;
  }
  .temple-metrics {
    grid-template-columns: 1fr 1fr;
  }
  body.admin-mode .brother-create-form {
    grid-template-columns: 1fr;
  }
  body.admin-mode .brother-create-form input:first-child,
  body.admin-mode .brother-create-form button {
    grid-column: auto;
  }
  body.admin-mode .brother-table-head {
    align-items: stretch;
    flex-direction: column;
  }
  body.admin-mode .brother-tools {
    align-items: stretch;
    justify-content: flex-start;
  }
  body.admin-mode .search-field {
    width: 100%;
  }
  body.admin-mode .degree-filters {
    border-radius: 8px;
  }
  .brain-subtabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .brain-tab {
    justify-content: center;
    border-radius: 8px;
    white-space: normal;
  }
  .bigstat-grid {
    grid-template-columns: 1fr;
  }
  .brain-row,
  .probe-match {
    align-items: stretch;
    flex-direction: column;
  }
  .brain-row .info .t {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .brain-row .acts {
    flex-wrap: wrap;
  }
  .probe-row {
    flex-direction: column;
  }
  .probe-row .cta {
    width: 100%;
  }
  .graph-wrap {
    height: min(68vh, 460px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sigil-ring { animation: none; }
}

/* ===================== Ficha do irmão (drawer do painel) ===================== */
.bro-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(2,4,10,0.6); backdrop-filter: blur(2px); }
.bro-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 71; width: min(440px, 92vw);
  background: var(--bg-surface); border-left: 1px solid var(--gold-glow);
  box-shadow: -20px 0 60px rgba(0,0,0,0.5); padding: 20px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
}
.bro-head { display: flex; align-items: center; justify-content: space-between; }
.bro-head strong { color: var(--gold-bright); font-size: 1.05rem; }
.bro-sec { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; background: var(--bg-card); }
.bro-sec h4 { margin: 0 0 10px; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.bro-sec label { display: block; font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 8px; }
.bro-sec input { width: 100%; margin-top: 4px; background: var(--control-bg); border: 1px solid var(--control-border); border-radius: 8px; padding: 9px 11px; color: var(--text-primary); font-family: inherit; }
.bro-grant { display: flex; gap: 8px; margin-bottom: 10px; }
.bro-grant input { flex: 1; }
.bro-actions { display: flex; gap: 8px; margin-top: 6px; }
.btn-ghost { cursor: pointer; padding: 9px 14px; border-radius: 8px; background: transparent; border: 1px solid var(--border); color: var(--text-secondary); font-family: inherit; }
.btn-ghost:hover { border-color: var(--danger); color: var(--danger); }
.bro-tx { list-style: none; margin: 10px 0 0; padding: 0; }
.bro-tx li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.bro-tx b { color: var(--gold-bright); }
.bro-convs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.bro-convs li { padding: 0; }
.bro-conv { width: 100%; text-align: left; cursor: pointer; padding: 8px 10px; border-radius: 8px; background: transparent; border: 1px solid var(--border); color: var(--text-primary); font-family: inherit; font-size: 0.82rem; }
.bro-conv:hover { border-color: var(--gold-glow); color: var(--gold-bright); }
.bro-conv-read { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.bro-msg { padding: 9px 12px; border-radius: 10px; font-size: 0.82rem; line-height: 1.5; white-space: pre-wrap; }
.bro-msg-u { background: rgba(216,177,90,0.10); border: 1px solid var(--gold-glow); align-self: flex-end; max-width: 88%; }
.bro-msg-a { background: var(--bg-card); border: 1px solid var(--border); align-self: flex-start; max-width: 88%; }
.row-open { cursor: pointer; margin-left: 6px; padding: 1px 7px; border-radius: 6px; background: transparent; border: 1px solid var(--border); color: var(--text-muted); font-family: inherit; }
.row-open:hover { color: var(--gold-bright); border-color: var(--gold-glow); }
.muted { color: var(--text-muted); }
