/* The shell's own layout: the rail beside the app slot, both widths.
 *
 * The font faces and the shared tokens are in faces.css, imported here so a
 * page linking app.css has them, and linked on its own by an app (through
 * /kit/1/theme.js), which has a layout of its own.
 * Palette colours (--p-*) are in neither: palettes.js is the one source and
 * injects them as a <style> at start, keyed by data-palette on the root. */

@import url('faces.css');

:root {
    --rail-w: 300px;
}

html, body { height: 100%; margin: 0; }

body {
    display: grid;
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    background: var(--p-bg);
    color: var(--p-ink);
    font: 14px/1.45 var(--font-ui);
}

hud-rail {
    display: block;
    height: 100vh;
    overflow: auto;
    border-right: 1px solid var(--p-muted);
    box-sizing: border-box;
}

#app {
    position: relative;
    height: 100vh;
    min-width: 0;
}

/* One app in the slot at a time; home when there is none. */
#app .app, #app hud-home {
    position: absolute;
    inset: 0;
}
#app .app[hidden], #app hud-home[hidden] { display: none; }
/* The texts step of signing in covers the slot until it is answered. */
#app hud-texts { position: absolute; inset: 0; z-index: 2; }
#app hud-texts[hidden] { display: none; }

#app iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: var(--p-bg);
}

@media (max-width: 800px) {
    body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 100vh; }
    hud-rail { height: auto; max-height: 75vh; border-right: 0; border-bottom: 1px solid var(--p-muted); }
    #app { height: auto; min-height: 0; }
}
