/* ==========================================================================
   Ophiuchus shared look. One place for the colours, type and parts taken from the designed boards
   (Roadmap 375). New and rebuilt screens use the oph- classes; older pages keep Bootstrap until rebuilt.
   Colours are the boards' own. Buttons are at least 44 px tall so thumbs on low-cost phones can hit them.
   ========================================================================== */
:root {
    --oph-bg: #F6F7F5;
    --oph-ink: #1A2928;
    --oph-body: #3B4B49;
    --oph-muted: #5A6B69;
    --oph-line: #D8E0DE;
    --oph-card: #FFFFFF;
    --oph-pri: #1F5F5B;
    --oph-pri-d: #134441;
    --oph-soft: #E4EFED;
    --oph-field: #9AA8A6;
    --oph-amber: #FCEFD3;
    --oph-amber-ink: #5A3A00;
    --oph-green: #DCEFE2;
    --oph-green-ink: #1D5A33;
    --oph-red: #F6DCDC;
    --oph-red-ink: #7A1F1F;
    --oph-radius: 16px;
    --oph-radius-s: 12px;
    --oph-font: Figtree, system-ui, "Segoe UI", Roboto, Arial, sans-serif;
}

/* The page area every rebuilt screen sits in: phone first, centred and narrow on a big screen. */
.oph-page {
    font-family: var(--oph-font);
    color: var(--oph-ink);
    width: 100%;
    max-width: 1400px;
    padding: 6px 0 32px;
    /* One column on a phone; on a wide screen the cards sit side by side and fill the width. */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
    gap: 14px;
    align-items: start;
    line-height: 1.45;
}
.oph-page > .oph-title, .oph-page > .oph-sub, .oph-page > .oph-note, .oph-page > .oph-wide { grid-column: 1 / -1; }

.oph-title { font-weight: 700; font-size: 24px; margin: 0; }
.oph-sub { color: var(--oph-muted); font-weight: 600; font-size: 13px; letter-spacing: .04em; margin: -8px 0 0; }
.oph-muted { color: var(--oph-muted); font-size: 14px; }
.oph-page a { color: var(--oph-pri); font-weight: 600; }

.oph-card {
    background: var(--oph-card);
    border: 1px solid var(--oph-line);
    border-radius: var(--oph-radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.oph-card-title { font-weight: 600; font-size: 16px; }
.oph-card p { margin: 0; font-size: 15px; color: var(--oph-body); }

/* Buttons: the main action fills with teal, the second action is outlined. */
.oph-btn {
    min-height: 52px;
    border-radius: var(--oph-radius-s);
    border: 1px solid var(--oph-pri);
    background: var(--oph-card);
    color: var(--oph-pri);
    font-family: inherit;
    font-weight: 700;
    font-size: 17px;
    padding: 0 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.oph-btn-fill { background: var(--oph-pri); color: #fff; border-color: var(--oph-pri); }
.oph-page a.oph-btn-fill { color: #fff; }
.oph-btn:disabled { opacity: .5; cursor: not-allowed; }
.oph-btn:focus-visible, .oph-page input:focus-visible, .oph-page select:focus-visible {
    outline: 3px solid var(--oph-soft);
    outline-offset: 1px;
    box-shadow: 0 0 0 2px var(--oph-pri);
}

/* Fields */
.oph-page label { font-size: 14px; font-weight: 600; display: block; }
.oph-page input, .oph-page select {
    min-height: 48px;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--oph-field);
    border-radius: 10px;
    padding: 0 12px;
    font-family: inherit;
    font-size: 16px;
    color: var(--oph-ink);
    background: var(--oph-card);
}

.oph-page .oph-check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; line-height: 1.45; color: var(--oph-body); }
.oph-page input[type=checkbox] { width: 22px; min-height: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--oph-pri); }

/* Pills: a short status in a coloured capsule. */
.oph-pill {
    align-self: flex-start;
    display: inline-block;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    background: var(--oph-soft);
    color: var(--oph-pri);
}
.oph-pill-amber { background: var(--oph-amber); color: var(--oph-amber-ink); }
.oph-pill-green { background: var(--oph-green); color: var(--oph-green-ink); }
.oph-pill-red { background: var(--oph-red); color: var(--oph-red-ink); }

/* Notes: a calm message with a coloured edge. No red unless something truly failed. */
.oph-note {
    border-radius: var(--oph-radius-s);
    border-left: 4px solid var(--oph-pri);
    background: var(--oph-soft);
    color: var(--oph-body);
    padding: 12px 14px;
    font-size: 15px;
}
.oph-note-warn { border-left-color: #C98A1B; background: var(--oph-amber); color: var(--oph-amber-ink); }
.oph-note-ok { border-left-color: #1E7A4C; background: var(--oph-green); color: var(--oph-green-ink); }
.oph-note-err { border-left-color: #B03A3A; background: var(--oph-red); color: var(--oph-red-ink); }

.oph-price { font-weight: 700; font-size: 26px; }

.oph-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.oph-table th { text-align: left; color: var(--oph-muted); font-weight: 600; padding: 6px 4px; border-bottom: 1px solid var(--oph-line); }
.oph-table td { padding: 8px 4px; border-bottom: 1px solid var(--oph-line); }

.oph-code { font-family: Consolas, "Courier New", monospace; word-break: break-all; }

/* Three dots that come and go while we wait. */
.oph-dots::after { content: "..."; display: inline-block; width: 1.2em; text-align: left; animation: oph-dots 1.2s steps(4, end) infinite; }
@keyframes oph-dots {
    0% { clip-path: inset(0 100% 0 0); }
    100% { clip-path: inset(0 0 0 0); }
}
@media (prefers-reduced-motion: reduce) { .oph-dots::after { animation: none; } }

/* ==========================================================================
   The shell: left panel, top bar and (on phones) a bottom tab bar. On a phone the left panel is a drawer.
   ========================================================================== */
body { background: var(--oph-bg); }

.oph-shell { display: flex; min-height: 100vh; font-family: var(--oph-font); color: var(--oph-ink); background: var(--oph-bg); }
.oph-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.oph-content { flex: 1; padding: 20px; min-width: 0; }
.oph-grow { flex: 1; }
.oph-ico { flex: none; }

.oph-panel {
    width: 264px; flex: none; background: #fff; border-right: 1px solid var(--oph-line);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.oph-panel-head { padding: 18px 20px 10px; display: flex; flex-direction: column; }
.oph-brand { font-weight: 700; font-size: 22px; color: var(--oph-pri); text-decoration: none; }
.oph-brand-sub { font-size: 12px; color: var(--oph-muted); font-weight: 600; letter-spacing: .03em; }
.oph-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; flex: 1; }
.oph-nav-link {
    display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 12px;
    color: var(--oph-body); text-decoration: none; font-weight: 600; font-size: 15px;
    background: none; border: 0; font-family: inherit; cursor: pointer; width: 100%; text-align: left; box-sizing: border-box;
}
.oph-nav-link:hover { background: var(--oph-soft); color: var(--oph-pri-d); }
.oph-nav-link.active { background: var(--oph-soft); color: var(--oph-pri-d); }
.oph-nav-sub { padding-left: 50px; min-height: 40px; font-weight: 500; font-size: 14px; }
.oph-weather summary { list-style: none; }
.oph-weather summary::-webkit-details-marker { display: none; }
.oph-panel-foot { padding: 12px 20px 18px; border-top: 1px solid var(--oph-line); display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.oph-panel-foot .oph-nav-link { padding: 0; }

.oph-top {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 60px; padding: 8px 20px;
    background: #fff; border-bottom: 1px solid var(--oph-line); position: sticky; top: 0; z-index: 20;
}
.oph-date { color: var(--oph-muted); font-size: 14px; font-weight: 600; }
.oph-brand-s { display: none; font-weight: 700; font-size: 19px; color: var(--oph-pri); text-decoration: none; }
.oph-iconbtn { display: none; min-width: 44px; min-height: 44px; border: 0; background: none; color: var(--oph-pri-d); cursor: pointer; align-items: center; justify-content: center; }
.oph-lang {
    min-height: 40px; max-width: 170px; border: 1px solid var(--oph-line); border-radius: 20px; padding: 0 10px;
    font-family: inherit; font-size: 14px; font-weight: 600; background: #fff; color: var(--oph-ink);
}
.oph-logout {
    min-height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid var(--oph-pri); background: #fff;
    color: var(--oph-pri); font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
}
.oph-date { order: -1; }

.oph-tabs { display: none; }
.oph-scrim { display: none; }

@media (max-width: 899px) {
    .oph-iconbtn { display: inline-flex; }
    .oph-brand-s { display: inline; }
    .oph-date { order: 10; flex-basis: 100%; font-size: 13px; }
    .oph-top { padding: 6px 12px; gap: 8px; }
    .oph-lang { max-width: 96px; padding: 0 6px; }
    .oph-logout { padding: 0 12px; }

    .oph-panel {
        position: fixed; left: 0; top: 0; height: 100%; width: min(300px, 86vw); z-index: 40;
        transform: translateX(-100%); transition: transform .18s ease; box-shadow: 0 0 24px rgba(0,0,0,.18);
    }
    .oph-panel.open { transform: none; }
    .oph-scrim.show { display: block; position: fixed; inset: 0; background: rgba(16,24,23,.45); z-index: 35; }

    .oph-content { padding: 14px 14px 88px; }
    .oph-tabs {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff;
        border-top: 1px solid var(--oph-line); padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .oph-tab {
        flex: 1; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
        font-size: 12px; font-weight: 600; color: var(--oph-muted); background: none; border: 0; text-decoration: none;
        font-family: inherit; cursor: pointer;
    }
    .oph-tab.active { color: var(--oph-pri); }
}
@media (prefers-reduced-motion: reduce) { .oph-panel { transition: none; } }

/* Home: status card, report tiles and the set-up list. */
.oph-big { font-size: 20px !important; font-weight: 700 !important; }
.oph-statusrow { display: flex; align-items: center; gap: 16px; }
.oph-statuscol { display: flex; flex-direction: column; gap: 6px; }
.oph-ring { position: relative; width: 92px; height: 92px; flex: none; }
.oph-ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.oph-ring-text strong { font-size: 22px; }
.oph-ring-text span { font-size: 12px; color: var(--oph-muted); margin-top: 2px; }
.oph-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.oph-actions .oph-btn { flex: 1 1 160px; }

.oph-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.oph-tile {
    min-height: 92px; border: 1px solid var(--oph-line); border-radius: var(--oph-radius-s); background: var(--oph-card);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px 4px;
    color: var(--oph-pri-d); text-decoration: none; font-weight: 600; font-size: 14px; text-align: center; position: relative;
}
a.oph-tile:hover { background: var(--oph-soft); }
.oph-page a.oph-tile { color: var(--oph-pri-d); }
.oph-tile-off { background: #F1F4F3; color: var(--oph-muted); }
.oph-tile em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--oph-muted); }

.oph-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.oph-steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--oph-body); }
.oph-dot {
    flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--oph-field);
    display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.oph-steps li.done .oph-dot { background: var(--oph-pri); border-color: var(--oph-pri); }
.oph-dot .oph-ico { width: 16px; height: 16px; }

/* Reports: the recent list, the inline PIN row and the for-me switch. */
.oph-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.oph-rows li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--oph-line); }
.oph-rows li:first-child { border-top: 0; }
.oph-avatar {
    flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--oph-soft); color: var(--oph-pri-d);
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.oph-rowmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.oph-rows .oph-btn { min-height: 44px; font-size: 14px; }
.oph-pinrow { display: flex; gap: 8px; align-items: center; }
.oph-pinrow input { max-width: 140px; }
.oph-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--oph-body); }
.oph-seg { display: flex; background: #E9EEEC; border-radius: 10px; padding: 3px; }
.oph-seg button {
    flex: 1; border: 0; background: transparent; border-radius: 8px; min-height: 40px; padding: 0 14px;
    font-family: inherit; font-weight: 600; font-size: 14px; color: var(--oph-body); cursor: pointer;
}
.oph-seg button.on { background: #fff; color: var(--oph-pri-d); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
