.portal-body { min-height: 100vh; background: #f4f7f4; }
.portal-shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.portal-sidebar { padding: 25px 20px; border-right: 1px solid var(--line); background: rgba(255,255,255,.82); }
.portal-sidebar .brand { margin-bottom: 34px; }
.portal-nav { display: grid; gap: 7px; }
.portal-nav a { padding: 11px 13px; border-radius: 10px; color: var(--muted); font-size: 12px; font-weight: 750; text-decoration: none; }
.portal-nav a.active, .portal-nav a:hover { color: var(--accent-dark); background: var(--accent-soft); }
.portal-sidebar-note { margin-top: 28px; padding: 14px; border-radius: 12px; color: var(--muted); background: #f2f6f3; font-size: 10px; line-height: 1.6; }
.portal-main { min-width: 0; }
.portal-header { height: 82px; padding: 0 34px; display: flex; align-items: center; justify-content: flex-end; gap: 13px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.6); }
.account-menu-wrap { position: relative; }
.account-menu-button { padding: 6px 10px 6px 7px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: white; font-size: 11px; font-weight: 800; }
.demo-avatar { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--accent); }
.account-dropdown { position: absolute; z-index: 20; top: calc(100% + 9px); right: 0; width: 210px; padding: 8px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: 0 18px 50px rgba(20,45,35,.18); }
.account-dropdown[hidden] { display: none; }
.account-dropdown strong, .account-dropdown small { padding: 5px 8px; display: block; }
.account-dropdown small { color: var(--muted); }
.account-dropdown hr { border: 0; border-top: 1px solid var(--line); }
.account-dropdown a, .account-dropdown button { width: 100%; padding: 9px 8px; display: block; border: 0; border-radius: 8px; color: var(--muted); background: none; font-size: 11px; font-weight: 700; text-align: left; text-decoration: none; }
.account-dropdown a:hover, .account-dropdown button:hover { color: var(--accent); background: var(--accent-soft); }
.portal-content { width: min(1040px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 80px; }
.portal-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.portal-title-row span { color: var(--accent); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.portal-title-row h1 { margin: 7px 0 0; font-size: clamp(31px, 5vw, 48px); }
.portal-title-row .primary-button { width: auto; text-decoration: none; }
.portal-stats { margin-top: 30px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.portal-stat { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.portal-stat small { color: var(--muted); font-size: 10px; font-weight: 700; }
.portal-stat strong { margin-top: 9px; display: block; font-family: "Manrope"; font-size: 27px; }
.models-card { margin-top: 20px; padding: 28px; border: 1px solid var(--line); border-radius: 19px; background: white; }
.models-card-header { display: flex; align-items: center; justify-content: space-between; }
.models-card-header h2 { margin: 0; font-family: "Manrope"; font-size: 18px; }
.demo-label { padding: 5px 8px; border-radius: 999px; color: #8a5b2c; background: #fff0df; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.models-empty { min-height: 330px; display: grid; place-items: center; text-align: center; }
.models-empty[hidden], .models-list[hidden] { display: none; }
.models-empty > div { width: min(410px, 100%); }
.empty-icon { width: 62px; height: 62px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 18px; color: var(--accent); background: var(--accent-soft); font-size: 24px; }
.models-empty h3 { margin: 0 0 9px; font-family: "Manrope"; font-size: 20px; }
.models-empty p { margin: 0 auto 20px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.models-empty .primary-button { width: auto; display: inline-flex; text-decoration: none; }
.models-list { display: grid; gap: 10px; }
.model-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; }
.model-row strong { display: block; font-size: 13px; }
.model-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.model-row-custom code { padding: 1px 5px; border-radius: 4px; color: var(--accent-dark); background: var(--accent-soft); font-size: 10px; }
.model-row-actions { display: flex; flex-shrink: 0; gap: 8px; }
.model-row-actions button { padding: 0 14px; min-height: 34px; border-radius: 9px; font-size: 10px; font-weight: 800; cursor: pointer; }
.model-redownload { border: 0; color: white; background: var(--accent); }
.model-redownload:hover { background: var(--accent-dark); }
.model-redownload:disabled { opacity: .6; cursor: wait; }
.model-delete { border: 1px solid var(--line); color: #b23b3b; background: white; }
.model-delete:hover { background: #fdf1f1; }
.legal-shell { width: min(820px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 80px; }
.legal-header { display: flex; align-items: center; justify-content: space-between; }
.legal-card { margin-top: 48px; padding: clamp(26px, 6vw, 60px); border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: var(--shadow); }
.legal-card > span { color: var(--accent); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.legal-card h1 { margin: 10px 0 14px; font-size: clamp(34px, 6vw, 55px); }
.legal-card h2 { margin: 34px 0 9px; font-family: "Manrope"; font-size: 19px; }
.legal-card p, .legal-card li { color: var(--muted); font-size: 13px; line-height: 1.75; }
.status-page { min-height: 100vh; padding: 30px; display: grid; place-items: center; text-align: center; }
.status-card { width: min(560px, 100%); padding: 50px 35px; border: 1px solid var(--line); border-radius: 25px; background: white; box-shadow: var(--shadow); }
.status-code { color: var(--accent); font-family: "Manrope"; font-size: 70px; font-weight: 900; letter-spacing: -.08em; }
.status-card h1 { margin: 8px 0 12px; font-size: 31px; }
.status-card p { margin: 0 auto 24px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.status-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.status-actions a { text-decoration: none; }
html[data-theme="dark"] .portal-body { background: #111b16; }
html[data-theme="dark"] .portal-sidebar, html[data-theme="dark"] .portal-header, html[data-theme="dark"] .portal-stat, html[data-theme="dark"] .models-card, html[data-theme="dark"] .account-dropdown, html[data-theme="dark"] .legal-card, html[data-theme="dark"] .status-card { color: var(--ink); background: #1a2821; }
html[data-theme="dark"] .portal-sidebar-note { background: #213129; }
@media (max-width: 760px) {
  .portal-shell { grid-template-columns: 1fr; }
  .portal-sidebar { padding: 17px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .portal-sidebar .brand { margin-bottom: 14px; }
  .portal-nav { display: flex; overflow-x: auto; }
  .portal-sidebar-note { display: none; }
  .portal-header { height: 64px; padding-inline: 20px; }
  .portal-content { width: min(100% - 32px, 1040px); padding-top: 32px; }
  .portal-title-row { align-items: stretch; flex-direction: column; }
  .portal-stats { grid-template-columns: 1fr; }
  .models-card { padding: 20px; }
}
