/* VIRE Portal - Component Library
 * Font: IBM Plex Mono
 * Colors: #000, #fff, #888 only
 * No border-radius, no box-shadow
 */

[x-cloak] {
    display: none !important;
}

/* === RESET === */

* {
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    background: #fff;
    color: #000;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    font-size: 0.875rem;
}

::selection {
    background: #000;
    color: #fff;
}

:focus-visible {
    outline: 3px solid #000;
    outline-offset: 2px;
}

a {
    color: #000;
    text-decoration: underline;
}

a:hover {
    color: #888;
}


/* ============================================================
   LAYOUT
   ============================================================ */

.page {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.page-body {
    flex: 1;
    width: 100%;
    /* Viewport-proportional gutters: 20% per side (content = 60% of viewport).
       Steps to 30% on ultra-wide and flat 1.5rem on mobile below. sty_170a6a3a. */
    padding: 2rem 20%;
}

@media (min-width: 2560px) {
    .page-body { padding-left: 30%; padding-right: 30%; }
}

@media (max-width: 48rem) {
    .page-body { padding-left: 1.5rem; padding-right: 1.5rem; }
}

.page-body-fluid {
    flex: 1;
    width: 100%;
    padding: 2rem 1.5rem;
}

/* Sidebar + main layout */
.layout-sidebar {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2rem;
}

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

@media (max-width: 48rem) {
    .layout-sidebar { grid-template-columns: 1fr; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}


/* ============================================================
   NAVIGATION
   ============================================================ */

.nav {
    border-bottom: 2px solid #000;
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
}

.nav-inner {
    /* Match .page-body gutters so the nav bar aligns with page content. sty_170a6a3a. */
    padding: 0.75rem 20%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 2560px) {
    .nav-inner { padding-left: 30%; padding-right: 30%; }
}

@media (max-width: 48rem) {
    .nav-inner { padding-left: 1.5rem; padding-right: 1.5rem; }
}

.nav-brand {
    font-size: 1.125rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.1em;
}

/* Desktop links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: #000;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
    border-bottom-color: #000;
    color: #000;
}


/* Status indicators */
.status-indicators {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50% !important;
    font-size: 0.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    letter-spacing: 0;
    transition: background-color 0.3s ease;
}

.status-up { background-color: #2d8a4e; }
.status-stale { background-color: #d97706; }
.status-startup { background-color: #d97706; }
.status-down { background-color: #c53030; }

/* Hamburger wrapper (positions dropdown) */
.nav-hamburger-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Hamburger */
.nav-hamburger {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-hamburger-icon {
    display: block;
    width: 22px;
    height: 2px;
    background: #000;
    position: relative;
}

.nav-hamburger-icon::before,
.nav-hamburger-icon::after {
    content: '';
    display: block;
    width: 22px;
    height: 2px;
    background: #000;
    position: absolute;
    left: 0;
}

.nav-hamburger-icon::before { top: -6px; }
.nav-hamburger-icon::after  { top:  6px; }

@media (max-width: 48rem) {
    .nav-links { display: none; }
}

/* Desktop dropdown (hamburger menu) */
.nav-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 2px solid #000;
    min-width: 160px;
    z-index: 200;
}

.nav-dropdown a,
.nav-dropdown-logout {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: #000;
    border: none;
    border-bottom: 1px solid #888;
    background: none;
    cursor: pointer;
    text-align: left;
}

.nav-dropdown a:hover,
.nav-dropdown-logout:hover {
    background: #000;
    color: #fff;
}

.session-expiry-banner {
    background: #ff6b35;
    color: #000;
    text-align: center;
    padding: 0.3rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.session-expiry-link {
    color: #000;
    text-decoration: underline;
}

.nav-dropdown a.nav-admin-item,
.mobile-menu a.nav-admin-item {
    background: #fee2e2;
}

.nav-dropdown a.nav-admin-item:hover,
.mobile-menu a.nav-admin-item:hover {
    background: #7f1d1d;
}

.mobile-menu .nav-admin-item {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}


/* ============================================================
   MOBILE MENU
   ============================================================ */

.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 299;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100vh;
    background: #fff;
    border-left: 2px solid #000;
    z-index: 300;
    padding: 1.5rem;
}

.mobile-menu-close {
    display: block;
    background: none;
    border: none;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 1.25rem;
    cursor: pointer;
    margin-bottom: 1.5rem;
}

.mobile-menu a {
    display: block;
    padding: 0.6rem 0;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: #000;
    border-bottom: 1px solid #888;
}


/* ============================================================
   SIDEBAR NAV
   ============================================================ */

.sidebar-heading {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #888;
    padding: 0.5rem 0.75rem;
    margin-top: 0.75rem;
}

.sidebar-heading:first-child {
    margin-top: 0;
}

.sidebar-nav a {
    display: block;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    text-decoration: none;
    color: #000;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: #000;
    color: #fff;
}

.sidebar-nav a.active {
    border-left-color: #000;
    font-weight: 700;
}


/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.section-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
}

.label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #888;
    margin-bottom: 0.5rem;
}

.text-muted {
    color: #888;
}

.text-sm {
    font-size: 0.8125rem;
}

.text-bold {
    font-weight: 700;
}


/* ============================================================
   PANELS / SECTIONS
   ============================================================ */

/* Basic bordered panel */
.panel {
    border: 2px solid #000;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Panel with black header bar */
.panel-headed {
    border: 2px solid #000;
    margin-bottom: 1.5rem;
}

.panel-header {
    background: #000;
    color: #fff;
    padding: 0.5rem 1rem;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.panel-content {
    padding: 1.5rem;
}

/* Collapsible panel */
.panel-collapse {
    border: 2px solid #000;
    margin-bottom: 1.5rem;
}

.panel-collapse-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    text-align: left;
}

.panel-collapse-trigger:hover {
    background: #000;
    color: #fff;
}

.panel-collapse-body {
    padding: 0 1rem 1rem;
    border-top: 1px solid #888;
}


/* ============================================================
   TABS
   ============================================================ */

.tabs {
    display: flex;
    border-bottom: 2px solid #000;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.tab {
    padding: 0.5rem 1rem;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    color: #888;
    margin-bottom: -2px;
    white-space: nowrap;
}

.tab:hover {
    color: #000;
}

.tab.active {
    color: #000;
    border-bottom-color: #000;
}


/* ============================================================
   TABLE
   ============================================================ */

.table-wrap {
    overflow-x: auto;
}

.tool-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.tool-table th {
    text-align: left;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid #000;
}

.tool-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #000;
    vertical-align: top;
}

.tool-table .text-right {
    text-align: right;
}

.tool-table tr:hover td {
    background: #e5e5e5;
}

.tool-name {
    font-weight: 700;
    white-space: nowrap;
}

.tool-desc {
    max-width: 24rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tool-method {
    white-space: nowrap;
    color: #888;
}

.th-tooltip {
    position: relative;
    cursor: help;
}

.th-tooltip:hover::after {
    content: attr(data-field);
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 0.25rem;
    padding: 0.35rem 0.5rem;
    background: #000;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    white-space: nowrap;
    z-index: 10;
}

.th-tooltip:hover .th-tooltip-link {
    display: block;
    position: absolute;
    left: 0;
    top: calc(100% + 1.5rem);
    font-size: 0.625rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    z-index: 10;
}

.th-tooltip-link {
    display: none;
    color: #888;
    text-decoration: underline;
    padding: 0.25rem 0.5rem;
    background: #f5f5f5;
    border: 1px solid #000;
}

.th-tooltip-link:hover {
    color: #000;
}

.tool-path {
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
}


/* ============================================================
   FORMS
   ============================================================ */

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 0.35rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.8125rem;
    border: 2px solid #000;
    background: #fff;
    color: #000;
    outline: none;
}

.profile-tz-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}
.profile-tz-form .form-select {
    flex: 1;
}
.profile-tz-form .btn {
    flex-shrink: 0;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    background: #000;
    color: #fff;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Inline row */
.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}


/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    display: inline-block;
    border: 2px solid #000;
    padding: 0.5rem 1.25rem;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
}

.btn-primary {
    background: #000;
    color: #fff;
}

.btn-primary:hover {
    background: #fff;
    color: #000;
}

.btn-secondary {
    background: #fff;
    color: #000;
}

.btn-secondary:hover {
    background: #000;
    color: #fff;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
}


/* ============================================================
   BADGES
   ============================================================ */

.badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid #000;
}

.badge-filled {
    background: #000;
    color: #fff;
}

.badge-muted {
    border-color: #888;
    color: #888;
}

/* Pending settlement rows on the Cash page (sty_2d813773 §F).
   Italicises the row to signal "placeholder awaiting broker confirmation";
   the inline PENDING badge carries the glossary tooltip. */
.txn-row-pending td {
    font-style: italic;
    color: #555;
}

.txn-pending-badge {
    margin-left: 0.4rem;
    vertical-align: middle;
}


/* ============================================================
   CODE
   ============================================================ */

code {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.8125rem;
}

.code-block {
    border: 2px solid #000;
    padding: 1rem;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
    background: #fff;
}


/* ============================================================
   CONFIG GRID (existing)
   ============================================================ */

.config-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 48rem) {
    .config-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid #000;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

.config-label {
    font-weight: 700;
    letter-spacing: 0.05em;
}

.status-ok {
    font-weight: 700;
}

.status-missing {
    color: #888;
}


/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    padding: 0.6rem 1rem;
    font-size: 0.8125rem;
    border: 2px solid #000;
    background: #fff;
    color: #000;
    min-width: 220px;
    pointer-events: auto;
    animation: toast-in 0.2s ease;
}

.toast-dark {
    background: #000;
    color: #fff;
}

@keyframes toast-in {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}


/* ============================================================
   FOOTER
   ============================================================ */

.footer {
    border-top: 2px solid #000;
    padding: 1rem 1.5rem;
}

.footer-inner {
    max-width: 64rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-text {
    font-size: 0.75rem;
    color: #888;
    letter-spacing: 0.1em;
}

.footer a {
    color: #000;
    font-weight: 700;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}


/* ============================================================
   LANDING PAGE
   ============================================================ */

.landing {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.landing-inner {
    max-width: 42rem;
    width: 100%;
    text-align: center;
}

.landing-hero {
    margin-bottom: 3rem;
}

.landing-title {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
}

.landing-tagline {
    font-size: 1.125rem;
    color: #000;
}

.landing-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem;
}

.landing-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #666;
    font-size: 0.875rem;
}

.landing-divider::before,
.landing-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ddd;
}

.landing-login-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.landing-login-form input[type="text"],
.landing-login-form input[type="password"] {
    width: 100%;
    padding: 0.5rem 1.25rem;
    border: 2px solid #000;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    background: #fff;
}

.landing-login-form input[type="text"]:focus,
.landing-login-form input[type="password"]:focus {
    outline: none;
    border-color: #0066cc;
}

.landing-login-form input[type="text"]::placeholder,
.landing-login-form input[type="password"]::placeholder {
    color: #999;
}

.btn-login {
    background: #000;
    color: #fff;
    width: 100%;
}

.btn-login:hover {
    background: #333;
}

.landing-features {
    border-top: 2px solid #000;
    padding-top: 2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: left;
}

@media (min-width: 48rem) {
    .landing-features {
        grid-template-columns: repeat(3, 1fr);
    }
}

.feature-card {
    border: 2px solid #000;
    padding: 1rem;
    font-size: 0.875rem;
}

.feature-label {
    font-weight: 700;
    margin-bottom: 0.5rem;
}


/* ============================================================
   PORTFOLIO DASHBOARD
   ============================================================ */

.portfolio-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.portfolio-select {
    flex: 1;
    max-width: 20rem;
}

.portfolio-default-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    white-space: nowrap;
}

.portfolio-editor {
    min-height: 200px;
    max-height: 600px;
    resize: vertical;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    white-space: pre-wrap;
    width: 100%;
}

.text-right {
    text-align: right;
}

.gain-positive { color: #2d8a4e; }
.gain-negative { color: #a33; }

.watchlist-verdict { font-weight: 600; text-transform: uppercase; font-size: 0.85em; }
.verdict-pass { color: #2d8a4e; }
.verdict-watch { color: #b58a1b; }
.verdict-fail { color: #a33; }

/* Compliance widget */
.compliance-widget {
    margin-bottom: 1.5rem;
    border: 2px solid #000;
}

.compliance-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.compliance-state-clean {
    background: #2d8a4e;
    color: #fff;
}

.compliance-state-issues {
    background: #a33;
    color: #fff;
}

.compliance-state-dirty {
    background: #b58a1b;
    color: #fff;
}

.compliance-state-never {
    background: #888;
    color: #fff;
}

.compliance-status {
    flex: 1;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

.compliance-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-compliance-run,
.btn-compliance-toggle {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
    padding: 0.2rem 0.6rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    text-transform: uppercase;
}

.btn-compliance-run:hover,
.btn-compliance-toggle:hover {
    background: rgba(255,255,255,0.3);
}

.btn-compliance-run:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.compliance-findings {
    padding: 0.75rem 1rem;
    border-top: 1px solid #ddd;
}

.compliance-finding {
    padding: 0.4rem 0;
    font-size: 0.8125rem;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
}

.compliance-finding:last-of-type {
    border-bottom: none;
}

.compliance-severity {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.4rem;
    border-radius: 2px;
    flex-shrink: 0;
}

.compliance-BREACH .compliance-severity,
.compliance-breach .compliance-severity {
    background: #a33;
    color: #fff;
}

.compliance-WARNING .compliance-severity,
.compliance-warning .compliance-severity {
    background: #b58a1b;
    color: #fff;
}

.compliance-INFO .compliance-severity,
.compliance-info .compliance-severity {
    background: #888;
    color: #fff;
}

.compliance-bug { border-left-color: #d97706; }
.compliance-bug .compliance-severity { color: #d97706; }
.compliance-bug-indicator { margin-top: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.compliance-bug-title { font-weight: 700; font-size: 0.75rem; letter-spacing: 0.05em; margin-bottom: 0.5rem; color: #d97706; }
.compliance-bug-section { margin-top: 0.5rem; }

.compliance-ticker {
    font-weight: 700;
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.compliance-message {
    color: #333;
}

.compliance-disclaimer {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
    font-size: 0.6875rem;
    color: #888;
    font-style: italic;
}

.portfolio-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #888;
}

/* sty_30f253e3 wrapper: holds the tile grid plus a row-level "* values in AUD"
   footnote anchored to the trailing horizontal rule. */
.portfolio-summary-row {
    width: 100%;
    margin-bottom: 1rem;
    border-bottom: 2px solid #000;
    padding-bottom: 0.25rem;
}

.portfolio-summary-row .portfolio-summary {
    border-bottom: none;
    margin-bottom: 0;
}

.portfolio-summary-footnote {
    width: 100%;
    text-align: right;
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    padding-bottom: 0.25rem;
}

.portfolio-summary {
    /* Row 1 (4 tiles) and Row 2 (5 tiles) both stay on a single row at any
       viewport width — titles wrap inside the tile if the label is too long.
       1fr columns keep every tile equal-width; the row never spills. */
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 16px;
    width: 100%;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-bottom: 2px solid #000;
}

.portfolio-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: left;
    min-width: 0; /* allow grid item to shrink below content width — prevents overflow */
}

.portfolio-summary-item:last-child {
    text-align: right;
}

.portfolio-summary-item .label {
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    color: #888;
    /* sty_3ec37b1c: allow long labels (e.g. "UNREALIZED EQUITY RETURN (AUD)") to
       wrap to a second line within the tile rather than overflow the cell. */
    white-space: normal;
}

.portfolio-changes {
    display: flex;
    gap: 0.75rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.change-up { color: #2d8a4e; }
.change-down { color: #b54747; }
.change-neutral { color: #888; }

.portfolio-change-today {
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.portfolio-dividend-forecast {
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    margin-top: 0.15rem;
}

.label-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    font-size: 0.5625rem;
    font-weight: 700;
    font-style: italic;
    border: 1px solid #888;
    color: #888;
    cursor: help;
    position: relative;
    vertical-align: middle;
    margin-left: 0.25rem;
}

.label-info:hover {
    border-color: #000;
    color: #000;
}

.label-info[data-tooltip]:not([data-tooltip=""]):hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 0.25rem;
    padding: 0.35rem 0.5rem;
    background: #000;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 400;
    font-style: normal;
    letter-spacing: 0.02em;
    white-space: normal;
    max-width: 20rem;
    z-index: 10;
    line-height: 1.4;
}

.portfolio-synced {
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    text-align: right;
}

.breadth-bar-section {
    margin-bottom: 1.5rem;
    border: 2px solid #000;
    padding: 1rem;
}

.breadth-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
}

.breadth-trend {
    font-weight: 700;
    letter-spacing: 0.05em;
}

.breadth-bar {
    display: flex;
    height: 1rem;
    width: 100%;
    margin-bottom: 0.5rem;
    border: 1px solid #000;
}

.breadth-segment {
    height: 100%;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.breadth-segment.breadth-rising { background: #5a9e6f; }
.breadth-segment.breadth-flat { background: #aaa; }
.breadth-segment.breadth-falling { background: #c06060; }

.breadth-segment.trend-uptrend { background: #5a9e6f; }
.breadth-segment.trend-consolidating { background: #aaa; }
.breadth-segment.trend-downtrend { background: #c06060; }

.breadth-bar-label {
    font-weight: 700;
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    color: #888;
}

.breadth-counts {
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #888;
}

.breadth-summary-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

.breadth-sync {
    font-size: 0.6875rem;
}

.holding-movement-row td {
    padding-top: 0.25rem;
    padding-bottom: 0.5rem;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #000;
}

.holding-detail-label {
    font-weight: 700;
    color: #888;
    margin-right: 0.25rem;
}

.holding-detail-sep {
    display: inline-block;
    width: 1.5rem;
}

.holding-breadth-arrow { font-size: 0.75rem; margin-right: 0.25rem; }
.holding-breadth-arrow.breadth-rising { color: #5a9e6f; }
.holding-breadth-arrow.breadth-flat { color: #aaa; }
.holding-breadth-arrow.breadth-falling { color: #c06060; }

.holdings-total-row td {
    border-top: 2px solid #000;
    padding-top: 0.5rem;
    font-weight: 700;
}

.portfolio-summary-equity {
    border-bottom: 1px solid #888;
}

.portfolio-summary-performance {
    border-bottom: 1px solid #888;
}

.portfolio-summary-cash {
    border-bottom: 1px solid #888;
}

.portfolio-summary-accounts {
    border-bottom: 1px solid #888;
}

.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 1rem 0; font-size: 0.75rem; letter-spacing: 0.1em; }
.pagination-info { color: #888; }

.portfolio-filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    cursor: pointer;
    margin-bottom: 1rem;
}

.growth-chart-section {
    margin-bottom: 1.5rem;
    border: 2px solid #000;
    padding: 1rem;
}

.growth-chart-scroll {
    width: 100%;
    overflow-x: auto;
    height: 220px;
}

.growth-chart-canvas-sizer {
    height: 100%;
    min-width: 100%;
}

@media (max-width: 48rem) {
    .growth-chart-scroll {
        height: 180px;
    }
}

.growth-chart-controls {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.chart-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
    color: #888;
}

.growth-chart-ghost {
    width: 100%;
    margin-bottom: 1.5rem;
    border: 2px dashed #ccc;
    padding: 1rem;
    aspect-ratio: 3 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 48rem) {
    .growth-chart-ghost {
        aspect-ratio: 2 / 1;
    }
}


/* ============================================================
   WARNING / SUCCESS BANNERS
   ============================================================ */

.warning-banner {
    border: 2px solid #a33;
    padding: 1rem 1.5rem;
    color: #a33;
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

.warning-banner a {
    color: #a33;
    font-weight: 700;
}

.success-banner {
    border: 2px solid #000;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    font-weight: 700;
}

/* Info banner */
.info-banner {
    border: 2px solid #555;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    color: #555;
}

/* Strategy rendered markdown */
.strategy-rendered {
    line-height: 1.6;
    color: #222;
}
.strategy-rendered h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 1.5rem 0 0.5rem;
    color: #000;
    border-bottom: 1px solid #ccc;
    padding-bottom: 0.25rem;
}
.strategy-rendered h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 1.25rem 0 0.4rem;
    color: #000;
}
.strategy-rendered p {
    margin: 0.5rem 0;
}
.strategy-rendered ul, .strategy-rendered ol {
    margin: 0.5rem 0 0.5rem 1.5rem;
}
.strategy-rendered li {
    margin: 0.25rem 0;
}
.strategy-rendered strong {
    color: #000;
}
.strategy-rendered pre {
    background: #f5f5f5;
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.8rem;
}
.strategy-rendered code {
    background: #eee;
    padding: 0.1rem 0.3rem;
    font-size: 0.85em;
}

/* Plan table */
.plan-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.plan-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid #ccc;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #888;
}
.plan-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
}
.plan-completed {
    opacity: 0.5;
}
.plan-status {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
}
.plan-status-completed { color: #2d8a4e; }
.plan-status-pending { color: #d97706; }
.plan-action {
    font-size: 0.75rem;
    font-weight: 700;
}
.plan-action-buy { color: #2d8a4e; }
.plan-action-sell { color: #c53030; }
.plan-action-watch { color: #d97706; }
/* Plan notes sub-row */
.plan-notes-row td {
    padding-top: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ddd;
}
.plan-notes-cell {
    font-size: 0.8rem;
    color: #555;
    font-style: italic;
}


/* ============================================================
   SETTINGS
   ============================================================ */

.dashboard-section {
    border: 2px solid #000;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-field {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid #eee;
}

.dashboard-field:last-of-type {
    border-bottom: none;
}

.dashboard-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #888;
    min-width: 8rem;
    flex-shrink: 0;
}

.profile-key-status {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.profile-key-missing {
    color: #888;
}


/* ============================================================
   UTILITIES
   ============================================================ */

/* ============================================================
   HELP PAGE
   ============================================================ */

.help-support-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.help-support-contact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.help-feedback-form {
    margin-top: 0.5rem;
}

.feedback-id {
    cursor: pointer;
    font-size: 0.75rem;
    color: #888;
    border-bottom: 1px dashed #888;
}
.feedback-id:hover {
    color: #000;
    border-bottom-color: #000;
}

.help-search-wrap {
    margin-bottom: 1rem;
}

.help-search {
    font-size: 0.875rem;
}

.help-loading {
    padding: 1.5rem;
    text-align: center;
    color: #888;
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
}

.help-glossary-category {
    margin-bottom: 1.5rem;
}

.help-glossary-category:last-child {
    margin-bottom: 0;
}

.help-glossary-category-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #888;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #000;
    margin-bottom: 0.5rem;
}

.help-term {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.help-term:last-child {
    border-bottom: none;
}

.help-term-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.15rem;
}

.help-term-label {
    font-weight: 700;
    font-size: 0.8125rem;
}

.help-term-id {
    font-size: 0.6875rem;
    color: #888;
    letter-spacing: 0.05em;
}

.help-term-def {
    font-size: 0.8125rem;
    color: #000;
    line-height: 1.5;
}

.help-term-formula {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.15rem;
}

.help-term-formula-label {
    font-weight: 700;
}


/* === CHANGELOG === */

.changelog-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.changelog-heading {
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.changelog-body {
    white-space: pre-wrap;
    font-size: 0.8125rem;
    line-height: 1.7;
    color: #000;
}


/* ============================================================
   LANDING CONTACT
   ============================================================ */

.landing-contact {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.8125rem;
}

.landing-contact-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #888;
    margin-right: 0.75rem;
}


/* ============================================================
   UTILITIES
   ============================================================ */

/* ============================================================
   MOBILE DASHBOARD
   ============================================================ */

.mobile-dashboard {
    max-width: 100%;
    padding: 1rem;
}

.mobile-portfolio-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.mobile-portfolio-select {
    flex: 1;
}

.mobile-synced {
    font-size: 1rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    text-align: right;
}

.mobile-value-section {
    border: 2px solid #000;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.mobile-value-amount {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.mobile-changes-row {
    display: flex;
    gap: 1rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

.mobile-performance-row {
    display: flex;
    justify-content: space-between;
    border: 2px solid #000;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.mobile-perf-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mobile-today-change {
    font-size: 1rem;
    letter-spacing: 0.05em;
}

.mobile-chart-section {
    border: 2px solid #000;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.mobile-chart-container {
    height: 160px;
    width: 100%;
    overflow-x: auto;
}

.mobile-breadth-section {
    border: 2px solid #000;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.mobile-breadth-section .breadth-bar {
    height: 1.25rem;
}

.mobile-breadth-section .breadth-segment-label {
    line-height: 1.25rem;
    font-size: 0.5625rem;
}

.mobile-holdings-section {
    border: 2px solid #000;
    margin-bottom: 0.75rem;
}

a.mobile-holding-card {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

a.mobile-holding-card:hover {
    background: #f5f5f5;
}

.mobile-holding-card {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-holding-card:last-child {
    border-bottom: none;
}

.mobile-holding-left {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.mobile-holding-ticker {
    font-weight: 700;
    font-size: 1.125rem;
}

.mobile-holding-name {
    font-size: 1rem;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-holding-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
}

.mobile-holding-right .text-bold {
    font-size: 1.125rem;
}

.mobile-holding-detail {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

.mobile-holding-value {
    display: flex;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.mobile-holding-total {
    border-top: 2px solid #000;
    font-weight: 700;
}

.mobile-dashboard .label {
    font-size: 1rem;
}

.mobile-perf-item .text-bold {
    font-size: 1.25rem;
}

.mobile-holding-1d {
    font-size: 1rem;
}

.mobile-full-link {
    text-align: center;
    padding: 1rem;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.1em;
}

.mobile-full-link a {
    text-decoration: none;
    color: #000;
}

.mobile-full-link a:hover {
    text-decoration: underline;
}


/* ============================================================
   UTILITIES
   ============================================================ */

.mt  { margin-top: 1.5rem; }
.mb  { margin-bottom: 1.5rem; }
.mt0 { margin-top: 0; }
.mb0 { margin-bottom: 0; }
.flex { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.hidden { display: none; }

/* Prompt edit page */
.prompt-textarea {
    width: 100%;
    min-height: 400px;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 1rem;
    border: 1px solid #ddd;
    background: #fafafa;
    color: #333;
    resize: vertical;
    margin: 1rem 0;
}

.prompt-meta {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.prompt-meta div {
    margin-bottom: 0.25rem;
}

.prompt-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}


.prompt-success { color: #2e7d32; }
.prompt-error { color: #c62828; }


/* ============================================================
   STOCK DETAIL PAGE
   ============================================================ */

.stock-back-link {
    margin-bottom: 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.stock-back-link a {
    text-decoration: none;
    color: #000;
}

.stock-back-link a:hover {
    text-decoration: underline;
}

.stock-ticker-heading {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
}

.stock-detail-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
}

.stock-detail-grid .stock-detail-field {
    min-width: 8rem;
}

.stock-detail-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stock-company-inline {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

.stock-placeholder {
    opacity: 0.5;
}


.filing-row {
    cursor: pointer;
}

.filing-row:hover {
    text-decoration: underline;
}

.filing-key-facts {
    padding: 0.5rem 0 0.25rem 1rem;
    font-size: 0.8125rem;
    color: #555;
}

.filing-key-facts ul {
    margin: 0;
    padding-left: 1rem;
}

.filing-key-facts li {
    margin-bottom: 0.25rem;
}

.filing-price-sensitive {
    font-size: 0.625rem;
}

.sentiment-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid #000;
}

.sentiment-positive { background: #2d8a4e; color: #fff; border-color: #2d8a4e; }
.sentiment-negative { background: #a33; color: #fff; border-color: #a33; }
.sentiment-neutral { background: #888; color: #fff; border-color: #888; }

.credibility-badge {
    display: inline-block;
    padding: 0.05rem 0.3rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid #888;
    margin-left: 0.5rem;
}

.credibility-high { border-color: #2d8a4e; color: #2d8a4e; }
.credibility-medium { border-color: #888; color: #888; }
.credibility-low { border-color: #a33; color: #a33; }

/* Walk chart */
.walk-chart-scroll { overflow-x: auto; }
.walk-chart-sizer { min-width: 600px; height: 300px; position: relative; }

/* Trade summary bar */
.trade-summary {
    display: flex;
    gap: 2rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

/* Trade type badges */
.trade-type-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
}
.trade-buy { background: #dcfce7; color: #166534; }
.trade-sell { background: #fee2e2; color: #991b1b; }

/* Gain breakdown */
.gain-breakdown {
    font-size: 0.8rem;
    color: #888;
}

.company-event {
    display: flex;
    gap: 0.75rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid #eee;
}

.company-event:last-child {
    border-bottom: none;
}

