:root {
    --page-bg: #ffffff;
    --panel-bg: #f7f7f7;
    --card-bg: #efefef;
    --border: #d5d5d5;
    --text: #111;
    --muted: #666;
    --radius: 22px;
    --gap: 32px;
    --font-scale: 1;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--page-bg);
    color: var(--text);
    font-size: calc(16px * var(--font-scale));
}

button {
    border: 1px solid #cfcfcf;
    background: #fff;
    border-radius: 18px;
    padding: 12px 20px;
    font-size: 1rem;
    cursor: pointer;
}

button:hover {
    background: #f2f2f2;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: 92px;
    margin: 24px 26px 0;
    padding: 20px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-title {
    font-size: 1.7rem;
    font-weight: 800;
}

.top-title span {
    font-size: .9rem;
    color: var(--muted);
    border: 1px solid #ddd;
    border-radius: 999px;
    padding: 4px 10px;
    margin-left: 8px;
}

.top-nav {
    display: flex;
    gap: 14px;
    align-items: center;
}

.id-button {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    padding: 0;
    font-weight: 800;
}

.app-shell {
    height: calc(100vh - 140px);
    padding: 32px 26px 24px;
    display: grid;
    grid-template-columns: 420px minmax(0, 1fr);
    gap: var(--gap);
}

.left-panel,
.right-panel {
    min-height: 0;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}

.left-panel {
    padding: 0;
}

.right-panel {
    padding: 32px;
}

.panel-header,
.content-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-header h2,
.content-header h1 {
    margin: 0;
}

.solution-list {
    padding: 20px;
}

.solution-card {
    background: var(--card-bg);
    border: 1px solid #ddd;
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}

.solution-head {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
}

.project-list {
    padding: 0 14px 16px;
}

.project-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 18px;
    margin-top: 10px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-card small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

.gear {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
}

.content-actions {
    display: flex;
    gap: 12px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    padding-top: 24px;
}

.info-card {
    background: var(--card-bg);
    border: 1px solid #ddd;
    border-radius: var(--radius);
    padding: 24px;
    min-height: 160px;
}

.info-card h3 {
    margin-top: 0;
    font-size: 1.45rem;
}

.info-card p {
    color: #333;
    line-height: 1.45;
}

.info-card.wide {
    grid-column: 1 / -1;
    min-height: 260px;
}

@media (max-width: 900px) {
    html,
    body {
        height: 100%;
        overflow: hidden;
    }

    .top-bar {
        height: auto;
        min-height: 0;
        margin: 14px 14px 0;
        padding: 18px;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .top-title {
        font-size: 1.8rem;
        line-height: 1.1;
    }

    .top-nav {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        overflow: visible;
        gap: 10px;
    }

    .top-nav button {
        flex: 1 1 calc(50% - 10px);
        min-width: 0;
        padding: 12px 10px;
    }

    .top-nav .id-button {
        flex: 0 0 46px;
    }

    .app-shell {
        height: calc(100vh - 190px);
        padding: 18px 14px 14px;
        display: block;
        overflow: hidden;
    }

    .left-panel {
        display: none;
    }

    .right-panel {
        height: 100%;
        overflow-y: auto;
        padding: 22px;
    }

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

    .content-header::before {
        content: "☰ Solutions";
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #cfcfcf;
        background: #fff;
        border-radius: 18px;
        padding: 12px 20px;
        font-size: 1rem;
        cursor: pointer;
    }

    .content-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .content-actions button {
        flex: 1 1 calc(33.333% - 10px);
        min-width: 120px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}


/* Header layout refinement */

.top-main-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
}

.mobile-solutions-button {
    display: none;
}

.top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
}

.top-nav {
    justify-content: flex-end;
}

@media (min-width: 901px) {
    .top-bar {
        height: auto;
    }

    .top-main-row {
        position: relative;
    }

    .top-title {
        flex: 1 1 auto;
    }

    .id-button {
        margin-left: auto;
    }
}

@media (max-width: 900px) {
    .top-main-row {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        gap: 10px;
    }

    .mobile-solutions-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        grid-column: 1;
        justify-self: start;
        padding: 11px 14px;
        white-space: nowrap;
    }

    .top-title {
        grid-column: 2;
        justify-self: center;
        text-align: center;
        font-size: 1.45rem;
        white-space: nowrap;
    }

    .top-title span {
        display: inline-flex;
        font-size: .8rem;
        margin-left: 6px;
    }

    .id-button {
        grid-column: 3;
        justify-self: end;
        width: 46px;
        height: 46px;
        flex: 0 0 46px;
    }

    .top-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100%;
    }

    .top-nav button {
        width: 100%;
        flex: none;
    }

    .top-nav button:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .content-header::before {
        content: none;
        display: none;
    }
}

/* Mobile action bars: max 3 buttons per row */

@media (max-width: 900px) {
    .top-nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        width: 100%;
    }

    .top-nav button {
        width: 100%;
        min-width: 0;
        flex: none;
    }

    .top-nav button:last-child:nth-child(odd) {
        grid-column: auto;
    }

    .content-header {
        position: static;
        top: auto;
        z-index: auto;
        background: transparent;
        border-bottom: 1px solid #ddd;
        padding: 22px 0 28px;
    }

    .content-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        width: 100%;
    }

    .content-actions button {
        width: 100%;
        min-width: 0;
        flex: none;
        padding-left: 8px;
        padding-right: 8px;
    }

    .right-panel {
        padding-top: 22px;
    }

    .cards-grid {
        padding-top: 22px;
    }
}

a.id-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #111;
}

.id-button {
    overflow: hidden;
}

.id-button.has-user {
    padding: 0;
    background: #f3f4f6;
}

.id-avatar {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
