/* ── LUKE (#148): calm chat, prefix lk- ─────────────────────────────────── */

.lk { font-family: var(--font-base); max-width: 1500px; margin: 0 auto; display: grid; grid-template-columns: 230px minmax(0, 1fr) 300px; gap: 1rem; height: calc(100vh - 96px); }
.lk button, .lk input, .lk textarea, .lk select { font-family: inherit; }
.lk-center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.lk-left, .lk-right { overflow-y: auto; padding: .5rem 0; display: flex; flex-direction: column; gap: .9rem; font-size: .8125rem; }
.lk-right { border-left: 1px solid #e5e7eb; padding-left: .9rem; }
.lk-left { border-right: 1px solid #e5e7eb; padding-right: .9rem; }
@media (max-width: 1150px) { .lk { grid-template-columns: minmax(0, 1fr); height: auto; } .lk-left, .lk-right { border: 0; padding: 0; } .lk-center { height: calc(100vh - 96px); } }
.lk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .5rem 0 .75rem; }
.lk-head__title h1 { display: inline; font-size: 1.25rem; margin: 0 .5rem 0 0; letter-spacing: .04em; }
.lk-head__sub { color: #6b7280; font-size: .8125rem; }
.lk-new { font-size: .8125rem; font-weight: 600; color: #fff; background: #1f2937; text-decoration: none; border-radius: 6px; padding: .5rem .6rem; text-align: center; }
.lk-new:hover { background: #374151; }

.lk-messages { flex: 1; overflow-y: auto; padding: .5rem 0 1rem; display: flex; flex-direction: column; gap: .9rem; }
.lk-empty { margin: auto 0; text-align: center; color: #4b5563; }
.lk-empty__lead { font-size: 1rem; margin-bottom: .75rem; }

.lk-msg--user { align-self: flex-end; max-width: 75%; }
.lk-msg__bubble { background: #eef2ff; color: #1f2937; border-radius: 12px 12px 2px 12px; padding: .55rem .8rem; white-space: pre-wrap; }
.lk-msg--assistant { align-self: stretch; }
.lk-answer { color: #111827; line-height: 1.55; }
.lk-answer p { margin: 0 0 .6rem; }
.lk-answer ul { margin: 0 0 .6rem 1.1rem; padding: 0; }
.lk-answer--failed { color: #b91c1c; }

.lk-status { display: flex; align-items: center; gap: .45rem; color: #6b7280; font-size: .8125rem; margin-bottom: .35rem; }
.lk-status__dot { width: 7px; height: 7px; border-radius: 50%; background: #6366f1; animation: lk-pulse 1.2s ease-in-out infinite; }
@keyframes lk-pulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .lk-status__dot { animation: none; } }

.lk-chips { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.lk-ask .lk-chips, .lk-note .lk-chip { justify-content: flex-start; }
.lk-chip { border: 1px solid #c7d2fe; background: #fff; color: #3730a3; border-radius: 999px; padding: .3rem .75rem; font-size: .8125rem; cursor: pointer; }
.lk-chip:hover { background: #eef2ff; }

.lk-ask { border-left: 3px solid #6366f1; padding: .25rem 0 .25rem .75rem; margin-top: .4rem; }
.lk-ask__question { margin: 0 0 .25rem; font-weight: 600; }
.lk-ask__why { margin: 0 0 .5rem; color: #6b7280; font-size: .8125rem; }

.lk-note { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .8125rem; background: #f9fafb; border-radius: 6px; padding: .4rem .6rem; margin-top: .4rem; }
.lk-note__kind { font-weight: 600; text-transform: uppercase; font-size: .6875rem; letter-spacing: .05em; color: #6b7280; }
.lk-note--handoff .lk-note__kind { color: #b45309; }

.lk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; margin-top: .5rem; }
.lk-card { border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.lk-card__img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #f9fafb; }
.lk-card__body { padding: .5rem .6rem; display: flex; flex-direction: column; gap: .2rem; font-size: .8125rem; }
.lk-card__brand { color: #6b7280; text-transform: uppercase; font-size: .6875rem; letter-spacing: .05em; }
.lk-card__name { font-weight: 600; color: #111827; }
.lk-card__facts { display: flex; gap: .5rem; flex-wrap: wrap; }
.lk-card__why { color: #374151; }
.lk-card__meta { display: flex; justify-content: space-between; align-items: center; color: #6b7280; }
.lk-ok { color: #047857; }
.lk-no { color: #b91c1c; }
.lk-price { font-weight: 600; }
.lk-price--none { font-weight: 400; color: #9ca3af; }

.lk-compare { overflow-x: auto; margin-top: .5rem; }
.lk-compare table { border-collapse: collapse; font-size: .8125rem; }
.lk-compare th, .lk-compare td { border-bottom: 1px solid #f3f4f6; padding: .35rem .6rem; text-align: left; vertical-align: top; }

.lk-places { display: flex; flex-direction: column; gap: .3rem; margin-top: .5rem; font-size: .8125rem; }
.lk-place { display: flex; gap: .6rem; flex-wrap: wrap; align-items: baseline; }
.lk-place__where, .lk-place__when { color: #6b7280; }

.lk-form { border-top: 1px solid #e5e7eb; padding: .6rem 0 .75rem; background: #fff; }
.lk-form textarea { width: 100%; box-sizing: border-box; resize: none; border: 1px solid #d1d5db; border-radius: 8px; padding: .55rem .7rem; font: inherit; }
.lk-form__actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .4rem; }
.lk-send, .lk-now { border-radius: 6px; padding: .35rem .9rem; font-size: .875rem; cursor: pointer; border: 1px solid transparent; }
.lk-send { background: #4f46e5; color: #fff; }
.lk-send:disabled { background: #c7d2fe; cursor: default; }
.lk-now { background: #fff; color: #4f46e5; border-color: #c7d2fe; }

/* ── MR 4: tiles ────────────────────────────────────────────────────────── */

.lk-widget--fresh { animation: lk-fresh 8s ease-out; border-radius: 10px; }
@keyframes lk-fresh { 0% { box-shadow: 0 0 0 3px #c7d2fe; } 100% { box-shadow: 0 0 0 3px transparent; } }
@media (prefers-reduced-motion: reduce) { .lk-widget--fresh { animation: none; } }

.lk-cards__lead { font-size: .8125rem; color: #4b5563; margin-top: .4rem; }
.lk-card__media { position: relative; }
.lk-card__similar-form { position: absolute; right: 8px; bottom: 8px; margin: 0; }
.lk-card__similar { font-size: .6875rem; font-weight: 600; background: #fff; border: 1px solid #e5e7eb; border-radius: 999px; padding: .2rem .55rem; cursor: pointer; opacity: 0; transition: opacity .15s; }
.lk-card:hover .lk-card__similar, .lk-card__similar:focus-visible { opacity: 1; }
@media (hover: none) { .lk-card__similar { opacity: 1; } }
.lk-card__size { font-size: .75rem; background: #eef2ff; color: #3730a3; border-radius: 5px; padding: .15rem .45rem; align-self: flex-start; }
.lk-card__why { border-left: 2px solid #6366f1; padding-left: .45rem; }
.lk-card__actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.lk-card__actions form { margin: 0; }
.lk-act { font-size: .75rem; font-weight: 600; border: 1px solid #6366f1; color: #4338ca; background: #fff; border-radius: 6px; padding: .2rem .55rem; cursor: pointer; }
.lk-chip--sm { padding: .15rem .55rem; font-size: .75rem; }
.lk-badge { font-size: .6875rem; border-radius: 999px; padding: .05rem .45rem; background: #f3f4f6; }
.lk-badge--ok { background: #ecfdf5; color: #047857; }
.lk-badge--no { background: #fef2f2; color: #b91c1c; }

.lk-sheet { border: 1px solid #6366f1; border-radius: 12px; background: #fff; overflow: hidden; margin-top: .5rem; }
.lk-sheet__top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1rem; padding: .9rem; }
@media (max-width: 760px) { .lk-sheet__top { grid-template-columns: minmax(0, 1fr); } }
.lk-sheet__main { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #f9fafb; border-radius: 8px; }
.lk-sheet__main--empty { display: grid; place-items: center; color: #9ca3af; }
.lk-sheet__thumbs { display: flex; gap: .35rem; overflow-x: auto; margin-top: .4rem; }
.lk-sheet__thumb { flex: 0 0 56px; height: 42px; padding: 0; border: 2px solid transparent; border-radius: 5px; background: #f9fafb; cursor: pointer; }
.lk-sheet__thumb[aria-pressed="true"] { border-color: #6366f1; }
.lk-sheet__thumb img { width: 100%; height: 100%; object-fit: contain; }
.lk-sheet__colors { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.lk-sheet__color { font-size: .75rem; border: 1px solid #e5e7eb; background: #fff; border-radius: 999px; padding: .15rem .55rem; cursor: pointer; display: inline-flex; gap: .35rem; align-items: center; }
.lk-swatch { width: 11px; height: 11px; border-radius: 3px; border: 1px solid #e5e7eb; background: #f3f4f6; }
.lk-sheet__info { display: flex; flex-direction: column; gap: .35rem; font-size: .8125rem; min-width: 0; }
.lk-sheet__name { font-size: 1.125rem; margin: 0; }
.lk-sheet__tabs { display: flex; flex-wrap: wrap; gap: .2rem; padding: 0 .9rem; border-bottom: 1px solid #e5e7eb; }
.lk-sheet__tabs button { font-size: .8125rem; font-weight: 600; border: 0; background: none; color: #6b7280; padding: .45rem .6rem; border-bottom: 2px solid transparent; cursor: pointer; }
.lk-sheet__tabs button[aria-selected="true"] { color: #4338ca; border-bottom-color: #6366f1; }
.lk-sheet__body { padding: .9rem; display: flex; flex-direction: column; gap: .6rem; font-size: .875rem; min-width: 0; }
.lk-sheet__src { font-size: .75rem; color: #9ca3af; margin: 0; }
.lk-sheet__foot { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: 0 .9rem .9rem; }
.lk-sheet__foot form { margin: 0; }
.lk-sheet--small .lk-sheet__tabs, .lk-sheet--small .lk-sheet__body, .lk-sheet--small .lk-sheet__thumbs, .lk-sheet--small .lk-sheet__colors { display: none; }

.lk-tbl { border-collapse: collapse; font-size: .8125rem; font-variant-numeric: tabular-nums; }
.lk-tbl th, .lk-tbl td { border-bottom: 1px solid #f3f4f6; padding: .25rem .5rem; text-align: left; }
.lk-tbl th { color: #6b7280; font-weight: 600; }
.lk-stock { font-size: .75rem; color: #4b5563; display: flex; flex-direction: column; gap: .1rem; }
.lk-stock__row { display: flex; gap: .5rem; flex-wrap: wrap; }
.lk-stock__seg { color: #6b7280; }
.lk-kv b { color: #6b7280; font-size: .6875rem; text-transform: uppercase; letter-spacing: .04em; margin-right: .4rem; }
.lk-facts { display: grid; grid-template-columns: auto 1fr; gap: .2rem .7rem; margin: 0; font-size: .8125rem; }
.lk-facts dt { color: #6b7280; }
.lk-facts dd { margin: 0; }
.lk-muted { color: #6b7280; font-size: .8125rem; margin: 0; }
.lk-hint { font-size: .75rem; color: #92400e; background: #fef3c7; border-radius: 6px; padding: .25rem .5rem; }
.lk-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.lk-media { border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; font-size: .75rem; color: #374151; text-decoration: none; }
.lk-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #f9fafb; }
.lk-media span { padding: .3rem .45rem; }
.lk-media__play { aspect-ratio: 16 / 9; display: grid; place-items: center; background: #e0e7ff; color: #4338ca; font-size: 1.25rem; }
.lk-sizet td.lk-hit { background: #eef2ff; color: #3730a3; font-weight: 700; }
.lk-sizet th, .lk-sizet td { text-align: center; }
.lk-features { display: flex; flex-direction: column; gap: .5rem; }
.lk-feature { display: flex; gap: .6rem; align-items: flex-start; }
.lk-feature > div { flex: 1; min-width: 0; } /* without a picture the text used to fall into the 72 px column */
.lk-feature img { flex: none; width: 72px; height: 54px; object-fit: cover; border-radius: 5px; }
.lk-feature p { margin: .15rem 0 0; color: #4b5563; font-size: .8125rem; }
.lk-doc { display: flex; justify-content: space-between; gap: .6rem; border: 1px solid #e5e7eb; border-radius: 8px; padding: .4rem .6rem; font-size: .8125rem; }

/* Tables the model writes look like the comparison table. */
.lk-answer .lk-compare { margin: .3rem 0 .6rem; }
.lk-md-table { border-collapse: collapse; font-size: .8125rem; }
.lk-md-table th, .lk-md-table td { border-bottom: 1px solid #f3f4f6; padding: .35rem .6rem; text-align: left; vertical-align: top; }
.lk-md-table thead th { color: #111827; border-bottom-color: #e5e7eb; }
.lk-md-table tbody th { color: #6b7280; font-weight: 600; }
.lk-answer h4 { font-size: .9375rem; margin: .6rem 0 .3rem; }
.lk-answer ol { margin: 0 0 .6rem 1.2rem; padding: 0; }
.lk-answer code { font-size: .8125rem; background: #f3f4f6; border-radius: 3px; padding: 0 .25rem; }

/* ── Lightbox and stock table (fix after the first test on prod) ────────── */

.lk-lightbox { position: fixed; inset: 0; z-index: 1100; background: rgba(17, 24, 39, .88); display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 1.5rem; }
.lk-lightbox[hidden] { display: none; }
.lk-lightbox__figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .5rem; max-width: min(92vw, 1600px); }
.lk-lightbox__img { max-width: 100%; max-height: calc(100vh - 7rem); object-fit: contain; background: #fff; border-radius: 6px; }
.lk-lightbox__caption { color: #e5e7eb; font-size: .8125rem; }
.lk-lightbox__close { position: absolute; top: 1rem; right: 1.25rem; font-size: 1.75rem; line-height: 1; color: #fff; background: none; border: 0; cursor: pointer; }
.lk-lightbox__nav { font-size: 2.5rem; line-height: 1; color: #fff; background: rgba(255, 255, 255, .08); border: 0; border-radius: 999px; width: 3rem; height: 3rem; cursor: pointer; flex: none; }
.lk-lightbox__nav:hover, .lk-lightbox__close:hover { background: rgba(255, 255, 255, .18); }
.lk-lightbox__nav[hidden] { visibility: hidden; display: block; }
.lk-card__zoom, .lk-sheet__zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.lk-media { cursor: zoom-in; background: #fff; text-align: left; padding: 0; font: inherit; }
.lk-stock__table th, .lk-stock__table td { padding: .15rem .45rem; font-size: .75rem; text-align: right; }
.lk-stock__table th:first-child { text-align: left; }

/* ── MR 5: history, switches, modes, concierge ──────────────────────────── */

.lk-eyebrow { font-size: .6875rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; margin: 0 0 .3rem; }
.lk-history { display: flex; flex-direction: column; }
.lk-history__item { text-align: left; background: none; border: 0; border-bottom: 1px solid #f3f4f6; padding: .3rem .1rem; color: #374151; cursor: pointer; font: inherit; }
.lk-history__item[aria-current="true"] { color: #4338ca; font-weight: 600; }
.lk-switches { display: flex; flex-direction: column; gap: .35rem; }
.lk-switch { display: flex; gap: .45rem; align-items: flex-start; line-height: 1.3; cursor: pointer; }
.lk-switch input { margin-top: .15rem; accent-color: #4f46e5; }
.lk-switch small { display: block; color: #9ca3af; font-size: .6875rem; }
.lk-switch--fixed { cursor: default; color: #6b7280; }
.lk-modes { display: inline-flex; border: 1px solid #e5e7eb; border-radius: 6px; overflow: hidden; }
.lk-mode-form { margin: 0; }
.lk-mode { font-size: .75rem; font-weight: 600; border: 0; background: #fff; color: #4b5563; padding: .3rem .6rem; cursor: pointer; }
.lk-mode[aria-pressed="true"] { background: #1f2937; color: #fff; }
.lk-chip__src { color: #9ca3af; margin-left: .2rem; }
.lk-chip--ghost { border-style: dashed; color: #6b7280; text-decoration: none; }
.lk-chips--left { justify-content: flex-start; }
.lk-next { margin-top: .6rem; }
.lk-next__lead { font-size: .75rem; color: #6b7280; margin: 0 0 .3rem; }
.lk-tools { display: none; font-size: .75rem; color: #6b7280; margin-top: .4rem; }
.lk-tools ol { margin: .3rem 0 0 1.1rem; padding: 0; font-family: ui-monospace, monospace; }
.lk-memory { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px; padding: .7rem .8rem; display: flex; flex-direction: column; gap: .5rem; }
.lk-gaps { display: flex; flex-wrap: wrap; gap: .3rem; }
.lk-gap { font-size: .6875rem; border: 1px dashed #d1d5db; border-radius: 999px; padding: .05rem .5rem; color: #9ca3af; }
.lk-cards--alt { display: none; }

/* One class per switch that is off (Luke::Preferences#css_classes). */
.lk--no-starters .lk-starters { display: none; }
.lk--no-status .lk-status, .lk--no-status .lk-now { display: none; }
.lk--no-cards .lk-cards { display: none !important; }
.lk--no-compare .lk-widget .lk-compare { display: none; }
.lk--no-compare .lk-cards--alt { display: grid; }
.lk--no-dossier .lk-dossier-form { display: none; }
.lk--no-media [data-luke-sheet-tab-param="images"], .lk--no-media [data-luke-sheet-tab-param="videos"],
.lk--no-media [data-luke-sheet-tab-param="manuals"], .lk--no-media .lk-sheet__thumbs { display: none; }
.lk--no-similar .lk-card__similar-form { display: none; }
.lk--no-concierge .lk-next { display: none; }
.lk:not(.lk--no-tool-details) .lk-tools { display: block; }

/* ── Location cards ─────────────────────────────────────────────────────── */

.lk-places { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .5rem; margin-top: .5rem; }
.lk-place-card { border: 1px solid #e5e7eb; border-radius: 8px; padding: .5rem .65rem; display: flex; flex-direction: column; gap: .25rem; font-size: .8125rem; background: #fff; }
.lk-place-card__head { display: flex; flex-wrap: wrap; gap: .4rem; align-items: baseline; }
.lk-place-card__distance { margin-left: auto; color: #4338ca; font-weight: 600; font-size: .75rem; }
.lk-place-card__address { color: #4b5563; display: flex; flex-wrap: wrap; gap: .4rem; }
.lk-place-card__badges { display: flex; flex-wrap: wrap; gap: .25rem; }
.lk-place-card__more summary { cursor: pointer; color: #6b7280; font-size: .75rem; }
.lk-place-card__more .lk-facts { margin-top: .3rem; font-size: .75rem; }

/* ── Starter questions, grouped by source ───────────────────────────────── */

.lk-empty { margin: 1rem 0; text-align: left; }
.lk-starters { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .8rem 1.2rem; align-items: start; }
.lk-starters__group .lk-eyebrow { margin-bottom: .3rem; }
.lk-starters__group .lk-chip { text-align: left; }
.lk-starters > .lk-chip--ghost { justify-self: start; align-self: end; }
.lk-places-help { display: flex; justify-content: flex-end; margin-top: .4rem; }
.lk-card__similar-form--inline { position: static; } /* in the large tile footer, not over a picture */

/* ── Product links in the answer and their card ─────────────────────────── */

.lk-product-link { font: inherit; color: #4338ca; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }
.lk-product-link:hover, .lk-product-link:focus-visible { text-decoration-style: solid; }
.lk-popover { position: absolute; z-index: 950; width: 340px; }
.lk-pcard { position: relative; background: #fff; border: 1px solid #c7d2fe; border-radius: 10px; box-shadow: 0 8px 24px rgba(17, 24, 39, .15); padding: .7rem .8rem; display: flex; flex-direction: column; gap: .4rem; font-size: .8125rem; }
.lk-pcard--loading { color: #6b7280; }
.lk-pcard__close { position: absolute; top: .3rem; right: .5rem; border: 0; background: none; font-size: 1.1rem; cursor: pointer; color: #6b7280; }
.lk-pcard__top { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: .6rem; }
.lk-pcard__img { width: 96px; height: 72px; object-fit: contain; background: #f9fafb; border-radius: 6px; }
.lk-pcard__head { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.lk-pcard__name { font-size: .9375rem; }
.lk-pcard__features { margin: 0; padding-left: 1.1rem; color: #374151; }
.lk-pcard .lk-card__actions form { margin: 0; }

/* ── Concierge memory: open items and the round notes (#154) ──────────── */

.lk-open { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; padding: .4rem .55rem; }
.lk-open__title { margin: 0 0 .2rem; font-size: .6875rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #9a3412; }
.lk-open ul { margin: 0; padding-left: 1rem; font-size: .8125rem; }
.lk-notes summary { cursor: pointer; font-size: .75rem; color: #6b7280; }
.lk-notes ol { margin: .3rem 0 0; padding-left: 1.1rem; font-size: .75rem; color: #4b5563; display: flex; flex-direction: column; gap: .15rem; }

/* ── Left column: earlier chats, collapsible switches ────────────────── */

.lk-switches-box > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .35rem; }
.lk-switches-box > summary::-webkit-details-marker { display: none; }
.lk-switches-box > summary::before { content: "▸"; font-size: .7rem; color: #9ca3af; }
.lk-switches-box[open] > summary::before { content: "▾"; }
.lk-switches-box > summary .lk-muted { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; }
.lk-switches-box .lk-switches { margin-top: .35rem; }
.lk--mode-history .lk-history { display: none; }
.lk-chats { display: flex; flex-direction: column; gap: .1rem; }
.lk-chats__item { display: flex; flex-direction: column; padding: .35rem .45rem; border-radius: 6px; text-decoration: none; color: #374151; }
.lk-chats__item:hover { background: #f3f4f6; }
.lk-chats__item--active { background: #eef2ff; color: #3730a3; }
.lk-chats__title { font-size: .8125rem; line-height: 1.3; }
.lk-chats__when { font-size: .6875rem; color: #9ca3af; }
