/* ════════════════════════════════════════════════════════════════════════
   Shorey — AI assistant  ·  /assistant
   Translated from Shore Pass Design › ai-assistant.jsx › AIAssistant + ShoreyLogo.

   The prototype is a 340×500 floating panel: gradient header, scrolling message
   list with 80%-wide bubbles, a "Try asking:" prompt list and a pill composer with
   a round send button. Here it is a whole screen, so the panel fills the phone
   viewport; at ≥1024px it collapses back into the bordered, rounded card the
   prototype draws.

   Every rule is scoped under .scr-assistant. Colours come from the design tokens,
   so dark mode is free — the one literal is the gradient's second stop (#4A8FE7),
   which no token covers.
   ════════════════════════════════════════════════════════════════════════ */

.scr-assistant {
    --asst-blue-2: #4A8FE7;                 /* ai-assistant.jsx header gradient stop 2 */
    --asst-bar: 62px;                        /* height of the fixed bottom tab bar */

    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--asst-bar) - env(safe-area-inset-bottom));
    /* .mshell reserves 96px for the tab bar; this panel measures its own height. */
    margin-bottom: -96px;
    background: var(--sp-surface);
    overflow: hidden;
}

/* ──────────────── Shorey mark (ShoreyLogo) ──────────────── */
/* Body paths ride on currentColor; the face is the prototype's default variant
   (stroke/fill = var(--sp-surface)) unless a context below overrides it. */
.scr-assistant .asst-mark__face { stroke: var(--sp-surface); }
.scr-assistant .asst-mark__eye  { fill: var(--sp-surface); }

/* ──────────────── Header (prototype panel header) ──────────────── */
.scr-assistant .asst-head { flex: 0 0 auto; }

.scr-assistant .asst-top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    padding-top: calc(16px + env(safe-area-inset-top));
    background: linear-gradient(135deg, var(--sp-blue) 0%, var(--asst-blue-2) 100%);
    color: #fff;
}
.scr-assistant .asst-top__back {
    flex: 0 0 auto;
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    text-decoration: none;
    transition: background .15s;
}
.scr-assistant .asst-top__back:hover { background: rgba(255, 255, 255, .3); }

/* 44px translucent bubble holding a 28px white Shorey */
.scr-assistant .asst-top__av {
    flex: 0 0 auto;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .2);
    display: grid; place-items: center;
    color: #fff;
}
.scr-assistant .asst-top__av .asst-mark { width: 28px; height: 28px; }
/* The prototype's "light" mark hides the face in white-on-white; tint it with the
   gradient underneath instead so the mascot still reads as a face. */
.scr-assistant .asst-top__av .asst-mark__face { stroke: var(--sp-blue); }
.scr-assistant .asst-top__av .asst-mark__eye  { fill: var(--sp-blue); }

.scr-assistant .asst-top__id { flex: 1; min-width: 0; }
.scr-assistant .asst-top__id strong {
    display: block;
    font-family: var(--sp-font-display);
    font-size: 18px; font-weight: 600;
    letter-spacing: .01em; line-height: 1.2;
}
.scr-assistant .asst-top__id span { font-size: 12px; opacity: .9; }

/* Honesty strip — this screen has no model behind it. */
.scr-assistant .asst-note {
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 16px 10px;
    background: var(--sp-blue-soft);
    border-bottom: 1px solid var(--sp-line);
    color: var(--sp-slate);
    font-size: 11.5px;
    line-height: 1.45;
}
.scr-assistant .asst-note__ico {
    width: 14px; height: 14px;
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--sp-blue);
}

/* ──────────────── Message list ──────────────── */
.scr-assistant .asst-feed {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--sp-surface);
}

.scr-assistant .asst-msg { max-width: 80%; }
.scr-assistant .asst-msg--bot  { align-self: flex-start; }
.scr-assistant .asst-msg--user { align-self: flex-end; }

.scr-assistant .asst-msg__bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.scr-assistant .asst-msg--bot .asst-msg__bubble {
    background: var(--sp-bg-2);
    border: 1px solid var(--sp-line-2);
    color: var(--sp-ink);
}
.scr-assistant .asst-msg--user .asst-msg__bubble {
    background: var(--sp-blue);
    color: #fff;
}
.scr-assistant .asst-link {
    color: var(--sp-blue);
    font-weight: 700;
    white-space: nowrap;
}
.scr-assistant .asst-link:hover { text-decoration: underline; }

/* ──────────────── "Try asking:" prompt list ──────────────── */
.scr-assistant .asst-sugg { margin-top: 8px; }
.scr-assistant .asst-sugg__lbl {
    font-size: 11px; font-weight: 700;
    color: var(--sp-slate-2);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 8px;
}
.scr-assistant .asst-sugg__list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.scr-assistant .asst-chip {
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--sp-surface);
    border: 1px solid var(--sp-line);
    font: inherit;
    font-size: 12px;
    color: var(--sp-ink);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.scr-assistant .asst-chip:hover {
    border-color: var(--sp-blue);
    color: var(--sp-blue);
    background: var(--sp-blue-soft);
}

/* Empty state — no starter prompts configured */
.scr-assistant .asst-empty { margin: 8px 0 0; }

/* ──────────────── Composer ──────────────── */
.scr-assistant .asst-composer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--sp-line);
    background: var(--sp-surface);
}
.scr-assistant .asst-composer__in {
    flex: 1; min-width: 0;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--sp-line);
    background: var(--sp-bg-2);
    font-family: var(--sp-font-body);
    font-size: 14px;
    color: var(--sp-ink);
    outline: none;
}
.scr-assistant .asst-composer__in::placeholder { color: var(--sp-slate-2); }
.scr-assistant .asst-composer__in:focus { border-color: var(--sp-blue); }

.scr-assistant .asst-composer__send {
    flex: 0 0 auto;
    width: 36px; height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--sp-blue);
    color: #fff;
    display: grid; place-items: center;
    cursor: pointer;
    transition: background .15s, opacity .15s;
}
.scr-assistant .asst-composer__send:disabled {
    background: var(--sp-bg-2);
    color: var(--sp-slate);
    opacity: .5;
    cursor: not-allowed;
}
.scr-assistant .asst-composer__sendico { width: 18px; height: 18px; }

/* ──────────────── Desktop: back to the prototype's floating card ──────────────── */
@media (min-width: 1024px) {
    .scr-assistant {
        height: calc(100vh - 108px);
        max-width: 420px;
        margin: 26px auto 0;
        border: 1px solid var(--sp-line);
        border-radius: 20px;
        box-shadow: var(--sp-shadow-2);
    }
    .scr-assistant .asst-top { padding-top: 16px; }
    .scr-assistant .asst-top__back { display: none; }   /* sidebar nav is always visible */
    .scr-assistant .asst-composer { padding-bottom: 12px; }
}
