/* Cyan is interactive, amber draws attention, and rarity still frames gear. */
:root {
  --hud-accent: #8cdeed;
  --hud-edge: #507886;
  --hud-float: #10232d;
  --hud-ease: cubic-bezier(.2,.75,.25,1);
}
:is(.hud-bar,.hud-context,#main,#sheet) button,
:is(.hud-bar,.catalog-tools,.roll-tools,#sheet) :is(select,input,summary) {
  transition: color 150ms var(--hud-ease), background-color 150ms var(--hud-ease),
    border-color 150ms var(--hud-ease), box-shadow 150ms var(--hud-ease);
}
:is(button, summary, a, select, input):focus-visible {
  outline: 2px solid var(--hud-accent);
  outline-offset: 2px;
}
.catalog-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 4px;
}
#list-label {
  color: #b3d1da;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.inventory-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-inline: 9px;
  border-left: 2px solid #528799;
}
.inventory-group small {
  color: #a9c9d3;
  font: 500 12px var(--mono);
}
#item-list .gear-tile {
  transition: box-shadow 170ms var(--hud-ease), translate 220ms var(--hud-ease);
}
.gear-tile .item-art {
  transition: scale 260ms cubic-bezier(.18,.84,.29,1.16);
}
@media (hover:hover) and (pointer:fine) {
  #item-list .gear-tile:hover:not(:active) { translate: 0 -2px; }
  .gear-tile:hover .item-art { scale: 1.035; }
}
#item-list .gear-tile:active { translate: 0 1px; }
.gear-tile[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--hud-accent); }
#gear-detail {
  border: 1px solid var(--hud-edge);
  border-top: 2px solid var(--rar,var(--hud-accent));
  border-radius: 5px;
  background: linear-gradient(140deg,#17313a,var(--hud-float) 34%,#0b1c25);
  box-shadow: 0 15px 42px #000a,0 2px 8px #0008;
  overscroll-behavior: contain;
  animation: none;
}
#gear-detail .roll-context {
  position: sticky;
  top: 0;
  z-index: 2;
  margin-inline: -6px;
  padding: 4px 8px;
  background: #10252f;
  border-bottom: 1px solid #345565;
}
#gear-detail .roll-context > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: #c1e1eb;
}
#gear-detail .roll-context .back {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
}
#gear-detail:not(:modal) .roll-context .back { display: none; }
#gear-detail .roll-head h2 {font-size: 19px;}
.roll-tools {
  margin-top: 9px;
  border-top: 1px solid #345565;
  background: #10242f;
}
.roll-tools .roll-more {
  margin-top: 6px;
  padding: 7px 0;
  border-top: 1px solid #355362;
}
.roll-band.element strong { font-weight: 650; }
.roll-stats dd {font-variant-numeric: tabular-nums;}
#gear-detail::backdrop, #sheet::backdrop {
  background: #020b13b3;
  animation: backdrop-in 160ms ease-out both;
}
@keyframes backdrop-in { from { opacity: 0; } }
#sheet[open], #open-panel:not([hidden]), #gear-sort[open] #sort-options,
#gear-filters[open] #filter-options,
#selection-tools:not([hidden]), #feedback:not(:empty) {
  animation: float-in 200ms var(--hud-ease) both;
}
@keyframes float-in { from { opacity: 0; transform: translateY(6px); } }
#sheet {
  border: 1px solid var(--hud-edge);
  border-top: 2px solid var(--hud-accent);
  border-radius: 6px;
  background: var(--hud-float);
  box-shadow: 0 18px 58px #000a;
  overscroll-behavior: contain;
}
#sheet h2 {color: #def2f6; margin-bottom: .45em;}
#sheet-body > p {max-width: 60ch; line-height: 1.5;}
#sheet form[method="dialog"] { margin-top: 12px; }
#sort-options,#filter-options {border-radius: 5px;}
#feedback:not(:empty) {animation-name: notice-in;}
@keyframes notice-in { from { opacity: 0; translate: 0 7px; } }

/* These marks are CSS geometry. They do not depend on the device's emoji font. */
.ui-mark {
  display: inline-block;
  flex: 0 0 auto;
  width: .95em;
  height: .95em;
  vertical-align: -.1em;
  background: currentColor;
}
.mark-check {clip-path: polygon(0 54%,16% 37%,39% 61%,82% 10%,100% 26%,40% 96%);}
.mark-close {clip-path: polygon(12% 0,50% 38%,88% 0,100% 12%,62% 50%,100% 88%,88% 100%,50% 62%,12% 100%,0 88%,38% 50%,0 12%);}
.mark-warning {clip-path: polygon(evenodd,50% 1%,100% 95%,0 95%,50% 1%,44% 34%,56% 34%,56% 64%,44% 64%,44% 34%,44% 71%,56% 71%,56% 82%,44% 82%,44% 71%);}
.mark-diamond {clip-path: polygon(50% 7%,93% 50%,50% 93%,7% 50%);}
.mark-star {clip-path: polygon(50% 0,62% 34%,99% 36%,71% 59%,81% 96%,50% 75%,19% 96%,29% 59%,1% 36%,38% 34%);}
.mark-junk {clip-path: polygon(12% 24%,33% 24%,33% 9%,67% 9%,67% 24%,88% 24%,88% 38%,12% 38%,12% 24%,23% 47%,77% 47%,70% 94%,30% 94%,23% 47%);}
.mark-fire {clip-path: polygon(50% 0,76% 31%,78% 21%,97% 61%,92% 81%,72% 98%,26% 98%,6% 76%,10% 48%,34% 18%,32% 49%);}
.mark-shock {clip-path: polygon(54% 0,91% 0,62% 39%,90% 39%,32% 100%,43% 56%,13% 56%);}
.mark-corrosive {clip-path: polygon(50% 0,83% 51%,93% 72%,79% 93%,56% 100%,29% 96%,10% 79%,13% 60%);}
.mark-cryo {clip-path: polygon(45% 0,55% 0,55% 39%,89% 19%,94% 28%,60% 50%,94% 72%,89% 81%,55% 61%,55% 100%,45% 100%,45% 61%,11% 81%,6% 72%,40% 50%,6% 28%,11% 19%,45% 39%);}
.flag-label,.mark-action {display: inline-flex; align-items: center; gap: .45em;}
.roll-effect .ui-mark {margin-right: .25em;}
.roll-band.element {gap: .45em;}
.roll-band.element .roll-icon {flex-shrink: 0;}
.gear-tile .select-check {font-size: 12px;}
.gear-tile .favorite-star {font-size: 12px;}
.gear-tile .gear-tag {
  min-width: 16px;
  text-align: center;
  font: 700 11px/1.3 var(--mono);
  border: 1px solid currentColor;
  border-radius: 3px;
  background: #0d222c;
}
.weapon-wheel > .ui-mark {width: 12px; height: 12px;}

@media (max-width: 760px), (pointer:coarse) {
  #gear-detail:modal {
    inset: auto 0 0 !important;
    margin: 0 auto;
    width: min(100%, 440px);
    max-width: 100%;
    max-height: 85dvh;
    border-radius: 10px 10px 0 0;
    padding-bottom: max(8px,env(safe-area-inset-bottom));
  }
  #gear-detail .roll-context .back {width: 44px; height: 44px; flex-basis: 44px;}
  .roll-tools button {min-height: 40px;}
}
@media (prefers-reduced-motion: reduce) {
  :is(.hud-bar,.hud-context,#main,#sheet) *,
  #sheet, #gear-detail, #gear-detail::backdrop, #sheet::backdrop,
  #feedback:not(:empty) {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }
  #item-list .gear-tile,.gear-tile .item-art {translate: none !important; scale: none !important;}
}

/* Short labels and values use distinct roles in the denser workspace panels. */
#gear-detail .back .mark-close, .notification-close .mark-close {width: 13px; height: 13px;}
.catalog-tools .searchbar {position: relative;}
.catalog-tools .searchbar::before {
  content: "";
  position: absolute;
  top: calc(50% - 6px);
  left: 11px;
  width: 9px;
  height: 9px;
  border: 1.5px solid #a0bec9;
  border-radius: 50%;
  pointer-events: none;
}
.catalog-tools .searchbar::after {
  content: "";
  position: absolute;
  top: calc(50% + 4px);
  left: 20px;
  width: 5px;
  height: 1.5px;
  transform: rotate(45deg);
  background: #a0bec9;
  pointer-events: none;
}
#inventory-view .catalog-tools input[type="search"] {padding-left: 31px;}
.weapon-wheel > .ui-mark {position: absolute; inset: 50% auto auto 50%;translate: -50% -50%;color: #a8d9e3;}
#feedback:not(:empty) {
  position: fixed;
  z-index: 80;
  inset: auto auto max(16px,env(safe-area-inset-bottom)) 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: max-content;
  max-width: min(620px,calc(100% - 28px));
  box-sizing: border-box;
  margin: 0;
  padding: 10px 11px 10px 14px;
  border: 1px solid #3a6978;
  border-left: 3px solid var(--hud-accent);
  border-radius: 4px;
  background: #122e3c;
  box-shadow: 0 10px 26px #0008;
}
.notification-close {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #638b98;
  border-radius: 50%;
}
.mission-list button, .mission-state, .mission-progress {
  display: flex;
  align-items: center;
  gap: .65em;
}
.mission-list button .ui-mark {width: .65em;height: .65em;color: #749aa9;}
.mission-list button[aria-pressed="true"] .ui-mark {color: var(--hud-accent);}
.mission-state {
  width: fit-content;
  margin: 0 0 9px;
  padding: 4px 8px;
  border: 1px solid #6b573e;
  background: #352f22;
}
.mission-detail .objective-list {display: grid;gap: 5px;margin-top: 10px;}
.mission-detail .objective-row {
  display: grid;
  grid-template-columns: 14px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #142e3b;
  border-left: 2px solid #446877;
}
.objective-row[data-state="active"] {border-color: #e9b55e;}
.objective-row[data-state="complete"] {border-color: #7fbda4;}
.objective-row small {color: #aecbd4;font-size: .8em;}
.objective-row .ui-mark {color: #8fbbca;}
.objective-row[data-state="active"] .ui-mark {color: #f2c67f;}
.objective-row[data-state="complete"] .ui-mark {color: #95dfb6;}
.mission-progress {margin: 5px 0 12px;color: #b6d3df;flex-wrap: wrap;}
.mission-progress span {background: #0c2431;border: 1px solid #385d6c;padding: 3px 8px;}
.build-stats {padding-inline-start: 0;list-style: none;}
.build-stats li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2px 10px;
  padding: 5px 0;
  border-bottom: 1px solid #335260;
}
.build-stats b {color: #d9f3f7;font-variant-numeric: tabular-nums;}
.build-inspect {border-radius: 5px;box-shadow: 0 8px 24px #0004;}
.sdu-row strong {font-variant-numeric: tabular-nums;}
.sdu-row .ranks .bought {box-shadow: 0 0 6px #6fdcf456;}
.sdu-controls {grid-column: 1/-1;flex-wrap: wrap;}
@media (hover:none) {
  .control-strip {display: none;}
}

#main a[target="_blank"]::after, #sheet a[target="_blank"]::after,
#gear-detail a[target="_blank"]::after {
  content: "";
  display: inline-block;
  width: .78em;
  height: .78em;
  margin-left: .35em;
  background: currentColor;
  clip-path: polygon(36% 0,100% 0,100% 64%,85% 64%,85% 25%,20% 90%,10% 80%,75% 15%,36% 15%);
}
/* Release audit: let content set the opening screen height and keep touch actions legible. */
body[data-opening="true"] #open-panel{min-height:0;max-width:900px;margin:clamp(1rem,4vw,3rem) auto;padding:clamp(1rem,3vw,2rem)}
body[data-ssh="false"] [data-device]{display:none!important}
#open-panel .open-heading p{font-size:1rem}
#open-panel .open-heading small,#open-panel label,#open-panel summary{font-size:.9rem}
#sheet-body input,#sheet-body select{max-width:100%;min-width:0}
#sheet-body form{display:grid;gap:.8rem}#sheet-body form label{display:grid;gap:.4rem}
#sheet .sheet-close{position:sticky;top:0;float:right;width:36px;height:36px;display:grid;place-items:center;border-radius:50%;padding:0;z-index:2;background:#102b36}
#sheet::backdrop{background:#000a;backdrop-filter:blur(2px)}
#inventory-view .catalog-tools>label,#inventory-view .catalog-tools input[type=search],#inventory-view .catalog-tools select,#inventory-view .catalog-tools button,#inventory-view .catalog-tools summary{font-size:.875rem}
.public-footer{margin-top:1.5rem;gap:1rem;flex-wrap:wrap}
@media(max-width:760px){
 #sheet{width:calc(100% - 20px);max-width:none;max-height:88dvh;padding:16px;box-sizing:border-box}
 #sheet-body button,#sheet-body input,#sheet-body select,#inventory-view .catalog-tools summary,#inventory-view .catalog-tools button,#inventory-view .catalog-tools select{min-height:42px}
 .hud-bar{gap:8px}.hud-bar #build-guides{margin-left:auto}.hud-brand{min-width:0}
 .hud-context{position:relative;flex-wrap:wrap;gap:8px}.file-context{flex-wrap:wrap;justify-content:flex-start}
 #draft-actions{flex-wrap:wrap}#open-panel .save-path code{font-size:.8rem}
}

@media(max-width:480px){.hud-bar nav{gap:4px}.hud-bar nav button{padding-inline:9px;flex-shrink:0}}

.hud-context .character {min-width:0;max-width:100%}
#character-select-field:not([hidden]) {display:inline-flex;align-items:center;gap:.65rem;min-width:0;max-width:100%}
#character-select-field > span {font-size:.73rem;color:var(--muted,#9eb8c3);letter-spacing:.06em}
#character-picker {min-width:0;max-width:100%;padding:.35rem .65rem;color:#d8f4fa;background:#112835;border:1px solid #396071;font:inherit;cursor:pointer}
#character-picker:focus-visible {outline:2px solid #78dbe8;outline-offset:2px}
#character-select-field:not([hidden]) ~ :is(#hunter,#level) {display:none}
