/* One game face, with enough room for labels and exact numeric values. */
:root {
  --font-ui: "RuneMarket RuneScape", monospace;
  --mono: var(--font-ui);
  --numbers: var(--font-ui);
  --sidebar-width: 240px;
  --selection: #dfc58e;
}
:root[data-theme="light"] {
  --selection: #765a23;
}
body,
body *,
body *::before,
body *::after {
  font-family: var(--font-ui) !important;
  letter-spacing: 0 !important;
}
body {
  font-size: 18px;
  line-height: 1.4;
  font-feature-settings: normal;
}
button,
input,
select,
textarea {
  font-family: inherit;
}
.page-heading h1 {
  font-size: clamp(26px, 2.8vw, 36px);
  line-height: 1.2;
}
.section-heading h2,
.overview-heading h2 {
  font-size: 25px;
  line-height: 1.3;
}
.method-panel h2,
.settings-section h2 {
  font-size: 22px;
  line-height: 1.4;
}
.market-table td,
.market-table th {
  line-height: 1.4;
}
.market-table .cell-subline {
  line-height: 1.3;
}
.market-table th button {
  font-size: 16px;
}
.market-table td.number {
  font-size: 19px;
}
#alert-count {
  min-width: 19px;
  height: 19px;
  padding-inline: 3px;
  font-size: 14px;
  line-height: 1;
}
.price-block-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.price-block:last-child {
  display: block;
}
.block-time {
  gap: 8px;
}
.block-prices {
  min-width: 0;
  gap: 16px;
}
.block-prices > span {
  min-width: 0;
}
.block-prices strong {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.block-prices strong em {
  margin-left: 0;
}
.history-page-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}
.history-page-top > .history-item-identity {
  margin: 0;
  min-width: 0;
  font-size: 21px;
}
.history-item-identity strong {
  font-weight: 400;
  overflow-wrap: anywhere;
}
.history-item-identity img {
  flex-shrink: 0;
}
.history-share-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.history-share-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 17px;
  white-space: nowrap;
}
.history-share-actions svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.ticket-nearby > div:first-child {
  flex-wrap: wrap;
  gap: 6px 14px;
}
.ticket-period > div:first-child {
  min-width: 0;
}
.account-identity > div {
  min-width: 0;
}
.account-identity h2,
.account-identity p {
  overflow-wrap: anywhere;
}
.page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}
.page-heading h1,
.page-heading-actions {
  min-width: 0;
}
.page-heading-actions {
  width: auto;
  max-width: none;
  flex-direction: row;
}
.feed-copy {
  min-width: 0;
}
.feed-copy strong {
  font-size: 17px;
}
.feed-copy small {
  font-size: 14px;
}
.section-heading > div,
.asset-identity,
.asset-identity > div {
  min-width: 0;
}
.asset-heading {
  align-items: start;
  gap: 16px;
}
.asset-name-line h2 {
  overflow-wrap: anywhere;
}
.asset-actions {
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}
.item-share-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 17px;
}
.item-share-button svg {
  width: 16px;
  height: 16px;
}
.asset-stats > div,
.market-summary > div {
  min-width: 0;
}
.asset-stats strong {
  overflow-wrap: anywhere;
}
.text-button,
.primary-button,
.secondary-button {
  line-height: 1.2;
}
.primary-button,
.secondary-button {
  min-width: 0;
}

/* A selected inventory tab: one restrained gold edge and a pixel pointer. */
.sidebar-pages {
  gap: 5px;
}
.sidebar-pages .sidebar-link {
  border: 1px solid transparent;
  min-height: 48px;
  padding: 9px 11px;
  gap: 11px;
  font-size: 18px;
  line-height: 1.3;
}
.sidebar-pages .sidebar-link > span:not(.nav-sprite):not(.nav-current) {
  flex: 1;
  white-space: nowrap;
}
.sidebar-pages .sidebar-link.active {
  background: var(--subtle);
  border-color: color-mix(in srgb, var(--selection) 48%, var(--line));
  color: var(--selection);
}
.sidebar-pages .sidebar-link.active > span {
  text-decoration: none;
}
.sidebar-pages .sidebar-link.active > .nav-sprite {
  opacity: 1;
}
.nav-current {
  display: none;
  flex: 0 0 8px;
  width: 8px;
  height: 13px;
  background: var(--selection);
  clip-path: polygon(0 0, 44% 0, 100% 50%, 44% 100%, 0 100%, 56% 50%);
}
.sidebar-link.active > .nav-current {
  display: block;
}
.nav-selection-corners {
  display: none !important;
}
.sidebar-signin,
.sidebar-create {
  font-size: 17px;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-storage {
  font-size: 14px;
  line-height: 1.4;
}
.sidebar-sound,
.sidebar-shortcuts {
  font-size: 16px;
  line-height: 1.4;
}

/* Profile controls share the same portrait in the rail, header and menu. */
.profile-portrait {
  display: inline-grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--subtle);
  color: var(--accent);
  font-size: 25px;
  line-height: 1;
}
.profile-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-portrait img[src^="/assets/"] {
  object-fit: contain;
  padding: 4px;
  image-rendering: pixelated;
}
.sidebar-profile .profile-copy strong {
  font-size: 18px;
  line-height: 1.25;
}
.sidebar-profile .profile-copy small {
  font-size: 14px;
  line-height: 1.2;
}
.sidebar-profile > [data-icon] svg {
  transition: transform 160ms ease;
}
.sidebar-profile[aria-expanded="true"] > [data-icon] svg {
  transform: rotate(180deg);
}
[data-profile-toggle][aria-expanded="true"] .profile-portrait {
  border-color: var(--selection);
}
#account-avatar {
  padding: 0;
  border: 0;
  min-width: 34px;
}
#account-avatar .profile-portrait {
  width: 32px;
  height: 32px;
  font-size: 22px;
}
.profile-menu {
  animation: profile-open 150ms ease-out both;
}
@keyframes profile-open {
  from {
    opacity: 0;
    clip-path: inset(0 0 6% 0);
  }
  to {
    opacity: 1;
    clip-path: inset(0);
  }
}
.profile-menu-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px 16px;
  margin-bottom: 5px;
  border-bottom: 1px solid var(--line);
}
.profile-menu-identity > span:last-child {
  display: block;
  min-width: 0;
}
.profile-menu-identity strong,
.profile-menu-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-menu-identity strong {
  font-size: 20px;
  line-height: 1.4;
}
.profile-menu-identity small {
  font-size: 16px;
  line-height: 1.3;
  color: var(--muted);
}
.profile-menu {
  min-width: 0 !important;
}
.profile-menu .link-menu a,
.profile-menu .link-menu button {
  min-height: 43px;
  font-size: 18px;
}
.profile-menu .link-menu a > svg {
  transform: rotate(-90deg);
}
.account-identity > .profile-portrait {
  width: 62px;
  height: 62px;
  flex-basis: 62px;
  font-size: 37px;
}
.profile-photo-editor {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px 18px;
  margin: 20px 0 24px;
}
#profile-photo-preview .profile-portrait {
  width: 76px;
  height: 76px;
  font-size: 44px;
}
.profile-photo-controls {
  min-width: 0;
}
.profile-photo-controls > strong {
  font-size: 20px;
  font-weight: 400;
}
.profile-photo-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px 16px;
  margin-top: 10px;
}
.profile-photo-actions .secondary-button {
  position: relative;
  margin: 0;
  font-size: 17px;
  cursor: pointer;
}
#profile-photo {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.profile-photo-actions .secondary-button:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.profile-photo-controls p {
  margin: 12px 0 0;
  font-size: 16px;
  line-height: 1.4;
  color: var(--muted);
}
.profile-photo-presets {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.profile-photo-presets button {
  width: 40px;
  height: 40px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.profile-photo-presets img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}
.profile-photo-presets [aria-pressed="true"] {
  border-color: var(--selection);
  background: var(--subtle);
}
.profile-photo-status {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  color: var(--muted);
}
.profile-photo-status:empty {
  display: none;
}
.profile-photo-actions [hidden] {
  display: none;
}

/* Item cards are purpose-built PNGs; preview and actions form one compact tool. */
.capture-dialog {
  width: min(820px, calc(100vw - 24px));
  max-width: 820px;
}
.share-card-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 18px;
}
.share-card-heading p {
  margin: 0 !important;
  font-size: 19px;
  color: var(--text);
}
.share-card-heading > span {
  font-size: 16px;
  color: var(--muted);
}
.capture-preview {
  padding: 0;
  border: 1px solid var(--line);
  overflow: hidden;
  max-height: none;
}
.capture-preview img {
  width: 100%;
  height: auto;
  max-height: 45dvh;
  object-fit: contain;
  cursor: default;
  background: #101310;
}
.capture-name-row {
  margin-top: 18px;
  align-items: center;
  gap: 12px;
}
.capture-name-row > label {
  font-size: 17px;
}
.capture-name-row input {
  width: 100%;
  font-size: 17px;
  min-height: 38px;
}
.capture-name-row small {
  font-size: 16px;
}
.capture-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
  margin-top: 20px;
}
.capture-actions > button,
.capture-actions > button:first-child {
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 12px;
  justify-content: center;
  font-size: 18px;
  gap: 9px;
}
.capture-actions svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}
.capture-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 16px;
  line-height: 1.4;
}
.capture-link-row .text-button {
  font-size: 17px;
}
.capture-copy-status {
  min-height: 0;
  margin: 12px 0 0 !important;
  color: var(--muted);
  font-size: 16px !important;
}
.capture-copy-status:empty {
  display: none;
}

/* The search launcher has its own stable row, independent of title length. */
.overview-search {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  margin: 0 0 26px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  text-align: left;
  font-size: 20px;
}
.overview-search:hover {
  border-color: var(--secondary);
  background: var(--subtle);
}
.overview-search svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}
.overview-search kbd {
  font-size: 16px;
  color: var(--muted);
}
.overview-heading {
  margin-bottom: 18px;
}
.overview-heading > div {
  min-width: 0;
}
.overview-value > strong {
  font-size: clamp(34px, 3.6vw, 46px);
}
.overview-leader {
  gap: 10px;
}
.overview-leader > .overview-leader-price {
  max-width: 40%;
}
.overview-leader strong {
  font-size: 18px;
}
.overview-leader small {
  font-size: 14px;
}
.overview-direction-values {
  flex-wrap: wrap;
}
.topbar .global-search {
  flex: 1;
  min-width: 0;
  width: auto;
  max-width: 480px;
  font-size: 19px;
}
.topbar .global-search > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-actions {
  flex: 0 0 auto;
}

/* Capacity-aware treemap: weighted rectangles tessellate without tiny tiles. */
.market-map.treemap-surface {
  display: block;
  position: relative;
  min-height: 240px;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--bg);
  border-radius: 4px;
}
.market-map.treemap-surface[hidden] {
  display: none;
}
.treemap-surface .map-tile {
  position: absolute;
  display: flex;
  padding: 13px;
  border: 2px solid var(--bg);
  border-radius: 0;
  margin: 0;
  min-width: 0;
  min-height: 0;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}
.treemap-surface .map-tile:hover,
.treemap-surface .map-tile:focus-visible {
  border-color: var(--secondary);
  outline: none;
}
.treemap-surface .map-tile-body {
  justify-content: center;
  min-width: 0;
  min-height: 0;
  gap: 8px;
}
.treemap-surface .map-tile-head {
  min-height: 36px;
  gap: 8px;
}
.treemap-surface .map-tile-head strong {
  font-size: 17px;
  line-height: 1.1;
  -webkit-line-clamp: 2;
}
.treemap-surface .map-tile-head img {
  width: 26px;
  height: 26px;
}
.treemap-surface .map-tile-change {
  font-size: 28px;
  line-height: 1;
}
.treemap-surface .map-tile-change small {
  font-size: 14px;
}
.treemap-surface .map-tile-price,
.treemap-surface .map-tile-volume {
  gap: 2px;
}
.treemap-surface .map-tile-price > small,
.treemap-surface .map-tile-volume > small {
  font-size: 14px;
  line-height: 1.2;
}
.treemap-surface .map-tile-price strong,
.treemap-surface .map-tile-volume strong {
  font-size: 21px;
  line-height: 1.1;
  white-space: nowrap;
}
.treemap-surface .map-tile-price strong > span {
  font-size: 14px;
}
.treemap-surface .map-activity-track {
  margin-top: 5px;
}
.treemap-surface .empty-state {
  width: 100%;
  padding: 32px;
}
.map-toolbar label {
  min-width: 0;
}
.map-view-toolbar {
  flex-wrap: wrap;
}
.map-list-header,
.map-list-row {
  font-size: 17px;
}
.map-list-row > span {
  min-width: 0;
}
.map-list-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

@container workspace (max-width: 760px) {
  .history-page-top {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
  }
  .history-page-top > .history-item-identity {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
  }
  .history-share-actions {
    gap: 14px;
  }
  .history-share-actions [data-capture] {
    width: 34px;
    min-height: 34px;
    padding: 8px;
  }
  .history-share-actions [data-capture] > span {
    display: none;
  }
  .overview-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .item-share-button {
    padding: 7px;
    width: 32px;
  }
  .item-share-button > span:last-child {
    display: none;
  }
  .overview-heading h2 {
    font-size: 23px;
  }
  .overview-footer {
    flex-wrap: wrap;
  }
  .section-heading {
    flex-wrap: wrap;
    gap: 12px;
  }
  .table-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .table-search-row .table-search,
  .table-search-row .table-search input {
    width: 100%;
    min-width: 0;
  }
  .table-view-controls {
    justify-content: space-between;
  }
  .asset-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 1099px) {
  :root {
    --sidebar-width: 0px;
  }
  .topbar > .brand {
    display: none;
  }
  .topbar {
    gap: 12px;
    padding-inline: 20px;
  }
}
@media (max-width: 600px) {
  .ticket-volume-strip[data-block-count="7"] > button:first-child,
  .ticket-volume-strip[data-block-count="7"] > button:last-child {
    display: none;
  }
  .topbar {
    gap: 10px;
    padding-inline: 16px;
  }
  #sound-button {
    display: none;
  }
  .topbar .global-search {
    display: flex;
    width: auto;
    flex: 1;
    margin: 0;
    padding: 9px;
    gap: 8px;
    min-height: 38px;
  }
  .topbar .global-search > span:nth-child(2) {
    display: block;
    font-size: 17px;
  }
  .topbar .global-search kbd {
    display: none;
  }
  .header-actions {
    gap: 5px;
  }
  .page-heading {
    gap: 10px;
  }
  .page-heading-actions {
    gap: 0;
    justify-content: end;
  }
  .feed-copy small {
    font-size: 14px;
  }
  .profile-photo-editor {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 12px;
  }
  #profile-photo-preview .profile-portrait {
    width: 62px;
    height: 62px;
    font-size: 36px;
  }
  .capture-dialog .dialog-body {
    padding: 16px;
  }
  .capture-name-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .capture-actions {
    gap: 9px;
  }
  .capture-actions > button {
    font-size: 17px;
    padding: 11px 8px;
  }
  .capture-link-row > span {
    font-size: 14px;
  }
  .overview-search {
    margin-bottom: 23px;
  }
  .profile-menu {
    min-width: 0 !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .profile-menu {
    animation: none;
  }
  .sidebar-profile > [data-icon] svg {
    transition: none;
  }
}
:root[data-reduced-motion="true"] .profile-menu {
  animation: none;
}
:root[data-reduced-motion="true"] .sidebar-profile > [data-icon] svg {
  transition: none;
}

/* Search and synchronisation share one stable header row. */
.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 24px;
}
.topbar > .brand {
  display: none;
}
.topbar .global-search,
.auth-page .topbar .global-search {
  display: flex;
  width: 100%;
  max-width: 520px;
  min-width: 0;
}
.topbar .header-actions {
  margin-left: 0;
}
.topbar .feed-sync {
  display: block;
  position: relative;
  width: auto;
  min-width: 0;
  padding: 0 16px;
  border-inline: 1px solid var(--line);
}
.topbar #refresh-button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  min-height: 38px;
  white-space: nowrap;
  border: 0;
  opacity: 1;
}
.topbar #refresh-button:hover .feed-copy strong {
  color: var(--accent);
}
.topbar #refresh-button .feed-copy {
  gap: 3px;
}
.topbar .feed-copy strong {
  font-size: 18px;
  line-height: 1.15;
}
.topbar .feed-copy small {
  font-size: 15px;
  line-height: 1.15;
  white-space: nowrap;
}
.topbar .feed-emblem {
  width: 28px;
  height: 31px;
}
.topbar .feed-action {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
}
.topbar .feed-action svg {
  width: 15px;
  height: 15px;
  margin: 0;
}
.topbar .sync-track {
  left: 16px;
  right: 16px;
  bottom: -7px;
}
.topbar .syncing .feed-action svg {
  animation: feed-rotate 900ms linear infinite;
}
.page-heading {
  align-items: end;
}
.page-heading-actions:empty {
  display: none;
}
.page-map-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 19px;
  padding: 9px 13px;
  white-space: nowrap;
  min-height: 41px;
}
.page-map-link img {
  object-fit: contain;
  image-rendering: pixelated;
}
.page-map-link[hidden],
.item-back[hidden] {
  display: none;
}
.item-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.25;
}
.item-back svg {
  width: 16px;
  height: 16px;
}
.item-back:hover {
  color: var(--accent);
}
.ticker[hidden] {
  display: none;
}
.route-skeleton {
  display: block;
  width: min(100%, 600px);
  height: 130px;
  background: var(--subtle);
  border-block: 1px solid var(--line);
}

/* Catalog actions stay together; there is one search entry in the header. */
.market-browser > .section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 20px;
}
.market-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 9px;
}
.market-actions > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 17px;
  min-height: 38px;
  padding: 8px 11px;
}
.market-actions > [hidden] {
  display: none;
}
.market-actions img {
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.market-actions #export-button {
  padding-inline: 8px;
}
.table-search-row {
  display: flex;
  justify-content: end;
  margin-top: 14px;
}
.table-view-controls {
  flex: 1;
  justify-content: space-between;
  min-width: 0;
}
.market-query {
  margin-left: auto;
  color: var(--accent);
  max-width: min(100%, 340px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.market-query[hidden],
.search-market-results[hidden] {
  display: none;
}
.search-market-results {
  display: block;
  width: calc(100% - 36px);
  margin: 12px 18px;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--accent);
  font-size: 18px;
  overflow-wrap: anywhere;
}
.search-market-results:hover {
  border-color: var(--secondary);
  background: var(--subtle);
}

/* A live receipt pair makes trade direction and reporting times explicit. */
.activity-heading {
  margin-bottom: 22px;
}
.activity-heading h2 {
  font-size: 29px;
  line-height: 1.2;
}
.activity-heading p {
  margin-top: 7px;
  font-size: 17px;
}
.activity-receipts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.trade-receipt {
  min-width: 0;
  padding: 23px;
  background: var(--surface);
}
.trade-receipt + .trade-receipt {
  border-left: 1px solid var(--line);
}
.receipt-label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.receipt-label h3 {
  font-size: 21px;
  line-height: 1.3;
  margin: 0;
  font-weight: 400;
}
.receipt-label img {
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.receipt-label > svg {
  width: 17px;
  height: 17px;
  margin-left: auto;
  opacity: 0.7;
}
.buy-receipt .receipt-label,
.buy-receipt .receipt-price {
  color: var(--accent);
}
.sell-receipt .receipt-label,
.sell-receipt .receipt-price {
  color: #d7ba83;
}
:root[data-theme="light"] .sell-receipt .receipt-label,
:root[data-theme="light"] .sell-receipt .receipt-price {
  color: #89651c;
}
.receipt-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.receipt-price > .coin-sprite {
  display: none;
}
.receipt-price strong {
  min-width: 0;
  font-size: clamp(29px, 3cqw, 39px);
  font-weight: 400;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.receipt-price small {
  color: var(--muted);
  font-size: 17px;
}
.trade-receipt time {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 16px;
  font-size: 16px;
  color: var(--muted);
}
.trade-receipt time > span:last-child {
  color: var(--text);
}
.activity-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 20px 0 28px;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}
.activity-facts > div {
  min-width: 0;
}
.activity-facts span {
  display: block;
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 7px;
}
.activity-facts strong {
  display: block;
  font-size: 21px;
  line-height: 1.3;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.recent-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-top: 31px;
}
.recent-heading h3 {
  margin: 0;
  font-size: 27px;
  line-height: 1.2;
  font-weight: 400;
}
.recent-heading > div > span {
  display: block;
  color: var(--muted);
  margin-top: 7px;
  font-size: 17px;
}
.recent-heading > .text-button {
  white-space: nowrap;
  font-size: 18px;
}
.block-legend {
  font-size: 16px;
  margin-block: 18px 0;
}
.block-legend > span {
  font-size: 16px;
}
.block-legend p {
  margin-top: 7px;
  font-size: 16px;
}
.price-block-grid {
  gap: 13px;
}
.price-block {
  padding: 18px;
  border-radius: 3px;
}
.block-time {
  font-size: 20px;
  color: var(--text);
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}
.block-time > span {
  color: var(--muted);
  font-size: 17px;
}
.block-prices {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 17px;
  margin: 18px 0;
}
.block-prices > span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  padding-left: 10px;
  border-left: 2px solid currentColor;
}
.block-prices small {
  grid-column: 1;
  grid-row: 1;
  font-size: 17px;
  line-height: 1.2;
  color: inherit;
}
.block-prices strong {
  grid-column: 2;
  grid-row: 1 / 3;
  display: flex;
  gap: 8px;
  font-size: 25px;
  line-height: 1.1;
  white-space: nowrap;
}
.block-prices strong em {
  font-size: 16px;
  font-style: normal;
  color: var(--muted);
}
.block-prices > span > span {
  grid-column: 1;
  grid-row: 2;
  font-size: 16px;
  line-height: 1.2;
  color: var(--muted);
}
.block-volume-bar {
  height: 4px;
  background: color-mix(in srgb, #d7ba83 48%, var(--bg));
}
.block-volume-text {
  font-size: 16px;
  gap: 10px;
}
.block-volume-text > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 17px;
  white-space: nowrap;
}

/* Comparison uses the selected inventory, rather than a decorative chart. */
.page-market .compare-prompt,
.compare-prompt {
  display: block;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.builder-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}
.builder-heading > img {
  object-fit: contain;
  image-rendering: pixelated;
}
.builder-heading h3 {
  margin: 0;
  font-size: 25px;
  font-weight: 400;
}
.builder-heading > span {
  margin-left: auto;
  color: var(--muted);
  font-size: 18px;
  white-space: nowrap;
}
.comparison-inventory {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 23px 0 16px;
}
.compare-prompt .comparison-slot {
  display: grid;
  place-items: center;
  position: relative;
  width: 100%;
  min-width: 0;
  height: 67px;
  padding: 8px;
  border: 1px dashed var(--line);
  border-radius: 3px;
  background: var(--bg);
  color: var(--muted);
}
.compare-prompt .comparison-slot.filled {
  border-style: solid;
  border-color: var(--secondary);
  animation: comparison-slot-reveal 180ms ease-out;
}
.comparison-slot > img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
}
.comparison-slot > svg {
  width: 19px;
  height: 19px;
}
.comparison-slot small {
  position: absolute;
  right: 5px;
  bottom: 3px;
  font-size: 14px;
  line-height: 1;
  opacity: 0.6;
}
.compare-prompt p {
  font-size: 18px;
  line-height: 1.4;
  margin: 0 0 20px;
}
.compare-prompt #open-compare {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 11px;
  font-size: 18px;
}
@keyframes comparison-slot-reveal {
  from {
    opacity: 0.25;
  }
  to {
    opacity: 1;
  }
}
.comparison-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.comparison-chip {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.comparison-chip-name {
  flex: 1;
  min-width: 0;
  font-size: 19px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.comparison-chip > img {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
}
.comparison-chip > span:first-child {
  width: 3px;
  height: 28px;
  border-radius: 0;
}
.comparison-chip button {
  flex-shrink: 0;
}
.compare-tray .primary-button {
  white-space: nowrap;
  min-height: 40px;
}

@media (max-width: 1099px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 16px;
  }
  .topbar .feed-sync {
    padding-inline: 12px;
  }
}
@container workspace (max-width:900px) {
  .market-browser > .section-heading {
    grid-template-columns: minmax(0, 1fr);
    gap: 15px;
  }
  .market-actions {
    justify-content: start;
  }
}
@container workspace (max-width:620px) {
  .activity-receipts {
    grid-template-columns: minmax(0, 1fr);
  }
  .trade-receipt + .trade-receipt {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .trade-receipt {
    padding: 19px;
  }
  .activity-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
  .recent-heading {
    flex-wrap: wrap;
    gap: 13px;
  }
  .recent-heading h3 {
    font-size: 26px;
  }
  .activity-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .activity-heading > .text-button {
    justify-self: start;
  }
  .market-actions {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    width: 100%;
    gap: 8px;
  }
  .market-actions > button {
    padding: 9px 7px;
    font-size: 16px;
  }
  .market-actions #market-compare span {
    font-size: 0;
  }
  .market-actions #market-compare span:after {
    content: "Compare";
    font-size: 17px;
  }
  .market-actions #market-watch span {
    font-size: 0;
  }
  .market-actions #market-watch span:after {
    content: "Watchlist";
    font-size: 17px;
  }
  .market-actions #export-button {
    width: 35px;
    overflow: hidden;
    font-size: 0;
    gap: 0;
  }
  .market-actions #export-button svg {
    width: 16px;
    height: 16px;
  }
  .comparison-chips {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 600px) {
  .topbar {
    gap: 10px;
    padding-inline: 14px;
  }
  .topbar .feed-sync {
    border: 0;
    padding: 0;
  }
  .topbar .feed-emblem {
    width: 21px;
    height: 27px;
  }
  .topbar .feed-emblem > img {
    width: 19px;
    height: 19px;
  }
  .topbar .feed-signal {
    left: 2px;
    right: 2px;
    height: 5px;
  }
  .topbar .feed-copy strong,
  .topbar .feed-action {
    display: none;
  }
  .topbar .feed-copy small {
    font-size: 14px;
  }
  .topbar #refresh-button {
    gap: 5px;
    min-height: 34px;
  }
  .topbar .sync-track {
    left: 0;
    right: 0;
    bottom: -4px;
  }
  .topbar .header-actions {
    gap: 2px;
  }
  .topbar .header-actions > .icon-button {
    width: 27px;
  }
  .topbar .global-search {
    min-height: 36px;
    padding: 7px;
    gap: 6px;
  }
  .page-map-link {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 17px;
  }
}
@media (max-width: 380px) {
  .topbar .global-search > span:nth-child(2) {
    display: none;
  }
  .topbar .global-search {
    justify-content: center;
  }
  .topbar {
    grid-template-columns: 30px minmax(36px, 1fr) auto auto;
    gap: 7px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .compare-prompt .comparison-slot.filled {
    animation: none;
  }
}
:root[data-reduced-motion="true"] .compare-prompt .comparison-slot.filled {
  animation: none;
}

/* A persistent setup action, with a brief acknowledgement on a real apply. */
.page-flipper .flipper-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
}
.flipper-controls.flipper-workbench {
  display: block;
  padding: 0;
  overflow: visible;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.setup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.setup-header > div {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.setup-header img {
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.setup-header h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 400;
}
.setup-header > span {
  text-align: right;
  font-size: 16px;
  line-height: 1.3;
  color: var(--muted);
}
.flipper-workbench[data-setup-state="dirty"] .setup-header > span {
  color: var(--selection);
}
.flipper-workbench[data-setup-state="applied"] .setup-header > span {
  color: var(--accent);
}
.setup-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  padding: 23px 22px 20px;
}
.flipper-controls.flipper-workbench .setup-fields > label {
  display: block;
  grid-column: auto;
  min-width: 0;
  width: auto;
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}
.flipper-workbench .input-unit,
.flipper-workbench .select-control {
  margin-top: 8px;
}
.flipper-workbench .gp-control {
  width: 100%;
  min-width: 0;
}
.flipper-workbench .setup-fields input,
.flipper-workbench .select-trigger {
  min-height: 44px;
  font-size: 19px;
}
.flipper-workbench .setup-fields .field-hint {
  display: block;
  margin-top: 10px;
  min-height: 19px;
  line-height: 1.3;
  font-size: 16px;
  color: var(--muted);
}
.setup-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 22px;
  border-top: 1px solid var(--line);
}
.setup-applied-summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px 12px;
  min-width: 0;
}
.setup-applied-summary > span {
  font-size: 16px;
  color: var(--muted);
}
.setup-applied-summary strong {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
}
.setup-applied-summary small {
  margin-left: 5px;
  color: var(--muted);
  font-size: 16px;
}
.flipper-controls.flipper-workbench .flipper-apply {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: auto;
  gap: 11px;
  min-height: 45px;
  min-width: 162px;
  width: auto;
  padding: 11px 17px;
  margin: 0;
  font-size: 20px;
  white-space: nowrap;
  overflow: hidden;
}
.apply-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
}
.apply-icon > img {
  width: 23px;
  height: 23px;
  object-fit: contain;
  image-rendering: pixelated;
  transition: opacity 150ms ease;
}
.apply-icon > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 150ms ease;
}
.apply-icon > span svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}
.setup-applied .apply-icon > img {
  opacity: 0;
}
.setup-applied .apply-icon > span {
  opacity: 1;
}
.setup-applied .flipper-apply {
  animation: setup-acknowledge 440ms ease-out;
}
.setup-applied .apply-icon > span {
  animation: setup-check 300ms ease-out;
}
@keyframes setup-acknowledge {
  0% {
    background: var(--selection);
  }
  100% {
    background: var(--accent);
  }
}
@keyframes setup-check {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Base weights and recorded outcomes form an expandable trading ledger. */
.workbench-sidebar.flipper-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 22px;
  min-width: 0;
}
.workbench-sidebar > section,
.workbench-sidebar > section:last-child {
  display: block;
  grid-column: auto;
  min-width: 0;
  padding: 20px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}
.ledger-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 18px;
}
.ledger-heading img {
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.ledger-heading h2 {
  margin: 0;
  font-size: 25px;
  font-weight: 400;
  line-height: 1.2;
}
.score-weight-ribbon {
  display: flex;
  height: 7px;
  gap: 3px;
  margin: 5px 0 20px;
}
.score-weight-ribbon span {
  background: var(--accent);
}
.score-weight-ribbon span:nth-child(2) {
  opacity: 0.78;
}
.score-weight-ribbon span:nth-child(3) {
  background: var(--selection);
}
.score-weight-ribbon span:nth-child(4) {
  opacity: 0.52;
}
.score-weight-ribbon span:nth-child(5) {
  opacity: 0.32;
}
.score-factor {
  border-top: 1px solid var(--line);
}
.score-factor:last-child {
  border-bottom: 1px solid var(--line);
}
.score-factor summary {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto 11px;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  min-height: 48px;
  padding: 12px 0;
  font-size: 18px;
  line-height: 1.2;
}
.score-factor summary::-webkit-details-marker {
  display: none;
}
.score-factor summary::marker {
  content: "";
}
.score-factor summary:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}
.factor-index {
  color: var(--faint);
  font-size: 14px;
}
.score-factor summary strong {
  font-size: 21px;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
}
.score-factor summary svg {
  width: 11px;
  height: 11px;
  color: var(--muted);
  transition: transform 150ms ease;
}
.score-factor[open] summary svg {
  transform: rotate(180deg);
}
.score-factor p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
  margin: 0;
  padding: 0 0 16px 26px;
}
.score-factor[open] p {
  animation: factor-reveal 150ms ease-out;
}
@keyframes factor-reveal {
  from {
    opacity: 0.2;
  }
  to {
    opacity: 1;
  }
}
.ledger-note {
  margin: 16px 0 18px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}
.flipper-ledger .text-button {
  font-size: 18px;
  line-height: 1.3;
}
.flipper-ledger .text-button svg,
.ledger-action svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.outcome-lines,
.sizing-lines {
  margin: 0;
}
.outcome-lines > div,
.sizing-lines > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.outcome-lines dt,
.sizing-lines dt {
  min-width: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.3;
}
.outcome-lines dd {
  font-size: 29px;
  font-weight: 400;
  margin: 0;
  line-height: 1.1;
}
.outcome-lines > div:nth-child(2) dd {
  color: var(--accent);
}
.sizing-lines dd {
  font-size: 19px;
  margin: 0;
  line-height: 1.3;
  text-align: right;
  overflow-wrap: anywhere;
}
.ledger-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0 0;
  border-top: 1px solid var(--line);
  font-size: 19px;
}
.ledger-action:hover {
  color: var(--accent);
}
.opportunity-table .item-description {
  line-height: 1.4;
}
.workbench-sidebar .sizing-ledger .ledger-note {
  margin-bottom: 0;
}

@container workspace (max-width:1000px) {
  .page-flipper .flipper-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .workbench-sidebar.flipper-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
  .workbench-sidebar > .sizing-ledger {
    grid-column: 1 / -1;
  }
  .sizing-ledger .sizing-lines {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 26px;
  }
}
@container workspace (max-width:620px) {
  .setup-fields {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px;
    gap: 19px;
  }
  .setup-header,
  .setup-footer {
    padding: 17px 20px;
  }
  .setup-header {
    gap: 12px;
  }
  .setup-header h2 {
    font-size: 25px;
  }
  .setup-header > span {
    max-width: 110px;
    font-size: 16px;
  }
  .setup-footer {
    align-items: stretch;
  }
  .setup-applied-summary {
    flex-direction: column;
    gap: 4px;
    justify-content: center;
  }
  .flipper-controls.flipper-workbench .flipper-apply {
    min-width: 146px;
    padding-inline: 13px;
    font-size: 19px;
  }
  .workbench-sidebar.flipper-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }
  .workbench-sidebar > .sizing-ledger {
    grid-column: auto;
  }
  .sizing-ledger .sizing-lines {
    display: block;
  }
  .ledger-heading h2 {
    font-size: 25px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .setup-applied .flipper-apply,
  .setup-applied .apply-icon > span,
  .score-factor[open] p {
    animation: none;
  }
  .apply-icon > img,
  .apply-icon > span,
  .score-factor summary svg {
    transition: none;
  }
}
:root[data-reduced-motion="true"] .setup-applied .flipper-apply,
:root[data-reduced-motion="true"] .setup-applied .apply-icon > span,
:root[data-reduced-motion="true"] .score-factor[open] p {
  animation: none;
}
:root[data-reduced-motion="true"] .apply-icon > img,
:root[data-reduced-motion="true"] .apply-icon > span,
:root[data-reduced-motion="true"] .score-factor summary svg {
  transition: none;
}
.setup-applied .flipper-apply::before {
  content: "";
  position: absolute;
  left: 23px;
  top: 13px;
  width: 16px;
  height: 18px;
  background: url("/assets/coins-25.png") center / contain no-repeat;
  image-rendering: pixelated;
  pointer-events: none;
  opacity: 0;
  animation: setup-coin 360ms steps(5, end);
}
@keyframes setup-coin {
  0% {
    opacity: 1;
    transform: translate(-8px, -7px);
  }
  65% {
    opacity: 1;
    transform: translate(0, 1px);
  }
  100% {
    opacity: 0;
    transform: translate(0, 4px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .setup-applied .flipper-apply::before {
    animation: none;
  }
}
:root[data-reduced-motion="true"] .setup-applied .flipper-apply::before {
  animation: none;
}
@container workspace (max-width:380px) {
  .setup-header {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .setup-header > div {
    flex: 1 0 100%;
  }
  .setup-header > span {
    max-width: none;
    text-align: left;
  }
  .setup-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
  }
  .setup-applied-summary {
    flex-direction: row;
    align-items: baseline;
    justify-content: start;
    gap: 12px;
  }
  .flipper-controls.flipper-workbench .flipper-apply {
    width: 100%;
  }
}
