/*
 * assets/store/account.css: the buyer account pages on /products/
 * (2026-10-29, SPEC2 D12): dashboard, settings, reviews, subscriptions,
 * documents and the spending part of billing. Loaded through the page's
 * `storeStyles: ["account.css"]` after store.css.
 *
 * Only var(--dhs-*) tokens, so html.dark flips everything with the rest of
 * the store. Every class starts dhs-ac-. Built on the kit (store-ui-kit.md):
 * cards, rows, chips, badges, tabs, alerts and empty states come from
 * store.css; this file adds the pieces the kit has no component for.
 */

/* ── Page head with an avatar (dashboard) ─────────────────────────────────── */
.dhs-ac-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; margin: 16px 0 24px; }
.dhs-ac-hero__text { flex: 1 1 260px; min-width: 0; }
.dhs-ac-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; flex: 1 1 100%; }
.dhs-ac-hero__actions .dhs-btn { flex: 1 1 140px; }
@media (min-width: 600px) {
  .dhs-ac-hero { margin-bottom: 32px; }
  .dhs-ac-hero__actions { flex: 0 0 auto; }
  .dhs-ac-hero__actions .dhs-btn { flex: 0 0 auto; }
}
.dhs-ac-hero .dhs-pagehead__sub { margin-top: 4px; }

/* ── Stat tiles ───────────────────────────────────────────────────────────── */
.dhs-ac-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 24px; padding: 0; list-style: none; }
@media (min-width: 600px) { .dhs-ac-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1160px) { .dhs-ac-stats--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (min-width: 900px) { .dhs-ac-stats--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.dhs-ac-stat { display: flex; flex-direction: column; gap: 6px; height: 100%; min-width: 0; padding: 16px; border: 1px solid var(--dhs-border); border-radius: var(--dhs-r); background: var(--dhs-bg); color: inherit; text-decoration: none; }
a.dhs-ac-stat:hover { border-color: var(--dhs-text-strong); }
a.dhs-ac-stat:focus-visible { outline: 2px solid var(--dhs-focus); outline-offset: 2px; }
.dhs-ac-stat__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; color: var(--dhs-text-muted); }
/* Two columns on a phone: a label may take two lines, so every label row
   keeps room for two and the numbers line up across a row of tiles. */
@media (max-width: 599px) { .dhs-ac-stat__top { min-height: 40px; } }
.dhs-ac-stat__label { font-size: 14px; line-height: 20px; color: var(--dhs-text-body); }
.dhs-ac-stat__value { font-size: 24px; line-height: 30px; font-weight: 600; color: var(--dhs-text-strong); overflow-wrap: anywhere; }
@media (min-width: 600px) { .dhs-ac-stat__value { font-size: 28px; line-height: 34px; } }
.dhs-ac-stat__note { font-size: 12px; line-height: 18px; color: var(--dhs-text-muted); }
.dhs-ac-stat.is-attention { border-color: var(--dhs-accent); box-shadow: inset 0 0 0 1px var(--dhs-accent); }
.dhs-ac-stat.is-attention .dhs-ac-stat__top { color: var(--dhs-accent); }
.dhs-ac-stat--skel { gap: 10px; }

/* ── Lists inside cards (orders, conversations, offers, reviews, files) ───── */
.dhs-ac-list { margin: 0; padding: 0; list-style: none; }
.dhs-ac-item { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--dhs-border-faint); color: inherit; text-decoration: none; min-width: 0; }
.dhs-ac-list > li:first-child > .dhs-ac-item, .dhs-ac-list > .dhs-ac-item:first-child { border-top: 0; }
a.dhs-ac-item:hover { background: var(--dhs-bg-subtle); }
a.dhs-ac-item:focus-visible { outline: 2px solid var(--dhs-focus); outline-offset: -2px; }
@media (min-width: 600px) { .dhs-ac-item { padding-inline: 24px; } }
.dhs-ac-item__media { flex: none; width: 72px; aspect-ratio: 5 / 3; border-radius: var(--dhs-r-sm); overflow: hidden; background: var(--dhs-bg-media); border: 1px solid var(--dhs-border-faint); }
.dhs-ac-item__media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: left center; }
.dhs-ac-item__media--icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; aspect-ratio: 1; border-radius: var(--dhs-r); color: var(--dhs-text-heading); }
.dhs-ac-item__main { flex: 1 1 auto; min-width: 0; }
.dhs-ac-item__title { font-size: 15px; line-height: 21px; font-weight: 600; color: var(--dhs-text-strong); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dhs-ac-item__sub { display: block; margin-top: 2px; font-size: 13px; line-height: 19px; color: var(--dhs-text-muted); overflow-wrap: anywhere; }
.dhs-ac-item__line { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; line-height: 19px; color: var(--dhs-text-body); }
.dhs-ac-item__preview { margin-top: 4px; font-size: 14px; line-height: 20px; color: var(--dhs-text-body); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.dhs-ac-item.is-unread .dhs-ac-item__title, .dhs-ac-item.is-unread .dhs-ac-item__preview { color: var(--dhs-text-strong); font-weight: 700; }
.dhs-ac-item__end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 13px; line-height: 19px; color: var(--dhs-text-muted); text-align: right; }
/* A row whose end is a whole button ("Leave a review"): on phones the button
   takes its own line under the text instead of squeezing the title to one
   letter per line (seen at 360px, 2026-10-29). */
@media (max-width: 599px) {
  .dhs-ac-item--action { flex-wrap: wrap; }
  .dhs-ac-item--action .dhs-ac-item__end { flex: 1 1 100%; align-items: stretch; }
  .dhs-ac-item--action .dhs-ac-item__end .dhs-btn { width: 100%; justify-content: center; }
}
.dhs-ac-item__amount { font-size: 15px; line-height: 21px; font-weight: 700; color: var(--dhs-text-strong); white-space: nowrap; }
.dhs-ac-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--dhs-r-pill); background: var(--dhs-accent); color: var(--dhs-on-accent); font-size: 12px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.dhs-card__title .dhs-ac-count { margin-left: 6px; vertical-align: 1px; }
.dhs-ac-more { display: flex; justify-content: center; padding: 12px 20px 16px; border-top: 1px solid var(--dhs-border-faint); }
.dhs-ac-card-empty { padding: 32px 20px; }
.dhs-ac-card-empty.dhs-empty { padding-block: 32px; }

/* ── Account links (dashboard side card) ──────────────────────────────────── */
.dhs-ac-links { margin: 0; padding: 4px 0; list-style: none; }
.dhs-ac-link { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: var(--dhs-text-heading); text-decoration: none; font-size: 15px; line-height: 21px; font-weight: 600; }
.dhs-ac-link:hover { background: var(--dhs-bg-subtle); color: var(--dhs-text-strong); }
.dhs-ac-link:focus-visible { outline: 2px solid var(--dhs-focus); outline-offset: -2px; }
.dhs-ac-link > .dhs-icon:first-child { color: var(--dhs-text-muted); }
.dhs-ac-link > span { flex: 1 1 auto; min-width: 0; }
.dhs-ac-link > .dhs-icon:last-child { color: var(--dhs-text-muted); }
@media (min-width: 600px) { .dhs-ac-link { padding-inline: 24px; } }

/* ── Money summary (dashboard side card, billing) ─────────────────────────── */
.dhs-ac-money { display: flex; flex-direction: column; gap: 4px; }
.dhs-ac-money__main { font-size: 28px; line-height: 34px; font-weight: 600; color: var(--dhs-text-strong); overflow-wrap: anywhere; }
.dhs-ac-money__more { font-size: 14px; line-height: 21px; color: var(--dhs-text-body); }

/* ── Spending chart (billing): inline SVG drawn at the real width ─────────── */
.dhs-ac-chart { margin: 0; }
.dhs-ac-chart__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.dhs-ac-chart__title { font-size: 16px; line-height: 24px; font-weight: 700; color: var(--dhs-text-strong); }
.dhs-ac-chart__sub { font-size: 13px; line-height: 19px; color: var(--dhs-text-muted); }
.dhs-ac-chart__plot { position: relative; min-height: 240px; }
.dhs-ac-chart__plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.dhs-ac-chart__plot.is-table { min-height: 0; }
.dhs-ac-grid { stroke: var(--dhs-border-light); stroke-width: 1; shape-rendering: crispEdges; }
.dhs-ac-base { stroke: var(--dhs-border); stroke-width: 1; shape-rendering: crispEdges; }
.dhs-ac-tick { fill: var(--dhs-text-muted); font-size: 11px; font-family: var(--dhs-font); font-variant-numeric: tabular-nums; }
.dhs-ac-tick--year { font-weight: 600; fill: var(--dhs-text-body); }
.dhs-ac-vlabel { fill: var(--dhs-text-strong); font-size: 11px; font-weight: 600; font-family: var(--dhs-font); }
.dhs-ac-bar { fill: var(--dhs-accent); transition: fill .12s var(--dhs-ease); }
.dhs-ac-col { cursor: default; outline: none; }
.dhs-ac-col__hit { fill: transparent; }
.dhs-ac-col:hover .dhs-ac-bar, .dhs-ac-col:focus .dhs-ac-bar, .dhs-ac-col.is-on .dhs-ac-bar { fill: var(--dhs-accent-hover); }
.dhs-ac-col:hover .dhs-ac-col__hit, .dhs-ac-col.is-on .dhs-ac-col__hit { fill: var(--dhs-accent-soft); }
.dhs-ac-col:focus-visible .dhs-ac-col__hit { stroke: var(--dhs-focus); stroke-width: 2; fill: var(--dhs-accent-soft); }
.dhs-ac-tip { position: absolute; z-index: 2; min-width: 120px; max-width: 220px; padding: 8px 10px; border: 1px solid var(--dhs-border); border-radius: var(--dhs-r); background: var(--dhs-bg); box-shadow: var(--dhs-shadow-2); pointer-events: none; transform: translate(-50%, calc(-100% - 8px)); }
.dhs-ac-tip[hidden] { display: none; }
.dhs-ac-tip__value { display: block; font-size: 15px; line-height: 21px; font-weight: 700; color: var(--dhs-text-strong); white-space: nowrap; }
.dhs-ac-tip__label { display: block; font-size: 12px; line-height: 17px; color: var(--dhs-text-muted); white-space: nowrap; }
.dhs-ac-chart__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 8px; }

/* ── Category breakdown (billing) ─────────────────────────────────────────── */
.dhs-ac-cats { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.dhs-ac-cat { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: baseline; }
.dhs-ac-cat__name { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--dhs-text-strong); overflow-wrap: anywhere; }
.dhs-ac-cat__value { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--dhs-text-strong); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dhs-ac-cat__share { color: var(--dhs-text-muted); font-weight: 400; }
.dhs-ac-cat .dhs-meter { grid-column: 1 / -1; height: 8px; }
.dhs-ac-cat .dhs-meter::-webkit-progress-value { background: var(--dhs-accent); }
.dhs-ac-cat .dhs-meter::-moz-progress-bar { background: var(--dhs-accent); }
.dhs-ac-cat__orders { grid-column: 1 / -1; font-size: 12px; line-height: 17px; color: var(--dhs-text-muted); }

/* ── Currency switch (billing, above everything it scopes) ────────────────── */
.dhs-ac-currencies { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.dhs-ac-currencies .dhs-chip { height: 36px; }

/* ── Spending layout (billing) ────────────────────────────────────────────── */
.dhs-ac-spend { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 900px) { .dhs-ac-spend { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 24px; align-items: start; } }

/* ── Settings ─────────────────────────────────────────────────────────────── */
.dhs-ac-avatar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; }
.dhs-ac-avatar__img { display: inline-flex; }
.dhs-ac-avatar__img .dhs-avatar { --dhs-av: 96px; font-size: 40px; }
.dhs-ac-avatar__info { flex: 1 1 180px; min-width: 0; }
.dhs-ac-avatar__name { font-size: 18px; line-height: 26px; font-weight: 700; color: var(--dhs-text-strong); overflow-wrap: anywhere; }
.dhs-ac-avatar__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dhs-ac-avatar.is-busy .dhs-ac-avatar__img { opacity: .55; }
.dhs-ac-form { display: flex; flex-direction: column; gap: 24px; }
.dhs-ac-form .dhs-card__body { display: flex; flex-direction: column; gap: 16px; }
.dhs-ac-readonly { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 44px; padding: 10px 12px; border: 1px dashed var(--dhs-border); border-radius: var(--dhs-r); background: var(--dhs-bg-subtle); color: var(--dhs-text-strong); font-size: 16px; line-height: 22px; overflow-wrap: anywhere; }
.dhs-ac-tzrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dhs-ac-tzrow .dhs-select { flex: 1 1 220px; min-width: 0; }
.dhs-ac-save { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 4px; }
.dhs-ac-save .dhs-btn { flex: 0 0 auto; }
@media (max-width: 599px) { .dhs-ac-save .dhs-btn { flex: 1 1 100%; } }
.dhs-ac-save__status { flex: 1 1 auto; font-size: 14px; line-height: 20px; color: var(--dhs-text-muted); }

/* ── Reviews ──────────────────────────────────────────────────────────────── */
.dhs-ac-rev { display: flex; flex-direction: column; gap: 10px; padding: 20px; border: 1px solid var(--dhs-border); border-radius: var(--dhs-r); background: var(--dhs-bg); min-width: 0; }
@media (min-width: 600px) { .dhs-ac-rev { padding: 24px; } }
.dhs-ac-rev__top { display: flex; align-items: flex-start; gap: 12px; }
.dhs-ac-rev__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; line-height: 19px; color: var(--dhs-text-muted); }
.dhs-ac-rev__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding-top: 12px; border-top: 1px solid var(--dhs-border-faint); }
.dhs-ac-rev .dhs-review__reply { margin-top: 4px; }

/* ── Documents ────────────────────────────────────────────────────────────── */
.dhs-ac-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; }
.dhs-ac-filters__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dhs-ac-filters__chips .dhs-chip { height: 36px; }
.dhs-ac-filters__order { flex: 1 1 200px; max-width: 320px; }
.dhs-ac-doc__name { display: block; font-size: 15px; line-height: 21px; font-weight: 600; color: var(--dhs-text-strong); overflow-wrap: anywhere; }
.dhs-ac-doc__name a { color: inherit; text-decoration: none; }
.dhs-ac-doc__name a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Subscriptions ────────────────────────────────────────────────────────── */
.dhs-ac-subs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 900px) { .dhs-ac-subs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dhs-ac-sub__price { font-size: 22px; line-height: 28px; font-weight: 600; color: var(--dhs-text-strong); }
.dhs-ac-sub__price span { font-size: 14px; font-weight: 400; color: var(--dhs-text-muted); }

/* A loading block keeps its place while data comes in. */
.dhs-ac-skel-list { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; }
