/* Imperial Rose Guild Hall - dark, warm, a little medieval; clean and fast. */

:root {
  --bg: #140e0d;
  --bg-glow: #2a1512;
  --surface: #1f1715;
  --surface-2: #281d1a;
  --surface-3: #33251f;
  --border: #3b2b26;
  --border-strong: #5b4038;
  --text: #ecdfc6;
  --muted: #b39f86;
  --faint: #86725f;
  --rose: #c8324f;
  --rose-bright: #e46a83;
  --rose-deep: #7d1428;
  --rose-wash: rgba(200, 50, 79, 0.14);
  --gold: #d6af62;
  --gold-wash: rgba(214, 175, 98, 0.12);
  --good: #8fbf7a;
  --good-wash: rgba(143, 191, 122, 0.13);
  --bad: #ec7a6f;
  --bad-wash: rgba(236, 122, 111, 0.13);
  --warn: #eab155;
  --warn-wash: rgba(234, 177, 85, 0.14);
  --shadow: 0 1px 0 rgba(255, 235, 200, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.35);
  --radius: 12px;
  --font-display: "Cinzel", "Trajan Pro", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f1e7d3;
    --bg-glow: #f7d9cf;
    --surface: #fbf5e8;
    --surface-2: #f4ead6;
    --surface-3: #ecdfc5;
    --border: #dccaa8;
    --border-strong: #c3a982;
    --text: #2b1c15;
    --muted: #6d5646;
    --faint: #927a64;
    --rose: #a61e3a;
    --rose-bright: #b8274a;
    --rose-deep: #7d1428;
    --rose-wash: rgba(166, 30, 58, 0.09);
    --gold: #8a6420;
    --gold-wash: rgba(138, 100, 32, 0.1);
    --good: #3f7a2c;
    --good-wash: rgba(63, 122, 44, 0.1);
    --bad: #b2362a;
    --bad-wash: rgba(178, 54, 42, 0.09);
    --warn: #9a5f00;
    --warn-wash: rgba(196, 128, 20, 0.13);
    --shadow: 0 1px 2px rgba(80, 50, 20, 0.08), 0 6px 18px rgba(80, 50, 20, 0.08);
    color-scheme: light;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 420px at 50% -120px, var(--bg-glow), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font-body);
  overflow-x: hidden;
}

a {
  color: var(--rose-bright);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 8px;
  z-index: 10;
  background: var(--surface);
  padding: 6px 10px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------------------------------------------------------------- header */

.site-header {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(125, 20, 40, 0.22), transparent);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  min-width: 0;
}
.brand:hover {
  text-decoration: none;
}

.emblem {
  width: 46px;
  height: 46px;
  flex: none;
  filter: drop-shadow(0 2px 6px rgba(200, 50, 79, 0.35));
}
.emblem-ring {
  fill: var(--surface);
  stroke: var(--gold);
  stroke-width: 2.5;
}
.emblem-petal {
  fill: var(--rose);
}
.emblem-inner {
  fill: var(--rose-deep);
}
.emblem-core {
  fill: var(--rose-bright);
}
.emblem-leaf {
  fill: #5f8f4e;
}
.emblem-stem {
  stroke: #5f8f4e;
  stroke-width: 3;
  stroke-linecap: round;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}
.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--text);
  white-space: nowrap;
}
.brand-sub {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
  text-align: right;
  min-width: 0;
}
.who .name {
  color: var(--text);
  font-weight: 600;
}

.nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar {
  display: none;
}
.nav a {
  flex: none;
  padding: 9px 14px 10px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.05em;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav a:hover {
  color: var(--text);
  text-decoration: none;
}
.nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--rose);
}
.nav .count {
  display: inline-block;
  margin-left: 6px;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--rose);
  color: #fff;
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

/* ---------------------------------------------------------------- page */

main {
  flex: 1;
  padding-top: 22px;
  padding-bottom: 40px;
  outline: none;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.25;
  margin: 0 0 12px;
}
h1 {
  font-size: 26px;
}
h2 {
  font-size: 19px;
  margin-top: 28px;
}
h3 {
  font-size: 15px;
  margin-top: 18px;
  color: var(--gold);
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 14px;
}
.page-head h1 {
  margin: 0;
}
.page-head .sub {
  color: var(--muted);
  font-size: 14px;
}

.ornament {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  margin: 26px 0 12px;
}
.ornament::before,
.ornament::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}
.ornament h2 {
  margin: 0;
}

p {
  margin: 0 0 10px;
}
.muted {
  color: var(--muted);
}
.faint {
  color: var(--faint);
}
.small {
  font-size: 13px;
}
.nowrap {
  white-space: nowrap;
}
.mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}
.card > :last-child {
  margin-bottom: 0;
}
.card.narrow {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.card.warn {
  border-color: var(--warn);
  background: linear-gradient(0deg, var(--warn-wash), var(--warn-wash)), var(--surface);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.stat .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.stat .value {
  font-size: 20px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- forms */

input,
select,
button,
textarea {
  font: inherit;
  color: inherit;
}

input[type="text"],
input[type="search"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 38px;
  max-width: 100%;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px var(--gold-wash);
}
input::placeholder {
  color: var(--faint);
}

.search-big {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.search-big input {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  padding: 11px 14px;
  min-height: 48px;
  border-radius: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--gold);
  text-decoration: none;
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn.primary {
  background: linear-gradient(180deg, var(--rose), var(--rose-deep));
  border-color: var(--rose-deep);
  color: #fff;
}
.btn.primary:hover {
  border-color: var(--rose-bright);
}
.btn.good {
  background: var(--good-wash);
  border-color: var(--good);
  color: var(--good);
}
.btn.bad {
  background: var(--bad-wash);
  border-color: var(--bad);
  color: var(--bad);
}
.btn.small {
  min-height: 28px;
  padding: 2px 10px;
  font-size: 13px;
}
.btn.link {
  background: none;
  border: none;
  color: var(--rose-bright);
  padding: 0;
  min-height: 0;
  font-weight: 500;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.field > span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.field input,
.field select {
  width: 100%;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 10px;
}
.toolbar .grow {
  flex: 1;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
}
.seg button {
  background: var(--surface-2);
  border: 0;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
}
.seg button + button {
  border-left: 1px solid var(--border-strong);
}
.seg button[aria-pressed="true"] {
  background: var(--rose-wash);
  color: var(--text);
  font-weight: 600;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}

/* ---------------------------------------------------------------- tables */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
table.data th,
table.data td {
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
table.data tbody tr:last-child td {
  border-bottom: 0;
}
table.data th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  user-select: none;
}
table.data th.sortable {
  cursor: pointer;
}
table.data th.sortable:hover {
  color: var(--text);
}
table.data th .arrow {
  display: inline-block;
  width: 1em;
  color: var(--gold);
}
table.data .num {
  text-align: right;
  white-space: nowrap;
}
table.data tbody tr:hover td {
  background: var(--surface-2);
}
table.data tr.clickable {
  cursor: pointer;
}
table.data td.empty {
  text-align: center;
  color: var(--muted);
  padding: 22px;
}
table.data tr.unseen td:first-child {
  box-shadow: inset 3px 0 0 var(--warn);
}
table.data tr.unseen td {
  background: var(--warn-wash);
}
table.data tr.group td {
  background: var(--surface-2);
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.cell-main {
  font-weight: 600;
}
.cell-sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.plus {
  color: var(--good);
}
.minus {
  color: var(--bad);
}
.gold {
  color: var(--gold);
}

/* ---------------------------------------------------------------- badges */

.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  background: var(--surface-2);
  white-space: nowrap;
}
.badge.owner {
  color: var(--gold);
  border-color: var(--gold);
  background: var(--gold-wash);
}
.badge.officer {
  color: var(--rose-bright);
  border-color: var(--rose);
  background: var(--rose-wash);
}
.badge.member {
  color: var(--text);
}
.badge.pending {
  color: var(--warn);
  border-color: var(--warn);
  background: var(--warn-wash);
}
.badge.rejected,
.badge.revoked {
  color: var(--bad);
  border-color: var(--bad);
  background: var(--bad-wash);
}
.badge.deposit {
  color: var(--good);
  border-color: var(--good);
  background: var(--good-wash);
}
.badge.withdraw {
  color: var(--bad);
  border-color: var(--bad);
  background: var(--bad-wash);
}
.badge.move {
  color: var(--muted);
}
.badge.unseen,
.badge.other {
  color: var(--warn);
  border-color: var(--warn);
  background: var(--warn-wash);
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--faint);
  margin-right: 6px;
  vertical-align: 1px;
}
.dot.on {
  background: var(--good);
  box-shadow: 0 0 0 3px var(--good-wash);
}

.unseen-note {
  color: var(--warn);
  font-size: 13px;
  font-style: italic;
}

/* ---------------------------------------------------------------- misc */

.notice {
  border-left: 3px solid var(--warn);
  background: var(--warn-wash);
  padding: 10px 12px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 14px;
  font-size: 14px;
}
.notice.info {
  border-left-color: var(--gold);
  background: var(--gold-wash);
}
.notice.error {
  border-left-color: var(--bad);
  background: var(--bad-wash);
}

.loading {
  color: var(--muted);
  padding: 24px 0;
  text-align: center;
}
.loading::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--rose);
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.tile {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  color: var(--text);
}
.tile:hover {
  border-color: var(--gold);
  text-decoration: none;
}
.tile .t-title {
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 2px;
}

.diff-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.diff-list li {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 13px;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.inline-form input {
  flex: 1;
  min-width: 140px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.toasts {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 20;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--good);
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  font-size: 14px;
  animation: rise 0.18s ease-out;
}
.toast.error {
  border-left-color: var(--bad);
}
@keyframes rise {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

.site-footer {
  padding-top: 14px;
  padding-bottom: 22px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 12px;
}

.hero {
  text-align: center;
  padding: 18px 0 6px;
}
.hero h1 {
  font-size: 28px;
}
.hero p {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 14px;
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }
  .brand-title {
    font-size: 18px;
  }
  .brand-sub {
    font-size: 10px;
  }
  .emblem {
    width: 38px;
    height: 38px;
  }
  .who .role-badge,
  .who .server {
    display: none;
  }
  h1 {
    font-size: 22px;
  }
  table.data th,
  table.data td {
    padding: 7px 9px;
  }
  .hide-sm {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
  }
}

/* ---------------------------------------------------------------- items: icons, cards, the item panel */

main.wide {
  max-width: 1480px;
}

.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: radial-gradient(circle at 50% 40%, #2a201c, #120d0b 75%);
  border: 1px solid #3d2d27;
  border-radius: 8px;
  overflow: hidden;
}
.icon-tile img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}
.icon-tile.no-art span {
  color: #8d7763;
  font-family: var(--font-display);
  font-weight: 700;
}

.item-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.item-link .item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.item-link:hover .item-name {
  color: var(--rose-bright);
  text-decoration: underline;
}
.item-link.plain {
  cursor: default;
}
.item-name {
  font-weight: 600;
}
.find-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* the hover/focus popover */
.item-pop {
  position: fixed;
  z-index: 40;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  padding: 12px 14px;
  font-size: 13px;
  pointer-events: none;
}
.pop-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.pop-name {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
}
.pop-sub {
  color: var(--muted);
}
.pop-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  margin: 0 0 8px;
}
.pop-facts dt {
  color: var(--muted);
}
.pop-facts dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pop-where {
  margin: 0 0 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.pop-desc {
  margin: 0 0 6px;
  font-style: italic;
  color: var(--muted);
}
.pop-foot {
  margin: 0;
  color: var(--faint);
  font-size: 12px;
}

/* the items page */
.items-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.items-side {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}
.vault-picker > summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold);
  padding: 4px 2px 10px;
  list-style: none;
}
.vault-picker > summary::-webkit-details-marker {
  display: none;
}
.vault-picker > summary::after {
  content: " ▾";
  color: var(--faint);
}
.vault-picker[open] > summary::after {
  content: " ▴";
}
.vault-side {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 14px;
}
.side-item:hover {
  background: var(--surface-2);
}
.side-item[aria-current="true"] {
  background: var(--rose-wash);
  border-color: var(--rose);
  font-weight: 600;
}
.side-item.sub {
  padding-left: 20px;
  font-size: 13px;
  color: var(--muted);
}
.side-item.sub[aria-current="true"] {
  color: var(--text);
}
.side-arrow {
  color: var(--faint);
}
.side-label {
  min-width: 0;
  overflow-wrap: anywhere;
}
.side-count {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 0 8px;
}
.side-note {
  color: var(--faint);
  font-size: 12px;
  margin: 10px 4px 0;
}

.seen-note {
  border-left: 3px solid var(--gold);
  background: var(--gold-wash);
  border-radius: 0 10px 10px 0;
  padding: 9px 12px;
  margin-bottom: 14px;
  font-size: 14px;
}
.seen-note .faint {
  display: block;
  font-size: 12px;
}

.items-toolbar .search-wrap {
  flex: 1 1 220px;
  min-width: 0;
}
.items-toolbar .search-wrap input {
  width: 100%;
}
.inline-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.inline-field > span {
  font-size: 13px;
  color: var(--muted);
}
.dir-btn {
  min-width: 36px;
}

.item-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 232px), 1fr));
  gap: 12px;
}
.item-card {
  display: grid;
  gap: 4px;
  align-content: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.item-card:hover {
  border-color: var(--gold);
}
.ic-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 4px;
}
.ic-name {
  font-weight: 650;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.ic-qty {
  align-self: start;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.ic-cat {
  color: var(--muted);
  font-size: 13px;
}
.ic-where {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.ic-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.item-rows {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.item-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.item-row:last-child {
  border-bottom: 0;
}
.item-row:hover {
  background: var(--surface-2);
}
.ir-name {
  font-weight: 600;
}
.ir-sub {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.ir-qty,
.ir-worth {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.tbl-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.items-table td {
  vertical-align: middle;
}
.more-row {
  text-align: center;
  margin: 16px 0;
}
.shown {
  white-space: nowrap;
}

/* the item panel and page */
.item-dialog {
  width: min(900px, calc(100vw - 24px));
  max-height: min(92vh, 1100px);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}
.item-dialog::backdrop {
  background: rgba(10, 6, 5, 0.66);
}
.dialog-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.dialog-bar .grow {
  flex: 1;
}
.item-detail {
  padding: 18px 20px 22px;
}
.item-page .item-detail {
  padding: 4px;
}
.detail-head {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.detail-head h2 {
  margin: 4px 0 4px;
  font-size: 24px;
}
.detail-desc {
  margin: 8px 0 0;
  font-style: italic;
  color: var(--muted);
}
.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
  gap: 8px;
  margin: 0 0 6px;
}
.facts-grid > div {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  min-width: 0;
}
.facts-grid dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.facts-grid dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.detail-section h3 {
  margin-top: 20px;
}
.chip-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 2px 2px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.chip:hover {
  border-color: var(--gold);
}
.chip.plain {
  padding: 3px 10px;
  cursor: default;
}
.chip.plain:hover {
  border-color: var(--border-strong);
}
.chip.mob.boss {
  border-color: var(--gold);
  color: var(--gold);
}
.mob-level {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.recipe-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: grid;
  gap: 8px;
}
.recipe {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}
.recipe-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.recipe-trade {
  color: var(--muted);
  font-size: 13px;
}
.recipe-mats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}
.place-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.place-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.place-q {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.place-seen {
  margin-left: auto;
}
.badge.left {
  color: var(--muted);
  border-style: dashed;
}

@media (max-width: 900px) {
  .items-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .items-side {
    position: static;
    max-height: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 10px;
  }
  .vault-picker > summary {
    padding: 6px 2px;
  }
}

@media (max-width: 640px) {
  .item-detail {
    padding: 14px 12px 18px;
  }
  .detail-head {
    gap: 12px;
  }
  .detail-head h2 {
    font-size: 20px;
  }
  .item-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    margin: 0;
  }
  .items-toolbar .inline-field > span {
    display: none;
  }
  .item-row {
    gap: 10px;
    padding: 7px 10px;
  }
}

@media (prefers-color-scheme: light) {
  .item-pop {
    box-shadow: 0 12px 32px rgba(80, 50, 20, 0.25);
  }
  .item-dialog::backdrop {
    background: rgba(40, 25, 15, 0.45);
  }
}
