:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-blue: #eff6ff;
  --text: #162033;
  --text-secondary: #596579;
  --text-muted: #7b8799;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #e8f0ff;
  --success: #15803d;
  --success-soft: #ecfdf3;
  --warning: #b45309;
  --warning-soft: #fff8e7;
  --danger: #c2414a;
  --danger-soft: #fff1f2;
  --violet: #6d45d6;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 5%);
  --shadow-md: 0 12px 30px rgb(15 23 42 / 10%);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: 180ms ease;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 90% -10%, rgb(219 234 254 / 65%), transparent 27rem),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.64;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgb(37 99 235 / 20%);
  outline-offset: 2px;
}

[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;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: white;
  transform: translateY(-140%);
  transition: transform var(--transition);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px clamp(18px, 3.3vw, 48px) 48px;
}

.topbar,
.workspace-heading,
.section-heading,
.drawer-header,
.drawer-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  min-height: 68px;
  margin-bottom: 16px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgb(37 99 235 / 12%);
  border-radius: 13px;
  background: linear-gradient(145deg, #3679ef, #1f59c8);
  box-shadow: 0 8px 18px rgb(37 99 235 / 20%);
  color: white;
  font-size: 18px;
  font-weight: 750;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.35;
}

h3 {
  margin-bottom: 0;
  font-size: 15px;
}

.topbar-actions,
.scan-summary {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 16px;
}

.scan-summary {
  align-items: flex-end;
  flex-direction: column;
  gap: 3px;
}

.status-pill,
.small-badge,
.table-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-weight: 650;
  white-space: nowrap;
}

.status-pill {
  min-height: 28px;
  padding: 4px 10px;
  gap: 7px;
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgb(100 116 139 / 12%);
}

.status-neutral {
  background: #eef2f7;
  color: #526174;
}

.status-success {
  background: var(--success-soft);
  color: var(--success);
}

.status-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-running .status-dot {
  animation: pulse 1.5s ease-in-out infinite;
}

.updated-at {
  color: var(--text-muted);
  font-size: 12px;
}

.button,
.icon-button,
.view-button,
.account-name-button,
.table-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: none;
  font-weight: 650;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.button {
  padding: 0 15px;
  gap: 8px;
}

.button svg,
.icon-button svg,
.search-field svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.button:active:not(:disabled),
.icon-button:active:not(:disabled),
.view-button:active:not(:disabled),
.table-action:active:not(:disabled) {
  transform: translateY(1px);
}

.button-primary {
  background: var(--primary);
  box-shadow: 0 5px 14px rgb(37 99 235 / 18%);
  color: white;
}

.button-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.button-secondary {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: #344158;
}

.button-secondary:hover:not(:disabled),
.button-ghost:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: #f8fafc;
}

.button-ghost {
  border: 1px solid transparent;
  color: var(--text-secondary);
}

.risk-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 24px;
  padding: 11px 14px;
  border: 1px solid #f5d697;
  border-radius: var(--radius-md);
  background: #fffaf0;
  color: #7b4a0a;
}

.risk-notice svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.risk-notice div {
  display: flex;
  flex-wrap: wrap;
  column-gap: 10px;
}

.risk-notice strong {
  color: #713f12;
}

.risk-notice span {
  color: #8a5a18;
}

.overview-section {
  margin-bottom: 24px;
}

.section-heading,
.workspace-heading {
  margin-bottom: 14px;
}

.section-meta {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 12px;
  text-align: right;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-card {
  display: flex;
  min-height: 124px;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgb(255 255 255 / 88%);
  box-shadow: var(--shadow-sm);
}

.summary-icon {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 750;
}

.summary-blue .summary-icon {
  background: #e9f2ff;
  color: #2563eb;
}

.summary-amber .summary-icon {
  background: #fff4d8;
  color: #a95d05;
}

.summary-violet .summary-icon {
  background: #f1edff;
  color: var(--violet);
}

.summary-rose .summary-icon {
  background: #fff0f1;
  color: var(--danger);
}

.summary-card p {
  margin-bottom: 3px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 650;
}

.summary-card strong {
  display: block;
  margin-bottom: 3px;
  font-size: 29px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.summary-card span {
  color: var(--text-muted);
  font-size: 12px;
}

.workspace-card {
  min-height: 440px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 5px 18px rgb(15 23 42 / 5%);
}

.view-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
}

.view-button {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
}

.view-button.is-active {
  background: var(--surface);
  box-shadow: 0 1px 4px rgb(15 23 42 / 10%);
  color: var(--primary);
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(150px, 190px) minmax(150px, 190px) auto;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.search-field,
.select-field {
  min-width: 0;
}

.search-field {
  position: relative;
  display: block;
}

.search-field svg {
  position: absolute;
  top: 13px;
  left: 13px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-field input,
.select-field select,
.claim-form input,
.claim-form textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-field input,
.select-field select,
.claim-form input {
  min-height: 44px;
}

.search-field input {
  padding: 0 13px 0 40px;
}

.search-field input::placeholder,
.claim-form input::placeholder,
.claim-form textarea::placeholder {
  color: #98a3b2;
}

.search-field input:focus,
.select-field select:focus,
.claim-form input:focus,
.claim-form textarea:focus {
  border-color: #7ca7f4;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 9%);
}

.select-field {
  position: relative;
}

.select-field > span {
  position: absolute;
  z-index: 1;
  top: -7px;
  left: 10px;
  padding: 0 4px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1;
}

.select-field select {
  padding: 0 34px 0 12px;
}

.feedback-region {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.feedback-banner {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
}

.feedback-banner > div {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.feedback-symbol {
  display: grid;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: rgb(255 255 255 / 75%);
  font-size: 12px;
  font-weight: 800;
}

.feedback-copy strong,
.feedback-copy span {
  display: block;
}

.feedback-copy strong {
  font-size: 13px;
}

.feedback-copy span {
  margin-top: 1px;
  color: inherit;
  font-size: 12px;
  opacity: 0.86;
}

.feedback-warning {
  border-color: #f3d494;
  background: var(--warning-soft);
  color: #80510e;
}

.feedback-danger {
  border-color: #fecdd3;
  background: var(--danger-soft);
  color: #9f2633;
}

.feedback-info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #2456a5;
}

.feedback-action {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.loading-state,
.drawer-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
}

.loading-state {
  min-height: 260px;
}

.spinner,
.button-spinner {
  border: 2px solid rgb(100 116 139 / 20%);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.spinner {
  width: 20px;
  height: 20px;
}

.button-spinner {
  display: none;
  width: 16px;
  height: 16px;
}

.button.is-loading .button-spinner {
  display: block;
}

.button.is-loading .button-label {
  opacity: 0.82;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 11px;
}

table {
  width: 100%;
  min-width: 950px;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid #e8edf3;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f8fafc;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

th:nth-child(1) { width: 21%; }
th:nth-child(2) { width: 11%; }
th:nth-child(3) { width: 16%; }
th:nth-child(4) { width: 8%; }
th:nth-child(5) { width: 17%; }
th:nth-child(6) { width: 18%; }
th:nth-child(7) { width: 9%; }

tbody tr {
  transition: background-color var(--transition);
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #f9fbff;
}

.account-name-button {
  min-height: 44px;
  padding: 0;
  color: var(--text);
  font-weight: 720;
  text-align: left;
}

.account-name-button:hover {
  color: var(--primary);
}

.cell-stack {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
}

.cell-primary,
.cell-secondary {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-primary {
  color: var(--text);
  font-weight: 650;
}

.cell-secondary {
  color: var(--text-muted);
  font-size: 12px;
}

.count-zero {
  color: #b45309;
  font-size: 16px;
  font-weight: 760;
}

.table-badge,
.small-badge {
  min-height: 26px;
  padding: 3px 9px;
  font-size: 12px;
}

.badge-online,
.badge-claimed,
.badge-current {
  background: var(--success-soft);
  color: var(--success);
}

.badge-unclaimed {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-history,
.badge-muted {
  background: #eef2f7;
  color: #5f6c7d;
}

.table-action {
  min-height: 44px;
  padding: 0 8px;
  color: var(--primary);
}

.table-action:hover {
  background: var(--primary-soft);
}

.action-column {
  text-align: right;
}

td.action-column {
  text-align: right;
}

.result-count {
  margin: 10px 2px 0;
  color: var(--text-muted);
  font-size: 12px;
}

.account-card-list {
  display: none;
}

.account-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.account-card + .account-card {
  margin-top: 10px;
}

.account-card-header,
.account-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.account-card-title {
  min-width: 0;
}

.account-card-title strong,
.account-card-title span {
  display: block;
}

.account-card-title strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-card-title span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.account-card-data {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 15px 0;
  padding: 13px;
  border-radius: 10px;
  background: var(--surface-soft);
}

.account-card-data dt {
  margin-bottom: 3px;
  color: var(--text-muted);
  font-size: 11px;
}

.account-card-data dd {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}

.account-card-footer .table-action {
  padding: 0 10px;
}

.empty-state {
  display: flex;
  min-height: 290px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 36px 18px;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 16px;
  background: #edf8f1;
  color: var(--success);
  font-size: 22px;
  font-weight: 800;
}

.empty-state h3 {
  margin-bottom: 6px;
  font-size: 17px;
}

.empty-state p {
  max-width: 420px;
  margin-bottom: 17px;
  color: var(--text-muted);
}

.drawer-overlay {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgb(15 23 42 / 35%);
  opacity: 0;
  transition: opacity var(--transition);
}

.drawer-overlay.is-open {
  opacity: 1;
}

.case-drawer {
  width: min(460px, 100%);
  height: 100%;
  overflow-y: auto;
  background: var(--surface);
  box-shadow: -18px 0 42px rgb(15 23 42 / 14%);
  transform: translateX(100%);
  transition: transform 220ms ease;
}

.drawer-overlay.is-open .case-drawer {
  transform: translateX(0);
}

.drawer-header {
  position: sticky;
  z-index: 2;
  top: 0;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(8px);
}

.icon-button {
  flex: 0 0 auto;
  width: 44px;
  padding: 0;
  color: var(--text-secondary);
}

.icon-button:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.drawer-loading {
  min-height: 160px;
}

.drawer-content {
  padding: 0 20px 34px;
}

.drawer-section {
  padding: 21px 0;
  border-bottom: 1px solid var(--border);
}

.drawer-section:last-child {
  border-bottom: 0;
}

.drawer-section-title {
  align-items: flex-start;
  margin-bottom: 14px;
}

.drawer-section-title p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 16px;
  margin: 0;
}

.detail-grid div {
  min-width: 0;
}

.detail-grid dt {
  margin-bottom: 3px;
  color: var(--text-muted);
  font-size: 11px;
}

.detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.claim-form {
  display: grid;
  gap: 14px;
}

.claim-form label > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: #344158;
  font-size: 13px;
  font-weight: 650;
}

.claim-form label > span em {
  margin-right: auto;
  color: var(--danger);
  font-size: 11px;
  font-style: normal;
}

.claim-form label > span small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
}

.claim-form input,
.claim-form textarea {
  padding: 10px 12px;
  resize: vertical;
}

.claim-form textarea {
  min-height: 116px;
  max-height: 240px;
}

.field-error {
  display: block;
  min-height: 18px;
  padding-top: 3px;
  color: var(--danger);
  font-size: 11px;
}

.claim-form input[aria-invalid="true"] {
  border-color: #e5737c;
}

.save-feedback {
  display: none;
  padding: 10px 11px;
  border-radius: 9px;
  font-size: 12px;
}

.save-feedback.is-visible {
  display: block;
}

.save-feedback.feedback-danger {
  border: 1px solid #fecdd3;
}

.save-feedback.feedback-warning {
  border: 1px solid #f3d494;
}

.save-feedback.feedback-info {
  border: 1px solid #bfdbfe;
}

.drawer-actions {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 10px;
  padding-top: 2px;
}

.event-timeline {
  position: relative;
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 17px;
}

.event-item::after {
  position: absolute;
  top: 14px;
  bottom: -1px;
  left: 5px;
  width: 1px;
  background: var(--border);
  content: "";
}

.event-item:last-child {
  padding-bottom: 0;
}

.event-item:last-child::after {
  display: none;
}

.event-dot {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 4px;
  border: 3px solid #dbeafe;
  border-radius: 50%;
  background: var(--primary);
}

.event-content strong,
.event-content time,
.event-content span {
  display: block;
}

.event-content strong {
  color: #344158;
  font-size: 13px;
}

.event-content span {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.event-content time {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
}

.timeline-empty {
  padding: 14px;
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.toast-region {
  position: fixed;
  z-index: 80;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: min(360px, calc(100vw - 32px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  color: var(--text);
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--transition), transform var(--transition);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-danger {
  border-left: 4px solid var(--danger);
}

body.drawer-open {
  overflow: hidden;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  50% { opacity: 0.45; }
}

@media (max-width: 1050px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 16px 14px 32px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .scan-summary {
    align-items: flex-start;
  }

  .risk-notice {
    margin-bottom: 20px;
  }

  .risk-notice div {
    display: block;
  }

  .risk-notice strong,
  .risk-notice span {
    display: block;
  }

  .risk-notice span {
    margin-top: 2px;
  }

  .section-heading {
    align-items: flex-end;
  }

  .summary-card {
    min-height: 112px;
    padding: 15px;
  }

  .workspace-card {
    padding: 16px;
  }

  .workspace-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .view-switch {
    width: 100%;
  }

  .view-button {
    flex: 1;
    min-height: 44px;
  }

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

  .search-field {
    grid-column: 1 / -1;
  }

  .filter-bar .button-ghost {
    grid-column: 1 / -1;
    justify-self: stretch;
    margin-top: 0;
    transform: none;
  }

  .table-wrap {
    display: none;
  }

  .account-card-list {
    display: block;
  }

  .result-count {
    margin-top: 12px;
  }

  .feedback-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .feedback-action {
    min-height: 44px;
  }
}

@media (max-width: 520px) {
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .topbar-actions .button {
    width: 100%;
  }

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

  .summary-card {
    min-height: 136px;
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .summary-card strong {
    font-size: 25px;
  }

  .section-meta {
    max-width: 55%;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .search-field,
  .filter-bar .button-ghost {
    grid-column: 1;
  }

  .account-card-data {
    gap: 10px;
  }

  .drawer-overlay {
    align-items: flex-end;
  }

  .case-drawer {
    width: 100%;
    height: min(92vh, 820px);
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
  }

  .drawer-overlay.is-open .case-drawer {
    transform: translateY(0);
  }

  .drawer-header {
    border-radius: 18px 18px 0 0;
  }

  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .drawer-actions {
    grid-template-columns: 1fr;
  }

  .drawer-actions .button-primary {
    grid-row: 1;
  }

  .toast-region {
    right: 16px;
    bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
