/* EnchoMind one-page dashboard overrides. Load after styles.css. */

:root {
  --content-width: 1240px;
  --content-gutter: clamp(16px, 4vw, 48px);
  --card-radius: 8px;
  --tap-size: 48px;
}

html {
  min-width: 320px;
  scroll-padding-top: 78px;
}

body {
  min-width: 320px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

/* Keep every flex/grid child shrinkable so long IDs and localized labels wrap. */
.topbar *,
.auth-layout *,
#appShell *,
.modal * {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 68px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 8px var(--content-gutter);
  background: rgba(244, 238, 223, .97);
  backdrop-filter: blur(12px);
  border-bottom-color: rgba(130, 102, 75, .2);
}

.topbar .brand {
  flex: 0 0 auto;
  gap: 8px;
}

.brand-name {
  font-size: 22px;
}

.brand-mark {
  width: 25px;
  height: 25px;
}

.topbar-right,
.account-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.topbar-right {
  flex: 0 1 auto;
  flex-wrap: wrap;
}
.account-tools { flex-wrap: wrap; }

.edition-label {
  display: none !important;
}

.account-tools #userEmail {
  display: block;
  max-width: clamp(56px, 20vw, 220px);
  overflow: hidden;
  color: var(--brown-dark);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.language-picker {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}

.language-picker select {
  min-width: 54px;
  min-height: var(--tap-size);
  padding: 8px 22px 8px 10px;
  font-family: var(--sans);
  font-size: 14px;
  background-position: calc(100% - 12px) 21px, calc(100% - 8px) 21px;
}

/* The authentication screen becomes a compact, readable single column. */
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  justify-items: center;
  gap: 20px;
  width: 100%;
  max-width: 780px;
  min-height: calc(100vh - 68px);
  margin-inline: auto;
  padding: clamp(20px, 5vw, 44px) var(--content-gutter) 40px;
}

.welcome-panel {
  position: relative;
  width: 100%;
  min-height: 0;
  padding: 0;
}

.welcome-panel h1 {
  max-width: 12ch;
  margin: 0 0 12px;
  font-size: clamp(34px, 8vw, 54px);
  line-height: 1.08;
  letter-spacing: -.7px;
}

.welcome-copy {
  max-width: 58ch;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.roadmap-copy,
.sound-stamp,
.welcome-foot,
.tiny-sun {
  display: none !important;
}

.auth-card {
  width: 100%;
  max-width: 560px;
  padding: clamp(20px, 5vw, 32px);
  border: 1px solid #dfd1bd;
  border-radius: var(--card-radius);
  background: var(--paper-light);
  box-shadow: 0 8px 26px rgba(76, 53, 35, .07);
}

.auth-card::before,
.surface-card::before {
  display: none;
}

.auth-card h2 {
  margin-bottom: 18px;
  font-size: 28px;
}

.auth-tabs {
  gap: 6px;
  margin-bottom: 20px;
}

.auth-tab {
  min-height: var(--tap-size);
  padding: 10px;
  font-size: 16px;
}

/* One-page app shell: each section participates in normal document flow. */
.app-shell {
  display: block;
  width: 100%;
  min-height: calc(100vh - 68px);
}

.workspace {
  width: 100%;
  min-width: 0;
}

.workspace-content {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding: clamp(20px, 4vw, 42px) var(--content-gutter) 48px;
}

.sidebar,
.workspace-topbar,
.menu-button,
.sidebar-close {
  display: none !important;
}

.view,
.view.is-visible {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  animation: none;
  scroll-margin-top: 82px;
}

.view[hidden],
#view-admin[hidden] {
  display: none !important;
}

.view + .view {
  margin-top: clamp(28px, 5vw, 52px);
  padding-top: clamp(24px, 4vw, 40px);
  border-top: 1px solid rgba(130, 102, 75, .22);
}

.dashboard-intro,
.dashboard-section {
  width: 100%;
  min-width: 0;
  scroll-margin-top: 82px;
}

.dashboard-intro > h1 {
  margin: 0 0 10px;
  color: var(--brown-dark);
  font: 600 clamp(30px, 6vw, 46px)/1.12 var(--serif);
  letter-spacing: -.5px;
  overflow-wrap: anywhere;
}

.dashboard-intro > h1 em {
  color: var(--rust);
  font-weight: 500;
}

.dashboard-section {
  margin-top: clamp(28px, 5vw, 52px);
  padding-top: clamp(24px, 4vw, 40px);
  border-top: 1px solid rgba(130, 102, 75, .22);
}

.dashboard-section[hidden],
.admin-section[hidden] {
  display: none !important;
}

.bind-panel h3,
.order-layout h3 {
  margin: 0 0 16px;
  color: var(--brown-dark);
  font: 600 22px/1.25 var(--serif);
  overflow-wrap: anywhere;
}

.page-intro,
.section-head,
.section-heading {
  min-width: 0;
  margin: 0 0 18px;
}

.page-intro h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1.12;
  letter-spacing: -.5px;
  overflow-wrap: anywhere;
}

.page-intro .eyebrow,
.section-head .eyebrow,
.section-heading .eyebrow {
  margin-bottom: 6px;
}

.eyebrow,
.card-number,
.metric-top,
.workspace-footer,
.issued-code > span,
.user-chip small {
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .06em;
}

.lead,
.welcome-copy,
.muted-copy,
.fine-print,
.field-hint,
.form-message,
.auth-note,
.empty-inline,
.empty-card,
.workspace-footer,
.product-note,
.row-copy small,
.row-side,
.asset-meta,
.device-card-meta,
.device-card-stats,
.device-card-order,
.admin-row,
.admin-audio-preview,
.device-detail {
  font-size: 14px;
  line-height: 1.55;
}

.lead {
  max-width: 68ch;
  margin: 0;
  color: var(--muted);
}

.page-intro .eyebrow,
.section-head .eyebrow,
.section-heading .eyebrow,
.eyebrow {
  color: var(--copper);
}

.section-head,
.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.section-head h2,
.section-heading h2,
.auth-card h2 {
  color: var(--brown-dark);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.section-head h2,
.section-heading h2 {
  margin: 0;
  font-size: clamp(22px, 4vw, 28px);
}

/* Two key figures stay legible on a narrow phone. */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 0;
}

.summary-item { min-height: 82px; padding: 12px 16px; }
.summary-item strong { font-size: clamp(24px, 5vw, 30px); }
.device-list-panel { padding: 0; border: 0; background: transparent; box-shadow: none; }
.history-details > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  color: var(--brown-dark);
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  cursor: pointer;
}
.history-details > summary::marker { color: var(--rust); font-size: 16px; }
.history-details > summary .count-pill { margin-left: auto; }
.history-details > summary::after { content: "⌄"; color: var(--rust); font-size: 22px; }
.history-details[open] > summary::after { content: "⌃"; }
.history-details .order-layout { margin-top: 16px; }

.summary-item,
.metric-card {
  min-width: 0;
  min-height: 112px;
  padding: clamp(14px, 3vw, 20px);
  overflow-wrap: anywhere;
  border: 1px solid #dfd1bd;
  border-radius: var(--card-radius);
  background: rgba(251, 248, 239, .92);
  box-shadow: 0 5px 18px rgba(76, 53, 35, .045);
}

.summary-item strong,
.metric-card strong {
  display: block;
  margin: 7px 0 0;
  color: var(--brown-dark);
  font: 600 clamp(26px, 6vw, 36px)/1.15 var(--serif);
  overflow-wrap: anywhere;
}

.summary-item small,
.metric-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.summary-item .metric-top,
.summary-item .eyebrow,
.metric-card .metric-top {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.summary-item > span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.metric-card-dark {
  border-color: var(--brown-dark);
  background: var(--brown-dark);
  color: #fff8ec;
}

.metric-card-dark strong,
.metric-card-dark small {
  color: #fff8ec;
}

/* Cards and lists use shrinkable tracks and wrapping content at every width. */
.surface-card,
.form-card,
.device-list-card,
.device-list-panel,
.bind-panel,
.library-card,
.playlist-card,
.order-layout > *,
.admin-columns > *,
.product-card,
.device-card {
  min-width: 0;
  border: 1px solid #dfd1bd;
  border-radius: var(--card-radius);
  background: rgba(251, 248, 239, .94);
  box-shadow: 0 5px 18px rgba(76, 53, 35, .045);
}

.surface-card,
.form-card,
.device-list-card,
.device-list-panel,
.bind-panel,
.library-card,
.playlist-card,
.order-layout > *,
.admin-columns > * {
  padding: clamp(16px, 3vw, 24px);
}

.device-layout,
.library-layout,
.order-layout,
.admin-columns,
.two-column-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  min-width: 0;
}

.device-list,
.device-list-panel,
.library-card,
.playlist-card,
.admin-records,
.admin-list,
.order-list,
.grant-list {
  min-width: 0;
}

.device-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  padding: 16px;
}

.device-card:first-child,
.device-card:first-of-type {
  margin-top: 0;
}

.device-card-head,
.device-card-stats,
.device-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
}

.device-card-head > *,
.device-card-meta > *,
.device-card-stats > *,
.device-card-order > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.device-card-head > div {
  flex: 1 1 180px;
}

.device-card-head .device-detail {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.device-card-head strong,
.device-card-head h3 {
  margin: 0;
  color: var(--brown-dark);
  font: 600 20px/1.3 var(--serif);
}

.device-card-meta,
.device-card-stats,
.device-card-order {
  color: var(--muted);
}

.device-card-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding-block: 12px;
  border-top: 1px solid #e8dccb;
  border-bottom: 1px solid #e8dccb;
}

.device-card-stats > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.device-card-stats strong {
  color: var(--brown-dark);
  font-size: 16px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.device-card-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.device-card-recent {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.device-card-recent small,
.device-card-empty {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.device-card-order-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.device-card-order-line strong {
  flex: 1 1 160px;
  color: var(--brown-dark);
  font-size: 16px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.device-card-order-line .order-status {
  flex: 0 1 auto;
}

.device-buy {
  width: 100%;
}

.device-card-actions {
  justify-content: flex-start;
  padding-top: 4px;
  border-top: 1px solid #e8dccb;
}

.device-card-order {
  padding: 12px;
  border: 1px solid #e2d4c1;
  border-radius: 6px;
  background: #f8f1e5;
}

.row-copy,
.row-side,
.row-side > *,
.asset-actions,
.item-tools {
  min-width: 0;
  max-width: 100%;
}

.row-copy strong,
.row-copy small,
.admin-row .row-copy small,
.asset-meta,
.code-chip,
.order-status {
  overflow-wrap: anywhere;
  white-space: normal;
}

.device-row,
.order-row,
.asset-row,
.playlist-row,
.admin-row,
.grant-row {
  min-width: 0;
  gap: 10px;
  padding-block: 14px;
}

.row-copy strong,
.grant-row .row-copy strong {
  font-size: 16px;
  line-height: 1.35;
}

.row-copy small,
.row-side,
.asset-meta,
.device-row .device-detail,
.admin-row .row-copy small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.row-side {
  flex: 0 1 auto;
  align-items: flex-end;
}

.device-emblem,
.asset-emblem,
.round-icon,
.avatar {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
}

.count-pill,
.order-status,
.code-chip {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 14px;
  line-height: 1.35;
}

.code-chip {
  display: inline-block;
  max-width: 100%;
}

.device-status {
  font-size: 14px;
}

.device-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.device-detail span {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Forms and all interactive controls use generous hit areas and type sizes. */
button,
select,
.button,
.mini-button,
.text-button,
.icon-button,
.modal-close,
.auth-tab {
  min-height: var(--tap-size);
}

button,
input,
select,
textarea {
  font-family: var(--sans);
  font-size: 16px;
}

button {
  max-width: 100%;
  padding: 8px 12px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.button {
  min-height: var(--tap-size);
  padding: 9px 16px;
  gap: 10px;
  font-size: 16px;
  line-height: 1.35;
  border-radius: 5px;
}

.button-small,
.mini-button {
  min-height: var(--tap-size);
  padding: 8px 12px;
  gap: 8px;
  font-size: 14px;
}

.text-button {
  min-height: var(--tap-size);
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.35;
  white-space: normal;
}

.icon-button,
#logoutButton,
.modal-close {
  width: var(--tap-size);
  min-width: var(--tap-size);
  min-height: var(--tap-size);
  padding: 6px;
  font-size: 20px;
}

.account-tools #logoutButton {
  width: auto;
  min-width: var(--tap-size);
  min-height: var(--tap-size);
  padding-inline: 12px;
  white-space: nowrap;
}

.field {
  min-width: 0;
  gap: 7px;
  font-size: 16px;
  line-height: 1.4;
}

.field small {
  font-size: 14px;
}

.field input,
.field select,
.field textarea,
.playlist-create input,
.playlist-edit-tools input,
.search-field input,
input[type="file"] {
  width: 100%;
  min-width: 0;
  min-height: var(--tap-size);
  padding: 10px 12px;
  border-radius: 5px;
  font-size: 16px;
  line-height: 1.4;
}

.field select {
  padding-right: 36px;
  background-position: calc(100% - 17px) 21px, calc(100% - 13px) 21px;
}

.field textarea {
  min-height: 100px;
}

.field-hint,
.muted-copy,
.form-message,
.auth-note,
.fine-print,
.empty-inline,
.empty-card {
  font-size: 14px;
}

.form-stack {
  min-width: 0;
  gap: 16px;
}

.input-action,
.playlist-create,
.playlist-edit-tools,
.playlist-item,
.item-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.input-action input,
.playlist-create input,
.playlist-edit-tools input {
  flex: 1 1 160px;
}

.asset-row .asset-actions {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.asset-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.search-field {
  flex: 1 1 220px;
  min-width: min(100%, 220px);
}

.search-field input {
  flex: 1 1 auto;
  width: auto;
  background: transparent;
}

.playlist-list,
.admin-list {
  max-height: none;
  overflow: visible;
}

.playlist-item {
  padding-block: 8px;
}

.admin-upload-block {
  margin-top: 24px;
  padding-top: 22px;
}

.admin-audio-preview audio {
  width: 100%;
  min-height: 48px;
}

/* Dialogs stay inside the viewport and scroll internally when needed. */
.modal {
  width: min(680px, calc(100vw - 24px));
  max-width: 680px;
  max-height: calc(100dvh - 24px);
  overflow: auto;
  margin: auto;
  padding: clamp(20px, 5vw, 32px);
  border-radius: 10px;
  background: var(--paper-light);
}

.checkout-modal { position: relative; padding-top: 64px; }
.checkout-modal > form:first-child { position: absolute; top: 12px; right: 12px; z-index: 3; margin: 0; }
.checkout-modal .modal-close {
  position: static;
  display: grid;
  place-items: center;
  width: 50px;
  min-width: 50px;
  height: 50px;
  min-height: 50px;
  padding: 0;
  border: 2px solid #8a4e30;
  border-radius: 50%;
  background: #fffaf2;
  color: #5d3928;
  font-size: 30px;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(63, 43, 29, .18);
  cursor: pointer;
}
.checkout-modal .modal-close:hover,
.checkout-modal .modal-close:focus-visible { background: #f2e3d0; outline: 3px solid rgba(138, 78, 48, .28); outline-offset: 2px; }

.modal::backdrop {
  background: rgba(48, 34, 26, .55);
  backdrop-filter: blur(3px);
}

.modal h2 {
  max-width: 24ch;
  font-size: clamp(24px, 6vw, 32px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.modal-close {
  top: 8px;
  right: 8px;
  border-radius: 5px;
  background: var(--paper-light);
}

.simulation-callout {
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 6px;
}

.simulation-callout p {
  margin: 0;
  color: var(--brown-dark);
  font-size: 16px;
  line-height: 1.5;
}

.issued-code {
  min-width: 0;
  text-align: left;
}

.issued-code #issuedCodeLabel {
  color: var(--brown-dark);
  font: 700 13px/1.4 var(--mono);
  letter-spacing: .04em;
}

.activation-code-value {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 64px;
  padding: 12px;
  border: 1px solid #cbb79f;
  border-radius: 5px;
  background: #fffdf8;
  color: var(--brown-dark);
  font: 600 clamp(13px, 3.5vw, 16px)/1.5 var(--mono);
  overflow-wrap: anywhere;
  user-select: all;
  cursor: text;
}

.activation-code-value:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 2px;
}

.issued-code .button {
  min-height: 48px;
  font-size: 14px;
}

.issued-code-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.checkout-return-guide {
  border-top: 1px solid #d8c5a9;
  padding-top: 12px;
}

.checkout-return-guide h3 {
  margin: 0 0 8px;
  color: var(--brown-dark);
  font-size: 16px;
  line-height: 1.35;
}

.checkout-return-guide ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-inline-start: 22px;
  color: var(--brown);
  font-size: 14px;
  line-height: 1.5;
}

.subscription-complete {
  margin: 14px 0;
  padding: 15px;
  border: 1px solid #a9b9a0;
  border-radius: 6px;
  background: #eff3e8;
  color: var(--brown-dark);
  font-size: 14px;
  line-height: 1.55;
}

.subscription-complete p { margin: 0; }
.subscription-complete-expiry { margin-top: 7px !important; font-weight: 700; }

.wechat-checkout {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin: 18px 0;
  text-align: center;
}

.wechat-payment-heading { display: flex; align-items: center; justify-content: center; gap: 10px; }
.wechat-payment-heading h3 { margin: 0; color: #176b3a; font-size: 22px; line-height: 1.25; }
.wechat-payment-icon { display: block; width: 42px; height: 36px; flex: 0 0 auto; }

.wechat-payment-copy,
.wechat-canonical-help {
  max-width: 44ch;
  margin: 0;
  color: var(--brown);
  font-size: 14px;
  line-height: 1.55;
}

.wechat-network-help {
  max-width: 44ch;
  margin: 0;
  padding: 12px;
  border: 1px solid #dfd1bd;
  border-radius: 6px;
  background: #f8f1e5;
  color: var(--brown-dark);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}

.wechat-canonical-help a {
  display: inline-block;
  margin-inline-start: 4px;
  color: var(--rust);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wechat-qr-panel,
.wechat-jsapi-panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: 100%;
}

.wechat-qr-image {
  display: block;
  width: min(256px, 72vw);
  aspect-ratio: 1;
  padding: 9px;
  border: 1px solid #dfd1bd;
  border-radius: 7px;
  background: #fff;
  object-fit: contain;
  image-rendering: pixelated;
}

.wechat-qr-save {
  width: min(100%, 360px);
  min-height: 46px;
  font-size: 14px;
}

.wechat-qr-help {
  max-width: 44ch;
  margin: 0;
  color: var(--brown);
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
}

.wechat-qr-status {
  min-height: 1.5em;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.wechat-checkout .button {
  max-width: 360px;
}

#productGrid,
.product-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}

.product-card,
.product-card.featured {
  min-height: 0;
  padding: 18px;
  transform: none;
  overflow-wrap: anywhere;
}

.product-card.subscription-product {
  border-color: #a57a4d;
  background: #f5eddf;
}

.product-card.subscription-product::before {
  content: attr(data-plan-label);
  align-self: flex-start;
  margin-bottom: 10px;
  padding: 4px 7px;
  border-radius: 3px;
  background: #e8d5b9;
  color: var(--brown-dark);
  font: 700 11px/1.3 var(--sans);
}

.product-card h3 {
  font-size: 22px;
  overflow-wrap: anywhere;
}

.product-duration {
  font-size: 28px;
}

.product-price {
  font-size: 16px;
}

.product-note {
  color: var(--muted);
  font-size: 14px;
}

.product-card.featured .product-note {
  color: #f1e2ce;
}

.workspace-footer {
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 12px;
}

:where(button, a, input, select, textarea):focus-visible {
  outline: 3px solid rgba(173, 112, 73, .65);
  outline-offset: 2px;
}

@media (min-width: 860px) {
  :root {
    --content-gutter: clamp(28px, 4vw, 52px);
  }

  .auth-layout {
    grid-template-columns: minmax(0, 1fr) minmax(340px, .9fr);
    align-items: center;
    max-width: 1120px;
    gap: clamp(32px, 6vw, 80px);
  }

  .welcome-panel h1 {
    max-width: 11ch;
    font-size: clamp(42px, 5vw, 62px);
  }

  .device-layout,
  .two-column-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
    gap: 20px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .device-card-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-layout {
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr);
    gap: 20px;
  }

  .order-layout,
  .admin-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  #productGrid,
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  :root {
    --content-gutter: 14px;
  }

  .brand-name {
    font-size: 20px;
  }

  .topbar {
    gap: 6px 8px;
    padding-block: 6px;
    padding-inline: 12px;
  }

  .account-tools,
  .topbar-right {
    gap: 6px;
  }

  .account-tools #userEmail {
    display: none;
  }

  .account-tools #logoutButton {
    padding-inline: 6px;
    font-size: 14px;
  }

  .language-picker select {
    min-width: 48px;
    padding-inline: 7px 18px;
    font-size: 13px;
  }

  .summary-grid {
    gap: 8px;
  }

  .summary-item,
  .metric-card {
    min-height: 104px;
    padding: 12px;
  }

  .summary-item small,
  .metric-card small {
    font-size: 14px;
  }

  .device-card-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .device-row,
  .order-row,
  .asset-row,
  .grant-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .row-side {
    margin-left: 54px;
    align-items: flex-start;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

.summary-grid .summary-item { min-height: 82px; padding: 12px 16px; }
.device-layout .device-list-panel { padding: 0; border: 0; background: transparent; box-shadow: none; }

/* Device ID is the only entry point; each device owns its detail and resource views. */
.dashboard-intro { padding-bottom: 4px; }
#view-devices { margin-top: 20px; padding-top: 20px; }
#view-devices .section-head { align-items: center; }
#view-devices .section-head .button { flex: 0 0 auto; }
#deviceList { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.device-card { min-width: 0; }
.device-card:has(#deviceDialog:not([hidden])) { grid-column: 1 / -1; }
.device-entry {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 82px; padding: 18px; text-align: left;
  border: 1px solid #dfd1bd; border-radius: var(--card-radius);
  background: rgba(251, 248, 239, .94); color: var(--brown-dark);
  box-shadow: 0 5px 18px rgba(76, 53, 35, .045); cursor: pointer;
}
.device-entry:hover, .device-entry:focus-visible { border-color: var(--rust); box-shadow: 0 6px 20px rgba(120, 73, 43, .12); }
.device-entry strong { display: block; font: 600 19px/1.3 var(--serif); overflow-wrap: anywhere; }
.device-entry small { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.device-entry .entry-arrow { flex: 0 0 auto; color: var(--rust); font-size: 22px; }
#deviceList > .empty-inline { grid-column: 1 / -1; padding: 22px; border: 1px dashed #d7c7b1; border-radius: var(--card-radius); }

#bindDialog { width: min(460px, calc(100vw - 24px)); }
#bindDialog .form-stack { margin-top: 20px; }
.device-modal, .resource-modal { width: min(780px, calc(100vw - 24px)); max-width: 780px; max-height: min(88vh, 960px); overflow-y: auto; }
.device-expanded { margin-top: 12px; padding: clamp(16px, 3vw, 24px); border: 1px solid #dfd1bd; border-radius: var(--card-radius); background: rgba(251, 248, 239, .98); box-shadow: 0 8px 24px rgba(76, 53, 35, .07); }
.device-expanded-header, .resource-inline-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.device-expanded-header h2, .resource-inline-heading h2 { margin: 0; color: var(--brown-dark); overflow-wrap: anywhere; }
.device-expanded-header .eyebrow { margin: 0 0 4px; }
.device-expanded-header .button, .resource-inline-heading .button { flex: 0 0 auto; }
.device-section-panel { min-width: 0; }
.device-section-panel > h3 { margin: 0 0 12px; color: var(--brown-dark); font: 600 22px/1.25 var(--serif); }
.resource-inline { max-height: min(78vh, 900px); overflow: auto; padding: 0 2px 8px; }
.resource-inline-heading { margin-bottom: 12px; }
.resource-inline-heading .muted-copy { margin: 3px 0 0; }
.resource-inline[hidden], .device-expanded[hidden], .device-section-panel[hidden] { display: none !important; }
.device-modal > .eyebrow { margin: 0 0 4px; }
.device-modal h2 { padding-right: 34px; overflow-wrap: anywhere; }
.device-detail-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.device-detail-stats > div { padding: 13px; border: 1px solid #e0d1bc; background: #f8f2e6; border-radius: 6px; }
.device-detail-stats span { display: block; color: var(--muted); font-size: 13px; }
.device-detail-stats strong { display: block; margin-top: 5px; color: var(--brown-dark); font: 600 18px/1.3 var(--serif); overflow-wrap: anywhere; }
.device-detail-stats .device-report-note { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.device-detail-stats .subscription-stat { grid-column: 1 / -1; border-color: #d2bea1; background: #f5eddf; }
.device-detail-stats .subscription-stat small { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.admin-subscription-test-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.device-detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 24px; }
.device-detail-actions .button { flex: 1 1 170px; }
.detail-history { border-top: 1px solid #e3d5c1; padding-top: 18px; margin-top: 18px; }
.detail-history h3 { margin: 0 0 12px; color: var(--brown-dark); font: 600 22px/1.2 var(--serif); }
.detail-history .order-row, .detail-history .grant-row { padding: 12px 0; border-bottom: 1px solid #ede3d4; }
.detail-history .row-copy, .detail-history .row-side { min-width: 0; overflow-wrap: anywhere; }
.resource-list { margin-top: 18px; }
.resource-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 14px 0; border-top: 1px solid #e3d5c1; }
.resource-row strong { display: block; color: var(--brown-dark); overflow-wrap: anywhere; }
.resource-row small { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.resource-row .button { min-width: 100px; }

@media (max-width: 600px) {
  #view-devices .section-head { align-items: stretch; }
  #view-devices .section-head h2 { flex: 1 1 auto; }
  #view-devices .section-head .button { min-height: 46px; }
  .device-modal, .resource-modal { padding: 20px 16px; max-height: 90vh; }
  .device-detail-stats { grid-template-columns: minmax(0, 1fr); }
  .device-expanded-header, .resource-inline-heading { align-items: flex-start; }
  .device-expanded-header .button, .resource-inline-heading .button { min-height: 44px; }
  .resource-inline { max-height: none; overflow: visible; }
  .resource-row { grid-template-columns: minmax(0, 1fr); }
  .resource-row .button { justify-self: start; }
}

/* Device identifiers and counts stay legible across the member and admin views. */
.id-text,
.numeric-value,
.count-pill,
.order-id-text {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.id-text {
  overflow-wrap: anywhere;
  word-break: break-word;
  letter-spacing: .015em;
}

.member-intro .eyebrow { margin: 0 0 7px; }

/* Resource pack preview, version history, and daily admin selection. */
.resource-modal { max-width: 1000px; }
.resource-pack-panel,
.legacy-resource-section {
  margin-top: 22px;
  padding: clamp(15px, 2.4vw, 24px);
  border: 1px solid #dfd1bd;
  border-radius: var(--card-radius);
  background: #fbf8ef;
}
.resource-pack-panel .section-heading { margin-bottom: 10px; }
.resource-pack-step[hidden],
.resource-pack-form[hidden] { display: none !important; }
.resource-pack-panel > .resource-pack-step {
  display: block;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
}
.resource-source-item-list { list-style: none; margin: 0; padding: 0; }
.resource-source-item-list li { display: grid; gap: 3px; padding: 9px 12px; border-bottom: 1px solid #ece3d4; min-width: 0; }
.resource-source-item-list li:last-child { border-bottom: 0; }
.resource-source-item-list strong, .resource-source-item-list small { overflow-wrap: anywhere; }
.resource-source-item-list small { color: var(--muted); }
.resource-source-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.resource-source-upload { margin: 13px 0; }
.resource-source-group h4 { margin: 10px 0 4px; }
.resource-source-group .resource-source-option { width: 100%; grid-template-columns: minmax(0, 1fr) auto; text-align: left; }
.resource-source-group .resource-source-option strong,
.resource-source-group .resource-source-option small { grid-column: 1; }
.resource-source-group .resource-source-option > span { grid-column: 2; grid-row: 1 / span 2; }
#resourceSourceList > .resource-source-option { width: 100%; grid-template-columns: minmax(0, 1fr) auto; text-align: left; }
.resource-pack-compare-group { margin: 12px 0; }
.resource-pack-compare-group summary { cursor: pointer; font-weight: 600; }
.resource-pack-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 14px 0 18px;
}
.resource-pack-step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #dfd1bd;
  border-radius: 6px;
  background: rgba(255, 255, 255, .52);
  color: var(--muted);
}
.resource-pack-step.is-active,
.resource-pack-step[aria-current="step"] {
  border-color: var(--rust);
  background: #fffaf0;
  color: var(--brown-dark);
  box-shadow: 0 0 0 1px rgba(145, 84, 49, .12);
}
.resource-pack-step.is-complete { border-color: #91a777; color: var(--brown-dark); }
.resource-pack-step-number {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font: 600 13px/1 var(--mono);
}
.resource-pack-step-copy { display: grid; min-width: 0; gap: 2px; }
.resource-pack-step-copy strong { color: var(--brown-dark); font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.resource-pack-step-copy small { color: var(--muted); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.resource-source-list { display: grid; gap: 9px; min-width: 0; margin: 12px 0; }
.resource-source-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: var(--tap-size);
  padding: 12px;
  border: 1px solid #dfd1bd;
  border-radius: 6px;
  background: rgba(255, 255, 255, .56);
  color: var(--brown-dark);
  cursor: pointer;
}
.resource-source-option:hover,
.resource-source-option:focus-within { border-color: #b78358; }
.resource-source-option.is-selected {
  border-color: var(--rust);
  background: #fff7e9;
  box-shadow: 0 0 0 1px rgba(145, 84, 49, .14);
}
.resource-source-option.is-disabled,
.resource-source-option:has(input:disabled) { opacity: .62; cursor: not-allowed; }
.resource-source-option input { flex: 0 0 auto; width: 20px; height: 20px; margin: 0; accent-color: var(--rust); }
.resource-source-option > span,
.resource-source-option-copy { display: grid; min-width: 0; gap: 3px; }
.resource-source-option strong { color: var(--brown-dark); line-height: 1.35; overflow-wrap: anywhere; }
.resource-source-option small { color: var(--muted); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.resource-source-option .resource-source-selected { justify-self: end; color: var(--rust); font-size: 12px; font-weight: 650; }
.resource-source-summary {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 10px 0 14px;
  padding: 13px;
  border: 1px solid #d9c4a8;
  border-radius: 6px;
  background: #f8f1e5;
}
.resource-source-summary-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; }
.resource-source-summary-heading strong { color: var(--brown-dark); overflow-wrap: anywhere; }
.resource-source-summary dl,
.resource-source-summary-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.resource-source-summary dl > div,
.resource-source-summary-metric { min-width: 0; padding: 8px 9px; border: 1px solid rgba(130, 102, 75, .16); border-radius: 5px; background: rgba(255, 255, 255, .58); }
.resource-source-summary dt,
.resource-source-summary-metric small { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; }
.resource-source-summary dd,
.resource-source-summary-metric strong { display: block; margin: 3px 0 0; color: var(--brown-dark); font: 600 15px/1.3 var(--mono); overflow-wrap: anywhere; }
.resource-pack-compare { display: grid; gap: 14px; min-width: 0; }
.resource-pack-compare-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; min-width: 0; }
.resource-pack-compare-section { min-width: 0; padding: 12px; border: 1px solid #e3d5c1; border-radius: 6px; background: rgba(255, 255, 255, .52); }
.resource-pack-compare-section h5 { margin: 0 0 9px; color: var(--brown-dark); font: 600 15px/1.35 var(--sans); }
.resource-pack-compare-table-wrap,
.resource-pack-preview-table-wrap,
.resource-source-table-wrap {
  max-width: 100%;
  max-height: min(52vh, 460px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #dfd1bd;
  border-radius: 5px;
  background: #fffdf8;
  -webkit-overflow-scrolling: touch;
}
.resource-pack-compare-table,
.resource-pack-preview-table,
.resource-source-table { width: 100%; min-width: 560px; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.resource-pack-compare-table th,
.resource-pack-compare-table td,
.resource-pack-preview-table th,
.resource-pack-preview-table td,
.resource-source-table th,
.resource-source-table td { padding: 8px 10px; border-bottom: 1px solid #ede3d4; text-align: start; vertical-align: top; overflow-wrap: anywhere; }
.resource-pack-compare-table th,
.resource-pack-preview-table th,
.resource-source-table th { position: sticky; top: 0; z-index: 1; background: #f3eadb; color: var(--brown-dark); font-weight: 650; }
.resource-pack-compare-table tr:last-child td,
.resource-pack-preview-table tr:last-child td,
.resource-source-table tr:last-child td { border-bottom: 0; }
.resource-pack-compare-table td:first-child,
.resource-pack-preview-table td:first-child,
.resource-source-table td:first-child { max-width: 320px; }
.resource-pack-compare-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.resource-pack-test-flow {
  margin: 10px 0 16px;
  padding: 10px 12px;
  border-left: 3px solid var(--rust);
  border-radius: 4px;
  background: #f5efe3;
}
.resource-pack-panel h3,
.legacy-resource-section h3 {
  margin: 0;
  color: var(--brown-dark);
  font: 600 clamp(19px, 3vw, 24px)/1.25 var(--serif);
  overflow-wrap: anywhere;
}
.resource-pack-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.resource-pack-end-field { align-self: end; }
.resource-pack-end-year {
  display: block;
  min-height: var(--tap-size);
  padding: 11px 13px;
  border: 1px solid #ded2c1;
  border-radius: 4px;
  background: #f5efe3;
  color: var(--brown-dark);
  font-weight: 600;
}
.resource-pack-empty-choice { display: flex; align-items: flex-start; gap: 10px; min-height: var(--tap-size); color: var(--brown-dark); font-weight: 600; }
.resource-pack-empty-choice input,
.mandatory-candidate input { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--rust); }
.resource-pack-source-picker { display: grid; gap: 9px; margin: 0; padding: 12px; border: 1px solid #dfd1bd; border-radius: 5px; }
.resource-pack-source-picker legend { padding: 0 5px; color: var(--brown-dark); font-weight: 650; }
.resource-pack-source-option { display: flex; align-items: flex-start; gap: 9px; min-height: 32px; color: var(--brown-dark); font-weight: 600; cursor: pointer; }
.resource-pack-source-option input { flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--rust); }
.resource-pack-source-option input:disabled { cursor: not-allowed; }
.device-csv-info-container { margin-inline-start: 28px; }
.device-csv-info { display: grid; gap: 8px; padding: 10px; border: 1px solid #e3d5c1; border-radius: 5px; background: #fbf8ef; }
.device-csv-info > strong { color: var(--brown-dark); overflow-wrap: anywhere; }
.device-csv-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 0; }
.device-csv-meta > div { min-width: 0; }
.device-csv-meta dt { color: var(--muted); font-size: 12px; line-height: 1.4; }
.device-csv-meta dd { margin: 2px 0 0; color: var(--brown-dark); font-weight: 600; overflow-wrap: anywhere; }
.device-csv-download { justify-self: start; min-height: 40px; }
.device-report-panel,
.inventory-diff-panel,
.year-pack-preview-section { margin-top: 14px; padding: 13px; border: 1px solid #e3d5c1; border-radius: 6px; background: rgba(255, 255, 255, .52); }
.device-report-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.device-report-heading h4,
.device-report-contents h5,
.inventory-diff-panel h4 { margin: 0; color: var(--brown-dark); font: 600 16px/1.35 var(--serif); }
.device-report-meta,
.inventory-diff-summary dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 10px; }
.device-report-meta > div,
.inventory-diff-summary dl > div { min-width: 0; padding: 8px 9px; border: 1px solid rgba(130, 102, 75, .16); border-radius: 5px; background: rgba(255, 255, 255, .66); }
.device-report-meta dt,
.inventory-diff-summary dt { color: var(--muted); font-size: 11px; line-height: 1.35; }
.device-report-meta dd,
.inventory-diff-summary dd { margin: 3px 0 0; color: var(--brown-dark); font-weight: 650; overflow-wrap: anywhere; }
.device-report-contents { margin-top: 14px; padding-top: 12px; border-top: 1px solid #e3d5c1; }
.device-report-contents h5 { margin-bottom: 8px; }
.device-report-item-list { display: grid; gap: 5px; max-height: 360px; margin: 0; padding: 0; overflow: auto; list-style: none; }
.device-report-item-list li { display: grid; gap: 3px; padding: 9px 10px; border: 1px solid #e3d5c1; border-radius: 4px; background: #fffdf8; }
.device-report-item-list strong { color: var(--brown-dark); overflow-wrap: anywhere; }
.device-report-item-list small { color: var(--muted); overflow-wrap: anywhere; }
.year-pack-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid #e3d5c1; }
.year-pack-fields { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(120px, .7fr) auto; align-items: end; gap: 10px; }
.year-pack-fields .field { margin: 0; }
.year-pack-selected-years { display: flex; flex-wrap: wrap; gap: 7px; min-height: 38px; align-items: center; }
.year-pack-year-chip { display: inline-flex; align-items: center; gap: 10px; min-height: 38px; padding: 6px 10px; border: 1px solid #c9a57d; border-radius: 999px; background: #fff7e9; color: var(--brown-dark); font-weight: 650; cursor: pointer; }
.year-pack-year-chip:hover,
.year-pack-year-chip:focus-visible { border-color: var(--rust); color: var(--rust); }
.year-pack-year-chip > span:last-child { font-size: 18px; line-height: 1; }
.year-pack-preview-section { background: #fbf8ef; }
.year-pack-preview-section .section-heading { margin-bottom: 8px; }
.year-pack-status { display: inline-block; padding: 3px 8px; border: 1px solid #d6bd99; border-radius: 999px; color: var(--brown-dark); white-space: nowrap; }
.year-pack-status.is-owned { border-color: #91a777; background: #f1f5e9; }
.year-pack-status.is-new { border-color: #b78358; background: #fff7e9; }
.year-pack-status.is-missing { border-color: #ca9879; background: #faf0e9; }
.resource-pack-v2-panel { margin: 0 0 25px; padding: 16px; border: 1px solid #cbb79e; border-radius: 7px; background: #fbf8ef; }
.resource-library-view[hidden], .resource-library-create-entry[hidden] { display: none !important; }
.resource-library-toolbar { display: flex; justify-content: flex-end; }
.resource-library-heading { align-items: center; gap: 12px; }
.resource-library-heading h3,
.resource-library-builder-header h3 { margin: 0; color: var(--brown-dark); font: 600 21px/1.25 var(--serif); }
.resource-library-summary,
.resource-pack-v2-inventory-section,
.resource-pack-v2-history-section { margin-top: 16px; padding: 15px; border: 1px solid #e3d5c1; border-radius: 7px; background: rgba(255, 255, 255, .55); }
.resource-library-summary > h4,
.resource-pack-v2-inventory-section > h4,
.resource-pack-v2-history-section > h4 { margin: 0 0 10px; }
.resource-library-create-entry { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; padding: 17px; border: 1px solid #c9af88; border-radius: 7px; background: #f5ead5; }
.resource-library-create-entry strong { color: var(--brown-dark); font: 600 18px/1.3 var(--serif); }
.resource-library-create-entry p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.resource-library-create-entry .button { flex: 0 0 auto; }
.resource-library-builder-header { display: grid; gap: 15px; }
.resource-library-builder-header .button { justify-self: start; }
.resource-library-builder-header .eyebrow { margin: 0 0 5px; }
.resource-library-builder > .field-hint { margin: 11px 0 0; }
.resource-library-disclosure { margin-top: 10px; padding-top: 3px; border-top: 1px solid #e3d5c1; }
.resource-library-disclosure > summary { min-height: 40px; display: flex; align-items: center; padding: 8px 0; color: var(--rust); font-size: 12px; font-weight: 650; cursor: pointer; }
.resource-library-disclosure .resource-pack-v2-inventory-list { margin-top: 8px; }
.resource-library-empty-candidates { margin: 8px 0 0; padding: 15px; border: 1px dashed #cbb79e; border-radius: 6px; background: #fffaf0; color: var(--brown-dark); font-size: 13px; line-height: 1.6; }
.resource-pack-v2-panel > .section-heading { align-items: center; margin-bottom: 8px; }
.resource-pack-v2-panel .section-heading h3 { margin: 0; color: var(--brown-dark); font: 600 21px/1.25 var(--serif); }
.resource-pack-v2-panel h4 { margin: 17px 0 9px; color: var(--brown-dark); font: 600 17px/1.3 var(--serif); }
.resource-pack-v2-status-metrics,
.resource-pack-v2-inventory-metrics,
.resource-pack-v2-preview-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.resource-pack-v2-cleanup-policy,
.resource-pack-v2-cleanup-outcome { min-width: 0; margin: 14px 0; padding: 14px; border: 1px solid #d8c5a8; border-radius: 7px; background: #fffaf0; }
.resource-pack-v2-cleanup-policy > h4,
.resource-pack-v2-cleanup-outcome > h5 { margin: 0 0 5px; color: var(--brown-dark); font: 600 16px/1.35 var(--serif); }
.resource-pack-v2-cleanup-policy > .field-hint,
.resource-pack-v2-cleanup-outcome > .field-hint { margin: 0 0 10px; }
.resource-pack-v2-cleanup-storage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.resource-pack-v2-cleanup-toggle { display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; }
.resource-pack-v2-cleanup-toggle > input { position: relative; flex: 0 0 48px; width: 48px; height: 28px; margin: 0; appearance: none; border: 1px solid #9a8366; border-radius: 999px; background: #e6dccb; cursor: pointer; transition: background-color .16s ease, border-color .16s ease; }
.resource-pack-v2-cleanup-toggle > input::before { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(48, 35, 22, .28); content: ""; transition: transform .16s ease; }
.resource-pack-v2-cleanup-toggle > input:checked { border-color: #315a45; background: #477b60; }
.resource-pack-v2-cleanup-toggle > input:checked::before { transform: translateX(20px); }
.resource-pack-v2-cleanup-toggle > input:focus-visible { outline: 3px solid rgba(49, 90, 120, .38); outline-offset: 3px; }
.resource-pack-v2-cleanup-toggle > input:disabled { cursor: wait; opacity: .6; }
.resource-pack-v2-cleanup-toggle-copy { display: grid; gap: 2px; min-width: 0; }
.resource-pack-v2-cleanup-toggle-copy strong { color: var(--brown-dark); font-size: 14px; }
.resource-pack-v2-cleanup-toggle-copy small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.resource-pack-v2-cleanup-policy .form-message { min-height: 1.5em; margin: 4px 0 0; overflow-wrap: anywhere; }
.resource-pack-v2-cleanup-outcome .resource-pack-v2-detail-list { margin-top: 8px; }
.resource-library-current-content { margin-top: 13px; }
.resource-library-current-content > h5,
.resource-library-version-detail h5 { margin: 0 0 9px; color: var(--brown-dark); font: 600 15px/1.35 var(--serif); }
.resource-library-current-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.resource-library-current-group { display: grid; gap: 3px; min-width: 0; padding: 10px 12px; border: 1px solid #d8c5a8; border-left: 3px solid #315a78; border-radius: 6px; background: #f5f8f9; color: var(--brown-dark); }
.resource-library-current-group strong { font-size: 13px; overflow-wrap: anywhere; }
.resource-library-current-group span { color: var(--muted); font-size: 12px; }
.resource-library-current-group b { color: #315a78; font-size: 12px; }
.resource-library-version-detail { margin-top: 14px; padding: 14px; border: 1px solid #c9af88; border-radius: 8px; background: #fffaf0; }
.resource-library-version-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.resource-library-version-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.resource-library-version-rows { margin-top: 12px; }
.resource-pack-v2-metric { min-width: 0; padding: 10px 12px; border: 1px solid rgba(130, 102, 75, .18); border-radius: 5px; background: rgba(255, 255, 255, .64); }
.resource-pack-v2-metric dt { color: var(--muted); font-size: 12px; line-height: 1.4; }
.resource-pack-v2-metric dd { margin: 3px 0 0; color: var(--brown-dark); font: 600 16px/1.35 var(--mono); overflow-wrap: anywhere; }
.resource-pack-v2-detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 14px; margin: 12px 0 0; }
.resource-pack-v2-detail-list > div { display: grid; grid-template-columns: minmax(100px, .38fr) minmax(0, 1fr); gap: 9px; padding-top: 7px; border-top: 1px solid rgba(130, 102, 75, .15); }
.resource-pack-v2-detail-list dt { color: var(--muted); font-size: 12px; }
.resource-pack-v2-detail-list dd { margin: 0; color: var(--brown-dark); font-size: 12px; overflow-wrap: anywhere; }
.resource-pack-v2-inventory-section { margin-top: 16px; padding: 15px; border: 1px solid #e3d5c1; border-radius: 7px; background: rgba(255, 255, 255, .55); }
.resource-pack-v2-inventory-list,
.resource-pack-v2-history { display: grid; gap: 8px; }
.resource-pack-v2-row,
.resource-pack-v2-history-item { min-width: 0; padding: 11px 12px; border: 1px solid #e3d5c1; border-radius: 5px; background: rgba(255, 255, 255, .58); }
.resource-pack-v2-row-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.resource-pack-v2-row-heading strong { color: var(--brown-dark); overflow-wrap: anywhere; }
.resource-pack-v2-row-heading span,
.resource-pack-v2-row-meta { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.resource-pack-v2-row-meta { display: block; margin-top: 4px; }
.resource-pack-v2-row details { margin-top: 7px; }
.resource-pack-v2-row details summary { min-height: 38px; padding: 8px 0; color: var(--rust); font-size: 12px; font-weight: 600; cursor: pointer; }
.resource-pack-v2-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 12px; }
.resource-pack-v2-fields .field { margin: 0; }
.resource-pack-v2-fields select:disabled,
.resource-pack-v2-fields input:disabled { opacity: .68; }
.resource-pack-v2-result-actions { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; min-width: 0; padding: 12px; border: 1px solid #d6d9e9; border-radius: 9px; background: #f7f8fc; }
.resource-pack-v2-result-actions .resource-pack-v2-fields { display: flex; flex: 1 1 280px; flex-wrap: wrap; align-items: flex-end; gap: 9px; min-width: 0; }
.resource-pack-v2-result-actions .field { flex: 1 1 185px; max-width: 260px; min-width: 0; }
.resource-pack-v2-result-actions #resourcePackV2SampleCountField { flex-basis: 120px; max-width: 150px; }
#resourcePackV2SearchGroup:not(:disabled) { border-color: #315a78; background: #315a78; color: #fff; }
#resourcePackV2SearchGroup:hover:not(:disabled), #resourcePackV2SearchGroup:focus-visible:not(:disabled) { border-color: #25455d; background: #25455d; color: #fff; }
#resourcePackV2AddGroup:not(:disabled) { border-color: #884c3b; background: #884c3b; color: #fff; }
#resourcePackV2AddGroup:hover:not(:disabled), #resourcePackV2AddGroup:focus-visible:not(:disabled) { border-color: #6f3b2d; background: #6f3b2d; color: #fff; }
.resource-pack-v2-detail-action { display: flex; flex: 0 1 auto; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 0; margin-left: auto; text-align: right; }
.resource-pack-v2-detail-button { min-height: 44px; border-color: #565889; background: #565889; color: #fff; font-weight: 700; }
.resource-pack-v2-detail-button:hover:not(:disabled), .resource-pack-v2-detail-button:focus-visible:not(:disabled) { border-color: #41436f; background: #41436f; color: #fff; }
.resource-pack-v2-detail-button:focus-visible { outline: 3px solid #a1a7de; outline-offset: 2px; }
.resource-pack-v2-detail-button:disabled { border-color: #a2a6b8; background: #a2a6b8; color: #fff; cursor: not-allowed; }
#resourcePackV2ManualMonthHint { max-width: 250px; margin: 0; color: #654d66; font-size: 12px; line-height: 1.4; }
#resourcePackV2ResultActions[hidden], #resourcePackV2SelectionControls[hidden], #resourcePackV2SampleCountField[hidden], #resourcePackV2ManualMonthHint[hidden] { display: none; }
.resource-pack-v2-manual-dialog { width: min(780px, calc(100vw - 24px)); max-width: 780px; max-height: calc(100dvh - 24px); margin: auto; padding: 0; overflow: hidden; border: 1px solid #cbb79e; border-radius: 12px; background: var(--paper-light); color: var(--brown-dark); box-shadow: 0 18px 60px rgba(48, 34, 26, .25); }
.admin-initial-template { margin: 1rem 0; padding: 1rem; border: 1px solid #cbd7d9; border-radius: 12px; background: #f4f8f8; }
.admin-initial-template h4 { margin: 0 0 .35rem; }
.admin-initial-template .field-hint { margin: .4rem 0 .75rem; }
.admin-initial-template-result { margin-top: .8rem; display: grid; gap: .55rem; }
.admin-initial-template-result p { margin: 0; }
.admin-initial-template-result details { font-size: .9rem; }
.admin-initial-template-result details p { margin: .45rem 0; overflow-wrap: anywhere; }
#resourcePackV2SearchItems { max-height: 240px; overflow: auto; }
.resource-pack-v2-search-items { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.resource-pack-v2-search-items li { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid #e3d5c1; border-radius: 7px; background: #fffdf8; overflow-wrap: anywhere; }
.resource-pack-v2-search-items strong { font-size: 14px; }
.resource-pack-v2-search-items small { color: var(--muted); }
.resource-pack-v2-news-group { justify-self: start; display: inline-block; width: fit-content; padding: 2px 8px; border: 1px solid #c8c1dc; border-radius: 999px; background: #eeebf7; color: #4d4778; font-size: 12px; font-weight: 700; line-height: 1.35; }
.resource-pack-v2-manual-dialog::backdrop { background: rgba(48, 34, 26, .58); backdrop-filter: blur(3px); }
.resource-pack-v2-manual-dialog-content { display: grid; grid-template-rows: auto auto auto minmax(120px, 1fr) auto; max-height: calc(100dvh - 26px); }
.resource-pack-v2-manual-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 17px 18px 12px; border-bottom: 1px solid #e3d5c1; }
.resource-pack-v2-manual-header .eyebrow { margin: 0 0 4px; }
.resource-pack-v2-manual-header h3 { margin: 0; color: var(--brown-dark); font: 600 21px/1.25 var(--serif); }
.resource-pack-v2-manual-header .button { flex: 0 0 auto; min-height: 44px; }
.resource-pack-v2-manual-scope { margin: 0; padding: 11px 18px 0; color: var(--brown-dark); font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.resource-pack-v2-manual-hint { margin: 6px 18px 0; line-height: 1.45; }
.resource-pack-v2-manual-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px; padding: 11px 18px; }
.resource-pack-v2-manual-toolbar strong { color: var(--brown-dark); font-size: 13px; }
.resource-pack-v2-manual-toolbar > div { display: flex; flex-wrap: wrap; gap: 7px; }
.resource-pack-v2-manual-toolbar .button { min-height: 42px; padding: 8px 11px; }
.resource-pack-v2-manual-items { min-height: 120px; max-height: min(54dvh, 560px); overflow: auto; overscroll-behavior: contain; padding: 0 18px 13px; }
.resource-pack-v2-manual-list { display: grid; gap: 7px; }
.resource-pack-v2-manual-item { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: start; gap: 11px; min-width: 0; padding: 11px 12px; border: 1px solid #e3d5c1; border-radius: 7px; background: #fffdf8; color: var(--brown-dark); cursor: pointer; }
.resource-pack-v2-manual-item:has(input:checked) { border-color: #91a777; background: #f1f5e9; }
.resource-pack-v2-manual-item input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--rust); }
.resource-pack-v2-manual-item-copy { display: grid; gap: 4px; min-width: 0; }
.resource-pack-v2-manual-item-copy strong { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.resource-pack-v2-manual-item-copy small { color: var(--muted); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.resource-pack-v2-manual-item-copy .id-text { color: #654e3b; }
.resource-pack-v2-manual-footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 12px 18px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid #e3d5c1; background: var(--paper-light); }
.resource-pack-v2-manual-footer .button { min-height: 48px; }
.resource-pack-v2-region { display: grid; gap: 5px; padding: 0 0 9px; color: var(--muted); font-size: 13px; }
.resource-pack-v2-region strong { color: var(--brown-dark); }
.resource-pack-v2-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid #e3d5c1; }
.resource-pack-v2-download-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; }
.resource-pack-v2-download-actions .form-message { margin: 0; }
.resource-pack-v2-example-download { display: grid; justify-items: start; gap: 8px; margin-top: 12px; padding: 12px 14px; border: 1px solid #e3d5c1; border-radius: 8px; background: #fffdf8; }
.resource-pack-v2-example-download > .field-hint { margin: 0; }
.resource-pack-v2-candidate-section { margin-top: 7px; }
.resource-pack-v2-candidate-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 7px 12px; }
.resource-pack-v2-candidate-heading h4 { margin-bottom: 8px; }
.resource-pack-v2-selection-count { color: var(--muted); font-size: 12px; font-weight: 650; }
.resource-pack-v2-candidates { display: grid; gap: 8px; }
.resource-pack-v2-year { min-width: 0; border: 1px solid #dfd1bd; border-radius: 5px; background: rgba(255, 255, 255, .35); }
.resource-pack-v2-year > summary { display: flex; align-items: center; justify-content: space-between; gap: 9px; min-height: 44px; padding: 9px 12px; color: var(--brown-dark); cursor: pointer; list-style: none; }
.resource-pack-v2-year > summary::-webkit-details-marker { display: none; }
.resource-pack-v2-year > summary::after { content: "+"; flex: 0 0 auto; color: var(--rust); font-size: 18px; }
.resource-pack-v2-year[open] > summary::after { content: "−"; }
.resource-pack-v2-year > summary span { margin-left: auto; color: var(--muted); font-size: 12px; }
.resource-pack-v2-month-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 9px 10px; }
.resource-pack-v2-month { min-width: 0; padding: 9px; border: 1px solid rgba(130, 102, 75, .16); border-radius: 4px; background: rgba(255, 255, 255, .6); }
.resource-pack-v2-month h5 { margin: 0 0 7px; color: var(--brown-dark); font: 600 13px/1.35 var(--sans); }
.resource-pack-v2-month-items { display: grid; gap: 6px; }
.resource-pack-v2-month-empty { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.resource-pack-v2-candidate { display: flex; align-items: flex-start; gap: 9px; min-width: 0; padding: 8px; border: 1px solid #e3d5c1; border-radius: 4px; background: #fffdf8; color: var(--brown-dark); cursor: pointer; }
.resource-pack-v2-candidate:has(input:checked) { border-color: #91a777; background: #f1f5e9; }
.resource-pack-v2-candidate input { flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--rust); }
.resource-pack-v2-candidate input:disabled { cursor: not-allowed; }
.resource-pack-v2-candidate-copy { display: grid; min-width: 0; gap: 3px; }
.resource-pack-v2-candidate-copy strong { overflow-wrap: anywhere; font-size: 12px; line-height: 1.35; }
.resource-pack-v2-candidate-copy small { color: var(--muted); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.resource-pack-v2-preview-section { margin-top: 15px; padding: 13px; border: 1px solid #d6bd99; border-radius: 6px; background: #fffaf0; }
.resource-pack-v2-preview-section h4 { margin-top: 0; }
.resource-pack-v2-preview-card { padding: 11px; border: 1px solid #e3d5c1; border-radius: 5px; background: rgba(255, 255, 255, .7); }
.resource-pack-v2-preview-card.is-ready { border-color: #91a777; }
.resource-pack-v2-preview-card.is-blocked { border-color: #ca9879; }
.resource-pack-v2-capacity-blocked { color: #9e3b2e; font-weight: 650; }
.resource-pack-v2-target-section,
.resource-pack-v2-conflicts { margin-top: 13px; padding-top: 10px; border-top: 1px solid rgba(130, 102, 75, .17); }
.resource-pack-v2-target-section h4,
.resource-pack-v2-conflicts h5,
.resource-pack-v2-preview-card h5 { margin: 0 0 8px; color: var(--brown-dark); font-size: 14px; }
.resource-pack-v2-conflicts ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.resource-pack-v2-conflicts li { display: grid; gap: 3px; padding: 8px 9px; border: 1px solid #decbb2; border-radius: 4px; background: rgba(255, 255, 255, .68); }
.resource-pack-v2-conflicts small { color: var(--muted); overflow-wrap: anywhere; }
.resource-pack-v2-missing-years { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.resource-pack-v2-missing-years > div { padding: 9px 10px; border: 1px solid rgba(130, 102, 75, .16); border-radius: 4px; background: rgba(255, 255, 255, .66); }
.resource-pack-v2-missing-years strong { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.resource-pack-v2-history-section { margin-top: 16px; padding: 15px; border: 1px solid #e3d5c1; border-radius: 7px; background: rgba(255, 255, 255, .55); }
.resource-pack-v2-panel .resource-library-summary > h4,
.resource-pack-v2-panel .resource-pack-v2-inventory-section > h4,
.resource-pack-v2-panel .resource-pack-v2-history-section > h4 { margin: 0 0 10px; }
.resource-pack-v2-history-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 9px 14px; }
.resource-pack-v2-history-item strong { color: var(--brown-dark); overflow-wrap: anywhere; }
.resource-pack-v2-history-item small { display: block; margin-top: 3px; color: var(--muted); overflow-wrap: anywhere; }
.resource-pack-v2-download-count { justify-self: end; padding: 5px 8px; border: 1px solid #d6bd99; border-radius: 999px; color: var(--brown-dark); font-size: 12px; white-space: nowrap; }
.resource-pack-v2-history-item .button { min-height: 38px; padding: 7px 11px; white-space: nowrap; }
.resource-pack-v2-history-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.resource-pack-v2-history-item .button-danger-outline { border-color: #b9473d; color: #a63830; background: #fffafa; }
.resource-pack-v2-history-item .button-danger-outline:hover:not(:disabled) { color: #fff; border-color: #a63830; background: #a63830; }
.legacy-resource-pack { padding: 0; overflow: hidden; }
.legacy-resource-pack-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 17px; cursor: pointer; list-style: none; }
.legacy-resource-pack-summary::-webkit-details-marker { display: none; }
.legacy-resource-pack-summary > span:first-child { display: grid; gap: 3px; }
.legacy-resource-pack-summary strong { color: var(--brown-dark); font-size: 15px; }
.legacy-resource-pack-summary small { color: var(--muted); font-size: 12px; }
.legacy-resource-pack-toggle { flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #d6bd99; border-radius: 50%; color: var(--rust); font-size: 20px; line-height: 1; }
.legacy-resource-pack[open] .legacy-resource-pack-summary { border-bottom: 1px solid #dfd1bd; }
.legacy-resource-pack[open] .legacy-resource-pack-toggle { font-size: 0; }
.legacy-resource-pack[open] .legacy-resource-pack-toggle::after { content: "−"; font-size: 20px; }
.legacy-resource-pack-content { padding: 0 clamp(15px, 2.4vw, 24px) 20px; }
.inventory-diff-summary { display: grid; gap: 8px; }
.inventory-diff-summary dl { margin: 0; }
.inventory-diff-summary .field-hint { margin: 0; }
.inventory-diff-paths { margin-top: 9px; border-top: 1px solid rgba(130, 102, 75, .16); }
.inventory-diff-paths summary { min-height: 40px; padding: 9px 0; color: var(--rust); font-weight: 600; cursor: pointer; }
.inventory-diff-paths ul { display: grid; gap: 5px; max-height: 240px; margin: 0; padding: 0 0 4px; overflow: auto; list-style: none; }
.inventory-diff-paths li { padding: 7px 8px; border: 1px solid #e3d5c1; border-radius: 4px; background: #fffdf8; font-size: 12px; overflow-wrap: anywhere; }
.inventory-diff-paths > small { display: block; padding: 3px 0 8px; color: var(--muted); }
.resource-pack-current { margin: 15px 0; padding: 14px; border: 1px solid #e3d5c1; border-radius: 6px; background: #f7f0e4; }
.resource-pack-current > small { display: block; margin-top: 8px; color: var(--muted); overflow-wrap: anywhere; }
.resource-pack-current-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.resource-pack-current-heading > strong { color: var(--brown-dark); overflow-wrap: anywhere; }
.resource-pack-sync-status { flex: 0 0 auto; padding: 3px 8px; border: 1px solid #d6bd99; border-radius: 999px; color: var(--brown-dark); font-size: 12px; }
.resource-pack-sync-status.is-confirmed { border-color: #91a777; background: #f1f5e9; }
.resource-pack-sync-status.is-pending { border-color: #ca9879; background: #faf0e9; }
.resource-pack-preview { margin-top: 16px; }
.resource-pack-preview-card { padding: 16px; border: 1px solid #d6bd99; border-radius: 6px; background: #f8f1e4; }
.resource-pack-preview-card.is-ready { border-color: #91a777; background: #f1f5e9; }
.resource-pack-preview-card.is-blocked { border-color: #ca9879; background: #faf0e9; }
.resource-pack-preview-card h4,
.resource-pack-history-section h4 { margin: 0 0 12px; color: var(--brown-dark); font: 600 18px/1.3 var(--serif); }
.resource-pack-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.resource-pack-metric { min-width: 0; padding: 10px 12px; border: 1px solid rgba(130, 102, 75, .18); border-radius: 5px; background: rgba(255, 255, 255, .56); }
.resource-pack-metric.is-primary { border-color: #b78358; background: #fffaf0; }
.resource-pack-metric.is-primary dd { color: var(--rust); font-size: clamp(21px, 4vw, 28px); }
.resource-pack-metric dt { color: var(--muted); font-size: 12px; line-height: 1.4; }
.resource-pack-metric dd { margin: 3px 0 0; color: var(--brown-dark); font: 600 18px/1.25 var(--mono); overflow-wrap: anywhere; }
.resource-pack-record-summary { margin-top: 12px; }
.resource-pack-record-summary .resource-pack-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.resource-pack-missing-details { margin-top: 9px; border-top: 1px solid rgba(130, 102, 75, .16); font-size: 12px; }
.resource-pack-missing-details > summary { min-height: 40px; padding: 9px 0; color: var(--rust); font-weight: 600; cursor: pointer; }
.resource-pack-missing-details ul { display: grid; gap: 7px; max-height: 280px; margin: 0; padding: 0 0 4px; overflow: auto; list-style: none; }
.resource-pack-missing-details li { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid #decbb2; border-radius: 4px; background: rgba(255, 255, 255, .65); }
.resource-pack-missing-details li strong { color: var(--brown-dark); }
.resource-pack-missing-details li small { color: var(--muted); overflow-wrap: anywhere; }
.resource-pack-gap-note { margin-bottom: 0; }
.resource-pack-outcome .resource-pack-record-summary { margin-top: 0; }
.resource-pack-audit-list { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(130, 102, 75, .2); }
.resource-pack-audit-list h5 { margin: 0 0 9px; color: var(--brown-dark); font-size: 15px; }
.resource-pack-date-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.resource-pack-date-list li { padding: 4px 8px; border: 1px solid #decbb2; border-radius: 4px; background: rgba(255, 255, 255, .65); font: 12px/1.5 var(--mono); overflow-wrap: anywhere; }
.mandatory-pack-rule-note { padding: 10px; border-left: 3px solid var(--rust); background: rgba(255, 255, 255, .55); }
.resource-pack-history-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid #e3d5c1; }
.resource-pack-history,
.admin-resource-pack-history { display: grid; gap: 8px; }
.resource-pack-version { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 16px; padding: 12px 0; border-top: 1px solid #e3d5c1; }
.resource-pack-version-copy strong { display: block; color: var(--brown-dark); overflow-wrap: anywhere; }
.resource-pack-version-copy small { display: block; margin-top: 3px; color: var(--muted); overflow-wrap: anywhere; }
.resource-pack-manifest { margin-top: 8px; font-size: 13px; }
.resource-pack-manifest summary { min-height: 40px; padding: 9px 0; color: var(--rust); font-weight: 600; cursor: pointer; }
.resource-pack-manifest ul { display: grid; gap: 5px; max-height: 300px; margin: 0; padding: 0 0 0 18px; overflow: auto; }
.resource-pack-manifest li { min-width: 0; overflow-wrap: anywhere; }
.resource-pack-manifest li small { display: block; font-size: 11px; }
.resource-pack-downloads { display: flex; flex-wrap: wrap; gap: 7px; }
.resource-pack-downloads .button { min-height: 42px; padding: 8px 12px; }
.resource-pack-admin-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.resource-pack-demo-builder { display: grid; gap: 10px; margin-top: 14px; padding-top: 13px; border-top: 1px solid #e3d5c1; }
.resource-pack-demo-panel { display: grid; gap: 10px; padding: 12px; border: 1px solid #dfd1bd; border-radius: 5px; background: #fbf8ef; }
.resource-pack-demo-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.resource-pack-demo-fields .field { margin: 0; }
.demo-pack-preview-card { display: grid; gap: 12px; }
.demo-pack-preview-card .resource-pack-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.demo-pack-file-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.demo-pack-file-list li { display: grid; gap: 2px; min-width: 0; padding: 8px 10px; border: 1px solid #e3d5c1; border-radius: 4px; background: rgba(255, 255, 255, .65); }
.demo-pack-file-list strong { overflow-wrap: anywhere; }
.demo-pack-file-list small { color: var(--muted); }
.demo-pack-acknowledgement { display: flex; align-items: flex-start; gap: 8px; color: var(--brown-dark); font-size: 13px; font-weight: 600; }
.demo-pack-acknowledgement input { flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--rust); }
.legacy-resource-section > h3 { margin-bottom: 10px; font-size: 18px; }
.legacy-resource-section .resource-list { margin-top: 0; }
.resource-pack-admin-card { grid-column: 1 / -1; }
.resource-pack-country-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.resource-pack-country-actions .is-active { border-color: var(--rust); color: var(--rust); }
.mandatory-day-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-height: 680px; margin: 8px 0 14px; overflow: auto; overscroll-behavior: contain; }
.mandatory-day { min-width: 0; padding: 12px; border: 1px solid #e3d5c1; border-radius: 5px; background: #fbf8ef; }
.mandatory-day-heading { display: grid; gap: 5px; color: var(--brown-dark); }
.mandatory-day-confirmed { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.mandatory-candidates { display: grid; gap: 7px; min-width: 0; margin: 9px 0; padding: 0; border: 0; }
.mandatory-candidates legend { margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.mandatory-candidate { display: flex; align-items: flex-start; gap: 8px; padding: 7px; border: 1px solid #e3d5c1; border-radius: 4px; background: #fffdf8; cursor: pointer; }
.mandatory-candidate span { display: grid; min-width: 0; gap: 2px; }
.mandatory-candidate strong { color: var(--brown-dark); font-size: 12px; }
.mandatory-candidate small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.mandatory-day > .button { width: 100%; min-height: 42px; }
.admin-resource-pack-current { margin-bottom: 12px; }
.admin-resource-pack-current h4 { margin: 12px 0 0; color: var(--brown-dark); }
.resource-catalog-card { grid-column: 1 / -1; }
.resource-catalog-upload-form { margin: 14px 0 20px; padding: 14px; border: 1px solid #e3d5c1; border-radius: 5px; background: #fbf8ef; }
.resource-catalog-upload-form > h4 { margin: 0; color: var(--brown-dark); font: 600 18px/1.3 var(--serif); }
.resource-catalog-upload-form > .field-hint { margin: 0; }
.resource-catalog-upload-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 10px; }
.resource-catalog-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 10px; }
.resource-catalog-upload-form[hidden] { display: none; }
.resource-catalog-filters > .button { min-height: var(--tap-size); }
.resource-catalog-list { display: grid; gap: 10px; max-height: 760px; margin: 10px 0; overflow: auto; overscroll-behavior: contain; }
.resource-catalog-item { min-width: 0; padding: 13px; border: 1px solid #e3d5c1; border-radius: 5px; background: #fbf8ef; }
.resource-catalog-item-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.resource-catalog-item-heading .admin-status { flex: 0 0 auto; }
.resource-catalog-item-heading > strong { min-width: 0; color: var(--brown-dark); overflow-wrap: anywhere; }
.resource-catalog-type { flex: 0 0 auto; padding: 3px 7px; border: 1px solid #d6bd99; border-radius: 999px; color: var(--rust); font-size: 11px; font-weight: 650; }
.resource-catalog-meta { display: block; margin-top: 6px; color: var(--muted); overflow-wrap: anywhere; }
.resource-catalog-item details { margin-top: 8px; }
.resource-catalog-item details summary { min-height: 36px; padding: 7px 0; color: var(--rust); font-size: 12px; font-weight: 600; cursor: pointer; }
.resource-catalog-readonly-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 14px; margin: 8px 0 0; }
.resource-catalog-readonly-details > div { min-width: 0; display: grid; grid-template-columns: minmax(95px, .35fr) minmax(0, 1fr); gap: 8px; padding-top: 6px; border-top: 1px solid rgba(130, 102, 75, .15); }
.resource-catalog-readonly-details dt { color: var(--muted); font-size: 11px; }
.resource-catalog-readonly-details dd { margin: 0; color: var(--brown-dark); font-size: 11px; overflow-wrap: anywhere; }
.resource-catalog-fields { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(120px, 1fr)) auto; align-items: end; gap: 10px; margin-top: 11px; }
.resource-catalog-published-choice { display: flex; align-items: center; gap: 7px; min-height: var(--tap-size); color: var(--brown-dark); font-size: 14px; font-weight: 600; }
.resource-catalog-published-choice input { width: 20px; height: 20px; accent-color: var(--rust); }
.resource-catalog-item > .button { margin-top: 8px; min-height: 42px; }
.resource-catalog-encryption { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.resource-catalog-encrypted-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border: 1px solid #d5b47b; border-radius: 999px; background: #f7edda; color: #72521e; font-size: 11px; font-weight: 700; line-height: 1.3; }
.resource-catalog-encryption code { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.resource-catalog-encrypted-hint { flex-basis: 100%; color: var(--muted); font-size: 12px; line-height: 1.45; }
.resource-catalog-encryption.is-compact { display: inline-flex; gap: 5px; margin: 1px 0; vertical-align: middle; }
.resource-catalog-encryption.is-compact .resource-catalog-encrypted-badge { padding: 2px 6px; font-size: 10px; }
.resource-catalog-encryption.is-compact code { font-size: 10px; }
.resource-catalog-item > .button.resource-catalog-encrypted-action { color: var(--muted); border-color: #d8c5a8; background: #f5efe3; cursor: not-allowed; opacity: 1; }
.resource-catalog-audio { display: block; width: 100%; margin: 8px 0; }
.resource-group-chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 38px; }
.resource-group-chip { min-height: 40px; padding: 8px 12px; border: 1px solid #d8c5a8; border-radius: 999px; background: #fbf8ef; color: var(--brown-dark); font: inherit; font-size: 13px; cursor: pointer; }
.resource-group-chip:hover, .resource-group-chip:focus-visible { border-color: var(--rust); outline: 2px solid color-mix(in srgb, var(--rust) 25%, transparent); }
.resource-group-chip.is-removed { background: #f7e7e2; color: #853b32; text-decoration: line-through; }
.resource-catalog-item-message { min-height: 0; margin: 4px 0; }

@media (max-width: 760px) {
  .resource-pack-v2-result-actions .resource-pack-v2-fields { flex-basis: 100%; }
  .resource-pack-v2-result-actions .field { max-width: none; }
  .resource-pack-v2-fields,
  .resource-pack-v2-status-metrics,
  .resource-pack-v2-cleanup-storage,
  .resource-pack-v2-inventory-metrics,
  .resource-pack-v2-preview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resource-pack-v2-month-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legacy-resource-pack-summary { align-items: flex-start; padding: 13px 12px; }
  .resource-pack-steps { grid-template-columns: minmax(0, 1fr); }
  .resource-source-summary dl,
  .resource-source-summary-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resource-pack-compare-sections { grid-template-columns: minmax(0, 1fr); }
  .resource-pack-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-pack-preview-card .resource-pack-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resource-pack-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .device-csv-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .device-report-meta,
  .inventory-diff-summary dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .year-pack-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .year-pack-fields > .button { grid-column: 1 / -1; }
  .resource-pack-record-summary .resource-pack-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mandatory-day-list { grid-template-columns: minmax(0, 1fr); max-height: 56vh; }
  .resource-catalog-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resource-catalog-upload-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resource-catalog-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .resource-library-heading { align-items: flex-start; }
  .resource-library-heading .button { flex: 0 0 auto; }
  .resource-library-summary,
  .resource-pack-v2-inventory-section,
  .resource-pack-v2-history-section { padding: 12px; }
  .resource-library-create-entry { align-items: stretch; flex-direction: column; padding: 14px; }
  .resource-library-create-entry .button { width: 100%; }
  .resource-pack-step { min-height: 50px; padding: 9px 10px; }
  .resource-source-option { grid-template-columns: auto minmax(0, 1fr); align-items: start; padding: 10px; }
  .resource-source-option .resource-source-selected { grid-column: 2; justify-self: start; }
  .resource-source-summary { padding: 10px; }
  .resource-source-summary dl,
  .resource-source-summary-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resource-pack-compare-section { padding: 10px; }
  .resource-pack-v2-panel { padding: 13px 11px; }
  .resource-pack-v2-panel > .section-heading { align-items: flex-start; }
  .resource-pack-v2-panel > .section-heading .button { flex: 0 0 auto; }
  .resource-pack-v2-fields,
  .resource-pack-v2-status-metrics,
  .resource-pack-v2-inventory-metrics,
  .resource-pack-v2-preview-metrics,
  .resource-pack-v2-detail-list,
  .resource-pack-v2-missing-years { grid-template-columns: minmax(0, 1fr); }
  .resource-pack-v2-history-item { grid-template-columns: minmax(0, 1fr); }
  .resource-pack-v2-history-actions { justify-content: flex-start; }
  .resource-pack-v2-download-count { justify-self: start; }
  .resource-catalog-readonly-details { grid-template-columns: minmax(0, 1fr); }
  .resource-pack-v2-month-grid { grid-template-columns: minmax(0, 1fr); padding-inline: 7px; }
  .resource-pack-v2-month { padding: 9px; }
  .legacy-resource-pack-content { padding-inline: 12px; }
  .resource-pack-compare-table-wrap,
  .resource-pack-preview-table-wrap,
  .resource-source-table-wrap { max-height: 48vh; }
  .resource-pack-fields { grid-template-columns: minmax(0, 1fr); }
  .resource-pack-demo-fields,
  .demo-pack-preview-card .resource-pack-metrics { grid-template-columns: minmax(0, 1fr); }
  .resource-pack-metrics { grid-template-columns: minmax(0, 1fr); }
  .device-csv-meta { grid-template-columns: minmax(0, 1fr); }
  .device-report-meta,
  .inventory-diff-summary dl,
  .year-pack-fields { grid-template-columns: minmax(0, 1fr); }
  .device-report-heading { align-items: stretch; }
  .device-report-heading .button { flex: 0 0 auto; }
  .resource-pack-version { grid-template-columns: minmax(0, 1fr); }
  .resource-pack-record-summary .resource-pack-metrics { grid-template-columns: minmax(0, 1fr); }
  .resource-pack-downloads { width: 100%; }
  .resource-pack-downloads .button { flex: 1 1 130px; }
  .resource-pack-current-heading { align-items: stretch; }
  .resource-catalog-filters,
  .resource-catalog-upload-fields,
  .resource-catalog-fields { grid-template-columns: minmax(0, 1fr); }
  .resource-catalog-item-heading { flex-direction: column; }
}
.member-intro .dashboard-intro > h1 { font-family: var(--sans); font-weight: 650; }
#view-devices { margin-top: 18px; padding-top: 22px; }
#view-devices .section-note,
.section-note { margin: 5px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
#view-devices .section-head { align-items: flex-end; margin-bottom: 16px; }
#view-devices .section-head > div { min-width: 0; }

#deviceList { align-items: stretch; }
.device-entry { min-height: 118px; padding: 16px 18px; align-items: stretch; }
.device-entry-main { display: flex; flex: 1 1 auto; min-width: 0; flex-direction: column; justify-content: space-between; gap: 14px; }
.device-entry-id { display: block; color: var(--brown-dark); font-size: clamp(17px, 2vw, 20px); line-height: 1.35; font-weight: 600; }
.device-entry-details { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: end; }
.device-entry-fact { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.device-entry-fact small,
.device-entry-bound { color: var(--muted); font: 12px/1.4 var(--sans); }
.device-entry-fact strong { color: var(--brown-dark); font: 600 14px/1.35 var(--sans); overflow-wrap: anywhere; }
.device-entry-bound { flex-basis: 100%; }
.device-entry .entry-arrow { align-self: center; }

.admin-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 20px 0 16px; }
.admin-metrics .metric-card { min-height: 120px; padding: 17px 18px 16px; }
.admin-metrics .metric-top { gap: 8px; align-items: flex-start; font-size: 11px; letter-spacing: .04em; }
.admin-metrics .metric-top span:first-child { font-family: var(--sans); font-weight: 650; }
.admin-metrics .metric-top span:last-child { font-size: 11px; }
.admin-metrics .metric-card strong { margin-top: 10px; font-family: var(--mono); font-size: clamp(25px, 3vw, 33px); font-variant-numeric: tabular-nums; }
.admin-metrics .metric-card small { font-size: 12px; }
.admin-chart-card { margin: 18px 0 20px; padding: clamp(18px, 3vw, 26px); }
.admin-chart-card .section-heading { align-items: center; margin-bottom: 8px; }
.admin-chart-card .section-heading h2 { max-width: 34ch; font-size: clamp(20px, 3vw, 26px); }
.admin-chart-card .eyebrow { margin: 0 0 4px; }
.chart-total { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: var(--muted); font-size: 12px; }
.chart-total strong { color: var(--brown-dark); font: 600 24px/1.1 var(--mono); font-variant-numeric: tabular-nums; }
.admin-note { max-width: 78ch; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.admin-order-chart { margin-top: 16px; }
.chart-bars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(8px, 2vw, 22px); align-items: end; min-height: 172px; margin: 0; padding: 7px 0 0; list-style: none; border-bottom: 1px solid #dfd1bd; }
.chart-month { display: grid; grid-template-rows: 22px minmax(96px, 1fr) 24px; justify-items: center; align-items: end; min-width: 0; text-align: center; }
.chart-value { color: var(--brown-dark); font: 600 13px/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.chart-bar-track { display: flex; width: min(100%, 54px); height: 100%; align-items: end; justify-content: center; border-radius: 4px 4px 0 0; background: rgba(218, 202, 180, .24); }
.chart-bar { display: block; width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #bd8659, #80533b); }
.chart-month-label { align-self: center; color: var(--muted); font-size: 12px; line-height: 1.2; }

.admin-tabs { display: flex; gap: 7px; margin: 24px 0 12px; padding: 0 0 8px; overflow-x: auto; border-bottom: 1px solid #dfd1bd; scrollbar-width: thin; }
.admin-tab { flex: 0 0 auto; min-width: 120px; min-height: 46px; padding: 10px 16px; border: 1px solid transparent; border-radius: 6px 6px 0 0; background: transparent; color: var(--muted); font: 600 14px/1.3 var(--sans); cursor: pointer; }
.admin-tab:hover { background: rgba(251, 248, 239, .76); color: var(--brown-dark); }
.admin-tab.is-active { border-color: #dfd1bd; border-bottom-color: var(--paper-light); background: var(--paper-light); color: var(--brown-dark); box-shadow: 0 3px 0 var(--rust); }
.admin-registry { padding: clamp(16px, 3vw, 25px); }
.registry-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; min-width: 0; margin-bottom: 14px; }
.registry-heading h2 { margin: 0; color: var(--brown-dark); font-size: clamp(21px, 3vw, 27px); line-height: 1.2; overflow-wrap: anywhere; }
.registry-heading .eyebrow { margin: 0 0 5px; }
.admin-search { display: grid; grid-template-columns: auto minmax(180px, 340px); justify-content: space-between; gap: 12px; align-items: center; margin: 12px 0 15px; color: var(--muted); font-size: 13px; }
.admin-search input { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #d8c8b3; border-radius: 5px; background: #fffdf8; color: var(--ink); font: 14px var(--sans); }
.admin-table-wrap { width: 100%; min-width: 0; overflow-x: auto; border-top: 1px solid #e3d5c1; scrollbar-width: thin; }
.admin-table { width: 100%; min-width: 850px; border-collapse: collapse; text-align: left; }
.admin-table th { padding: 11px 12px; color: var(--muted); background: rgba(244, 238, 223, .72); font: 600 11px/1.3 var(--sans); letter-spacing: .02em; white-space: nowrap; }
.table-sort-button { padding: 0; border: 0; color: inherit; background: transparent; font: inherit; cursor: pointer; }
.table-sort-button:hover, .table-sort-button:focus-visible { color: var(--brown-dark); text-decoration: underline; }
.issued-code { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 3px; }
.issued-code code { max-width: 100%; overflow-wrap: anywhere; padding: 6px 8px; border-radius: 5px; background: rgba(244, 238, 223, .85); color: var(--brown-dark); }
.admin-table td { padding: 13px 12px; border-top: 1px solid #ece2d4; color: var(--ink); font-size: 13px; line-height: 1.45; vertical-align: top; }
.admin-table tbody tr:hover { background: rgba(248, 242, 230, .62); }
.admin-table .id-text { display: inline-block; max-width: 230px; color: var(--brown-dark); font-size: 12px; }
.table-email { display: inline-block; max-width: 270px; color: var(--brown-dark); font: 600 13px/1.45 var(--sans); overflow-wrap: anywhere; }
.binding-stack { display: grid; gap: 7px; min-width: 160px; }
.binding-item { display: grid; gap: 2px; padding-left: 9px; border-left: 2px solid #c59167; }
.binding-item strong { color: var(--brown-dark); font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.binding-item small,.cell-subtext { color: var(--muted); font-size: 11px; line-height: 1.4; }
.count-summary { display: inline-grid; grid-template-columns: auto auto; gap: 1px 5px; align-items: baseline; white-space: nowrap; }
.count-summary > strong,.numeric-value { color: var(--brown-dark); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.count-summary > small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.latest-order-summary { display: grid; gap: 3px; min-width: 130px; color: var(--muted); font-size: 11px; }
.latest-order-summary span:first-child { color: var(--brown-dark); overflow-wrap: anywhere; }
.numeric-value { font-size: 13px; }
.cell-unit { display: block; color: var(--muted); font-size: 11px; }
.table-action { min-height: 40px; padding: 7px 10px; border: 1px solid #d8c8b3; border-radius: 5px; background: #fffaf1; color: var(--rust); font: 600 12px/1.3 var(--sans); cursor: pointer; white-space: nowrap; }
.table-action:hover { border-color: var(--rust); background: #f9efd9; }
.admin-status,.account-status { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 9px; border: 1px solid #d9c9b2; border-radius: 99px; color: #537365; font-size: 11px; line-height: 1.2; white-space: nowrap; }
.admin-status.is-pending { color: #8d6540; }
.admin-status.is-confirmed { color: #537365; }
.account-status { color: var(--brown); }
.admin-empty { padding: 22px 0; }
.admin-pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.admin-pagination > span { color: var(--muted); font: 12px/1.4 var(--mono); font-variant-numeric: tabular-nums; text-align: center; }
.admin-pagination .button { min-height: 42px; }
.admin-pagination .button:disabled { opacity: .5; cursor: not-allowed; }
.admin-presence-card { margin: 20px 0; padding: clamp(16px, 2.5vw, 24px); }
.admin-presence-card .section-heading { align-items: center; margin-bottom: 8px; }
.admin-presence-card .section-note { margin: 0 0 14px; }
.presence-map-shell { border: 1px solid #cbded9; border-radius: 14px; overflow: hidden; background: #f5faf7; }
.presence-map-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px; background: #f0f6f1; border-bottom: 1px solid #d8e5dd; }
.presence-map-views, .presence-map-zoom { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.presence-map-toolbar button { min-height: 34px; padding: 5px 12px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #3e665e; font: 600 12px/1.2 var(--sans); cursor: pointer; }
.presence-map-toolbar button:hover, .presence-map-toolbar button:focus-visible { background: #e0eee7; outline-color: #438375; }
.presence-map-toolbar button[aria-pressed="true"] { background: #226a5d; color: #fff; }
.presence-map-toolbar button:disabled { opacity: .4; cursor: default; }
.presence-map-zoom button { width: 34px; padding: 0; border-color: #cadbd3; background: #fff; font-size: 18px; }
.presence-map { position: relative; overflow: hidden; aspect-ratio: 2/1; min-height: 260px; background: #d5e9e7; }
.presence-map-vector { position: absolute; inset: 0; }
.presence-map .maplibregl-map { width: 100%; height: 100%; }
.presence-map .maplibregl-control-container { font-family: var(--sans); }
.presence-map .maplibregl-ctrl-attrib { max-width: min(70vw, 560px); color: #4c6e67; }
.presence-map svg { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.presence-map svg:active { cursor: grabbing; }
.presence-map svg:focus-visible { outline: 3px solid #226a5d; outline-offset: -3px; }
.presence-map-grid path { stroke: rgba(255, 255, 255, .65); stroke-width: .75; fill: none; }
.presence-map-grid-labels text { fill: #47716e; font: 11px/1 var(--mono); opacity: .88; pointer-events: none; }
.presence-city { cursor: pointer; }
.presence-city-target { fill: transparent; }
.presence-city-dot { fill: #225f68; stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.presence-city-label { fill: #1f4850; font-weight: 700; paint-order: stroke; stroke: #e9f5f2; stroke-width: 2.5px; stroke-linejoin: round; pointer-events: none; }
.presence-city:hover .presence-city-dot, .presence-city.is-selected .presence-city-dot { fill: #073f48; stroke: #ffe6a9; stroke-width: 2.5; }
.presence-map-device { cursor: pointer; }
.presence-map-device-halo { fill: rgba(196, 79, 38, .26); }
.presence-map-device-dot { fill: #bd4e2c; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.presence-map-device:hover .presence-map-device-dot, .presence-map-device.is-selected .presence-map-device-dot { fill: #8b3219; stroke: #ffe6a9; }
.presence-map-device-count { fill: #742e1c; font-weight: 800; paint-order: stroke; stroke: #fff5e8; stroke-width: 2.5px; pointer-events: none; }
.presence-map-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; padding: 9px 12px; color: #4c6e67; font-size: 11px; border-top: 1px solid #d8e5dd; }
.presence-map-legend { display: inline-flex; align-items: center; gap: 6px; }
.presence-map-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #225f68; }
.presence-map-device-legend i { background: #bd4e2c; }
.presence-map-attribution { margin-left: auto; color: #718b84; }
.presence-map-info { min-height: 20px; margin: 0; padding: 8px 12px 2px; color: #244f49; font-size: 12px; font-weight: 650; }
.presence-city-list { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px 12px; scrollbar-width: thin; }
.presence-city-chip { display: inline-flex; flex: 0 0 auto; flex-direction: column; gap: 2px; min-width: 108px; padding: 7px 9px; border: 1px solid #d4e2da; border-radius: 8px; background: #fff; color: #31574f; text-align: left; cursor: pointer; }
.presence-city-chip:hover, .presence-city-chip:focus-visible, .presence-city-chip.is-selected { border-color: #4d8d7c; background: #e7f3ed; }
.presence-city-chip strong { font-size: 11px; }
.presence-city-chip span { color: #69847e; font: 10px/1.2 var(--mono); }
@media (max-width: 620px) {
  .presence-map-toolbar { align-items: stretch; }
  .presence-map-views { gap: 2px; }
  .presence-map-toolbar button { min-height: 32px; padding: 4px 8px; font-size: 10px; }
  .presence-map-zoom { flex-wrap: nowrap; }
  .presence-map-zoom button { width: 29px; }
  .presence-map-footer { gap: 6px 12px; }
  .presence-map-attribution { width: 100%; margin-left: 0; }
}
.presence-summary { margin: 12px 0; color: var(--brown-dark); font-size: 13px; font-weight: 600; }
.presence-list { max-height: 310px; overflow: auto; }
.presence-list .admin-table { min-width: 1020px; }
.presence-list .admin-table td .cell-subtext { display: block; }
.admin-tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.admin-tool-grid .form-card { padding: clamp(16px, 2.5vw, 23px); }
.admin-tool-grid .section-heading { align-items: center; margin-bottom: 16px; }
.admin-tool-grid .section-heading h3 { margin: 0; color: var(--brown-dark); font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.admin-tool-grid .form-stack { gap: 12px; }
.admin-grant-history { margin-top: 20px; padding-top: 15px; border-top: 1px solid #e3d5c1; }
.admin-grant-history h4 { margin: 0 0 8px; color: var(--brown-dark); font-size: 15px; }
.admin-grant-history .admin-row { align-items: flex-start; padding: 10px 0; }
.admin-grant-history .row-copy { overflow-wrap: anywhere; }
.admin-grant-history .row-copy strong { font-size: 12px; }
.admin-grant-history .row-copy small { white-space: normal; overflow-wrap: anywhere; }
.admin-detail-modal { width: min(1000px, calc(100vw - 24px)); max-width: 1000px; max-height: min(90vh, 1000px); overflow-y: auto; }
.admin-detail-modal > h2 { max-width: calc(100% - 60px); margin-top: 0; overflow-wrap: anywhere; }
.admin-detail-modal .modal-close { top: 7px; right: 7px; display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid #c7ae91; border-radius: 50%; background: #fffaf1; color: #573c2c; font: 600 30px/1 var(--sans); cursor: pointer; }
.admin-detail-modal .modal-close:hover { border-color: #8f472f; background: #f2e4d1; color: #783b28; }
.admin-detail-modal .modal-close:focus-visible { outline: 3px solid #a05b3c; outline-offset: 2px; }
.admin-detail-modal > .eyebrow { margin: 0 0 5px; }
.admin-detail-content { display: grid; gap: 18px; margin-top: 18px; }
.admin-reuse-reset { border: 1px solid #d7dfe0; border-radius: 12px; background: #f5f8f8; padding: 1rem; }
.admin-reuse-reset > p { margin: 0 0 .65rem; }
.admin-reuse-reset details { margin-top: .65rem; }
.admin-reuse-reset summary { cursor: pointer; font-weight: 650; color: #24485a; }
.admin-reuse-reset ol { margin: .6rem 0; padding-left: 1.5rem; line-height: 1.6; }
.admin-reuse-reset li small { display: block; color: var(--muted); }
.admin-reuse-reset .field { display: grid; gap: .35rem; max-width: 24rem; margin: .75rem 0; }
.admin-reuse-reset .field input, .admin-reuse-reset .field select { width: 100%; }
.admin-reuse-warning { margin: .8rem 0; padding: .8rem 1rem; border-left: 4px solid #a44935; background: #fff0e9; color: #702f23; font-weight: 700; line-height: 1.55; }
.admin-reuse-firmware-notice { margin: .8rem 0; padding: .8rem 1rem; border: 1px solid #cfb985; border-left: 4px solid #a67824; background: #fff7df; color: #553d1c; line-height: 1.55; }
.admin-reuse-firmware-notice strong { display: block; overflow-wrap: anywhere; }
.admin-reuse-firmware-notice p { margin: .25rem 0 0; }
.admin-reuse-firmware-notice.is-blocked { border-color: #c78678; border-left-color: #a3332a; background: #fff0ed; color: #70261e; }
.admin-reuse-firmware-confirm { display: flex; gap: .65rem; align-items: flex-start; margin: 1rem 0; padding: .8rem 1rem; border: 1px solid #d1bea4; background: #fffaf1; line-height: 1.5; }
.admin-reuse-firmware-confirm input { width: 20px; height: 20px; min-height: 20px; flex: 0 0 20px; margin: .1rem 0 0; }
.admin-reuse-firmware-blocked { margin: .9rem 0; padding: .75rem 1rem; border: 1px solid #c78678; background: #fff0ed; color: #70261e; font-weight: 700; line-height: 1.5; }
.admin-detail-section { min-width: 0; }
.admin-detail-section h3 { margin: 0 0 9px; color: var(--brown-dark); font: 600 19px/1.25 var(--sans); }
.admin-detail-section .admin-table { min-width: 580px; }
.admin-detail-section .admin-table-wrap { border: 1px solid #e3d5c1; border-radius: 5px; }
.admin-detail-section .admin-table th { background: rgba(244, 238, 223, .52); }
.admin-detail-section .admin-table td { padding: 10px 11px; }
.profile-modal { width: min(620px, calc(100vw - 24px)); max-width: 620px; max-height: min(90vh, 900px); overflow-y: auto; }
.profile-modal > .eyebrow { margin: 0 0 4px; }
.profile-modal h2 { margin: 0 34px 8px 0; color: var(--brown-dark); font-size: clamp(25px, 5vw, 32px); }
.profile-modal #profileSummary { margin: 0 0 18px; }
.profile-modal .form-stack { gap: 13px; }
.profile-modal textarea { resize: vertical; }
.profile-modal .field[hidden] { display: none !important; }
.admin-profile-table { width: 100%; border-collapse: collapse; }
.admin-profile-table th,.admin-profile-table td { padding: 10px 12px; border-top: 1px solid #e8dccb; text-align: left; vertical-align: top; line-height: 1.5; overflow-wrap: anywhere; }
.admin-profile-table th { width: 180px; color: var(--muted); font-size: 12px; font-weight: 600; }
.admin-profile-table td { color: var(--brown-dark); font-size: 13px; white-space: pre-wrap; }
.admin-profile-table tr:first-child > * { border-top: 0; }
[data-admin-panel][hidden] { display: none !important; }

/* Final readability pass: lift small legacy type and make the main actions scan clearly. */
body { font-size: 16px; line-height: 1.6; }
.field { gap: 8px; font-size: 14px; line-height: 1.4; }
.field input, .field select, .field textarea { min-height: 48px; padding: 11px 13px; font-size: 16px; line-height: 1.4; }
.field textarea { min-height: 96px; }
.field-hint, .fine-print, .empty-inline, .empty-card { font-size: 14px; line-height: 1.55; }
.button { min-height: 46px; padding-inline: 17px; font-size: 14px; line-height: 1.3; }
.text-button, .mini-button, .table-action { font-size: 13px; }
.section-heading h2, .device-section-panel > h3, .detail-history h3 { line-height: 1.3; }
.dashboard-intro { max-width: 78ch; }
.dashboard-intro > h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.15; letter-spacing: -.025em; }

/* Device view: clear summary, then two equally visible destinations. */
#deviceList { gap: 14px; }
.device-entry { min-height: 126px; border-radius: 12px; box-shadow: 0 3px 12px rgba(76, 53, 35, .045); transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.device-entry:hover { transform: translateY(-1px); }
.device-entry-fact small, .device-entry-bound { font-size: 13px; line-height: 1.45; }
.device-entry-fact strong { font-size: 15px; }
.device-expanded { margin-top: 16px; padding: clamp(18px, 3vw, 30px); border-radius: 14px; box-shadow: 0 10px 30px rgba(76, 53, 35, .06); }
.device-expanded-header { padding-bottom: 17px; border-bottom: 1px solid #e3d5c1; }
.device-expanded-header h2, .resource-inline-heading h2 { font-size: clamp(22px, 3vw, 30px); line-height: 1.2; letter-spacing: -.02em; }
.device-detail-stats { gap: 12px; margin: 20px 0; }
.device-detail-stats > div { padding: 15px; border-radius: 9px; }
.device-detail-stats span, .device-detail-stats .device-report-note { font-size: 14px; line-height: 1.5; }
.device-detail-stats strong { font-size: 20px; }
.device-detail-actions { gap: 10px; margin: 20px 0 24px; padding: 5px; border: 1px solid #e2d4c1; border-radius: 11px; background: #f3ecdf; }
.device-detail-actions .button { min-height: 48px; flex: 1 1 0; border-radius: 8px; }
.device-detail-actions .button-outline { border-color: transparent; background: transparent; }
.device-detail-actions .button[aria-selected="true"] { box-shadow: 0 2px 8px rgba(76, 53, 35, .12); }
.detail-history { margin-top: 24px; padding-top: 22px; }
.resource-inline { max-height: none; overflow: visible; }

/* Purchase cards use a consistent reading order and comfortable tap targets. */
.product-grid { gap: 14px; }
.product-card { min-height: 230px; padding: 22px; border-radius: 11px; }
.product-card.featured { transform: none; }
.product-card .eyebrow { margin-bottom: 12px; font-size: 11px; letter-spacing: .07em; }
.product-card h3 { font-size: 22px; line-height: 1.25; }
.product-duration { font-size: 29px; line-height: 1.2; }
.product-price { font-size: 17px; }
.product-note { margin-bottom: 16px; font-size: 13px; line-height: 1.5; }
.product-badge { font: 600 10px/1.2 var(--sans); letter-spacing: .04em; }
.fine-print { text-align: start; }

/* Resource builder: present selection controls as a short sequence with readable summaries. */
.resource-pack-v2-panel { padding: clamp(16px, 2.4vw, 24px); border-radius: 12px; }
.resource-library-summary, .resource-pack-v2-inventory-section, .resource-pack-v2-history-section { padding: 17px; border-radius: 10px; }
.resource-library-create-entry { padding: 20px; border-radius: 10px; }
.resource-library-create-entry strong { font-size: 20px; }
.resource-library-create-entry p { font-size: 14px; line-height: 1.5; }
.resource-library-heading h3, .resource-library-builder-header h3, .resource-pack-v2-panel .section-heading h3 { font-size: clamp(21px, 2.6vw, 26px); line-height: 1.25; }
.resource-pack-v2-panel h4 { margin-top: 21px; font-size: 18px; line-height: 1.35; }
.resource-pack-v2-metric { padding: 13px 14px; border-radius: 8px; }
.resource-pack-v2-metric dt, .resource-pack-v2-detail-list dt, .resource-pack-v2-row-heading span, .resource-pack-v2-row-meta { font-size: 13px; line-height: 1.45; }
.resource-pack-v2-metric dd { font-size: 17px; }
.resource-pack-v2-detail-list dd { font-size: 14px; line-height: 1.5; }
.resource-pack-v2-row, .resource-pack-v2-history-item { padding: 14px; border-radius: 8px; }
.resource-pack-v2-row-heading strong, .resource-pack-v2-history-item strong { font-size: 15px; line-height: 1.4; }
.resource-pack-v2-row details summary, .resource-library-disclosure > summary { min-height: 44px; font-size: 14px; }
.resource-pack-v2-year { border-radius: 8px; }
.resource-pack-v2-year > summary { min-height: 50px; padding: 12px 15px; font-size: 15px; }
.resource-pack-v2-year > summary span { font-size: 14px; }
.resource-pack-v2-month-grid { gap: 10px; padding-inline: 12px; }
.resource-pack-v2-month { padding: 12px; border-radius: 7px; }
.resource-pack-v2-month h5 { font-size: 15px; }
.resource-pack-v2-month-empty { font-size: 14px; }
.resource-pack-v2-candidate { min-height: 48px; align-items: flex-start; padding: 10px; border-radius: 7px; }
.resource-pack-v2-candidate-copy strong { font-size: 14px; line-height: 1.45; }
.resource-pack-v2-candidate-copy small { font-size: 13px; line-height: 1.45; }
.resource-group-chip { min-height: 44px; font-size: 14px; }
.resource-pack-v2-preview-section { padding: 17px; border-radius: 10px; }
.resource-pack-v2-preview-card { padding: 15px; border-radius: 8px; }
.resource-pack-v2-missing-years strong { font-size: 13px; }
.resource-pack-v2-history-item small, .resource-pack-v2-conflicts small { font-size: 13px; line-height: 1.45; }

/* Admin data stays compact on desktop while controls and metadata remain readable. */
.admin-metrics .metric-top, .admin-metrics .metric-top span:last-child { font-size: 13px; }
.admin-metrics .metric-card small, .admin-note, .presence-summary { font-size: 14px; line-height: 1.5; }
.admin-table th { font-size: 12px; }
.admin-table td { font-size: 14px; line-height: 1.5; }
.admin-table .id-text, .table-email { font-size: 13px; }
.binding-item strong, .latest-order-summary, .count-summary > small, .cell-unit { font-size: 13px; }
.binding-item small, .cell-subtext { font-size: 12px; line-height: 1.45; }
.admin-status, .account-status { min-height: 30px; font-size: 13px; }
.resource-catalog-item { padding: 16px; border-radius: 9px; }
.resource-catalog-meta { font-size: 14px; line-height: 1.5; }
.resource-catalog-type { font-size: 13px; }
.resource-catalog-item details summary { min-height: 44px; font-size: 14px; }
.resource-catalog-readonly-details dt, .resource-catalog-readonly-details dd { font-size: 13px; line-height: 1.45; }

@media (max-width: 760px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-card { min-height: 218px; padding: 17px 15px; }
  .resource-pack-v2-panel { padding: 16px; }
  .resource-pack-v2-month-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .topbar { gap: 8px; }
  .brand-name { font-size: 20px; }
  .account-tools #userEmail { max-width: 34vw; font-size: 12px; }
  .dashboard-intro > h1 { font-size: clamp(28px, 8vw, 36px); }
  #view-devices { margin-top: 14px; padding-top: 18px; }
  .device-entry { min-height: 108px; padding: 15px; border-radius: 10px; }
  .device-entry-id { font-size: 17px; }
  .device-entry-details { gap: 8px 12px; }
  .device-expanded { padding: 16px 13px; border-radius: 11px; }
  .device-expanded-header, .resource-inline-heading { gap: 8px; }
  .device-expanded-header .button, .resource-inline-heading .button { padding-inline: 11px; }
  .device-detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .device-detail-stats > div { padding: 11px; }
  .device-detail-stats .subscription-stat { grid-column: 1 / -1; }
  .device-detail-actions { margin: 16px 0 20px; }
  .device-detail-actions .button { min-width: 0; padding-inline: 8px; font-size: 13px; }
  .product-grid { grid-template-columns: minmax(0, 1fr); }
  .product-card { min-height: 0; padding: 18px; }
  .product-card .button { margin-top: 12px; }
  .resource-pack-v2-panel { padding: 14px 12px; }
  .resource-pack-v2-manual-dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); border-radius: 10px; }
  .resource-pack-v2-manual-dialog-content { max-height: calc(100dvh - 14px); }
  .resource-pack-v2-manual-header { padding: 13px 13px 10px; }
  .resource-pack-v2-manual-header h3 { font-size: 19px; }
  .resource-pack-v2-manual-scope { padding-inline: 13px; font-size: 13px; }
  .resource-pack-v2-manual-hint { margin-inline: 13px; }
  .resource-pack-v2-manual-toolbar { align-items: flex-start; padding: 10px 13px; }
  .resource-pack-v2-manual-toolbar > div { width: 100%; }
  .resource-pack-v2-manual-toolbar .button { flex: 1 1 auto; }
  .resource-pack-v2-manual-items { max-height: min(48dvh, 420px); padding-inline: 13px; }
  .resource-pack-v2-manual-footer { padding-inline: 13px; }
  .resource-library-summary, .resource-pack-v2-inventory-section, .resource-pack-v2-history-section { padding: 13px; }
  .resource-library-create-entry { padding: 15px; }
  .resource-pack-v2-month-grid { grid-template-columns: minmax(0, 1fr); padding-inline: 8px; }
  .resource-pack-v2-fields, .resource-pack-v2-status-metrics, .resource-pack-v2-cleanup-storage, .resource-pack-v2-inventory-metrics, .resource-pack-v2-preview-metrics, .resource-pack-v2-detail-list, .resource-pack-v2-missing-years { grid-template-columns: minmax(0, 1fr); }
  .resource-pack-v2-form > .button, .resource-pack-v2-preview-section > .button { width: 100%; }
  .resource-pack-v2-history-item { grid-template-columns: minmax(0, 1fr); }
  .resource-pack-v2-download-count { justify-self: start; }
  .resource-catalog-item { padding: 13px; }
  .admin-metrics .metric-top, .admin-metrics .metric-top span:last-child { font-size: 11px; }
  .admin-metrics .metric-card small { font-size: 12px; }
  .admin-table td::before { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .device-entry { transition: none; }
  .device-entry:hover { transform: none; }
}

/* Device registry uses stable rows so the list remains easy to scan as it grows. */
#deviceList.device-list-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0; border-top: 1px solid #ded1bf; }
.device-row-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; min-width: 0; padding: 15px 16px; border-bottom: 1px solid #ded1bf; background: rgba(251, 248, 239, .56); transition: background .15s ease; }
.device-row-item:hover, .device-row-item.is-selected { background: #f6efdf; }
.device-row-columns { display: grid; grid-template-columns: minmax(210px, 1.8fr) repeat(3, minmax(120px, 1fr)); align-items: center; gap: 15px; min-width: 0; }
.device-row-id, .device-row-field { display: grid; gap: 4px; min-width: 0; }
.device-row-label { color: var(--muted); font-size: 13px; line-height: 1.35; }
.device-row-id strong, .device-row-field strong { color: var(--brown-dark); font-size: 15px; line-height: 1.4; font-weight: 650; overflow-wrap: anywhere; }
.device-row-id strong { font-size: 16px; }
.device-row-manage { min-width: 118px; min-height: 46px; justify-content: space-between; gap: 10px; white-space: nowrap; }
.device-details-slot { min-width: 0; }
.device-details-slot:empty { display: none; }
.device-details-slot > .device-expanded { margin-top: 16px; }
#deviceList > .empty-inline { margin: 0; }

/* Profile editing is a form, so group short fields and give the close control a clear target. */
.profile-modal { padding: 32px; border-radius: 14px; }
.profile-modal > form:first-child { position: static; }
.profile-modal .modal-close { position: absolute; top: 14px; right: 14px; z-index: 2; display: grid; place-items: center; width: 48px; min-width: 48px; height: 48px; min-height: 48px; padding: 0; border: 1px solid #bca78d; border-radius: 50%; background: #f2e7d5; color: #5d3928; font: 400 30px/1 var(--sans); box-shadow: 0 2px 8px rgba(63, 43, 29, .14); cursor: pointer; }
.profile-modal .modal-close:hover, .profile-modal .modal-close:focus-visible { border-color: var(--rust); background: #ead7bd; color: #452819; outline: 3px solid rgba(138, 78, 48, .22); outline-offset: 2px; }
.profile-modal > .eyebrow { padding-right: 58px; font-size: 12px; letter-spacing: .08em; }
.profile-modal h2 { padding-right: 48px; font-size: clamp(26px, 4vw, 34px); line-height: 1.2; }
.profile-modal #profileSummary { max-width: 62ch; font-size: 15px; line-height: 1.55; }
.profile-modal .form-stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 16px; }
.profile-modal .field:has(textarea), .profile-modal .form-message, .profile-modal .button-wide { grid-column: 1 / -1; }
.profile-modal .field { gap: 7px; font-size: 14px; }
.profile-modal .field input, .profile-modal .field select, .profile-modal .field textarea { border-radius: 7px; }
.profile-modal .button-wide { min-height: 50px; }

@media (max-width: 700px) {
  .device-row-item { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px 12px; }
  .device-row-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 14px; }
  .device-row-manage { width: 100%; }
}
@media (max-width: 520px) {
  .profile-modal { padding: 27px 17px 18px; }
  .profile-modal .form-stack { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .profile-modal .field:has(textarea), .profile-modal .form-message, .profile-modal .button-wide { grid-column: auto; }
  .profile-modal .modal-close { top: 10px; right: 10px; width: 46px; min-width: 46px; height: 46px; min-height: 46px; }
}

@media (max-width: 980px) {
  .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-tool-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  #view-devices .section-head { align-items: flex-start; }
  #view-devices .section-head .button { width: 100%; }
  .device-entry { min-height: 112px; padding: 14px; }
  .device-entry-details { gap: 8px 15px; }
  .admin-metrics { gap: 8px; margin: 15px 0; }
  .admin-metrics .metric-card { min-height: 112px; padding: 12px 11px 14px; }
  .admin-metrics .metric-top { font-size: 10px; }
  .admin-metrics .metric-card strong { margin-top: 8px; font-size: clamp(22px, 7vw, 29px); }
  .admin-metrics .metric-card small { font-size: 11px; }
  .admin-chart-card { padding: 16px 14px; }
  .admin-chart-card .section-heading { align-items: flex-start; }
  .chart-total { align-items: flex-end; }
  .chart-bars { gap: 6px; min-height: 151px; }
  .chart-month { grid-template-rows: 20px minmax(78px, 1fr) 22px; }
  .chart-month-label { font-size: 11px; }
  .admin-tab { min-width: 112px; padding-inline: 12px; }
  .admin-registry { padding: 15px 13px; }
  .admin-search { grid-template-columns: minmax(0, 1fr); gap: 6px; align-items: stretch; }
  .admin-table-wrap { overflow: visible; border-top: 0; }
  .admin-table,
  .admin-detail-section .admin-table,
  .presence-list .admin-table { display: block; min-width: 0; width: 100%; }
  .admin-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .admin-table tbody { display: grid; gap: 10px; }
  .admin-table tr { display: grid; gap: 0; padding: 4px 12px; border: 1px solid #e5d8c7; border-radius: 6px; background: rgba(255, 253, 248, .74); }
  .admin-table tbody tr:hover { background: rgba(255, 253, 248, .9); }
  .admin-table td { display: grid; grid-template-columns: minmax(94px, .4fr) minmax(0, 1fr); gap: 10px; align-items: start; padding: 9px 0; border-top: 1px solid #eee5d9; overflow-wrap: anywhere; }
  .admin-table td:first-child { border-top: 0; }
  .admin-table td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.45; }
  .admin-table .id-text { max-width: none; font-size: 12px; }
  .table-email { max-width: none; font-size: 12px; }
  .binding-stack { min-width: 0; }
  .binding-item { padding-left: 7px; }
  .admin-status,.account-status { justify-self: start; }
  .admin-pagination { gap: 7px; }
  .admin-pagination .button { flex: 0 0 auto; padding-inline: 10px; }
  .admin-pagination > span { flex: 1 1 auto; font-size: 11px; }
  .admin-detail-modal { padding: 24px 15px 18px; max-height: 91vh; }
  .admin-detail-content { gap: 15px; }
  .profile-modal { padding: 24px 16px 18px; max-height: 91vh; }
  .admin-profile-table,.admin-profile-table tbody,.admin-profile-table tr { display: block; width: 100%; }
  .admin-profile-table th,.admin-profile-table td { display: block; width: 100%; padding: 7px 0; }
  .admin-profile-table th { border-top: 1px solid #e8dccb; }
  .admin-profile-table td { padding-top: 0; }
}

@media (max-width: 380px) {
  .resource-preview-filters { grid-template-columns: minmax(0, 1fr); }
  .resource-preview-filters > button { grid-column: 1; }
  .device-entry-details { gap: 7px 10px; }
  .device-entry-fact strong { font-size: 13px; }
  .admin-metrics .metric-card { min-height: 110px; padding: 11px 9px 13px; }
  .admin-metrics .metric-top { font-size: 9px; }
  .chart-bars { gap: 3px; }
  .admin-table td { grid-template-columns: minmax(82px, .38fr) minmax(0, 1fr); gap: 7px; }
}

/* Keep the profile sizing after the older responsive rules above. */
@media (max-width: 720px) {
  .profile-modal { padding: 27px 17px 18px; max-height: 91vh; }
}
.device-detail-actions [data-device-panel="purchase"] { --tab-accent: #315a78; }
.device-detail-actions [data-device-panel="preview"] { --tab-accent: #9a4d3c; }
.device-detail-actions [data-device-panel="resources"] { --tab-accent: #687b50; }
.device-detail-actions .button[aria-selected="true"] { color: #fff; border-color: var(--tab-accent, #315a78); background: var(--tab-accent, #315a78); }
.device-detail-actions .button-outline { color: var(--tab-accent, #315a78); }
.resource-group-chip { display: inline-flex; align-items: center; gap: 7px; border-radius: 12px; padding: 9px 11px; }
.resource-group-chip.is-news { border-color: #315a78; background: #edf4f8; color: #24445c; }
.resource-group-chip.is-song { border-color: #bd7a1f; background: #fff4df; color: #76500f; }
.resource-group-chip.is-removed { background: #f5e5e0; color: #84382e; }
.resource-group-chip > span { text-decoration: none; }
.resource-group-country { font-weight: 700; }
.resource-group-region, .resource-group-year { padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.72); }
.resource-group-kind { font-size: 12px; font-weight: 700; }
.resource-group-count { color: #5f625e; font-size: 12px; white-space: nowrap; }
.resource-group-action { display: inline-grid; place-items: center; flex: 0 0 23px; width: 23px; height: 23px; margin-left: 3px; border: 1px solid #a63832; border-radius: 50%; background: #fff0ed; color: #a32620; font-size: 17px; font-weight: 800; line-height: 1; }
.resource-group-action.is-restore { border-color: #315a78; background: #edf4f8; color: #24445c; }
.resource-preview-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); align-items: end; gap: 12px; margin: 16px 0; }
.resource-preview-filters .field { min-width: 0; }
.checkout-activation-guide { margin: 12px 0 18px; padding: 14px 16px; border-left: 4px solid #315a78; border-radius: 8px; background: #edf4f8; line-height: 1.6; }
.wechat-creating-indicator { display: flex; align-items: center; gap: 12px; margin: 16px 0; padding: 14px 16px; border-radius: 10px; background: #f3ecdf; color: #453b31; }
.loading-spinner { width: 22px; height: 22px; flex: 0 0 22px; border: 3px solid #d8cbb8; border-top-color: #315a78; border-radius: 50%; animation: encho-spin .8s linear infinite; }
@keyframes encho-spin { to { transform: rotate(360deg); } }
@media (max-width: 600px) { .resource-group-chip { width: 100%; justify-content: flex-start; flex-wrap: wrap; } .resource-preview-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .resource-preview-filters > button { grid-column: 1 / -1; } }

/* Admin preview shares the user library's navy, green and amber palette. */
.resource-catalog-card > .section-heading { flex-wrap: wrap; gap: 14px; }
.resource-catalog-card .catalog-refresh { color: #42633f; border-color: #9caf91; background: #f1f6ed; }
.resource-catalog-card .resource-catalog-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 18px; border-radius: 12px; background: #f2f6f8; border: 1px solid #d9e3ea; }
.resource-catalog-filters > .button-primary { background: #315a78; border-color: #315a78; }
.catalog-availability { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; padding: 15px 18px; border-radius: 10px; color: #42633f; background: #edf4e8; }
.catalog-availability > strong { font-size: 17px; }
.catalog-availability > span { color: #4d6151; font-size: 14px; }
.resource-catalog-card .resource-catalog-item { background: #fffefa; border-color: #e0e5e4; }
.resource-catalog-card .resource-catalog-item > .button { color: #315a78; border-color: #a4bbcb; background: #edf4f8; }
.resource-catalog-type.is-news { color: #24445c; border-color: #abc3d3; background: #edf4f8; }
.resource-catalog-type.is-song { color: #76500f; border-color: #dfbe7e; background: #fff4df; }
.resource-catalog-type.is-intro { color: #42633f; border-color: #adc49d; background: #edf4e8; }
@media (max-width: 700px) { .resource-catalog-card .resource-catalog-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; } .resource-catalog-filters > .button { grid-column: 1 / -1; } }
@media (max-width: 380px) { .resource-catalog-card .resource-catalog-filters { grid-template-columns: minmax(0, 1fr); } }
.admin-tab[data-admin-tab="devices"] { --admin-accent: #315a78; --admin-tint: #edf4f8; }
.admin-tab[data-admin-tab="users"] { --admin-accent: #42633f; --admin-tint: #edf4e8; }
.admin-tab[data-admin-tab="orders"] { --admin-accent: #906219; --admin-tint: #fff4df; }
.admin-tab[data-admin-tab="firmware"] { --admin-accent: #765347; --admin-tint: #f6ece7; }
.admin-tab[data-admin-tab="resources"] { --admin-accent: #42633f; --admin-tint: #edf4e8; }
.admin-tab { color: var(--admin-accent); }
.admin-tab.is-active { color: var(--admin-accent); background: var(--admin-tint); box-shadow: 0 3px 0 var(--admin-accent); }
.admin-registry .count-pill { color: #315a78; background: #edf4f8; border-color: #c2d3df; }
.admin-table th { background: #f1f5f7; color: #405a6b; }

.admin-firmware { display: grid; gap: 18px; min-width: 0; padding: clamp(16px, 3vw, 25px); }
.admin-firmware .registry-heading { align-items: flex-start; }
.admin-firmware .registry-heading h2,
.firmware-card h3,
.firmware-release-section h3 { margin: 0; color: var(--brown-dark); font-size: clamp(19px, 2vw, 24px); line-height: 1.25; overflow-wrap: anywhere; }
.admin-firmware .registry-heading .eyebrow,
.firmware-card .eyebrow { margin: 0 0 6px; }
.firmware-target-card,
.firmware-card,
.firmware-release-section { min-width: 0; padding: clamp(15px, 2.4vw, 22px); border: 1px solid #e5d8c7; border-radius: 9px; background: rgba(255, 253, 248, .82); }
.firmware-card select,
.firmware-card input:not([type="file"]) { min-height: 46px; }
.admin-firmware-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.firmware-card { display: grid; gap: 14px; }
.firmware-card .section-heading { align-items: flex-start; margin: 0; }
.firmware-card .form-stack { gap: 12px; }
.firmware-card .field-hint { margin: -3px 0 0; }
.firmware-card .button,
.firmware-release-section .button { min-height: 46px; }
.firmware-current-assignment { min-width: 0; padding-top: 12px; border-top: 1px solid #e5d8c7; }
.firmware-current-assignment h4 { margin: 0 0 9px; color: var(--brown-dark); font-size: 15px; }
.firmware-current-assignment .admin-empty { margin: 0; }
.firmware-current-assignment > .field-hint { margin: 0 0 10px; }
.firmware-scope-label { margin: 0; padding: 10px 12px; border: 1px solid #c8d9e2; border-radius: 7px; background: #edf4f8; color: #24445c; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.firmware-scope-warning { margin: 0; padding: 10px 12px; border: 1px solid #dfbe7e; border-radius: 7px; background: #fff4df; color: #6b4a10; font-size: 13px; line-height: 1.5; }
.firmware-scope-warning[hidden] { display: none; }
.firmware-confirm-choice { display: flex; align-items: flex-start; gap: 9px; min-width: 0; color: var(--brown-dark); font-size: 13px; line-height: 1.5; }
.firmware-confirm-choice input { flex: 0 0 20px; width: 20px; min-height: 20px !important; height: 20px; margin: 2px 0 0; accent-color: var(--rust); }
.firmware-assignment-card { align-content: start; }
.firmware-device-picker { display: grid; gap: 12px; min-width: 0; padding-top: 13px; border-top: 1px solid #e5d8c7; }
.firmware-device-picker > .section-heading { margin: 0; align-items: end; }
.firmware-device-picker h4 { margin: 0; color: var(--brown-dark); font-size: 16px; }
.firmware-page-size { width: min(100%, 148px); }
.firmware-page-size .field { gap: 5px; }
.firmware-page-size select { min-height: 40px; }
.firmware-device-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; min-width: 0; }
.firmware-device-filters .field { min-width: 0; }
.firmware-device-filters > .button { min-height: 46px; }
.firmware-advanced-filters { grid-column: 1 / -1; min-width: 0; padding: 10px 12px; border: 1px solid #e5d8c7; border-radius: 7px; background: #fbf8ef; }
.firmware-advanced-filters > summary { min-height: 28px; color: var(--rust); font-size: 13px; font-weight: 650; cursor: pointer; }
.firmware-shipping-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-top: 9px; }
.firmware-picker-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 12px; align-items: start; min-width: 0; }
.firmware-device-results,
.firmware-selection { min-width: 0; padding: 11px; border: 1px solid #e5d8c7; border-radius: 8px; background: rgba(255, 255, 255, .56); }
.firmware-picker-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.firmware-picker-actions .button { min-width: 0; min-height: 42px; padding-inline: 9px; font-size: 12px; }
.firmware-device-list { display: grid; gap: 7px; max-height: 470px; margin-top: 9px; overflow: auto; overscroll-behavior: contain; }
.firmware-device-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-width: 0; padding: 10px; border: 1px solid #e7ddcf; border-radius: 7px; background: #fffefa; }
.firmware-device-copy { display: grid; gap: 3px; min-width: 0; }
.firmware-device-copy > strong { color: var(--brown-dark); font: 650 13px/1.35 var(--mono); overflow-wrap: anywhere; }
.firmware-device-copy > small { color: var(--muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.firmware-device-version { color: var(--ink); font-size: 11px; overflow-wrap: anywhere; }
.firmware-device-copy .firmware-device-blocked { color: #8a3428; font-weight: 650; }
.firmware-device-row > .button { min-height: 40px; padding-inline: 10px; white-space: nowrap; }
.firmware-selection-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.firmware-selection-heading h4 { overflow-wrap: anywhere; }
.firmware-selection-heading .text-button { min-height: 40px; flex: 0 0 auto; }
.firmware-selection > .section-note { margin: 4px 0 8px; }
.firmware-selected-list { display: grid; gap: 7px; max-height: 470px; overflow: auto; overscroll-behavior: contain; }
.firmware-selected-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-width: 0; padding: 9px; border: 1px solid #e7ddcf; border-radius: 7px; background: #fffefa; }
.firmware-selected-row > div { display: grid; gap: 3px; min-width: 0; }
.firmware-selected-row strong { color: var(--brown-dark); font: 650 12px/1.4 var(--mono); overflow-wrap: anywhere; }
.firmware-selected-row small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.firmware-selected-row .text-button { min-height: 38px; flex: 0 0 auto; }
.firmware-all-selection { display: grid; gap: 6px; min-width: 0; padding: 11px; border: 1px solid #b9cfb0; border-radius: 7px; background: #edf4e8; color: #315a31; }
.firmware-all-selection strong { font-size: 13px; }
.firmware-all-selection small { color: var(--muted); overflow-wrap: anywhere; }
.firmware-preview { display: grid; gap: 11px; min-width: 0; margin-top: 12px; padding: 13px; border: 1px solid #c8d9e2; border-radius: 8px; background: #f3f7f9; }
.firmware-preview h4 { margin: 0; }
.firmware-preview-summary { margin: 0; color: var(--brown-dark); font-weight: 700; }
.firmware-blocking-reasons { max-height: 300px; overflow: auto; overscroll-behavior: contain; }
.firmware-blocking-reasons h5 { margin: 0 0 7px; color: #8a3428; font-size: 13px; }
.firmware-blocking-reasons ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.firmware-blocking-reasons li { display: grid; grid-template-columns: minmax(100px, .45fr) minmax(0, 1fr); gap: 3px 10px; padding: 8px; border: 1px solid #e7c3b9; border-radius: 6px; background: #fff7f4; }
.firmware-blocking-reasons li code { color: #8a3428; overflow-wrap: anywhere; }
.firmware-blocking-reasons li span { color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.firmware-blocking-reasons li small { grid-column: 1 / -1; color: var(--muted); font: 11px/1.35 var(--mono); overflow-wrap: anywhere; }
.firmware-no-blocks { margin: 0; color: #315a31; font-size: 13px; }
.firmware-assignment-card .button,
.firmware-preview .button { min-height: 46px; }
.firmware-assignment-card > .form-message.is-blocked { color: #8a3428; }
.subscription-test-card { display: grid; gap: 10px; margin-top: 18px; padding: clamp(15px, 2.4vw, 22px); border: 1px solid #e5d8c7; border-radius: 9px; background: rgba(255, 253, 248, .82); }
.subscription-test-card .section-heading { margin: 0; }
.subscription-test-card .field-hint { margin: 0; }
.admin-resource-panel { display: grid; gap: 12px; }
.firmware-release-section { display: grid; gap: 14px; }
.firmware-release-section .registry-heading { align-items: center; margin: 0; }
.firmware-release-section .registry-heading .section-note { margin-top: 5px; }
.firmware-release-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 10px; min-width: 0; }
.firmware-release-card { min-width: 0; padding: 13px; border: 1px solid #e7ddcf; border-radius: 7px; background: rgba(255, 255, 255, .68); }
.firmware-metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; min-width: 0; margin: 0; }
.firmware-metadata > div { display: grid; grid-template-columns: minmax(100px, .38fr) minmax(0, 1fr); gap: 8px; align-items: start; min-width: 0; }
.firmware-metadata dt { color: var(--muted); font-size: 12px; line-height: 1.45; }
.firmware-metadata dd { min-width: 0; margin: 0; color: var(--ink); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.firmware-metadata code { color: var(--brown-dark); font: 12px/1.45 var(--mono); overflow-wrap: anywhere; word-break: break-word; }
.firmware-update-detail { display: grid; gap: 10px; min-width: 0; }
.firmware-update-detail h4 { margin: 3px 0 0; color: var(--brown-dark); font-size: 15px; }
.firmware-update-state { margin: 0; padding: 10px 12px; border: 1px solid #c8d9e2; border-radius: 7px; background: #edf4f8; color: #24445c; line-height: 1.5; overflow-wrap: anywhere; }
.firmware-update-detail .admin-table-wrap { min-width: 0; }
.admin-tab[data-admin-tab="firmware"].is-active { border-color: #ead7ce; }
.admin-firmware button:focus-visible,
.admin-firmware select:focus-visible,
.admin-firmware input:focus-visible { outline: 3px solid rgba(49, 90, 120, .32); outline-offset: 2px; }
.admin-news-texts { display: grid; gap: 14px; }
.admin-news-texts > .registry-heading { margin-bottom: 0; }
.admin-news-text-filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: end; padding: 13px; border: 1px solid #e5d8c7; border-radius: 8px; background: rgba(255, 253, 248, .78); }
.admin-news-text-filters .field { min-width: 0; }
.admin-news-text-filter-actions { display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: 8px; }
.admin-news-text-filter-actions .button { min-height: 44px; }
.admin-news-text-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 10px; min-width: 0; }
.admin-news-text-card { display: grid; align-content: start; gap: 10px; min-width: 0; padding: 14px; border: 1px solid #e5d8c7; border-radius: 8px; background: rgba(255, 255, 255, .72); }
.admin-news-text-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; }
.admin-news-text-card-heading > div { min-width: 0; }
.admin-news-text-card h3 { margin: 0; color: var(--brown-dark); font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.admin-news-text-card-meta,
.admin-news-text-entry-date { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.admin-news-text-summary { display: -webkit-box; margin: 0; overflow: hidden; color: var(--ink); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.news-text-status { flex: 0 0 auto; max-width: 44%; padding: 4px 7px; border: 1px solid #e8d6ca; border-radius: 999px; background: #f8eee9; color: #814537; font-size: 11px; line-height: 1.35; text-align: center; }
.news-text-status.is-available { border-color: #c6d8bf; background: #edf4e8; color: #315a31; }
.admin-news-text-card > .button { justify-self: start; min-height: 42px; }
.resource-catalog-text-action { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 8px; }
.resource-catalog-text-action .button { min-height: 40px; }
.resource-catalog-text-action small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.admin-news-text-detail { display: grid; gap: 12px; min-width: 0; }
.admin-news-text-detail[hidden] { display: none; }
.admin-news-text-detail-toolbar { display: flex; justify-content: flex-start; }
.admin-news-text-detail h3 { margin: 0; color: var(--brown-dark); font-size: clamp(21px, 3vw, 29px); line-height: 1.3; overflow-wrap: anywhere; }
.admin-news-text-detail-meta { margin: -5px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.admin-news-text-content { display: grid; gap: 13px; min-width: 0; }
.admin-news-text-entry,
.admin-news-text-references { display: grid; gap: 8px; min-width: 0; padding: 15px; border: 1px solid #e5d8c7; border-radius: 8px; background: rgba(255, 253, 248, .82); }
.admin-news-text-entry h4,
.admin-news-text-entry h5,
.admin-news-text-references > h4 { margin: 0; color: var(--brown-dark); font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.admin-news-text-references > h4 { color: var(--rust); }
.admin-news-text-body { color: var(--ink); font-size: 15px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.admin-news-text-entry-date { margin: -2px 0 0; }
.admin-news-text-references .admin-news-text-entry { padding: 12px; border-color: #eee4d6; background: rgba(255, 255, 255, .76); }
@media (max-width: 760px) {
  .admin-firmware-grid { grid-template-columns: minmax(0, 1fr); }
  .firmware-picker-layout { grid-template-columns: minmax(0, 1fr); }
  .admin-news-text-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .admin-firmware { padding: 14px 12px; }
  .firmware-card,
  .firmware-release-section { padding: 14px 12px; }
  .firmware-device-filters,
  .firmware-shipping-filters { grid-template-columns: minmax(0, 1fr); }
  .firmware-advanced-filters { grid-column: auto; }
  .firmware-device-picker > .section-heading { align-items: stretch; flex-direction: column; }
  .firmware-page-size { width: 100%; }
  .firmware-picker-actions { grid-template-columns: minmax(0, 1fr); }
  .firmware-device-row { grid-template-columns: minmax(0, 1fr); }
  .firmware-device-row > .button { width: 100%; }
  .firmware-blocking-reasons li { grid-template-columns: minmax(0, 1fr); }
  .firmware-blocking-reasons li small { grid-column: auto; }
  .firmware-release-section .registry-heading { align-items: stretch; flex-direction: column; }
  .firmware-metadata { grid-template-columns: minmax(0, 1fr); }
  .firmware-metadata > div { grid-template-columns: minmax(98px, .38fr) minmax(0, 1fr); gap: 7px; }
  .admin-firmware .button { width: 100%; min-height: 48px; }
  .admin-firmware .admin-pagination { gap: 6px; }
  .admin-firmware .admin-pagination .button { width: auto; min-width: 0; flex: 0 1 auto; padding-inline: 8px; white-space: nowrap; }
  .admin-firmware .admin-pagination > span { min-width: 0; flex: 1 1 auto; font-size: 10px; }
  .firmware-selection-heading { align-items: flex-start; }
  .firmware-selected-row { flex-wrap: wrap; }
  .admin-news-text-filters { grid-template-columns: minmax(0, 1fr); }
  .admin-news-text-filter-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-news-text-filter-actions .button { min-height: 48px; padding-inline: 9px; font-size: 12px; }
  .admin-news-text-card-heading { flex-direction: column; }
  .news-text-status { max-width: 100%; }
  .admin-news-text-card > .button { width: 100%; min-height: 48px; }
  .admin-news-text-entry,
  .admin-news-text-references { padding: 12px; }
  .admin-news-text-body { font-size: 14px; line-height: 1.72; }
}
