/* ==========================================
   AFO: Style.css (v74.0 - STRIPED APE DASHBOARD OVERHAUL)
   Mission: Deep contrasts, high-impact readiness cards, and crisp layout segregation
   ========================================== */

:root {
    --shop-black: #080808;
    --steel-gray: #121212;
    --tool-teal: #00a896;
    --safety-orange: #ff6b35;
    --danger-red: #d90429;
    --go-green: #2ec4b6;
    --text-main: #f8f9fa;
    --text-dim: #8d99ae;
    --border-dim: #2b2d42;
    --btn-primary-text: #080808;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

html {
    /* Belt-and-suspenders alongside body's own overflow-x:clip below — a fixed-position
       overlay (e.g. the Buy List) can still make the viewport itself scrollable if only
       body clips and html doesn't, since fixed elements are positioned against the
       viewport/root, not against body. Real overflow reported live 2026-07-10. */
    overflow-x: clip;
}

body {
    background-color: var(--shop-black);
    color: var(--text-main);
    font-family: var(--font-stack);
    margin: 0;
    padding: 0;
    padding-bottom: 80px;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    overflow-x: clip; /* clip prevents horizontal scroll without creating a scroll container, which lets position:sticky work on the header */
}

/* --- HEADER & CONTROLS --- */
header {
    background-color: var(--steel-gray);
    border-bottom: 2px solid var(--border-dim);
    /* Matches #hc-dashboard's 900px content cap (2026-09-08) so the title and the mic sit with the
       content instead of a screen apart at either edge. The BAR stays full width — only its
       contents are inset — so the header still reads as a band across the top.
       Plain declaration first as the fallback for engines without CSS max(). */
    padding: 12px 15px;
    padding: 12px max(15px, calc(50% - 450px));
    position: fixed;
    top: 44px; /* sits below the 44px #global-top-strip injected by Manual.js */
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 1000;
}

header h1 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: -0.5px;
    display: inline-block;
    white-space: nowrap;
}

.header-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

/* --- CORE BUTTONS --- */
.btn, button, .edit-btn {
    background-color: #1e1e1e;
    color: var(--text-main);
    border: 1px solid #333;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    -webkit-user-select: none;
    user-select: none;
}

.btn.primary {
    background-color: var(--tool-teal);
    color: var(--btn-primary-text);
    border-color: var(--tool-teal);
    font-weight: 900;
}

.btn:active, button:active, .edit-btn:active {
    filter: brightness(0.85);
    transform: scale(0.98);
}

.wake-active {
    background-color: #ffb703 !important;
    color: #000 !important;
    border-color: #fff !important;
    font-weight: 900;
}

/* --- DASHBOARD COMMANDER LAYOUT --- */
#afo-dashboard-commander {
    padding: 15px;
    max-width: 800px;
    margin: 0 auto;
}

.dash-card {
    background: var(--steel-gray);
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.dash-card-title {
    font-size: 0.8rem;
    font-weight: 900;
    color: var(--tool-teal);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meal-action-row {
    background: #0a0a0a;
    border: 1px solid #222;
    border-left: 4px solid var(--safety-orange);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.meal-action-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.meal-slot-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-weight: bold;
}

.meal-recipe-title {
    font-size: 1.1rem;
    font-weight: 900;
    color: #fff;
}

/* --- SEARCH & INPUTS --- */
input[type="text"], input[type="number"], select {
    background-color: var(--shop-black);
    color: var(--text-main);
    border: 1px solid var(--border-dim);
    padding: 10px 12px;
    font-size: 0.95rem;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: inherit;
}

input[type="text"]:focus, input[type="number"]:focus, select:focus {
    border-color: var(--tool-teal);
    outline: none;
}

/* --- BLUEPRINT DESIGNER (HIDDEN BY DEFAULT) --- */
#afo-blueprint-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

#breadcrumb {
    font-size: 0.75rem;
    color: var(--text-dim);
    padding: 10px 15px;
    background: #0d0d0d;
    border-bottom: 1px solid #1a1a1a;
    font-family: monospace;
}

.panel {
    background-color: var(--steel-gray);
    border: 1px solid var(--border-dim);
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
}

.node-item {
    background-color: var(--steel-gray);
    border: 1px solid var(--border-dim);
    margin-bottom: 8px;
    padding: 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.node-content {
    font-size: 0.95rem;
    line-height: 1.3;
}

.node-type-tag {
    font-size: 0.65rem;
    background-color: #222;
    color: var(--text-dim);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
}

/* --- QUANTITY STEPPERS --- */
.inline-qty-wrap {
    display: inline-flex;
    align-items: center;
    background: #000;
    border: 1px solid #333;
    border-radius: 4px;
    margin-top: 6px;
    overflow: hidden;
}

.inline-step {
    background: #111;
    color: var(--tool-teal);
    border: none;
    padding: 4px 10px;
    font-weight: bold;
    cursor: pointer;
}

.inline-val {
    padding: 0 10px;
    font-size: 0.85rem;
    font-weight: bold;
    font-family: monospace;
}

/* --- STATUS DOTS --- */
.status-toggle-wrap {
    display: inline-flex;
    gap: 4px;
    margin-top: 6px;
    margin-left: 10px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #000;
    padding: 0;
    cursor: pointer;
    opacity: 0.3;
}

.status-dot.active {
    opacity: 1;
    box-shadow: 0 0 6px currentColor;
}

/* --- MODALS & OVERLAYS --- */
.template-modal {
    background-color: var(--steel-gray);
    border: 2px solid;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    box-sizing: border-box;
}

/* --- PRINT GRIDS --- */
.sticker-grid-layout {
    display: grid;
    gap: 10px;
    padding: 15px;
    background: white;
    color: black;
}

.label-cell {
    border: 2px solid black;
    padding: 10px;
    text-align: center;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
}

.label-text {
    font-size: 14pt;
    font-weight: bold;
    margin-top: 5px;
    font-family: Arial, sans-serif;
}