/* Escala de raios do painel: 14px contentores (cartoes, dialogos, drawer),
   8px controlos (botoes, inputs), pill (999px) para chips de estado. */
:root {
  --ink: #182027;
  --muted: #66707a;
  --line: #e1e5e8;
  --line-strong: #ccd2d6;
  --soft: #eef1f3;
  --paper: #ffffff;
  --green: #28795f;
  --green-dark: #1e604b;
  --green-soft: #e9f3ef;
  --amber-ink: #8a5a10;
  --amber-soft: #f8f0dd;
  --red-ink: #a03a2c;
  --red-soft: #f9ebe8;
  --blue-ink: #35608d;
  --blue-soft: #e9f1f8;
  --radius-lg: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(24, 32, 39, 0.05), 0 16px 44px rgba(24, 32, 39, 0.13);
  --shadow-soft: 0 1px 1px rgba(24, 32, 39, 0.03), 0 6px 20px rgba(24, 32, 39, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--soft);
  font-synthesis: none;
  letter-spacing: -0.01em;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--soft); }
button, input, select { font: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(440px, 1.1fr);
  background: var(--paper);
}

.auth-brand {
  min-height: 100vh;
  padding: clamp(36px, 7vw, 96px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 42px;
  color: #f6faf8;
  background: linear-gradient(165deg, #1c252d, #141c22);
  border-right: 6px solid var(--green);
}

.brand-logo {
  width: 78px;
  height: 78px;
  display: block;
  border-radius: 16px;
}
.brand-logo-small {
  width: 46px;
  height: 46px;
  border-radius: 11px;
}

.auth-brand .eyebrow { color: #93c6b3; }
.auth-brand h1 { margin: 0; font-size: clamp(38px, 5vw, 64px); line-height: 1.02; letter-spacing: -0.02em; }
.brand-copy { max-width: 420px; margin: 18px 0 0; color: #b7c1c7; font-size: 17px; line-height: 1.55; }
.signal-line { display: flex; gap: 10px; align-items: center; color: #b7c1c7; font-size: 14px; }
.signal-line span, .receiver-state > span { width: 9px; height: 9px; border-radius: 50%; background: #52bd8e; box-shadow: 0 0 0 4px rgba(82, 189, 142, 0.14); }

.auth-form-wrap { display: grid; place-items: center; padding: 36px; background: var(--soft); }
.login-panel { width: min(390px, 100%); display: grid; gap: 22px; padding: 34px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.login-panel h2, .dialog h2, .drawer-header h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
label { display: grid; gap: 7px; color: #48525b; font-size: 13px; font-weight: 600; }
input, select {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(40, 121, 95, 0.14); }
.form-error { min-height: 18px; margin: -8px 0; color: var(--red-ink); font-size: 13px; }

.button {
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 650;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.button:active { transform: scale(0.98); }
.button:disabled { cursor: not-allowed; opacity: 0.48; }
.button-primary { color: #fff; background: var(--green); border-color: var(--green); box-shadow: 0 1px 1px rgba(24, 32, 39, 0.06), 0 6px 16px rgba(40, 121, 95, 0.22); }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { color: #34404a; background: var(--paper); border-color: var(--line-strong); }
.button-secondary:hover { border-color: #9ba5ac; background: #f7f9f8; }
.button-danger { color: var(--red-ink); background: var(--paper); border-color: #e0bbb5; }
.button-danger:hover { background: var(--red-soft); }
.button-quiet { color: #c3cbd0; background: transparent; border-color: #46515a; }
.button-quiet:hover { background: #232d35; color: #fff; }
.button-wide { width: 100%; }
a.button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.button:focus-visible, .icon-button:focus-visible, .restaurant-item:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  font-size: 22px;
  line-height: 1;
  transition: background 0.15s ease;
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 20; height: 100vh; display: flex; flex-direction: column; color: #e7ebed; background: #182027; border-right: 1px solid #2b343c; }
.sidebar-brand { height: 76px; padding: 14px 18px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #2b343c; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand strong { font-size: 15px; }
.sidebar-brand span { margin-top: 3px; color: #8f9aa2; font-size: 11px; }
.restaurant-nav { min-height: 0; flex: 1; padding: 22px 12px; overflow: auto; }
.nav-heading { padding: 0 8px 12px; display: flex; align-items: center; justify-content: space-between; color: #8f9aa2; font-size: 11px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; }
.nav-heading .icon-button { width: 28px; height: 28px; color: #9da7ad; font-size: 18px; }
.nav-heading .icon-button:hover { background: #232d35; }
.restaurant-list { display: grid; gap: 4px; }
.restaurant-item {
  width: 100%;
  min-height: 45px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: #cbd2d6;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-align: left;
  transition: background 0.15s ease;
}
.restaurant-item:hover { background: #222c34; }
.restaurant-item.active { color: #fff; background: #2a343c; border-color: #3d4952; }
.restaurant-item .dot { width: 8px; height: 8px; border-radius: 50%; background: #747b84; }
.restaurant-item .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.restaurant-item .count { min-width: 26px; padding: 3px 7px; color: #aeb7bd; background: #10171c; border-radius: 999px; font-size: 11px; font-variant-numeric: tabular-nums; text-align: center; }
.sidebar-footer { padding: 16px; display: grid; gap: 16px; border-top: 1px solid #2b343c; }
.receiver-state { display: flex; align-items: center; gap: 12px; }
.receiver-state strong, .receiver-state small { display: block; }
.receiver-state strong { font-size: 12px; }
.receiver-state small { width: 180px; margin-top: 3px; overflow: hidden; color: #8f9aa2; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.workspace { min-width: 0; }
.topbar { height: 76px; padding: 12px clamp(20px, 3vw, 42px); display: flex; align-items: center; gap: 16px; background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.last-update { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.menu-button { display: none; width: 38px; height: 38px; padding: 0; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 18px; }
.content { padding: 28px clamp(18px, 3vw, 42px) 48px; }
.mobile-filter { display: none; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; }
.stat-card { min-height: 126px; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.stat-card > span { color: var(--muted); font-size: 12px; font-weight: 650; }
.stat-card strong { margin-top: 8px; overflow-wrap: anywhere; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-card small { color: #8a939a; font-size: 11px; }
.stat-total { --accent: var(--green); }
.stat-today { --accent: #c45d3d; }
.stat-space { --accent: #315d91; }
.stat-last { --accent: #7b527d; }
.stat-last strong { font-size: 20px; }

.labels-section { margin-top: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); overflow: hidden; }
.section-toolbar { min-height: 76px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.section-toolbar h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.section-toolbar p { margin: 4px 0 0; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.search-box { width: min(340px, 45vw); }
.search-box input { min-height: 38px; }
.table-wrap { position: relative; min-height: 260px; overflow-x: auto; }
table { width: 100%; min-width: 900px; border-collapse: collapse; table-layout: fixed; }
th { padding: 11px 14px; color: #6f7a83; background: #f7f9f8; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 650; letter-spacing: 0.04em; text-align: left; text-transform: uppercase; }
td { height: 66px; padding: 10px 14px; border-bottom: 1px solid #eceef0; color: #39434b; font-size: 13px; vertical-align: middle; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f4f8f6; }
th:nth-child(1), td:nth-child(1) { width: 148px; }
th:nth-child(2), td:nth-child(2) { width: 154px; }
th:nth-child(3), td:nth-child(3) { width: 230px; }
th:nth-child(5), td:nth-child(5) { width: 158px; }
th:nth-child(6), td:nth-child(6) { width: 90px; }
th:nth-child(7), td:nth-child(7) { width: 42px; }
.date-cell strong, .date-cell span, .filename-cell strong, .filename-cell span { display: block; }
.date-cell strong, .filename-cell strong { overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.date-cell span, .filename-cell span { margin-top: 4px; color: #8a939a; font-size: 11px; font-variant-numeric: tabular-nums; }
.restaurant-badge { max-width: 130px; display: inline-flex; align-items: center; gap: 7px; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.restaurant-badge::before { content: ""; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #747b84; }
.tone-green .dot, .restaurant-badge.tone-green::before { background: #28795f; }
.tone-coral .dot, .restaurant-badge.tone-coral::before { background: #c45d3d; }
.tone-blue .dot, .restaurant-badge.tone-blue::before { background: #315d91; }
.tone-ochre .dot, .restaurant-badge.tone-ochre::before { background: #94632f; }
.tone-plum .dot, .restaurant-badge.tone-plum::before { background: #7b527d; }
.tone-teal .dot, .restaurant-badge.tone-teal::before { background: #317783; }
.tone-neutral .dot, .restaurant-badge.tone-neutral::before { background: #747b84; }
.tone-mint .dot, .restaurant-badge.tone-mint::before { background: #52bd8e; }
.content-preview { max-width: 100%; overflow: hidden; color: #5c6670; text-overflow: ellipsis; white-space: nowrap; }
.dlc-cell span, .dlc-cell small { display: block; }
.dlc-cell small { margin-top: 5px; color: #7a858d; font-size: 10px; white-space: nowrap; }
.dlc-badge { width: max-content; max-width: 100%; padding: 4px 10px; border: 0; border-radius: 999px; color: #4a544c; background: #eef1ef; font-size: 10px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.dlc-badge.dlc-ok { color: #1e6a4e; background: var(--green-soft); }
.dlc-badge.dlc-soon, .dlc-badge.dlc-urgent { color: var(--amber-ink); background: var(--amber-soft); }
.dlc-badge.dlc-expired, .dlc-badge.dlc-error { color: var(--red-ink); background: var(--red-soft); }
.dlc-badge.dlc-pending { color: var(--blue-ink); background: var(--blue-soft); }
.row-arrow { color: #89939a; font-size: 17px; }
.table-state { position: absolute; inset: 42px 0 0; display: grid; place-items: center; color: var(--muted); background: rgba(255, 255, 255, 0.92); font-size: 13px; }
.pagination { min-height: 58px; padding: 10px 16px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.pagination span { min-width: 88px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; text-align: center; }

.drawer-backdrop, .sidebar-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(10, 16, 20, 0.44); }
.detail-drawer { position: fixed; top: 0; right: 0; z-index: 50; width: min(720px, 100%); height: 100vh; display: flex; flex-direction: column; background: var(--paper); box-shadow: var(--shadow); transform: translateX(105%); transition: transform 0.22s ease; }
.detail-drawer.open { transform: translateX(0); }
.drawer-header, .dialog-header { min-height: 76px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.drawer-header > div { min-width: 0; flex: 1; }
.drawer-header h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-header .icon-button, .dialog-header .icon-button { color: #73808a; border-color: #d1d6d9; }
.drawer-header .icon-button:hover, .dialog-header .icon-button:hover { background: #f2f4f5; }
.drawer-header .icon-button { flex: 0 0 auto; }
.drawer-content { min-height: 0; padding: 22px; overflow: auto; }
.detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.meta-item { min-width: 0; padding: 12px; background: #f6f8f7; border: 1px solid #e4e7e9; border-radius: var(--radius-sm); }
.meta-item-wide { grid-column: 1 / -1; }
.meta-item span, .config-block > span { display: block; margin-bottom: 6px; color: #7d878f; font-size: 10px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; }
.meta-item strong { display: block; overflow-wrap: anywhere; font-size: 12px; }
.detail-section { margin-top: 22px; }
.detail-section h3 { margin: 0 0 10px; font-size: 13px; font-weight: 700; }
.render-preview { min-height: 220px; display: grid; place-items: center; overflow: hidden; background: #e9edeb; border: 1px solid #d8dedc; border-radius: var(--radius-sm); }
.render-loading { color: #637078; font-size: 12px; }
.render-result { width: 100%; }
.render-meta { padding: 9px 12px; color: #5d6870; background: #f7f9f8; border-bottom: 1px solid #d8dedc; font-size: 11px; font-weight: 600; }
.render-pages { max-height: 650px; padding: 20px; display: grid; gap: 18px; overflow: auto; place-items: center; }
.render-page { width: 100%; margin: 0; display: grid; gap: 7px; place-items: center; }
.render-page img { display: block; max-width: 100%; height: auto; max-height: 600px; object-fit: contain; background: #fff; border: 1px solid #cbd1ce; box-shadow: 0 8px 24px rgba(24, 32, 39, 0.14); }
.render-page figcaption { color: #68727d; font-size: 10px; }
.render-warning, .render-error { width: 100%; padding: 11px 12px; color: #744736; background: #fdf3ec; border-left: 3px solid #c45d3d; font-size: 11px; line-height: 1.5; }
.render-error { color: #6c4340; background: #fbf2f1; }
.dlc-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #dce2df; border-left: 4px solid #7d8a83; border-radius: var(--radius-sm); }
.dlc-summary > div { min-width: 0; padding: 12px; border-right: 1px solid #e4e8e6; }
.dlc-summary > div:last-child { border-right: 0; }
.dlc-summary span, .text-source > span { display: block; margin-bottom: 6px; color: #77828a; font-size: 10px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; }
.dlc-summary strong { display: block; overflow-wrap: anywhere; font-size: 12px; }
.dlc-summary.dlc-ok { border-left-color: var(--green); }
.dlc-summary.dlc-soon, .dlc-summary.dlc-urgent { border-left-color: #c88a2f; }
.dlc-summary.dlc-expired, .dlc-summary.dlc-error { border-left-color: #c45d3d; }
.dlc-summary.dlc-pending { border-left-color: #315d91; }
.text-analysis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.text-source { min-width: 0; padding: 12px; background: #f7f9f8; border-top: 3px solid #b9c5bf; border-radius: 0 0 6px 6px; }
.text-source .field-list { margin: 0; }
.ocr-text { max-height: 230px; margin: 0; overflow: auto; color: #354039; font: 12px/1.55 Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.analysis-pending, .analysis-error { margin: 0; color: #566c7e; font-size: 12px; }
.analysis-error { color: #8b4439; }
.field-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.field-list li { padding: 9px 11px; background: var(--green-soft); border-left: 3px solid var(--green); border-radius: 4px; color: #2f5044; font-size: 12px; overflow-wrap: anywhere; }
.zpl-code, .config-block pre { max-height: 300px; margin: 0; padding: 14px; overflow: auto; color: #dbe7e2; background: #182027; border-radius: var(--radius-sm); font: 11px/1.6 Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-actions { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 9px; }
.detail-actions .move-label { min-width: 180px; flex: 1; }

.dialog-overlay { position: fixed; inset: 0; z-index: 70; padding: 18px; display: grid; place-items: center; background: rgba(10, 16, 20, 0.5); }
.dialog { width: min(650px, calc(100vw - 28px)); max-height: calc(100vh - 36px); overflow: auto; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.dialog-shell { margin: 0; }
.dialog-body { padding: 20px; }
.inline-form { padding-bottom: 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: 10px; border-bottom: 1px solid var(--line); }
.manage-list { display: grid; }
.manage-empty { min-height: 100px; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.manage-item { min-height: 74px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; border-bottom: 1px solid #e9ecee; }
.manage-item:last-child { border: 0; }
.manage-item strong, .manage-item span { display: block; }
.manage-item strong { font-size: 13px; }
.manage-item span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.manage-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.token-field input { font-family: Consolas, monospace; }
.dialog-token { width: min(590px, calc(100vw - 28px)); }
.dialog-printer { width: min(480px, calc(100vw - 28px)); }
.printer-form { display: grid; gap: 16px; }
.dimension-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.config-block { margin-top: 18px; }
.config-block pre { max-height: 170px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 80; max-width: min(390px, calc(100vw - 40px)); padding: 12px 16px; color: #fff; background: #242f37; border-left: 4px solid #52bd8e; border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: 12.5px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity 0.18s ease, transform 0.18s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-left-color: #c45d3d; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  th:nth-child(2), td:nth-child(2) { display: none; }
}

@media (max-width: 760px) {
  .auth-shell { grid-template-columns: 1fr; background: var(--soft); }
  .auth-brand { min-height: 220px; padding: 28px; gap: 18px; border-right: 0; border-bottom: 5px solid var(--green); }
  .auth-brand h1 { font-size: 38px; }
  .brand-logo { width: 58px; height: 58px; }
  .brand-copy { margin-top: 10px; font-size: 15px; }
  .signal-line { display: none; }
  .auth-form-wrap { padding: 24px 18px; place-items: start center; }
  .login-panel { padding: 24px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; z-index: 60; width: 270px; transform: translateX(-105%); transition: transform 0.2s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { z-index: 55; }
  .menu-button { display: block; }
  .topbar { height: 68px; padding: 10px 14px; }
  .topbar h1 { max-width: 42vw; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
  .last-update { display: none; }
  .content { padding: 16px 12px 34px; }
  .mobile-filter { margin-bottom: 12px; display: grid; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat-card { min-height: 112px; padding: 14px; }
  .stat-card strong { font-size: 23px; }
  .stat-last strong { font-size: 16px; }
  .section-toolbar { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  table { min-width: 0; }
  th, td { padding-right: 8px; padding-left: 8px; }
  th:nth-child(1), td:nth-child(1) { width: 84px; }
  th:nth-child(3), td:nth-child(3) { width: auto; }
  th:nth-child(5), td:nth-child(5) { width: 112px; }
  th:nth-child(7), td:nth-child(7) { width: 28px; }
  th:nth-child(4), td:nth-child(4), th:nth-child(6), td:nth-child(6) { display: none; }
  .dlc-cell small { white-space: normal; }
  .pagination { justify-content: center; }
  .detail-meta { grid-template-columns: 1fr; }
  .dlc-summary, .text-analysis { grid-template-columns: 1fr; }
  .dlc-summary > div { border-right: 0; border-bottom: 1px solid #e4e8e6; }
  .dlc-summary > div:last-child { border-bottom: 0; }
  .drawer-content { padding: 16px; }
  .drawer-header { padding: 12px 14px; }
  .drawer-header h2 { font-size: 18px; }
  .inline-form { grid-template-columns: 1fr; }
  .manage-item { grid-template-columns: 1fr; padding: 12px 0; }
  .manage-actions { justify-content: flex-start; }
}

@media (max-width: 390px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 104px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
