:root {
  --brand: #0b5d4b;
  --brand-strong: #064637;
  --brand-soft: #e8f3ef;
  --accent: #c79b3b;
  --ink: #172420;
  --muted: #67756f;
  --line: #dfe7e3;
  --surface: #ffffff;
  --canvas: #f4f7f5;
  --success: #16845f;
  --danger: #c74747;
  --warning: #a66b14;
  --shadow: 0 14px 38px rgba(23, 57, 46, .09);
  --sidebar: 252px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--brand); }
.hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
:where(button,a,input,select,textarea,summary):focus-visible { outline: 3px solid rgba(11,93,75,.22); outline-offset: 2px; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 12% 10%, #d9eee6 0, transparent 38%), linear-gradient(135deg, #f5f8f6 25%, #eaf2ee); }
.login-card { width: min(560px, 100%); padding: 54px; border: 1px solid rgba(11,93,75,.12); border-radius: 28px; background: rgba(255,255,255,.93); box-shadow: var(--shadow); text-align: center; }
.login-card h1 { margin: 10px 0 18px; font-size: clamp(2rem, 6vw, 3.4rem); letter-spacing: -.055em; line-height: 1.02; }
.login-card p:not(.eyebrow) { margin: 0 auto 28px; max-width: 430px; color: var(--muted); line-height: 1.65; }
.login-card small { display: block; margin-top: 24px; color: var(--muted); }
.login-divider { display:flex; align-items:center; gap:12px; margin:24px 0 18px; color:var(--muted); font-size:.78rem; }
.login-divider::before,.login-divider::after { content:""; flex:1; border-top:1px solid var(--line); }
.email-login-form { display:grid; gap:8px; text-align:left; }
.email-login-form + .email-login-form { margin-top:12px; }
.email-login-form label { color:var(--ink); font-size:.8rem; font-weight:750; }
.email-login-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; }
.email-login-row input { min-width:0; min-height:44px; padding:10px 13px; border:1px solid var(--line); border-radius:10px; background:#fff; color:var(--ink); font:inherit; }
.email-login-row input:focus { outline:3px solid rgba(11,93,75,.13); border-color:var(--brand); }
.login-message { margin-top:12px; padding:10px 12px; border-radius:10px; background:#eaf6f1; color:var(--brand-strong); font-size:.8rem; line-height:1.45; text-align:left; }
.login-message.error { background:#fff0ee; color:#8e3026; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: var(--sidebar); background: #f9fbfa; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; transition: width .22s ease, transform .22s ease; }
.brand { min-height: 60px; display: flex; align-items: center; gap: 11px; padding: 6px 4px 18px; }
.brand-mark { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(145deg, var(--brand), var(--brand-strong)); color: white; font-weight: 800; letter-spacing: -.04em; box-shadow: 0 8px 20px rgba(11,93,75,.18); }
.brand-mark-large { width: 54px; height: 54px; margin: 0 auto 18px; border-radius: 17px; font-size: 1.15rem; }
.brand-copy { min-width: 0; line-height: 1.05; }
.brand-copy strong, .brand-copy span { display: block; white-space: nowrap; }
.brand-copy span { margin-top: 4px; color: var(--muted); font-size: .79rem; }
.collapse-button { margin-left: auto; }
.primary-nav { display: grid; gap: 6px; margin-top: 18px; }
.nav-item { width: 100%; border: 0; border-radius: 12px; background: transparent; color: #44524d; display: flex; align-items: center; gap: 12px; padding: 12px; cursor: pointer; text-align: left; transition: .16s ease; }
.nav-item:hover { color: var(--brand); background: var(--brand-soft); }
.nav-item.active { color: white; background: var(--brand); box-shadow: 0 7px 18px rgba(11,93,75,.18); }
.nav-icon { width: 23px; text-align: center; font-size: 1.08rem; }
.nav-label { white-space: nowrap; overflow: hidden; }
.sidebar-footer { margin-top: auto; padding: 14px 10px 5px; color: var(--muted); display: flex; align-items: center; gap: 9px; font-size: .78rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #1fa975; box-shadow: 0 0 0 4px rgba(31,169,117,.12); }

body.sidebar-collapsed { --sidebar: 78px; }
body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .nav-label { display: none; }
body.sidebar-collapsed .collapse-button { transform: rotate(180deg); margin-left: 0; }
body.sidebar-collapsed .nav-item { justify-content: center; }

.workspace { min-height: 100vh; margin-left: var(--sidebar); transition: margin-left .22s ease; }
.topbar { position: sticky; top: 0; z-index: 20; height: 72px; display: flex; align-items: center; gap: 16px; padding: 10px clamp(18px, 3vw, 42px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(14px); }
.global-search-wrap { position: relative; flex: 1; max-width: 720px; }
.global-search-wrap input { width: 100%; height: 44px; padding: 0 48px 0 42px; border: 1px solid var(--line); border-radius: 13px; outline: 0; background: #f7f9f8; transition: .18s ease; }
.global-search-wrap input:focus { background: white; border-color: rgba(11,93,75,.55); box-shadow: 0 0 0 4px rgba(11,93,75,.08); }
.search-icon { position: absolute; left: 15px; top: 11px; color: var(--muted); z-index: 1; }
kbd { position: absolute; right: 13px; top: 11px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: white; font-size: .75rem; }
.search-results { position: absolute; left: 0; right: 0; top: 52px; max-height: 420px; overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: var(--shadow); }
.search-result { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px; border: 0; border-radius: 10px; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.search-result:hover, .search-result:focus { background: var(--brand-soft); }
.search-result strong { min-width: 85px; color: var(--brand); }
.search-result small { margin-left: auto; color: var(--muted); }
.topbar-home-link { flex: 0 0 auto; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 11px; border: 1px solid rgba(11,93,75,.22); border-radius: 10px; color: var(--brand); background: white; text-decoration: none; font-size: .78rem; font-weight: 700; white-space: nowrap; transition: .15s ease; }
.topbar-home-link:hover { background: var(--brand-soft); }
.topbar-home-link:focus-visible { outline: 3px solid rgba(11,93,75,.2); outline-offset: 2px; }
.topbar-home-icon { font-size: 1.05rem; line-height: 1; }
.profile { display: flex; align-items: center; gap: 10px; }
.profile-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: white; background: var(--brand); font-weight: 700; overflow: hidden; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-copy { min-width: 0; }
.profile-copy strong, .profile-copy span { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy strong { font-size: .84rem; }
.profile-copy span { color: var(--muted); font-size: .72rem; margin-top: 2px; }
.icon-button, .ghost-button, .button { border: 0; cursor: pointer; }
.icon-button { position: relative; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); background: transparent; }
.icon-button:hover { color: var(--brand); background: var(--brand-soft); }
.ghost-button { padding: 8px 10px; border-radius: 9px; background: transparent; color: var(--muted); }
.ghost-button:hover { background: #f1f4f2; color: var(--ink); }
.mobile-menu { display: none; }
.badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 10px; display: grid; place-items: center; color: white; background: var(--danger); font-size: .66rem; }

.main-content { padding: 30px clamp(18px, 3vw, 42px) 64px; }
.view { display: none; animation: fade .2s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: .45; transform: translateY(4px); } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading h1 { margin: 2px 0 7px; font-size: clamp(1.7rem, 3vw, 2.35rem); line-height: 1.08; letter-spacing: -.04em; }
.page-heading p:not(.eyebrow) { margin: 0; color: var(--muted); line-height: 1.5; }
.eyebrow { margin: 0; color: var(--brand); font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.heading-actions { display: flex; align-items: center; gap: 10px; }
.updated-label { color: var(--muted); font-size: .76rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 15px; border-radius: 11px; font-weight: 650; text-decoration: none; transition: .15s ease; }
.button.primary { color: white; background: var(--brand); }
.button.primary:hover { background: var(--brand-strong); }
.button.secondary { color: var(--brand); border: 1px solid rgba(11,93,75,.22); background: white; }
.button.secondary:hover { background: var(--brand-soft); }
.button.large { min-height: 48px; padding: 12px 22px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; }
.summary-grid { margin-bottom: 22px; }
.metric-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: 0 4px 15px rgba(23,57,46,.035); }
.metric-card .metric-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .78rem; }
.metric-card .metric-value { display: block; margin: 8px 0 5px; font-size: 1.45rem; font-weight: 760; letter-spacing: -.03em; }
.metric-card .metric-meta { color: var(--muted); font-size: .72rem; }
.positive { color: var(--success) !important; }
.negative { color: var(--danger) !important; }
.warning { color: var(--warning) !important; }

.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 13px; background: #edf2ef; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; min-height: 38px; padding: 8px 14px; border: 0; border-radius: 9px; color: #52615b; background: transparent; cursor: pointer; font-weight: 650; font-size: .84rem; }
.tab:hover { color: var(--brand); }
.tab.active { color: var(--brand-strong); background: white; box-shadow: 0 2px 8px rgba(23,57,46,.08); }
.tab-content { min-height: 280px; }
.panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.panel-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.global-market-layout { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(310px,1fr); gap: 16px; align-items: stretch; }
.global-market-main, .global-market-main > .data-card { min-width: 0; height: 100%; }
.global-market-stack { min-width: 0; display: grid; grid-template-rows: repeat(2,minmax(0,1fr)); gap: 16px; }
.global-market-stack > .data-card { min-height: 0; }
.global-market-stack .card-section { height: 100%; }
.data-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 4px 18px rgba(23,57,46,.04); }
.card-section { padding: 20px; }
.card-section + .card-section { border-top: 1px solid var(--line); }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.card-heading h2, .card-heading h3 { margin: 0; font-size: 1rem; }
.card-heading p { margin: 5px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.source-link { color: var(--muted); font-size: .7rem; text-decoration: none; }
.source-link:hover { color: var(--brand); text-decoration: underline; }

.table-scroll { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .81rem; }
th { position: sticky; top: 0; z-index: 1; padding: 11px 13px; color: #66736e; background: #f5f8f6; text-align: left; font-size: .7rem; letter-spacing: .025em; text-transform: uppercase; white-space: nowrap; }
td { padding: 12px 13px; border-top: 1px solid #edf1ef; white-space: nowrap; }
tr[data-ticker] { cursor: pointer; }
tr[data-ticker]:hover td { background: #f5faf7; }
.ticker-cell { color: var(--brand); font-weight: 750; }
.empty-state, .error-state { padding: 42px 24px; text-align: center; color: var(--muted); }
.error-state { color: var(--danger); }
.empty-state strong, .error-state strong { display: block; color: var(--ink); margin-bottom: 6px; }

.filter-drawer { margin-bottom: 16px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.filter-drawer summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; cursor: pointer; }
.filter-drawer summary::-webkit-details-marker { display: none; }
.filter-drawer summary strong, .filter-drawer summary small { display: block; }
.filter-drawer summary small { margin-top: 4px; color: var(--muted); }
.summary-action { color: var(--brand); font-size: .78rem; font-weight: 700; }
.filter-body { padding: 0 18px 18px; border-top: 1px solid var(--line); }
.preset-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 15px 0; }
.preset-button { padding: 8px 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: white; cursor: pointer; }
.preset-button.active { color: white; border-color: var(--brand); background: var(--brand); }
.preset-button:disabled { cursor: not-allowed; opacity: .48; }
.custom-preset-buttons { display: contents; }
.filter-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.filter-columns h3 { margin: 3px 0 11px; font-size: .87rem; }
.filter-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.field { display: grid; gap: 5px; }
.field label { color: var(--muted); font-size: .72rem; }
.field input, .field select { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: white; }
.field textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; resize: vertical; }
.field input:focus, .field select:focus { border-color: var(--brand); }
.field input:disabled, .field select:disabled { color: #53625c; background: #f2f5f3; cursor: not-allowed; opacity: .88; }
.help-mark { display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 1px solid #b8c9c2; border-radius: 50%; color: var(--brand); background: white; font-size: .66rem; font-weight: 800; cursor: help; vertical-align: middle; }
.range-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.check { display: flex; align-items: center; gap: 7px; color: var(--ink) !important; cursor: pointer; }
.check input { width: auto; min-height: 0; }
.wide-action { grid-column: 1 / -1; }
.filter-subgroup { grid-column: 1 / -1; padding: 2px 0; }
.filter-subgroup > summary { cursor: pointer; color: var(--brand); font-size: .78rem; font-weight: 750; }
.filter-subgroup > .filter-grid { margin-top: 10px; }
.analysis-filter-notice { margin-bottom: 14px; }
.custom-filter-controls { display: grid; grid-template-columns: minmax(220px,1fr) auto auto; align-items: end; gap: 10px; margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f7faf8; }
.custom-filter-controls small { grid-column: 1 / -1; color: var(--muted); }
.analysis-mode-tabs { width: fit-content; margin-top: -7px; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 13px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .74rem; }
.table-toolbar-main,.table-density { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.table-density .button.active { color: white; background: var(--brand); }
.table-freshness { align-items: center; display: inline-flex; gap: 6px; white-space: nowrap; }
.status-chip { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 8px; border: 1px solid transparent; border-radius: 999px; font-size: .67rem; font-weight: 760; line-height: 1.2; white-space: nowrap; }
.status-updated { color: #0a654c; border-color: #b9dfd1; background: #e7f6f0; }
.status-empty { color: #6a5934; border-color: #eadcb9; background: #fff8e7; }
.status-na { color: #5f6c67; border-color: #dce3e0; background: #f2f5f3; cursor: help; }
.status-failed { color: #9a3535; border-color: #edc5c5; background: #fff0f0; }
.table-sort { align-items: center; display: inline-flex; gap: 7px; padding: 0; border: 0; color: inherit; background: transparent; cursor: pointer; font: inherit; font-weight: inherit; letter-spacing: inherit; text-transform: inherit; white-space: nowrap; }
.table-sort span { color: #96a19d; font-size: .78rem; }
.table-sort:hover,.table-sort.active { color: var(--brand); }
.analysis-data-table.density-compact th { padding: 8px 10px; }
.analysis-data-table.density-compact td { padding: 7px 10px; font-size: .75rem; }
.analysis-data-table th:first-child,.analysis-data-table td:first-child { left: 0; position: sticky; }
.analysis-data-table th:first-child { z-index: 3; }
.analysis-data-table td:first-child { z-index: 2; background: white; box-shadow: 1px 0 0 var(--line); }
.analysis-data-table tr[data-ticker]:hover td:first-child { background: #f5faf7; }
.backtest-leader-stack { display: grid; gap: 7px; min-width: 270px; }
.backtest-leader-stack > div { display: grid; grid-template-columns: 22px minmax(120px,1fr) auto; align-items: center; gap: 7px; }
.backtest-leader-stack strong, .backtest-leader-stack small { display: block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backtest-leader-stack strong { color: var(--ink); font-size: .73rem; }
.backtest-leader-stack small { margin-top: 2px; color: var(--muted); font-size: .65rem; }
.backtest-leader-single { display: grid; gap: 4px; min-width: 150px; }
.backtest-leader-single strong { color: var(--ink); font-size: .75rem; }
.backtest-leader-single .pill { justify-self: start; }
.backtest-leader-single small { color: var(--muted); font-size: .66rem; }
.leader-rank { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; color: var(--brand); background: var(--brand-soft); font-size: .65rem; font-weight: 800; }
.guide-intro { margin-bottom: 16px; }
.guide-intro h2 { margin: 3px 0 8px; }
.guide-intro p:last-child { margin-bottom: 0; color: var(--muted); line-height: 1.6; }
.guide-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-bottom: 16px; }
.guide-list { display: grid; gap: 7px; }
.guide-list details { padding: 10px 12px; border: 1px solid #e6ece9; border-radius: 10px; background: #fafcfb; }
.guide-list summary { color: var(--ink); cursor: pointer; font-size: .8rem; font-weight: 750; }
.guide-list p { margin: 8px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.score-profile-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.score-profile-grid article { display: grid; gap: 5px; padding: 12px; border: 1px solid #e4ebe7; border-radius: 11px; background: #fafcfb; }
.score-profile-grid strong { font-size: .79rem; }
.score-profile-grid span { color: var(--muted); font-size: .72rem; line-height: 1.5; }
.column-picker { position: relative; }
.column-picker > summary { cursor: pointer; color: var(--brand); font-weight: 700; }
.column-picker[open] > div { position: absolute; z-index: 12; top: 30px; left: 0; width: min(520px, 78vw); max-height: 360px; overflow: auto; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.chart-periods { display: flex; flex-wrap: wrap; gap: 7px; padding: 18px 18px 0; }
.chart-periods .button { min-height: 34px; padding: 6px 10px; font-size: .75rem; }

.skeleton { position: relative; overflow: hidden; min-height: 86px; border-radius: 14px; background: #e9efec; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: shimmer 1.25s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.loading-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 13px; }
.secondary-loading { align-items: center; color: var(--muted); display: inline-flex; font-size: .76rem; gap: 7px; white-space: nowrap; }
.loading-dot { animation: secondary-pulse .9s ease-in-out infinite alternate; background: var(--brand); border-radius: 50%; display: inline-block; height: 7px; width: 7px; }
@keyframes secondary-pulse { from { opacity: .28; transform: scale(.75); } to { opacity: 1; transform: scale(1); } }
.tab-content.panel-refreshing { position: relative; }
.tab-content.panel-refreshing::before { background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 999px; color: var(--muted); content: "Atualizando…"; font-size: .7rem; font-weight: 700; padding: 5px 9px; position: absolute; right: 4px; top: -34px; z-index: 4; }
@supports (content-visibility: auto) {
  .view.active .tab-content > .data-card,
  .view.active .tab-content > .panel-grid > .data-card { contain-intrinsic-size: auto 420px; content-visibility: auto; }
}

.admin-workspace { display: grid; grid-template-columns: minmax(210px,240px) minmax(0,1fr); gap: 18px; align-items: start; }
.admin-section-nav { position: sticky; top: 92px; display: grid; gap: 15px; margin: 0; padding: 10px; overflow: visible; background: #edf2ef; }
.admin-nav-group { display: grid; gap: 4px; }
.admin-nav-label { padding: 4px 9px 5px; color: #71807a; font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.admin-section-nav .tab { width: 100%; min-height: 42px; text-align: left; white-space: normal; }
.admin-panel-stage { min-width: 0; }

.chart { position: relative; min-height: 300px; padding: 22px 12px 10px 48px; }
.chart-grid-line { position: absolute; left: 48px; right: 12px; border-top: 1px dashed #dfe6e2; }
.chart-svg { width: 100%; height: 260px; overflow: visible; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 0 18px 18px; color: var(--muted); font-size: .74rem; }
.allocation-visual { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; align-items: center; gap: 28px; padding: 10px; }
.allocation-donut { width: min(240px, 65vw); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; position: relative; margin: auto; }
.allocation-donut::after { content: ""; position: absolute; inset: 24%; border-radius: 50%; background: var(--surface, #fff); }
.allocation-donut span { position: relative; z-index: 1; font-weight: 750; font-size: .9rem; text-align: center; }
.allocation-legend { display: grid; gap: 9px; }
.allocation-legend div { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 8px; padding-bottom: 7px; border-bottom: 1px solid var(--border); }
.allocation-hierarchy { display: grid; gap: 16px; }
.allocation-svg-wrap { display: grid; justify-items: center; gap: 4px; min-width: 0; }
.allocation-svg { width: min(300px,72vw); height: auto; overflow: visible; }
.allocation-type-slice,.allocation-breakdown-slice { stroke: white; stroke-width: 2; transition: opacity .15s ease,transform .15s ease,filter .15s ease; transform-origin: center; }
.allocation-type-slice { cursor: pointer; }
.allocation-type-slice:hover,.allocation-type-slice:focus-visible,.allocation-type-slice.selected { filter: brightness(1.08) drop-shadow(0 2px 3px rgba(7,61,49,.2)); transform: scale(1.018); outline: none; }
.allocation-breakdown-slice:hover,.allocation-breakdown-slice:focus-visible { opacity: .82; outline: none; }
.allocation-center { fill: var(--surface,#fff); stroke: var(--line); stroke-width: 1; pointer-events: none; }
.allocation-center-label,.allocation-center-value { fill: var(--ink); text-anchor: middle; pointer-events: none; }
.allocation-center-label { font-size: 9px; fill: var(--muted); }
.allocation-center-value { font-size: 11px; font-weight: 750; }
.allocation-ring-help { color: var(--muted); font-size: .72rem; text-align: center; }
.allocation-legend-row { width: 100%; display: grid; grid-template-columns: 14px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 8px 7px; border: 1px solid transparent; border-bottom-color: var(--line); border-radius: 8px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.allocation-legend-row span { display: grid; gap: 2px; }
.allocation-legend-row small { color: var(--muted); font-size: .68rem; font-weight: 500; }
.allocation-legend-row:hover,.allocation-legend-row:focus-visible,.allocation-legend-row.selected { border-color: rgba(11,93,75,.25); background: var(--brand-soft); outline: none; }
.allocation-partial { margin: 0; }
.allocation-detail-card { margin: 4px 0 0; border-color: rgba(11,93,75,.22); background: linear-gradient(145deg,#fff,#f3f8f5); }
.allocation-detail-card .card-heading { align-items: flex-start; }
.allocation-detail-visual { grid-template-columns: minmax(170px,230px) 1fr; padding: 0; }
.allocation-detail-svg { width: min(230px,62vw); }
@media (max-width: 720px) { .allocation-visual { grid-template-columns: 1fr; } }
.compact-field { min-width: 170px; margin: 0; }
.compact-field span { font-size: .74rem; color: var(--muted); }
.finance-overview-grid { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(300px,.85fr); gap: 16px; margin: 16px 0; }
.finance-bars { display: grid; gap: 11px; }
.finance-bar-row { display: grid; grid-template-columns: minmax(110px,.8fr) minmax(120px,2fr) auto; align-items: center; gap: 10px; font-size: .86rem; }
.finance-bar-row > div { height: 9px; border-radius: 99px; background: var(--brand-soft); overflow: hidden; }
.finance-bar-row i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--brand),#3ea684); }
.finance-bar-row strong { font-size: .82rem; text-align: right; }
@media (max-width: 900px) { .finance-overview-grid { grid-template-columns: 1fr; } .finance-bar-row { grid-template-columns: minmax(95px,.8fr) minmax(90px,1fr) auto; } }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.comparison-controls { display: grid; gap: 13px; margin-bottom: 5px; }
.comparison-controls .chart-periods { padding: 0; }
.comparison-date-range { display: grid; grid-template-columns: repeat(2,minmax(180px,240px)); gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--brand-soft); }
.comparison-refresh-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.curve-controls { display: grid; gap: 9px; margin-bottom: 10px; }
.update-panel{margin:0 0 14px;border:1px solid #dce7e2;background:#f8fbf9;border-radius:14px;padding:11px 14px;color:#334b42}
.update-summary{display:flex;align-items:center;justify-content:space-between;gap:16px}
.update-summary>span{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.update-summary small,.update-detail-row small{display:block;color:#697d74;font-size:.78rem}
.button.compact{min-height:32px;padding:6px 10px;font-size:.78rem}
.update-details{margin-top:8px;border-top:1px solid #e3ece8;padding-top:7px}
.update-details summary{cursor:pointer;color:#42665a;font-size:.8rem;font-weight:700}
.update-detail-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,.85fr);gap:14px;padding:9px 2px;border-bottom:1px solid #e8efec}
.update-detail-row:last-child{border-bottom:0}
.update-detail-row>span:last-child{text-align:right}
.series-picker { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #f7f9f8; }
.series-picker .check { min-width: 0; min-height: 45px; padding: 10px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .76rem; transition: background .15s ease; }
.series-picker .check:nth-child(4n) { border-right: 0; }
.series-picker .check:hover { background: var(--brand-soft); }
.series-picker .check:has(input:checked) { color: var(--brand-strong) !important; background: #edf7f3; font-weight: 750; }
.series-picker .check span { min-width: 0; }
.series-picker .check small { color: var(--muted); font-size: .64rem; font-weight: 650; }
.series-picker input:disabled { cursor: not-allowed; }
.series-picker .check:has(input:disabled) { cursor: not-allowed; opacity: .55; }
.series-picker input:disabled + .legend-dot { opacity: .35; }
.comparison-chart { min-width: 720px; height: 330px; }
.comparison-chart-wrap { overflow-x: auto; }

.headline-list { display: grid; gap: 4px; }
.headline { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 13px 3px; color: var(--ink); text-decoration: none; border-bottom: 1px solid #edf1ef; }
.headline:last-child { border-bottom: 0; }
.headline-number { color: var(--brand); font-size: 1.3rem; font-weight: 800; }
.headline strong { display: block; line-height: 1.4; }
.headline small { color: var(--muted); }
.headline-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.headline-header { color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.headline-header:hover { background: transparent; }
.subtabs { display: flex; align-items: center; gap: 6px; width: fit-content; margin-bottom: 14px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #f5f8f6; }
.subtabs .tab { min-height: 34px; border-radius: 8px; }
.recommendation-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.segmented-control { display: flex; flex-wrap: wrap; gap: 6px; }
.alerts-workspace { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(300px,.65fr); gap: 16px; margin-bottom: 16px; }
.alerts-workspace > .data-card { margin: 0; }
.alert-form { display: grid; gap: 12px; }
.alert-form-help { margin-top: 4px; }
.alert-schedule { margin-bottom: 14px; }
.alert-schedule small { color: inherit; opacity: .82; }
.alert-symbol-field { position: relative; }
.alert-suggestions { position: absolute; z-index: 25; top: calc(100% + 4px); right: 0; left: 0; max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: var(--shadow); }
.alert-suggestions button { width: 100%; display: grid; grid-template-columns: 72px minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 10px 12px; border: 0; border-bottom: 1px solid #edf1ef; background: white; color: var(--ink); text-align: left; cursor: pointer; }
.alert-suggestions button:hover { background: var(--brand-soft); }
.alert-suggestions button:last-child { border-bottom: 0; }
.alert-suggestions button strong { color: var(--brand); }
.alert-suggestions button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-suggestions button small { color: var(--muted); }
.input-suffix { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: white; overflow: hidden; }
.input-suffix input { border: 0; border-radius: 0; }
.input-suffix span { padding: 0 10px; color: var(--muted); font-size: .72rem; }
.disabled-condition { opacity: .62; }
.alert-history { margin-top: 16px; padding: 0; overflow: hidden; }
.alert-history > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 18px; cursor: pointer; }
.alert-history-body { border-top: 1px solid var(--line); }
.permission-grid { display: grid; grid-template-columns: repeat(2,minmax(90px,1fr)); gap: 4px 10px; margin-top: 9px; }
.access-level-list { display: grid; gap: 12px; margin: 16px 0; }
.access-level-card { border: 1px solid var(--line); border-radius: 15px; background: white; overflow: hidden; }
.access-level-card > summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; cursor: pointer; }
.access-level-card > summary > span:first-child { display: grid; gap: 4px; }
.access-level-card > summary > span:last-child { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.access-level-card summary small { color: var(--muted); font-weight: 500; line-height: 1.45; }
.access-level-form { display: grid; gap: 13px; padding: 17px 18px 19px; border-top: 1px solid var(--line); background: #fbfcfb; }
.access-level-meta { display: grid; grid-template-columns: minmax(180px,.6fr) minmax(260px,1.4fr) auto; align-items: end; gap: 10px; }
.access-active { min-height: 38px; }
.permission-section { border: 1px solid #e2eae6; border-radius: 11px; background: white; }
.permission-section > summary { display: flex; justify-content: space-between; gap: 12px; padding: 11px 13px; color: var(--ink); font-size: .79rem; font-weight: 750; cursor: pointer; }
.permission-section > summary span { color: var(--muted); font-weight: 600; }
.permission-matrix { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; padding: 0 13px 13px; }
.permission-matrix .check { min-height: 38px; padding: 8px 9px; border: 1px solid #e7ece9; border-radius: 8px; background: #fafcfb; font-size: .76rem; }
.access-limit-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--brand-soft); }
.create-level-card { margin-top: 16px; }
.create-level-card > summary { padding: 16px 18px; cursor: pointer; }
.create-level-card form { margin-top: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.admin-user-filters { display: grid; grid-template-columns: minmax(230px,1.4fr) minmax(170px,.7fr) minmax(150px,.6fr) auto; align-items: end; gap: 10px; margin-bottom: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.bulk-access-bar,.admin-monitor-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--brand-soft); }
.bulk-access-bar > span,.admin-monitor-row > span { display: grid; gap: 3px; margin-right: auto; }
.bulk-access-bar small,.admin-monitor-row small { color: var(--muted); }
.bulk-access-bar select { min-width: 180px; min-height: 38px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.admin-users-table select { min-width: 145px; min-height: 34px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px 0; color: var(--muted); }
.admin-update-actions { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 9px; margin: 15px 0; }
.admin-update-actions .button { white-space: normal; }
.admin-analysis-type-picker { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 14px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.admin-analysis-type-picker select { width: min(320px,100%); }
.admin-analysis-preset-list { display: grid; gap: 14px; }
.admin-analysis-preset { display: grid; gap: 13px; padding: 16px; }
.admin-analysis-preset-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-analysis-preset-heading > span:first-child { display: grid; gap: 3px; }
.admin-analysis-preset-heading small { color: var(--muted); }
.admin-analysis-owner-toggle { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid rgba(11,93,75,.2); border-radius: 11px; background: var(--brand-soft); }
.admin-analysis-owner-toggle small { color: var(--muted); padding-left: 25px; }
.admin-analysis-summary-tags { margin-top: 10px; }
.admin-analysis-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 3px; }
.admin-column-order { display: grid; gap: 6px; margin: 14px 0; }
.admin-column-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fafcfb; }
.admin-column-row > span { display: flex; gap: 4px; }
.admin-column-row .icon-button { width: 32px; height: 32px; }
.admin-column-row:focus-within { border-color: rgba(11,93,75,.35); background: var(--brand-soft); }
.admin-launch-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.admin-launch-row > div { display: grid; gap: 5px; }
.admin-launch-row p { margin: 0; }
.admin-launch-row small { color: var(--muted); }
.operations-resources { margin: 14px 0; }
.operations-summary.warning { background: #fff7e4; }
.operations-summary.critical { color: #7b2828; background: #fff0f0; border-color: #f2c9c9; }
.operations-leases { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.operations-lease { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8faf9; }
.operations-lease small { color: var(--muted); overflow-wrap: anywhere; }

.pill { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: .68rem; font-weight: 700; }
.pill.warning { background: #fff4d9; }
.pill.danger { background: #ffeaea; }
.notice { padding: 13px 15px; border-radius: 11px; color: #5c5540; background: #fff7e4; font-size: .78rem; line-height: 1.5; }
.notice.info { color: #31534a; background: var(--brand-soft); }
.notice.danger { color: #7b2828; background: #fff0f0; border: 1px solid #f2c9c9; }
.notice.danger p { margin: 0 0 8px; }
.notice.danger p:last-child { margin-bottom: 0; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.button.compact { min-height: 32px; padding: 6px 10px; font-size: .75rem; }

.asset-dialog { width: min(1240px, calc(100vw - 30px)); height: min(94dvh, 980px); max-width: none; max-height: 94dvh; padding: 0; overflow: auto; border: 0; border-radius: 20px; box-shadow: 0 26px 80px rgba(6,38,29,.25); }
.compact-dialog { width: min(580px,calc(100vw - 28px)); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 26px 80px rgba(6,38,29,.25); }
.compact-dialog::backdrop { background: rgba(6,38,29,.42); backdrop-filter: blur(2px); }
.compact-dialog .data-card { margin: 0; box-shadow: none; }
.asset-dialog::backdrop { background: rgba(6,30,24,.45); backdrop-filter: blur(3px); }
.dialog-close { position: absolute; right: 12px; top: 12px; z-index: 2; background: #f1f5f3; }
.asset-dialog-content { padding: 28px; }
.table-link { appearance: none; border: 0; padding: 0; background: transparent; color: var(--brand); font: inherit; font-weight: 800; text-align: left; cursor: pointer; }
.table-link:hover { text-decoration: underline; }
.block-hint { display: block; margin-top: 3px; color: var(--muted); }
.study-configurations { display: grid; gap: 12px; margin-top: 16px; }
.study-configuration { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.study-configuration > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; cursor: pointer; font-weight: 800; }
.study-configuration > summary small { color: var(--muted); font-weight: 600; }
.study-configuration-body { padding: 0 18px 18px; border-top: 1px solid var(--line); }
.study-configuration-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin: 16px 0; }
.study-configuration-grid article { padding: 14px; border-radius: 12px; background: var(--brand-soft); }
.study-configuration-grid h4 { margin: 0 0 10px; }
.configuration-pairs { display: grid; gap: 7px; margin: 0; }
.configuration-pairs > div { display: grid; grid-template-columns: minmax(120px,.8fr) minmax(0,1.2fr); gap: 10px; }
.configuration-pairs dt { color: var(--muted); }
.configuration-pairs dd { margin: 0; overflow-wrap: anywhere; font-weight: 700; }
.configuration-pairs.nested { gap: 5px; padding: 8px 10px; border-left: 3px solid rgba(20,97,83,.22); border-radius: 8px; background: rgba(255,255,255,.55); }
.configuration-pairs.nested > div { grid-template-columns: minmax(105px,.9fr) minmax(0,1.1fr); }
.configuration-pairs.nested dt { font-size: .84rem; }
.configuration-pairs.nested dd { font-size: .86rem; }
.configuration-list { margin: 0; padding-left: 18px; }
.configuration-text { margin: 0; color: var(--muted); line-height: 1.6; }
.asset-dialog-header { position: sticky; top: 0; z-index: 1; margin: -28px -28px 18px; padding: 25px 65px 16px 28px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
.asset-dialog-header .asset-subtitle { margin-bottom: 0; }
.asset-summary { margin-bottom: 16px; }
.asset-detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.asset-detail-grid > .data-card { box-shadow: none; }
.detail-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 18px; }
.detail-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 2px; border-bottom: 1px solid #edf1ef; }
.detail-list span { color: var(--muted); font-size: .75rem; }
.detail-list span small { display: block; margin-top: 3px; color: var(--muted); font-size: .64rem; line-height: 1.35; }
.detail-list strong { font-size: .78rem; }
.metric-grid.mini { grid-template-columns: repeat(2,minmax(0,1fr)); margin-bottom: 14px; }
.formula-note { display: block; margin-top: 12px; color: var(--muted); line-height: 1.45; }
.empty-state.compact { padding: 20px 12px; }
.backtest-form { grid-template-columns: repeat(3,minmax(0,1fr)); }
.valuation-choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 16px; margin: 8px 0 12px; }
.valuation-choice-grid .check { min-height: 34px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.valuation-choice-grid .check > span { display: grid; gap: 3px; }
.valuation-choice-grid .check small { color: var(--muted); font-size: .64rem; line-height: 1.35; }
.valuation-choice-grid .check.unavailable { opacity: .5; background: #f4f6f5; }
.valuation-controls { margin: 4px 0 10px; }
#economic-assumptions { padding: 10px 0; }
#economic-assumptions .notice { margin: 10px 0; }
.valuation-base-value { display: block; font-weight: 750; }
.valuation-mini-scenarios { display: block; min-width: 220px; margin-top: 4px; color: var(--muted); font-size: .64rem; line-height: 1.45; white-space: normal; }
.valuation-method-list { display: grid; gap: 10px; }
.valuation-method-card { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.valuation-method-card > div:first-child { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.valuation-method-card p { margin: 9px 0; color: var(--muted); }
.strategy-parameters { display: grid; gap: 10px; }
.strategy-parameter-card { box-shadow: none; }
.strategy-parameter-card > summary { cursor: pointer; }
.staging-banner { position: fixed; z-index: 100; inset: 0 0 auto; height: 32px; display: grid; place-items: center; color: #493509; background: #f5c861; font-size: .73rem; font-weight: 800; letter-spacing: .035em; }
body.staging-mode .sidebar { top: 32px; }
body.staging-mode .topbar { top: 32px; }
body.staging-mode .workspace { padding-top: 32px; }
body.staging-mode .login-view { padding-top: 60px; }
.asset-title { margin: 0 45px 2px 0; font-size: 1.7rem; }
.asset-subtitle { color: var(--muted); margin: 0 0 20px; }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 80; display: grid; gap: 8px; width: min(380px, calc(100vw - 30px)); }
.toast { padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); font-size: .82rem; animation: toast-in .2s ease; }
.toast.error { border-left: 4px solid var(--danger); }
.toast.success { border-left: 4px solid var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1050px) {
  .metric-grid, .loading-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .panel-grid.three { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .topbar-home-link { width: 38px; padding: 0; }
  .topbar-home-label { display: none; }
  .profile-copy, .ghost-button { display: none; }
  .series-picker { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .series-picker .check:nth-child(4n) { border-right: 1px solid var(--line); }
  .series-picker .check:nth-child(3n) { border-right: 0; }
  .alerts-workspace { grid-template-columns: 1fr; }
  .permission-matrix { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .admin-update-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-analysis-preset-heading,.admin-analysis-type-picker { align-items: stretch; flex-direction: column; }
  .admin-analysis-actions { flex-direction: column-reverse; }
  .admin-analysis-actions .button { width: 100%; }
  .admin-workspace { grid-template-columns: 1fr; }
  .admin-section-nav { position: static; grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  :root { --sidebar: 0px; }
  .sidebar { width: 252px; transform: translateX(-102%); box-shadow: var(--shadow); }
  body.mobile-nav-open .sidebar { transform: translateX(0); }
  .collapse-button { display: none; }
  .mobile-menu { display: grid; }
  .topbar { padding: 10px 13px; gap: 8px; }
  kbd, .notification-button { display: none; }
  .global-search-wrap input { padding-right: 14px; font-size: .84rem; }
  .main-content { padding: 22px 14px 48px; }
  .page-heading { display: block; }
  .heading-actions { margin-top: 13px; }
  .metric-grid, .loading-grid, .panel-grid, .panel-grid.three, .global-market-layout, .filter-columns, .asset-detail-grid, .backtest-form, .guide-grid, .score-profile-grid, .custom-filter-controls, .study-configuration-grid { grid-template-columns: 1fr; }
  .global-market-stack { grid-template-rows: auto; }
  .series-picker { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .series-picker .check:nth-child(3n) { border-right: 1px solid var(--line); }
  .series-picker .check:nth-child(2n) { border-right: 0; }
  .study-configuration > summary { align-items: flex-start; flex-direction: column; }
  .comparison-date-range { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .custom-filter-controls small { grid-column: auto; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .valuation-choice-grid { grid-template-columns: 1fr; }
  .recommendation-controls { align-items: stretch; flex-direction: column; }
  .recommendation-controls > .button { width: 100%; }
  .access-level-meta,.access-limit-grid,.admin-user-filters { grid-template-columns: 1fr; }
  .operations-leases { grid-template-columns: 1fr; }
  .permission-matrix { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .bulk-access-bar,.admin-monitor-row,.admin-launch-row { align-items: stretch; flex-direction: column; }
  .bulk-access-bar select,.bulk-access-bar .button,.admin-monitor-row .button,.admin-launch-row .button { width: 100%; }
  .login-card { padding: 36px 24px; }
  .email-login-row { grid-template-columns: 1fr; }
  .admin-section-nav { grid-template-columns: 1fr; }
  .table-toolbar { align-items: flex-start; flex-direction: column; }
  .table-toolbar-main,.table-density { width: 100%; }
  .tab,.button,.nav-item { min-height: 44px; }
}

@media (max-width: 450px) {
  .metric-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr; }
  .headline { grid-template-columns: 35px 1fr; }
  .headline > small { display: none; }
  .detail-list, .column-picker[open] > div { grid-template-columns: 1fr; }
  .series-picker { grid-template-columns: 1fr; }
  .series-picker .check:nth-child(n) { border-right: 0; }
  .comparison-date-range { grid-template-columns: 1fr; }
  .permission-matrix,.admin-update-actions { grid-template-columns: 1fr; }
}

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

@media(max-width:720px){.update-summary{align-items:flex-start;flex-direction:column}.update-summary>span:last-child{width:100%;justify-content:space-between}.update-detail-row{grid-template-columns:1fr}.update-detail-row>span:last-child{text-align:left}}
/* Página inicial e biblioteca editáveis */
.portal-admin-sections { display: grid; gap: 14px; }
.portal-admin-sections > .data-card { margin: 0; }
.portal-edit-grid { margin-top: 16px; }
.portal-purpose-item, .portal-sales-fieldset { border: 1px solid var(--line); border-radius: 14px; display: grid; gap: 12px; grid-template-columns: minmax(100px,.35fr) minmax(180px,1fr); padding: 14px; }
.portal-purpose-item legend, .portal-sales-fieldset legend { color: var(--muted); font-size: .78rem; font-weight: 800; padding: 0 8px; text-transform: uppercase; }
.portal-sticky-action { align-items: center; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 14px; bottom: 12px; box-shadow: var(--shadow); display: flex; gap: 18px; justify-content: space-between; padding: 12px 16px; position: sticky; z-index: 5; }
.portal-sticky-action span { color: var(--muted); font-size: .82rem; }
.portal-book-list { display: grid; gap: 12px; }
.portal-book-card summary { align-items: center; }
.portal-book-thumb { border-radius: 6px; height: 60px; object-fit: cover; width: 42px; }
.portal-book-form { padding-top: 18px; }
.portal-book-published { align-self: end; min-height: 44px; }
.portal-sales-row { display: grid; gap: 12px; grid-template-columns: minmax(180px,.7fr) minmax(260px,1.3fr); }
.portal-book-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.tag-list span { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 999px; font-size: .78rem; padding: 5px 9px; }
@media (max-width: 760px) { .portal-purpose-item, .portal-sales-row { grid-template-columns: 1fr; } .portal-sticky-action { align-items: stretch; flex-direction: column; } }
