/* Shared across every page: index, cozyfit, chat, 404. */
/* ==========================================================
   Retro header: a Netscape 3-style browser chrome.
   Everything is one #c0c0c0 gray; buttons pop with a 3D bevel.
   ========================================================== */
.retro-nav {
    --chrome: #c0c0c0;
    --hi: #ffffff;
    --lo: #808080;
    --shadow: #000000;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "tools tools"
        "loc   logo"
        "dirs  logo";
    gap: 6px 10px;
    padding: 4px 8px 8px;
    background: var(--chrome);
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
    border-bottom: 2px solid var(--lo);
    box-shadow: inset 0 -1px var(--hi);
}

/* Raised bevel (buttons) and pressed bevel */
.retro-tool,
.bookmark-button,
#retro-dropdown {
    background: var(--chrome);
    border: 2px solid;
    border-color: var(--hi) var(--shadow) var(--shadow) var(--hi);
    box-shadow: inset -1px -1px var(--lo), inset 1px 1px #dfdfdf;
    cursor: pointer;
}
.retro-tool:active,
.bookmark-button:active,
#retro-dropdown:active,
#retro-dropdown[aria-expanded="true"] {
    border-color: var(--shadow) var(--hi) var(--hi) var(--shadow);
    box-shadow: inset 1px 1px var(--lo);
}
.retro-tool:focus-visible,
.bookmark-button:focus-visible,
#retro-dropdown:focus-visible {
    outline: 1px dotted #000;
    outline-offset: -5px;
}

/* Row 1: toolbar */
.retro-toolbar {
    grid-area: tools;
    display: flex;
    gap: 2px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--lo);
    box-shadow: 0 1px var(--hi);
}
.retro-tool {
    display: flex;
    padding: 1px;
}
.retro-tool img {
    display: block;
    width: 52px;
    height: 52px;
}
.retro-tool:active img { transform: translate(1px, 1px); }

/* Row 2: Location */
.retro-location {
    grid-area: loc;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.retro-location-icon { width: 22px; height: 22px; }
#retro-location-label { font-size: 14px; white-space: nowrap; }
.retro-url-field {
    position: relative;
    display: flex;
    flex: 1;
    min-width: 0;
    height: 28px;
}
.retro-input {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 2px 6px;
    font: 14px Arial, Helvetica, sans-serif;
    color: #000;
    background: #fff;
    border: 2px solid;
    border-color: var(--lo) var(--hi) var(--hi) var(--lo);
    box-shadow: inset 1px 1px var(--shadow);
    border-radius: 0;
    outline: none;
}
#retro-dropdown {
    width: 22px;
    padding: 0;
    font-size: 11px;
    color: #000;
}

/* Recent pages menu */
.retro-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 20;
    margin: 0;
    padding: 2px 0;
    list-style: none;
    background: #fff;
    border: 1px solid var(--shadow);
    font: 14px Arial, Helvetica, sans-serif;
}
.retro-menu[hidden] { display: none; }
.retro-menu a { display: block; padding: 3px 8px; color: #000; text-decoration: none; }
.retro-menu a:hover, .retro-menu a:focus { background: #000080; color: #fff; }

/* Row 3: directory buttons */
.retro-bookmarks {
    grid-area: dirs;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.bookmark-button {
    display: inline-flex;
    align-items: center;
    padding: 3px 16px;
    color: #000;
    font-family: inherit;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}
.bookmark-button:hover { text-decoration: none; }

/* The logo tile: the animated R in a sunken frame */
.retro-logo {
    grid-area: logo;
    display: block;
    width: 68px;
    height: 68px;
    align-self: center;
    border: 2px solid;
    border-color: var(--lo) var(--hi) var(--hi) var(--lo);
    background: #000;
    overflow: hidden;
}
.retro-logo img { display: block; width: 100%; height: 100%; }

/* Phones: logo moves up beside the toolbar; Location gets the full width */
@media screen and (max-width: 600px) {
    .retro-nav {
        grid-template-areas:
            "tools logo"
            "loc   loc"
            "dirs  dirs";
        padding: 4px 6px 6px;
    }
    .retro-toolbar { border-bottom: 0; box-shadow: none; padding-bottom: 0; }
    .retro-tool img { width: 44px; height: 44px; }
    .retro-logo { width: 52px; height: 52px; }
    .retro-bookmarks { gap: 3px; }
    .retro-location-icon,
    #retro-location-label { display: none; }
    .retro-input { font-size: 16px; } /* 16px stops iOS zooming on focus */
    .bookmark-button { padding: 3px 5px; font-size: 13px; }
}
