/* Albion Scanner visual theme. Use the existing light and dark tokens. */
:root { --terminal-brass: #e4b760; --terminal-radius: 17px; }
.terminal-symbols { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.terminal-icon {
  width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round;
}
.brand > .terminal-icon { width: 34px; height: 34px; color: var(--accent); }
.brand-wordmark { font-weight: 650; letter-spacing: -.025em; }
.brand-wordmark strong { font-weight: 750; }
.mobile-terminal-nav { display: none; }

#tab-dashboard .dashboard-head {
  min-height: 256px; align-items: center; display: flex; padding: clamp(20px, 5vw, 48px);
  border-radius: var(--terminal-radius); border: 1px solid #6c5735; color: #fff3dc;
  background-color: #1b1916;
  background-image: linear-gradient(90deg, #1b1916 10%, #1b1916 27%, #1b1916b8 53%, #1b191630 100%), url("img/terminal-hero.webp");
  background-position: center, right center; background-size: cover, min(72%, 820px) auto;
  background-repeat: no-repeat;
}
.terminal-hero-copy { max-width: 34rem; min-width: 0; }
.terminal-eyebrow { color: #efc579; font-size: .73rem; font-weight: 750; letter-spacing: .19em; }
#tab-dashboard .terminal-hero-copy h1 { margin-block: 6px; font-size: clamp(1.7rem, 4.8vw, 3rem); color: inherit; }
#tab-dashboard .terminal-hero-copy p { margin: 0; max-width: 35ch; color: #eee3ce; }
.terminal-scan {
  display: inline-flex; gap: .55rem; align-items: center; justify-content: center;
  min-height: 48px; margin-top: 20px; text-decoration: none; max-width: 100%; text-align: center;
}
#tab-dashboard .terminal-scan { background: var(--terminal-brass); color: #21170d; }
.dashboard-shortcuts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .6rem; margin-block: .85rem 1.15rem; }
.dashboard-shortcuts a {
  display: flex; gap: .6rem; min-height: 58px; align-items: center; justify-content: center; text-align: center;
  color: var(--text); text-decoration: none; font-weight: 650; padding: 8px; overflow-wrap: anywhere;
}
.dashboard-shortcuts a .terminal-icon { color: var(--accent); }
.dashboard-shortcuts a:hover, .dashboard-shortcuts a:focus-visible { border-color: var(--accent); }
.terminal-overview-head { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: .55rem 0; align-items: baseline; justify-content: space-between; }
.terminal-overview-head > h2 { font-size: 1.2rem; }
.terminal-overview-head > details, .terminal-overview-head fieldset { min-width: 0; max-width: 100%; }
#tab-dashboard .dashboard-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,240px),1fr)); }
.dashboard-card { border-radius: var(--terminal-radius); min-width: 0; }
.dashboard-card[data-widget="gold"] { order: -1; }
.dashboard-trend { display: block; width: 100%; height: 62px; margin-bottom: .35rem; }
.dashboard-trend-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.dashboard-trend-baseline { stroke: var(--border); vector-effect: non-scaling-stroke; }
#my-favorites, #my-gold { scroll-margin-top: calc(112px + env(safe-area-inset-top,0px)); }

#dealsTable .price, #dealsTable .profit, #dashboard-gold { font-variant-numeric: tabular-nums; }
#dealsTable .profit.negative { color: var(--warn); }
#dealsTable .deal-item .item-name { overflow-wrap: anywhere; }
#dealsTable .deal-actions { margin-top: 0; min-width: 115px; }
#dealsTable .deal-shopping { border-color: transparent; }
#dealsTable .deal-actions :focus-visible { outline-offset: -2px; }

@media (max-width: 720px) {
  header .tabs { display: none; }
  .topbar-inner { justify-content: space-between; }
  .brand { gap: .4rem; }
  .brand > .terminal-icon { width: 29px; height: 29px; }
  .brand-wordmark { font-size: .95rem; }
  .topbar-right { gap: 4px; }
  .mobile-terminal-nav {
    display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 1px;
    position: fixed; z-index: 25; inset: auto 0 0;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 4px 5px calc(5px + env(safe-area-inset-bottom,0px));
    box-shadow: 0 -7px 24px #00000018;
  }
  body:has(.mobile-terminal-nav) { padding-bottom: calc(68px + env(safe-area-inset-bottom,0px)); }
  .mobile-terminal-nav .terminal-tab {
    display: flex; flex-direction: column; min-height: 50px; min-width: 0; gap: .18rem; padding: .3rem .1rem;
    align-items: center; justify-content: center; text-align: center; line-height: 1.1;
    color: var(--text-2); font-size: clamp(.62rem,2.7vw,.76rem); white-space: normal; border-radius: 10px;
  }
  .terminal-tab .terminal-icon { width: 20px; height: 20px; }
  .mobile-terminal-nav .terminal-tab.active, .terminal-more.current > summary, .terminal-more[open] > summary {
    background: var(--accent-soft); color: var(--text); font-weight: 750;
  }
  .mobile-terminal-nav .terminal-tab.active .terminal-icon, .terminal-more.current > summary .terminal-icon { color: var(--accent); }
  .terminal-more summary { cursor: pointer; list-style: none; }
  .terminal-more summary::-webkit-details-marker { display: none; }
  .terminal-more summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .terminal-more-links {
    position: absolute; inset: auto 8px calc(100% + 6px); display: grid; grid-template-columns: repeat(2,minmax(0,1fr));
    gap: .3rem; padding: .55rem; border: 1px solid var(--border); border-radius: var(--terminal-radius);
    background: var(--surface); box-shadow: var(--shadow);
    overflow: auto; max-height: min(60vh,320px);
  }
  .terminal-more-links .tab { display: flex; min-height: 44px; align-items: center; white-space: normal; overflow-wrap: anywhere; }

  #tab-dashboard .dashboard-head {
    min-height: 238px; padding: 20px 16px;
    background-image: linear-gradient(90deg,#1b1916ee 4%,#1b1916bd 48%,#1b191640 100%),url("img/terminal-hero.webp");
    background-size: cover, auto 118%; background-position: center,right center;
  }
  .terminal-scan { margin-top: 16px; }
  .dashboard-shortcuts a { flex-direction: column; gap: .3rem; font-size: clamp(.72rem,3.2vw,.9rem); }
  .dashboard-shortcuts a .terminal-icon { width: 21px; height: 21px; }

  #dealsTable tbody { display: grid; gap: .7rem; }
  #dealsTable tr {
    box-sizing: border-box; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem .75rem;
    grid-template-areas: "item item" "profit profit" "buy sell" "roi volume" "fresh fresh" "actions actions";
    border: 1px solid var(--border); border-radius: var(--terminal-radius); background: var(--surface);
    padding: 12px; box-shadow: var(--shadow);
  }
  #dealsTable td { min-width: 0; white-space: normal; }
  #dealsTable .deal-item { grid-area: item; }
  #dealsTable .deal-item .item-cell img { width: 44px; height: 44px; object-fit: contain; flex: none; border-radius: 8px; }
  #dealsTable .deal-profit { grid-area: profit; padding-bottom: .65rem; border-bottom: 1px solid var(--border); }
  #dealsTable .deal-profit .profit { font-size: clamp(1.42rem,6vw,2rem); line-height: 1.15; white-space: normal; overflow-wrap: anywhere; }
  #dealsTable .risk { white-space: normal; }
  #dealsTable .deal-buy { grid-area: buy; }
  #dealsTable .deal-sell { grid-area: sell; border-inline-start: 1px solid var(--border); padding-inline-start: .7rem; }
  #dealsTable .deal-buy .price, #dealsTable .deal-sell .price { font-weight: 750; margin-top: .12rem; }
  #dealsTable .deal-roi { grid-area: roi; }
  #dealsTable .deal-volume { grid-area: volume; }
  #dealsTable .deal-freshness { grid-area: fresh; }
  #dealsTable .deal-freshness.old { color: var(--warn); }
  #dealsTable .deal-freshness .deal-confidence { margin-top: .2rem; }
  #dealsTable .deal-controls { grid-area: actions; border-top: 1px solid var(--border); padding-top: .65rem; }
  #dealsTable .deal-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .4rem; }
  #dealsTable .deal-shopping { grid-column: 1 / -1; }
  #dealsTable .deal-actions .btn { min-height: 44px; overflow-wrap: anywhere; }
}
.terminal-more:not([open]) .terminal-more-links { display: none; }
#tab-dashboard .tool-details { margin-top: .9rem; }
.terminal-diagnostics { color: var(--text-2); margin: .25rem 0 .65rem; }
.terminal-diagnostics summary { cursor: pointer; min-height: 36px; align-content: center; }
.deal-icon {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 1px solid var(--border); border-radius: 9px; color: var(--accent); background: var(--surface-2);
}
#dealsTable .deal-icon img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
#dealsTable .deal-icon.image-ready img { opacity: 1; }
.deal-icon.image-ready svg { visibility: hidden; }

@media (max-width: 720px) {
  .terminal-deals-wrap { border: 0; box-shadow: none; background: transparent; overflow: visible; }
  .terminal-diagnostics summary { min-height: 44px; }
}
@media (max-width: 520px) {
  .topbar-right { flex: 1 1 100%; margin-left: 0; justify-content: space-between; }
}
@media (min-width: 721px) {
  .topbar-inner { justify-content: space-between; gap: 6px 16px; }
  header .tabs { order: 3; flex: 0 0 100%; flex-wrap: wrap; padding-bottom: 5px; }
  header .tabs .tab { font-size: .85rem; padding: .38rem .48rem; }
}

/* The price decision comes first; full quotes and the history remain below it. */
.price-quick { margin-block: .85rem 1rem; border-radius: var(--terminal-radius); }
.price-quick-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .45rem .8rem; }
.price-quick-head .btn { min-height: 44px; }
.price-quick > p { margin: .55rem 0 0; font-size: .82rem; }
.price-quick-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; margin-top: .65rem; }
.price-quote-card {
  min-width: 0; display: flex; flex-direction: column; gap: .2rem; padding: .8rem;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); overflow-wrap: anywhere;
}
.price-quote-card h4 { margin: 0; font-size: .78rem; font-weight: 720; color: var(--text-2); }
.price-quote-city { font-weight: 660; }
.price-quote-value { font-size: clamp(1.05rem,4.7vw,1.52rem); line-height: 1.15; font-variant-numeric: tabular-nums; }
.price-quote-value small { font-size: .67rem; font-weight: 550; color: var(--text-2); }
.price-quote-time { color: var(--text-2); font-size: .8rem; }
.price-quote-empty, .price-quote-risk { color: var(--warn); }
.price-quote-empty { font-size: .91rem; }
.price-city-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: .4rem; background: var(--city-color); }
#price-cities-heading { margin-top: 1.15rem; }
@media (max-width: 420px) {
  .price-quick { padding: .75rem; }
  .price-quote-card { padding: .58rem; }
  #tab-prices .item-card { gap: .5rem; }
  #tab-prices .item-card img { width: 48px; height: 48px; }
  #tab-prices .item-card .btn { min-height: 44px; }
}
.price-item-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .85rem; }
.price-item-actions .btn { min-height: 44px; margin: 0; }
.price-quote-time small { display: block; opacity: .9; font-size: .73rem; }
.black-market-mode { border-inline-start: 3px solid var(--warn); margin-block: .8rem 1rem; }
.black-market-mode h2 { font-size: 1.05rem; }
.black-market-mode p { margin: .35rem 0 .65rem; }
.black-market-mode .btn { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; }
