/* App hosting page (pages/app-hosting.html). It is built from the bot page's
   components (bot-hosting.css) and chapter.css; this file only adds what the
   bot page has no component for: the live site beside the hero's console,
   template covers, and the panel's instance cards, log viewer and code
   editor, each drawn from nextclient's own styles. */

/* The visitor's view of the app, in the card bot-hosting.css floats beside
   the hero's console */
.ah-site {
    padding: 18px 20px 22px;
    background: #10111c;
}

.ah-site-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.6);
}

.ah-site-nav b {
    margin-right: auto;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.ah-site-title {
    margin: 22px 0 0;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #fff;
}

.ah-site-text {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.66);
}

.ah-site-btn {
    display: inline-flex;
    align-items: center;
    height: 32px;
    margin-top: 16px;
    padding: 0 14px;
    border-radius: 8px;
    background: #f5b942;
    font-size: 12.5px;
    font-weight: 700;
    color: #0b111b;
}

.ah-site-posts {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.ah-site-posts li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 13px;
    color: #fff;
}

.ah-site-posts time {
    flex: none;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* Template covers, in the colours of what each template runs */
.ah-cover-nextjs { background-color: #1f2937; }
.ah-cover-react { background-color: #0e7490; }
.ah-cover-express { background-color: #3f6212; }
.ah-cover-fastapi { background-color: #047857; }
.ah-cover-flask { background-color: #334155; }
.ah-cover-hono { background-color: #c2410c; }
.ah-cover-php { background-color: #4f5b93; }
.ah-cover-static { background-color: #1d4ed8; }
.ah-cover-chat { background-color: #7c3aed; }
.ah-cover-status { background-color: #15803d; }

/* The language picker's console runs the height of the list, its facts
   and tip at the bottom */
.ah-lang-console > :not([hidden]) {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.ah-lang-console .bh-term {
    flex: 1;
}

/* Two facts per language: packages and templates */
@media (min-width: 768px) {
    .ah-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Instances, as the panel's instance cards draw them */
.ah-instances {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.ah-instance {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border-radius: 16px;
    background: #1b2333;
}

.ah-instance.is-active {
    background: #1c2e36;
}

.ah-instance-head {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ah-instance-head .bh-tile {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 20px;
}

.ah-instance-head b {
    display: block;
    font-size: 15.5px;
    font-weight: 700;
    color: #fff;
}

.ah-instance-head b + span {
    display: block;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.6);
}

.ah-instance-head .bh-chip {
    margin-left: auto;
}

.ah-instance-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.ah-instance-facts div {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}

.ah-instance-facts dt {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.ah-instance-facts dd {
    margin: 2px 0 0;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.ah-instance .bh-pbtn {
    min-height: 40px;
    border-radius: 10px;
}

/* The log viewer */
.ah-log-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.ah-log-bar .bh-chip:not([class*="is-"]) {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
}

.ah-log-bar .bh-pbtn {
    margin-left: auto;
}

.ah-log {
    margin: 12px 0;
    padding: 6px 0;
    list-style: none;
    counter-reset: line;
    border-radius: 12px;
    background: #1b1e2a;
    font-family: "SF Mono", Monaco, ui-monospace, monospace;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.86);
}

.ah-log li {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    margin: 0 6px;
    padding-right: 10px;
    overflow: hidden;
    border-radius: 6px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ah-log li::before {
    flex: none;
    width: 28px;
    counter-increment: line;
    content: counter(line);
    font-size: 11px;
    text-align: right;
    color: #6b7280;
}

.ah-log span {
    color: #9ca3af;
}

.ah-log b {
    font-weight: 700;
}

.ah-log .is-info { color: #60a5fa; }
.ah-log .is-warn { color: #f59e0b; }
.ah-log .is-error { color: #ef4444; }
.ah-log li.is-warn { background: rgba(245, 158, 11, 0.08); color: inherit; }
.ah-log li.is-error { background: rgba(239, 68, 68, 0.08); color: inherit; }

/* The API call under the key that makes it */
.ah-code {
    margin-top: 12px;
}

/* The panel's code editor, with a teammate's cursor and the file's history */
.ah-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #171b25;
}

.ah-editor-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: #1c2230;
}

.ah-editor-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
    font-size: 13px;
    font-weight: 500;
    color: rgba(245, 247, 250, 0.92);
}

.ah-editor-file i {
    color: #58a6ff;
}

.ah-editor-ai {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(136, 119, 218, 0.14);
    font-size: 13px;
    color: #ded6ff;
}

.ah-editor-body {
    display: grid;
    flex: 1;
    grid-template-columns: minmax(0, 1fr) 170px;
}

.ah-editor-code {
    margin: 0;
    padding: 12px 0;
    overflow: hidden;
    list-style: none;
    counter-reset: line;
    font-family: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
    font-size: 12px;
    line-height: 1.95;
    color: #e6edf3;
}

.ah-editor-code li {
    white-space: pre;
}

.ah-editor-code li::before {
    display: inline-block;
    width: 30px;
    margin-right: 12px;
    counter-increment: line;
    content: counter(line);
    text-align: right;
    color: rgba(255, 255, 255, 0.3);
}

.ah-editor-code b {
    font-weight: 400;
    color: #ff7b72;
}

.ah-editor-code i {
    font-style: normal;
    color: #d2a8ff;
}

.ah-editor-peer {
    background: color-mix(in srgb, var(--peer) 10%, transparent);
}

.ah-editor-peer span {
    position: relative;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 10px;
    background: var(--peer);
    font-family: Inter, sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    color: #fff;
}

.ah-editor-peer span::before {
    content: "";
    position: absolute;
    top: -3px;
    bottom: -3px;
    left: -6px;
    width: 2px;
    background: var(--peer);
}

.ah-editor-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.ah-editor-history p {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 4px;
    font-size: 12.5px;
    font-weight: 600;
    color: #fff;
}

.ah-editor-history div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ah-editor-history .bh-avatar {
    width: 26px;
    height: 26px;
    font-size: 11px;
}

.ah-editor-history b {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: #fff;
}

.ah-editor-history small {
    display: block;
    font-size: 11px;
    color: rgba(220, 215, 255, 0.75);
}

.ah-editor-history code {
    display: block;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.18);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.ah-editor-history ins,
.ah-editor-history del {
    text-decoration: none;
}

.ah-editor-history ins { color: #3fb950; }
.ah-editor-history del { color: #f85149; }

@media (max-width: 767.98px) {
    .ah-instances,
    .ah-editor-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .ah-editor-history {
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        border-left: 0;
    }

    /* A proxy's badges move under its address */
    .ah-proxy {
        flex-wrap: wrap;
        row-gap: 10px;
    }

    .ah-proxy .bh-row-text {
        flex-basis: calc(100% - 54px);
    }

    .ah-proxy .bh-row-text + .bh-chip {
        margin-left: 54px;
    }

    .ah-proxy .bh-switch {
        margin-left: auto;
    }
}

