/* /manage — layout on top of editor.css tokens */
.topnav { display: flex; gap: 4px; }
.topnav a {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: 13px;
}
.topnav a:hover { color: var(--fg); background: var(--subtle); }
.topnav a[aria-current="page"] { color: var(--fg); background: var(--subtle); box-shadow: inset 0 0 0 1px var(--border); }
/* Phones: the subtitle goes, the menu scrolls sideways instead of being cut */
@media (max-width: 640px) {
  .topbar h1 .muted { display: none; }
  .topbar h1 { white-space: nowrap; }
  .topnav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .topnav a { flex: none; }
}

.manage { max-width: 1120px; margin: 0 auto; padding: 32px 24px 64px; display: flex; flex-direction: column; gap: 24px; }
.manage-head h2 { margin: 0 0 6px; font-size: 32px; font-weight: 600; letter-spacing: -0.01em; }
.manage-head p { margin: 0; }

.request { display: flex; flex-direction: column; gap: 6px; }
.request-row { display: flex; gap: 8px; flex-wrap: wrap; }
.request-row .input { flex: 1; min-width: 220px; max-width: 420px; }
.request-msg b, #request-msg b { color: var(--fg); font-weight: 500; font-family: ui-monospace, Menlo, monospace; }

select.native {
  height: 34px; padding: 0 28px 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--fg);
  font: inherit; font-size: 13px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}

.filters { display: flex; flex-direction: column; gap: 10px; }
.pills { display: flex; flex-wrap: wrap; gap: 4px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 7px;
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer;
}
.pill:hover { color: var(--fg); }
.pill[aria-pressed="true"] { color: var(--fg); background: var(--subtle); box-shadow: inset 0 0 0 1px var(--border); }
/* Counters: same font as the label, tabular figures, sitting on the label's baseline */
.pill .n, .segmented .n { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); line-height: 1; }
.segmented button { gap: 6px; }
.segmented button[aria-pressed="true"] .n { color: var(--fg); opacity: .6; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.gem { width: 10px; height: 10px; border-radius: 2px; transform: rotate(45deg); flex: none; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-row .sort { margin-left: auto; }

/* Table, like pixicons' ManageList */
.table { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg); }
.thead, .mrow { display: grid; grid-template-columns: 56px minmax(0, 1fr) 150px 160px 110px 40px; gap: 16px; align-items: center; }
.thead { padding: 9px 16px; background: var(--fg); color: var(--bg); font-size: 12px; opacity: .92; }
.tbody { list-style: none; margin: 0; padding: 0; }
.mrow { padding: 10px 16px; border-top: 1px solid var(--border); }
.mrow:first-child { border-top: 0; }
.mrow:hover { background: color-mix(in srgb, var(--subtle) 55%, transparent); }
.thumb {
  width: 48px; height: 48px; border-radius: 8px; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: conic-gradient(var(--check-b) 25%, var(--check-a) 0 50%, var(--check-b) 0 75%, var(--check-a) 0) 0 0 / 8px 8px;
}
.thumb canvas { width: 40px; height: 40px; image-rendering: pixelated; }
.thumb .blank { width: 22px; height: 22px; border: 1.5px dashed var(--border); border-radius: 4px; background: var(--bg); }
.name { min-width: 0; }
.name a, .name span.t { display: block; font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--fg); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name a:hover { text-decoration: underline; }
.name a { font-family: inherit; font-size: 14px; font-weight: 500; }
.name a.untitled { font-family: ui-monospace, Menlo, monospace; font-size: 13px; font-weight: 400; }
.name small code { font-family: ui-monospace, Menlo, monospace; font-size: 11px; }
.name small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.src { display: inline-block; padding: 0 5px; border-radius: 4px; border: 1px solid var(--border); font-size: 10px; line-height: 15px; margin-left: 4px; vertical-align: 1px; }

.sel { position: relative; width: fit-content; max-width: 100%; }
.sel select {
  height: 30px; padding: 0 26px 0 24px; border-radius: 7px; border: 1px solid var(--border); background: var(--bg); color: var(--fg);
  font: inherit; font-size: 12px; appearance: none; cursor: pointer; max-width: 100%;
}
.sel select:hover { border-color: var(--muted); }
.sel select:disabled { opacity: .5; cursor: default; }
.sel .dot, .sel .gem { position: absolute; left: 10px; top: 50%; translate: 0 -50%; pointer-events: none; }
.sel .gem { left: 9px; translate: 0 -50%; }
.sel .gem.none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border); }
.sel::after {
  content: ""; position: absolute; right: 9px; top: 50%; width: 6px; height: 6px; translate: 0 -70%; rotate: 45deg;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); pointer-events: none;
}
.date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.actions { display: flex; gap: 4px; justify-content: flex-end; }
.actions .btn { height: 30px; padding: 0 10px; font-size: 12px; text-decoration: none; }
.actions .btn-icon { width: 30px; height: 30px; border-color: var(--border); color: var(--muted); }
.actions .btn-icon:hover { color: var(--danger); }
.empty-row { padding: 48px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.foot { margin: -12px 0 0; }

@media (max-width: 820px) {
  .thead { display: none; }
  .mrow { grid-template-columns: 56px minmax(0, 1fr); row-gap: 8px; }
  .mrow .thumb { grid-row: span 3; }
  .mrow .date { display: none; }
  .actions { justify-content: flex-start; }
  .filter-row .sort { margin-left: 0; }
  .manage { padding: 24px 16px 48px; }
}

/* Row actions menu */
.actions .more { color: var(--muted); }
.actions .more:hover, .actions .more[aria-expanded="true"] { color: var(--fg); background: var(--subtle); }
.menu {
  position: fixed; z-index: 60; min-width: 168px; padding: 4px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border); box-shadow: 0 12px 32px rgba(0,0,0,.16), 0 2px 6px rgba(0,0,0,.06);
  display: flex; flex-direction: column;
}
.menu[hidden] { display: none; }
.menu-item {
  display: flex; align-items: center; height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent;
  color: var(--fg); font: inherit; font-size: 13px; text-align: left; text-decoration: none; cursor: pointer;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--subtle); outline: none; }
.menu-item.danger { color: var(--danger); }

.actions .more .px { font-size: 16px; }

/* Rarity icons (Pixicons, see RARITIES in shared.js) */
.rarity-ic { font-size: 11px; flex: none; } /* 11 cells → whole pixels (2 per cell on retina) */
.gem.none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border); }
.sel .mark { position: absolute; left: 8px; top: 50%; translate: 0 -50%; display: flex; pointer-events: none; }
.sel .mark .gem { transform: rotate(45deg); }
.rarity-tag { display: inline-flex; align-items: center; gap: 5px; }
.rarity-tag .rarity-ic { font-size: 11px; }
