/* Theme tokens and frontend components. Responsive variants are grouped at the end. */
/* Theme tokens */

:root {
  color-scheme: light;
  --danger: #ff3b30;
  --danger-soft: rgba(255, 59, 48, 0.09);
  --header-height: 68px;
  --nav-height: 66px;
  --bg: #f5f7fa;
  --surface: #fff;
  --surface-soft: #f5f5f7;
  --surface-raised: #fff;
  --text: #1d1d1f;
  --text-secondary: #6e7480;
  --text-tertiary: #7b8290;
  --line: rgba(30, 60, 95, .065);
  --line-strong: rgba(30, 60, 95, .14);
  --accent: #0071e3;
  --accent-hover: #005fc6;
  --accent-soft: rgba(0, 113, 227, .08);
  --shadow-sm: 0 4px 16px rgba(32, 60, 98, .035);
  --shadow-lg: 0 24px 80px rgba(20, 42, 74, .18);
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --content-width: 760px;
  --control-height: 46px;
  --panel-padding: 20px;
  --section-gap: 14px;
  --dock-muted: #999;
  --secondary-bg: #fff;
  --secondary-border: rgba(0,113,227,.08);
  --secondary-hover-bg: #fff;
  --secondary-hover-border: rgba(0,113,227,.16);
  --secondary-hover-color: #005fc6;
}

/* Dark theme */

html[data-theme="dark"] {
  color-scheme: dark;
  --danger: #ff453a;
  --danger-soft: rgba(255, 69, 58, 0.12);
  --bg: #16181d;
  --surface: #22252c;
  --surface-soft: #2b2f37;
  --surface-raised: #242830;
  --text: #f5f5f7;
  --text-secondary: #acb3c0;
  --text-tertiary: #969eac;
  --line: rgba(255, 255, 255, .065);
  --line-strong: rgba(255, 255, 255, .14);
  --accent: #4fa8ff;
  --accent-hover: #75bcff;
  --accent-soft: rgba(79, 168, 255, .12);
  --shadow-sm: 0 4px 20px rgba(0, 0, 0, .12);
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, .4);
  --dock-muted: #acb3c0;
  --secondary-bg: var(--surface-soft);
  --secondary-border: rgba(79,168,255,.24);
  --secondary-hover-bg: #343a45;
  --secondary-hover-border: rgba(79,168,255,.38);
  --secondary-hover-color: #8ac5ff;
}

/* Foundations and accessibility */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

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

button {
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.52;
}

a {
  -webkit-tap-highlight-color: transparent;
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-width: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Page shell and header */

.zz-shell {
  min-height: 100vh;
}

.zz-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: var(--header-height);
  padding: max(10px, env(safe-area-inset-top)) max(24px, calc((100vw - var(--content-width)) / 2));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.zz-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.zz-brand-logo {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.zz-brand-title {
  overflow: hidden;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zz-icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.zz-icon-button:active {
  transform: scale(0.94);
}

.zz-theme-toggle {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.zz-theme-toggle:hover {
  border-color: transparent;
  background: var(--accent-soft);
}

.zz-theme-icon-half {
  fill: currentColor;
  stroke: none;
}

html[data-theme="dark"] .zz-theme-icon {
  color: #f5f5f7;
  transform: rotate(180deg);
}

.zz-page {
  display: none;
  animation: zz-page-in 220ms ease both;
}

.zz-page.is-active {
  display: block;
}

.zz-dialog-head .zz-icon-button {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  box-shadow: none;
  font-size: 22px;
}

.zz-icon-button {
  display: inline-grid;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
  width: 44px;
  height: 44px;
  flex-basis: 44px;
}

.zz-theme-icon {
  fill: none;
  color: var(--accent);
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  transition: color 180ms ease, transform 180ms ease;
  width: 21px;
  height: 21px;
}

.zz-top-tools {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: calc(12px + env(safe-area-inset-top)) max(5%, calc((100vw - 760px) / 2)) 12px;
  background: var(--bg);
}

.zz-top-tools .zz-brand {
  min-width: 0;
  flex: 1;
  gap: 10px;
}

.zz-top-tools .zz-brand-copy {
  min-width: 0;
}

.zz-top-tools .zz-brand-logo {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.zz-top-tools .zz-brand-title {
  font-size: 18px;
}

.zz-top-tools .zz-theme-toggle {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.zz-main {
  margin: 0 auto;
  padding: 20px 0 calc(var(--nav-height) + 28px + env(safe-area-inset-bottom));
  width: min(90%, 760px);
  padding-top: 8px;
  padding-bottom: calc(140px + env(safe-area-inset-bottom));
}

.zz-sheet-head .zz-icon-button {
  flex-basis: 34px;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  min-height: 32px;
  background: transparent;
  color: var(--text-tertiary);
  border: 0;
  box-shadow: none;
  font-size: 24px;
  font-weight: 300;
}

/* Shared controls */

.zz-search span {
  color: var(--text-tertiary);
  font-size: 20px;
  line-height: 1;
}

.zz-search input::-webkit-search-cancel-button {
  opacity: 0.55;
}

.zz-search input::placeholder,
.zz-query-line input::placeholder {
  color: var(--text-tertiary);
}

.zz-query-line input:focus,
.zz-field-list input:focus,
.zz-field-list textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.zz-outline:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.zz-outline.is-danger {
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
  color: var(--danger);
}

.zz-outline.is-danger:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.zz-primary.full {
  width: 100%;
}

.zz-field-list > label:last-child,
.zz-field-list > .zz-field-udid,
.zz-field-list > .zz-field-exchange,
.zz-field-list > .zz-field-selfsign {
  grid-column: 1 / -1;
}

.zz-field-list input[type="file"] {
  height: auto;
  padding: 9px;
  font-size: 13px;
}

.zz-record-query-card .zz-query-line input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.01em;
}

.zz-search {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  padding: 0 13px;
  height: 48px;
  padding-inline: 16px;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.zz-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.zz-search-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  color: var(--text-tertiary);
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.zz-search input {
  width: 100%;
  min-width: 0;
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 14px;
}

.zz-primary:hover {
  background: #0066ce;
}

.zz-toolbar .zz-primary {
  min-height: 48px;
  padding-inline: 23px;
}

.zz-outline.small {
  padding: 0 12px;
  font-size: 12px;
  min-height: 36px;
}

.zz-primary {
  display: inline-flex;
  min-height: var(--control-height);
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  color: #fff;
  background: #0071e3;
  box-shadow: 0 4px 12px rgba(0,113,227,.2);
  border-radius: 14px;
  font-weight: 600;
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.zz-outline {
  display: inline-flex;
  min-height: var(--control-height);
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid var(--line-strong);
  border-color: transparent;
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-weight: 500;
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.zz-primary:active,
.zz-outline:active {
  filter: brightness(0.94);
  transform: scale(.97);
}

.zz-upload-card .zz-outline {
  background: var(--surface);
  padding-inline: 14px;
}

.zz-query-line {
  display: flex;
  align-items: stretch;
  margin-top: 10px;
  gap: 10px;
}

.zz-query-line input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  flex: 1;
  padding: 0 12px;
  border-color: transparent;
  height: 46px;
  font-size: 14px;
}

.zz-field-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 12px;
  margin-bottom: 0;
}

.zz-field-list > label {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 400;
}

.zz-field-list input {
  width: 100%;
  min-width: 0;
  background: var(--surface-soft);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  display: block;
  resize: vertical;
  margin-top: 6px;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
}

.zz-field-list input::placeholder,
.zz-field-list textarea::placeholder {
  font-weight: 400;
  color: var(--text-tertiary);
}

.zz-field-list textarea {
  width: 100%;
  min-width: 0;
  background: var(--surface-soft);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  display: block;
  resize: vertical;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  min-height: 68px;
}

.zz-advanced-body .zz-outline {
  min-height: 36px;
  background: var(--surface);
  color: var(--accent);
  font-size: 12px;
  font-weight: 400;
  box-shadow: none;
}

.zz-primary.large {
  font-size: 15px;
  min-height: 46px;
  border-radius: 14px;
}

.zz-outline.zz-secondary-action {
  display: inline-flex;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 12px;
  border: 1px solid var(--secondary-border);
  border-radius: 12px;
  background: var(--secondary-bg);
  color: var(--accent);
  box-shadow: none;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.zz-outline.zz-secondary-action:hover {
  border-color: var(--secondary-hover-border);
  background: var(--secondary-hover-bg);
  color: var(--secondary-hover-color);
}

.zz-outline.zz-secondary-action.is-danger,
.zz-outline.zz-secondary-action.is-danger:hover {
  color: var(--danger);
}

/* Library and device status */

.zz-notice-list p {
  margin: 3px 0 0;
}

.zz-chip-row::-webkit-scrollbar {
  display: none;
}

.zz-chip:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.zz-upload-body {
  min-width: 0;
  flex: 1;
}

html[data-theme="dark"] .zz-app-card:hover {
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
}

.zz-app-info {
  min-width: 0;
}

.zz-device-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 88px;
  margin-bottom: 22px;
  padding: 18px 20px;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, #0071e3, #4facfe);
  color: white;
  box-shadow: 0 10px 24px rgba(0,113,227,.18);
}

.zz-device-symbol {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 12px;
  background: rgba(255,255,255,.2);
  color: white;
}

.zz-device-symbol i {
  font-size: 22px;
}

.zz-device-copy {
  min-width: 0;
  flex: 1;
}

.zz-device-copy strong {
  font-size: 15px;
  font-weight: 600;
}

.zz-device-copy p {
  margin: 5px 0 0;
  color: rgba(255,255,255,.9);
  font-size: 11px;
}

.zz-device-udid {
  display: block;
  width: 100%;
  min-height: 26px;
  padding: 2px 0;
  overflow: hidden;
  background: transparent;
  color: rgba(255,255,255,.9);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zz-device-action {
  display: inline-flex;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  color: white;
  font-size: 12px;
  font-weight: 500;
}

.zz-device-action span {
  font-size: 22px;
  font-weight: 400;
}

.zz-device-connected {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 20px;
  background: rgba(52,199,89,.1);
  color: #238445;
  font-size: 10px;
}

html[data-theme="dark"] .zz-device-connected {
  color: #71dc8d;
}

.zz-notice-panel {
  border: 1px solid var(--line);
  padding: 18px 20px;
  margin-bottom: 18px;
  border-color: transparent;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.zz-notice-title {
  display: flex;
  align-items: center;
  font-size: 15px;
  color: var(--text);
  gap: 10px;
  margin-bottom: 10px;
}

.zz-notice-dot {
  border-radius: 50%;
  background: var(--accent);
  width: 5px;
  height: 5px;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.zz-notice-list {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.zz-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.zz-sign-btn:active {
  filter: brightness(0.94);
  transform: scale(.97);
}

.zz-chip:active {
  transform: scale(.97);
}

.zz-chip-row {
  display: flex;
  margin: 0 0 14px;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 10px;
  margin-bottom: 22px;
  padding: 4px 2px 6px;
}

.zz-chip {
  flex: 0 0 auto;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
  min-height: 38px;
  padding-inline: 18px;
  border-color: transparent;
  background: var(--surface);
  font-size: 13px;
  box-shadow: 0 2px 10px rgba(0,0,0,.03);
}

.zz-chip.is-active {
  color: #fff;
  border-color: transparent;
  background: #0071e3;
  box-shadow: 0 4px 12px rgba(0,113,227,.17);
}

.zz-upload-card {
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  border-radius: var(--radius-md);
  gap: 12px;
  margin-bottom: 24px;
  padding: 18px;
  border-style: dashed;
  border-color: rgba(0,113,227,.2);
  box-shadow: none;
  background: var(--accent-soft);
}

.zz-upload-icon {
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  color: var(--accent);
  font-size: 25px;
  font-weight: 300;
  width: 44px;
  height: 44px;
  flex-basis: 44px;
  border-radius: 14px;
  background: var(--surface);
}

.zz-upload-title {
  margin-bottom: 3px;
  font-weight: 650;
  font-size: 14px;
}

.zz-upload-desc {
  overflow: hidden;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.zz-list {
  display: grid;
  gap: 14px;
}

.zz-app-card {
  display: grid;
  align-items: center;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  grid-template-columns: 64px minmax(0,1fr) auto;
  min-height: 110px;
  gap: 16px;
  padding: 20px;
  border: 1px solid transparent;
  border-radius: 20px;
}

.zz-app-card:hover {
  transform: translateY(-1px);
  border-color: rgba(0,113,227,.12);
  box-shadow: 0 8px 24px rgba(32,60,98,.075);
}

.zz-app-icon {
  object-fit: cover;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(20,40,70,.08);
}

.zz-app-title-row {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
}

.zz-app-title-row h3 {
  overflow: hidden;
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.zz-app-title-row span {
  flex: 0 0 auto;
  color: var(--text-tertiary);
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.zz-app-meta {
  overflow: hidden;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 5px;
  font-size: 10px;
}

.zz-app-info p {
  display: -webkit-box;
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--text-secondary);
  -webkit-box-orient: vertical;
  margin-top: 4px;
  font-size: 11px;
  -webkit-line-clamp: 1;
}

.zz-sign-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  line-height: 1;
  white-space: nowrap;
  font-weight: 600;
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
  min-width: 68px;
  min-height: 40px;
  padding-inline: 18px;
  border: 0;
  border-radius: 20px;
  background: #0071e3;
  color: white;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,113,227,.2);
}

.zz-sign-btn:hover {
  background: #0066ce;
  color: white;
}

.zz-sign-btn.is-disabled {
  pointer-events: none;
  background: var(--surface-soft);
  color: var(--text-tertiary);
}

/* Records and signing tasks */

.zz-record-list {
  display: grid;
  gap: var(--section-gap);
}

.zz-record-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.zz-record-card p {
  margin: 4px 0;
  color: var(--text-secondary);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.zz-sign-task-card {
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
}

.zz-sign-task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.zz-sign-task-head h3 {
  min-width: 0;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.zz-record-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.zz-record-hero h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.zz-record-hero p {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.zz-record-query-state.is-loading {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
}

.zz-record-query-state.is-ready {
  border-color: rgba(34, 197, 94, 0.18);
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.zz-record-query-state.is-empty {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--text-tertiary);
}

.zz-record-summary[hidden] {
  display: none;
}

.zz-record-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.zz-record-summary span {
  color: var(--text-secondary);
  font-size: 12px;
}

.zz-record-summary strong {
  font-size: 20px;
  line-height: 1;
}

.zz-record-card.is-success::before {
  background: #22c55e;
}

.zz-record-card.is-pending::before {
  background: var(--accent);
}

.zz-record-card.is-failed::before {
  background: var(--danger);
}

.zz-record-title h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.35;
}

.zz-record-title p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.zz-record-meta-item {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.zz-record-meta-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 650;
}

.zz-record-meta-item strong {
  display: block;
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 550;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.zz-record-error > strong {
  display: block;
  margin-bottom: 4px;
  color: var(--danger);
  font-size: 11px;
}

.zz-record-error p,
.zz-record-progress p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.zz-record-progress > span {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 2px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: zz-record-spin 0.8s linear infinite;
}

.zz-sign-task-status {
  background: var(--surface-soft);
  color: var(--text-secondary);
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.zz-sign-task-status.is-pending {
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
  background: var(--accent-soft);
  color: var(--accent);
}

.zz-sign-task-status.is-success {
  border-color: rgba(34, 197, 94, 0.16);
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.zz-sign-task-status.is-failed {
  border-color: color-mix(in srgb, var(--danger) 18%, transparent);
  background: var(--danger-soft);
  color: var(--danger);
}

.zz-record-hero {
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: var(--section-gap);
  padding: 22px 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: radial-gradient(circle at 92% 14%, var(--accent-soft), transparent 30%),
    var(--surface);
  box-shadow: var(--shadow-sm);
  display: none !important;
}

.zz-record-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: var(--section-gap);
  display: none !important;
}

.zz-record-query-state {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  display: none !important;
}

.zz-record-query-card {
  border-radius: var(--radius-md);
  margin-bottom: var(--section-gap);
  padding: var(--panel-padding);
}

.zz-record-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--line-strong);
  display: none !important;
  content: none !important;
}

.zz-record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.zz-record-head h3 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.45;
}

.zz-record-card > p {
  margin: 4px 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.zz-record-meta {
  grid-template-columns: minmax(240px, 1.5fr) minmax(120px, 0.7fr) minmax(150px, 0.8fr);
  gap: 10px;
  margin-top: 14px;
  display: none !important;
}

.zz-record-title {
  min-width: 0;
  display: none !important;
}

.zz-record-error {
  margin-top: 12px;
  padding: 12px 13px;
  border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--danger) 18%, var(--line));
  background: var(--danger-soft);
  display: none !important;
}

.zz-record-progress {
  margin-top: 12px;
  padding: 12px 13px;
  border-radius: 11px;
  align-items: center;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  background: var(--accent-soft);
  display: none !important;
}

.zz-record-message.is-failed {
  margin-top: 8px;
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, var(--danger) 16%, var(--line));
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
}

.zz-record-message.is-pending {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
  border-radius: 10px;
  background: var(--accent-soft);
}

.zz-record-message.is-pending > span {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: zz-record-spin 0.8s linear infinite;
}

.zz-record-message.is-pending p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.zz-record-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 0;
  border-top: 0;
}

.zz-record-actions > a,
.zz-record-actions > button {
  min-height: var(--control-height);
}

.zz-query-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--section-gap);
  border-color: transparent;
  border-radius: 20px;
  padding: 20px;
}

.zz-query-card > label {
  display: block;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
}

.zz-record-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  position: static;
  overflow: visible;
  transition: none;
  border-color: transparent;
  border-radius: 20px;
  padding: 20px;
}

/* Member and help pages */

.zz-member-card > div {
  min-width: 0;
  flex: 1;
}

.zz-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: var(--section-gap);
}

.zz-form-card > label:not(:first-child) {
  margin-top: 14px;
}

.zz-action-list > :last-child {
  border-bottom: 0;
}

.zz-action-list > a:hover,
.zz-action-list > button:hover {
  background: var(--surface-soft);
}

.zz-action-list em {
  color: var(--text-tertiary);
  font-size: 20px;
  font-style: normal;
}

.zz-empty.compact {
  padding-block: 34px;
}

.zz-empty h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.zz-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.zz-action-list,
.zz-help-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border-color: transparent;
  border-radius: 20px;
}

.zz-form-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--section-gap);
  border-color: transparent;
  border-radius: 20px;
  padding: 20px;
}

.zz-form-card > label {
  display: block;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
}

.zz-help-list {
  display: grid;
  gap: 16px;
}

.zz-help-card h2 {
  margin: 0;
  font-weight: 650;
  line-height: 1.45;
  padding: 18px 20px 0;
  border: 0;
  font-size: 15px;
}

.zz-help-card p {
  margin: 0;
  color: var(--text-secondary);
  white-space: pre-line;
  padding: 10px 20px 20px;
  font-size: 13px;
  line-height: 1.85;
}

.zz-member-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--section-gap);
  border-color: transparent;
  border-radius: 20px;
  padding: 22px 20px;
  background: linear-gradient(115deg, var(--surface), var(--accent-soft));
}

.zz-member-logo {
  flex: 0 0 50px;
  object-fit: cover;
  width: 58px;
  height: 58px;
  flex-basis: 58px;
  border-radius: 17px;
  border: 0;
}

.zz-member-card h2 {
  margin: 0 0 3px;
  font-size: 18px;
}

.zz-member-card p {
  overflow: hidden;
  margin: 0;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
}

.zz-stat {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  border-color: transparent;
  border-radius: 20px;
  padding: 20px;
}

.zz-stat span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 12px;
}

.zz-stat strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.zz-action-list > a,
.zz-action-list > button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  min-height: 58px;
  padding-inline: 20px;
  font-size: 14px;
}

.zz-empty {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 42px 18px;
  text-align: center;
  border-color: transparent;
  border-radius: 20px;
  padding-block: 48px;
}

.zz-empty-icon {
  position: relative;
  margin: 0 auto 12px;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  background: var(--accent-soft);
}

.zz-empty-icon::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-tertiary);
  border-radius: 50%;
  content: "";
  transform: translate(-58%, -58%);
  border-color: var(--accent);
}

.zz-empty-icon::after {
  position: absolute;
  width: 8px;
  height: 2px;
  border-radius: 2px;
  content: "";
  transform: rotate(45deg);
  top: 32px;
  left: 31px;
  background: var(--accent);
}

.zz-empty p {
  max-width: 520px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 12px;
}

/* Bottom navigation */

.zz-nav-mask {
  display: block;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.zz-nav-home {
  -webkit-mask-image: url('../img/nav/nav-home.png');
  mask-image: url('../img/nav/nav-home.png');
}

.zz-nav-records {
  -webkit-mask-image: url('../img/nav/nav-records.png');
  mask-image: url('../img/nav/nav-records.png');
}

.zz-nav-help {
  -webkit-mask-image: url('../img/nav/nav-help.png');
  mask-image: url('../img/nav/nav-help.png');
}

.zz-nav-member {
  -webkit-mask-image: url('../img/nav/nav-member.png');
  mask-image: url('../img/nav/nav-member.png');
}

html[data-theme="dark"] .zz-bottom-nav {
  border-color: var(--line-strong);
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}

.zz-bottom-nav button:hover,
.zz-bottom-nav button:focus,
.zz-bottom-nav button:active {
  background: transparent;
  color: var(--dock-muted);
  box-shadow: none;
}

.zz-bottom-nav button.is-active,
.zz-bottom-nav button.is-active:hover,
.zz-bottom-nav button.is-active:focus,
.zz-bottom-nav button.is-active:active {
  background: transparent;
  color: var(--accent);
}

.zz-bottom-nav {
  position: fixed;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  right: auto;
  bottom: calc(30px + env(safe-area-inset-bottom));
  left: 50%;
  width: min(85%, 400px);
  height: 70px;
  padding: 0 10px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line);
  border-radius: 40px;
  background: var(--surface);
  background-clip: padding-box;
  box-shadow: 0 15px 40px rgba(0,0,0,.12);
  transform: translateX(-50%);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.zz-bottom-nav button {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-weight: 500;
  height: 50px;
  align-self: center;
  gap: 4px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--dock-muted);
  font-size: 10px;
  transition: color .2s;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.zz-bottom-nav button > * {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.zz-bottom-nav button:focus-visible {
  border-radius: 14px;
  outline-offset: -2px;
}

.zz-bottom-nav button i {
  width: 24px;
  height: 22px;
  font-size: 20px;
  line-height: 22px;
  text-align: center;
}

.zz-nav-badge {
  position: absolute;
  left: calc(50% + 7px);
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  line-height: 13px;
  text-align: center;
  top: 1px;
}

/* Dialogs and signing form */

.zz-dialog-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.zz-segment.zz-segment-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.zz-segment label {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.zz-segment input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.zz-segment label.is-unavailable {
  cursor: not-allowed;
}

.zz-segment label.is-unavailable span {
  opacity: 0.48;
}

.zz-field-is-hidden {
  display: none !important;
}

.zz-udid-get,
.zz-buy-cert {
  min-height: 40px;
  flex: 0 0 auto;
  padding-inline: 14px;
}

.zz-dialog {
  position: fixed;
  z-index: 80;
  top: 50%;
  left: 50%;
  width: min(calc(100% - 32px), 520px);
  max-height: min(78vh, 720px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, -50%);
}

.zz-cert-download-tip {
  margin: 0 0 14px;
}

.zz-cert-actions {
  display: flex;
  gap: 10px;
}

.zz-cert-actions > * {
  flex: 1;
}

.zz-mask,
.zz-dialog-mask {
  position: fixed;
  z-index: 60;
  inset: 0;
  background: rgba(14,27,44,.35);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.zz-sheet {
  position: fixed;
  z-index: 70;
  overflow-y: auto;
  top: 50%;
  right: auto;
  bottom: auto;
  left: 50%;
  width: min(90%, 380px);
  max-height: 90vh;
  margin: 0;
  padding: 25px;
  border: 0;
  border-radius: 24px;
  background: var(--surface-raised);
  box-shadow: 0 25px 60px rgba(0,0,0,.25);
  transform: translate(-50%, -46%);
  opacity: 0;
  transition: transform .2s ease, opacity .2s ease;
}

.zz-sheet:not(.is-open) {
  visibility: hidden;
}

.zz-sheet.is-open {
  transform: translate(-50%, -50%);
  opacity: 1;
}

.zz-sheet-handle {
  width: 42px;
  height: 5px;
  margin: 0 auto 10px;
  border-radius: 4px;
  background: var(--line-strong);
  display: none;
}

.zz-sheet-head {
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  display: block;
  margin: 0 0 18px;
  padding: 0 12px;
  text-align: center;
}

.zz-sheet-head h2 {
  margin: 0;
  letter-spacing: -0.02em;
  font-size: 18px;
  font-weight: 700;
}

.zz-sheet-head p {
  margin: 2px 0 0;
  margin-top: 5px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.zz-segment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
  padding: 0;
  gap: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.zz-segment span {
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  position: relative;
  min-height: 40px;
  border-radius: 0;
  font-size: 13px;
  font-weight: 500;
}

.zz-segment input:checked + span {
  background: transparent;
  color: var(--accent);
  box-shadow: none;
}

.zz-segment input:checked + span::after {
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  content: "";
}

.zz-segment input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.zz-sign-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-md);
  padding: 0;
  margin: 0 0 14px;
  border: 0;
  background: transparent;
}

.zz-sign-preview img {
  object-fit: cover;
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.zz-sign-basics {
  grid-template-columns: 1fr;
}

.zz-sign-basics input {
  background: var(--surface-soft);
}

.zz-udid-line,
.zz-exchange-line {
  align-items: flex-end;
  gap: 8px;
  position: relative;
  display: block;
}

.zz-udid-line input,
.zz-exchange-line input {
  min-width: 0;
  flex: 1;
  width: 100%;
  padding-right: 88px;
}

.zz-udid-line .zz-udid-get,
.zz-exchange-line .zz-buy-cert {
  position: absolute;
  top: 0;
  right: 4px;
  min-height: 44px;
  min-width: 76px;
  padding: 0 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  box-shadow: none;
}

.zz-advanced {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.zz-advanced summary {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
  color: var(--accent);
  font-size: 14px;
  font-weight: 400;
}

.zz-advanced summary::-webkit-details-marker {
  display: none;
}

.zz-advanced summary svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zz-advanced[open] summary svg {
  transform: rotate(180deg);
}

.zz-advanced-body {
  padding: 15px;
  border-radius: 12px;
  background: var(--surface-soft);
}

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

.zz-advanced-fields > label:nth-child(-n+2) {
  grid-column: 1 / -1;
}

.zz-advanced-fields > label.zz-field-description {
  grid-column: 1 / -1;
  min-width: 0;
}

.zz-field-description textarea {
  width: 100%;
  min-height: 88px;
}

.zz-advanced-fields input,
.zz-advanced-fields textarea {
  background: var(--surface);
  font-size: 13px;
}

.zz-modal-buttons {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.zz-modal-buttons > button {
  min-width: 0;
  min-height: 46px;
  flex: 1;
  padding-inline: 10px;
  border: 0;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
}

.zz-cancel {
  background: var(--surface-soft);
  color: var(--text-secondary);
}

.zz-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
}

.zz-dialog-body {
  max-height: calc(min(78vh, 720px) - 72px);
  overflow-y: auto;
  color: var(--text-secondary);
  line-height: 1.75;
  white-space: pre-line;
  padding: 20px;
}

.zz-toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  display: flex;
  align-items: center;
  text-align: left;
  transform: translateX(-50%);
  animation: zz-toast-in 180ms ease-out both;
  top: calc(78px + env(safe-area-inset-top));
  width: max-content;
  max-width: min(calc(100% - 40px), 360px);
  gap: 9px;
  padding: 9px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 4px 18px rgba(20,42,74,.12);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  pointer-events: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.zz-toast::before {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 27%, var(--accent) 0 1px, transparent 1.2px), linear-gradient(var(--accent), var(--accent)) center 70% / 2px 5px no-repeat;
  box-shadow: none;
  content: "";
}

.zz-toast.is-category::before {
  width: 6px;
  height: 10px;
  flex: 0 0 6px;
  margin: -3px 2px 0 1px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  border-radius: 0;
  background: transparent;
  transform: rotate(45deg);
}

.zz-segment.zz-segment-1 {
  grid-template-columns: 1fr;
}

@keyframes zz-page-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes zz-toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, -7px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

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

@media (max-width: 700px) {
  :root {
    --header-height: 60px;
    --nav-height: 58px;
    --control-height: 44px;
    --section-gap: 10px;
    --panel-padding: 14px;
  }

  .zz-header {
    padding-right: 14px;
    padding-left: 14px;
  }

  .zz-brand-logo {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 9px;
  }

  .zz-brand-title {
    font-size: 16px;
  }

  .zz-main {
    width: 90%;
  }

  .zz-top-tools {
    padding-top: calc(8px + env(safe-area-inset-top));
    padding-bottom: 8px;
  }

  .zz-query-line .zz-primary {
    padding-inline: 13px;
  }

  .zz-field-list > .zz-field-udid,
  .zz-field-list > .zz-field-exchange,
  .zz-field-list > .zz-field-selfsign,
  .zz-field-list > label {
    grid-column: auto;
  }

  .zz-toolbar .zz-primary {
    min-height: 44px;
    padding-inline: 18px;
  }

  .zz-search input,
  .zz-field-list input,
  .zz-field-list textarea {
    font-size: 16px;
  }

  .zz-search {
    height: 44px;
    padding-inline: 13px;
  }

  .zz-search input::placeholder {
    font-size: 12px;
  }

  .zz-upload-card .zz-outline {
    padding-inline: 12px;
    font-size: 12px;
  }

  .zz-query-line {
    margin-top: 8px;
  }

  .zz-query-line input {
    font-size: 16px;
    height: 44px;
  }

  .zz-field-list {
    gap: 12px;
  }

  .zz-modal-buttons .zz-primary.large {
    min-height: 44px;
  }

  .zz-sheet .zz-field-list input,
  .zz-sheet .zz-field-list textarea {
    font-size: 15px;
  }

  .zz-notice-panel {
    padding: 14px 16px;
    margin-bottom: 14px;
  }

  .zz-notice-title {
    margin-bottom: 6px;
  }

  .zz-notice-list {
    line-height: 1.65;
  }

  .zz-device-banner {
    min-height: 72px;
    padding: 10px 14px;
    gap: 9px;
    margin-bottom: 14px;
  }

  .zz-device-symbol {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .zz-device-copy strong {
    font-size: 14px;
  }

  .zz-device-copy p {
    font-size: 10px;
  }

  .zz-device-action {
    font-size: 11px;
    gap: 3px;
  }

  .zz-toolbar {
    margin-bottom: 10px;
  }

  .zz-chip-row {
    margin-bottom: 14px;
    padding-top: 2px;
    padding-bottom: 4px;
  }

  .zz-chip {
    min-height: 36px;
    padding-inline: 17px;
    font-size: 12px;
  }

  .zz-upload-card {
    margin-bottom: 16px;
    padding: 10px 14px;
    gap: 10px;
  }

  .zz-upload-icon {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .zz-list {
    gap: 10px;
  }

  .zz-app-card {
    grid-template-columns: 52px minmax(0,1fr) auto;
    gap: 10px;
    padding: 12px 14px;
    min-height: 84px;
  }

  .zz-app-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
  }

  .zz-app-title-row {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .zz-app-title-row h3 {
    min-width: 0;
    max-width: 100%;
    font-size: 15px;
  }

  .zz-app-meta {
    margin-top: 3px;
    font-size: 9px;
  }

  .zz-app-info p {
    font-size: 10px;
  }

  .zz-sign-btn {
    grid-column: auto;
    width: auto;
    min-width: 58px;
    padding-inline: 14px;
    font-size: 13px;
  }

  .zz-record-hero h1 {
    font-size: 21px;
  }

  .zz-record-hero p {
    font-size: 12px;
  }

  .zz-record-summary > div {
    min-height: 58px;
    padding: 12px;
  }

  .zz-record-hero {
    padding: 17px;
  }

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

  .zz-record-meta {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .zz-record-actions > a,
  .zz-record-actions > button {
    justify-content: center;
    flex: 0 0 auto;
  }

  .zz-query-card,
  .zz-record-card,
  .zz-form-card,
  .zz-stat {
    padding: 14px;
  }

  .zz-form-card > label:not(:first-child) {
    margin-top: 12px;
  }

  .zz-member-card {
    padding: 16px;
    gap: 10px;
  }

  .zz-member-logo {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    border-radius: 14px;
  }

  .zz-action-list > a,
  .zz-action-list > button {
    min-height: 50px;
  }

  .zz-help-card h2 {
    padding: 14px 16px 0;
  }

  .zz-help-card p {
    padding: 8px 16px 14px;
  }

  .zz-empty,
  .zz-empty.compact {
    padding-block: 32px;
  }

  .zz-nav-mask {
    width: 19px;
    height: 19px;
  }

  .zz-bottom-nav {
    bottom: calc(22px + env(safe-area-inset-bottom));
    height: 62px;
    border-radius: 34px;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
  }

  .zz-udid-line,
  .zz-exchange-line {
    flex-direction: row;
  }

  .zz-toast {
    top: calc(70px + env(safe-area-inset-top));
  }

  .zz-sheet {
    padding: 20px;
  }

  .zz-sheet-head,
  .zz-segment {
    margin-bottom: 14px;
  }

  .zz-segment span {
    min-height: 36px;
  }

  .zz-advanced {
    margin-top: 14px;
  }

  .zz-advanced summary {
    min-height: 44px;
  }

  .zz-advanced-body {
    padding: 12px;
  }

  .zz-modal-buttons > button {
    min-height: 44px;
  }

  .zz-sheet .zz-advanced-fields input,
  .zz-sheet .zz-advanced-fields textarea {
    font-size: 13px;
  }
}

@media (max-width: 420px) {
  .zz-upload-desc {
    white-space: normal;
  }

  .zz-record-title h3 {
    font-size: 16px;
  }

  .zz-record-hero {
    flex-direction: column;
    gap: 13px;
  }

  .zz-record-query-state {
    align-self: flex-start;
  }

  .zz-record-head {
    gap: 10px;
  }

  .zz-record-actions {
    grid-template-columns: none;
  }

  .zz-record-actions > a,
  .zz-record-actions > button {
    width: auto;
  }

  .zz-cert-actions {
    flex-direction: column;
  }
}

@media (max-width: 360px) {
  .zz-sheet .zz-field-list input {
    font-size: 13px;
  }

  .zz-device-banner {
    gap: 8px;
    padding-inline: 12px;
  }

  .zz-device-symbol {
    display: none;
  }

  .zz-app-card {
    grid-template-columns: 52px minmax(0,1fr) auto;
    gap: 9px;
    padding-inline: 12px;
  }

  .zz-app-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
  }

  .zz-sign-btn {
    min-width: 52px;
    padding-inline: 11px;
  }

  .zz-upload-desc {
    white-space: normal;
  }

  .zz-sheet {
    padding-inline: 20px;
  }

  .zz-sheet-head {
    padding-inline: 10px;
  }

  .zz-sheet .zz-udid-line input,
  .zz-sheet .zz-exchange-line input {
    padding-right: 78px;
  }

  .zz-sheet .zz-udid-get,
  .zz-sheet .zz-buy-cert {
    min-width: 68px;
    padding-inline: 5px;
    font-size: 11px;
  }
}

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

  .zz-primary,
  .zz-outline,
  .zz-sign-btn,
  .zz-chip {
    transition: none;
  }

  .zz-toast {
    animation: none;
  }
}
