:root {
  color-scheme: light;
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  color: #183130;
  background: #f3f6f5;
  line-height: 1.5;
  --text: #183130;
  --muted: #526563;
  --brand: #145b50;
  --line: #dce6e3;
  --paper: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.045em; line-height: 1.13; overflow-wrap: anywhere; }
h2 { font-size: 1.12rem; letter-spacing: -.02em; }
p { color: var(--muted); }
a { color: var(--brand); font-weight: 650; text-underline-offset: .2em; }
button, input { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, .table-area:focus-visible {
  outline: 3px solid #207e6b;
  outline-offset: 3px;
}
.wrap { width: min(100% - 2rem, 73rem); margin-inline: auto; }
.masthead { background: #163b36; color: #fff; }
.head-content { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: #fff; font-weight: 700; }
.mark { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; background: #d8f0e6; color: #164c42; border-radius: .58rem; font-size: .78rem; }
main { padding-block: clamp(2rem, 6vw, 4rem); }
.page-heading { margin-bottom: 1.7rem; }
.page-heading p { margin-top: .6rem; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, .42fr); gap: 1.1rem; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: .95rem; padding: clamp(1.1rem, 3vw, 1.65rem); min-width: 0; }
.panel h2 { margin-bottom: 1rem; }
.login, .issued { width: min(100%, 37rem); margin: 1rem auto; }
.login h1, .issued h1 { margin-bottom: 1.25rem; }
.stack { display: grid; gap: 1rem; }
.stack label { display: grid; gap: .38rem; font-size: .91rem; font-weight: 650; }
input:not([type=hidden]) { width: 100%; min-height: 2.75rem; background: #fbfdfc; color: var(--text); border: 1px solid #aabdb8; border-radius: .5rem; padding: .55rem .7rem; }
button { background: #fff; border: 1px solid #a9bbb7; color: var(--text); border-radius: .5rem; padding: .55rem .9rem; min-height: 2.65rem; cursor: pointer; font-weight: 650; }
button:hover { background: #eaf2ef; }
button.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
button.primary:hover { background: #10463e; }
button.quiet { background: transparent; border-color: #76988f; color: #fff; }
button.quiet:hover { background: #285249; }
button.danger { color: #922f2a; border-color: #ddb9b6; }
button.danger:hover { background: #fbefee; }
.count { margin-left: .3rem; color: var(--muted); font-size: .85rem; }
.empty { padding-block: .65rem; }
.table-area { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: .75rem .75rem .75rem 0; border-top: 1px solid var(--line); vertical-align: top; }
thead th { color: var(--muted); }
th[scope=row] { font-weight: 650; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: .19rem .55rem; font-size: .77rem; border-radius: 1rem; font-weight: 700; white-space: nowrap; background: #e9efef; color: #425a57; }
.badge.active { background: #dbeee6; color: #185e46; }
.badge.expired { background: #faeed7; color: #744803; }
.badge.suspended { background: #f8e8e8; color: #8a332e; }
.device { overflow-wrap: anywhere; font-size: .82em; }
table .device { display: block; min-width: 7rem; }
.back { display: inline-block; margin-bottom: 1rem; }
.title-row { display: flex; align-items: center; flex-wrap: wrap; gap: .85rem; }
.detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.info { margin: 0; }
.info div + div { margin-top: 1rem; }
dt { color: var(--muted); font-weight: 650; font-size: .88rem; }
dd { margin: .22rem 0 0; }
.muted { font-weight: 400; }
.actions, .inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.history { margin-top: 1.1rem; }
.notice { border: 1px solid #bbd8cf; border-radius: .5rem; background: #eef7f3; padding: .7rem .9rem; margin-bottom: 1rem; color: #214a41; }
.notice.error { border-color: #ddb9b6; background: #fff1ef; color: #832e27; }
.issued-key { display: block; padding: 1rem; border: 1px solid #c8dfd7; border-radius: .5rem; background: #f0f8f4; overflow-wrap: anywhere; margin-block: 1rem; user-select: all; }
#copy-status:not(:empty) { margin-top: .55rem; }
@media (max-width: 50rem) {
  .dashboard, .detail-grid { grid-template-columns: 1fr; }
  .dashboard:not(.detail-grid) > :last-child { grid-row: 1; }
}
