/* OLED screen tab (#oled). Light page like every other tab; the only dark surfaces are the OLED glass itself
 * (viewer, catalogue tiles) and the order bar that carries the purchase. Loaded after content-width.css. */
body.storefront #oled {
  --oled-ink: #101c30;
  --oled-text: #182336;
  --oled-muted: var(--rc-secondary, #52627a);
  --oled-ground: var(--rc-ground, #f5f8fd);
  --oled-line: #d6e0ee;
  --oled-blue: var(--yst-blue, #0057d9);
  --oled-yellow: var(--yst-yellow, #ffda2d);
  --oled-glass: #05070b;
  --oled-bezel: #12151b;
  width: min(var(--yst-content, 1120px), calc(100% - 64px));
  margin: 0 auto;
  padding: 48px 0 64px;
  color: var(--oled-text);
  font: 400 16px/1.7 YSTBody, sans-serif;
}
body.storefront #oled :is(h2, h3, h4) { font-family: YSTBody, sans-serif; color: var(--oled-ink); letter-spacing: -0.02em; margin: 0; }
body.storefront #oled :is(button, select) { font-family: YSTBody, sans-serif; }
body.storefront #oled p { margin: 0; }

/* heading */
body.storefront #oled .oled-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 24px 48px; align-items: end; margin-bottom: 32px; }
body.storefront #oled .oled-head h2 { font-size: clamp(30px, 3.2vw, 42px); font-weight: 700; line-height: 1.15; }
body.storefront #oled .oled-head p { color: var(--oled-muted); font-size: 16px; line-height: 1.7; max-width: 60ch; }

/* viewer + detail: the screen is the hero */
body.storefront #oled .oled-stage { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 40px; align-items: center; }
body.storefront #oled .oled-viewer { margin: 0; display: grid; gap: 10px; justify-items: start; }
body.storefront #oled .oled-viewer-shot {
  width: 100%; box-sizing: border-box; padding: clamp(14px, 3vw, 36px);
  background: var(--oled-bezel); border-radius: 20px; box-shadow: 0 22px 44px -28px rgba(16, 28, 48, 0.7);
}
body.storefront #oled .oled-viewer-screen { position: relative; }
body.storefront #oled .oled-viewer-screen img { display: block; width: 100%; height: auto; }
/* the screen window inside oled-face-n.webp (1200x800), printed by make_review_images.py */
body.storefront #oled .oled-viewer-screen .oled-viewer-live {
  position: absolute; left: 18%; top: 24.875%; width: 64%; height: 48%; transition: opacity 120ms linear;
}
body.storefront #oled .oled-viewer-screen[data-size="small"] .oled-viewer-live { left: 20.75%; top: 35.5%; height: 24%; }
body.storefront #oled .oled-viewer-screen .oled-viewer-live.is-loading { opacity: 0; }
body.storefront #oled .oled-viewer-screen .oled-viewer-live[hidden] { display: none; }
body.storefront #oled .oled-detail { display: grid; gap: 12px; align-content: center; }
body.storefront #oled .oled-detail-spec { color: var(--oled-muted); font-size: 14px; }
body.storefront #oled .oled-detail h3 { font-size: 32px; font-weight: 700; line-height: 1.2; }
body.storefront #oled .oled-detail-text { font-size: 16px; line-height: 1.7; max-width: 42ch; }
body.storefront #oled .oled-detail-price { font-size: 18px; font-weight: 700; color: var(--oled-ink); }
body.storefront #oled .oled-detail-owned { justify-self: start; padding: 6px 12px; border-radius: 8px; background: #e6f5ed; color: #08724c; font-size: 14px; font-weight: 600; }
body.storefront #oled .oled-detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

/* buttons, links */
body.storefront #oled .oled-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 12px 20px;
  border: 0; border-radius: 10px; font-size: 15px; font-weight: 700; line-height: 1.3; cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}
body.storefront #oled .oled-btn-primary { background: var(--oled-yellow); color: var(--oled-text); }
body.storefront #oled .oled-btn-primary:hover:not(:disabled) { background: #ffcf00; }
body.storefront #oled .oled-btn-primary[aria-pressed="true"] { background: #fff1b3; }
body.storefront #oled .oled-btn-quiet { background: #e9f0fb; color: var(--oled-blue); }
body.storefront #oled .oled-btn-quiet:hover:not(:disabled) { background: #dbe7f8; }
body.storefront #oled .oled-btn:disabled { background: #edf1f7; color: #617087; cursor: not-allowed; }
body.storefront #oled .oled-link {
  padding: 0; border: 0; background: none; color: var(--oled-blue); font-size: 15px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 32px;
}
body.storefront #oled :is(button, a, select):focus-visible { outline: 2px solid var(--oled-blue); outline-offset: 3px; }

/* catalogue */
body.storefront #oled .oled-catalog { margin-top: 56px; }
body.storefront #oled .oled-catalog-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
body.storefront #oled .oled-catalog-head h3 { font-size: 22px; font-weight: 650; }
body.storefront #oled .oled-size { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--oled-ground); }
body.storefront #oled .oled-size button {
  min-height: 44px; padding: 8px 16px; border: 0; border-radius: 9px; background: transparent;
  color: var(--oled-text); font-size: 15px; font-weight: 600; cursor: pointer;
}
body.storefront #oled .oled-size button[aria-pressed="true"] { background: var(--oled-yellow); }
body.storefront #oled .oled-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 24px 18px; margin: 0; padding: 0; list-style: none; }
body.storefront #oled .oled-grid li { margin: 0; padding: 0; }
body.storefront #oled .oled-tile {
  display: grid; gap: 8px; width: 100%; padding: 0; border: 0; background: none; color: inherit;
  text-align: left; cursor: pointer;
}
body.storefront #oled .oled-tile-glass {
  display: block; border-radius: 12px; overflow: hidden; background: var(--oled-glass);
  box-shadow: 0 0 0 2px transparent; transition: box-shadow 160ms ease;
}
body.storefront #oled .oled-tile-glass img { display: block; width: 100%; height: auto; aspect-ratio: 420 / 228; }
body.storefront #oled .oled-tile:hover .oled-tile-glass { box-shadow: 0 0 0 2px #c4d3e8; }
body.storefront #oled .oled-tile[aria-pressed="true"] .oled-tile-glass { box-shadow: 0 0 0 3px var(--oled-blue); }
body.storefront #oled .oled-tile:focus-visible { outline: none; }
body.storefront #oled .oled-tile:focus-visible .oled-tile-glass { box-shadow: 0 0 0 3px var(--oled-blue), 0 0 0 6px #c8dcff; }
body.storefront #oled .oled-tile-name { font-size: 15px; font-weight: 600; color: var(--oled-ink); }
body.storefront #oled .oled-tile[aria-pressed="true"] .oled-tile-name { color: var(--oled-blue); }
body.storefront #oled .oled-tile-marks { display: flex; min-height: 24px; }
body.storefront #oled .oled-chip { padding: 2px 8px; border-radius: 6px; font-size: 13px; font-weight: 600; line-height: 1.6; }
body.storefront #oled .oled-chip[data-tone="owned"] { background: #e6f5ed; color: #08724c; }
body.storefront #oled .oled-chip[data-tone="order"] { background: #fff1b3; color: #574300; }

/* order bar: sticks to the bottom while a face is in the order */
body.storefront #oled .oled-order {
  position: sticky; bottom: 16px; z-index: 6; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 24px;
  align-items: center; margin-top: 28px; padding: 16px 20px; border-radius: 16px; background: var(--oled-ink); color: #eef3fb;
  box-shadow: 0 16px 32px -20px rgba(16, 28, 48, 0.8);
}
body.storefront #oled .oled-order[hidden] { display: none; }
body.storefront #oled .oled-order-text { display: grid; gap: 2px; min-width: 0; font-size: 15px; line-height: 1.5; }
body.storefront #oled .oled-order-text strong { color: #fff; font-size: 16px; }
body.storefront #oled .oled-order-board { color: #b9c6da; font-size: 14px; }
body.storefront #oled .oled-order-board[data-tone="good"] { color: #8fe3b6; }
body.storefront #oled .oled-order-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: end; }
body.storefront #oled .oled-order .oled-btn-quiet { background: transparent; color: #eef3fb; box-shadow: inset 0 0 0 1px #3a4a64; }
body.storefront #oled .oled-order .oled-btn-quiet:hover { background: #1d2c45; }
body.storefront #oled .oled-order :is(button):focus-visible { outline-color: var(--oled-yellow); }
body.storefront #oled .oled-order-note { grid-column: 1 / -1; color: #ffe57a; font-size: 14px; }
body.storefront #oled .oled-order-note:empty { display: none; }

/* flashing: one centred card like "Cập nhật thiết bị ESRC" on the sound tab (same buttons, same 44px step dots) */
body.storefront #oled .oled-flash { margin-top: 64px; scroll-margin-top: 100px; }
body.storefront #oled .oled-device {
  display: grid; justify-items: center; gap: 22px; max-width: 920px; margin: 0 auto; box-sizing: border-box;
  padding: 28px 24px 0; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; text-align: center;
}
body.storefront #oled .oled-device > h3 { font-size: 20px; font-weight: 650; }
body.storefront #oled .oled-steps { display: flex; justify-content: center; gap: 12px; width: 100%; margin: 0; padding: 0; list-style: none; }
body.storefront #oled .oled-steps li { display: grid; justify-items: center; gap: 4px; width: 150px; margin: 0; }
body.storefront #oled .oled-steps strong { font-size: 15px; font-weight: 650; color: var(--oled-ink); }
body.storefront #oled .oled-steps small { font-size: 13px; line-height: 1.4; color: var(--oled-muted); overflow-wrap: anywhere; }
body.storefront #oled .oled-step-dot {
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 4px; border-radius: 50%;
  background: #edf1f7; color: #52627a; transition: background-color 200ms ease, color 200ms ease;
}
body.storefront #oled .oled-step-dot svg { width: 22px; height: 22px; }
body.storefront #oled .oled-steps [data-state="active"] .oled-step-dot { background: #e7f0ff; color: var(--oled-blue); }
body.storefront #oled .oled-steps [data-state="busy"] .oled-step-dot { background: #e7f0ff; color: var(--oled-blue); animation: oled-pulse 1.6s ease-in-out infinite; }
body.storefront #oled .oled-steps [data-state="good"] .oled-step-dot { background: #e2f6ea; color: #08724c; }
body.storefront #oled .oled-steps [data-state="good"] small { color: #08724c; }
body.storefront #oled .oled-steps [data-state="bad"] .oled-step-dot { background: #fff0f1; color: #a11e30; }
body.storefront #oled .oled-steps [data-state="bad"] small { color: #a11e30; }
@keyframes oled-pulse { 50% { background: #cfe0ff; } }

body.storefront #oled .oled-device-row { display: grid; justify-items: center; gap: 10px; width: min(360px, 100%); }
body.storefront #oled .oled-device .oled-link { min-height: 44px; }
body.storefront #oled .oled-device-row .oled-btn { width: 100%; min-height: 48px; font-size: 15px; font-weight: 800; }
body.storefront #oled .oled-btn-connect { background: #00c853; color: #053719; }
body.storefront #oled .oled-btn-connect:hover:not(:disabled) { background: #00b84c; }
body.storefront #oled .oled-btn-connect.is-secondary { background: #e9f0fb; color: var(--oled-blue); }

/* the board's own screens: the chosen one plays its drive simulation */
body.storefront #oled .oled-mine { display: grid; gap: 12px; width: 100%; text-align: left; }
body.storefront #oled .oled-mine[hidden] { display: none; }
body.storefront #oled .oled-mine-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
body.storefront #oled .oled-mine-head strong { font-size: 16px; color: var(--oled-ink); }
body.storefront #oled .oled-mine-head span { font-size: 14px; color: var(--oled-muted); }
body.storefront #oled .oled-mine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 14px; }
body.storefront #oled .oled-mine-grid:empty { display: none; }
body.storefront #oled .oled-mine-tile {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline; width: 100%;
  padding: 10px 10px 12px; border: 0; border-radius: 14px; background: var(--oled-ground); color: inherit;
  text-align: left; cursor: pointer; box-shadow: inset 0 0 0 2px transparent; transition: box-shadow 160ms ease, background-color 160ms ease;
}
body.storefront #oled .oled-mine-tile:hover:not(:disabled) { box-shadow: inset 0 0 0 2px #c4d3e8; }
body.storefront #oled .oled-mine-tile[aria-checked="true"] { background: #eaf2ff; box-shadow: inset 0 0 0 2px var(--oled-blue); }
body.storefront #oled .oled-mine-tile:disabled { cursor: progress; }
body.storefront #oled .oled-mine-glass { grid-column: 1 / -1; display: block; margin-bottom: 6px; border-radius: 10px; overflow: hidden; background: var(--oled-glass); }
body.storefront #oled .oled-mine-glass img { display: block; width: 100%; height: auto; aspect-ratio: 420 / 228; object-fit: contain; image-rendering: pixelated; }
body.storefront #oled .oled-mine-name { font-size: 15px; font-weight: 650; color: var(--oled-ink); }
body.storefront #oled .oled-mine-size { font-size: 13px; color: var(--oled-muted); }
body.storefront #oled .oled-mine-tile[aria-checked="true"] .oled-mine-name { color: var(--oled-blue); }
body.storefront #oled .oled-mine-empty { padding: 14px 16px; border-radius: 12px; background: var(--oled-ground); font-size: 15px; line-height: 1.6; text-align: center; }
body.storefront #oled .oled-mine-empty[hidden] { display: none; }

body.storefront #oled .oled-challenge { display: grid; justify-items: center; gap: 6px; width: min(360px, 100%); }
body.storefront #oled .oled-challenge[hidden] { display: none; }
body.storefront #oled #oledTurnstileContainer { width: 100%; }
body.storefront #oled .oled-challenge-status { color: var(--oled-muted); font-size: 13px; line-height: 1.5; }
body.storefront #oled .oled-challenge-status[data-tone="good"] { color: #08724c; }
body.storefront #oled .oled-challenge-status[data-tone="bad"] { color: #a11e30; }
body.storefront #oled .oled-status {
  display: flex; align-items: flex-start; justify-content: center; gap: 8px; width: 100%; box-sizing: border-box;
  padding: 0; color: var(--oled-muted); font-size: 14px; line-height: 1.6; text-align: left;
}
body.storefront #oled .oled-status[data-tone="good"] { padding: 12px 14px; border-radius: 10px; color: #08724c; background: #e6f5ed; }
body.storefront #oled .oled-status[data-tone="busy"] { color: #274c7c; }
body.storefront #oled .oled-status[data-tone="bad"] { padding: 12px 14px; border-radius: 10px; color: #a11e30; background: #fff0f1; }
body.storefront #oled .oled-status .repair-status-mark { flex: none; width: 20px; height: 20px; margin-top: 1px; }

body.storefront #oled .oled-board-info { width: calc(100% + 48px); margin: 4px -24px 0; border-top: 1px solid #e2e8f0; text-align: left; }
body.storefront #oled .oled-board-info summary {
  display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 52px; padding: 0 20px;
  font-size: 15px; font-weight: 650; color: var(--oled-ink); cursor: pointer; list-style: none;
}
body.storefront #oled .oled-board-info summary::-webkit-details-marker { display: none; }
body.storefront #oled .oled-board-info summary::before { content: ""; width: 0; height: 0; border-left: 6px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; transition: transform 160ms ease; }
body.storefront #oled .oled-board-info[open] summary::before { transform: rotate(90deg); }
body.storefront #oled .oled-board-info summary:focus-visible { outline: 2px solid var(--oled-blue); outline-offset: -4px; }
body.storefront #oled .oled-board-info dl { display: grid; gap: 8px; max-width: 520px; margin: 0 auto; padding: 0 20px 12px; }
body.storefront #oled .oled-board-info dl div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; font-size: 14px; line-height: 1.6; }
body.storefront #oled .oled-board-info dt { color: var(--oled-muted); }
body.storefront #oled .oled-board-info dd { margin: 0; color: var(--oled-ink); overflow-wrap: anywhere; }
body.storefront #oled .oled-board-info > .oled-link { display: block; margin: 0 auto 16px; font-size: 14px; }
body.storefront #oled .oled-board-info > .oled-link:disabled { color: #8a97ab; text-decoration: none; cursor: default; }

/* purchase conditions, folded under the face detail */
body.storefront #oled .oled-needs { margin-top: 4px; font-size: 15px; }
body.storefront #oled .oled-needs summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--oled-blue); font-weight: 600; cursor: pointer; }
body.storefront #oled .oled-needs ul { display: grid; gap: 6px; margin: 4px 0 10px; padding-left: 20px; color: var(--oled-text); font-size: 15px; line-height: 1.6; }
body.storefront #oled .oled-offscreen, .oled-offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }

/* tablet */
@media (max-width: 1000px) {
  body.storefront #oled .oled-stage { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
/* phone */
@media (max-width: 760px) {
  body.storefront #oled { width: calc(100% - 32px); padding: 32px 0 44px; font-size: 15px; }
  body.storefront #oled .oled-head { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 24px; }
  body.storefront #oled .oled-head h2 { font-size: 28px; }
  body.storefront #oled .oled-detail h3 { font-size: 26px; }
  body.storefront #oled .oled-viewer-shot { border-radius: 14px; }
  body.storefront #oled .oled-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  body.storefront #oled .oled-order { grid-template-columns: minmax(0, 1fr); bottom: 84px; padding: 14px 16px; }
  body.storefront #oled .oled-order-actions { justify-content: stretch; }
  body.storefront #oled .oled-order-actions .oled-btn { flex: 1 1 auto; }
  body.storefront #oled .oled-device { padding: 22px 16px 0; gap: 18px; }
  body.storefront #oled .oled-board-info { width: calc(100% + 32px); margin: 4px -16px 0; }
  body.storefront #oled .oled-steps { gap: 4px; }
  body.storefront #oled .oled-steps li { width: auto; flex: 1 1 0; }
  body.storefront #oled .oled-board-info dl div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  body.storefront #oled .oled-mine-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.storefront #oled .oled-mine-tile { grid-template-columns: minmax(0, 1fr); padding: 8px 8px 10px; }
  body.storefront #oled .oled-detail-actions .oled-btn { flex: 1 1 auto; }
  body.storefront #oled .oled-link { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  body.storefront #oled :is(.oled-btn, .oled-tile-glass, .oled-mine-tile, .oled-step-dot) { transition: none; }
  body.storefront #oled .oled-steps [data-state="busy"] .oled-step-dot { animation: none; }
}

/* home page: a fourth tool card (OLED) */
.icon-tool-oled { --icon-scale: 1.32; }
/* 2 x 2 from tablet up: four cards in one row were too narrow (titles wrapped to three lines) */
@media (min-width: 761px) {
  body.storefront #home .home-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto auto; }
  body.storefront #home [data-region="tools-heading"] { grid-column: 1; grid-row: 1; }
  body.storefront #home [data-region="tools-description"] { grid-column: 2; grid-row: 1; }
  body.storefront #home .home-tools .home-tool-sound { grid-column: 1; grid-row: 2; }
  body.storefront #home .home-tools .home-tool-firmware { grid-column: 2; grid-row: 2; }
  body.storefront #home .home-tools .home-tool-oled { grid-column: 1; grid-row: 3; }
  body.storefront #home .home-tools .home-tool-download { grid-column: 2; grid-row: 3; }
}
