* { box-sizing: border-box; }
html, body { margin: 0; background: var(--real-surface); color: var(--real-charcoal); font-family: var(--font-body); font-size: 16px; }
a { color: var(--real-red-dark); }

.display { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; line-height: 1.05; margin: 0; }

.app-shell { min-height: 100dvh; padding-bottom: 84px; }
.app-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--real-charcoal); color: var(--real-white); }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-tile { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--real-white); display: grid; place-items: center; }
.brand-word { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: .06em; }
.brand-word b { color: var(--real-red); }
.icon-btn { width: var(--tap); height: var(--tap); border-radius: 12px; display: grid; place-items: center; background: var(--real-charcoal-2); color: var(--real-white); }

.app-main { max-width: 1200px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }

.hero { background: var(--real-charcoal); color: var(--real-white); margin: -16px -16px 0; padding: 8px 20px 24px; }
.hero-hello { margin: 0; color: #C9C8CA; }
.hero .display { font-size: 32px; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 4px; min-height: 104px; justify-content: flex-end; padding: 16px; border-radius: var(--radius-lg); background: var(--real-white); color: var(--real-charcoal); text-decoration: none; box-shadow: 0 2px 10px rgba(35, 31, 32, .06); }
.tile span { font-size: 13px; color: var(--real-text-muted); }
.tile-primary { background: var(--real-red); color: var(--real-white); }
.tile-primary span { color: var(--real-white); opacity: .9; }

.card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--radius-lg); background: var(--real-white); }
.card p { margin: 4px 0 0; color: var(--real-text-muted); }
.card-dark { flex-direction: row; align-items: center; justify-content: space-between; background: var(--real-charcoal); color: var(--real-white); }
.card-dark p { color: #C9C8CA; }
.card-dark .btn { flex: none; white-space: nowrap; }

.btn { min-height: var(--tap); padding: 0 18px; border-radius: 12px; border: 0; font: 700 16px var(--font-body); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--real-red); color: var(--real-white); }
.btn-primary:hover { background: var(--real-red-dark); }
.btn-block { width: 100%; min-height: 54px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--real-line); background: var(--real-white); color: var(--real-charcoal); font: 600 15px var(--font-body); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--real-charcoal); border-color: var(--real-charcoal); color: var(--real-white); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--real-text-muted); }
.field input { min-height: 46px; border-radius: 12px; border: 1.5px solid var(--real-line); padding: 0 14px; font: 15px var(--font-body); color: var(--real-charcoal); }
.form-section h2 { font-family: var(--font-display); font-weight: 700; font-size: 22px; text-transform: uppercase; margin: 0 0 10px; }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--real-red-tint); color: var(--real-charcoal); }

.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; height: 76px; padding: 6px 4px 14px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--real-white); border-top: 1px solid var(--real-line); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 500; color: var(--real-text-muted); text-decoration: none; }
.bottom-nav a.active { color: var(--real-red); font-weight: 700; }

/* Desktop: navigation moves into a top bar under the header. */
@media (min-width: 900px) {
  .app-shell { padding-bottom: 0; }
  .bottom-nav { position: sticky; top: 60px; height: 56px; padding: 0 calc(50% - 600px); grid-template-columns: repeat(5, max-content); gap: 28px; justify-content: start; }
  .bottom-nav a { flex-direction: row; font-size: 16px; font-weight: 600; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero .display { font-size: 56px; }
}

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: 12px 16px; background: var(--real-red-tint); z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; }

/* ---- Phase 1 screens ---- */
.muted, .hint { color: var(--real-text-muted); font-size: 14px; margin: 0; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--real-text-muted); text-transform: uppercase; }
.card h2 { font-family: var(--font-display); font-weight: 700; font-size: 22px; text-transform: uppercase; margin: 0; }
.card-link { text-decoration: none; color: var(--real-charcoal); gap: 4px; }
.card-link span { font-size: 14px; color: var(--real-text-muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.btn-secondary { background: var(--real-white); color: var(--real-charcoal); border: 1.5px solid var(--real-line); }
.btn-secondary:hover { border-color: var(--real-charcoal); }
.btn-link { background: none; color: var(--real-red-dark); padding: 0 4px; font-weight: 600; align-self: flex-start; }
.btn:disabled { opacity: .55; cursor: default; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.action-list { display: flex; flex-wrap: wrap; gap: 8px; }

.field textarea, .field select, .composer-row select, .composer-row input {
  min-height: 46px; border-radius: 12px; border: 1.5px solid var(--real-line); padding: 10px 14px;
  font: 15px var(--font-body); color: var(--real-charcoal); background: var(--real-white); width: 100%;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .composer-row input:focus { outline: 2px solid var(--real-charcoal); outline-offset: 1px; }
.password-row { display: flex; gap: 6px; align-items: center; }
.password-row input { flex: 1; min-width: 0; }

.pill { display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.pill-open { background: var(--real-red-tint); color: var(--real-red-dark); }
.pill-closed { background: var(--real-surface); color: var(--real-text-muted); }

.list { padding: 4px 0; gap: 0; }
.list-row { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; min-height: var(--tap); color: var(--real-charcoal); text-decoration: none; border-top: 1px solid var(--real-line); }
.list-row:first-child { border-top: 0; }
.list-row span, .list-row time { font-size: 14px; color: var(--real-text-muted); }
.list-row .pill { align-self: flex-start; }
.list-row.is-unread strong::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--real-red); vertical-align: middle; }
.list-row.is-muted { opacity: .6; }
.row-meta { display: flex; align-items: center; gap: 10px; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--real-text-muted); font-size: 14px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.estimate { border: 2px solid var(--real-red); }
.estimate .amount { font: 700 34px var(--font-display); color: var(--real-charcoal); margin: 0; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 0 0 18px 26px; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--real-charcoal); }
.timeline li::after { content: ""; position: absolute; left: 5px; top: 18px; bottom: 0; width: 2px; background: var(--real-line); }
.timeline li:last-child::after { display: none; }
.timeline li.is-current::before { background: var(--real-red); box-shadow: 0 0 0 4px var(--real-red-tint); }
.timeline li.is-upcoming::before { background: var(--real-white); border: 2px solid var(--real-line); }
.timeline li.is-upcoming strong { color: var(--real-grey); font-weight: 500; }
.timeline time, .timeline-note { font-size: 13px; color: var(--real-text-muted); }

.chat-head { gap: 4px; }
.chat { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 16px; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.bubble.is-theirs { align-self: flex-start; background: var(--real-white); border-bottom-left-radius: 4px; }
.bubble.is-mine { align-self: flex-end; background: var(--real-charcoal); color: var(--real-white); border-bottom-right-radius: 4px; }
.bubble time { font-size: 12px; color: var(--real-text-muted); }
.bubble.is-mine time { color: #C9C8CA; }
.bubble img { max-width: 100%; max-height: 260px; border-radius: 10px; display: block; }
.bubble-system { align-self: center; text-align: center; font-size: 13px; color: var(--real-text-muted); padding: 4px 12px; }
.composer { position: sticky; bottom: 84px; display: flex; flex-direction: column; gap: 8px; padding: 10px 0 0; background: var(--real-surface); }
.composer-row { display: flex; gap: 8px; align-items: center; }
.composer-row input, .composer-row select { flex: 1; min-width: 0; }
.quick-replies { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
.quick-replies .chip { white-space: nowrap; }
.icon-btn-light { background: var(--real-white); color: var(--real-charcoal); border: 1.5px solid var(--real-line); flex: none; cursor: pointer; }

@media (min-width: 900px) {
  .composer { bottom: 0; padding-bottom: 12px; }
}

/* Sign in with Google (Google's button guidelines: white, grey border, their logo) */
.btn-google { gap: 10px; background: var(--real-white); color: #1F1F1F; border: 1.5px solid #747775; font-weight: 600; }
.btn-google:hover { background: #F8F9FA; }
.divider { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--real-text-muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--real-line); }
.center { text-align: center; }
.prose h2 { font-family: var(--font-display); font-size: 20px; text-transform: uppercase; margin: 8px 0 0; }
.prose p, .prose li { color: var(--real-charcoal); line-height: 1.5; }

/* ---- Loading skeletons ---- */
.skeleton { display: flex; flex-direction: column; gap: 16px; }
.skel { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--real-line) 25%, #F3F1F2 37%, var(--real-line) 63%);
  background-size: 400% 100%; animation: skel-shimmer 1.4s ease infinite; }
@keyframes skel-shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.skel-title { height: 30px; width: 65%; }
.skel-heading { height: 20px; width: 35%; }
.skel-line { height: 14px; }
.skel-small { height: 12px; }
.skel-pill { height: 26px; width: 120px; border-radius: 999px; }
.skel-chip-row { height: 40px; width: 90%; border-radius: 999px; }
.skel-input { height: 46px; border-radius: 12px; }
.skel-button { height: 54px; border-radius: 12px; }
.skel-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.skel-step { display: flex; align-items: center; gap: 14px; }
.skel-chat { display: flex; flex-direction: column; gap: 10px; }
.skel-bubble { height: 44px; border-radius: 16px; }
.skel-bubble-mine { align-self: flex-end; }
.skel-w30 { width: 30%; } .skel-w40 { width: 40%; } .skel-w50 { width: 50%; } .skel-w60 { width: 60%; }
.skel-w70 { width: 70%; } .skel-w80 { width: 80%; }
.list-row .skel + .skel { margin-top: 4px; }

/* Shown while the browser app starts (first visit can take a few seconds on mobile data).
   Hidden as soon as the page puts anything of its own into <main>. */
.app-main:has(> :not(.boot-skeleton)) > .boot-skeleton { display: none; }

/* ---- Used laptop: buy or sell ---- */
.choice-grid { display: grid; gap: 12px; }
.choice { display: flex; flex-direction: column; gap: 6px; min-height: 120px; justify-content: flex-end; padding: 18px; border-radius: var(--radius-lg);
  background: var(--real-white); color: var(--real-charcoal); text-decoration: none; box-shadow: 0 2px 10px rgba(35, 31, 32, .06); }
.choice strong { font: 700 24px var(--font-display); text-transform: uppercase; }
.choice span { color: var(--real-text-muted); font-size: 14px; }
.choice-primary { background: var(--real-charcoal); color: var(--real-white); }
.choice-primary span { color: #C9C8CA; }
@media (min-width: 700px) { .choice-grid { grid-template-columns: 1fr 1fr; } }

/* Sell form */
.condition-list { display: grid; gap: 8px; }
.condition { text-align: left; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--real-line); background: var(--real-white);
  font: 15px var(--font-body); color: var(--real-charcoal); cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.condition span { font-size: 13px; color: var(--real-text-muted); }
.condition[aria-pressed="true"] { border-color: var(--real-charcoal); box-shadow: inset 0 0 0 1px var(--real-charcoal); }
.price-card { background: var(--real-charcoal); color: var(--real-white); }
.price-card .amount { font: 700 32px var(--font-display); margin: 0; color: var(--real-white); }
.price-card p { color: #C9C8CA; }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; color: var(--real-charcoal); }
.check-row input { width: 22px; height: 22px; margin-top: 1px; flex: none; accent-color: var(--real-charcoal); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }

/* Cards that start hidden (install card) must stay hidden even though .card sets display. */
[hidden] { display: none !important; }

/* ---- Used laptops for sale ---- */
.laptop-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.laptop-card { display: flex; flex-direction: column; border-radius: var(--radius-lg); overflow: hidden; background: var(--real-white);
  color: var(--real-charcoal); text-decoration: none; box-shadow: 0 2px 10px rgba(35, 31, 32, .06); }
.laptop-photo { position: relative; aspect-ratio: 4 / 3; background: var(--real-line); }
.laptop-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.laptop-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.laptop-body span { font-size: 14px; color: var(--real-text-muted); }
.laptop-body .price, .price-big { font: 700 24px var(--font-display); color: var(--real-charcoal); }
.price-big { font-size: 32px; margin: 0; }
.badge { position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px; background: var(--real-red); color: var(--real-white); font-size: 12px; font-weight: 700; }
.badge-dark { background: var(--real-charcoal); }
.grade { display: inline-block; align-self: flex-start; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--real-surface); color: var(--real-charcoal) !important; }
.grade-A { background: #E6F2EA; } .grade-B { background: #EEF1F6; } .grade-C { background: #F6F1E6; }
.laptop-gallery { display: flex; flex-direction: column; gap: 8px; }
.laptop-hero { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg); background: var(--real-line); }
.laptop-thumbs { display: flex; gap: 8px; overflow-x: auto; }
.laptop-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 10px; background: none; cursor: pointer; flex: none; }
.laptop-thumbs button[aria-pressed="true"] { border-color: var(--real-charcoal); }
.laptop-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; display: block; }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.check-list li::before { content: "✓"; display: inline-block; width: 22px; font-weight: 700; color: #2E7D4F; }
.check-list li.is-issue::before { content: "!"; color: var(--real-red-dark); }

/* Home: used laptops slider */
.slider-section { display: flex; flex-direction: column; gap: 10px; }
.slider-head { display: flex; align-items: baseline; justify-content: space-between; }
.slider-head h2 { font-size: 22px; }
.slider-head a { font-weight: 600; text-decoration: none; }
.slider { position: relative; }
.slider-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.slider-track::-webkit-scrollbar { display: none; }
.slider .slide { flex: 0 0 75%; max-width: 280px; scroll-snap-align: start; }
.slider-arrow { display: none; position: absolute; top: 35%; z-index: 1; width: var(--tap); height: var(--tap); border-radius: 50%; border: 0;
  background: var(--real-white); color: var(--real-charcoal); font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgba(35, 31, 32, .15); }
.slider-prev { left: -8px; } .slider-next { right: -8px; }
@media (min-width: 900px) {
  .slider .slide { flex-basis: 260px; }
  .slider-arrow { display: block; }
}

/* Unread badge on the header bell */
.bell { position: relative; }
.bell-badge { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--real-red); color: var(--real-white); font: 700 11px/18px var(--font-body); text-align: center;
  box-shadow: 0 0 0 2px var(--real-charcoal-2); }

/* Blazor focuses the page heading after each navigation (FocusOnNavigate) so screen readers announce the page.
   That focus isn't from the keyboard, so don't draw the browser's focus ring around the heading. */
h1:focus, h1[tabindex="-1"]:focus { outline: none; }

/* Home tiles: icon in the empty top-left space */
.tile .tile-icon { width: 46px; height: 46px; margin-bottom: auto; border-radius: 12px; display: grid; place-items: center;
  background: var(--real-surface); color: var(--real-charcoal); }
.tile-primary .tile-icon { background: rgba(255, 255, 255, .18); color: var(--real-white); }
.tile { justify-content: space-between; }
