/* Hounds — Layout: menu lateral, árvore do menu e área de conteúdo */

/* Rail */
.rail { background: var(--rail); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 12px; padding: 16px 14px; border-bottom: 1px solid var(--line); min-height: 64px; box-sizing: border-box; color: inherit; text-decoration: none; }
.brand:hover .brand-mark { border-color: var(--accent); }
.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.brand-mark { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(245,158,11,.35); overflow: hidden; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand-text { min-width: 0; white-space: nowrap; }
.brand-text strong { display: block; font-size: 16px; font-weight: 800; letter-spacing: .02em; }
.brand-text span { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.nav { padding: 12px 10px; flex: 1; overflow-y: auto; overflow-x: hidden; }
.nav-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 6px 8px 8px; white-space: nowrap; }

/* Menu tree: every level uses the same markup and rules */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree { display: flex; flex-direction: column; gap: 4px; }
.row { display: flex; align-items: center; border-radius: 10px; border: 1px solid transparent; }
.row:hover { background: var(--surface); }
.row.current { background: var(--accent-soft); border-color: rgba(245,158,11,.25); }
.node-row { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; box-sizing: border-box; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer; }
.node-row svg { flex: none; }
.node-row .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.row:hover .node-row { color: var(--text); }
.row.current .node-row { color: var(--accent); }
.node.on-path > .row .node-row { color: var(--text); }
.node-row:focus-visible, .chev-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.chev-btn { flex: none; display: grid; place-items: center; width: 30px; height: 30px; margin-right: 4px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.chev-btn:hover { color: var(--text); background: var(--surface-2); }
.chev { flex: none; transition: transform .18s ease; color: var(--muted); }
[aria-expanded="true"] > .chev, [aria-expanded="true"] .chev { transform: rotate(90deg); }
.kids { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .2s ease; }
.kids > ul { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; margin-left: 20px; padding-left: 10px; border-left: 1px solid var(--line); }
.node.open > .kids { grid-template-rows: 1fr; }
.node.open > .kids > ul { padding-top: 4px; padding-bottom: 4px; }
.node:not(.depth-0) > .row .node-row { font-size: 13px; padding: 7px 10px; gap: 10px; }
.kids .kids .kids > ul { margin-left: 9px; padding-left: 5px; }
.kids .node-row { white-space: normal; }
.kids .node-row .label { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.node:not(.depth-0):not(.depth-1):not(.depth-2) > .row .node-row { padding: 6px 6px; gap: 8px; }
.empty-kid { font-size: 12px; color: var(--faint); padding: 6px 10px; font-style: italic; }

.toggle { margin: 10px; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.toggle:hover { color: var(--text); background: var(--surface); }
.toggle:focus-visible, .menu-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle svg { flex: none; transition: transform .2s ease; }
.app.collapsed .toggle svg { transform: rotate(180deg); }
.toggle.theme-btn { margin-bottom: 0; }
.app.collapsed .toggle.theme-btn svg { transform: none; }
.theme-btn .i-moon, :root[data-theme="light"] .theme-btn .i-sun { display: none; }
:root[data-theme="light"] .theme-btn .i-moon { display: block; }
/* Tema claro/escuro e Mais temas lado a lado; com o menu recolhido, um embaixo do outro (só os ícones) */
.theme-row { display: flex; gap: 8px; margin: 10px 10px 0; }
.theme-row .toggle.theme-btn { flex: 1 1 0; min-width: 0; margin: 0; gap: 8px; padding: 10px 8px; }
.theme-row .toggle span { overflow: hidden; text-overflow: ellipsis; }
/* Mais temas: só o ícone; o resto da linha fica com Tema claro/escuro. */
.theme-row #themesBtn { flex: none; padding: 10px; justify-content: center; }
.app.collapsed .theme-row { flex-direction: column; }
/* Mais temas: dois claros e dois escuros, cada um com as cores dele (fundo, superfície, texto, destaque) */
.theme-pick { display: flex; flex-direction: column; gap: 12px; }
.theme-pick h2 { margin: 0; }
.theme-pick .sec-title { margin: 6px 0 0; }
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.theme-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.theme-card:hover { border-color: var(--accent); }
.theme-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-card.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.theme-card small { font-size: 12px; color: var(--muted); }
.theme-sw { display: flex; width: 100%; height: 28px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 4px; }
.theme-sw i { flex: 1; }
@media (max-width: 480px) { .theme-grid { grid-template-columns: minmax(0, 1fr); } }

/* Status da última atualização */
.build-status { display: flex; align-items: center; gap: 8px; margin: 8px 10px 4px; padding: 7px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; color: var(--muted); line-height: 1.3; cursor: default; user-select: none; }
.build-status .status-dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 6px rgba(16,185,129,.7); flex: none; }
.build-status .status-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.build-status strong { color: var(--text); font-weight: 600; }
.app.collapsed .build-status { margin: 8px auto 4px; padding: 8px; justify-content: center; width: 34px; height: 34px; box-sizing: border-box; }
.app.collapsed .build-status .status-text { display: none; }

.app.collapsed .brand-text, .app.collapsed .nav-label, .app.collapsed .toggle span, .app.collapsed .node-row .label, .app.collapsed .chev, .app.collapsed .chev-btn, .app.collapsed .kids { display: none; }
.app.collapsed .brand { justify-content: center; padding-inline: 0; }
.app.collapsed .node-row, .app.collapsed .toggle { justify-content: center; }

/* Content */
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.view { flex: 1; min-height: 0; }
.view[hidden] { display: none !important; }
.frame { width: 100%; height: 100%; border: 0; display: block; background: var(--ground); }
.page { overflow-y: auto; height: 100%; }
.page-inner { max-width: 1040px; margin: 0 auto; padding: 28px 24px 56px; display: flex; flex-direction: column; gap: 22px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.crumbs b { color: var(--accent); font-weight: 600; }
.page h1 { margin: 2px 0 6px; font-size: 30px; font-weight: 800; text-wrap: balance; overflow-wrap: anywhere; }
.lede { margin: 0; color: var(--muted); line-height: 1.6; max-width: 66ch; }
.head-row { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.head-row > div { min-width: 0; }
.notice { font-size: 13px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-2); border-radius: 10px; padding: 10px 12px; }
.sec-title { margin: 0 0 12px; font-size: 12px; font-family: var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
