@layer reset,base,layout,components,pages,responsive;
@layer components {
  .developer-credit { margin-top: 28px; text-align: center; }
  .developer-credit a { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-height: 44px; font-size: 11px; color: #6b665f; text-decoration: none; }
  .developer-credit img { display: block; width: 108px; height: auto; }
  .developer-credit a:hover span { text-decoration: underline; }
  .student-loans {
    flex-basis: 100%;
    border-top: 1px solid var(--line);
    margin-top: 3px;
  }
  .student-loans>summary {
    font-size: 11px;
    color: var(--accent-ink);
    padding: 10px 0;
    min-height: 44px;
  }
  .student-loans .copy-list>a {
    font-size: 11px;
    gap: 14px;
  }
  .student-loans .copy-list .code-small {
    flex: 0 0 auto;
  }
  .student-loans .copy-list>a>span:nth-child(2) {
    flex: 1;
  }
  .copy-list>.text-link {
    font-size: 11px;
    min-height: 48px;
    justify-content: center;
  }
}
@layer responsive {
  @media (max-width:720px) {
    .search-input input {
      padding-left: 43px;
    }
    .student-loans .copy-list>a {
      flex-wrap: wrap;
    }
    .student-loans .copy-list .code-small {
      flex-basis: auto;
    }
    .student-loans .copy-list>a>.icon {
      position: static;
    }
  }
}
@layer reset {
  * {
    box-sizing: border-box;
  }
  html {
    scroll-behavior: smooth;
  }
  body,h1,h2,h3,p,ul,ol,dl,dd {
    margin: 0;
  }
  button,input,select,textarea {
    font: inherit;
  }
  button,a,input,select,textarea,summary {
    -webkit-tap-highlight-color: transparent;
  }
  button {
    cursor: pointer;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
  img,svg {
    max-width: 100%;
  }
  [hidden] {
    display: none !important;
  }
  svg {
    flex-shrink: 0;
  }
  button {
    color: inherit;
  }
  input,select,textarea {
    min-width: 0;
  }
  button:disabled {
    cursor: not-allowed;
  }
  summary {
    cursor: pointer;
    list-style: none;
  }
  summary::-webkit-details-marker {
    display: none;
  }
}
@layer base {
  :root {
    --bg: #faf9f6;
    --surface: #fff;
    --ink: #25231f;
    --muted: #6b665f;
    --accent-ink: #793900;
    --strong-ink: #30271e;
    --accent-soft: #fff0df;
    --line: #e8e3dc;
    --peach: #fff0df;
    --sand: #f3efe8;
    --danger: #a53035;
    --radius: 14px;
    --shadow: 0 4px 18px #30271e05;
    --brand: #ff8000;
    --brand-hover: #ef7700;
  }
  body {
    background: var(--bg);
    color: var(--ink);
    font-family: Inter,"Segoe UI",Arial,sans-serif;
    font-size: 14px;
    line-height: 1.55;
  }
  ::selection {
    background: #ffdcad;
  }
  h1,h2,h3 {
    line-height: 1.25;
    letter-spacing: -.035em;
    font-weight: 650;
  }
  h1 {
    font-size: clamp(26px,2.6vw,36px);
  }
  h2 {
    font-size: 19px;
  }
  h3 {
    font-size: 15px;
  }
  p {
    color: var(--muted);
  }
  input,textarea,select {
    width: 100%;
    border: 1px solid #e8e3dc;
    background: white;
    color: var(--ink);
    border-radius: 10px;
    padding: 12px 14px;
    min-height: 47px;
    outline: none;
    transition: border-color .15s,box-shadow .15s;
  }
  textarea {
    resize: vertical;
    line-height: 1.6;
  }
  input::placeholder,textarea::placeholder {
    color: #6b665f;
  }
  input:focus,select:focus,textarea:focus {
    border-color: var(--accent-ink);
    box-shadow: 0 0 0 3px #ff800024;
  }
  input[type=checkbox] {
    width: 20px;
    min-height: 20px;
    height: 20px;
    accent-color: var(--accent-ink);
    flex-shrink: 0;
  }
  input[type=file] {
    padding: 9px;
    font-size: 13px;
  }
  input[type=file]::file-selector-button {
    border: 0;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent-ink);
    padding: 7px 10px;
    margin-right: 10px;
    cursor: pointer;
  }
  input[readonly] {
    background: #f5f2ed;
  }
  label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 7px;
  }
  button {
    border: 0;
  }
  a:focus-visible,button:focus-visible,summary:focus-visible {
    outline: 3px solid var(--accent-ink);
    outline-offset: 4px;
  }
  a:hover {
    color: var(--accent-ink);
  }
  button:disabled {
    opacity: .48;
  }
  select {
    appearance: auto;
  }
  table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
  }
  th,td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
  }
  th {
    color: var(--muted);
    font-weight: 500;
    background: #fdfbf8;
  }
  time {
    font-size: 12px;
    color: var(--muted);
  }
  .icon {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
  }
  .icon.small {
    width: 17px;
    height: 17px;
  }
  .svg-symbols {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
  }
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
  }
  .skip-link {
    position: fixed;
    z-index: 100;
    top: 10px;
    left: 10px;
    padding: 12px;
    background: var(--strong-ink);
    color: white;
    transform: translateY(-200%);
    border-radius: 8px;
  }
  .skip-link:focus {
    transform: translateY(0);
  }
  .muted {
    color: var(--muted);
  }
  .danger-text {
    color: var(--danger) !important;
  }
  .full-width {
    width: 100%;
  }
  .mint {
    background: var(--accent-soft);
    color: var(--accent-ink);
  }
  .peach {
    background: var(--peach);
    color: var(--accent-ink);
  }
  .lavender {
    background: #efebf7;
    color: #62517d;
  }
  .sand {
    background: var(--sand);
    color: var(--muted);
  }
  .eyebrow {
    font-size: 10px;
    letter-spacing: .15em;
    line-height: 1.5;
    color: #6b665f;
    font-weight: 700;
    text-transform: uppercase;
  }
  .live-dot,.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #78a585;
    display: inline-block;
    flex-shrink: 0;
  }
  .optional {
    font-weight: 400;
    color: var(--muted);
    font-size: 12px;
    margin-left: 4px;
  }
  .text-link {
    color: var(--accent-ink);
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 7px;
  }
  .text-link:hover {
    text-decoration: underline;
  }
  .text-button {
    padding: 10px 4px;
    min-height: 44px;
    background: none;
    color: var(--accent-ink);
    font-size: 12px;
    font-weight: 600;
    white-space: normal;
  }
  .text-button:hover {
    text-decoration: underline;
  }
}
@layer layout {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 238px;
    padding: 32px 20px 20px;
    background: #fff;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    z-index: 25;
  }
  .brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    letter-spacing: -1.5px;
    font-size: 30px;
    font-weight: 750;
    color: var(--strong-ink);
    line-height: 1;
  }
  .brand-mark {
    width: 35px;
    height: 39px;
    background: var(--brand);
    color: var(--ink);
    border-radius: 10px;
    display: grid;
    place-items: center;
    transform: none;
  }
  .brand-mark .icon {
    width: 23px;
    height: 23px;
    transform: none;
    stroke-width: 1.4;
  }
  .brand-dot {
    color: var(--brand);
  }
  .sidebar .brand {
    margin: 0 14px 39px;
  }
  .main-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  .main-nav>a {
    padding: 12px 14px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--muted);
    min-height: 45px;
    transition: background .15s;
  }
  .main-nav>a .icon {
    width: 19px;
    height: 19px;
  }
  .main-nav>a:hover {
    background: #f5f2ed;
    color: var(--ink);
  }
  .main-nav>a.active {
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-weight: 650;
  }
  .nav-divider {
    border-top: 1px solid var(--line);
    margin: 18px 13px;
  }
  .sidebar-bottom {
    margin-top: auto;
    padding-top: 35px;
  }
  .sidebar-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    row-gap: 10px;
    padding: 20px 13px 0;
    font-size: 10px;
    color: #6b665f;
  }
  .sidebar-legal>.help-link {
    flex-basis: 100%;
    font-size: 11px;
  }
  .app-shell {
    margin-left: 238px;
  }
  .topbar {
    height: 68px;
    border-bottom: 1px solid var(--line);
    padding: 0 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    gap: 20px;
  }
  .topbar-context {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #6b665f;
  }
  .topbar-actions {
    display: flex;
    align-items: center;
    gap: 18px;
  }
  .role-badge {
    font-size: 10px;
    font-weight: 500;
    color: #6b665f;
    background: #f5f2ed;
    border: 1px solid #e8e3dc;
    border-radius: 5px;
    padding: 4px 8px;
  }
  .avatar {
    display: inline-grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent-ink);
    width: 34px;
    height: 34px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .account-menu {
    position: relative;
  }
  .account-menu summary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
  }
  .account-menu summary>.icon {
    width: 12px;
    transform: rotate(90deg);
    color: #6b665f;
  }
  .account-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 14px);
    z-index: 45;
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 40px #152d351c;
    padding: 8px;
    width: 255px;
    max-width: 90vw;
  }
  .account-dropdown>a,.account-dropdown button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 12px;
    font-size: 13px;
    background: none;
    border-radius: 6px;
    text-align: left;
  }
  .account-dropdown>a:hover,.account-dropdown button:hover {
    background: var(--bg);
  }
  .account-email {
    display: block;
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
    overflow-wrap: anywhere;
  }
  .mobile-brand,.bottom-nav {
    display: none;
  }
  .page-content {
    max-width: 1440px;
    margin: auto;
    padding: 34px 38px 50px;
  }
  .page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 22px;
  }
  .page-heading .eyebrow {
    margin-bottom: 10px;
  }
  .page-description {
    font-size: 13px;
    line-height: 1.7;
    margin-top: 10px;
  }
  .date-display {
    font-size: 11px;
    color: #6b665f;
    text-align: right;
    white-space: nowrap;
  }
  .section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 28px 0 16px;
  }
  .section-heading h2 {
    font-size: 17px;
  }
  .section-heading>span {
    color: #6b665f;
    font-size: 10px;
  }
  .dashboard-lower {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 22px;
    margin-top: 28px;
  }
  .detail-grid {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    gap: 24px;
    align-items: start;
  }
  .management-grid {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    gap: 24px;
    align-items: start;
  }
  .panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 0;
  }
  .panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 20px 24px;
    border-bottom: 1px solid #f5f2ed;
    min-height: 69px;
  }
  .panel-heading h2 {
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .panel-heading h2>.icon {
    width: 19px;
    height: 19px;
    color: #6b665f;
  }
  .panel-body {
    padding: 24px;
  }
  .panel-heading .text-link {
    font-size: 10px;
  }
  .form-panel {
    padding: 30px;
    max-width: 620px;
  }
  .panel>form {
    border-radius: var(--radius);
  }
  .anchored {
    scroll-margin-top: 20px;
  }
  .table-scroll {
    overflow-x: auto;
  }
  .pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 25px 0;
    font-size: 12px;
    color: var(--muted);
  }
  .public-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 1600px;
    margin: auto;
  }
  .public-header {
    padding: 35px 6%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
  }
  .public-header>span {
    font-size: 12px;
    color: var(--muted);
  }
  .public-footer {
    padding: 28px 6%;
    display: flex;
    justify-content: space-between;
    gap: 25px;
    align-items: center;
    color: #6b665f;
    font-size: 11px;
    margin-top: auto;
  }
  .public-footer>div {
    display: flex;
    gap: 25px;
  }
}
@layer components {
  .button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 17px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 12px;
    line-height: 1.4;
    border: 1px solid transparent;
    transition: background .15s,transform .15s;
    white-space: normal;
    text-align: center;
  }
  .button:hover:not(:disabled) {
    transform: translateY(-1px);
  }
  .button-primary {
    background: var(--brand);
    color: var(--ink);
    box-shadow: none;
  }
  .button-primary:hover:not(:disabled) {
    background: var(--brand-hover);
    color: var(--ink);
  }
  .button-secondary {
    background: #fff;
    border-color: var(--line);
    color: var(--ink);
  }
  .button-secondary:hover:not(:disabled) {
    background: #f5f2ed;
  }
  .button-white {
    background: #fdfbf8;
    color: var(--strong-ink);
  }
  .button-white:hover {
    background: #f5f2ed;
    color: var(--strong-ink);
  }
  .button-quiet {
    background: #f5f2ed;
    color: #6b665f;
    padding: 8px 12px;
    min-height: 42px;
  }
  .button .icon {
    width: 18px;
    height: 18px;
  }
  .pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 5px;
    background: #f5f2ed;
    color: #6b665f;
    font-size: 10px;
    padding: 5px 8px;
    white-space: nowrap;
    font-weight: 500;
    line-height: 1.4;
  }
  .count-badge {
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: 11px;
    font-weight: 650;
    margin-left: 5px;
  }
  .status {
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 5px;
    padding: 4px 7px;
    line-height: 1.4;
    white-space: nowrap;
  }
  .status:before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
  }
  .status.available {
    background: #edf4e7;
    color: #42622f;
  }
  .status.loaned {
    background: #fff2df;
    color: #805516;
  }
  .status.retired {
    background: #f0f0ed;
    color: #63655d;
  }
  .status.large {
    padding: 8px 12px;
    font-size: 12px;
  }
  .message-stack {
    margin-bottom: 20px;
    display: grid;
    gap: 10px;
  }
  .notice {
    border: 1px solid #d9e7d6;
    background: #f0f6ed;
    color: #46633c;
    border-radius: 11px;
    padding: 15px 17px;
    display: flex;
    gap: 11px;
    align-items: flex-start;
    font-size: 13px;
    overflow-wrap: anywhere;
  }
  .notice p {
    color: inherit;
  }
  .notice ul {
    padding-left: 20px;
  }
  .notice>svg {
    width: 19px;
    height: 19px;
    margin-top: 1px;
  }
  .notice-error {
    background: #fcf0ed;
    border-color: #efd4ce;
    color: #963f31;
  }
  .notice-warning {
    background: #fff8e8;
    border-color: #ecdfb9;
    color: #897033;
  }
  .notice-success {
    background: #ecf5e8;
    border-color: #d6e6cc;
    color: #4c7339;
  }
  .toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--strong-ink);
    color: white;
    z-index: 99;
    padding: 14px 22px;
    border-radius: 11px;
    box-shadow: 0 8px 35px #0002;
    max-width: 90vw;
    font-size: 13px;
    text-align: center;
  }
  .empty-state {
    padding: 45px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .empty-state h2 {
    font-size: 21px;
  }
  .empty-state h3 {
    font-size: 14px;
  }
  .empty-state p {
    font-size: 12px;
    max-width: 350px;
    line-height: 1.8;
  }
  .empty-state .button {
    margin-top: 10px;
  }
  .empty-state.compact {
    padding: 28px 22px;
    gap: 9px;
  }
  .empty-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: var(--accent-soft);
    color: var(--accent-ink);
    margin-bottom: 5px;
  }
  .empty-icon>.icon {
    width: 25px;
    height: 25px;
  }
  .empty-state.compact .empty-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }
  .empty-state.compact .empty-icon>.icon {
    width: 21px;
    height: 21px;
  }
  .form-stack {
    display: flex;
    flex-direction: column;
    gap: 19px;
  }
  .form-grid {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    gap: 16px;
  }
  .form-field {
    min-width: 0;
  }
  .field-help {
    font-size: 11px;
    line-height: 1.65;
    color: #6b665f;
    margin-top: 7px;
  }
  .field-help ul {
    padding-left: 18px;
  }
  .field-error,.errorlist {
    font-size: 12px;
    line-height: 1.6;
    color: var(--danger);
    margin-top: 7px;
  }
  .has-error input {
    border-color: #c9877f;
  }
  .form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
    flex-wrap: wrap;
  }
  .search-input {
    position: relative;
    min-width: 0;
  }
  .search-input>.icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b665f;
    width: 18px;
    height: 18px;
  }
  .search-input input {
    padding-left: 43px;
  }
  .filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 25px;
  }
  .filter-bar>.search-input {
    flex: 1;
  }
  .filter-bar>select {
    width: 170px;
  }
  .input-button-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
  }
  .input-button-group>input {
    flex: 1;
    min-width: 0;
  }
  .input-button-group>.button {
    flex-shrink: 0;
  }
  .code-small,.book-id {
    font-family: ui-monospace,"Cascadia Code",Consolas,monospace;
  }
  .book-id {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -.02em;
    color: var(--accent-ink);
  }
  .privacy-note {
    font-size: 11px;
    color: #6b665f;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 7px;
    margin-top: 24px;
    text-align: center;
  }
  .privacy-note .icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 2px;
  }
  .subtle-card {
    display: flex;
    gap: 15px;
    background: #f5f2ed;
    border: 1px solid #e8e3dc;
    border-radius: 12px;
    padding: 21px;
  }
  .subtle-card>.icon {
    color: #6b665f;
    width: 22px;
    height: 22px;
    margin-top: 2px;
  }
  .subtle-card h3 {
    font-size: 12px;
    letter-spacing: 0;
    color: #6b665f;
  }
  .subtle-card p {
    font-size: 11px;
    line-height: 1.8;
    margin-top: 7px;
    color: #6b665f;
  }
  .breadcrumb {
    display: inline-block;
    font-size: 11px;
    color: #6b665f;
    margin: 0 0 22px;
  }
  .description-list>div {
    padding: 13px 0;
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 20px;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
  }
  .description-list>div:first-child {
    padding-top: 0;
  }
  .description-list dt {
    color: var(--muted);
  }
  .description-list dd {
    text-align: right;
    overflow-wrap: anywhere;
  }
  .description-list dd.book-id {
    font-size: 12px;
  }
  .class-badge {
    background: #f5f2ed;
    border: 1px solid #e8e3dc;
    color: #6b665f;
    font-size: 11px;
    padding: 5px 9px;
    border-radius: 5px;
    display: inline-block;
    white-space: nowrap;
  }
  .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    line-height: 1.3;
    cursor: pointer;
    font-size: 11px;
    color: #8a7467;
    font-weight: 400;
    min-height: 44px;
  }
  .error-page {
    max-width: 720px;
    margin: 30px auto;
  }
  .error-page h1 {
    font-size: 30px;
  }
  .error-page p {
    max-width: 480px;
  }
  .prose {
    max-width: 850px;
    padding: 35px;
    font-size: 14px;
    line-height: 1.8;
  }
  .prose h1 {
    font-size: 27px;
  }
  .prose h2 {
    margin: 28px 0 12px;
    font-size: 21px;
  }
  .prose h3 {
    margin: 22px 0 10px;
  }
  .prose p {
    margin: 0 0 15px;
    color: var(--muted);
  }
  .prose a {
    color: var(--accent-ink);
    text-decoration: underline;
    overflow-wrap: anywhere;
  }
  .prose ul,.prose ol {
    margin: 12px 0;
    padding-left: 25px;
    color: var(--muted);
  }
}
@layer pages {
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 16px;
    margin-top: 24px;
  }
  .stat-card {
    border: 1px solid var(--line);
    background: white;
    border-radius: 13px;
    padding: 18px 19px;
    box-shadow: var(--shadow);
    transition: border-color .2s;
  }
  .stat-card:hover {
    border-color: #e8e3dc;
  }
  .stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #6b665f;
    font-size: 12px;
  }
  .stat-icon {
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    border-radius: 9px;
    flex-shrink: 0;
  }
  .stat-icon .icon {
    width: 16px;
    height: 16px;
  }
  .stat-card>strong {
    display: block;
    font-weight: 600;
    letter-spacing: -.045em;
    font-size: 31px;
    line-height: 1.3;
    margin: 7px 0 0;
  }
  .quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .quick-card {
    padding: 20px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 13px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
    transition: background .2s;
    min-height: 94px;
  }
  .quick-card:hover {
    background: #fff8ef;
    border-color: #e6ba83;
  }
  .quick-card:first-child {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--ink);
  }
  .quick-card:first-child:hover {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
  }
  .quick-card:first-child p,
  .quick-card:first-child>.icon {
    color: var(--ink);
  }
  .quick-card:first-child .quick-icon {
    background: #ffffff40;
    color: var(--ink);
  }
  .quick-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: var(--accent-soft);
    color: var(--accent-ink);
  }
  .quick-icon>.icon {
    width: 22px;
    height: 22px;
  }
  .quick-card>div {
    flex: 1;
  }
  .quick-card h2 {
    font-size: 18px;
  }
  .quick-card p {
    font-size: 12px;
    margin-top: 6px;
    color: #6b665f;
  }
  .quick-card>.icon {
    width: 16px;
    height: 16px;
    color: var(--accent-ink);
  }
  .activity-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 17px 23px;
    border-bottom: 1px solid #f5f2ed;
  }
  .activity-row:last-child {
    border-bottom: 0;
  }
  .mini-cover {
    width: 29px;
    height: 39px;
    background: #fff0df;
    border: 1px solid #e8e3dc;
    box-shadow: inset 3px 0 #ffca8f;
    border-radius: 2px 4px 4px 2px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 8px;
    color: #793900;
    font-weight: 600;
    border-color: #efd5b6;
  }
  .activity-row:nth-child(2n) .mini-cover {
    background: #e8e3dc;
    border-color: #e8e3dc;
    box-shadow: inset 3px 0 #e7d7b9;
    color: #a08d66;
  }
  .activity-row:nth-child(3n) .mini-cover {
    background: #e5eced;
    border-color: #d9e3e4;
    box-shadow: inset 3px 0 #cedcdd;
    color: #799496;
  }
  .activity-main {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 0;
  }
  .activity-main strong {
    font-size: 11px;
    font-weight: 550;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .activity-main span {
    font-size: 9px;
    color: #6b665f;
  }
  .activity-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: right;
  }
  .activity-meta .code-small {
    font-size: 8px;
    color: #6b665f;
  }
  .activity-meta time {
    font-size: 8px;
    color: #6b665f;
  }
  .condition-item {
    display: block;
    padding: 18px 23px;
    border-bottom: 1px solid #f5f2ed;
  }
  .condition-item:last-child {
    border-bottom: 0;
  }
  .condition-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }
  .condition-title strong {
    font-size: 10px;
    font-family: ui-monospace,Consolas,monospace;
    font-weight: 500;
  }
  .condition-title time {
    font-size: 9px;
  }
  .condition-item p {
    font-size: 10px;
    color: #6b665f;
    margin-top: 7px;
    line-height: 1.7;
  }
  .workflow-steps {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 28px;
    max-width: 660px;
  }
  .workflow-step {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #6b665f;
    font-size: 11px;
    white-space: nowrap;
  }
  .workflow-step b {
    display: grid;
    place-items: center;
    background: #f5f2ed;
    color: #6b665f;
    font-size: 10px;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    font-weight: 600;
  }
  .workflow-step.active {
    color: var(--accent-ink);
    font-weight: 600;
  }
  .workflow-step.active b {
    background: var(--brand);
    color: var(--ink);
  }
  .workflow-step.complete b {
    background: #dcebd2;
    color: #537a43;
  }
  .step-line {
    flex: 1;
    height: 1px;
    background: #e8e3dc;
  }
  .workflow-grid {
    display: grid;
    grid-template-columns: minmax(0,1.1fr) minmax(0,1fr);
    gap: 24px;
    align-items: start;
  }
  .workflow-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .workflow-side .privacy-note {
    margin-top: 0;
    padding: 0 15px;
  }
  .scanner-stage {
    padding: 24px;
    text-align: center;
    position: relative;
    min-height: 315px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 30%,#fff0df,transparent 65%);
  }
  .camera-placeholder h3 {
    font-size: 15px;
    margin: 19px 0 7px;
  }
  .camera-placeholder p {
    font-size: 11px;
    max-width: 240px;
    margin: 0 auto;
    color: #6b665f;
  }
  .scan-frame {
    height: 79px;
    width: 94px;
    display: grid;
    place-items: center;
    position: relative;
    margin: auto;
    color: var(--accent-ink);
  }
  .scan-frame:before,.scan-frame:after {
    content: "";
    position: absolute;
    width: 24px;
    height: 24px;
    left: 0;
    top: 0;
    border-top: 2px solid var(--brand);
    border-left: 2px solid var(--brand);
    border-radius: 7px 0 0;
  }
  .scan-frame:after {
    left: auto;
    right: 0;
    top: auto;
    bottom: 0;
    transform: rotate(180deg);
  }
  .scan-frame .icon {
    width: 42px;
    height: 42px;
    stroke-width: 1.1;
  }
  .scanner-stage>.button {
    margin-top: 18px;
    font-size: 11px;
    min-width: 180px;
  }
  .scanner-stage .field-help {
    font-size: 10px;
  }
  .qr-reader {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    border: 0 !important;
    border-radius: 11px;
    overflow: hidden;
    background: transparent;
  }
  .qr-reader video {
    object-fit: cover;
    max-height: 360px;
  }
  .scan-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    color: #6b665f;
    font-size: 10px;
  }
  .scan-divider:before,.scan-divider:after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--line);
  }
  .manual-form {
    padding: 21px 24px 24px;
    position: relative;
  }
  .manual-form>label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    margin-bottom: 9px;
  }
  .manual-form .input-button-group .button {
    font-size: 10px;
    padding: 10px 12px;
  }
  .manual-form input {
    font-size: 12px;
    min-height: 46px;
  }
  .suggestions {
    position: absolute;
    left: 24px;
    right: 24px;
    top: 99px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
    z-index: 15;
    box-shadow: 0 8px 24px #0001;
    max-height: 240px;
    overflow: auto;
    padding: 5px;
  }
  .suggestion {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    background: white;
    border-radius: 6px;
    padding: 12px;
    width: 100%;
    min-height: 51px;
    text-align: left;
  }
  .suggestion:hover,.suggestion:focus {
    background: #f5f2ed;
  }
  .suggestion strong {
    font-size: 12px;
    font-family: ui-monospace,Consolas,monospace;
  }
  .suggestion span {
    font-size: 11px;
    color: var(--muted);
  }
  .scan-feedback {
    margin: 0 24px 22px;
    font-size: 12px;
  }
  .basket-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 17px 22px;
    border-bottom: 1px solid #f5f2ed;
  }
  .basket-row>.mini-cover {
    width: 34px;
    height: 44px;
    font-size: 10px;
  }
  .basket-copy {
    flex: 1;
    min-width: 0;
  }
  .basket-copy strong {
    font-size: 12px;
    display: block;
    overflow-wrap: anywhere;
  }
  .basket-copy span {
    font-family: ui-monospace,Consolas,monospace;
    font-size: 10px;
    color: #6b665f;
    display: block;
    margin-top: 5px;
  }
  .icon-button {
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 8px;
    color: #6b665f;
    display: grid;
    place-items: center;
    flex-shrink: 0;
  }
  .icon-button:hover {
    background: #f5f2ed;
    color: #ad765b;
  }
  .icon-button>.icon {
    width: 16px;
    height: 16px;
  }
  .basket-bottom {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 13px;
  }
  .basket-bottom>span {
    font-size: 11px;
    color: #6b665f;
    text-align: center;
  }
  .student-picker .panel-body>.field-help {
    margin: 0 0 18px;
  }
  .student-picker .form-field {
    margin-bottom: 15px;
  }
  .student-results {
    max-height: 330px;
    overflow-y: auto;
    margin: 12px 0 16px;
    display: grid;
    gap: 5px;
  }
  .student-choice {
    padding: 11px 12px;
    border: 1px solid #e8e3dc;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    min-height: 55px;
  }
  .student-choice:hover {
    background: #f5f2ed;
  }
  .student-choice[aria-pressed=true] {
    border-color: var(--accent-ink);
    background: var(--accent-soft);
  }
  .student-choice strong {
    font-size: 12px;
    flex: 1;
  }
  .student-choice>span {
    font-size: 10px;
    color: #6b665f;
    background: #f5f2ed;
    padding: 4px 7px;
    border-radius: 4px;
  }
  .selected-student {
    border-radius: 10px;
    padding: 13px;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: 12px;
    margin: 0 0 15px;
  }
  .workflow-success {
    padding: 32px 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .success-emblem {
    width: 59px;
    height: 59px;
    border-radius: 50%;
    background: #e6f1dc;
    color: #638548;
    display: grid;
    place-items: center;
    margin-bottom: 6px;
  }
  .success-emblem .icon {
    width: 28px;
    height: 28px;
    stroke-width: 2;
  }
  .workflow-success h2 {
    font-size: 24px;
  }
  .workflow-success p {
    font-size: 12px;
    line-height: 1.8;
  }
  .workflow-success .eyebrow {
    font-size: 9px;
    color: #6b665f;
  }
  .workflow-success .button {
    margin-top: 7px;
  }
  .return-title {
    font-size: 23px;
    margin: 9px 0 23px;
  }
  .detail-strip {
    display: flex;
    flex-direction: column;
    gap: 7px;
    background: #f5f2ed;
    padding: 16px;
    border-radius: 9px;
    margin-bottom: 18px;
  }
  .detail-strip>span {
    color: #6b665f;
    font-size: 10px;
  }
  .detail-strip>strong {
    font-size: 13px;
  }
  .condition-box {
    padding: 16px;
    border: 1px solid #e8e3dc;
    border-radius: 9px;
    margin-bottom: 24px;
  }
  .condition-box .eyebrow {
    font-size: 9px;
  }
  .condition-box p {
    font-size: 12px;
    line-height: 1.8;
    margin-top: 7px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  #return-actions {
    display: grid;
    gap: 10px;
  }
  .book-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 22px;
  }
  .book-card {
    overflow: hidden;
  }
  .book-card-cover {
    min-height: 155px;
    margin: 18px 18px 0;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 5px 10px 10px 5px;
    border-left: 7px solid #6b665f;
    background: #fff0df;
    color: #793900;
    gap: 12px;
    box-shadow: 0 4px 8px #6b665f08;
    border-left-color: #ff8000;
  }
  .book-card-cover:after {
    content: "";
    position: absolute;
    width: 75px;
    height: 75px;
    border: 1px solid #6b665f22;
    border-radius: 50%;
    right: 10px;
    bottom: 18px;
    border-color: #79390022;
  }
  .book-card-cover.cover-sand {
    background: #f3efe8;
    border-left-color: #a88d70;
    color: #625241;
  }
  .cover-subject {
    font-size: 9px;
    letter-spacing: .12em;
    text-transform: uppercase;
  }
  .cover-title {
    font-family: Georgia,serif;
    font-size: 22px;
    line-height: 1.2;
    flex: 1;
    position: relative;
    z-index: 1;
    overflow-wrap: anywhere;
  }
  .cover-year {
    font-size: 9px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: .1em;
  }
  .cover-year>.icon {
    width: 18px;
    height: 18px;
    stroke-width: 1.1;
  }
  .book-card-body {
    padding: 20px;
  }
  .book-card-eyebrow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: #6b665f;
    margin-bottom: 11px;
  }
  .book-card h2 {
    font-size: 15px;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }
  .isbn {
    font-size: 10px;
    margin: 5px 0 16px;
    color: #6b665f;
  }
  .book-card-count {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #6b665f;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
  }
  .copies-disclosure {
    margin-top: 3px;
  }
  .book-card-cover:hover .cover-title,.book-card h2>a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  .book-card-count>.text-link {
    justify-content: space-between;
    width: 100%;
    min-height: 32px;
  }
  .book-status-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 14px;
  }
  .book-status-link {
    display: flex;
    flex: 1 1 112px;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px;
    border: 1px solid #dce5d7;
    border-radius: 8px;
    background: #f1f6ec;
    color: #405e35;
    font-size: 12px;
    font-weight: 500;
  }
  .book-status-link.loaned {
    border-color: #f0d9bf;
    background: var(--accent-soft);
    color: var(--accent-ink);
  }
  .book-status-link:hover {
    box-shadow: inset 0 0 0 1px currentColor;
  }
  .book-status-link strong {
    font-size: 14px;
  }
  .copies-disclosure>summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 0;
    font-size: 11px;
    color: #6b665f;
    min-height: 44px;
  }
  .copies-disclosure[open]>summary>.icon {
    transform: rotate(90deg);
  }
  .copy-list {
    max-height: 320px;
    overflow: auto;
  }
  .copy-list>a {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-top: 1px solid #f5f2ed;
    min-height: 46px;
  }
  .copy-list .code-small {
    font-size: 10px;
    flex: 1;
  }
  .copy-list>a>.icon {
    width: 12px;
    height: 12px;
    color: #6b665f;
  }
  .copy-list .status {
    font-size: 8px;
  }
  .book-print {
    border-top: 1px solid var(--line);
    display: flex;
    font-size: 10px;
    padding-top: 13px;
    margin-top: 2px;
  }
  .borrower-box {
    margin-top: 22px;
    border-radius: 12px;
    background: #f5f2ed;
    padding: 20px;
  }
  .borrower-box h3 {
    font-size: 20px;
    margin: 10px 0;
  }
  .borrower-box p {
    font-size: 12px;
    margin-bottom: 20px;
    color: #6b665f;
  }
  .detail-admin {
    border-top: 1px solid var(--line);
    margin-top: 23px;
    padding-top: 23px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .detail-admin>form {
    text-align: center;
  }
  .condition-add {
    padding-bottom: 25px;
    border-bottom: 1px solid var(--line);
  }
  .condition-add>.button {
    align-self: flex-start;
  }
  .timeline {
    list-style: none;
    padding: 28px 0 0 15px;
  }
  .timeline li {
    position: relative;
    padding: 0 0 28px 25px;
    border-left: 1px solid #e8e3dc;
  }
  .timeline li:last-child {
    padding-bottom: 0;
  }
  .timeline-dot {
    position: absolute;
    width: 9px;
    height: 9px;
    background: #e8e3dc;
    border-radius: 50%;
    left: -5px;
    top: 5px;
    border: 2px solid white;
    box-shadow: 0 0 0 1px #e8e3dc;
  }
  .timeline time {
    font-size: 10px;
    color: #6b665f;
  }
  .timeline p {
    font-size: 12px;
    margin: 7px 0;
    color: #6b665f;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  .timeline .field-help {
    font-size: 9px;
  }
  .directory-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 17px 24px;
    border-bottom: 1px solid #f5f2ed;
  }
  .directory-row:last-child {
    border-bottom: 0;
  }
  .student-avatar {
    background: #f5f2ed;
    color: #6b665f;
    width: 39px;
    height: 39px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 11px;
    flex-shrink: 0;
  }
  .directory-name {
    flex: 1;
    min-width: 150px;
  }
  .directory-name h3 {
    font-size: 13px;
    letter-spacing: 0;
  }
  .directory-name>span {
    font-size: 10px;
    color: #6b665f;
    display: block;
    margin-top: 5px;
  }
  .student-edit {
    display: contents;
  }
  .student-edit>summary {
    font-size: 11px;
  }
  .student-edit-form {
    flex-basis: 100%;
    padding: 20px;
    border-radius: 11px;
    background: #f5f2ed;
    display: none;
  }
  .student-edit[open]>.student-edit-form {
    display: block;
  }
  .student-edit-form>.form-stack {
    max-width: 600px;
  }
  .student-edit-form>form:last-child {
    border-top: 1px solid var(--line);
    margin-top: 17px;
    padding-top: 7px;
  }
  .section-tabs {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 13px;
  }
  .section-tabs>a {
    padding: 9px 15px;
    border-radius: 7px;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: 11px;
    min-height: 38px;
    display: flex;
    align-items: center;
  }
  .section-tabs>a:hover {
    background: #ffe3c1;
  }
  .section-tabs>a[aria-current="page"] {
    background: var(--brand);
    color: #24170a;
    font-weight: 700;
  }
  .id-preview {
    display: flex;
    gap: 12px;
    padding: 15px;
    border: 1px dashed #e8e3dc;
    background: #f5f2ed;
    border-radius: 10px;
  }
  .id-preview>.icon {
    color: #6b665f;
  }
  .id-preview span {
    display: block;
    color: #6b665f;
    font-size: 10px;
  }
  .id-preview strong {
    font-size: 12px;
    display: block;
    margin-top: 5px;
    font-family: ui-monospace,Consolas,monospace;
    overflow-wrap: anywhere;
  }
  .id-preview p {
    font-size: 9px;
    color: #6b665f;
    margin-top: 5px;
  }
  .team-panel,.rollover-panel {
    margin-top: 26px;
  }
  .invitation-form {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #f5f2ed;
    border: 1px solid #e8e3dc;
    border-radius: 12px;
    padding: 20px;
  }
  .invitation-form>.form-field {
    flex: 1;
  }
  .invitation-form>.button {
    margin-top: 8px;
    flex-shrink: 0;
  }
  .team-list {
    margin-top: 24px;
  }
  .team-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f5f2ed;
    padding: 15px 0;
  }
  .team-row:last-child {
    border-bottom: 0;
  }
  .teacher-permissions {
    flex: 0 0 100%;
    min-width: 0;
  }
  .teacher-permissions > summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
  }
  .teacher-permissions > summary::before { content: '+'; }
  .teacher-permissions[open] > summary::before { content: '−'; }
  .permission-status {
    margin-left: auto;
    font-size: 11px;
    font-weight: 400;
    color: var(--muted);
  }
  .permission-form { padding-top: 12px; }
  .permission-form fieldset { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
  .permission-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    min-height: 48px;
    cursor: pointer;
  }
  .permission-option input[type=checkbox] {
    width: 22px;
    height: 22px;
    min-height: 22px;
    margin: 1px 0 0;
    flex-shrink: 0;
    accent-color: #ff8000;
  }
  .permission-option strong { display: block; font-size: 13px; }
  .permission-option small { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.5; }
  .book-create-page { max-width: 680px; }
  .team-person {
    flex: 1;
    min-width: 0;
  }
  .team-person strong {
    font-size: 12px;
    font-weight: 550;
    overflow-wrap: anywhere;
  }
  .team-person>span {
    display: block;
    font-size: 10px;
    color: #6b665f;
    margin-top: 4px;
  }
  .team-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .team-actions .button {
    font-size: 10px;
  }
  .action-menu {
    position: relative;
  }
  .action-menu>div {
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    background: white;
    border: 1px solid var(--line);
    box-shadow: 0 8px 25px #0001;
    border-radius: 9px;
    padding: 5px;
    min-width: 195px;
    z-index: 15;
  }
  .action-menu button {
    background: none;
    padding: 13px 10px;
    font-size: 11px;
    display: block;
    width: 100%;
    text-align: left;
    border-radius: 5px;
  }
  .action-menu button:hover {
    background: #f5f2ed;
  }
  .invitations-history {
    margin-top: 25px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
  }
  .invitations-history>summary {
    font-size: 12px;
    padding: 12px 0;
    color: #6b665f;
  }
  .invitations-history>summary:before {
    content: "+ ";
    margin-right: 4px;
  }
  .invitations-history[open]>summary:before {
    content: "\21b3 ";
  }
  .share-link {
    margin-bottom: 24px;
  }
  .share-link>div {
    flex: 1;
    min-width: 0;
  }
  .share-link p {
    font-size: 11px;
    margin: 6px 0 12px;
  }
  .share-link input {
    font-size: 12px;
  }
  .section-intro {
    font-size: 12px;
    margin-bottom: 21px;
    line-height: 1.8;
  }
  .rollover-toolbar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
  }
  .rollover-toolbar .button {
    font-size: 11px;
  }
  .rollover-toolbar .field-help {
    margin: 0;
  }
  .rollover-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 24px;
  }
  .rollover-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  .rollover-row>.class-badge {
    min-width: 45px;
    text-align: center;
  }
  .rollover-row>.icon {
    width: 15px;
    height: 15px;
  }
  .rollover-row>.form-field {
    width: 90px;
  }
  .rollover-row .promotion-input {
    font-size: 12px;
    min-height: 43px;
    padding: 10px;
  }
  .rollover-row .checkbox-label {
    margin-left: auto;
    max-width: 130px;
    font-size: 10px;
  }
  .rollover-preview {
    padding: 18px;
    background: #f5f2ed;
    border-radius: 9px;
    font-size: 12px;
    color: #6b665f;
    margin: 20px 0;
  }
  .rollover-preview ul {
    padding-left: 18px;
  }
  .rollover-panel .notice {
    font-size: 11px;
    margin-bottom: 22px;
  }
  .import-preview {
    border: 1px solid var(--line);
    border-radius: 9px;
    overflow: auto;
    max-height: 260px;
  }
  .import-preview>p {
    padding: 13px;
    font-size: 12px;
  }
  .import-preview td,.import-preview th {
    font-size: 11px;
    padding: 8px 13px;
  }
  .label-preview-area {
    background: #f5f2ed;
    padding: 35px 24px;
    text-align: center;
  }
  .label-print-preview {
    background: white;
    border: 1px solid #e8e3dc;
    aspect-ratio: 105/48;
    width: 100%;
    max-width: 520px;
    margin: auto;
    display: grid;
    place-items: center;
    box-shadow: 0 4px 15px #6b665f08;
  }
  .label-print-preview img { display: block; width: 100%; height: auto; }
  .label-print-preview img[hidden], .label-print-preview p[hidden] { display: none; }
  .label-print-preview p { padding: 20px; color: var(--muted); font-size: 12px; }
  .label-size {
    display: block;
    margin-top: 17px;
    font-size: 10px;
    color: #6b665f;
  }
  .label-specs {
    padding: 22px;
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 12px;
    text-align: center;
  }
  .label-specs>div {
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-right: 1px solid var(--line);
  }
  .label-specs>div:last-child {
    border: 0;
  }
  .label-specs strong {
    font-size: 20px;
    font-weight: 550;
  }
  .label-specs span {
    font-size: 9px;
    color: #6b665f;
  }
  .print-tip {
    margin-top: 23px;
  }
  .print-tip p {
    font-size: 11px;
  }
  .auth-card {
    border: 1px solid #e8e3dc;
    border-radius: 16px;
    background: white;
    box-shadow: var(--shadow);
    padding: 38px;
    max-width: 470px;
    width: 100%;
    border-color: var(--line);
  }
  .auth-card-icon {
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent-ink);
    border-radius: 12px;
    width: 48px;
    height: 48px;
    margin-bottom: 25px;
  }
  .auth-card-icon>.icon {
    width: 26px;
    height: 26px;
    stroke-width: 1.4;
  }
  .auth-card>.eyebrow {
    font-size: 9px;
    margin-bottom: 10px;
  }
  .auth-card h2,.auth-card h1 {
    font-size: 27px;
    margin-bottom: 10px;
  }
  .auth-card>p:not(.eyebrow) {
    font-size: 12px;
    line-height: 1.8;
    color: #6b665f;
  }
  .auth-card>.form-stack {
    margin-top: 28px;
    gap: 20px;
  }
  .auth-card label {
    font-size: 12px;
  }
  .auth-card input {
    font-size: 13px;
  }
  .auth-footnote {
    border-top: 1px solid var(--line);
    margin-top: 27px;
    padding-top: 20px;
    font-size: 10px;
  }
  .auth-footnote strong {
    font-weight: 500;
    color: #6b665f;
  }
  .auth-footnote p {
    font-size: 10px;
    line-height: 1.9;
    color: #6b665f;
    margin-top: 5px;
  }
  .centered-page {
    padding: 35px 20px 60px;
    margin: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .join-card {
    max-width: 500px;
  }
  .auth-back {
    display: block;
    color: #6b665f;
    font-size: 11px;
    margin-top: 25px;
    text-align: center;
  }
  .join-card .field-help {
    font-size: 11px;
  }
  .join-card .field-help .text-link {
    font-size: 11px;
  }
}
@layer responsive {
  @media (min-width:1600px) {
    .page-content {
      padding-top: 42px;
    }
  }
  @media (max-width:1200px) {
    .sidebar {
      width: 210px;
      padding: 30px 13px 18px;
    }
    .sidebar .brand {
      font-size: 29px;
      margin-left: 13px;
    }
    .main-nav>a {
      font-size: 13px;
      gap: 10px;
    }
    .app-shell {
      margin-left: 210px;
    }
    .topbar {
      padding: 0 28px;
      height: 68px;
    }
    .page-content {
      padding: 28px;
    }
    .date-display {
      display: none;
    }
    .stats-grid {
      gap: 12px;
    }
    .stat-card {
      padding: 15px;
    }
    .stat-top {
      font-size: 12px;
    }
    .stat-card>strong {
      font-size: 29px;
    }
    .dashboard-lower {
      gap: 17px;
    }
    .quick-grid {
      gap: 17px;
    }
    .quick-card {
      padding: 12px;
      gap: 8px;
      min-height: 82px;
    }
    .quick-card h2 {
      font-size: 18px;
    }
    .panel-heading {
      padding: 18px 20px;
    }
    .panel-body {
      padding: 20px;
    }
    .management-grid {
      gap: 18px;
    }
    .book-grid {
      grid-template-columns: repeat(2,minmax(0,1fr));
    }
    .rollover-grid {
      grid-template-columns: 1fr;
    }
    .rollover-row>.form-field {
      flex: 1;
      max-width: 220px;
    }
    .rollover-row .checkbox-label {
      max-width: none;
    }
    .invitation-form {
      align-items: flex-end;
    }
    .invitation-form>.button {
      font-size: 10px;
      margin-bottom: 24px;
    }
    .workflow-grid {
      gap: 18px;
    }
    .manual-form {
      padding-left: 20px;
      padding-right: 20px;
    }
    .manual-form .input-button-group>.button span {
      display: none;
    }
    .activity-row {
      padding-left: 18px;
      padding-right: 18px;
    }
    .activity-meta .code-small {
      display: none;
    }
    .auth-card {
      padding: 30px;
    }
  }
  @media (max-width:960px) {
    .sidebar {
      width: 190px;
      padding: 28px 9px 16px;
    }
    .sidebar .brand {
      font-size: 27px;
    }
    .main-nav>a {
      font-size: 13px;
      padding: 11px 12px;
      gap: 9px;
    }
    .main-nav>a .icon {
      width: 17px;
      height: 17px;
    }
    .app-shell {
      margin-left: 190px;
    }
    .page-content {
      padding: 24px;
    }
    .topbar {
      padding: 0 24px;
      height: 68px;
    }
    .stats-grid {
      grid-template-columns: 1fr 1fr;
      gap: 12px;
    }
    .stat-card {
      padding: 18px;
    }
    .stat-top {
      font-size: 12px;
    }
    .stat-card>strong {
      font-size: 32px;
    }
    .dashboard-lower {
      grid-template-columns: 1fr;
    }
    .quick-card {
      gap: 14px;
      padding: 20px;
    }
    .quick-card>div h2 {
      font-size: 15px;
    }
    .quick-card>div p {
      display: none;
      font-size: 9px;
    }
    .quick-icon {
      width: 30px;
      height: 34px;
    }
    .quick-card>.icon {
      display: none;
    }
    .workflow-grid {
      grid-template-columns: 1fr;
    }
    .workflow-side {
      gap: 20px;
    }
    .scanner-stage {
      min-height: 260px;
      padding: 21px;
    }
    .camera-placeholder {
      display: flex;
      flex-direction: column;
    }
    .camera-placeholder h3 {
      margin-top: 10px;
    }
    .scan-frame {
      width: 65px;
      height: 57px;
    }
    .scan-frame>.icon {
      width: 32px;
      height: 32px;
    }
    .manual-form .input-button-group>.button span {
      display: inline;
    }
    .detail-grid,.management-grid {
      grid-template-columns: 1fr;
    }
    .book-card-cover {
      min-height: 155px;
    }
    .auth-card {
      padding: 27px;
    }
    .invitation-form>.button {
      font-size: 11px;
    }
    .label-preview-area {
      padding: 35px;
    }
    .rollover-row .checkbox-label {
      max-width: none;
    }
    .sidebar-legal {
      gap: 12px;
      padding-left: 10px;
      font-size: 9px;
    }
    .sidebar-bottom {
      padding-top: 20px;
    }
    .team-panel .panel-body {
      padding: 20px;
    }
    .section-heading {
      margin-top: 24px;
    }
    .prose {
      padding: 25px;
    }
  }
  @media (max-width:720px) {
    :root {
      --radius: 14px;
    }
    .sidebar {
      display: none;
    }
    .app-shell {
      margin-left: 0;
    }
    .topbar {
      height: 68px;
      padding: 0 20px;
      background: #fff;
    }
    .topbar-context {
      display: none;
    }
    .mobile-brand {
      display: inline-flex;
      font-size: 27px;
      gap: 9px;
    }
    .mobile-brand .brand-mark {
      width: 29px;
      height: 33px;
      border-radius: 8px;
    }
    .mobile-brand .brand-mark>.icon {
      width: 20px;
      height: 20px;
    }
    .topbar-actions {
      gap: 10px;
    }
    .role-badge {
      font-size: 8px;
      padding: 4px 6px;
    }
    .avatar {
      width: 31px;
      height: 31px;
      font-size: 11px;
    }
    .account-menu summary {
      gap: 5px;
    }
    .account-menu summary>.icon {
      width: 10px;
    }
    .page-content {
      padding: 27px 20px calc(100px + env(safe-area-inset-bottom));
    }
    .page-heading {
      margin-bottom: 22px;
      align-items: flex-start;
      gap: 14px;
      flex-wrap: wrap;
    }
    .page-heading h1 {
      font-size: 27px;
    }
    .page-heading .eyebrow {
      font-size: 9px;
      margin-bottom: 9px;
    }
    .page-description {
      font-size: 12px;
      margin-top: 10px;
      max-width: 380px;
    }
    .page-heading>.button {
      font-size: 11px;
      min-height: 43px;
    }
    .page-heading>.text-link {
      font-size: 11px;
    }
    .bottom-nav {
      display: flex;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 40;
      justify-content: space-around;
      background: #fff;
      border-top: 1px solid var(--line);
      padding: 7px 8px calc(8px + env(safe-area-inset-bottom));
      box-shadow: 0 -6px 25px #6b665f05;
    }
    .bottom-nav>a {
      display: flex;
      flex-direction: column;
      gap: 5px;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      color: var(--muted);
      min-height: 49px;
      flex: 1;
      border-radius: 9px;
      max-width: 83px;
    }
    .bottom-nav>a .icon {
      width: 20px;
      height: 20px;
      stroke-width: 1.6;
    }
    .bottom-nav>a.active {
      color: var(--accent-ink);
      background: var(--accent-soft);
      font-weight: 600;
    }
    .toast {
      bottom: calc(88px + env(safe-area-inset-bottom));
      width: max-content;
      max-width: calc(100vw - 32px);
      font-size: 12px;
    }
    .stats-grid {
      gap: 12px;
      margin-top: 18px;
    }
    .stat-card {
      padding: 15px 16px;
      border-radius: 12px;
    }
    .stat-top {
      font-size: 12px;
    }
    .stat-icon {
      width: 30px;
      height: 30px;
    }
    .stat-card>strong {
      font-size: 31px;
      margin: 7px 0 0;
    }
    .section-heading {
      margin-top: 26px;
      margin-bottom: 13px;
    }
    .section-heading h2 {
      font-size: 16px;
    }
    .section-heading>span {
      font-size: 9px;
    }
    .quick-grid {
      gap: 12px;
    }
    .quick-card {
      padding: 12px;
      gap: 8px;
      min-height: 82px;
    }
    .quick-card>div h2 {
      font-size: 15px;
    }
    .quick-card>div p {
      display: none;
      font-size: 9px;
      line-height: 1.6;
      margin-top: 5px;
    }
    .quick-icon {
      width: 30px;
      height: 34px;
      border-radius: 9px;
    }
    .quick-icon>.icon {
      width: 18px;
      height: 18px;
    }
    .dashboard-lower {
      margin-top: 24px;
      gap: 20px;
    }
    .panel-heading {
      padding: 17px 20px;
      min-height: 62px;
    }
    .panel-heading h2 {
      font-size: 14px;
    }
    .activity-row {
      padding: 17px 20px;
    }
    .activity-main strong {
      font-size: 12px;
    }
    .activity-main span {
      font-size: 10px;
    }
    .activity-meta time {
      font-size: 9px;
    }
    .activity-meta .code-small {
      display: block;
      font-size: 8px;
    }
    .condition-item {
      padding: 17px 20px;
    }
    .condition-title strong {
      font-size: 11px;
    }
    .condition-item p {
      font-size: 11px;
    }
    .panel-body {
      padding: 20px;
    }
    .button {
      min-height: 48px;
      font-size: 12px;
    }
    .form-panel {
      padding: 22px;
    }
    .form-stack {
      gap: 20px;
    }
    input,select,textarea {
      font-size: 16px;
      padding: 11px 13px;
      min-height: 49px;
    }
    .manual-form input {
      font-size: 16px;
    }
    .manual-form .input-button-group>.button {
      padding: 10px 13px;
    }
    .manual-form .input-button-group>.button span {
      display: none;
    }
    .manual-form label {
      font-size: 13px;
    }
    .manual-form .field-help {
      font-size: 11px;
    }
    .scanner-stage {
      min-height: 270px;
      padding: 24px;
    }
    .scanner-stage>.button {
      font-size: 12px;
      min-height: 47px;
      margin-top: 20px;
    }
    .scanner-stage .field-help {
      font-size: 10px;
    }
    .camera-placeholder h3 {
      font-size: 16px;
      margin: 14px 0 8px;
    }
    .camera-placeholder p {
      font-size: 12px;
    }
    .scan-frame {
      width: 75px;
      height: 62px;
    }
    .scan-frame .icon {
      width: 35px;
      height: 35px;
    }
    .scan-divider {
      font-size: 11px;
    }
    .workflow-steps {
      gap: 9px;
      margin-bottom: 23px;
      justify-content: space-between;
    }
    .workflow-step {
      font-size: 10px;
      gap: 6px;
    }
    .workflow-step b {
      width: 23px;
      height: 23px;
      font-size: 9px;
    }
    .step-line {
      max-width: 30px;
    }
    .workflow-grid {
      gap: 20px;
    }
    .basket-copy strong {
      font-size: 13px;
    }
    .basket-copy span {
      font-size: 11px;
    }
    .basket-row {
      padding: 16px 20px;
    }
    .basket-bottom {
      padding: 20px;
    }
    .basket-bottom>span {
      font-size: 12px;
    }
    .student-choice {
      min-height: 59px;
    }
    .student-choice strong {
      font-size: 13px;
    }
    .student-choice>span {
      font-size: 11px;
    }
    .return-title {
      font-size: 24px;
    }
    .detail-strip>strong {
      font-size: 14px;
    }
    .condition-box p {
      font-size: 13px;
    }
    .subtle-card {
      padding: 20px;
    }
    .subtle-card h3 {
      font-size: 13px;
    }
    .subtle-card p {
      font-size: 12px;
    }
    .filter-bar {
      flex-wrap: wrap;
      gap: 10px;
      margin-bottom: 22px;
    }
    .filter-bar>.search-input {
      flex-basis: calc(100% - 90px);
      flex-grow: 1;
      order: 0;
    }
    .filter-bar>select {
      width: calc(100% - 100px);
      flex: 1;
      order: 1;
    }
    .filter-bar>.button {
      order: 0;
      font-size: 11px;
      min-height: 49px;
      padding: 10px 14px;
    }
    .filter-bar>.text-link {
      order: 2;
      min-height: 44px;
      padding: 8px;
      font-size: 11px;
    }
    .book-grid {
      gap: 15px;
    }
    .book-card-cover {
      margin: 12px 12px 0;
      min-height: 142px;
      padding: 14px 12px;
      border-left-width: 5px;
    }
    .cover-title {
      font-size: 20px;
    }
    .book-card-body {
      padding: 15px;
    }
    .book-card h2 {
      font-size: 13px;
    }
    .book-card-count {
      font-size: 10px;
      align-items: flex-start;
      gap: 8px;
      flex-wrap: wrap;
    }
    .isbn {
      font-size: 9px;
      overflow-wrap: anywhere;
    }
    .book-card-eyebrow {
      font-size: 9px;
    }
    .copies-disclosure>summary {
      font-size: 10px;
    }
    .book-print {
      font-size: 9px;
    }
    .copy-list>a {
      flex-wrap: wrap;
      position: relative;
      padding: 11px 0;
    }
    .copy-list .code-small {
      flex-basis: calc(100% - 20px);
      font-size: 10px;
    }
    .copy-list .status {
      font-size: 8px;
    }
    .copy-list>a>.icon {
      position: absolute;
      right: 0;
      top: 12px;
    }
    .directory-row {
      gap: 10px;
      padding: 16px 18px;
    }
    .directory-name {
      min-width: 110px;
    }
    .directory-name h3 {
      font-size: 12px;
    }
    .directory-name>span {
      font-size: 10px;
    }
    .directory-row>.class-badge {
      display: none;
    }
    .student-avatar {
      width: 33px;
      height: 36px;
      font-size: 10px;
    }
    .student-edit>summary {
      font-size: 10px;
      padding: 8px 11px;
      min-height: 42px;
    }
    .student-edit-form {
      padding: 16px;
      margin-top: 4px;
    }
    .student-edit-form label {
      font-size: 11px;
    }
    .student-edit-form input,.student-edit-form select {
      font-size: 16px;
    }
    .section-tabs {
      gap: 8px;
      padding-bottom: 17px;
      margin-bottom: 23px;
    }
    .section-tabs>a {
      font-size: 10px;
      padding: 8px 11px;
      min-height: 41px;
      flex-grow: 1;
      justify-content: center;
    }
    .management-grid {
      gap: 23px;
    }
    .team-panel,.rollover-panel {
      margin-top: 23px;
    }
    .team-panel .panel-body {
      padding: 17px;
    }
    .invitation-form {
      flex-direction: column;
      align-items: stretch;
      padding: 17px;
      gap: 17px;
    }
    .invitation-form>.button {
      margin: 0;
      align-self: stretch;
      font-size: 12px;
    }
    .team-row {
      gap: 10px;
      flex-wrap: wrap;
      padding: 17px 0;
    }
    .team-person strong {
      font-size: 11px;
    }
    .team-person>span {
      font-size: 10px;
    }
    .team-actions {
      gap: 4px;
    }
    .team-actions .button {
      padding: 8px 10px;
      min-height: 42px;
      font-size: 10px;
    }
    .team-row>.avatar {
      width: 29px;
      height: 29px;
      font-size: 10px;
    }
    .team-list {
      margin-top: 17px;
    }
    .team-row>.status {
      font-size: 8px;
    }
    .rollover-toolbar {
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
    }
    .rollover-toolbar .field-help {
      text-align: center;
    }
    .rollover-row {
      gap: 9px;
    }
    .rollover-row>.class-badge {
      font-size: 10px;
      min-width: 39px;
    }
    .rollover-row>.form-field {
      max-width: 90px;
    }
    .rollover-row .promotion-input {
      font-size: 16px;
    }
    .rollover-row .checkbox-label {
      font-size: 10px;
      max-width: 121px;
      gap: 8px;
      margin-left: auto;
    }
    .rollover-preview {
      font-size: 12px;
    }
    .rollover-panel #apply-rollover {
      width: 100%;
    }
    .share-link input {
      font-size: 12px;
    }
    .share-link .input-button-group {
      flex-wrap: wrap;
    }
    .share-link .input-button-group>input {
      flex-basis: 100%;
    }
    .share-link .input-button-group>.button {
      width: 100%;
      min-height: 43px;
    }
    .label-preview-area {
      padding: 30px 20px;
    }
    .label-specs span {
      font-size: 10px;
    }
    .label-specs strong {
      font-size: 21px;
    }
    .description-list>div {
      font-size: 12px;
    }
    .borrower-box {
      padding: 18px;
    }
    .condition-add textarea {
      font-size: 16px;
    }
    .timeline p {
      font-size: 13px;
    }
    .public-header {
      padding: 28px 22px;
    }
    .public-header .brand {
      font-size: 27px;
    }
    .public-header>span {
      display: none;
    }
    .auth-card {
      padding: 28px 25px;
      border-radius: 16px;
    }
    .auth-card-icon {
      width: 42px;
      height: 42px;
      margin-bottom: 19px;
    }
    .auth-card h2,.auth-card h1 {
      font-size: 26px;
    }
    .auth-card input {
      font-size: 16px;
    }
    .auth-card label {
      font-size: 12px;
    }
    .auth-card>.form-stack {
      margin-top: 25px;
    }
    .auth-card>p:not(.eyebrow) {
      font-size: 12px;
    }
    .auth-footnote {
      font-size: 11px;
    }
    .auth-footnote p {
      font-size: 11px;
    }
    .public-footer {
      padding: 25px 22px;
      flex-direction: column;
      gap: 15px;
      text-align: center;
      font-size: 10px;
    }
    .public-shell .page-content {
      padding-bottom: 35px;
    }
    .public-shell .page-heading {
      gap: 20px;
    }
    .centered-page {
      padding: 15px 20px 35px;
    }
    .public-shell .prose {
      padding: 23px;
    }
    .prose {
      font-size: 13px;
    }
    .prose h2 {
      font-size: 20px;
    }
    .error-page {
      margin-top: 10px;
      padding: 36px 22px;
    }
    .error-page h1 {
      font-size: 26px;
    }
    .notice {
      font-size: 12px;
    }
    .notice-warning {
      font-size: 11px;
    }
  }
  @media (max-width:390px) {
    .page-content {
      padding-left: 16px;
      padding-right: 16px;
    }
    .topbar {
      padding-left: 16px;
      padding-right: 16px;
    }
    .stat-card {
      padding: 13px;
    }
    .stat-top {
      font-size: 12px;
    }
    .quick-card {
      padding: 12px;
      gap: 8px;
      min-height: 82px;
      flex-direction: row;
      align-items: center;
    }
    .quick-card>div h2 {
      font-size: 15px;
    }
    .quick-card>div p {
      display: none;
      font-size: 9px;
    }
    .quick-icon {
      width: 30px;
      height: 34px;
    }
    .activity-meta .code-small {
      display: none;
    }
    .workflow-step {
      font-size: 9px;
      gap: 5px;
    }
    .workflow-steps {
      gap: 7px;
    }
    .step-line {
      max-width: 18px;
    }
    .workflow-step b {
      width: 22px;
      height: 22px;
    }
    .panel-heading {
      padding: 16px 18px;
    }
    .panel-heading h2 {
      font-size: 13px;
    }
    .panel-heading .pill {
      font-size: 8px;
    }
    .book-card-cover {
      margin: 10px 10px 0;
      padding: 12px 10px;
      min-height: 142px;
    }
    .book-card-body {
      padding: 13px;
    }
    .cover-title {
      font-size: 18px;
    }
    .book-grid {
      gap: 12px;
    }
    .copies-disclosure>summary {
      font-size: 9px;
    }
    .book-print {
      font-size: 8px;
    }
    .rollover-row {
      gap: 7px;
    }
    .rollover-row>.form-field {
      max-width: 72px;
    }
    .rollover-row .checkbox-label {
      max-width: 114px;
    }
    .student-avatar {
      display: none;
    }
    .team-person strong {
      font-size: 10px;
    }
    .team-row>.avatar {
      display: none;
    }
  }
  @media (prefers-reduced-motion:reduce) {
    html {
      scroll-behavior: auto;
    }
    *,*:before,*:after {
      transition: none !important;
      animation: none !important;
    }
  }
  @media print {
    .sidebar,.topbar,.bottom-nav,.public-header,.public-footer,.section-tabs,.button,.account-menu,.skip-link {
      display: none !important;
    }
    .app-shell {
      margin: 0;
    }
    .page-content {
      padding: 0;
    }
    .panel {
      box-shadow: none;
      break-inside: avoid;
    }
    .page-heading h1 {
      font-size: 27px;
    }
    body {
      background: white;
    }
  }
}

@layer responsive {
  /* A scan, its result and confirmation share one workspace instead of stacking. */
  .scan-page { max-width: 920px; }
  .scan-page-heading { align-items: center; margin-bottom: 16px; }
  .scan-page-heading h1 { font-size: 29px; }
  .scan-workflow { display: flex; flex-direction: column; gap: 12px; max-width: 660px; }
  .scan-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
  .scan-toolbar p { font-size: 12px; color: var(--muted); }
  .scan-toolbar .button { flex: 0 0 auto; font-size: 12px; min-height: 44px; padding: 10px 14px; }
  .scan-toolbar .button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-ink); }
  .scan-toolbar .button:disabled { opacity: .5; }
  .scan-workflow .scan-feedback { margin: 0; padding: 10px 12px; line-height: 1.4; flex-shrink: 0; }
  .scan-workflow .scan-panel { display: flex; flex-direction: column; }
  .scan-workflow .scanner-stage { min-height: 0; padding: 18px; gap: 12px; }
  .scan-workflow .camera-window { position: relative; width: 100%; max-width: 330px; aspect-ratio: 1.5; overflow: hidden; border-radius: 12px; background: #fff2e3; }
  /* Keep the video and its decoding frame together, including portrait cameras
     that ignore the requested aspect ratio. Neither contributes flex height.
     Decode at twice the displayed resolution so the compact batch view remains readable. */
  .scan-workflow .camera-surface { position: absolute; top: 50%; left: 50%; width: 200%; transform: translate(-50%,-50%) scale(.5); }
  .scan-workflow .camera-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; }
  .scan-workflow .camera-placeholder h3 { font-size: 14px; margin: 12px 0 0; }
  .scan-workflow .scan-frame { width: 62px; height: 52px; margin: 0; }
  .scan-workflow .scan-frame .icon { width: 30px; height: 30px; }
  .scan-workflow .qr-reader { width: 100%; max-width: none; border-radius: 0; margin: 0; }
  .scan-workflow .qr-reader video { display: block; width: 100%; max-height: none; object-fit: contain; }
  .scan-workflow .camera-controls { text-align: center; }
  .scan-workflow .camera-controls .button { min-height: 46px; font-size: 13px; padding: 10px 18px; }
  .scan-workflow .camera-controls .field-help { font-size: 11px; margin: 7px 0 0; max-width: 360px; }
  .scan-workflow .manual-form { padding: 14px 18px 18px; border-top: 1px solid var(--line); }
  .scan-workflow .manual-form>label { margin: 0 0 7px; font-size: 13px; }
  .scan-workflow .manual-form input { font-size: 16px; min-height: 46px; padding: 10px; }
  .scan-workflow .manual-form .button { min-width: 48px; }
  .scan-workflow .suggestions { top: auto; bottom: calc(100% - 34px); left: 18px; right: 18px; max-height: 210px; }
  .scan-workflow .suggestion strong { overflow-wrap: anywhere; }
  .scan-workflow .panel-heading { padding: 12px 16px; min-height: 52px; gap: 8px; }
  .scan-workflow .panel-heading h2 { font-size: 15px; }
  .scan-workflow .panel-heading .text-button { min-height: 36px; font-size: 12px; white-space: nowrap; }
  .scan-workflow .basket-list { overflow: auto; max-height: 200px; overscroll-behavior: contain; }
  .scan-workflow .basket-row { padding: 8px 14px; gap: 8px; }
  .scan-workflow .basket-copy strong { font-size: 12px; }
  .scan-workflow .basket-copy span { margin-top: 3px; font-size: 10px; overflow-wrap: anywhere; }
  .scan-workflow .basket-bottom { padding: 10px 14px; flex-direction: row; align-items: center; border-top: 1px solid var(--line); gap: 10px; }
  .scan-workflow .basket-bottom>span { flex: 0 0 auto; }
  .scan-workflow .basket-bottom .button { flex: 1; min-height: 44px; padding: 10px; font-size: 12px; }
  .scan-workflow .student-picker { display: flex; flex-direction: column; min-height: 0; }
  .picker-book { display: flex; flex-direction: column; gap: 4px; padding: 10px 16px; background: var(--accent-soft); max-height: 80px; overflow: auto; overflow-wrap: anywhere; }
  .picker-book strong { font-size: 13px; }
  .picker-book span { font-size: 10px; color: var(--muted); font-family: ui-monospace,Consolas,monospace; }
  .student-filters { display: grid; grid-template-columns: minmax(90px,.7fr) minmax(0,1fr); gap: 8px; padding: 12px 16px 0; }
  .student-filters select { min-width: 0; padding: 10px; font-size: 14px; }
  .student-filters .search-input input { font-size: 16px; padding-left: 34px; min-height: 44px; }
  .student-filters .search-input .icon { left: 10px; width: 16px; height: 16px; }
  .scan-workflow .student-results { flex: 1 1 auto; min-height: 58px; max-height: 350px; padding: 0 16px; margin: 10px 0; overscroll-behavior: contain; align-content: start; }
  .scan-workflow .student-choice { min-height: 49px; padding: 9px 10px; }
  .scan-workflow .student-choice strong { font-size: 13px; overflow-wrap: anywhere; }
  .scan-confirmation { padding: 12px 16px; border-top: 1px solid var(--line); flex-shrink: 0; }
  .scan-confirmation .button { min-height: 48px; font-size: 13px; padding: 10px 12px; }
  .scan-confirmation .field-help { margin: 7px 0 0; text-align: center; font-size: 10px; }
  .scan-confirmation .selected-student { margin: 0 0 9px; padding: 0; color: var(--ink); background: none; font-weight: 600; font-size: 12px; }
  .scan-confirmation .field-error { margin-top: 8px; font-size: 12px; }
  .scan-workflow .return-panel { display: flex; flex-direction: column; min-height: 0; }
  .return-details { padding: 16px; overflow: auto; overscroll-behavior: contain; min-height: 0; }
  .return-details .book-id { font-size: 11px; overflow-wrap: anywhere; }
  .return-details .return-title { font-size: 21px; margin: 7px 0 14px; overflow-wrap: anywhere; }
  .return-details .detail-strip { padding: 12px; margin: 0 0 12px; gap: 4px; }
  .return-details .condition-box { padding: 12px; margin: 0; }
  .return-details .condition-box p { line-height: 1.5; margin-top: 5px; }
  .scan-workflow[data-condition="true"] .condition-box { display: none; }
  .scan-workflow #return-actions { gap: 8px; }
  .scan-workflow #condition-return-form { gap: 8px; }
  .scan-workflow #condition-return-form .form-field { margin-bottom: 0; }
  .scan-workflow #condition-return-form textarea { min-height: 70px; font-size: 16px; }
  .scan-workflow #condition-return-form label { font-size: 12px; margin-bottom: 6px; }
  .scan-workflow .workflow-success { justify-content: center; min-height: 280px; }
  .scan-workflow .workflow-success p { overflow-wrap: anywhere; }
  .scan-workflow .workflow-success .button { min-height: 48px; font-size: 14px; }
  .scan-workflow h2[tabindex="-1"]:focus,
  .scan-workflow .workflow-success[tabindex="-1"]:focus { outline: none; }
  .scan-page .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  @media (max-width:720px) {
    .scan-page { height: calc(100dvh - 68px - 65px - env(safe-area-inset-bottom)); min-height: 0; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
    .scan-page>.developer-credit { display: none; }
    .scan-page-heading { flex: 0 0 auto; margin: 0; min-height: 35px; gap: 8px; flex-wrap: nowrap; }
    .scan-page-heading h1 { font-size: 24px; }
    .scan-page-heading>.text-link { font-size: 11px; }
    .scan-workflow { flex: 1; min-height: 0; width: 100%; gap: 8px; }
    .scan-toolbar { flex: 0 0 auto; }
    .scan-toolbar p { font-size: 11px; line-height: 1.35; }
    .scan-toolbar .button { font-size: 11px; padding: 10px; }
    .scan-workflow .scan-panel { flex: 1; min-height: 0; }
    .scan-workflow .scanner-stage { flex: 1; min-height: 0; padding: 12px; gap: 10px; }
    .scan-workflow .camera-window { flex: 0 1 auto; max-width: 300px; min-height: 90px; }
    .scan-workflow .manual-form { flex: 0 0 auto; padding: 10px 12px 12px; }
    .scan-workflow .suggestions { left: 12px; right: 12px; max-height: min(210px,35dvh); }
    .scan-workflow .student-picker,.scan-workflow .return-panel { flex: 1; min-height: 0; }
    .scan-workflow .student-results { max-height: none; }
    .scan-workflow .return-details { flex: 1; }
    .scan-workflow .panel-heading { padding: 8px 12px; flex: 0 0 auto; min-height: 48px; }
    .picker-book { flex: 0 0 auto; padding: 8px 12px; max-height: 65px; }
    .student-filters { flex: 0 0 auto; padding: 10px 12px 0; }
    .scan-workflow .student-results { padding: 0 12px; margin: 8px 0; }
    .scan-confirmation { padding: 10px 12px; }
    .return-details { padding: 12px; }
    .scan-workflow .workflow-success { flex: 1; min-height: 0; padding: 22px 18px; }
    .scan-workflow .workflow-success h2 { font-size: 23px; }
    .scan-workflow[data-batch="true"] .scan-panel { flex: 0 0 auto; }
    .scan-workflow[data-batch="true"] .scanner-stage { flex-direction: row; padding: 10px; gap: 10px; }
    .scan-workflow[data-batch="true"] .camera-window { flex: 0 0 120px; max-width: 120px; min-height: 80px; }
    .scan-workflow[data-batch="true"] .camera-placeholder h3 { font-size: 10px; margin-top: 5px; }
    .scan-workflow[data-batch="true"] .scan-frame { width: 39px; height: 32px; }
    .scan-workflow[data-batch="true"] .scan-frame .icon { width: 23px; height: 23px; }
    .scan-workflow[data-batch="true"] .camera-controls { flex: 1; min-width: 0; }
    .scan-workflow[data-batch="true"] .camera-controls .button { min-width: 0; width: 100%; font-size: 11px; padding: 8px; gap: 6px; }
    .scan-workflow[data-batch="true"] .camera-controls .button>.icon { display: none; }
    .scan-workflow[data-batch="true"] .camera-controls .field-help { font-size: 10px; }
    .scan-workflow .basket-panel { display: flex; flex: 1; min-height: 137px; flex-direction: column; }
    .scan-workflow .basket-panel .panel-heading { min-height: 38px; padding: 4px 12px; }
    .scan-workflow .basket-list { flex: 1; min-height: 42px; max-height: none; }
    .scan-workflow .basket-bottom { flex-shrink: 0; padding: 8px 10px; }
    .scan-workflow .basket-bottom>span { font-size: 11px; }
  }
  @media (max-width:360px) {
    .scan-page { padding-right: 10px; padding-left: 10px; }
    .scan-toolbar p { max-width: 130px; }
    .scan-toolbar .button { font-size: 10px; }
    .scan-workflow[data-batch="true"] .camera-window { flex-basis: 105px; max-width: 105px; min-height: 70px; }
    .student-filters { grid-template-columns: 105px minmax(0,1fr); }
    .scan-confirmation .button { font-size: 12px; }
  }
  /* Small landscape screens and the on-screen keyboard may scroll to keep inputs usable. */
  @media (max-width:720px) and (max-height:560px) {
    .scan-page { height: auto; min-height: calc(100dvh - 133px); padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
    .scan-workflow .camera-window { max-width: 180px; }
    .scan-workflow .student-results { max-height: 140px; }
    .scan-workflow .return-details { max-height: 180px; }
    .scan-workflow .basket-list { max-height: 100px; }
  }
}

@layer pages {
  .book-edit-page { max-width: 720px; display: grid; gap: 20px; }
  .book-edit-page .form-stack { margin: 0; }
  .book-edit-page .errorlist { color: var(--danger,#b42318); margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
  .book-edit-page .notice { display: block; }
  .book-edit-page .notice .text-link { display: inline-block; margin-top: 8px; }
  .book-edit-page .panel-heading h2 { overflow-wrap: anywhere; }
  .book-edit-page .checkbox-label { align-items: flex-start; line-height: 1.5; }
  .book-edit-page .checkbox-label input { flex-shrink: 0; margin-top: 2px; }
  .inventory-delete-section { border-color: #efd4cf; }
  .inventory-delete-section h2 { font-size: 17px; }
  .inventory-delete-section p { color: var(--muted); font-size: 13px; margin: 8px 0 16px; line-height: 1.5; }
  .button-danger { background: #b42318; border-color: #b42318; color: white; }
  .button-danger:hover { background: #912018; border-color: #912018; }
  .book-edit-link { margin-top: 16px; min-height: 44px; font-size: 12px; }
  .inventory-toolbar { display: flex; justify-content: flex-end; margin-bottom: 14px; }
}

@layer responsive {
  .inventory-back { min-height: 48px; margin-bottom: 18px; padding: 12px 22px; font-size: 14px; }
  @media (max-width: 540px) {
    .inventory-back { width: 100%; }
    .book-grid { grid-template-columns: minmax(0, 1fr); }
    .book-card-cover { min-height: 120px; }
    .book-card h2 { font-size: 16px; }
    .book-status-link { font-size: 13px; }
  }
}

@layer pages {
  .directory-profile { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; min-height: 52px; margin: -8px 0; padding: 8px 0; border-radius: 8px; }
  .directory-profile .directory-name { min-width: 0; }
  .directory-profile h3 { overflow-wrap: anywhere; }
  .directory-profile:hover h3 { color: var(--accent-ink); text-decoration: underline; }
  .directory-chevron { flex-shrink: 0; color: var(--accent-ink); }
  .student-back { min-height: 48px; margin-bottom: 18px; padding: 12px 22px; font-size: 14px; }
  .student-book { display: flex; align-items: center; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
  .student-book:last-child { border-bottom: 0; }
  a.student-book:hover { background: var(--accent-soft); }
  .student-book-icon { display: grid; place-items: center; width: 42px; height: 48px; flex-shrink: 0; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); }
  .student-book-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
  .student-book-text h3 { font-size: 15px; margin-bottom: 7px; }
  .student-book-text .book-id { font-size: 12px; }
  .student-book-date { display: block; font-size: 11px; color: #6b665f; margin-top: 8px; }
  .student-book > .icon { flex-shrink: 0; }
}
@layer responsive {
  @media (max-width: 540px) {
    .student-back { width: 100%; }
    .directory-profile { gap: 10px; }
    .directory-profile .directory-name > span { font-size: 11px; line-height: 1.5; }
    .student-book { gap: 12px; padding: 18px 16px; }
    .student-book-text .book-id { font-size: 11px; }
  }
}
