:root {
  --bg: #0e0f10;
  --surface: #1a1c1e;
  --surface-2: #141617;
  --border: #2a2d30;
  --text: #f2efe9;
  --muted: #9c9890;
  --brass: #c9a96a;
  --brass-dim: rgba(201, 169, 106, 0.35);
  --brass-faint: rgba(201, 169, 106, 0.08);
  --danger: #e07a5f;
  --display: 'Barlow Condensed', 'Arial Narrow', 'Helvetica Neue', sans-serif;
  --mono: 'JetBrains Mono', Menlo, Consolas, monospace;
  --body: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    linear-gradient(var(--brass-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--brass-faint) 1px, transparent 1px);
  background-size: 48px 48px;
  background-attachment: fixed;
}

a {
  color: var(--brass);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-size: 34px;
}

h2 {
  font-size: 26px;
}

h3 {
  font-size: 21px;
}

p {
  margin: 0 0 12px;
}

.mono,
.value.mono,
td.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--body);
}

.brass {
  color: var(--brass);
}

.muted {
  color: var(--muted);
}

.danger {
  color: var(--danger);
}

.small {
  font-size: 13px;
}

.noscript {
  padding: 40px;
  text-align: center;
}

/* ---------- layout ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(14, 15, 16, 0.92);
  backdrop-filter: blur(10px);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.topbar .brand:hover {
  text-decoration: none;
}

.mark {
  width: 34px;
  height: 34px;
  display: block;
}

.brand-name {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.nav a {
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 2px solid transparent;
}

.nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.nav a.active {
  color: var(--brass);
  border-bottom-color: var(--brass);
}

.topbar .spacer {
  flex: 1;
}

.topbar .session {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 20px 96px;
}

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.page-head .summary {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.page-head .summary .stat .value {
  font-size: 22px;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.toolbar input {
  max-width: 360px;
}

/* ---------- controls ---------- */

input,
select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  border-radius: 2px;
}

input:focus {
  outline: none;
  border-color: var(--brass);
}

input.code {
  font-family: var(--mono);
  font-size: 24px;
  letter-spacing: 0.4em;
  text-align: center;
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 2px;
}

button.primary {
  width: 100%;
  background: var(--brass);
  color: #141414;
  border: 0;
  padding: 13px 18px;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

button.primary:disabled,
button.ghost:disabled {
  opacity: 0.5;
  cursor: default;
}

button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 12px;
  font-size: 13px;
}

button.ghost:hover:not(:disabled) {
  border-color: var(--brass);
  color: var(--brass);
}

button.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--brass);
  font-size: 13px;
}

.field {
  margin-bottom: 16px;
}

.field .label {
  display: block;
  margin-bottom: 6px;
}

.error {
  color: var(--danger);
  margin: 12px 0;
  font-size: 14px;
}

.notice {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.meter {
  height: 3px;
  background: var(--border);
  margin-top: 10px;
}

.meter > i {
  display: block;
  height: 100%;
  background: var(--brass);
  transition: width 0.4s ease;
}

/* ---------- sign in ---------- */

.signin {
  max-width: 460px;
  margin: 8vh auto 40px;
  padding: 34px 34px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
}

.signin .brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.signin .brand-block .mark {
  width: 52px;
  height: 52px;
}

.signin h1 {
  font-size: 30px;
}

.signin .sub {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.signin h2 {
  font-size: 22px;
  margin: 8px 0 6px;
}

.signin .privacy {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.signin .privacy .label {
  color: var(--brass);
  margin-bottom: 6px;
  display: block;
}

.signin .actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}

/* ---------- corner brackets and cards ---------- */

.bracket {
  position: relative;
}

.bracket::before,
.bracket::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--brass);
  border-style: solid;
  pointer-events: none;
}

.bracket::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}

.bracket::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  position: relative;
  transition: border-color 0.15s ease;
}

.card:hover {
  border-color: var(--brass-dim);
  text-decoration: none;
}

.card.inactive {
  opacity: 0.55;
}

.plate {
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.plate .placeholder {
  color: var(--muted);
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.slot {
  position: absolute;
  top: 10px;
  left: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--brass);
  background: rgba(14, 15, 16, 0.8);
  padding: 2px 6px;
}

.card-body {
  padding: 14px 16px 16px;
}

.card-body h3 {
  font-size: 24px;
}

.card-body .variant {
  color: var(--muted);
  font-size: 14px;
  min-height: 21px;
}

.card-body .meta {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.card-body .meta b {
  color: var(--text);
  font-weight: 500;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-top: 12px;
}

.stat .value {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--brass);
  line-height: 1.3;
}

.stat .value.plain {
  color: var(--text);
  font-size: 15px;
}

/* ---------- panels and tables ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px 22px;
  margin-bottom: 20px;
}

.panel h2 {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.panel h2 .count {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
  margin-left: 10px;
  letter-spacing: 0;
}

.kv {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px 24px;
}

.kv .value {
  font-size: 16px;
  margin-top: 2px;
  word-break: break-word;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  padding: 6px 12px 10px;
  white-space: nowrap;
}

td {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

th.num,
td.num {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

td.num.brass {
  color: var(--brass);
}

tr.inactive td {
  opacity: 0.55;
}

.empty {
  color: var(--muted);
  padding: 20px 0;
  text-align: center;
}

.prose {
  white-space: pre-wrap;
  line-height: 1.6;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.detail-head h1 {
  font-size: 40px;
}

.detail-head .sub {
  color: var(--muted);
  font-size: 16px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.gallery .plate {
  border: 1px solid var(--border);
}

.gallery .plate.hero {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 9;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--border);
  padding: 3px 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.chip.brass {
  border-color: var(--brass-dim);
  color: var(--brass);
}

.day {
  margin-bottom: 14px;
}

.day-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.day-head .date {
  font-family: var(--display);
  font-size: 24px;
  text-transform: uppercase;
}

.day-head .rounds {
  margin-left: auto;
  font-family: var(--mono);
  color: var(--brass);
  font-size: 18px;
}

.wish-group {
  margin-bottom: 24px;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 40px;
}

.loading {
  max-width: 460px;
  margin: 18vh auto;
  text-align: center;
}

.loading h2 {
  margin-bottom: 10px;
}

/* ---------- phones: a two-row top bar with a swipeable nav, wrapped rows, roomy targets ---------- */
@media (max-width: 720px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    overflow-x: hidden;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 8px 14px 0;
  }

  .topbar .brand {
    order: 1;
    gap: 8px;
    min-width: 0;
  }

  .mark {
    width: 28px;
    height: 28px;
  }

  .brand-name {
    font-size: 18px;
    white-space: nowrap;
  }

  .topbar .spacer {
    display: none;
  }

  .topbar .session {
    order: 2;
    width: auto;
    margin-left: auto;
    gap: 6px;
  }

  .session a {
    display: none;
  }

  .session button.ghost {
    padding: 6px 9px;
    font-size: 12px;
    letter-spacing: 0.06em;
  }

  .session .sync .sync-label {
    display: none;
  }

  .session .sync .dot {
    margin-right: 0;
  }

  .session .sync {
    padding: 6px 10px;
  }

  .nav {
    order: 3;
    width: calc(100% + 28px);
    margin: 0 -14px;
    padding: 0 8px;
    gap: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    font-size: 15px;
    padding: 8px 10px 10px;
    white-space: nowrap;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .nav a::after {
    left: 10px;
    right: 10px;
    bottom: 2px;
  }

  .container {
    padding: 18px 14px 80px;
  }

  h1 {
    font-size: 28px;
  }

  .page-head {
    gap: 12px;
    margin-bottom: 14px;
  }

  .page-head h1 {
    flex: 1 1 100%;
  }

  .page-head .summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    width: 100%;
  }

  .page-head .summary .stat .value {
    font-size: 20px;
  }

  .head-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .head-actions > button.primary {
    grid-column: 1 / -1;
  }

  .head-actions select {
    width: 100%;
    min-width: 0;
  }

  .toolbar {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
  }

  .toolbar input {
    max-width: none;
    flex: 1 1 100%;
  }

  .toolbar button {
    flex: 1 1 auto;
  }

  .detail-head h1 {
    font-size: 30px;
  }

  .panel {
    padding: 16px 14px;
    margin-bottom: 14px;
  }

  .panel h2 {
    font-size: 22px;
  }

  .kv {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px 16px;
  }

  .actions > button {
    flex: 1 1 auto;
  }

  .cards {
    gap: 14px;
  }

  .card-body h3 {
    font-size: 22px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .field input[type='date'] {
    min-height: 46px;
  }

  .report-summary .big {
    font-size: 19px;
  }

  .toasts {
    left: 14px;
    right: 14px;
    transform: none;
    align-items: center;
  }

  .signin {
    margin: 3vh 12px 24px;
    padding: 22px 18px;
  }

  .signin .mode {
    flex-direction: column;
  }
}

/* ---------- forms and app chrome (read-write edition) ---------- */

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
@media (max-width: 640px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}
.field input[type='text'],
.field input[type='number'],
.field input[type='date'],
.field input[type='password'],
.field input[type='search'],
.field input[type='file'],
.field select,
.field textarea {
  width: 100%;
  box-sizing: border-box;
}
.field .hint {
  font-size: 12px;
  color: var(--muted, #8d8a84);
  margin-top: 4px;
}
textarea {
  font: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border, #2a2925);
  background: var(--surface, #16151380);
  color: inherit;
  resize: vertical;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}
.head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.head-actions select {
  min-width: 140px;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
button.danger {
  border-color: #b8443a;
  color: #f0a59d;
}
button.danger:hover {
  background: #b8443a22;
}
.mode {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  cursor: pointer;
}
.checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px 16px;
}
.form-error:not(:empty) {
  margin-top: 10px;
}
ul.plain {
  list-style: none;
  padding: 0;
  margin: 8px 0;
}
ul.plain li {
  padding: 6px 0;
  border-top: 1px solid var(--border, #2a2925);
}
ul.plain li:first-child {
  border-top: 0;
}
ul.small {
  font-size: 12px;
  color: var(--muted, #8d8a84);
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(240px, 380px) 1fr;
  gap: 20px;
  align-items: start;
  margin: 12px 0 8px;
}
@media (max-width: 720px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
.plate.hero {
  aspect-ratio: 3 / 2;
}
.button-link {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 10px;
  background: #c9a96a;
  color: #14120f;
  text-decoration: none;
  font-weight: 600;
  margin-top: 10px;
}
.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
  pointer-events: none;
}
.toast {
  background: #26241f;
  border: 1px solid #3a3731;
  color: #f2efe9;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: 0 6px 20px #00000080;
}
.toast.danger {
  background: #4a1f1a;
  border-color: #b8443a;
}
.session .sync {
  font-variant-numeric: tabular-nums;
}
.session .sync.danger {
  color: #f0a59d;
}
.session a {
  color: inherit;
  text-decoration: none;
  opacity: 0.85;
}
.session a.active {
  color: #c9a96a;
}
.muted {
  color: var(--muted, #8d8a84);
}

/* ---------- loadout HUD: chrome, motion, and glow ---------- */

:root {
  --glow: rgba(201, 169, 106, 0.22);
  --glow-strong: rgba(201, 169, 106, 0.4);
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

.app {
  position: relative;
  z-index: 1;
}

/* Backdrop: vignette plus a slow scan sweep over the grid. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(201, 169, 106, 0.1), transparent 70%),
    radial-gradient(ellipse 80% 50% at 50% 110%, rgba(0, 0, 0, 0.65), transparent 70%);
}

body::after {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 18vh;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(to bottom, transparent, rgba(201, 169, 106, 0.05), transparent);
  transform: translateY(-100%);
  animation: sweep 11s linear infinite;
}

@keyframes sweep {
  to {
    transform: translateY(650%);
  }
}

/* Top bar: a brass hairline that fades at the ends, nav underline that slides in. */
.topbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--brass-dim) 30%,
    var(--brass-dim) 70%,
    transparent
  );
  pointer-events: none;
}

.brand-name {
  text-shadow: 0 0 18px var(--glow);
}

.mark {
  filter: drop-shadow(0 0 6px var(--glow));
}

.nav a {
  position: relative;
  border-bottom: 0;
  transition: color 0.18s ease;
}

.nav a::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 2px;
  background: var(--brass);
  box-shadow: 0 0 10px var(--brass);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease-out);
}

.nav a:hover::after {
  transform: scaleX(0.55);
}

.nav a.active::after {
  transform: scaleX(1);
}

/* Sync indicator. */
.sync .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 8px var(--brass);
  margin-right: 8px;
  vertical-align: 1px;
}

.sync.syncing .dot {
  animation: pulse 0.9s ease-in-out infinite;
}

.sync.danger .dot {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Reveal: everything on a page rises in, staggered by --i. */
.reveal {
  animation: rise 0.55s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

.cards > .card.reveal {
  animation-delay: calc(var(--i, 0) * 45ms);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Page titles carry a brass diamond, like the section rules on the phone. */
.page-head h1,
.detail-head h1 {
  position: relative;
  padding-left: 20px;
  text-shadow: 0 0 22px var(--glow);
}

.page-head h1::before,
.detail-head h1::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 9px;
  height: 9px;
  background: var(--brass);
  box-shadow: 0 0 10px var(--brass);
  transform: translateY(-50%) rotate(45deg);
}

.section-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 14px;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
}

.section-rule::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--brass);
  box-shadow: 0 0 8px var(--brass);
  transform: rotate(45deg);
}

.section-rule .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--brass-dim), transparent);
}

.section-rule .count {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

/* HUD frames: chamfered top-right and bottom-left, brass brackets on the other two corners. */
.panel,
.card,
.signin > .panel {
  position: relative;
  clip-path: polygon(
    0 0,
    calc(100% - 14px) 0,
    100% 14px,
    100% 100%,
    14px 100%,
    0 calc(100% - 14px)
  );
}

.bracket::before,
.bracket::after,
.panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 0;
  width: auto;
  height: auto;
  pointer-events: none;
  z-index: 2;
}

.bracket::after {
  display: none;
}

.bracket::before,
.panel::before {
  background:
    linear-gradient(var(--brass), var(--brass)) top left / 20px 2px no-repeat,
    linear-gradient(var(--brass), var(--brass)) top left / 2px 20px no-repeat,
    linear-gradient(var(--brass), var(--brass)) bottom right / 20px 2px no-repeat,
    linear-gradient(var(--brass), var(--brass)) bottom right / 2px 20px no-repeat;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.panel {
  background: linear-gradient(135deg, rgba(201, 169, 106, 0.05), transparent 40%), var(--surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.panel:hover::before,
.card:hover::before {
  opacity: 1;
}

/* Panel titles: the rule under the title draws itself in. */
.panel h2 {
  position: relative;
}

.panel h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1px;
  width: 0;
  background: linear-gradient(90deg, var(--brass), transparent);
  box-shadow: 0 0 8px var(--glow-strong);
  animation: draw 0.9s var(--ease-out) 0.25s forwards;
}

@keyframes draw {
  to {
    width: 46%;
  }
}

/* Cards: lift, glow, and a photo that leans in. */
.card {
  background: linear-gradient(160deg, rgba(201, 169, 106, 0.06), transparent 45%), var(--surface);
  transition:
    transform 0.28s var(--ease-out),
    border-color 0.2s ease,
    box-shadow 0.28s var(--ease-out);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--brass-dim);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(201, 169, 106, 0.25),
    0 0 30px var(--glow);
}

.card .plate {
  position: relative;
}

.card .plate::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(14, 15, 16, 0.65), transparent 55%);
  pointer-events: none;
}

.card .plate img {
  transition:
    transform 0.7s var(--ease-out),
    filter 0.4s ease;
  filter: saturate(0.9);
}

.card:hover .plate img {
  transform: scale(1.06);
  filter: saturate(1.05);
}

.slot {
  z-index: 3;
  border: 1px solid var(--brass-dim);
  letter-spacing: 0.1em;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}

.meter {
  position: relative;
  overflow: hidden;
}

.meter > i {
  box-shadow: 0 0 10px var(--brass);
  animation: fill 1s var(--ease-out) both;
}

@keyframes fill {
  from {
    width: 0;
  }
}

.stat .value.mono {
  text-shadow: 0 0 16px var(--glow);
}

/* Buttons: chamfered primary with a sheen sweep; ghosts glow on hover; everything presses. */
button {
  transition:
    transform 0.12s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    filter 0.2s ease,
    background-color 0.2s ease;
}

button:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

button.primary {
  position: relative;
  overflow: hidden;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  box-shadow: 0 0 0 rgba(201, 169, 106, 0);
}

button.primary::after {
  content: '';
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -70%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-20deg);
  transition: left 0.65s ease;
  pointer-events: none;
}

button.primary:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 0 24px var(--glow-strong);
}

button.primary:hover:not(:disabled)::after {
  left: 130%;
}

button.secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

button.secondary:hover:not(:disabled),
button.ghost:hover:not(:disabled) {
  border-color: var(--brass);
  color: var(--brass);
  box-shadow: 0 0 14px var(--glow);
}

button.danger:hover:not(:disabled) {
  box-shadow: 0 0 14px rgba(224, 122, 95, 0.3);
}

.button-link {
  border-radius: 0;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

/* Inputs: brass focus halo. */
input,
select,
textarea {
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow:
    0 0 0 3px rgba(201, 169, 106, 0.14),
    0 0 18px var(--glow);
}

textarea {
  border-radius: 2px;
  background: var(--bg);
}

/* Tables: rows light up with an accent bar. */
tbody tr {
  transition: background-color 0.15s ease;
}

tbody tr:hover td {
  background: rgba(201, 169, 106, 0.05);
}

tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--brass);
}

/* Sign in and loading. */
.signin {
  animation: rise 0.6s var(--ease-out) both;
}

.signin .brand-block h1 {
  text-shadow: 0 0 22px var(--glow);
}

.boot {
  height: 4px;
  background: var(--border);
  margin: 4px 0 16px;
  overflow: hidden;
}

.boot > i {
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
  box-shadow: 0 0 10px var(--brass);
  animation: boot 1.1s ease-in-out infinite;
}

@keyframes boot {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(260%);
  }
}

.loading {
  animation: rise 0.5s var(--ease-out) both;
}

.loading .radar {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--brass);
  box-shadow:
    0 0 22px var(--glow),
    inset 0 0 22px rgba(201, 169, 106, 0.08);
  animation: spin 1s linear infinite;
}

.loading .mark {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Toasts: chamfered, slide up. */
.toast {
  border-radius: 0;
  border-color: var(--brass-dim);
  clip-path: polygon(
    10px 0,
    100% 0,
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    0 100%,
    0 10px
  );
  animation: toast-in 0.35s var(--ease-out) both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* Detail pages: the hero photo gets the same brackets. */
.gallery .plate,
.detail-grid > .plate {
  position: relative;
}

.gallery .plate::before,
.detail-grid > .plate::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(var(--brass), var(--brass)) top left / 20px 2px no-repeat,
    linear-gradient(var(--brass), var(--brass)) top left / 2px 20px no-repeat,
    linear-gradient(var(--brass), var(--brass)) bottom right / 20px 2px no-repeat,
    linear-gradient(var(--brass), var(--brass)) bottom right / 2px 20px no-repeat;
  opacity: 0.75;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }

  body::after {
    display: none;
  }

  .card:hover {
    transform: none;
  }
}

/* ---------- one button family ---------- */

button.primary,
button.secondary,
button.ghost,
button.danger {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.2;
  padding: 10px 16px;
  border-radius: 0;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

button.primary {
  width: auto;
  font-size: 16px;
  padding: 11px 20px;
}

.signin button.primary[type='submit'],
form > .actions > button.primary:only-child {
  width: 100%;
}

.signin .mode button {
  flex: 1;
  width: auto;
}

button.secondary,
button.ghost {
  background: linear-gradient(160deg, rgba(201, 169, 106, 0.08), transparent 60%), var(--surface);
  border: 1px solid var(--brass-dim);
  color: var(--text);
}

button.danger {
  background: linear-gradient(160deg, rgba(224, 122, 95, 0.1), transparent 60%), var(--surface);
  border: 1px solid rgba(224, 122, 95, 0.5);
  color: #f0a59d;
}

button.danger:hover:not(:disabled) {
  background: rgba(224, 122, 95, 0.16);
  border-color: var(--danger);
  color: #fff;
}

.session button.ghost {
  font-size: 13px;
  padding: 7px 12px;
  letter-spacing: 0.08em;
}

.head-actions select,
.detail-head select {
  width: auto;
  min-width: 160px;
  padding: 9px 12px;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-color: var(--brass-dim);
}

.head-actions,
.actions {
  gap: 10px;
}

button {
  white-space: nowrap;
}

/* ---------- checkboxes ---------- */

input[type='checkbox'],
input[type='radio'] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--brass);
  cursor: pointer;
}

.check {
  width: fit-content;
  padding: 8px 12px 8px 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.check:hover {
  border-color: var(--brass-dim);
}

.check:has(input:checked) {
  border-color: var(--brass);
  box-shadow: 0 0 14px var(--glow);
}

/* ---------- insurance schedule page ---------- */

.report-head .sub {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 6px;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 0 0 22px;
}

.report-summary > div {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 14px 16px;
  clip-path: polygon(
    0 0,
    calc(100% - 10px) 0,
    100% 10px,
    100% 100%,
    10px 100%,
    0 calc(100% - 10px)
  );
}

.report-summary .big {
  font-size: 22px;
  color: var(--brass);
  margin-top: 4px;
  text-shadow: 0 0 16px var(--glow);
}

.report-item {
  display: grid;
  grid-template-columns: 44px 200px 1fr;
  gap: 18px;
  background: linear-gradient(135deg, rgba(201, 169, 106, 0.05), transparent 40%), var(--surface);
  border: 1px solid var(--border);
  padding: 18px 20px;
  margin-bottom: 14px;
  position: relative;
  clip-path: polygon(
    0 0,
    calc(100% - 14px) 0,
    100% 14px,
    100% 100%,
    14px 100%,
    0 calc(100% - 14px)
  );
  break-inside: avoid;
}

.report-item::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--brass), var(--brass)) top left / 20px 2px no-repeat,
    linear-gradient(var(--brass), var(--brass)) top left / 2px 20px no-repeat,
    linear-gradient(var(--brass), var(--brass)) bottom right / 20px 2px no-repeat,
    linear-gradient(var(--brass), var(--brass)) bottom right / 2px 20px no-repeat;
  opacity: 0.75;
}

.report-num {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--brass);
  padding-top: 4px;
}

.report-photo {
  aspect-ratio: 3 / 2;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.report-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.report-photo .placeholder {
  color: var(--muted);
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.report-details h2 {
  font-size: 26px;
  margin-bottom: 10px;
}

.report-details h2 .nick {
  font-weight: 400;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--body);
  font-size: 16px;
}

.report-specs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px 20px;
}

.report-specs .value {
  font-size: 15px;
  margin-top: 2px;
}

.report-specs .value b {
  color: var(--brass);
  font-weight: 600;
}

.acc-title {
  margin-top: 14px;
  margin-bottom: 4px;
}

.report-acc {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 4px 20px;
  font-size: 14px;
}

.report-acc .val {
  margin-left: 8px;
  color: var(--brass);
}

.report-foot {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

@media (max-width: 720px) {
  .report-item {
    grid-template-columns: 32px 1fr;
  }

  .report-photo {
    grid-column: 2;
  }

  .report-details {
    grid-column: 1 / -1;
  }
}

/* ---------- print: paper, not a screen ---------- */

@media print {
  @page {
    margin: 16mm 14mm;
  }

  html,
  body {
    background: #fff !important;
    color: #111 !important;
    font-size: 12px;
  }

  body::before,
  body::after,
  .topbar,
  .toasts,
  .no-print,
  .head-actions,
  .footer {
    display: none !important;
  }

  .container {
    max-width: none;
    padding: 0;
  }

  .reveal {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .report h1,
  .report h2,
  .report .label,
  .report .sub,
  .report .value,
  .report .muted {
    color: #111 !important;
    text-shadow: none !important;
  }

  .report .muted,
  .report .sub,
  .report .label,
  .report-foot {
    color: #666 !important;
  }

  .report h1::before {
    background: #8a6d3b !important;
    box-shadow: none !important;
  }

  .report-summary > div,
  .report-item,
  .report-photo {
    background: #fff !important;
    border-color: #bbb !important;
    box-shadow: none !important;
    clip-path: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-item::before {
    display: none;
  }

  .report-summary .big,
  .report-num,
  .report-acc .val,
  .report-specs .value b {
    color: #8a6d3b !important;
    text-shadow: none !important;
  }

  .report-item {
    page-break-inside: avoid;
    break-inside: avoid;
    grid-template-columns: 32px 160px 1fr;
    gap: 12px;
    padding: 12px;
  }

  .report-photo img {
    filter: none;
  }

  .report-details h2 {
    font-size: 18px;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}

.panel .summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 36px;
  margin-bottom: 14px;
}

.panel .summary .stat .value {
  font-size: 24px;
}

.range-chips {
  margin: -6px 0 14px;
}

.range-chips .chip {
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  border-radius: 0;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.range-chips .chip:hover {
  border-color: var(--brass);
  color: var(--brass);
  box-shadow: 0 0 12px var(--glow);
}

/* Standalone summaries (range day, ammo lot, magazine): a row on desktop, two across on phones. */
.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 36px;
  margin: 8px 0 18px;
}

@media (max-width: 720px) {
  .summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
  }
}
