:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #17202a;
  background: #f4f1ea;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(28, 112, 104, 0.12), transparent 32rem),
    #f4f1ea;
}

button,
input {
  font: inherit;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(22, 105, 98, 0.3);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.shell {
  width: min(100% - 20px, 760px);
  margin: 0 auto;
  padding: 10px 0 12px;
}

.page-header {
  margin-bottom: 8px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 1.45rem;
  line-height: 1.15;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

h3 {
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.network-banner {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
  padding: 7px 10px;
  border: 1px solid #dfb7ad;
  border-radius: 10px;
  background: #fff4f1;
  font-size: 0.85rem;
}

.network-banner p {
  margin: 4px 0 0;
  color: #6a5250;
  line-height: 1.45;
}

.network-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  flex: none;
  border-radius: 50%;
  background: #b44534;
  box-shadow: 0 0 0 3px rgba(180, 69, 52, 0.13);
}

.network-banner.is-offline {
  border-color: #9ecfc8;
  background: #effaf7;
}

.network-banner.is-offline p {
  color: #3e625e;
}

.network-banner.is-offline .network-dot {
  background: #16756b;
  box-shadow: 0 0 0 3px rgba(22, 117, 107, 0.13);
}

.card {
  margin-bottom: 8px;
  padding: 14px;
  border: 1px solid rgba(23, 32, 42, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(23, 32, 42, 0.07);
}

.field + .field {
  margin-top: 10px;
}

label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
  font-weight: 750;
}

input {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #aeb7be;
  border-radius: 11px;
  background: #fff;
  color: #17202a;
  font-size: 1rem;
}

.form-error,
.warning {
  color: #8e2f24;
}

.form-error {
  margin: 8px 0 0;
  font-size: 0.85rem;
  font-weight: 650;
}

.primary-button,
.danger-button {
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  padding: 8px 12px;
  color: #fff;
}

.primary-button {
  background: #146b63;
}

.danger-button {
  background: #9f3428;
}

.secondary-button {
  padding: 10px 16px;
  border: 1px solid #7b898e;
  background: #fff;
  color: #26343a;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  margin-bottom: 10px;
  padding: 3px;
  border-radius: 10px;
  background: #e8ecea;
}

.tab-button {
  min-height: 38px;
  padding: 4px;
  border-radius: 8px;
  background: transparent;
  color: #4b585d;
  font-size: 0.76rem;
  line-height: 1.2;
}

.tab-button[aria-selected="true"] {
  background: #fff;
  color: #154e49;
  box-shadow: 0 2px 8px rgba(23, 32, 42, 0.09);
}

.tab-panel {
  text-align: center;
}

.tab-panel[hidden] {
  display: none;
}

.tab-panel > p {
  margin-bottom: 0;
  font-size: 0.85rem;
}

.qr-frame {
  display: grid;
  place-items: center;
  width: min(100%, 250px);
  aspect-ratio: 1;
  margin: 8px auto 6px;
  padding: 8px;
  border: 1px solid #d8ddda;
  border-radius: 10px;
  background: #fff;
  color: #315e59;
}

.qr-placeholder {
  pointer-events: none;
  font-size: 0.85rem;
  line-height: 1.4;
}

.qr-hold-button {
  display: block;
  width: min(100%, 250px);
  min-height: 38px;
  margin: 0 auto 8px;
  padding: 6px 10px;
  font-size: 0.8rem;
  background: #146b63;
  color: #fff;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.qr-hold-button:active {
  background: #0e554f;
}

.qr-frame.is-revealed {
  padding: 7px;
  border-color: #7aaea7;
}

.qr-frame.is-revealed .qr-placeholder {
  display: none;
}

.qr-frame svg {
  display: block;
  width: 100%;
  height: auto;
  grid-area: 1 / 1;
}

.warning {
  margin: 6px auto 0;
  max-width: 520px;
  font-size: 0.75rem;
  line-height: 1.3;
}

.manual-fields {
  margin: 8px 0;
  text-align: left;
}

.manual-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
}

.manual-field + .manual-field {
  border-top: 1px solid #e2e5e3;
}

.manual-field > div {
  min-width: 0;
}

.manual-label {
  margin: 0 0 3px;
  color: #5b6570;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.manual-value {
  margin: 0;
  overflow-wrap: anywhere;
}

.secret-hidden {
  color: #5b6570;
  font-style: italic;
}

.manual-field .secondary-button {
  min-height: 38px;
  padding: 6px 10px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.action-status {
  min-height: 1.5em;
  margin: 4px 0 0;
  color: #315e59;
  font-size: 0.8rem;
}

.action-status.is-error {
  color: #8e2f24;
}

.verification-callout {
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  background: #f0f5f3;
}

.verification-callout ol {
  margin: 0;
  padding-left: 1.3rem;
  line-height: 1.35;
}

.completion-card {
  border-color: #9ecfc8;
  background: #f4fcfa;
}

.close-instruction {
  margin: 10px 0 0;
  font-weight: 700;
  line-height: 1.4;
}

.clipboard-helper {
  position: fixed;
  inset: auto auto 0 -9999px;
  opacity: 0;
}

#privacy-cover {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  background: #163c39;
  color: #fff;
}

.page-obscured #privacy-cover {
  display: flex;
}

.page-obscured .shell {
  visibility: hidden;
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
