/* Home-page reference design. Scoped to access panels so the editor keeps its layout. */
body:has(#accessPanel:not(.hidden)) {
    height: auto;
    min-height: 100vh;
    overflow: auto;
}
body:has(#accessPanel:not(.hidden)) .app-shell {
    flex: 0 0 auto;
    width: min(2200px, calc(100% - 24px));
    padding: 16px 0 12px;
}
#accessPanel:not(.creation-step) {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-top: 0;
}
#accessPanel.hidden { display: none; }
#accessPanel .split,
#accessPanel .support-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 0;
    overflow: visible;
}
#accessPanel.single-form .split { grid-template-columns: minmax(0, 1fr); }
#accessPanel .home-project-panel,
#accessPanel .home-info,
#accessPanel .home-support {
    min-width: 0;
    border-radius: 22px;
    padding: 20px 26px 16px 40px;
    box-shadow: 0 14px 34px #2471a30b;
}
#accessPanel .split .home-project-panel {
    display: block;
    min-height: 344px;
}
#accessPanel .split .home-project-panel.hidden { display: none; }
#accessPanel .home-create {
    --panel-surface: linear-gradient(115deg, #fff 15%, #f5fcf8 100%);
}
#accessPanel .home-open {
    --panel-surface: linear-gradient(115deg, #f8fcff, #f5faff);
}
.home-project-heading {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 16px;
    margin: 0 0 14px -6px;
}
.home-project-icon {
    display: grid;
    place-items: center;
    width: 66px;
    height: 66px;
    color: #146b36;
    background: #e3f3e9;
    border-radius: 50%;
}
.home-open .home-project-icon {
    color: #2298d0;
    background: #e3f4ff;
}
.home-project-icon svg { width: 36px; height: 36px; }
#accessPanel .split .home-project-heading h2 {
    margin: 0 36px 6px 0;
    color: #156b35;
    font-size: 26px;
    line-height: 1.2;
}
#accessPanel .split .home-open h2 { color: #238fc6; }
.home-welcome {
    color: #3b5070;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 8px;
}
.home-description,
.home-support-description {
    color: #63758e;
    font-size: 14px;
    line-height: 1.45;
}
#accessPanel .split .home-project-panel label {
    font-size: 14px;
    margin: 0 0 6px;
    color: #3b5070;
}
#accessPanel .split .home-project-panel input {
    min-height: 40px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 18px;
    border-radius: 6px;
}
#accessPanel input::placeholder,
#accessPanel textarea::placeholder {
    color: #7b89a0;
    opacity: 1;
}
#accessPanel .split .home-project-panel button[type="submit"] {
    display: inline-flex;
    gap: 10px;
    min-width: 128px;
    min-height: 42px;
    margin: 14px 0 0;
    padding: 0 24px;
    font-size: 14px;
}
.home-arrow { width: 22px; height: 22px; flex: 0 0 auto; }
#accessPanel .home-project-panel button[type="submit"],
#accessPanel .home-support button[type="submit"] {
    background: linear-gradient(100deg, #187bae, #40abe8 60%, #207fb1);
}
#accessPanel .home-project-panel button[type="submit"]:hover,
#accessPanel .home-support button[type="submit"]:hover {
    background: linear-gradient(100deg, #12638e, #2695cf 60%, #166a98);
}
#accessPanel .split .home-project-panel .contextual-help-trigger {
    position: absolute;
    top: 22px;
    right: 18px;
    width: 38px;
    min-height: 38px;
    margin: 0;
}
.home-open-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}
#accessPanel .creation-intro {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: none;
    margin: 12px 0 0;
    padding: 8px 12px;
    border: 0;
    border-radius: 7px;
    background: #eaf5fd;
    font-size: 13px;
    line-height: 1.3;
}
.creation-intro svg {
    width: 20px;
    height: 24px;
    flex: 0 0 20px;
    color: #459ed1;
}
.creation-intro p { color: #63758e; }
#accessPanel .home-info,
#accessPanel .home-support {
    --panel-surface: linear-gradient(120deg, #fff, #fcfeff);
    overflow: hidden;
}
#accessPanel .home-info {
    --home-info-height: max(clamp(380px, 55dvh, 480px), var(--guide-panel-height, 0px));
    display: block;
    padding-top: 16px;
    padding-bottom: 12px;
    height: max(var(--home-info-height), var(--collapsed-panel-height, 0px));
    overflow-y: auto;
    /* Let wheel/touch scrolling continue on the page at either panel edge. */
    overscroll-behavior-y: auto;
    scrollbar-gutter: stable;
}
@media (width < 1101px), (height < 700px) {
    /* Fit the collapsed copy so native panning scrolls the page directly. */
    #accessPanel .home-info:not(:has(.home-instructions[open])) {
        height: max-content;
        min-height: var(--home-info-height);
    }
}
#accessPanel .home-info .system-panel-brand { gap: 16px; margin-bottom: 12px; }
#accessPanel .home-info .system-brand-mark {
    width: 53px;
    height: 53px;
    font-size: 25px;
}
#accessPanel .home-info .system-panel-title {
    display: block;
    margin: 0 0 3px;
    font-size: 25px;
    line-height: 1.15;
    color: #20324e;
}
.home-product-tagline {
    font-size: 16px;
    line-height: 1.3;
    font-weight: 700;
    color: #59708d;
}
.home-benefits { padding-right: 154px; }
.home-benefits h3 {
    margin: 0 0 10px;
    font-size: 18px;
    color: #156b35;
}
.home-benefits .knowledge-list { gap: 7px; }
.home-benefits .knowledge-list li {
    font-size: 12px;
    letter-spacing: -0.2px;
    line-height: 1.5;
    color: #344763;
    padding-left: 35px;
}
.home-benefits .knowledge-list li::before {
    width: 20px;
    height: 20px;
    background: #127540;
    box-shadow: none;
}
#accessPanel .home-info > .home-illustration {
    position: absolute;
    width: 210px;
    height: auto;
    right: 0;
    top: 42px;
    pointer-events: none;
}
.home-instructions {
    margin-top: 8px;
    font-size: 12px;
    color: #246c98;
}
.home-instructions summary { cursor: pointer; width: fit-content; }
.home-instructions summary:focus-visible { outline: 2px solid #238fc6; outline-offset: 3px; }
.home-instructions[open] .knowledge-content { padding: 16px 0 4px; }
.home-guide[hidden] { display: none; }
#accessPanel .home-info > .home-guide {
    position: absolute;
    left: 62%;
    top: var(--guide-top);
    width: var(--guide-width);
    transform: translateX(-50%);
    display: block;
}
#accessPanel .home-info > .home-guide[hidden],
#accessPanel .home-info:has(.home-instructions[open]) > .home-guide { display: none; }
.home-guide img {
    display: block;
    width: 100%;
    height: var(--guide-height);
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}
#accessPanel .home-info[data-guide-layout="beside"] > .home-guide {
    left: auto;
    right: 12px;
    transform: none;
}
#accessPanel .home-info[data-guide-layout="stacked"] > .home-guide { left: 50%; }
#accessPanel .home-info[data-guide-layout="beside"]:not(:has(.home-instructions[open])) > .system-panel-brand,
#accessPanel .home-info[data-guide-layout="beside"]:not(:has(.home-instructions[open])) > .home-benefits {
    padding-right: var(--guide-column);
}
#accessPanel .home-info[data-guide-layout="beside"] .home-instructions:not([open]) {
    margin-right: var(--guide-column);
}
#accessPanel .home-info[data-guide-layout="beside"]:not(:has(.home-instructions[open])) > .home-illustration {
    display: none;
}
#accessPanel .home-support h2 { margin: 0 0 14px; font-size: 18px; }
.home-support-description { margin-bottom: 10px; }
#accessPanel .home-support {
    container-type: inline-size;
    --yogi-width: clamp(64px, 10cqw, 96px);
}
#accessPanel .home-support-heading {
    position: static;
    z-index: auto;
    padding-right: calc(var(--yogi-width) + 8px);
    flex: 0 0 auto;
    margin-bottom: 12px;
}
.home-support-heading > .home-yogi {
    position: absolute;
    z-index: 2;
    top: 2px;
    right: 4px;
    width: calc(var(--yogi-width) * 1.2);
    height: auto;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}
#accessPanel .home-support:has(.support-message-list > :not(.empty-chat)) {
    --yogi-width: clamp(56px, 8cqw, 72px);
}
#accessPanel .home-support .support-message-list:has(.empty-chat),
#accessPanel .home-support .support-message-list:empty { display: none; }
#accessPanel .home-support .support-message-list {
    position: relative;
    z-index: 1;
    background: #fcfeff;
    flex: 1 0 100px;
    min-height: 100px;
    max-height: 280px;
    margin: 4px 0 10px;
    overflow-y: auto;
}
#accessPanel .home-support .chat-form { margin-top: auto; }
#accessPanel .home-support label { font-size: 13px; margin: 8px 0 6px; }
#accessPanel .home-support textarea {
    min-height: 68px;
    height: 68px;
    padding: 11px 12px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
}
#accessPanel .home-support button[type="submit"] {
    min-height: 40px;
    margin-top: 12px;
    font-size: 14px;
}
@media (min-width: 1101px) {
    body:has(#accessPanel:not(.hidden)) .company-header,
    body:has(#accessPanel:not(.hidden)) .company-header-inner { min-height: 84px; }
    body:has(#accessPanel:not(.hidden)) .company-header-inner { padding-top: 0; padding-bottom: 0; }
    body:has(#accessPanel:not(.hidden)) .company-logo { max-height: 76px; width: auto; }
    body:has(#accessPanel:not(.hidden)) .header-brand-mark { width: 53px; height: 53px; }
    body:has(#accessPanel:not(.hidden)) .company-footer-inner { padding: 4px 0 5px; }
}
/* A bounded desktop canvas lets the lower row grow without growing the page.
   Short/mobile viewports retain normal document flow and a bounded info panel. */
@media (min-width: 1101px) and (min-height: 700px) {
    body:has(#accessPanel:not(.hidden):not(.creation-step)) {
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
    }
    body:has(#accessPanel:not(.hidden):not(.creation-step)) .company-header {
        flex-shrink: 0;
    }
    body:has(#accessPanel:not(.hidden):not(.creation-step)) .app-shell {
        flex: 1 1 0;
        min-height: 0;
    }
    #accessPanel:not(.creation-step):not(.hidden) {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
    }
    #accessPanel .support-grid {
        min-height: 0;
        overflow: hidden;
    }
    #accessPanel .home-info {
        height: 100%;
        min-height: 0;
        overscroll-behavior-y: contain;
    }
    #accessPanel .home-support {
        overflow-y: auto;
        overscroll-behavior-y: contain;
    }
    #accessPanel .home-support .support-message-list { max-height: none; }
}
@media (max-width: 1350px) and (min-width: 761px) {
    #accessPanel .home-project-panel,
    #accessPanel .home-info,
    #accessPanel .home-support { padding-left: 28px; padding-right: 22px; }
    .home-project-heading { grid-template-columns: 52px minmax(0, 1fr); gap: 12px; }
    .home-project-icon { width: 52px; height: 52px; }
    #accessPanel .split .home-project-heading h2 { font-size: 23px; }
    .home-welcome { font-size: 16px; }
    .home-benefits { padding-right: 110px; }
    #accessPanel .home-info > .home-illustration { width: 124px; top: 112px; }
    #accessPanel .home-info .system-panel-title { font-size: 21px; }
    .home-product-tagline { font-size: 14px; }
    .home-open-fields { gap: 12px; }
}
@media (max-width: 760px) {
    body:has(#accessPanel:not(.hidden)) .app-shell { width: calc(100% - 24px); padding-top: 12px; }
    #accessPanel:not(.creation-step) { gap: 12px; }
    #accessPanel .split,
    #accessPanel .support-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    #accessPanel .home-project-panel,
    #accessPanel .home-info,
    #accessPanel .home-support { padding: 20px 18px 20px 24px; border-radius: 18px; }
    #accessPanel .split .home-project-panel { min-height: 0; }
    .home-project-heading { grid-template-columns: 44px minmax(0, 1fr); gap: 10px; margin: 0 0 20px; }
    .home-project-icon { width: 44px; height: 44px; }
    .home-project-icon svg { width: 26px; height: 26px; }
    #accessPanel .split .home-project-heading h2 { font-size: 21px; margin-right: 24px; }
    .home-welcome { font-size: 15px; }
    .home-description { margin-left: -54px; margin-top: 14px; }
    #accessPanel .split .home-project-panel .contextual-help-trigger {
        top: 17px; right: 12px; width: 32px; min-height: 32px; font-size: 18px;
    }
    .home-open-fields { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    #accessPanel .home-info .system-brand-mark { width: 42px; height: 42px; font-size: 22px; }
    #accessPanel .home-info .system-panel-brand { gap: 10px; }
    #accessPanel .home-info .system-panel-title { font-size: 19px; }
    .home-product-tagline { font-size: 13px; }
    .home-benefits { padding-right: 0; }
    .home-benefits h3 { margin: 20px 0 16px; }
    .home-benefits .knowledge-list { gap: 12px; }
    .home-benefits .knowledge-list li { font-size: 13px; letter-spacing: normal; padding-left: 30px; }
    #accessPanel .home-info > .home-illustration { display: none; }
    #accessPanel .home-support h2 { line-height: 1.35; }
    #accessPanel .home-support textarea { min-height: 88px; }
    #accessPanel .split .home-project-panel button[type="submit"],
    #accessPanel .home-support button[type="submit"] { min-height: 44px; }
    .home-instructions { margin-top: 16px; }
}

/* The details step grows with its fields and keeps a short page's footer at the bottom. */
body:has(#accessPanel.creation-step:not(.hidden)) .app-shell {
    flex: 1 0 auto;
    width: min(1380px, calc(100% - 24px));
    padding-block: clamp(12px, 2vw, 32px);
}
.creation-layout { display: none; }
.creation-step .creation-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.3fr) minmax(240px, 1fr);
    gap: clamp(16px, 2vw, 28px);
    align-items: stretch;
}
#accessPanel .creation-details {
    --panel-surface: linear-gradient(#fff, #fff);
    padding: clamp(20px, 3vw, 40px);
}
.creation-heading { margin-bottom: 24px; }
.creation-heading h1 {
    margin: 0;
    color: var(--pulse-green);
    line-height: 1.13;
}
.creation-heading .creation-project-name {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    margin-block: 10px;
}
.creation-project-name strong {
    color: var(--accent-strong);
    font-size: 14px;
    font-weight: 600;
}
.creation-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 16px;
}
.creation-field:first-child { grid-column: 1 / -1; }
.creation-field-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 8px;
    margin: 0 0 7px;
}
.creation-field-heading,
.creation-project-name > span {
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}
.creation-field-status {
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 700;
}
.creation-field-optional {
    padding: 4px 9px;
    border-radius: 999px;
    background: #eaf5fd;
}
.creation-field input {
    min-height: 48px;
    border-radius: 10px;
    background: var(--workspace-canvas);
}
#accessPanel .creation-field input::placeholder { color: var(--muted); }
.creation-details .field-hint {
    margin: 5px 0 0;
    line-height: 1.42;
}
.creation-tip {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 12px 14px;
    border: 1px solid #bfddd5;
    border-radius: 12px;
    background: linear-gradient(110deg, #e9f6ee, #eef7fc);
}
.creation-tip-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--pulse-green);
    background: var(--panel);
}
.creation-tip-icon svg { width: 22px; height: 22px; }
.creation-tip p { font-size: 14px; line-height: 1.42; }
.creation-tip p + p { margin-top: 3px; color: var(--pulse-green); font-weight: 700; }
.creation-actions {
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
#accessPanel .creation-actions button {
    gap: 8px;
    min-height: 46px;
    margin-top: 0;
    border-radius: 10px;
    font-size: 14px;
}
.creation-actions .home-arrow { width: 18px; height: 18px; }
#createBack { color: var(--accent-strong); }
#createBack:not(:disabled):hover { background: var(--workspace-canvas); }
.creation-examples {
    display: grid;
    align-content: start;
    gap: 14px;
    padding: clamp(16px, 2vw, 24px);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    background: var(--workspace-canvas);
}
.creation-examples h2 { font-size: 18px; margin: 0 0 2px; color: var(--accent-strong); }
.creation-examples[hidden] { display: none; }
#galleryRetry[hidden] { display: none; }
.creation-step .creation-layout:has(.creation-examples[hidden]) { grid-template-columns: minmax(0, 832px); justify-content: center; }
.creation-examples a {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: white;
    color: var(--panel-label);
    text-decoration: none;
}
.creation-examples a:hover { border-color: var(--accent); text-decoration: underline; }
@media (min-width: 1244px) {
    .creation-step .creation-layout { grid-template-columns: 832px minmax(0, 1fr); }
}
.creation-examples img { display: block; width: 100%; height: auto; }
@media (min-width: 1100px) {
    #accessPanel.creation-step:not(.hidden):has(.creation-examples a:nth-of-type(4)) {
        display: flex;
        flex-direction: column;
    }
    .creation-step .creation-layout { flex: 1; }
    .creation-examples:has(a:nth-of-type(4)) {
        /* The form and viewport set the panel height; thumbnails share the remaining space. */
        contain: size;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto repeat(4, minmax(0, 1fr));
        align-content: stretch;
        gap: 8px;
        padding: 12px 16px;
    }
    .creation-examples a { align-content: start; overflow-wrap: anywhere; }
    .creation-examples:has(a:nth-of-type(4)) a {
        grid-template-rows: minmax(0, 1fr) auto;
        align-content: stretch;
    }
    .creation-examples:has(a:nth-of-type(4)) img { height: 100%; object-fit: contain; }
    .creation-examples:has(a:nth-of-type(4)) a > span { padding-block: 4px; }
}
@media (min-width: 1100px) and (max-height: 950px) {
    body:has(#accessPanel.creation-step:not(.hidden)) .app-shell { padding-block: 12px; }
    #accessPanel .creation-details { padding: 24px; }
}
@media (min-width: 1100px) and (max-height: 800px) {
    body:has(#accessPanel.creation-step:not(.hidden)) .app-shell { padding-block: 8px; }
    #accessPanel .creation-details { padding-block: 12px; }
    .creation-heading {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, max-content);
        align-items: baseline;
        gap: 4px 16px;
        margin-bottom: 10px;
    }
    .creation-heading p:last-child { grid-column: 1 / -1; }
    .creation-heading h1 { margin: 0; font-size: 28px; }
    .creation-heading p { font-size: 14px; line-height: 1.35; }
    .creation-heading .creation-project-name { max-width: 22ch; margin: 0; }
    .creation-fields { row-gap: 10px; }
    .creation-field-heading { margin-bottom: 4px; }
    .creation-field input { min-height: 40px; padding-block: 8px; }
    .creation-details .field-hint { font-size: 13px; }
    .creation-tip { margin-top: 10px; padding-block: 6px; }
    .creation-tip-icon { width: 36px; height: 36px; }
    .creation-tip p { font-size: 13px; }
    .creation-actions { margin-top: 10px; padding-top: 8px; }
    #accessPanel .creation-actions button { min-height: 44px; }
}
.creation-examples a > span {
    display: flex;
    justify-content: space-between;
    padding: 9px 12px;
    font-size: 14px;
    font-weight: 700;
}
@media (max-width: 760px) {
    .creation-step .creation-layout { grid-template-columns: minmax(0, 1fr); }
    .creation-fields { grid-template-columns: minmax(0, 1fr); }
    #accessPanel .creation-actions button { padding-inline: 12px; }
    .creation-examples a { grid-template-columns: minmax(80px, 30%) 1fr; align-items: center; }
}
