.baskets-page {
    max-width: 1280px;
    margin: 1.5rem auto 3rem;
}
.baskets-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.15rem;
}
.baskets-header h1 {
    margin: 0 0 0.35rem;
    font-size: 1.85rem;
    color: #111827;
    letter-spacing: -0.02em;
}
.baskets-header p {
    margin: 0;
    color: #6b7280;
    max-width: 40rem;
}
.baskets-header-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.baskets-manage-link {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #c7d2fe;
    background: #fff;
    color: #4338ca;
    font-weight: 650;
    font-size: 0.88rem;
    text-decoration: none;
    white-space: nowrap;
}
.baskets-manage-link:hover { background: #eef2ff; color: #3730a3; }
.view-mode-selector {
    display: flex;
    gap: 0.25rem;
    background: #f3f4f6;
    padding: 0.25rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}
.view-mode-btn {
    padding: 0.45rem 0.6rem;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.view-mode-btn.active {
    background: #fff;
    color: #667eea;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.view-mode-btn:hover:not(.active) { color: #374151; }
.basket-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.45rem;
}
.basket-toolbar input,
.basket-toolbar select {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.45rem 0.7rem;
    background: #fff;
    min-width: 0;
}
.basket-toolbar input[type="search"] { flex: 1 1 220px; }
.basket-toolbar-note {
    margin: 0 0 1rem;
    color: #9ca3af;
    font-size: 0.82rem;
}
.theme-zone {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 0.85rem 0.95rem 1rem;
    margin-bottom: 0.9rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.theme-zone[hidden] { display: none !important; }
.zone-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.zone-header h2 {
    margin: 0;
    font-size: 1.05rem;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.zone-icon { font-size: 1.1rem; line-height: 1; }
.zone-count {
    background: #e5e7eb;
    color: #374151;
    border-radius: 999px;
    font-size: 0.75rem;
    padding: 0.1rem 0.5rem;
}
.tiles { display: grid; gap: 0.85rem; }
#basketBoard.view-small .tiles { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
#basketBoard.view-medium .tiles { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
#basketBoard.view-large .tiles { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.basket-tile {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 0.75rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
    min-width: 0;
}
.basket-tile:hover {
    border-color: #c7d2fe;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.08);
    color: inherit;
}
.basket-tile.is-featured { border-color: #fcd34d; }
.basket-tile[hidden] { display: none !important; }
.icon-graphic {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    align-items: center;
    gap: 0.55rem;
    min-height: 168px;
    padding: 0.9rem 0.75rem;
    border-radius: 12px;
    background:
        radial-gradient(circle at 18% 20%, #eef2ff 0%, transparent 46%),
        radial-gradient(circle at 82% 78%, #f5f3ff 0%, transparent 42%),
        #f8fafc;
}
.icon-graphic.is-empty {
    color: #9ca3af;
    font-size: 0.85rem;
}
.stock-icon {
    position: relative;
    display: inline-flex;
    width: 68px;
    height: 68px;
    padding: 7px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    flex: 0 0 auto;
}
.stock-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.stock-icon img.is-broken { display: none; }
.stock-icon-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    font-weight: 750;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    color: #4338ca;
    background: #eef2ff;
}
.icon-overflow {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 36px;
    padding: 0 0.55rem;
    border-radius: 999px;
    background: #fff;
    border: 1px dashed #c7d2fe;
    color: #4338ca;
    font-size: 0.8rem;
    font-weight: 750;
}
#basketBoard.view-large .stock-icon:nth-child(n+13) { display: none; }
#basketBoard.view-large .overflow-large { display: inline-flex; }
#basketBoard.view-medium .icon-graphic { min-height: 112px; gap: 0.4rem; padding: 0.7rem 0.55rem; }
#basketBoard.view-medium .stock-icon { width: 44px; height: 44px; border-radius: 12px; padding: 4px; }
#basketBoard.view-medium .stock-icon:nth-child(n+9) { display: none; }
#basketBoard.view-medium .overflow-medium { display: inline-flex; }
#basketBoard.view-small .basket-tile { gap: 0.45rem; padding: 0.55rem; }
#basketBoard.view-small .icon-graphic { min-height: 0; gap: 0.28rem; padding: 0.4rem; }
#basketBoard.view-small .stock-icon { width: 32px; height: 32px; border-radius: 8px; padding: 3px; box-shadow: none; }
#basketBoard.view-small .stock-icon-fallback { font-size: 0.55rem; }
#basketBoard.view-small .stock-icon:nth-child(n+5) { display: none; }
#basketBoard.view-small .overflow-small { display: inline-flex; min-width: 32px; height: 28px; font-size: 0.72rem; }
#basketBoard.view-small .tile-tags { display: none; }
.tile-name {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}
.tile-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.meta-chip {
    background: #f3f4f6;
    color: #374151;
    border-radius: 999px;
    padding: 0.12rem 0.5rem;
    font-size: 0.75rem;
}
.meta-chip.featured {
    background: #fef3c7;
    color: #92400e;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-size: 0.68rem;
}
.meta-chip.research { background: #eef2ff; color: #4338ca; }
.basket-filter-empty {
    margin: 1.5rem 0;
    color: #6b7280;
    text-align: center;
}
.basket-filter-empty[hidden] { display: none !important; }

.basket-detail { max-width: 1100px; }
.basket-back {
    display: inline-flex;
    margin-bottom: 0.85rem;
    color: #4f46e5;
    font-weight: 650;
    text-decoration: none;
    font-size: 0.9rem;
}
.basket-back:hover { color: #3730a3; }
.basket-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.basket-detail-head h1 {
    margin: 0 0 0.45rem;
    font-size: 2rem;
    letter-spacing: -0.03em;
    color: #111827;
}
.detail-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.detail-tags a.meta-chip { text-decoration: none; }
.detail-tags a.meta-chip:hover { background: #e0e7ff; color: #3730a3; }
.basket-tools h2,
.basket-stocks h2 {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    color: #111827;
}
.basket-tools p,
.basket-stocks p.section-note {
    margin: 0 0 0.85rem;
    color: #6b7280;
    font-size: 0.92rem;
}
.tool-link-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 0.7rem;
    margin-bottom: 1.75rem;
}
.tool-link {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    padding: 0.85rem 0.9rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
a.tool-link:hover {
    border-color: #c7d2fe;
    background: #f8faff;
    color: inherit;
}
.tool-link.is-disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}
.tool-link-icon { font-size: 1.35rem; line-height: 1; }
.tool-link strong { display: block; color: #111827; font-size: 0.95rem; }
.tool-link.is-disabled strong { color: #9ca3af; }
.tool-link span { display: block; color: #6b7280; font-size: 0.8rem; margin-top: 0.15rem; }
.stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 0.8rem;
}
.stock-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1rem 0.7rem 0.85rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    text-align: center;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.stock-card:hover {
    border-color: #c7d2fe;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.08);
    color: inherit;
}
.stock-card .stock-icon {
    width: 84px;
    height: 84px;
    border-radius: 20px;
    padding: 10px;
    margin-bottom: 0.25rem;
}
.stock-card .stock-icon-fallback { font-size: 0.95rem; }
.stock-symbol {
    font-weight: 750;
    color: #111827;
    font-size: 0.92rem;
    line-height: 1.2;
    word-break: break-word;
}
.stock-name {
    color: #6b7280;
    font-size: 0.75rem;
    line-height: 1.25;
    min-height: 1.9em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.stock-quote {
    font-size: 0.8rem;
    font-weight: 650;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}
.stock-quote .up { color: #059669; }
.stock-quote .down { color: #dc2626; }
.basket-missing {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 2rem 1.25rem;
    text-align: center;
    color: #4b5563;
}
@media (max-width: 720px) {
    .baskets-header { flex-direction: column; }
    .baskets-header-actions { justify-content: flex-start; }
    #basketBoard.view-large .tiles { grid-template-columns: 1fr; }
    .basket-detail-head h1 { font-size: 1.55rem; }
}
