:root {
  color-scheme: light;
  --blue: #228dcc;
  --blue-dark: #116da4;
  --ink: #27333b;
  --muted: #71808a;
  --line: #e6ecef;
  --green: #11a252;
  --red: #ef1f27;
  --paper: #ffffff;
  --surface: #f2f6f7;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 0;
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  background: var(--surface);
}

button,
input,
select {
  font: inherit;
}

input,
button,
a {
  -webkit-tap-highlight-color: transparent;
}

input {
  min-width: 0;
}

:focus-visible {
  outline: 3px solid var(--blue-dark);
  outline-offset: 4px;
}

a {
  color: inherit;
}

.query-document {
  background:
    radial-gradient(circle at 15% 10%, rgb(74 144 255 / 14%), transparent 32rem),
    #dce6ec;
}

.query-page {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  background: #f3f6f9;
  box-shadow: 0 0 44px rgb(17 38 51 / 18%);
}

.query-hero {
  position: relative;
  min-height: 300px;
  padding: max(18px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 46px max(24px, env(safe-area-inset-left));
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 86% 6%, rgb(89 187 255 / 70%), transparent 12rem),
    linear-gradient(145deg, #0874b9 0%, #0c5d9b 48%, #093d72 100%);
}

.query-hero::before,
.query-hero::after {
  position: absolute;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 50%;
  content: "";
}

.query-hero::before {
  top: 68px;
  right: -88px;
  width: 260px;
  height: 260px;
}

.query-hero::after {
  top: 112px;
  right: -45px;
  width: 150px;
  height: 150px;
}

.query-nav {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-lockup img {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 8px rgb(0 0 0 / 20%));
}

.brand-lockup div {
  display: grid;
  gap: 1px;
}

.brand-lockup span {
  color: rgb(255 255 255 / 66%);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.brand-lockup strong {
  font-size: 15px;
  letter-spacing: 0.04em;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid rgb(255 255 255 / 19%);
  border-radius: 999px;
  color: rgb(255 255 255 / 86%);
  background: rgb(255 255 255 / 10%);
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(10px);
  flex-shrink: 0;
  white-space: nowrap;
}

.live-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #55e69c;
  box-shadow: 0 0 0 4px rgb(85 230 156 / 15%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  margin-top: 47px;
}

.hero-copy p {
  margin: 0 0 10px;
  color: #72d5ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(29px, 8vw, 38px);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.hero-copy span {
  display: block;
  margin-top: 13px;
  color: rgb(255 255 255 / 66%);
  font-size: 12px;
}

.query-content {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 14px;
  margin-top: -26px;
  padding: 0 max(14px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.query-content > *,
.verification-copy,
.notice-copy {
  min-width: 0;
}

.verification-copy,
.primary-identity,
.notice-copy {
  overflow-wrap: anywhere;
}

.verification-card,
.info-card,
.activity-card,
.record-notice {
  border: 1px solid rgb(22 58 78 / 7%);
  background: white;
  box-shadow: 0 8px 24px rgb(24 58 78 / 7%);
}

.verification-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 18px;
  border-radius: 18px;
}

.verification-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 17px;
  color: white;
  background: linear-gradient(145deg, #2acb7e, #12a760);
  box-shadow: 0 10px 18px rgb(18 167 96 / 20%);
}

.verification-icon svg {
  width: 30px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.verification-copy span,
.primary-identity span,
.activity-label {
  color: #84919a;
  font-size: 11px;
  font-weight: 700;
}

.verification-copy h2 {
  margin: 2px 0;
  color: #11985a;
  font-size: 23px;
}

.verification-copy p {
  margin: 0;
  color: #7b8891;
  font-size: 11px;
}

.status-badge {
  padding: 7px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.value-success {
  color: #0d8b50;
  background: #e9f9f1;
}

.status-badge.value-warning {
  color: #a85f09;
  background: #fff3e2;
}

.status-badge.value-danger {
  color: #b42335;
  background: #fff0f1;
}

.query-invalid .verification-card {
  border-color: #f0bec5;
  background: #fffafa;
}

.query-invalid .verification-icon {
  background: linear-gradient(145deg, #e75a6d, #c72e44);
  box-shadow: 0 10px 18px rgb(199 46 68 / 18%);
}

.query-invalid .verification-copy h2 {
  color: #ba253a;
}

.query-invalid .live-pill {
  border-color: rgb(255 191 197 / 50%);
  background: rgb(190 33 54 / 28%);
}

.query-invalid .live-pill i {
  background: #ff9da8;
  box-shadow: 0 0 0 4px rgb(255 157 168 / 18%);
}

.info-card {
  padding: 20px;
  border-radius: 18px;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-kicker {
  color: #2894ce;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.17em;
}

.card-heading h2 {
  margin: 3px 0 0;
  font-size: 20px;
}

.code-chip {
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid #b6d9ee;
  border-radius: 9px;
  color: #125c8b;
  background: #edf7fd;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.primary-identity {
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f2f8fb, #f8fafb);
}

.primary-identity h3 {
  margin: 6px 0 0;
  color: #22323d;
  font-size: 17px;
  line-height: 1.45;
}

.modern-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 16px 0 0;
}

.modern-details div {
  min-width: 0;
  padding: 14px 10px 4px 0;
  border-top: 1px solid var(--line);
}

.modern-details div:nth-child(even) {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.modern-details .wide {
  grid-column: 1 / -1;
  margin-top: 10px;
  padding-top: 14px;
}

.modern-details dt {
  color: #8a969e;
  font-size: 11px;
}

.modern-details dd {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  color: #33434d;
  font-size: 13px;
  font-weight: 700;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.activity-card {
  display: flex;
  min-width: 0;
  min-height: 118px;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border-radius: 16px;
}

.activity-card.featured {
  grid-column: 1 / -1;
  min-height: auto;
  color: white;
  background: linear-gradient(135deg, #176fa7, #124e85);
}

.activity-card.featured .activity-label,
.activity-card.featured small {
  color: rgb(255 255 255 / 60%);
}

.activity-card strong {
  display: block;
  margin: 9px 0;
  overflow-wrap: anywhere;
  color: #2d3d47;
  font-size: 15px;
  line-height: 1.35;
}

.activity-card.featured strong {
  color: white;
  font-size: 18px;
}

.activity-card .activity-number {
  color: #1673ac;
  font-size: 30px;
  line-height: 1;
}

.activity-card small {
  color: #9aa4aa;
  font-size: 10px;
}

.record-notice {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 18px;
  border-color: #f2d6d8;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgb(255 250 250 / 96%), rgb(255 245 245 / 96%)),
    white;
  box-shadow: 0 8px 24px rgb(135 34 41 / 7%);
}

.notice-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 2px solid #dc3440;
  border-radius: 50%;
  color: #dc3440;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 23px;
  font-weight: 800;
  transform: rotate(-5deg);
}

.notice-copy span {
  color: #cd6c73;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.notice-copy h2 {
  margin: 4px 0 7px;
  color: #c62531;
  font-size: 18px;
}

.notice-copy p {
  margin: 0;
  color: #8f6063;
  font-size: 12px;
  line-height: 1.65;
}

.query-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 0 3px;
  color: #8b989f;
}

.footer-shield {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 8px 8px 11px 11px;
  color: white;
  background: #9caab2;
  font-size: 12px;
}

.query-footer p {
  margin: 0;
  font-size: 9px;
  line-height: 1.55;
}

.admin-document {
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(circle at 15% 0, rgb(34 141 204 / 15%), transparent 35rem),
    #edf3f5;
}

.admin-shell {
  width: min(100% - 48px, 1200px);
  margin: 0 auto;
  padding: 42px 0 70px;
}

.login-shell,
.message-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 24px;
}

.login-card,
.message-card {
  width: min(100%, 480px);
  min-width: 0;
  padding: 34px;
  border: 1px solid #dfe8ec;
  border-radius: 22px;
  background: white;
  box-shadow: 0 24px 80px rgb(29 57 72 / 16%);
}

.message-card {
  text-align: center;
}

.login-emblem {
  width: 66px;
  height: 66px;
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-card h1,
.message-card h1,
.admin-header h1,
.section-heading h2 {
  margin: 0;
  color: #21303a;
}

.login-card h1 {
  font-size: 27px;
}

.intro,
.message-card p,
.section-heading p {
  color: var(--muted);
  line-height: 1.65;
}

.form-alert {
  padding: 10px 12px;
  border: 1px solid #ffd1d1;
  border-radius: 10px;
  color: #a82b2b;
  background: #fff2f2;
  font-size: 14px;
}

.security-features {
  display: grid;
  gap: 8px;
  margin-top: 24px;
  padding: 16px;
  border: 1px solid #d8e8ef;
  border-radius: 12px;
  background: #f4fafc;
}

.security-features p {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 0;
  color: #526771;
  font-size: 12px;
  line-height: 1.5;
}

.security-features span {
  display: inline-grid;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: #20a768;
  font-size: 11px;
  font-weight: 900;
}

.admin-form {
  display: grid;
  gap: 17px;
  margin-top: 24px;
}

.admin-form label {
  display: grid;
  gap: 7px;
  color: #50606a;
  font-size: 14px;
  font-weight: 700;
  min-width: 0;
}

.admin-form input,
.admin-form select {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid #cbd7dd;
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: #fbfcfd;
  font-size: 16px;
}

.admin-form input:focus,
.admin-form select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(34 141 204 / 13%);
}

.primary-button,
.secondary-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--blue);
  color: white;
  background: var(--blue);
}

.primary-button:hover {
  background: var(--blue-dark);
}

.secondary-button {
  border: 1px solid #bfcdd4;
  color: #364852;
  background: white;
}

.text-button {
  border: 0;
  color: #5f7079;
  background: transparent;
}

.link-button {
  width: fit-content;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.admin-header h1 {
  font-size: 28px;
  overflow-wrap: anywhere;
}

.admin-header-actions,
.user-pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.account-scope,
.permission-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.account-scope {
  margin: 8px 0 0;
}

.user-sections {
  display: grid;
  gap: 22px;
}

.user-sections h2 {
  margin: 0;
  font-size: 22px;
}

.user-danger {
  border-color: #e8b6be;
}

.admin-form .checkbox-field {
  display: flex;
  align-items: flex-start;
  line-height: 1.6;
  font-weight: 400;
}

.admin-form .checkbox-field input {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin: 2px 4px 0 0;
}

.user-pagination {
  justify-content: center;
  margin-top: 22px;
  color: var(--muted);
}

.admin-header > div,
.section-heading > div,
.seal-list-item > div {
  min-width: 0;
}

.admin-header > form,
.section-heading > a {
  flex-shrink: 0;
}

.admin-header > .text-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  flex-shrink: 0;
}

.admin-card {
  padding: 25px;
  border: 1px solid #dfe7eb;
  border-radius: 18px;
  background: white;
  box-shadow: 0 12px 38px rgb(30 59 73 / 9%);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  font-size: 22px;
}

.section-heading p {
  margin: 4px 0 0;
  font-size: 13px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.admin-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  margin: 20px 0 4px;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field svg {
  position: absolute;
  left: 15px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #78909c;
  stroke-linecap: round;
  stroke-width: 1.8;
  pointer-events: none;
}

.search-field input {
  width: 100%;
  height: 46px;
  padding: 0 15px 0 45px;
  border: 1px solid #cbd7dd;
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background: #f8fbfc;
  font-size: 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.search-field input:focus {
  border-color: var(--blue);
  background: white;
  box-shadow: 0 0 0 3px rgb(34 141 204 / 13%);
}

.search-field input::placeholder {
  color: #8a9ba4;
}

.search-submit,
.search-clear {
  min-height: 46px;
}

.seal-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px 3px;
  border-bottom: 1px solid var(--line);
}

.seal-list-item:last-child {
  border-bottom: 0;
}

.seal-list-name,
.seal-list-meta {
  margin: 0;
  overflow-wrap: anywhere;
}

.seal-list-name {
  font-size: 17px;
  font-weight: 800;
}

.seal-list-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.seal-list-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.record-state {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.record-state.is-active {
  color: #0d844a;
  background: #e8f7ef;
}

.record-state.is-inactive {
  color: #b42335;
  background: #fff0f1;
}

.seal-list-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seal-list-actions form {
  margin: 0;
}

.deactivate-button {
  border-color: #e8b6be;
  color: #b42335;
  background: #fff7f8;
}

.activate-button {
  border-color: #aed8c3;
  color: #0d844a;
  background: #f2fbf6;
}

.query-link,
.text-link {
  color: var(--blue-dark);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.compact {
  min-height: 44px;
  padding-inline: 15px;
  font-size: 14px;
}

.empty-state {
  display: grid;
  gap: 7px;
  padding: 52px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: #41535d;
  font-size: 16px;
}

.empty-state span {
  font-size: 14px;
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.list-summary {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.page-size-form,
.page-size-form label,
.page-jump,
.page-jump label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #5f707b;
  font-size: 13px;
}

.page-size-form select,
.page-jump input {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid #c7d5db;
  border-radius: 9px;
  color: var(--ink);
  background: white;
  font-size: 16px;
}

.page-size-form select {
  min-width: 76px;
}

.page-jump input {
  width: 96px;
  text-align: center;
}

.pagination {
  display: grid;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.pagination-controls,
.page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.page-link {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid #c7d5db;
  border-radius: 9px;
  color: #364852;
  background: white;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.page-link:hover {
  border-color: var(--blue);
  color: var(--blue-dark);
}

.page-link.disabled {
  color: #a7b4ba;
  background: #f5f7f8;
  pointer-events: none;
}

.page-link.current {
  border-color: var(--blue);
  color: white;
  background: var(--blue);
  font-weight: 800;
}

.page-ellipsis {
  color: var(--muted);
}

.page-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.form-card {
  max-width: 1040px;
  margin: 0 auto;
}

.two-column-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}

.form-actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 10px;
  padding-top: 8px;
}

/* Phone: a single reading flow, full-width search and touch-sized controls. */
@media (max-width: 699px) {
  .admin-shell {
    width: calc(100% - 28px);
    padding-top: 24px;
    padding-bottom: max(32px, env(safe-area-inset-bottom));
  }

  .login-shell,
  .message-shell {
    width: 100%;
    padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  .login-card,
  .message-card,
  .admin-card {
    padding: 22px;
    border-radius: 16px;
  }

  .admin-header,
  .section-heading {
    align-items: flex-start;
    gap: 12px;
  }

  .admin-header h1 {
    font-size: 23px;
  }

  .admin-search {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-field,
  .search-submit:last-child {
    grid-column: 1 / -1;
  }

  .search-clear {
    width: 100%;
  }

  .two-column-form {
    grid-template-columns: 1fr;
  }

  .form-actions {
    grid-column: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .form-actions > a {
    width: 100%;
  }

  .query-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    word-break: break-all;
  }

  .seal-list-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .seal-list-item > .secondary-button {
    width: 100%;
  }

  .seal-list-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .seal-list-actions button {
    width: 100%;
  }

  .page-status {
    text-align: center;
  }

  .page-size-form {
    width: 100%;
    justify-content: flex-end;
  }

  .pagination-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .page-numbers {
    grid-column: 1 / -1;
    grid-row: 1;
    gap: 6px;
  }

  .page-numbers .page-link {
    padding-inline: 10px;
  }

  .pagination-footer {
    flex-direction: column;
  }

  .page-jump {
    max-width: 100%;
    justify-content: center;
  }

  .hero-copy h1 {
    font-size: clamp(29px, 8vw, 40px);
  }
}

@media (max-width: 420px) {
  .section-heading {
    flex-wrap: wrap;
  }

  .section-heading > .link-button {
    width: 100%;
  }

  .admin-card {
    padding: 18px;
  }
}

@media (max-width: 370px) {
  .query-hero {
    padding-right: max(18px, env(safe-area-inset-right));
    padding-left: max(18px, env(safe-area-inset-left));
  }

  .query-nav {
    gap: 8px;
  }

  .live-pill {
    padding-inline: 8px;
  }

  .verification-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .verification-icon {
    width: 48px;
    height: 48px;
  }

  .status-badge {
    grid-column: 2;
    width: fit-content;
  }

  .query-content {
    padding-right: max(10px, env(safe-area-inset-right));
    padding-left: max(10px, env(safe-area-inset-left));
  }

  .record-notice {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    padding: 16px;
  }

  .notice-mark {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  .admin-header {
    flex-wrap: wrap;
  }

  .pagination {
    gap: 8px;
  }

  .page-link {
    padding-inline: 10px;
  }
}

/* Tablet: use both columns while keeping the page comfortable in portrait. */
@media (min-width: 700px) {
  .query-document {
    padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  }

  .query-page {
    max-width: 1000px;
    min-height: calc(100vh - 48px);
    min-height: calc(100svh - 48px);
    border-radius: 22px;
  }

  .query-hero {
    min-height: 290px;
    padding: 28px 32px 64px;
    border-radius: 22px 22px 0 0;
  }

  .hero-copy {
    margin-top: 38px;
  }

  .hero-copy h1 {
    font-size: clamp(32px, 4.5vw, 44px);
  }

  .hero-copy h1 br {
    display: none;
  }

  .hero-copy span {
    font-size: 14px;
  }

  .query-content {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 20px;
    margin-top: -30px;
    padding: 0 28px 28px;
    align-items: start;
  }

  .verification-card,
  .record-notice,
  .query-footer {
    grid-column: 1 / -1;
  }

  .verification-card {
    padding: 22px 24px;
  }

  .info-card {
    height: 100%;
    padding: 24px;
  }

  .activity-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .activity-card {
    min-height: 104px;
    padding: 18px;
  }

  .record-notice {
    padding: 24px;
  }

  .notice-copy h2 {
    font-size: 21px;
  }

  .notice-copy p {
    font-size: 14px;
  }

  .query-footer p {
    font-size: 11px;
  }

  .two-column-form {
    gap: 24px;
  }
}

/* Desktop: a wider workspace and balanced archive / activity columns. */
@media (min-width: 1100px) {
  .query-document {
    padding-block: 40px;
  }

  .query-page {
    max-width: 1180px;
    min-height: calc(100svh - 80px);
    border-radius: 28px;
  }

  .query-hero {
    padding: 32px 44px 66px;
    border-radius: 28px 28px 0 0;
  }

  .query-content {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 24px;
    padding: 0 40px 32px;
  }

  .brand-lockup strong {
    font-size: 18px;
  }

  .brand-lockup img {
    width: 54px;
    height: 54px;
  }

  .live-pill,
  .status-badge {
    font-size: 12px;
  }

  .info-card {
    padding: 28px;
  }

  .primary-identity h3 {
    font-size: 22px;
  }

  .modern-details dd {
    font-size: 15px;
  }

  .activity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: 100%;
    gap: 16px;
  }

  .activity-card {
    min-height: 156px;
    padding: 22px;
  }

  .activity-card.featured {
    min-height: 130px;
  }

  .activity-card.featured strong {
    font-size: 22px;
  }

  .activity-card .activity-number {
    font-size: 40px;
  }

  .admin-card {
    padding: 32px;
  }

  .seal-list-item {
    padding-block: 24px;
  }
}

@media (pointer: coarse) {
  .text-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .search-field input {
    transition: none;
  }
}

/* Seal search and date picker */
.seal-search { display: block; padding: 18px; background: #f5f9fb; border: 1px solid #e1ebf0; border-radius: 14px; }
.seal-search .search-field input { background: #fff; }
.search-options { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-top: 15px; }
.date-filters { min-width: 0; }
.date-caption { display: block; margin-bottom: 8px; color: #526b79; font-size: 13px; font-weight: 600; }
.date-range { display: flex; align-items: center; gap: 10px; }
.date-picker { position: relative; }
.date-picker > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.date-input-wrap { display: flex; align-items: center; width: 168px; height: 44px; border: 1px solid #cbd7dd; border-radius: 10px; background: #fff; }
.date-input-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(34 141 204 / 13%); }
.date-input-wrap input { width: 100%; min-width: 0; padding: 0 4px 0 12px; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; }
.date-input-wrap input::placeholder { color: #90a2ad; }
.date-toggle { flex: none; width: 40px; height: 42px; padding: 10px; border: 0; background: transparent; color: #78909c; cursor: pointer; }
.date-toggle svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.date-toggle:hover { color: var(--blue); }
.date-separator { color: #8598a2; font-size: 14px; }
.search-actions { display: flex; gap: 8px; }
.seal-search .search-submit, .seal-search .search-clear { min-width: 76px; min-height: 44px; }
.date-calendar { position: absolute; z-index: 10; top: calc(100% + 8px); left: 0; width: 280px; padding: 14px; background: #fff; border: 1px solid #d9e4ea; border-radius: 12px; box-shadow: 0 12px 32px rgb(28 65 86 / 16%); }
.date-calendar[hidden] { display: none; }
.calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; color: var(--ink); font-weight: 600; }
.calendar-header button, .calendar-grid button { border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.calendar-header button { width: 36px; height: 36px; font-size: 20px; }
.calendar-header button:hover, .calendar-grid button:hover { background: #eaf5fb; color: #147ab8; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.calendar-weekday { padding: 6px 0; color: #879aa5; font-size: 12px; }
.calendar-grid button { height: 34px; font: inherit; font-size: 13px; }
.calendar-grid button.selected { background: var(--blue); color: #fff; }
.calendar-grid button.today:not(.selected) { color: #147ab8; font-weight: 700; }
@media (max-width: 699px) {
  .seal-search { padding: 14px; }
  .search-options { align-items: stretch; flex-direction: column; gap: 14px; }
  .date-range { gap: 6px; }
  .date-picker { flex: 1; min-width: 0; }
  .date-input-wrap { width: 100%; }
  .date-calendar { max-width: min(280px, calc(100vw - 64px)); }
  .date-picker:last-child .date-calendar { left: auto; right: 0; }
  .search-actions > * { flex: 1; text-align: center; }
}

.engraved-field { min-width: 0; }
.engraved-field > label { margin-bottom: 7px; }
.engraved-field .date-picker > .date-input-wrap { width: 100%; height: 48px; background: #fbfcfd; }
.admin-form .engraved-field .date-input-wrap input { height: 46px; border: 0; box-shadow: none; background: transparent; }
.datetime-hint { display: block; margin-top: 6px; color: #78909c; font-size: 12px; }
.calendar-time { display: flex; gap: 8px; padding-top: 12px; margin-top: 8px; border-top: 1px solid #e1ebf0; }
.admin-form .calendar-time label { display: flex; flex: 1; align-items: center; gap: 3px; color: #526b79; font-size: 12px; }
.admin-form .calendar-time select { min-width: 0; height: 36px; padding: 0 2px; font-size: 14px; }
