/* ================================================================
   FriendsByChance — main.css
   Earthy/neutral palette, Material-inspired layout
   ================================================================ */

/* --- Variables ------------------------------------------------- */
:root {
    --color-primary:        #4A7C59;
    --color-primary-dark:   #2D5A3D;
    --color-primary-light:  #7AAB8A;
    --color-secondary:      #7D5A4F;
    --color-bg:             #FAF6F0;
    --color-surface:        #FFFFFF;
    --color-text-on-primary:#FFFFFF;
    --color-text-primary:   #3E2723;
    --color-text-secondary: #6D4C41;
    --color-divider:        #E8DDD0;

    /* Shared interaction tokens — consumed by every component stylesheet.
       They MUST live here (the first sheet loaded), not in a feature sheet,
       or a page rendered without that feature's CSS loses them. */
    --color-text:           var(--color-text-primary);
    --color-text-muted:     #888888;
    --color-danger:         #c0392b;
    --color-hover:          rgba(74, 124, 89, 0.07);
    --color-selected:       rgba(74, 124, 89, 0.14);
    --color-border:         var(--color-divider);
    --color-input-bg:       var(--color-surface);

    --top-bar-height:       56px;
    --drawer-width:         280px;
    --transition:           0.25s ease;

    /* ── App shell geometry ──────────────────────────────────────────
       Every page except The Map is capped at --fbc-total-max-w and
       centred, leaving empty bands at the sides on wide screens.  The
       top bar is capped to the same width, so the bar and the pane
       group read as one column.

       --fbc-menu-w-current is 0 until FBC.shell decides there is room
       for the navigation to become a pane of its own; it then sets
       :root.fbc-menu-pane and the whole column widens to include it.
       Deriving it this way keeps ONE number to reason about: every
       consumer reads --fbc-total-max-w and is automatically correct in
       both states.                                                    */
    /* 337: the time section's title row in one line — its fold, the
       "no dates" toggle, Back, three presets and "+" (the user, 2026-11-01). */
    --fbc-left-w:           337px;
    /* The right pane opens this wide; the user may drag it between its
       least and its most (718: what a page's content used to be — "keep
       that link", 2026-11-01), never more than half the window
       (pane-layout.js) — their width is set
       here, on :root, as --fbc-right-w (see the note on :root below). */
    --fbc-right-default-w:  360px;
    --fbc-right-min-w:      300px;
    --fbc-right-w:          var(--fbc-right-default-w);
    --fbc-right-max-w:      718px;
    /* 792: about 10% over the 720 it was, so two chats fit side by side
       in the main pane (the user, 2026-11-01). */
    --fbc-main-max-w:       792px;
    /* A chat pane on the Chat page, the least it may be: up to four share
       the main pane — two side by side, two rows — where each still gets
       this much (js/chat-page.js; the user, 2026-11-01).  Its width is the
       right pane's least: a chat is never narrower anywhere ("consistency
       in the min width, everywhere"). */
    --fbc-chat-pane-min-w:  var(--fbc-right-min-w);
    --fbc-chat-pane-min-h:  400px;
    --fbc-menu-pane-w:      240px;
    /* A full-width page (The Map) earns the navigation pane only when its
       main pane would still get this many times the usual main width: a
       map squeezed to make room for a menu is a worse map, and the drawer
       is one press away.  A plain number, read by FBC.shell. */
    --fbc-fullwidth-main-factor: 1.6;
    --fbc-menu-w-current:   0px;
    --fbc-shell-max-w:      calc(var(--fbc-left-w) + var(--fbc-main-max-w) + var(--fbc-right-w));
    --fbc-total-max-w:      calc(var(--fbc-shell-max-w) + var(--fbc-menu-w-current));
    /* Width of ONE empty side band. Used to keep viewport-fixed chrome
       (the chat panel) tucked against the shell instead of floating out
       in the band. */
    --fbc-band-w:           max(0px, calc((100vw - var(--fbc-total-max-w)) / 2));

    /* The grip a row is dragged by (.fbc-drag-handle): wider where the
       pointer is a finger.  A host that leaves room for it reads this. */
    --fbc-grip-w:           20px;
    /* A chip's height — every kind of chip (a tag-like, a person, a chat):
       narrow (the user, 2026-11-02: 32 px "too big now and ugly" — back near
       the old 24); its words are made readable by their weight and halo
       (.tl-chip), not by its size. */
    --fbc-chip-h:           26px;
    /* A TILE (components/tile-view.js): its row's height in the Normal
       height — the Taller one twice it — and the room round each tile
       (the tile background a group of My Journeys' tiles is shaded in).
       A tile's width is the left pane's (--fbc-left-w): it fits under it. */
    --fbc-tile-h:           168px;
    --fbc-tile-gap:         8px;
    /* The room always left under the left pane's head before the tiles
       under it (the user, 2026-11-02: "there should always be some padding"). */
    --fbc-tiles-dent-gap:   12px;
}
@media (pointer: coarse) {
    :root { --fbc-grip-w: 32px; --fbc-chip-h: 28px; }
}

/* The menu-pane toggle MUST live on the same element that declares the
   derived tokens above (:root).  A custom property containing var() is
   substituted at the element where it is DECLARED, so overriding
   --fbc-menu-w-current on <body> would leave --fbc-total-max-w and
   --fbc-band-w inherited from :root with the old 0px already baked in.
   FBC.shell therefore toggles these classes on document.documentElement,
   not document.body.  Do not "tidy" this onto body. */
:root.fbc-menu-pane {
    --fbc-menu-w-current: var(--fbc-menu-pane-w);
}

/* --- Reset ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* The `hidden` attribute ALWAYS hides.  The browser's own [hidden] rule is
   a plain `display: none`, which any class that sets `display` (flex,
   block, …) beats — so an element hidden from JS stayed on screen.  Thirty
   stylesheets each carried their own override for it, and each one
   forgotten was a bug: the hamburger with the menu already a pane, the QR
   button shown to visitors.  One rule here, for every element. */
[hidden] { display: none !important; }

/* Form fields take the app's font, like everything else.  Browsers give
   them their own (a text area: monospace) instead of inheriting it, and
   twenty stylesheets patched it field by field — every field forgotten
   kept the browser's (the journey editor's name and description, until
   2026-10-21).  One rule here, never per field. */
input, textarea, select, button { font-family: inherit; }

body {
    font-family: Roboto, 'Segoe UI', Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text-primary);
    overflow-x: hidden;
}

/* --- Boot overlay ----------------------------------------------
   Opaque and above everything, so nothing can be clicked while the app
   is still wiring itself up.  In main.css because this is the only sheet
   guaranteed to have loaded when the overlay first paints. */
.fbc-boot {
    position:        fixed;
    inset:           0;
    z-index:         10000;
    display:         flex;
    align-items:     center;
    justify-content: center;
    background:      var(--color-bg);
    transition:      opacity 0.18s ease;
}
.fbc-boot--done { opacity: 0; pointer-events: none; }

.fbc-boot-spinner {
    width:            34px;
    height:           34px;
    border:           3px solid var(--color-divider);
    border-top-color: var(--color-primary);
    border-radius:    50%;
    animation:        fbc-boot-spin 0.8s linear infinite;
}
@keyframes fbc-boot-spin { to { transform: rotate(360deg); } }

/* --- Top bar ---------------------------------------------------
   The band itself is capped and centred (not merely its contents), so
   it lines up exactly with the pane group beneath it. */
.top-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    margin: 0 auto;
    max-width: var(--fbc-total-max-w);
    height: var(--top-bar-height);
    background: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
/* The Map uses the full window; its bar must follow. */
:root.fbc-fullwidth-page .top-bar { max-width: none; }

/* The app's name and who is signed in: the room the buttons leave — the
   first thing to give way on a narrow bar, the buttons being what the bar
   is for.  How it gives way: FBC.shell._fitBrand (the classes below). */
.top-bar-brand {
    flex:        1 1 0;
    min-width:   0;
    display:     flex;
    align-items: center;
    gap:         10px;
    overflow:    hidden;
    white-space: nowrap;
}
.top-bar-title {
    flex:        none;
    color: var(--color-text-on-primary);
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}
.top-bar-title-short                         { display: none; }
.top-bar-brand--short .top-bar-title-full    { display: none; }
.top-bar-brand--short .top-bar-title-short   { display: inline; }
.top-bar-brand--no-handle .top-bar-user-handle { display: none; }
.top-bar-brand--no-title .top-bar-title      { display: none; }
/* No room even then: the bar's other buttons behind "+" (#top-bar-more). */
.top-bar--compact .top-bar-extra             { display: none; }

/* Who is signed in: a button — their business card (FBC.profile.openCard). */
.top-bar-user {
    flex:          0 1 auto;
    min-width:     0;
    display:       flex;
    align-items:   baseline;
    gap:           6px;
    padding:       6px 10px;
    border:        none;
    border-radius: 6px;
    background:    rgba(255, 255, 255, 0.12);
    color:         var(--color-text-on-primary);
    cursor:        pointer;
}
.top-bar-user:hover         { background: rgba(255, 255, 255, 0.22); }
.top-bar-user:focus-visible { outline: 2px solid var(--color-text-on-primary); outline-offset: 2px; }
.top-bar-user-name {
    /* Never cut under its first three letters and "…" (FBC.shell.setUser measures them). */
    min-width:     var(--top-bar-name-least, 0px);
    overflow:      hidden;
    text-overflow: ellipsis;
    font-size:     0.95rem;
    font-weight:   500;
}
.top-bar-user-handle { flex: none; font-size: 0.82rem; opacity: 0.8; }
/* Judging the room (FBC.shell._fitBrand): everything at its full width —
   or, --least, the name at the least it may be cut to. */
.top-bar-brand--measure > *,
.top-bar-brand--measure .top-bar-user-name { flex-shrink: 0; min-width: max-content; }
.top-bar-brand--measure.top-bar-brand--least .top-bar-user-name {
    min-width: var(--top-bar-name-least, 0px);
    max-width: var(--top-bar-name-least, none);
}

/* "+"'s overlay (FBC.shell._openMore): the bar's own buttons on the bar's
   colour, as they are in it; open so the language list can drop out of it. */
.fbc-popover.top-bar-more-pop {
    max-width:    calc(100vw - 16px);
    padding:      6px;
    background:   var(--color-primary);
    border-color: var(--color-primary-dark);
    overflow:     visible;
}
.top-bar-more-strip          { display: flex; align-items: center; gap: 6px; }
.top-bar-more-strip > *      { margin: 0; }

/* --- Pane toggle buttons in top bar (managed by pane-layout.js) - */
.top-bar-icon-btn {
    background:    none;
    border:        none;
    cursor:        pointer;
    padding:       8px;
    width:         38px;
    height:        38px;
    display:       flex;
    align-items:   center;
    justify-content: center;
    border-radius: 4px;
    color:         var(--color-text-on-primary);
    flex-shrink:   0;
}
/* Space is always reserved; button is invisible (not absent) when no pane to toggle */
.top-bar-icon-btn.fbc-pane-btn-invisible {
    visibility:     hidden;
    pointer-events: none;
}
.top-bar-icon-btn:focus-visible {
    outline:        2px solid var(--color-text-on-primary);
    outline-offset: 2px;
}
.top-bar-icon-btn:hover { background: rgba(255, 255, 255, 0.15); }

/* --- Right-pane view buttons (pane-layout.js) -----------------
   The far right of the bar: one slot per view, always reserved so the
   buttons to their left stay put from page to page. */
.fbc-view-btns {
    display:     flex;
    align-items: center;
    gap:         4px;
    flex-shrink: 0;
}
.fbc-view-btn               { position: relative; }
.fbc-view-btn--empty        { visibility: hidden; pointer-events: none; }
.fbc-view-btn--on           { background: rgba(255, 255, 255, 0.24); }
.fbc-view-btn--on:hover     { background: rgba(255, 255, 255, 0.30); }
/* The pane kept open where there is room (pane-layout.js): greyed, still
   pressable — it says why. */
.fbc-view-btn--kept         { opacity: 0.45; }
.fbc-view-btn-badge {
    position:        absolute;
    top:             2px;
    right:           2px;
    min-width:       16px;
    height:          16px;
    padding:         0 3px;
    border-radius:   8px;
    background:      #D32F2F;
    color:           #fff;
    font-size:       0.65rem;
    font-weight:     700;
    line-height:     16px;
    text-align:      center;
}

/* --- Hamburger button ------------------------------------------ */
.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-radius: 4px;
}

.hamburger-btn:focus-visible {
    outline: 2px solid var(--color-text-on-primary);
    outline-offset: 2px;
}
/* The menu pinned beside the page: nothing to open (FBC.shell). */
.hamburger-btn:disabled { opacity: 0.4; cursor: default; }

.hamburger-icon {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text-on-primary);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

/* Animate hamburger → X when drawer is open */
.hamburger-btn[aria-expanded="true"] .hamburger-icon:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger-btn[aria-expanded="true"] .hamburger-icon:nth-child(2) {
    opacity: 0;
}
.hamburger-btn[aria-expanded="true"] .hamburger-icon:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --- Drawer overlay --------------------------------------------
   Under the top bar, as the drawer is: the bar stays in reach — its
   hamburger closes the drawer as it opened it (the user, 2026-10-31). */
.drawer-overlay {
    position: fixed;
    inset: var(--top-bar-height) 0 0 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* --- Global nav drawer (N_GlobalHM) ----------------------------
   Under the top bar and its hamburger: at the column's left edge (the
   bar is centred with it), the window's on a page as wide as the window. */
.global-nav {
    position: fixed;
    top: var(--top-bar-height); left: var(--fbc-band-w); bottom: 0;
    width: var(--drawer-width);
    background: var(--color-bg);
    z-index: 300;
    transform: translateX(-100%);
    transition: transform var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

.global-nav.open {
    transform: translateX(0);
}
:root.fbc-fullwidth-page .global-nav { left: 0; }
/* Closed, it slides away under the band beside the column — never seen there. */
.global-nav:not(.open) { visibility: hidden; transition: transform var(--transition), visibility 0s var(--transition); }

/* The menu (nav.js): the same list in the drawer and in the menu pane —
   its look in auth.css (.nav-*); here only that it fills its home and
   scrolls, its items a column so Log out can sit at its foot. */
.nav-menu {
    list-style: none;
    padding: 8px 8px 12px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* --- Landing page (N_LP) ---------------------------------------
   Lives inside .fbc-shell-main like every other page, so it inherits
   the shell's max-width and centring instead of spanning the window.
   The shell already sits below the top bar — hence no margin-top. */
.landing-page {
    position:   absolute;
    inset:      0;
    overflow-y: auto;
    padding:    16px;
}

/* --- QR top-bar button (070) ----------------------------------- */
.qr-top-btn {
    margin-left:   auto;
    background:    none;
    border:        none;
    cursor:        pointer;
    padding:       8px;
    display:       flex;
    align-items:   center;
    justify-content: center;
    border-radius: 4px;
    color:         var(--color-text-on-primary);
}
.qr-top-btn:focus-visible {
    outline:        2px solid var(--color-text-on-primary);
    outline-offset: 2px;
}
.qr-top-btn:hover { background: rgba(255,255,255,0.15); }

/* --- Notification widget (070) --------------------------------- */
.notif-wrap {
    display:     flex;
    align-items: center;
    gap:         4px;
    position:    relative;
}
.notif-reload-btn,
.notif-btn {
    background:    none;
    border:        none;
    cursor:        pointer;
    padding:       8px;
    display:       flex;
    align-items:   center;
    justify-content: center;
    border-radius: 4px;
    color:         var(--color-text-on-primary);
    position:      relative;
}
.notif-reload-btn:focus-visible,
.notif-btn:focus-visible {
    outline:        2px solid var(--color-text-on-primary);
    outline-offset: 2px;
}
.notif-badge {
    position:    absolute;
    top:         4px;
    right:       4px;
    background:  #D32F2F;
    color:       #fff;
    font-size:   0.65rem;
    font-weight: 700;
    line-height: 1;
    min-width:   16px;
    height:      16px;
    border-radius: 8px;
    padding:     0 3px;
    display:     flex;
    align-items: center;
    justify-content: center;
}
.notif-overlay {
    position:      absolute;
    top:           calc(100% + 6px);
    right:         0;
    width:         340px;
    max-height:    420px;
    background:    var(--color-surface);
    border:        1px solid var(--color-divider);
    border-radius: 8px;
    box-shadow:    0 6px 20px rgba(0,0,0,0.18);
    z-index:       400;
    display:       flex;
    flex-direction: column;
    overflow:      hidden;
}
.notif-item {
    display:     flex;
    align-items: flex-start;
    gap:         10px;
    padding:     10px 14px;
    border-bottom: 1px solid var(--color-divider);
    cursor:      pointer;
    transition:  background 0.15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover      { background: var(--color-bg); }
.notif-item.notif-unread     { background: #F0F7F2; }
.notif-item.notif-unread:hover { background: #E5F0E8; }
.notif-avatar {
    width:         36px;
    height:        36px;
    border-radius: 50%;
    object-fit:    cover;
    flex-shrink:   0;
    background:    var(--color-divider);
}
.notif-body {
    flex:     1;
    min-width: 0;
}
.notif-title {
    font-size:  0.85rem;
    color:      var(--color-text-primary);
    line-height: 1.3;
}
.notif-ts {
    font-size: 0.75rem;
    color:     var(--color-text-secondary);
    margin-top: 2px;
}
.notif-dismiss {
    background:    none;
    border:        none;
    cursor:        pointer;
    color:         var(--color-text-secondary);
    font-size:     1.1rem;
    line-height:   1;
    padding:       2px 4px;
    border-radius: 4px;
    flex-shrink:   0;
    align-self:    flex-start;
}
.notif-dismiss:hover { color: var(--color-text-primary); }
.notif-empty {
    padding:    24px 16px;
    text-align: center;
    font-size:  0.85rem;
    color:      var(--color-text-secondary);
}

/* --- Language switcher ----------------------------------------- */
.lang-switcher {
    position: relative;
}
.lang-btn {
    background:    none;
    border:        none;
    cursor:        pointer;
    padding:       8px;
    display:       flex;
    align-items:   center;
    border-radius: 4px;
    color:         var(--color-text-on-primary);
}
/* ── The clock (js/clock.js): the user's time, just left of the QR
   button; its bottom border says whether anything is off with the zone.
   The colours are bright for the top bar's green — the overlay draws the
   same five in its own (.fbc-clock-dot).  It starts the bar's right-hand
   group, so it takes the QR button's auto margin while it is there. */
.fbc-clock {
    margin-left:    auto;
    background:     none;
    border:         none;
    border-bottom:  3px solid transparent;
    cursor:         pointer;
    padding:        6px 6px 3px;
    color:          var(--color-text-on-primary);
    font:           inherit;
    font-size:      0.9rem;
    font-weight:    600;
    font-variant-numeric: tabular-nums;
    white-space:    nowrap;
}
.fbc-clock + .qr-top-btn { margin-left: 0; }
.fbc-clock:focus-visible { outline: 2px solid var(--color-text-on-primary); outline-offset: 2px; }
.fbc-clock--green  { border-bottom-color: #9be7a8; }
.fbc-clock--blue   { border-bottom-color: #7cc0ff; }
.fbc-clock--purple { border-bottom-color: #d0a6ff; }
.fbc-clock--orange { border-bottom-color: #ffb454; }
.fbc-clock--red    { border-bottom-color: #ff7a7a; }
/* This device's clock itself wrong: red all round, whatever the zone —
   the same size as underlined (3 px of border for 3 px of padding). */
.fbc-clock.fbc-clock--skewed { border: 3px solid #ff7a7a; padding: 3px; }

/* ── The clock's overlay (FBC.clock.openOverlay) ──────────────────
   The clock first, as a card; then the choice of zone; then how it is
   detected; what the colours mean, folded, last.  Its status colours are
   the top bar's, darker for a light ground. */
.fbc-clock-sheet {
    display:        flex;
    flex-direction: column;
    gap:            22px;
}

/* The clock: the time, large, underlined in its status colour as the top
   bar's is — red all round when this device's clock is wrong. */
.fbc-clock-card {
    display:        flex;
    flex-direction: column;
    align-items:    flex-start;
    gap:            4px;
    padding:        16px 18px;
    border:         1px solid var(--color-divider);
    border-radius:  12px;
    background:     var(--color-surface);
}
.fbc-clock-face-time {
    font-size:     2.4rem;
    font-weight:   700;
    line-height:   1.15;
    font-variant-numeric: tabular-nums;
    color:         var(--color-text);
    border-bottom: 4px solid transparent;
    padding-bottom: 2px;
}
.fbc-clock-card--green  .fbc-clock-face-time { border-bottom-color: #2e9e44; }
.fbc-clock-card--blue   .fbc-clock-face-time { border-bottom-color: #2b7bd6; }
.fbc-clock-card--purple .fbc-clock-face-time { border-bottom-color: #8a4fd8; }
.fbc-clock-card--orange .fbc-clock-face-time { border-bottom-color: #e08a00; }
.fbc-clock-card--red    .fbc-clock-face-time { border-bottom-color: #d23c3c; }
.fbc-clock-card--skewed { border: 2px solid #d23c3c; }
.fbc-clock-card-day  { margin-top: 4px; font-size: 1rem; color: var(--color-text); }
.fbc-clock-card-zone { font-size: 0.88rem; color: var(--color-text-secondary); }

/* This device's clock is wrong: said in the clock, under its time. */
.fbc-clock-skew {
    align-self:    stretch;
    margin-top:    10px;
    padding:       10px 12px;
    border-radius: 8px;
    background:    rgba(210, 60, 60, 0.08);
}
.fbc-clock-skew-text { margin: 0 0 8px; line-height: 1.45; font-size: 0.88rem; }

/* What is in force, in words: the card's last line. */
.fbc-clock-status {
    align-self:  stretch;
    display:     flex;
    align-items: flex-start;
    gap:         10px;
    margin-top:  12px;
    padding-top: 12px;
    border-top:  1px solid var(--color-divider);
}
.fbc-clock-status-text { margin: 0; font-size: 0.88rem; line-height: 1.45; color: var(--color-text); }
.fbc-clock-dot {
    flex:          0 0 auto;
    width:         10px;
    height:        10px;
    margin-top:    5px;
    border-radius: 50%;
    background:    #999;
}
.fbc-clock-status--green  .fbc-clock-dot, .fbc-clock-dot--green  { background: #2e9e44; }
.fbc-clock-status--blue   .fbc-clock-dot, .fbc-clock-dot--blue   { background: #2b7bd6; }
.fbc-clock-status--purple .fbc-clock-dot, .fbc-clock-dot--purple { background: #8a4fd8; }
.fbc-clock-status--orange .fbc-clock-dot, .fbc-clock-dot--orange { background: #e08a00; }
.fbc-clock-status--red    .fbc-clock-dot, .fbc-clock-dot--red    { background: #d23c3c; }
.fbc-clock-dot--skewed { background: transparent; border: 2px solid #d23c3c; box-sizing: border-box; }

/* A section: its title, then what it holds, a shared rhythm. */
.fbc-clock-section {
    display:        flex;
    flex-direction: column;
    align-items:    flex-start;
    gap:            10px;
}
.fbc-clock-section-title { margin: 0; }   /* its look: .fbc-section-title */
.fbc-clock-hint {
    margin:      0;
    font-size:   0.84rem;
    line-height: 1.45;
    color:       var(--color-text-secondary);
}

/* The choice: one row, the first wider — one of the two in force. */
.fbc-clock-mode { align-self: stretch; }
.fbc-clock-mode .fbc-segchoice-btn:first-child { flex: 2 1 auto; }
.fbc-clock-mode .fbc-segchoice-btn:last-child  { flex: 1 1 auto; }
/* A zone's name can be long ("America/Argentina/Buenos Aires"): it wraps. */
.fbc-clock-zone { min-height: 40px; max-width: 100%; white-space: normal; text-align: left; }

/* How it is detected: a line per source — its glyph, what it is, what it says. */
.fbc-clock-source {
    align-self:    stretch;
    display:       flex;
    align-items:   center;
    gap:           10px;
    padding:       10px 12px;
    border:        1px solid var(--color-divider);
    border-radius: 8px;
    background:    var(--color-surface);
    font-size:     0.9rem;
}
.fbc-clock-source-icon       { display: inline-flex; flex: 0 0 auto; color: var(--color-primary); }
.fbc-clock-source-icon svg   { width: 18px; height: 18px; }
.fbc-clock-source-label      { flex: 1 1 auto; min-width: 0; }
.fbc-clock-source-value      { flex: 0 1 auto; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.fbc-clock-source--none .fbc-clock-source-icon,
.fbc-clock-source--none .fbc-clock-source-value { color: var(--color-text-muted); font-weight: 400; }
.fbc-clock-location-text,
.fbc-clock-location-note {
    margin:      0;
    font-size:   0.84rem;
    line-height: 1.45;
    color:       var(--color-text-secondary);
}

.fbc-clock-banner:empty { display: none; }
.fbc-clock-legend { font-size: 0.85rem; }
/* Right under the clock: it explains the clock's colour. */
.fbc-clock-card + .fbc-clock-legend { margin-top: -10px; }
.fbc-clock-legend summary { cursor: pointer; color: var(--color-text-secondary); }
.fbc-clock-legend-row { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; }

.lang-btn:focus-visible {
    outline:        2px solid var(--color-text-on-primary);
    outline-offset: 2px;
}
.lang-dropdown {
    position:      absolute;
    right:         0;
    top:           calc(100% + 4px);
    background:    var(--color-surface);
    border:        1px solid var(--color-divider);
    border-radius: 6px;
    box-shadow:    0 4px 12px rgba(0,0,0,0.15);
    min-width:     140px;
    z-index:       400;
    overflow:      hidden;
}
.lang-option {
    display:     block;
    width:       100%;
    text-align:  left;
    padding:     10px 16px;
    background:  none;
    border:      none;
    font-size:   0.9rem;
    cursor:      pointer;
    color:       var(--color-text-primary);
}
.lang-option:hover  { background: var(--color-bg); }
.lang-option.active { font-weight: 600; color: var(--color-primary); }

/* --- Utility: button rows ------------------------------------- */
.row-btns {
    display: flex;
    gap:     8px;
}

/* --- Danger / destructive button (canonical — used everywhere) - */
.btn-danger {
    background:    var(--color-danger);
    color:         #fff;
    border:        none;
    border-radius: 6px;
    padding:       8px 18px;
    font-size:     0.9rem;
    cursor:        pointer;
    transition:    background 0.15s;
}
.btn-danger:hover    { background: #a93226; }
.btn-danger:disabled { opacity: 0.6; cursor: not-allowed; }

/* --- Responsive: a phone's top bar -----------------------------
   Nine buttons do not fit a 360px bar at desktop spacing.  Tighter gaps,
   and an EMPTY view slot stops holding its place — keeping the buttons
   still between pages matters less than keeping them on screen. */
@media (max-width: 520px) {
    .top-bar            { gap: 2px; padding: 0 4px; }
    .fbc-view-btns      { gap: 2px; }
    .fbc-view-btn--empty { display: none; }
    .top-bar-icon-btn,
    .qr-top-btn,
    .notif-btn,
    .lang-btn           { padding: 6px; }
    .notif-reload-btn   { padding: 4px; }
    .top-bar-icon-btn   { width: 34px; height: 34px; }
}

/* --- Responsive: wider screens --------------------------------- */
@media (min-width: 900px) {
    :root {
        --drawer-width: 300px;
    }
    .top-bar {
        padding: 0 20px;
    }
}
