:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --ink: #172033;
  --muted: #667085;
  --line: #dfe5ee;
  --primary: #1769e0;
  --primary-dark: #0f4fb4;
  --accent: #e26d2f;
  --danger: #d92d20;
  --success: #087443;
  --shadow: 0 18px 50px rgba(22, 34, 51, 0.08);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg); }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

[hidden] { display: none !important; }

.page-shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding-bottom: 48px; }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 42px; height: 42px; object-fit: contain; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 800; }
.brand span:last-child { display: grid; gap: 2px; }
.brand strong { font-size: 18px; letter-spacing: 0; }
.brand small { color: var(--muted); font-size: 12px; }

main { display: grid; gap: 22px; }
.upload-panel, .result-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: clamp(20px, 4vw, 34px); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.panel-heading h1, .panel-heading h2 { margin: 5px 0 0; font-size: clamp(24px, 4vw, 36px); line-height: 1.16; letter-spacing: 0; }
.panel-heading h2 { font-size: 26px; }
.eyebrow { margin: 0; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; }
.limit-chip { border: 1px solid #cddaf0; background: #edf4ff; color: var(--primary-dark); border-radius: 999px; padding: 8px 12px; white-space: nowrap; font-size: 12px; font-weight: 700; }

.drop-zone { min-height: 310px; display: grid; place-items: center; align-content: center; gap: 12px; padding: 30px; border: 2px dashed #bdc9d9; border-radius: 10px; background: var(--surface-muted); text-align: center; transition: border-color .18s, background .18s, transform .18s; cursor: pointer; }
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--primary); background: #edf4ff; }
.drop-zone.is-busy { pointer-events: none; opacity: .6; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone strong { font-size: 18px; }
.drop-zone small { color: var(--muted); }
.drop-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: #fff; font-size: 34px; line-height: 1; font-weight: 300; }

.upload-options { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
.field { display: grid; gap: 7px; min-width: 180px; color: var(--muted); font-size: 12px; font-weight: 700; }
.field select, .field input, .toolbar-actions select, .form-section input:not([type="checkbox"]):not([type="radio"]), .form-section select { min-height: 42px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); padding: 0 12px; outline: none; }
.field select:focus, .field input:focus, .form-section input:not([type="checkbox"]):not([type="radio"]):focus, .form-section select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23, 105, 224, .12); }
.compact-field { min-width: 100px; }
.switch-field, .check-line { display: inline-flex; align-items: center; gap: 9px; min-height: 42px; color: var(--ink); font-weight: 650; }
.switch-field input, .check-line input { accent-color: var(--primary); width: 17px; height: 17px; }

.upload-status { display: flex; align-items: center; gap: 13px; margin-top: 18px; padding: 14px; border: 1px solid #cddaf0; border-radius: 8px; background: #edf4ff; }
.upload-status span:last-child { display: grid; gap: 2px; }
.upload-status small { color: var(--muted); }
.spinner { width: 24px; height: 24px; border: 3px solid #b9d2fa; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 7px; padding: 0 15px; font-weight: 750; text-decoration: none; transition: background .16s, border-color .16s, transform .16s; }
.button:active { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: .62; transform: none; }
.button.primary { background: var(--primary); color: #fff; }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { background: var(--accent); color: #fff; }
.button.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.button.ghost:hover { border-color: #aebcd0; }
.button.danger { background: #fff; color: var(--danger); border-color: #f2b8b5; }
.button.small { min-height: 36px; padding: 0 11px; font-size: 12px; }
.button.tiny { min-height: 30px; padding: 0 9px; font-size: 11px; }
.button.wide { width: 100%; margin-top: 6px; }

.result-panel { border-top: 4px solid var(--primary); }
.preview-frame { min-height: 250px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #eef2f6; }
.preview-frame img { display: block; width: 100%; max-height: 560px; object-fit: contain; }
.link-list { display: grid; gap: 15px; margin-top: 20px; }
.link-list label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 750; }
.copy-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.copy-line input { min-width: 0; min-height: 46px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-muted); padding: 0 13px; color: var(--primary-dark); font-family: Consolas, monospace; }

.feature-strip { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.feature-strip article { display: grid; gap: 6px; padding: 20px; border-right: 1px solid var(--line); }
.feature-strip article:last-child { border-right: 0; }
.feature-strip strong { font-size: 15px; }
.feature-strip span { color: var(--muted); font-size: 13px; line-height: 1.5; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; max-width: calc(100% - 32px); transform: translate(-50%, 16px); border-radius: 7px; background: #172033; color: #fff; padding: 11px 16px; box-shadow: 0 12px 30px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.admin-login-body { min-height: 100vh; display: grid; place-items: center; background: #eef2f6; padding: 24px; }
.admin-login-shell { width: min(460px, 100%); }
.admin-login-card { display: grid; gap: 22px; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 28px; box-shadow: 0 24px 70px rgba(15, 23, 42, .14); }
.admin-login-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.admin-login-brand > div { min-width: 0; }
.admin-login-brand h1 { margin: 5px 0 0; font-size: 23px; line-height: 1.25; }
.admin-login-brand p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.admin-login-form { display: grid; gap: 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.admin-login-form label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 750; }
.admin-login-form input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 0 13px; outline: none; }
.admin-login-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23, 105, 224, .12); }
.admin-login-form .button { margin-top: 4px; }
.turnstile-field { display: grid; gap: 7px; }
.turnstile-field small { color: var(--muted); font-size: 11px; }
#turnstileWidget { min-height: 65px; overflow: hidden; }
.login-error { margin: 0; border: 1px solid #f2b8b5; border-radius: 7px; background: #fff5f4; color: var(--danger); padding: 10px 12px; font-size: 12px; line-height: 1.5; }
.login-back { color: var(--muted); font-size: 12px; text-align: center; text-decoration: none; }
.login-back:hover { color: var(--primary); }

.admin-body { background: #eef2f6; }
.admin-shell { width: min(1500px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 48px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 18px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.admin-topbar h1 { margin: 5px 0 0; font-size: 28px; letter-spacing: 0; }
.admin-heading { display: flex; align-items: center; gap: 15px; min-width: 0; }
.admin-brand-mark { width: 58px; height: 58px; flex: 0 0 58px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-muted); color: var(--ink); font-size: 22px; font-weight: 800; }
.admin-brand-mark img { width: 100%; height: 100%; display: block; object-fit: contain; padding: 5px; }
.topbar-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.stat-cluster { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stat-cluster > span { min-width: 156px; display: grid; gap: 4px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); }
.stat-cluster small { color: var(--muted); font-size: 11px; }
.stat-cluster strong { font-size: 14px; }
.admin-tabs { display: flex; gap: 6px; margin-bottom: 14px; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: #fff; width: fit-content; }
.admin-tabs button { min-height: 38px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 0 16px; font-weight: 750; }
.admin-tabs button:hover { color: var(--ink); background: var(--surface-muted); }
.admin-tabs button.active { background: var(--ink); color: #fff; }
.admin-tabs button span { margin-left: 5px; opacity: .7; font-size: 11px; }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.library-card { border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 8px 28px rgba(22,34,51,.05); }
.settings-form { display: grid; gap: 14px; }
.settings-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 4px 18px rgba(22,34,51,.04); }
.settings-page-head h2 { margin: 5px 0 0; font-size: 24px; }
.settings-page-head p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.settings-head-actions { display: flex; align-items: center; gap: 12px; }
.settings-head-actions span { color: var(--muted); font-size: 11px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.settings-stack { display: grid; gap: 14px; min-width: 0; }
.form-section, .settings-section { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 4px 18px rgba(22,34,51,.04); }
.form-section h2, .library-toolbar h2 { grid-column: 1 / -1; margin: 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 15px; letter-spacing: 0; }
.settings-section.span-2 { grid-column: 1 / -1; }
.section-help { grid-column: 1 / -1; margin: -2px 0 2px; color: #98a2b3; font-size: 11px; line-height: 1.55; }
.form-section label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.form-section > label { align-self: start; align-content: start; }
.form-section label small { color: #98a2b3; font-size: 11px; font-weight: 500; line-height: 1.45; }
.form-section label > input:not([type="checkbox"]):not([type="radio"]), .form-section label > select { width: 100%; }
.form-section .check-line { display: flex; }
.field-with-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.span-2-field { grid-column: 1 / -1; }
.brand-preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.brand-preview-card { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; align-items: center; min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-muted); padding: 10px; }
.brand-preview-frame { width: 70px; height: 58px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.brand-preview-frame.icon-preview { width: 58px; }
.brand-preview-frame img { max-width: 100%; max-height: 100%; display: block; object-fit: contain; padding: 5px; }
.asset-preview-empty { color: #98a2b3; font-size: 10px; }
.brand-preview-copy { display: grid; gap: 3px; min-width: 0; }
.brand-preview-copy strong { font-size: 12px; }
.brand-preview-copy span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.setting-switches { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 20px; }
.expiry-editor { grid-column: 1 / -1; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.expiry-head, .expiry-row { display: grid; grid-template-columns: 22px minmax(80px, 1.4fr) minmax(56px, .7fr) 68px 38px; gap: 7px; align-items: center; }
.expiry-head { padding: 9px 10px; background: var(--surface-muted); color: #98a2b3; font-size: 10px; font-weight: 750; }
.expiry-row { min-height: 48px; padding: 7px 10px; }
.expiry-row + .expiry-row { border-top: 1px solid var(--line); }
.expiry-row:hover { background: #fbfdff; }
.expiry-row input, .expiry-row select { min-width: 0; min-height: 32px; padding: 0 8px; font-size: 12px; }
.expiry-default { display: flex; align-items: center; justify-content: center; }
.expiry-default .expiry-radio { appearance: none; display: block; width: 14px; height: 14px; min-width: 14px; min-height: 14px; margin: 0; border: 1.5px solid #b9c6d6; border-radius: 50%; background: #fff; padding: 0; }
.expiry-default .expiry-radio:hover { border-color: var(--primary); }
.expiry-default .expiry-radio:checked { border: 4px solid var(--primary); }
.expiry-default span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.settings-note { border: 1px solid #cddaf0; border-radius: 8px; background: #f2f7ff; color: var(--muted); padding: 11px 13px; font-size: 12px; line-height: 1.6; }
.settings-note code { color: var(--primary-dark); font-family: Consolas, monospace; }
.api-help { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); padding: 12px 13px; }
.api-help-head { display: grid; gap: 4px; }
.api-help-head strong { color: var(--ink); font-size: 12px; }
.api-help-head span, .api-help p { color: var(--muted); font-size: 11px; line-height: 1.55; }
.api-help pre { max-width: 100%; margin: 10px 0 0; overflow: auto; border: 1px solid #d8e0eb; border-radius: 7px; background: #fff; color: var(--ink); padding: 11px 12px; font: 11px/1.6 Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.api-help p { margin: 9px 0 0; }
.api-help code { color: var(--primary-dark); font-family: Consolas, monospace; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(15, 23, 42, .52);
}

.modal-backdrop[hidden] { display: none; }

.modal-card {
  display: grid;
  gap: 16px;
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
  padding: clamp(18px, 4vw, 26px);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.modal-head h2 {
  margin: 5px 0 0;
  font-size: 22px;
  line-height: 1.2;
}

.modal-close {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  padding: 0 0 2px;
  font-size: 23px;
  line-height: 1;
}

.modal-close:hover {
  border-color: #aebcd0;
  background: #fff;
  color: var(--ink);
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 2px;
}

.backup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.backup-card { align-content: start; min-height: 190px; }
.backup-card h2 { grid-column: 1 / -1; }
.backup-card .section-help { grid-column: 1 / -1; }
.backup-card .button { align-self: end; }
.backup-modal-card { width: min(520px, 100%); }
.backup-modal-message { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.backup-password-field { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.backup-password-field input { min-height: 42px; width: 100%; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 0 12px; outline: none; }
.backup-password-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23, 105, 224, .12); }
.backup-encrypt-toggle { margin: 0; }
.admin-dialog-card { width: min(460px, 100%); }
.admin-dialog-message { margin: -2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.admin-dialog-input { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 750; }
.admin-dialog-input input { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 0 12px; outline: none; }
.admin-dialog-input input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23, 105, 224, .12); }
.admin-dialog-card .button.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.admin-dialog-card .button.danger:hover { background: #b42318; border-color: #b42318; }

.library-card { min-width: 0; overflow: hidden; }
.library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.toolbar-title { display: grid; gap: 3px; }
.toolbar-title span { color: var(--muted); font-size: 11px; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.toolbar-actions select, .toolbar-actions input { min-height: 36px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); padding: 0 10px; font-size: 12px; }
.toolbar-actions input[type="search"] { width: 130px; }
.table-wrap { overflow: auto; }
table { min-width: 980px; width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: center; vertical-align: middle; }
th { position: sticky; top: 0; z-index: 1; background: #f8fafc; color: #475467; font-size: 11px; text-align: center; }
td img { width: 48px; height: 48px; display: block; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #f2f4f7; }
td a { color: var(--primary); text-decoration: none; }
td small { display: block; margin-top: 4px; color: var(--muted); }
.url-cell { min-width: 220px; max-width: 330px; text-align: left; }
.url-cell a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { display: inline-flex; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 800; }
.status.approved { color: var(--success); background: #e9f7f0; }
.status.blocked { color: var(--danger); background: #fdeceb; }
.lock { font-size: 11px; color: var(--primary); }
.image-row.is-protected td { background: #fffaf0; border-top: 2px solid #e69b2e; border-bottom: 2px solid #e69b2e; }
.image-row.is-protected td:first-child { border-left: 2px solid #e69b2e; border-radius: 8px 0 0 8px; }
.image-row.is-protected td:last-child { border-right: 2px solid #e69b2e; border-radius: 0 8px 8px 0; }
.image-row.is-protected:hover td { background: #fff4dc; }
.protected-badge { display: inline-flex; border-radius: 999px; background: #fff0cf; color: #a45c00; padding: 4px 8px; font-size: 11px; font-weight: 800; }
.empty-cell { padding: 80px 20px; color: #98a2b3; }
.row-actions { min-width: 150px; white-space: nowrap; }
.row-actions .button { margin: 1px; }
.selection-count { color: var(--primary-dark); font-weight: 800; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.pagination-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.pagination-actions select, .pagination-actions input { min-height: 34px; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 0 9px; font-size: 12px; }
.pagination-actions input[type="number"] { width: 70px; }
.jump-label { color: var(--muted); font-size: 11px; }

@media (max-width: 1050px) {
  .settings-grid { grid-template-columns: 1fr; }
  .settings-section.span-2 { grid-column: auto; }
}

@media (max-width: 720px) {
  .page-shell, .admin-shell { width: min(100% - 20px, 1080px); }
  .admin-shell { width: calc(100% - 20px); }
  .topbar { min-height: 68px; }
  .panel-heading, .admin-topbar, .library-toolbar { align-items: stretch; flex-direction: column; }
  .limit-chip { align-self: flex-start; }
  .drop-zone { min-height: 250px; }
  .copy-line { grid-template-columns: 1fr; }
  .feature-strip { grid-template-columns: 1fr; }
  .feature-strip article { border-right: 0; border-bottom: 1px solid var(--line); }
  .feature-strip article:last-child { border-bottom: 0; }
  .settings-page-head, .settings-grid, .form-section { align-items: stretch; grid-template-columns: 1fr; }
  .backup-grid { grid-template-columns: 1fr; }
  .settings-stack { grid-column: auto; }
  .settings-page-head { flex-direction: column; }
  .settings-head-actions { align-items: stretch; flex-direction: column; }
  .settings-head-actions span { text-align: center; }
  .settings-page-head .button { width: 100%; }
  .form-section h2, .settings-section.span-2, .expiry-editor, .setting-switches { grid-column: auto; }
  .field-with-action { grid-template-columns: 1fr; }
  .admin-topbar, .library-card { min-width: 0; }
  .settings-grid, .library-card, .table-wrap { width: 100%; }
  .table-wrap { max-width: 100%; }
  .brand-preview-grid { grid-template-columns: 1fr; }
  .toolbar-actions { justify-content: flex-start; }
  .toolbar-actions select { flex: 1 1 130px; }
  .toolbar-actions input[type="search"] { width: 100%; flex: 1 1 100%; }
  .stat-cluster { display: grid; grid-template-columns: 1fr 1fr; }
  .stat-cluster .button { grid-column: 1 / -1; }
  .admin-tabs { width: 100%; }
  .admin-tabs button { flex: 1; }
  .expiry-head { display: none; }
  .expiry-row { grid-template-columns: 20px minmax(0, 1fr) 54px 60px 36px; gap: 5px; padding: 7px 8px; }
  .expiry-default span { display: none; }
  .pagination { align-items: stretch; flex-direction: column; }
  .pagination-actions { justify-content: flex-start; }
  .modal-backdrop { padding: 12px; }
  .modal-card { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); padding: 18px; }
  .modal-actions { align-items: stretch; flex-direction: column-reverse; }
  .modal-actions .button { width: 100%; }
  .admin-login-body { padding: 12px; }
  .admin-login-card { padding: 20px; }
}
