/* here-chat-light.css — the room in daylight.
   ────────────────────────────────────────────────────────────────────────────
   HAND-MAINTAINED. Everything else in this package is generated by
   ops/chat/extract_chat.py and must never be hand-edited; this file is the
   exception, because the prototype has no light theme to extract. Neither does
   here.css — it has ZERO colour-scheme rules. The only measured light palette
   in the product is glass/rooms.html's, and it exists because someone sat down
   with a contrast meter: #898781 was rejected at 3.6:1 and #6e6c67 chosen for
   clearing 4.5:1 on both light surfaces.

   So this is not a new palette. It is that measured one, mapped onto the
   package's tokens, so that a surface adopting the package cannot lose daylight
   as the price of gaining bubbles.

   Load AFTER here-chat.css and here-rail.css.
   ──────────────────────────────────────────────────────────────────────────── */
@media (prefers-color-scheme:light){

  .here-chat{
    --ink:#0b0b0b;                    /* 18.3:1 on the page */
    --dim:rgba(11,11,11,.78);
    --soft:#52514e;                   /* 7.94:1 on card — carries labels + meta */
    --faint:#6e6c67;                  /* 4.89:1 page / 5.24:1 card — the DATA floor */
    /* Apple's #0a84ff carries white at 3.65:1 and fails AA. On a light surface
       there is no incumbent to override, so the light theme starts correct:
       #0a66c8 is 5.60:1 with white and reads as the same blue. */
    --tint:#0a66c8;
    --tint-hi:#0a52a0;                /* text-on-light variant */
    --ember:#0a66c8;                  /* the contract keeps ember an alias of tint */
    /* The night red (#ff6b6b, 5.58:1 on the card) is 2.41:1 on paper — a semantic
       colour has to flip like any other ink. #c9241a is 4.87:1 on the page and
       5.14:1 on print, and still reads as the same red. */
    --bad:#c9241a;                    /* 4.87:1 page / 5.55:1 card */
  }

  /* surfaces: the frosted material inverts, the aurora goes quiet */
  .here-chat .panel{background:rgba(255,255,255,.72);
    border-color:rgba(0,0,0,.10);
    box-shadow:0 1px 0 rgba(255,255,255,.9) inset, 0 10px 30px rgba(0,0,0,.06)}
  .here-chat .aurora{opacity:.28}
  .here-chat.railed{background:#f7f7f4}   /* the measured page ground */

  /* the widget card — a raised white surface, not a dark one with dark ink.
     `.wg{background:#1c1c1e}` is unconditional in the generated sheet, so in daylight
     the crystallization card measured 1.16:1 on its title and every body row. Matched to
     the panel's own light treatment above rather than invented. `.hero` is excluded: it
     is an image-backed card whose art covers the background, and whitening it would show
     through the corners the art is meant to fill. */
  .here-chat .wg:not(.hero){background:#fff;border:1px solid rgba(0,0,0,.08);
    box-shadow:0 1px 0 rgba(255,255,255,.9) inset,0 8px 24px -14px rgba(0,0,0,.35)}

  /* the rail's sheet and its search results. Same reason as everything else in this
     file: the package's surfaces are written dark, and a surface that only exists in
     one scheme is a surface half the day cannot read. */
  .here-chat .rail .sheet{background:rgba(0,0,0,.03);border-bottom-color:rgba(0,0,0,.10)}
  .here-chat .rail .shx{background:rgba(0,0,0,.045);border-color:rgba(0,0,0,.10)}
  .here-chat .rail .shname,
  .here-chat .rail .shfind{background:rgba(0,0,0,.04);border-color:rgba(0,0,0,.12)}
  .here-chat .rail .shp:hover{background:rgba(0,0,0,.05)}
  .here-chat .rail .shp.pick{background:rgba(0,0,0,.075)}
  .here-chat .rail .hit:hover{background:rgba(0,0,0,.05)}
  .here-chat .rail .hit:active{background:rgba(0,0,0,.08)}
  .here-chat .rail .home:hover{background:rgba(0,0,0,.05)}

  /* ── the three states, in daylight ────────────────────────────────────────────
     The dark scheme can sink the selected row, because there is room below black.
     Daylight has the opposite problem: the light palette was measured to clear 4.5:1
     and the resting ground already sits close to it, so DARKENING the row a person is
     standing in spends the margin someone earned with a contrast meter. So it goes the
     other way — the current room is RAISED into the light, nearly white, which buys
     contrast back instead of paying it out. Same grammar as the dark scheme (a lit top
     edge, a lip, a ramp), opposite direction, because the material is the same and the
     ground is not.
     Declared after :hover, same specificity — a selected row must still answer a
     mouse. */
  .here-chat .rail .r:hover{background:rgba(0,0,0,.045)}
  .here-chat .rail .r:active{background:rgba(0,0,0,.03);
    box-shadow:inset 0 1px 2px rgba(0,0,0,.10)}
  .here-chat .rail .r.on{
    background:linear-gradient(180deg,#ffffff,#fdfdfc 46%,#fbfbf9 55%,#f7f7f4);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.95),inset 0 -1px 0 rgba(0,0,0,.09),
      0 1px 2px rgba(0,0,0,.07)}
  .here-chat .rail .r.on:hover{
    background:linear-gradient(180deg,#ffffff,#ffffff 46%,#fdfdfc 55%,#fafaf8)}
  .here-chat .rail .r.on:active{box-shadow:inset 0 1px 2px rgba(0,0,0,.10)}

  /* the sticky heading carries the light ground and the same frost */
  .here-chat .rail .sec{background:rgba(255,255,255,.78)}

  /* the focus ring inverts: --tint-hi is a light blue for a dark ground and would be
     the wrong side of the scale here, where --tint is 5.6:1 on white. */
  .here-chat .rail :focus-visible{outline-color:var(--tint)}

  /* bubbles — iOS light: received #e9e9eb at 16.2:1, sent keeps white ink */
  .here-chat .bub{background:#e9e9eb;color:#0b0b0b}
  .here-chat .me .bub{background:var(--tint);color:#fff}

  /* chrome that assumed a dark ground */
  .here-chat .ask input{background:rgba(0,0,0,.04);border-color:rgba(0,0,0,.12);
    color:var(--ink)}
  .here-chat .ask input:focus{border-color:var(--tint);
    box-shadow:0 0 0 3px rgba(10,102,200,.16)}
  .here-chat .plus{background:rgba(0,0,0,.05);border-color:rgba(0,0,0,.10);color:var(--ink)}
  /* The ⤢ expand control was the one chrome button this block never named, so it
     kept here-chat.css's rgba(30,30,36,.7) — a night ground — while --soft flipped
     to #52514e above. Dark ink on a dark button measured 1.29:1 here. Same wash as
     .plus, because it is the same kind of thing. */
  .here-chat .hfullbtn{background:rgba(0,0,0,.05);border-color:rgba(0,0,0,.10);color:var(--soft)}

  /* the rail */
  .here-chat .rail{background:rgba(255,255,255,.78);border-right-color:rgba(0,0,0,.10)}
  .here-chat .rail .rhd,.here-chat .rail .find{border-bottom-color:rgba(0,0,0,.10)}
  .here-chat .rail .mk{background:rgba(0,0,0,.04);border-color:rgba(0,0,0,.12);color:var(--soft)}
  .here-chat .rail .find input{background:rgba(0,0,0,.04);border-color:rgba(0,0,0,.12)}
  .here-chat .rail .r:hover{background:rgba(0,0,0,.035)}
  .here-chat .rail .app-row:hover{background:rgba(0,0,0,.035)}
  .here-chat .rail .r .tick{background:rgba(0,0,0,.16)}
  .here-chat .rail .sec{color:var(--faint)}
  .here-chat .rail .r .n2,.here-chat .rail .app-row .ab{color:var(--faint)}
  /* presence keeps ok-green, darkened so it clears AA on white */
  .here-chat .rail .r .liv{background:#0a8f5a}
  .here-chat .rail .sec em,.here-chat .rail .r .atm{color:var(--tint-hi)}
}

/* Someone asking the OS for more contrast is saying the subtle version is not
   working for them, and this surface is largely hairlines. Both schemes. */
@media (prefers-contrast:more){
  .here-chat .panel,.here-chat .rail{border-color:rgba(255,255,255,.28)}
  .here-chat .rail .r .n2{color:var(--dim)}
  .here-chat :focus-visible{outline-width:3px}
  @media (prefers-color-scheme:light){
    .here-chat .panel,.here-chat .rail{border-color:rgba(0,0,0,.34)}
    .here-chat .rail .r .n2{color:#3a3936}
  }
}
