:root {
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", Meiryo, sans-serif;
  color: #20374a;
  background: #eef3f7;
  font-size: 15px;
  line-height: 1.6;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  background: #173d60;
  color: white;
  border-bottom: 4px solid #78b7bd;
}
.header-inner {
  max-width: 1100px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px;
}
.brand-mark {
  font-size: 38px;
  line-height: 1;
  background: #ffffff14;
  width: 56px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid #ffffff30;
  border-radius: 12px;
}
h1 {
  font-size: 23px;
  margin: 0;
  letter-spacing: 0.04em;
}
header p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #ccdde8;
}
.version {
  font-size: 11px;
  margin-left: auto;
  white-space: nowrap;
  color: #c7e4e5;
}
main {
  max-width: 1100px;
  margin: auto;
  padding: 24px;
}
.panel {
  background: white;
  border: 1px solid #d9e4eb;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 3px 14px #173d6005;
}
h2 {
  font-size: 20px;
  line-height: 1.4;
  margin: 4px 0 15px;
}
h3 {
  font-size: 17px;
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: #4c7b8c;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
}
.muted {
  color: #617487;
}
.small {
  font-size: 12px;
}
button,
.button-link {
  border: 1px solid #bbcedc;
  background: #f2f7fb;
  color: #1e536f;
  padding: 10px 14px;
  min-height: 44px;
  border-radius: 9px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
  max-width: 100%;
}
button:hover {
  background: #e5f0f5;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
.primary {
  background: #1e6c93;
  color: white;
  border-color: #1e6c93;
}
.primary:hover {
  background: #175678;
}
.quiet {
  background: white;
  font-weight: 500;
}
.danger {
  color: #994755;
  background: #fbf0f1;
  border-color: #dfc1c5;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 18px 0;
}
.fields .wide {
  grid-column: 1/-1;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #536d7d;
}
input,
select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  color: #20374a;
  background: white;
  border: 1px solid #b6c7d3;
  border-radius: 8px;
  padding: 10px;
  margin: 5px 0;
  min-height: 44px;
}
input:focus {
  outline: 3px solid #bce4f4;
  border-color: #2586b4;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #d68a2e;
  outline-offset: 3px;
}
form {
  margin: 0;
}
details {
  border-top: 1px solid #e1e8ed;
  margin-top: 18px;
  padding-top: 15px;
}
summary {
  cursor: pointer;
  color: #2b5e7c;
  font-weight: 600;
  padding: 4px 0;
  min-height: 38px;
}
.groupbar,
.section-head,
.modebar,
.confirmbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.groupbar h2 {
  margin-bottom: 4px;
}
.groupbar p {
  margin: 0;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sync {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 5px;
}
.sync small {
  font-size: 11px;
  color: #68808f;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 21px 0;
}
.stats > div {
  border-radius: 11px;
  padding: 15px 18px;
  background: #f1f5f8;
  border-left: 4px solid #8eacbc;
}
.stats > div:first-child {
  background: #edf7f2;
  border-color: #4d9b78;
}
.stats > div:nth-child(2) {
  background: #faf0f0;
  border-color: #c18c95;
}
.stats small {
  color: #597081;
  font-size: 12px;
}
.stats strong {
  font-size: 30px;
  display: block;
  line-height: 1.4;
}
.segmented {
  display: flex;
  background: #edf2f6;
  padding: 4px;
  border-radius: 11px;
  gap: 4px;
}
.segmented button {
  border: 0;
  background: none;
  min-width: 112px;
}
.segmented .active {
  background: white;
  color: #1c698d;
  box-shadow: 0 1px 5px #264f7322;
}
.cabinet-tabs {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 18px 1px 10px;
}
.cabinet-tabs button {
  white-space: nowrap;
}
.cabinet-tabs .active {
  background: #173d60;
  color: white;
  border-color: #173d60;
}
.cabinet-form {
  display: grid;
  grid-template-columns: 100px minmax(100px, 1fr) 100px auto;
  gap: 10px;
  align-items: end;
  background: #f4f7fa;
  border: 1px solid #dce5eb;
  border-radius: 12px;
  padding: 14px;
  margin: 10px 0;
}
.cabinet-form button {
  margin-bottom: 5px;
}
.legend {
  font-size: 11px;
  color: #607485;
  margin: 20px 0 12px;
}
.available-dot {
  color: #4b9571;
}
.busy-dot {
  color: #c87e8c;
}
.mine-dot {
  color: #437ca6;
}
.selected-dot {
  color: #d28b28;
}
.devices {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.device {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 92px;
  padding: 13px 5px;
  background: #eef8f2;
  border: 1px solid #a4cfb7;
  color: #326a50;
  position: relative;
  word-break: break-word;
}
.device strong {
  font-size: 17px;
}
.device span {
  font-size: 11px;
  line-height: 1.4;
}
.device.busy {
  background: #fcf0f2;
  color: #9a4e61;
  border-color: #e7bdc7;
}
.device.mine {
  background: #ecf4ff;
  color: #35678c;
  border-color: #a0c1dc;
}
.device.selected {
  background: #fff2d8;
  border: 2px solid #ca852a;
  box-shadow: 0 0 0 1px #ca852a;
  color: #794e10;
}
.device:disabled {
  opacity: 0.65;
}
.confirmbar {
  border-top: 1px solid #e1e8ed;
  margin-top: 22px;
  padding-top: 18px;
}
.confirmbar > div:first-child {
  flex: 1;
  min-width: 180px;
}
#chosenLabels {
  max-width: 500px;
  overflow-wrap: anywhere;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #e1e8ed;
  text-align: left;
  vertical-align: top;
}
th {
  background: #f4f7fa;
  color: #637a8d;
  white-space: nowrap;
}
.table-scroll {
  overflow-x: auto;
}
.table-scroll table {
  min-width: 570px;
}
.inline-form {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.inline-form label {
  flex: 1;
  min-width: 120px;
}
.inline-form button {
  margin-bottom: 5px;
}
.tablet-edit {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 8px;
  align-items: end;
  border-bottom: 1px solid #e1e8ed;
  padding: 10px 0;
}
.tablet-edit button {
  margin-bottom: 5px;
}
.filelabel {
  margin: 18px 0;
}
input[type="file"] {
  font-size: 13px;
}
.group-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
#notice,
.alert {
  padding: 15px 18px;
  background: #eed8e0;
  border: 1px solid #d9aebd;
  color: #352a30;
  border-radius: 10px;
  margin-bottom: 17px;
  white-space: pre-line;
}
#notice.success {
  background: #e6f4ec;
  border-color: #bbdac8;
  color: #29553b;
}
.alert p {
  font-size: 12px;
}
.preview-list {
  max-height: 300px;
  overflow: auto;
  background: #f6f8fa;
  padding: 10px;
  border-radius: 8px;
}
.preview-list > div {
  padding: 5px;
  border-bottom: 1px solid #e0e6eb;
  font-size: 12px;
}
dialog {
  border: 1px solid #c8d6df;
  border-radius: 16px;
  padding: 24px;
  max-width: min(660px, calc(100% - 24px));
  max-height: 90dvh;
  color: #20374a;
}
dialog::backdrop {
  background: #132b43aa;
}
dialog > form {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}
.modal-content {
  overflow-wrap: anywhere;
}
.qr {
  text-align: center;
}
.qr canvas {
  max-width: 100%;
  height: auto;
}
.urltext {
  font-size: 12px;
  word-break: break-all;
  background: #f1f5f8;
  padding: 10px;
  border-radius: 8px;
}
.code {
  font-family: monospace;
  font-size: 12px;
  word-break: break-all;
}
.credential {
  padding: 12px;
  border: 1px solid #d8e2e9;
  margin: 10px 0;
  border-radius: 9px;
}
.empty {
  grid-column: 1/-1;
  padding: 30px;
  text-align: center;
  color: #718591;
  background: #f7f9fb;
  border-radius: 10px;
}
footer {
  text-align: center;
  color: #8293a1;
  font-size: 11px;
  padding: 10px 0 25px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  main {
    padding: 14px;
  }
  .header-inner {
    padding: 18px;
  }
  .panel {
    padding: 18px;
  }
  .devices {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .cabinet-form {
    grid-template-columns: 80px minmax(90px, 1fr) 85px;
  }
  .cabinet-form button {
    grid-column: 1/-1;
  }
  .tablet-edit {
    grid-template-columns: 1fr 1fr;
  }
  .version {
    display: none;
  }
  .groupbar .actions {
    width: 100%;
  }
}
@media (max-width: 420px) {
  main {
    padding: 9px;
  }
  .panel {
    padding: 14px;
    border-radius: 12px;
  }
  h1 {
    font-size: 19px;
  }
  .brand-mark {
    width: 40px;
    height: 46px;
    font-size: 28px;
  }
  .header-inner {
    gap: 10px;
    padding: 16px 12px;
  }
  header p {
    font-size: 10px;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  .fields .wide {
    grid-column: auto;
  }
  .stats {
    gap: 7px;
  }
  .stats > div {
    padding: 10px;
  }
  .stats strong {
    font-size: 25px;
  }
  .devices {
    gap: 7px;
  }
  .device strong {
    font-size: 15px;
  }
  .device {
    min-height: 85px;
  }
  .sync {
    align-items: flex-start;
  }
  .confirmbar .actions {
    width: 100%;
  }
  .confirmbar .primary {
    flex: 1;
  }
  .cabinet-form {
    gap: 7px;
    padding: 10px;
    grid-template-columns: 64px minmax(70px, 1fr) 70px;
  }
}

.page-tabs {display:flex;gap:12px;margin:0 0 20px;}
.page-tabs button {flex:1;min-height:48px;}
.page-tabs button[aria-pressed="true"] {background:#1c526b;color:white;}
.access-card {border:1px solid #ccdbe3;border-radius:12px;padding:20px;margin:16px 0;overflow-wrap:anywhere;}
.access-card canvas {max-width:100%;height:auto;}
[hidden] {display:none !important;}

/* Group creation is available from the right side of the title banner. */
.header-inner { flex-wrap: wrap; }
.header-actions { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#groupsPageBtn { background: #ffdf43; color: #20374a; border: 2px solid #ffdf43; white-space: nowrap; min-height: 44px; }
#groupsPageBtn:hover { background: #ffe976; border-color: #ffe976; }
#groupsPageBtn[aria-pressed="true"] { background: #ffcf24; border-color: white; box-shadow: 0 0 0 2px #ffcf24; }
@media (max-width: 600px) {
  .header-actions { flex-direction: row; justify-content: flex-end; width: 100%; }
  .header-actions .version { margin-left: 0; }
}

#groupsPage {margin:0 0 0 auto;width:min(440px,90vw);height:100dvh;max-height:100dvh;max-width:none;padding:12px;overflow:auto;border:0;background:#eef3f7;}
#groupsPage::backdrop {background:#16344e66;}
#groupsPage .panel {padding:12px;}
#groupsPage canvas {max-width:100%;height:auto;}
#groupsPage .fields {grid-template-columns:1fr;}
@media(max-width:600px){
  #groupsPage {width:60vw;}
  .header-inner {display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:6px;padding:12px 8px;}
  .header-inner .brand-mark {width:28px;height:36px;font-size:22px;}
  .header-inner h1 {font-size:clamp(14px,4vw,20px);}
  .header-actions {width:auto;}
  #groupsPageBtn {padding:7px;font-size:13px;}
}

.entry-heading,.picker-head {display:flex;align-items:center;justify-content:space-between;gap:10px;}
.entry-heading label {width:45%;min-width:0;}
.entry-heading strong {display:block;overflow-wrap:anywhere;}
.entry-heading input {font-size:12px;width:100%;}
#chooseUser {display:flex;width:60%;margin:20px auto;}
#userPicker {width:min(94vw,660px);max-width:94vw;box-sizing:border-box;padding:14px;}
.picker-head {margin-bottom:14px;}
.picker-head h2 {font-size:18px;margin:0;}
.picker-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin:12px 0;}
.picker-grid button {padding:7px 2px;overflow-wrap:anywhere;min-width:0;}

.stats {margin:10px 0;gap:6px;}
.stats > div {padding:4px 6px;line-height:1.2;}
.stats strong {font-size:18px;line-height:1.15;}

.loan-controls {position:sticky;top:0;z-index:3;background:white;border-bottom:1px solid #cfdae1;padding:3px 0;display:grid;grid-template-columns:auto 1fr;gap:3px;align-items:center;}
.loan-controls .compact-sync,.loan-controls .stats,.loan-controls .cabinet-tabs,.loan-controls .alert {grid-column:1/-1;}
.compact-sync,.registration {display:flex;align-items:center;justify-content:space-between;gap:4px;}
.registration {justify-content:flex-end;font-size:12px;}
.loan-controls .stats,.loan-controls .modebar,.loan-controls .cabinet-tabs {margin:0;}
.loan-controls button {min-height:32px;padding:3px 7px;font-size:13px;}
.loan-controls .segmented {padding:2px;}
.loan-controls .stats>div {display:flex;align-items:baseline;justify-content:center;gap:3px;flex-wrap:wrap;padding:3px;}
.loan-controls .cabinet-tabs {display:flex;flex-wrap:nowrap;overflow-x:auto;}
.loan-controls .cabinet-tabs button {flex:none;}

/* Separate availability counts from the registration controls. */
.loan-controls .stats {
  padding-bottom: 7px;
  margin-bottom: 5px;
  border-bottom: 1px solid #b8c8d1;
}
.loan-controls {grid-template-columns:minmax(0,1fr) auto;}
.loan-controls .modebar {min-width:0;}
.loan-controls .segmented {min-width:0;width:100%;}
.loan-controls .segmented button {white-space:nowrap;min-width:0;flex:1;}
.loan-controls .registration {white-space:nowrap;}
.loan-controls #chosen {font-size:11px;}
.loan-controls #clearBtn,.loan-controls #confirmBtn {white-space:nowrap;flex-shrink:0;}
.loan-controls #confirmBtn {
  background:#a75660;
  border-color:#984b55;
  color:#fff;
  min-width:48px;
}
.loan-controls #confirmBtn:enabled {
  background:linear-gradient(#b96a73,#a7535e);
  box-shadow:0 0 0 2px #b96a7329,0 0 10px #a7535e55,inset 0 1px 1px #ffffff66;
}
.loan-controls #confirmBtn:enabled:hover {background:#a4515c;}
.loan-controls #confirmBtn:disabled {
  background:#d5babc;
  border-color:#c6a5a9;
  color:#65454a;
  opacity:1;
  box-shadow:none;
}

/* Keep status readable even when checkout is unavailable. */
.device:disabled {opacity:1;}
.device {background:#eaf7ed;border:2px solid #4c9365;color:#245537;}
.device.busy,.device.mine {background:#ead5d9;border:2px solid #a76573;color:#633541;}
.device .device-status {font-weight:800;font-size:12px;padding:3px 5px;border-radius:5px;background:#286b43;color:white;}
.device.busy .device-status,.device.mine .device-status {background:#8d4557;color:white;}
.device .device-holder {color:inherit;font-size:11px;}
.device.selected {background:#fff0bf;border:2px solid #b87914;color:#66400b;box-shadow:0 0 0 2px #b87914;}
.device.selected .device-status {background:#80500a;color:white;}
.device:enabled:hover {box-shadow:0 0 0 2px currentColor;}
.device:disabled {cursor:not-allowed;}

/* A centered settings dialog, with the existing outside-tap dismissal. */
#groupsPage {inset:0;margin:auto;height:auto;max-height:88dvh;border:1px solid #d7e1e7;border-radius:18px;box-shadow:0 18px 60px #173d6033;}
#groupsPage .cabinet-form {grid-template-columns:minmax(0,1fr);min-width:0;}
#groupsPage .cabinet-form button {grid-column:auto;}
#groupsPage .tablet-edit {grid-template-columns:minmax(0,1fr);}
#groupsPage .inline-form label {min-width:0;width:100%;}
#closeGroups {display:flex;margin:0 auto 12px;}
/* Muted rose and sage retain the explicit status labels. */
.device {background:linear-gradient(150deg,#f4faf6,#e5f1e9);border:1px solid #8bb59c;box-shadow:0 2px 6px #254d3710;}
.device.busy,.device.mine {background:linear-gradient(150deg,#faf4f5,#eddee2);border:1px solid #b58b96;color:#69434e;}
.device .device-status {background:#45785b;border-radius:6px;}
.device.busy .device-status,.device.mine .device-status {background:#946473;}
.return-view .device {gap:5px;}
.return-view .device.selected,.device.selected {background:linear-gradient(150deg,#fff8df,#f7e5b6);border:2px solid #b98b38;color:#654b20;box-shadow:0 0 0 1px #b98b38;}
.device.selected .device-status {background:#886329;}

/* Fixed top alignment and softly illuminated status cards. */
.devices .device {
  --card-accent:#237d72;--card-glow:#45c5ad40;--card-tint:#eaf8f4;
  justify-content:flex-start;align-items:center;gap:8px;
  padding:15px 5px 12px;border:1px solid #77bcae;
  background:linear-gradient(155deg,#ffffff 8%,var(--card-tint) 100%);
  color:#20574e;border-radius:12px;
  box-shadow:inset 0 1px 2px #ffffff,0 0 9px var(--card-glow),0 3px 8px #193b4810;
}
.devices .device > strong {
  display:block;flex:0 0 auto;align-self:stretch;
  margin:0;min-height:1.4em;line-height:1.4;text-align:center;
}
.devices .device.busy,.devices .device.mine {
  --card-accent:#96536b;--card-glow:#d887a340;--card-tint:#f8edf2;
  background:linear-gradient(155deg,#ffffff 8%,var(--card-tint) 100%);
  border-color:#c592a6;color:#68394d;
}
.devices .device .device-status {
  background:var(--card-accent);color:#fff;border:1px solid #ffffff55;
  box-shadow:inset 0 1px 1px #ffffff40,0 1px 5px var(--card-glow);
  border-radius:6px;padding:3px 5px;
}
.devices .device.selected,.return-view .device.selected {
  --card-accent:#8a5c13;--card-glow:#e5b24488;--card-tint:#fff1c8;
  background:linear-gradient(155deg,#fffdf5 8%,var(--card-tint) 100%);
  border:1px solid #c5912e;color:#68470e;
  box-shadow:0 0 0 2px #dfb650,0 0 15px var(--card-glow),inset 0 1px 3px #fff;
}
.devices .device:enabled:hover {box-shadow:0 0 0 1px var(--card-accent),0 0 14px var(--card-glow),inset 0 1px 2px #fff;}
.devices .device:disabled {opacity:1;}

.ledger-head{display:flex;justify-content:space-between;align-items:center;gap:6px;margin-bottom:8px}.ledger-head .segmented button{min-width:0;padding:7px 12px}.loan-controls #cabinetTabs{grid-column:1;min-width:0;padding:4px 0}.schedule-grid{display:grid;grid-template-columns:auto repeat(5,minmax(0,1fr));gap:4px;text-align:center;align-items:center}.schedule-grid input,.schedule-devices input{width:18px;min-height:18px;height:18px}.schedule-devices{display:flex;flex-wrap:wrap;gap:8px}.schedule-devices label{display:flex;align-items:center;gap:3px}.schedule-note{color:#69407a;font-weight:bold}

#scheduleBtn, #saveSchedule {
  background: #24669f;
  color: white;
  border-color: #20598b;
}
#scheduleBtn:hover, #saveSchedule:hover { background: #1c5689; }
.schedule-grid {
  grid-template-columns: 2.2em repeat(5, minmax(0, 1fr));
  gap: 1px;
  align-items: stretch;
  padding: 1px;
  background: #dce5ed;
}
.schedule-grid > * {
  display: grid;
  place-items: center;
  min-height: 32px;
  background: white;
}
.schedule-grid > b, .schedule-grid > span { background: #f5f8fb; }
.schedule-grid input, .schedule-devices input { accent-color: #24669f; }
#scheduleFields fieldset {
  min-width: 0;
  margin: 0 0 12px;
  padding: 8px 10px 12px;
  border: 1px solid #d2dee8;
  border-radius: 10px;
  background: #edf5fb;
}
#scheduleFields fieldset:nth-of-type(3n + 2) { background: #edf7f1; border-color: #cfdfd5; }
#scheduleFields fieldset:nth-of-type(3n) { background: #f4f0fa; border-color: #ddd5e7; }
#scheduleFields legend { padding: 0 5px; font-weight: 700; }

.schedule-devices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
}
.schedule-devices label {
  position: relative;
  justify-content: center;
  min-height: 44px;
  padding: 4px;
  border: 1px solid #abc3d4;
  border-radius: 8px;
  background: white;
  color: #234860;
  font-size: 15px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.schedule-devices label input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.schedule-devices label:has(input:checked) {
  background: #24669f;
  border-color: #184d7a;
  color: white;
  box-shadow: inset 0 0 0 1px #184d7a;
}
.schedule-devices label:has(input:focus-visible) {
  outline: 3px solid #d69032;
  outline-offset: 2px;
}

.schedule-report {background:white;}
.schedule-report table {width:100%;}
.schedule-report th,.schedule-report td {border:1px solid #bac8d2;padding:6px;overflow-wrap:anywhere;}
.schedule-report #printReport {float:right;}
@media print {
  .schedule-report #printReport {display:none;}
  .schedule-report main {max-width:none;margin:0;padding:0;}
  .schedule-report thead {display:table-header-group;}
  .schedule-report tr {break-inside:avoid;}
}

.ledger-head {display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;}
#ledgerGroupName {min-width:0;line-height:1.25;overflow-wrap:anywhere;}
.ledger-head .modebar {justify-self:center;}
.ledger-head #scheduleBtn {justify-self:end;white-space:nowrap;}
@media(max-width:420px){
  .ledger-head {gap:3px;}
  .ledger-head .segmented button,.ledger-head #scheduleBtn {padding:6px;font-size:13px;}
  #ledgerGroupName {font-size:13px;}
}

[data-tint="0"] {--sheet:#bcd8ee;--edge:#83aacb;}
[data-tint="1"] {--sheet:#aed8c5;--edge:#80af99;}
[data-tint="2"] {--sheet:#d7c8eb;--edge:#ae98c6;}
[data-tint="3"] {--sheet:#eed4a5;--edge:#c3a46d;}
.loan-controls {padding-bottom:0;border-bottom:0;}
.loan-controls #cabinetTabs {align-self:stretch;align-items:flex-end;padding:4px 0 0;gap:4px;}
#cabinetTabs button {background:var(--sheet);color:#314d5d;border:1px solid var(--edge);border-radius:9px 9px 0 0;}
#cabinetTabs button.active {border-top:3px solid var(--edge);border-bottom-color:var(--sheet);box-shadow:0 2px var(--sheet);color:#163b50;}
#cabinetTabs {position:relative;bottom:-1px;}
#cabinetSheet {background:var(--sheet,#f4f7fa);border:1px solid var(--edge,#ccdbe2);border-radius:0 0 12px 12px;padding:8px clamp(4px,1vw,12px) 12px;}
#cabinetSheet .legend {margin:0 0 8px;}

#modal:has(#scheduleFields) {
  width: 75vw;
  max-width: 75vw;
  max-height: 75vh;
  max-height: 75dvh;
  margin: auto;
  padding: clamp(12px, 2vw, 24px);
  overflow: auto;
}
.devices .device {
  min-height: 64px;
  gap: 4px;
  padding: 8px 4px;
}
.devices .device > strong {
  font-size: clamp(18px, 2.4vw, 21px);
  min-height: 1.25em;
  line-height: 1.25;
}
.schedule-devices label {font-size:17px;padding:2px;}

.devices .device > strong.text-medium {font-size:15px;}
.devices .device > strong.text-long {font-size:12px;}
.devices .device .team-name {font-size:14px;font-weight:600;line-height:1.25;}
.devices .device .team-name.text-medium {font-size:12px;}
.devices .device .team-name.text-long {font-size:11px;}
.devices .device .team-name,.devices .device > strong {max-width:100%;overflow-wrap:anywhere;}
#menuSettings .tablet-edit {grid-template-columns:minmax(0,1fr) minmax(0,1fr);}
#menuSettings .tablet-edit label {grid-column:1/-1;}


#devices .device {
  --wash:#eaf8f4; --rim:#82bcb1; --ink:#20574e; --badge:#427c70;
  background:linear-gradient(155deg,#fff 8%,var(--wash));
  border:1px solid var(--rim); border-radius:12px; color:var(--ink);
  box-shadow:0 2px 6px rgb(42 83 86 / 12%),inset 0 1px 0 white;
  padding:8px 4px; gap:5px;
}
#devices .device.busy,#devices .device.mine {
  --wash:#f8edf2; --rim:#bf96a7; --ink:#663b4c; --badge:#925269;
}
#devices .device.selected {
  --wash:#fff0ca; --rim:#bd9039; --ink:#674819; --badge:#846020;
  box-shadow:0 0 0 1px var(--rim);
}
#devices .device strong {font-variant-numeric:tabular-nums;}
#devices .device strong small {font-size:inherit;vertical-align:baseline;}
#devices .device .device-status {
  background:var(--badge);color:white;border:1px solid #ffffff55;border-radius:5px;
  padding:2px 6px;box-shadow:inset 0 1px 1px #ffffff38,0 1px 4px #57334222;
}
#devices .device .schedule-note {color:#644477;}
#devices .device:focus-visible {outline:3px solid #1866ad;outline-offset:2px;}



#groupsPageBtn {
  background:#e3edf5;
  border-color:#b9cedf;
  color:#244b69;
}
#groupsPageBtn:hover,#groupsPageBtn[aria-expanded="true"] {
  background:#cfdfec;
  border-color:#aac3d8;
  color:#203f59;
}
#scheduleBtn {
  background:#f0aa57;
  border-color:#ce8736;
  color:#4b2c0c;
}
#scheduleBtn:hover {background:#e99c44;}
#devices .device > strong,#devices .device > strong small {font-weight:400;}

header {
  background:#e3edf2;
  color:#234c62;
  border-bottom:2px solid #b5cbd0;
}
.brand-mark {background:#ffffff66;border-color:#b8ccd5;}
header .version {color:#526f80;}
.ledger-head .segmented {
  background:#194e42;
  border:1px solid #194e42;
  border-radius:11px;
  padding:3px;
  gap:3px;
}
.ledger-head .segmented button {
  background:transparent;
  color:#fff;
  border:1px solid transparent;
}
.ledger-head .segmented button:hover {background:#286451;}
.ledger-head .segmented button.active {
  background:#327a60;
  color:#fff;
  border-color:#b4d8c8;
  box-shadow:inset 0 1px 0 #ffffff30;
}
.ledger-head .segmented button:focus-visible {
  outline:2px solid #edc45e;
  outline-offset:1px;
}

.ledger-head {
  background:#dcefe3;
  color:#285b43;
  border-radius:12px;
  padding:10px 6px;
}
.ledger-head .segmented {
  background:#fff;
  border-color:#fff;
}
.ledger-head .segmented button {
  background:#fff;
  color:#245a46;
}
.ledger-head .segmented button:hover {background:#f0f7f3;}
.ledger-head .segmented button.active {
  background:#fff;
  color:#174c37;
  border-color:#4b876c;
  box-shadow:inset 0 -3px 0 #327a60;
}

.ledger-head {background:#f4dfe6;color:#694652;}
.ledger-head .segmented button {color:#6b4654;}
.ledger-head .segmented button:hover {background:#fcf5f7;}
.ledger-head .segmented button.active {
  background:#fff;
  color:#633a49;
  border-color:#b77e92;
  box-shadow:0 0 6px 2px rgba(154,88,112,.28);
}

/* A restrained shared card surface over pale cabinet sheets. */
[data-tint="0"] {--sheet:#edf3f8;--edge:#b5c7d5;}
[data-tint="1"] {--sheet:#eef5f1;--edge:#b4cbbf;}
[data-tint="2"] {--sheet:#f3f0f7;--edge:#c6bed1;}
[data-tint="3"] {--sheet:#f7f3eb;--edge:#d2c6b0;}
.ledger-head {background:#f7edf0;}
#devices .device {
  --wash:#a7e5d4;--rim:#4da991;--ink:#174f43;--badge:#397f6b;
  background:linear-gradient(150deg,#f4fffb 3%,var(--wash));
  color:var(--ink);border-color:var(--rim);
  box-shadow:inset 0 1px 0 #ffffffcc,0 0 5px #409f8520;
}
#devices .device.busy,#devices .device.mine {
  --wash:#efb6c9;--rim:#c77996;--ink:#653048;--badge:#91425f;
}
#devices .device .schedule-note {color:#643c7e;}
#devices .device.selected {
  --wash:#f8d783;--rim:#bf8b23;--ink:#62430d;--badge:#815b13;
  background:linear-gradient(150deg,#fffaf0 3%,var(--wash));
  color:var(--ink);border-color:var(--rim);
  box-shadow:0 0 0 2px #d9ab49,inset 0 1px 0 #ffffffbb;
}

/* Compact white title and neutral surroundings for colored cards. */
header {background:#fff;color:#000;border-bottom:1px solid #ddd;}
.header-inner {padding-top:8px;padding-bottom:8px;}
.header-inner .brand-mark {height:34px;width:34px;font-size:25px;background:#fff;color:#000;border-color:#ccc;}
:root,body {color:#000;background:#f3f3f3;}
.ledger-head {background:#e9e9e9;color:#000;}
[data-tint="0"] {--sheet:#f4f4f4;--edge:#aaa;}
[data-tint="1"] {--sheet:#e9e9e9;--edge:#999;}
[data-tint="2"] {--sheet:#f8f8f8;--edge:#aaa;}
[data-tint="3"] {--sheet:#dedede;--edge:#999;}
#devices .device,#devices .device.selected {
  background:radial-gradient(ellipse at center,#fff 22%,#ffffffed 40%,var(--wash) 100%);
  color:#000;
}
#devices .device strong,#devices .device span {color:#000;}
#devices .device .device-status {
  color:#000;
  background:#ffffffb3;
  border-color:var(--rim);
  box-shadow:none;
}
h1,h2,h3,label,input,select,button,.button-link,summary,.muted,.small,
.legend,.stats small,.stats strong,footer,header .version,.eyebrow,
.ledger-head .segmented button,.ledger-head .segmented button.active,
#groupsPageBtn,#scheduleBtn,#saveSchedule,#cabinetTabs button,
#cabinetTabs button.active,.loan-controls #confirmBtn,
.loan-controls #confirmBtn:disabled,.empty,
.schedule-devices label,.schedule-devices label:has(input:checked) {color:#000;}
.schedule-devices label:has(input:checked) {background:#b8d8f0;}
#saveSchedule {background:#b8d8f0;}
#saveSchedule:hover {background:#a2cbe9;}

.ledger-head {background:#f4dfe6;color:#000;}
#devices .device {--wash:#d5eee6;}
#devices .device.busy,#devices .device.mine {--wash:#f2dce5;}
#devices .device.selected {--wash:#f5e7c3;}
#devices .device,#devices .device.selected {
  background:radial-gradient(ellipse farthest-corner at center,#fff 0%,var(--wash) 100%);
}
