/* тХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХР
   PRO MODE (Terminal / Bloomberg-density)
   тХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХР */

/* In Pro mode: hide teaser, expand charts to full width */
body[data-mode="pro"] .bento-box {
    grid-template-columns: 1fr;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

body[data-mode="pro"] .bento-box__teaser {
    display: none;
}

/* Pro mode: widen main container */
body[data-mode="pro"] .main {
    max-width: 1600px;
    padding: 1rem 1rem 6rem; /* extra bottom padding for slider */
}

/* Pro mode: toolbar */
.pro-chart-grid-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.pro-toolbar__group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.pro-toolbar__btn {
    padding: 0.35rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.2;
}

.pro-toolbar__btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
}

.pro-toolbar__btn--active {
    background: rgba(245, 189, 65, 0.12);
    color: var(--accent);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Pro mode: multi-chart grid (up to 6 charts) */
body[data-mode="pro"] .pro-chart-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

body[data-mode="pro"] .pro-chart-grid.pro-chart-grid--cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Larger charts in 2-column mode (explicit toggle or responsive) */
.pro-chart-grid--cols-2 .pro-chart-slot,
.pro-chart-grid--cols-responsive .pro-chart-slot {
    padding: 0.75rem;
}

.pro-chart-grid--cols-2 .pro-chart-slot__label,
.pro-chart-grid--cols-responsive .pro-chart-slot__label {
    font-size: 0.78rem;
    margin-bottom: 0.5rem;
}

.pro-chart-grid--cols-2 .si-grid,
.pro-chart-grid--cols-responsive .si-grid {
    min-height: 400px;
}

.pro-chart-grid--cols-2 .si-planet,
.pro-chart-grid--cols-responsive .si-planet {
    font-size: 0.85rem;
}

.pro-chart-grid--cols-2 .si-cell__sign,
.pro-chart-grid--cols-responsive .si-cell__sign {
    font-size: 0.72rem;
    opacity: 0.85;
}

.pro-chart-grid--cols-2 .si-cell__house,
.pro-chart-grid--cols-responsive .si-cell__house {
    font-size: 0.72rem;
    opacity: 0.75;
    font-weight: 600;
    color: var(--text-secondary);
}

.pro-chart-grid--cols-2 .si-cell__glyph,
.pro-chart-grid--cols-responsive .si-cell__glyph {
    font-size: 1.1rem;
}

@media (max-width: 1200px) {
    body[data-mode="pro"] .pro-chart-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    body[data-mode="pro"] .pro-chart-grid,
    body[data-mode="pro"] .pro-chart-grid.pro-chart-grid--cols-2 {
        grid-template-columns: 1fr;
    }
}

body[data-mode="pro"] .pro-chart-grid .si-chart,
body[data-mode="pro"] .pro-chart-grid .ni-chart {
    width: 100%;
}

/* Hide duplicate titles in Pro grid (slot label is enough) */
.pro-chart-slot .si-chart__title,
.pro-chart-slot .ni-chart__title,
.pro-chart-slot .varga-table-header {
    display: none !important;
}

/* Pro mode: compact analysis tabs */
body[data-mode="pro"] .section__title {
    font-size: 0.72rem;
    margin-bottom: 0.4rem;
    padding-bottom: 0.25rem;
}

/* Pro mode: denser tables */
body[data-mode="pro"] .table td,
body[data-mode="pro"] .table th {
    padding: 0.25rem 0.5rem;
    font-size: 0.72rem;
}

/* тФАтФА Time-Traveler Slider тФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФА */

.time-traveler {
    display: none;
}

.time-traveler:not([hidden]) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    background: linear-gradient(145deg, rgba(30, 30, 40, 0.4), rgba(15, 15, 20, 0.6));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.time-traveler__label { 
    font-size: 0.75rem; 
    color: var(--accent); 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: 0.1em; 
    display: flex; 
    align-items: center; 
    gap: 0.4rem;
    margin-right: 0.5rem;
}

#tt-reset { 
    background: transparent; 
    border: none; 
    color: var(--text-muted); 
    font-size: 1.1rem; 
    cursor: pointer; 
    padding: 0.2rem; 
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.25rem;
}
#tt-reset:hover { 
    color: var(--accent); 
    transform: rotate(-90deg); 
}

#tt-date { 
    text-align: center; 
    font-size: 0.82rem; 
    padding: 0.5rem 0.75rem; 
    color: var(--text-main); 
    font-family: var(--font-mono); 
    background: rgba(0, 0, 0, 0.25); 
    border-radius: 8px; 
    border: 1px inset rgba(255, 255, 255, 0.02); 
    margin: 0 0.25rem; 
    font-variant-numeric: tabular-nums;
}

.time-traveler__slider {
    display: none;
}

.time-traveler__btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 0.5rem 0;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-family: var(--font-mono);
}

.time-traveler__btn:hover {
    background: rgba(245, 189, 65, 0.12);
    border-color: rgba(245, 189, 65, 0.3);
    color: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(245, 189, 65, 0.1);
}

.time-traveler__btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

/* тФАтФА Pro Mode: Chart Slot Card тФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФАтФА */

.pro-chart-slot {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.5rem;
    position: relative;
}

.pro-chart-slot__label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
    margin-bottom: 0.3rem;
}

/* Expanded state for Pro chart slot: Table Mode */
.pro-chart-slot--expanded {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pro-chart-slot--expanded .pro-chart-slot__label {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.pro-chart-slot--expanded .pro-slot-chart {
    display: none !important;
}

.pro-chart-slot--expanded .varga-detail__table {
    width: 100%;
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
}

.pro-chart-slot--expanded .pro-slot-chart .si-grid {
    min-height: 0; /* Override default 300px to allow shrinking */
}

.pro-chart-slot--expanded .pro-slot-chart .si-planet {
    font-size: 0.5rem;
}

.pro-chart-slot--expanded .pro-slot-chart .si-cell__sign,
.pro-chart-slot--expanded .pro-slot-chart .si-cell__house {
    font-size: 0.45rem;
}



/* Scale the table dynamically to fit the slot */
.pro-chart-slot--expanded .table--compact {
    font-size: clamp(0.65rem, 1.2vw, 0.85rem);
    width: 100%;
}
.pro-chart-slot--expanded .table--compact th {
    font-size: clamp(0.6rem, 1.1vw, 0.8rem);
    padding: 0.3rem 0.2rem;
    white-space: normal;
    word-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    line-height: 1.2;
}

.pro-chart-slot--expanded .table--compact td {
    padding: 0.3rem 0.2rem;
    font-size: clamp(0.65rem, 1.2vw, 0.85rem);
    white-space: normal;
    word-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    line-height: 1.2;
}

/* Specific column adjustments */
.pro-chart-slot--expanded .table--compact td:nth-child(2) {
    font-size: clamp(0.7rem, 1.3vw, 0.9rem);
}
.pro-chart-slot--expanded .table--compact th:nth-child(4),
.pro-chart-slot--expanded .table--compact th:nth-child(5) {
    font-size: clamp(0.55rem, 1vw, 0.75rem);
}

.pro-chart-slot--expanded .table--compact .badge {
    font-size: clamp(0.55rem, 1vw, 0.75rem);
    padding: 0.15rem 0.25rem;
    white-space: normal;
    word-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    text-align: center;
    line-height: 1.1;
    display: inline-block;
    margin: 2px 0;
}

/* --- Larger Table in 2-Column Mode --- */
/* (Grid templates removed since we toggle display) */
.pro-chart-grid--cols-2 .pro-chart-slot--expanded,
.pro-chart-grid--cols-responsive .pro-chart-slot--expanded {
    gap: 0.75rem;
}

/* Larger chart labels in 2-column expanded mode */
.pro-chart-grid--cols-2 .pro-chart-slot--expanded .pro-slot-chart .si-planet,
.pro-chart-grid--cols-responsive .pro-chart-slot--expanded .pro-slot-chart .si-planet {
    font-size: 0.75rem;
}

.pro-chart-grid--cols-2 .pro-chart-slot--expanded .pro-slot-chart .si-cell__sign,
.pro-chart-grid--cols-responsive .pro-chart-slot--expanded .pro-slot-chart .si-cell__sign,
.pro-chart-grid--cols-2 .pro-chart-slot--expanded .pro-slot-chart .si-cell__house,
.pro-chart-grid--cols-responsive .pro-chart-slot--expanded .pro-slot-chart .si-cell__house {
    font-size: 0.65rem;
}

.pro-chart-grid--cols-2 .pro-chart-slot--expanded .table--compact,
.pro-chart-grid--cols-responsive .pro-chart-slot--expanded .table--compact {
    font-size: 0.65rem;
}
.pro-chart-grid--cols-2 .pro-chart-slot--expanded .table--compact th,
.pro-chart-grid--cols-responsive .pro-chart-slot--expanded .table--compact th {
    font-size: 0.58rem;
    padding: 0.15rem;
}
.pro-chart-grid--cols-2 .pro-chart-slot--expanded .table--compact td,
.pro-chart-grid--cols-responsive .pro-chart-slot--expanded .table--compact td {
    font-size: 0.65rem;
    padding: 0.15rem;
}
/* Sign and House Columns larger */
.pro-chart-grid--cols-2 .pro-chart-slot--expanded .table--compact td:nth-child(2),
.pro-chart-grid--cols-responsive .pro-chart-slot--expanded .table--compact td:nth-child(2) {
    font-size: 0.75rem;
}
/* The house circle is drawn inline, but we can override font-size */
.pro-chart-grid--cols-2 .pro-chart-slot--expanded .table--compact td:nth-child(3) div,
.pro-chart-grid--cols-responsive .pro-chart-slot--expanded .table--compact td:nth-child(3) div {
    font-size: 0.7rem !important;
    width: 22px !important;
    height: 22px !important;
    color: var(--text-secondary) !important;
    border-color: rgba(255,255,255,0.2) !important;
}

/* Center text and badges in Dignity (4) and Status (5) columns */
.pro-chart-grid--cols-2 .pro-chart-slot--expanded .table--compact th:nth-child(4),
.pro-chart-grid--cols-responsive .pro-chart-slot--expanded .table--compact th:nth-child(4),
.pro-chart-grid--cols-2 .pro-chart-slot--expanded .table--compact td:nth-child(4),
.pro-chart-grid--cols-responsive .pro-chart-slot--expanded .table--compact td:nth-child(4),
.pro-chart-grid--cols-2 .pro-chart-slot--expanded .table--compact th:nth-child(5),
.pro-chart-grid--cols-responsive .pro-chart-slot--expanded .table--compact th:nth-child(5),
.pro-chart-grid--cols-2 .pro-chart-slot--expanded .table--compact td:nth-child(5),
.pro-chart-grid--cols-responsive .pro-chart-slot--expanded .table--compact td:nth-child(5) {
    font-size: 0.55rem;
    text-align: center;
}

.pro-chart-grid--cols-2 .pro-chart-slot--expanded .table--compact .badge,
.pro-chart-grid--cols-responsive .pro-chart-slot--expanded .table--compact .badge {
    font-size: 0.5rem;
    padding: 0.08rem 0.15rem;
}

@media (max-width: 960px) {
    .pro-chart-slot--expanded {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
}

.pro-chart-slot__controls {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    display: flex;
    gap: 0.35rem;
    z-index: 2;
}

.pro-chart-slot__btn {
    background: rgba(0, 0, 0, 0.6);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.15rem 0.35rem;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
    transition: all 0.2s;
}

.pro-chart-slot__btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(245, 189, 65, 0.1);
}

.pro-chart-slot__btn--danger:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(248, 113, 113, 0.1);
}

.pro-chart-slot--add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px dashed var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.pro-chart-slot--add:hover {
    border-color: var(--accent);
    background: rgba(245, 189, 65, 0.05);
}

.pro-chart-slot--add-icon {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    transition: color 0.2s;
}

.pro-chart-slot--add:hover .pro-chart-slot--add-icon {
    color: var(--accent);
}

/* тХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХР
.widget[data-id="charts"] .widget__body,
.widget[data-id="panchanga"] .widget__body {
    max-height: none;
    overflow-y: visible;
}

/* Per-widget height overrides */
.widget[data-id="dashas"] .widget__body,
.widget[data-id="yogas"] .widget__body      { max-height: 500px; }
.widget[data-id="ashtakavarga"] .widget__body,
.widget[data-id="aspects"] .widget__body     { max-height: 350px; }
.widget[data-id="key-grahas"] .widget__body  { max-height: 400px; }
.widget[data-id="shadbala"] .widget__body     { max-height: 400px; }
.widget[data-id="nakshatras"] .widget__body   { max-height: 400px; }
.widget[data-id="house-lords"] .widget__body  { max-height: 400px; }

.widget--collapsed .widget__body {
    max-height: 0 !important;
    padding-top: 0;
    padding-bottom: 0;
    border-top: none;
    overflow: hidden;
    resize: none;
}

.widget--collapsed .widget__header {
    border-bottom-color: transparent;
}

.widget--maximized .widget__body {
    max-height: none !important;
}

.widget--ghost {
    opacity: 0.4;
    background: rgba(245, 189, 65, 0.05);
    border: 2px dashed var(--accent);
}

/* Full-width widgets */
.widget[data-id="panchanga"] {
    grid-column: 1 / -1;
}

/* тХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХР
   PANCHANGA (Five Limbs)
   тХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХРтХР */

.panchanga-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.panchanga-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.panchanga-item__icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.panchanga-item__content {
    flex: 1;
    min-width: 0;
}

.panchanga-item__label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 0.2rem;
}

.panchanga-item__value {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.panchanga-item__bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    margin-top: 0.4rem;
    overflow: hidden;
}

.panchanga-item__bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s;
}

.panchanga__good { color: var(--success); }
.panchanga__bad { color: var(--danger); }
