/**
 * Index Page Styles
 * Clean admin dashboard design - industrial/utilitarian aesthetic
 */

/* ==================== Base Layout ==================== */
.custom-index {
    padding: 32px;
    min-height: calc(100dvh);
    max-width: 1200px;
    margin: 0 auto;
}

/* ==================== Welcome Header ==================== */
.welcome-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e1e4e8;
}

.welcome-header h1 {
    font-size: 1.75em;
    font-weight: 600;
    color: #24292f;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

.welcome-header h1 i {
    color: #0969da;
    font-size: 0.9em;
}

.welcome-user {
    font-size: 14px;
    color: #57606a;
    background: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #d0d7de;
}

.welcome-user strong {
    color: #24292f;
    font-weight: 600;
}

/* ==================== Section Title ==================== */
.section-title {
    font-size: 13px;
    font-weight: 600;
    color: #57606a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    font-size: 14px;
}

/* ==================== Feature Cards Grid ==================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.feature-card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    border: 1px solid #d0d7de;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.feature-card:hover {
    border-color: #0969da;
    box-shadow: 0 1px 3px rgba(9, 105, 218, 0.1);
    text-decoration: none;
    color: inherit;
}

/* ==================== Feature Icons ==================== */
.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 20px;
    flex-shrink: 0;
}

/* SVG agent sparkle sits slightly larger than the default 1em inside
   the 48px tile — three stars need room to breathe. */
.feature-icon .agent-icon {
    width: 30px;
    height: 30px;
}

.feature-icon.purple {
    background: #f3f0ff;
    color: #8250df;
    border: 1px solid #d8b9ff;
}

.feature-icon.blue {
    background: #ddf4ff;
    color: #0969da;
    border: 1px solid #80ccff;
}

.feature-icon.green {
    background: #dafbe1;
    color: #1a7f37;
    border: 1px solid #82e596;
}

.feature-icon.orange {
    background: #fff1e5;
    color: #bc4c00;
    border: 1px solid #ffbc8f;
}

.feature-icon.magenta {
    background: #f3f0ff;
    color: #8250df;
    border: 1px solid #d8b9ff;
}

.feature-icon.teal {
    background: #d3f8f0;
    color: #0d7377;
    border: 1px solid #6dd5cb;
}

.feature-icon.cyan {
    background: #ddf4ff;
    color: #0969da;
    border: 1px solid #80ccff;
}

/* ==================== Feature Card Content ==================== */
.feature-content {
    flex: 1;
    min-width: 0;
}

.feature-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: #24292f;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

.feature-content p {
    color: #57606a;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.feature-arrow {
    color: #8c959f;
    font-size: 14px;
    transition: transform 0.15s ease, color 0.15s ease;
    align-self: center;
}

.feature-card:hover .feature-arrow {
    transform: translateX(4px);
    color: #0969da;
}

/* ==================== Recently Working On ==================== */
.recent-sessions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.recent-sessions-column {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #d0d7de;
    overflow: hidden;
}

.recent-sessions-header {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #57606a;
    background: #f6f8fa;
    border-bottom: 1px solid #d0d7de;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recent-sessions-header i {
    font-size: 14px;
    color: #0969da;
}

.recent-sessions-list {
    display: flex;
    flex-direction: column;
}

.recent-session-item {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.15s;
}

.recent-session-item:last-child {
    border-bottom: none;
}

.recent-session-item:hover {
    background: #f6f8fa;
    text-decoration: none;
    color: inherit;
}

.recent-session-title {
    font-size: 13px;
    font-weight: 500;
    color: #24292f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.recent-session-meta {
    font-size: 12px;
    color: #8c959f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-session-time {
    margin-left: 2px;
}

/* ==================== Quick Start Section ==================== */
.quick-start-section {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    border: 1px solid #d0d7de;
    margin-bottom: 32px;
}

.quick-start-section .section-title {
    margin-bottom: 12px;
    justify-content: flex-start;
}

.getting-started-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #8c959f;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    transition: color 0.15s;
}

.getting-started-close:hover {
    color: #24292f;
}

/* ==================== Onboarding List ==================== */
.onboarding-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.onboarding-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid #e1e4e8;
}

.onboarding-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.onboarding-item:first-child {
    padding-top: 0;
}

.onboarding-step {
    width: 32px;
    height: 32px;
    background: #f6f8fa;
    border: 2px solid #d0d7de;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #57606a;
    flex-shrink: 0;
}

.onboarding-item.completed .onboarding-step {
    background: #dafbe1;
    border-color: #1a7f37;
    color: #1a7f37;
}

.onboarding-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: #24292f;
    margin: 0 0 6px 0;
}

.onboarding-content p {
    font-size: 13px;
    color: #57606a;
    line-height: 1.5;
    margin: 0;
}

.onboarding-content a {
    color: #0969da;
    text-decoration: none;
    font-weight: 500;
}

.onboarding-content a:hover {
    text-decoration: underline;
}

/* ==================== Onboarding: live progress ==================== */
/* Scoped hide helper — beats the class-level `display:flex/block` on the
   list/progress/done blocks that would otherwise override [hidden]. */
.quick-start-section [hidden] {
    display: none !important;
}

.onboarding-progress-label {
    margin-left: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #57606a;
}

.onboarding-progress {
    margin-bottom: 16px;
}

.onboarding-progress-track {
    height: 6px;
    background: #eaeef2;
    border-radius: 999px;
    overflow: hidden;
}

.onboarding-progress-fill {
    height: 100%;
    width: 0;
    background: #1a7f37;
    border-radius: 999px;
    transition: width 0.4s ease;
}

/* Step circle: number by default, check once completed. */
.onboarding-step-check {
    display: none;
}

.onboarding-item.completed .onboarding-step-num {
    display: none;
}

.onboarding-item.completed .onboarding-step-check {
    display: inline-block;
}

.onboarding-item.completed .onboarding-content h4 {
    color: #57606a;
}

/* Emphasised inline caveat (e.g. "even Admins need a group"). */
.onboarding-note {
    display: block;
    margin-top: 4px;
    color: #9a6700;
    font-weight: 600;
}

/* Per-step call-to-action, pushed to the right; hidden once the step is done. */
.onboarding-cta {
    align-self: center;
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #0969da;
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.onboarding-cta:hover {
    background: #0860ca;
    color: #fff;
    text-decoration: none;
}

.onboarding-cta i {
    font-size: 11px;
}

.onboarding-item.completed .onboarding-cta {
    display: none;
}

/* All-done success state — shown below the full checklist when everything's done. */
.onboarding-done {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding: 16px;
    background: #dafbe1;
    border: 1px solid #aceebb;
    border-radius: 8px;
}

.onboarding-done-icon {
    font-size: 32px;
    color: #1a7f37;
    flex-shrink: 0;
    line-height: 1;
}

.quick-start-section.onboarding-fade-out {
    opacity: 0;
    transition: opacity 0.6s ease;
}

/* ==================== Login Required ==================== */
.login-required-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 40px 20px;
}

.login-required-card {
    background: #fff;
    border-radius: 12px;
    padding: 48px;
    text-align: center;
    border: 1px solid #d0d7de;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.login-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #fff1e5 0%, #ffbc8f 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px auto;
    font-size: 28px;
    color: #bc4c00;
    border: 2px solid #ffbc8f;
}

.login-required-card h2 {
    font-size: 22px;
    font-weight: 600;
    color: #24292f;
    margin: 0 0 12px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

.login-required-card p {
    font-size: 14px;
    color: #57606a;
    line-height: 1.6;
    margin: 0 0 28px 0;
}

.login-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0969da;
    color: #fff;
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    border: none;
    cursor: pointer;
}

.login-button:hover {
    background: #0860ca;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(9, 105, 218, 0.3);
}

.login-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(9, 105, 218, 0.2);
}

.login-button i {
    font-size: 16px;
}

/* ==================== Beta Notice ==================== */
.beta-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 14px 20px;
    /* Sits at the foot of the page, after the last grid has already spent its
       own bottom margin — so the gap it needs is above, not below. */
    margin-top: 8px;
}

.beta-notice-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 4px;
    flex-shrink: 0;
}

.beta-notice-text {
    font-size: 13px;
    color: #6b5900;
    line-height: 1.5;
}

.beta-notice-text strong {
    color: #4a3c00;
}

/* ==================== Home grid (js/index/home_grid.js) ==================== */
.home-grid-error {
    padding: 16px;
    margin-bottom: 32px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text-secondary);
    font-size: 13px;
    background: var(--color-bg-white);
}

.home-section {
    margin-bottom: 8px;
}

.home-section-hint {
    margin-left: auto;
    font-size: 12px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--color-text-muted);
}

/* Badges: 11px / 600 / uppercase — the system's metadata signal. */
.home-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    vertical-align: 2px;
    line-height: 1.3;
}

.home-badge-new {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.home-badge-muted {
    background: var(--color-gray-100);
    color: var(--color-text-secondary);
}

.home-badge-current {
    background: var(--color-primary-lighter);
    color: var(--color-primary-dark);
}

/* ── Buttons ── */
.home-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.home-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.home-btn-primary {
    background: var(--color-primary);
    color: var(--color-text-white);
}

.home-btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

.home-btn-outline {
    background: var(--color-bg-white);
    border-color: var(--color-border);
    color: var(--color-accent-purple);
}

.home-btn-outline:hover:not(:disabled) {
    border-color: var(--color-accent-purple);
    background: var(--color-bg-light);
}

.home-link-btn {
    background: none;
    border: none;
    padding: 4px 0;
    font-size: 13px;
    color: var(--color-text-secondary);
    cursor: pointer;
}

.home-link-btn:hover {
    color: var(--color-accent-purple);
}

/* ── Toolbar: search + customize ── */
.home-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.home-search {
    flex: 1;
    position: relative;
    margin: 0;
    font-weight: 400;
}

.home-search > i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: 13px;
    pointer-events: none;
}

.home-search-input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 34px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg-white);
    font-size: 13px;
    color: var(--color-text-primary);
}

.home-search-input:focus {
    outline: none;
    border-color: var(--color-accent-purple);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.home-search-empty {
    padding: 32px 16px;
    margin-bottom: 32px;
    text-align: center;
    font-size: 13px;
    color: var(--color-text-secondary);
    background: var(--color-bg-white);
    border: 1px dashed var(--color-border);
    border-radius: 8px;
}

/* ── Cards: wrapper holds the link and its ⋯ menu button side by side, since
      a <button> inside an <a> is invalid HTML. ── */
.home-card {
    position: relative;
    display: flex;
}

.home-card > .feature-card {
    flex: 1;
    min-width: 0;
    padding-right: 44px;
}

.home-card-menu-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
}

.home-card:hover .home-card-menu-btn,
.home-card-menu-btn:focus-visible,
.home-card-menu-btn[aria-expanded="true"] {
    opacity: 1;
}

.home-card-menu-btn:hover,
.home-card-menu-btn[aria-expanded="true"] {
    background: var(--color-gray-100);
    color: var(--color-text-primary);
}

/* Touch screens have no hover — keep the menu reachable. */
@media (hover: none) {
    .home-card-menu-btn {
        opacity: 1;
    }
}

.home-card.is-user-hidden > .feature-card {
    background: var(--color-bg-light);
    border-style: dashed;
}

.home-card.is-user-hidden .feature-icon {
    opacity: 0.6;
}

.home-card[draggable="true"] > .feature-card {
    cursor: grab;
}

.home-card.is-dragging {
    opacity: 0.4;
}

.home-card-menu {
    position: absolute;
    z-index: 1000;
    min-width: 170px;
    padding: 4px;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.home-card-menu[hidden] {
    display: none;
}

.home-card-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 6px;
    background: none;
    font-size: 13px;
    color: var(--color-text-primary);
    text-align: left;
    cursor: pointer;
}

.home-card-menu button i {
    width: 14px;
    color: var(--color-text-secondary);
}

.home-card-menu button:hover,
.home-card-menu button:focus-visible {
    background: var(--color-gray-100);
    outline: none;
}

/* ── All tools (collapsible) ── */
.home-all-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.home-all-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #57606a;
    cursor: pointer;
}

.home-all-toggle:disabled {
    cursor: default;
}

.home-all-toggle:hover:not(:disabled) {
    color: var(--color-text-primary);
}

.home-all-chevron {
    font-size: 11px;
    transition: transform 0.15s ease;
}

.home-all.is-open .home-all-chevron {
    transform: rotate(90deg);
}

.home-all-count {
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--color-gray-100);
    font-size: 11px;
    letter-spacing: 0;
    color: var(--color-text-secondary);
}

.home-all-head .home-link-btn {
    margin-left: auto;
}

.home-all:not(.is-open) {
    margin-bottom: 32px;
}

/* ── Continue where you left off ── */
.home-recent-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.home-recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px 14px;
    background: var(--color-bg-white);
    border: 1px solid #d0d7de;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease;
}

.home-recent-item:hover {
    border-color: #0969da;
    text-decoration: none;
    color: inherit;
}

.home-recent-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 14px;
    background: var(--color-gray-100);
    color: var(--color-text-secondary);
}

.home-recent-conversation {
    background: #f3f0ff;
    color: #8250df;
}

.home-recent-workspace {
    background: #fff1e5;
    color: #bc4c00;
}

.home-recent-notebook {
    background: #ddf4ff;
    color: #0969da;
}

.home-recent-emoji {
    font-size: 16px;
    line-height: 1;
}

.home-recent-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.home-recent-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-recent-meta {
    font-size: 12px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── First-visit picker ── */
.home-picker {
    padding: 24px;
    margin-bottom: 32px;
    background: var(--color-bg-white);
    border: 1px solid #d0d7de;
    border-radius: 8px;
}

.home-picker-head h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.home-picker-head p {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--color-text-secondary);
}

.home-picker-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.home-picker-option,
.home-tpl-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.home-picker-option:hover,
.home-tpl-option:hover {
    border-color: var(--color-accent-purple);
}

.home-picker-option.is-selected,
.home-tpl-option.is-current {
    border-color: var(--color-accent-purple);
    background: var(--color-primary-lighter);
    box-shadow: 0 0 0 1px var(--color-accent-purple);
}

.home-picker-icon,
.home-tpl-icon {
    width: 18px;
    margin-top: 2px;
    text-align: center;
    color: var(--color-accent-purple);
}

.home-picker-text,
.home-tpl-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.home-picker-title,
.home-tpl-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.home-picker-title .home-badge,
.home-tpl-title .home-badge {
    vertical-align: 1px;
}

.home-picker-desc,
.home-tpl-desc {
    font-size: 12px;
    line-height: 1.45;
    color: var(--color-text-secondary);
}

.home-tpl-featured {
    margin-top: 4px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.home-picker-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* ── Customize dialog (custom modal pattern) ── */
.home-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
}

.home-modal-overlay.is-open {
    display: flex;
}

.home-modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    background: var(--color-bg-white);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.home-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--color-border-light);
}

.home-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.home-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--color-gray-500);
    cursor: pointer;
}

.home-modal-close:hover {
    background: var(--color-gray-100);
}

.home-modal-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
}

.home-modal-label {
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
}

.home-tpl-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.home-tpl-row {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.home-tpl-row > .home-tpl-option {
    flex: 1;
    min-width: 0;
}

.home-tpl-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.home-icon-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg-white);
    color: var(--color-text-secondary);
    cursor: pointer;
}

.home-icon-btn:hover {
    border-color: var(--color-accent-purple);
    color: var(--color-accent-purple);
}

.home-icon-btn-danger:hover {
    border-color: var(--color-error);
    color: var(--color-error);
}

.home-create-own {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--color-text-secondary);
}

.home-modal-reset {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border-light);
}

.home-modal-reset > div {
    flex: 1;
}

.home-modal-reset p {
    margin: 0;
    font-size: 12px;
    color: var(--color-text-secondary);
}

/* ==================== Responsive Design ==================== */
@media (max-width: 900px) {

    .features-grid,
    .recent-sessions-grid {
        grid-template-columns: 1fr;
    }

    .home-recent-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .custom-index {
        padding: 20px 16px;
    }

    .welcome-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .welcome-header h1 {
        font-size: 1.4em;
    }

    .feature-card {
        padding: 16px;
        gap: 16px;
    }

    .feature-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .onboarding-item {
        gap: 12px;
        flex-wrap: wrap;
    }

    /* Let the CTA drop to its own line under the step text on narrow screens. */
    .onboarding-cta {
        margin-left: 40px;
    }

    .onboarding-step {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .onboarding-content h4 {
        font-size: 13px;
    }

    .onboarding-content p {
        font-size: 12px;
    }

    .home-recent-list {
        grid-template-columns: 1fr;
    }

    /* Search takes the row; Customize collapses to its icon. */
    .home-toolbar .home-btn span {
        display: none;
    }

    .home-picker {
        padding: 16px;
    }

    .home-picker-options {
        grid-template-columns: 1fr;
    }

    .home-modal-reset {
        flex-direction: column;
        align-items: stretch;
    }
}