:root {
  color: #122039;
  background: #f0f4fa;
  font: 16px/1.5 system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header {
  background: #0c1729;
  color: white;
  border-bottom: 3px solid #00a9c5;
  padding: 16px max(16px, calc((100vw - 860px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 750;
  line-height: 1.25;
}
.brand img { width: 44px; height: 44px; }
.brand small { display: block; color: #a8dbeb; font-size: .73rem; font-weight: 600; }
main { width: min(calc(100% - 32px), 860px); margin: 32px auto; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.2; margin-bottom: 20px; }
h2 { font-size: 1.25rem; overflow-wrap: anywhere; }
.panel { padding: 22px; border: 1px solid #d5deeb; border-radius: 16px; background: white; }
.login { max-width: 440px; margin: 12vh auto 12px; display: grid; gap: 12px; }
label { display: block; margin-bottom: 6px; color: #42546c; font-weight: 620; font-size: .9rem; }
.search { margin-bottom: 20px; }
.search div { display: flex; gap: 8px; }
input, button { font: inherit; min-height: 44px; border-radius: 9px; }
input { width: 100%; min-width: 0; border: 1px solid #8494ac; padding: 8px 12px; color: #122039; background: white; }
button {
  border: 1px solid #2345c5;
  background: #2345c5;
  color: white;
  font-weight: 650;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.secondary { background: white; color: #25408b; border-color: #bac9e0; }
button[aria-pressed=true] { background: #e4edff; border-color: #7495d9; color: #143784; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, input:focus-visible { outline: 3px solid #008ca5; outline-offset: 3px; }
.balance { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.balance strong { display: block; font-size: clamp(1.45rem, 5vw, 2rem); font-variant-numeric: tabular-nums; }
.muted { color: #53657c; font-size: .87rem; }
#status { color: #45617b; font-size: .85rem; }
.activity-header { margin: 22px 0 8px; display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.switch { display: flex; gap: 5px; }
.records { list-style: none; padding: 0; display: grid; gap: 6px; }
.records li { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: white; border: 1px solid #d5deeb; border-radius: 9px; padding: 12px; }
.records small { display: block; color: #53657c; }
.records span { text-align: right; font-size: .9rem; }
#notice:not(:empty) { margin: 12px 0; color: #752e23; }
@media (max-width: 350px) {
  .activity-header button, .switch button { padding-inline: 7px; }
  .panel { padding: 16px; }
}

:root { background: #edf2f7; }
header { padding-inline: max(16px, calc((100% - 1024px) / 2)); }
main { width: min(calc(100% - 32px), 1024px); }
.panel { box-shadow: 0 4px 16px #0c17290a; }
.login { padding: clamp(22px, 5vw, 36px); gap: 16px; }
.login h1 { margin-bottom: 4px; }
.login button { width: 100%; }
.error { color: #983528; font-size: .9rem; }
.error:empty { display: none; }
.search { padding: 18px 22px; }
.balance {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 1fr));
  background: #142743;
  color: #fff;
  border-color: #142743;
  align-items: stretch;
  gap: 16px;
}
.balance .muted, .metric span { color: #bacde5; }
.metric { border-left: 1px solid #476080; padding-left: 16px; overflow-wrap: anywhere; }
.metric span { font-size: .85rem; }
#status {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 9px;
  border-radius: 20px;
  background: #354e72;
  color: white;
}
#status[data-state=unblocked] { background: #206551; }
#status[data-state=blocked] { background: #8e3c36; }
.freshness { margin: 8px 0 20px; }
.activity-header { margin-top: 0; }
.records { margin-bottom: 0; }
.records li { background: #f7f9fc; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  main { margin-top: 24px; }
  .balance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .balance > :first-child { grid-column: 1 / -1; }
  .metric { padding: 10px 0 0; border-left: 0; border-top: 1px solid #476080; }
  .activity-header button { padding-inline: 8px; font-size: .85rem; }
}

#administration { margin-top: 20px; }
#inventory-form { margin-top: 12px; }
.inventory-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.inventory-controls input { flex: 1 1 130px; }
.inventory-controls select {
  min-height: 44px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid #8494ac;
  border-radius: 9px;
  background: white;
  font: inherit;
  color: inherit;
}
.inventory-table { overflow-x: auto; margin: 8px 0; }
.inventory-table table { width: 100%; border-collapse: collapse; text-align: left; }
.inventory-table th, .inventory-table td { padding: 8px; border-bottom: 1px solid #d5deeb; }
.admin-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.admin-links a { color: #2345a0; padding: 8px; border: 1px solid #bac9e0; border-radius: 8px; }

.workspace-nav, .session-controls { display: flex; align-items: center; gap: 8px; }
.workspace-nav { margin-bottom: 16px; }
.session-controls { min-width: 0; }
.session-label { min-width: 0; overflow-wrap: anywhere; text-align: right; line-height: 1.25; }
.session-label small { display: block; color: #a8dbeb; }
@media (max-width: 500px) {
  .session-label { font-size: .73rem; }
  .session-controls button { padding-inline: 8px; }
}

.inventory-edit { margin-top: 16px; }
.inventory-edit textarea, .inventory-edit select {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  padding: 8px;
  font: inherit;
  color: inherit;
}
.inventory-edit .inventory-controls { margin-top: 12px; }

#funding-panel summary { cursor: pointer; font-weight: 650; }
#funding-form label { margin-top: 8px; }
#funding-status { margin-top: 8px; }
