:root {
  color-scheme: light;
  --ink: #113033;
  --muted: #6c7f82;
  --line: #dce8e7;
  --paper: #f5fbfa;
  --white: #ffffff;
  --teal: #0b6b72;
  --teal-2: #0f8d86;
  --blue: #2477c3;
  --ok: #1c8f57;
  --wait: #ba6b11;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #e8f6f4 0%, #f8fbf7 42%, #eef5f9 100%);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 2px 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.05;
}

.screen-lead {
  max-width: 260px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

h2 {
  margin-bottom: 12px;
  font-size: 19px;
}

.view {
  display: grid;
  gap: 14px;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.switch-btn {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.switch-btn.active {
  background: var(--white);
  color: var(--teal);
  box-shadow: 0 8px 18px rgba(17, 48, 51, 0.08);
}

.panel,
.hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 50px rgba(17, 48, 51, 0.08);
}

.panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.hero {
  padding: 20px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid #c8d9d7;
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
  outline: none;
}

input {
  min-height: 48px;
  padding: 0 13px;
  font-size: 17px;
}

textarea {
  resize: vertical;
  min-height: 128px;
  padding: 12px 13px;
}

input:focus,
textarea:focus {
  border-color: var(--teal-2);
  box-shadow: 0 0 0 3px rgba(15, 141, 134, 0.14);
}

.check {
  grid-template-columns: 22px 1fr;
  align-items: start;
  color: var(--ink);
  font-weight: 600;
}

.check input {
  width: 18px;
  min-height: 18px;
  margin: 2px 0 0;
}

.inline-link {
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
  border-bottom: 1px solid rgba(11, 107, 114, 0.32);
}

.primary,
.icon-btn,
.tab,
.ghost-btn {
  border: 0;
  cursor: pointer;
}

.primary {
  min-height: 50px;
  border-radius: 7px;
  background: var(--teal);
  color: white;
  font-weight: 800;
}

.primary:active {
  transform: translateY(1px);
}

.ghost-btn {
  min-height: 40px;
  border: 1px solid #c8d9d7;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--teal);
  font-weight: 850;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--white);
  color: var(--teal);
  font-size: 21px;
  box-shadow: 0 8px 24px rgba(17, 48, 51, 0.1);
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.guest {
  color: var(--muted);
  font-weight: 700;
}

.balance {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 8px 0 18px;
}

.balance strong {
  font-size: 76px;
  line-height: 0.95;
  color: var(--teal);
}

.balance span {
  max-width: 150px;
  font-size: 18px;
  font-weight: 800;
}

.code-action {
  width: 100%;
}

.code-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  background: #eaf6ff;
  border: 1px solid #cce4f8;
}

.code-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.code-box strong {
  display: block;
  margin: 4px 0 8px;
  color: var(--blue);
  font-size: 44px;
}

.code-box p {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.call-info {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #cce4f8;
  border-radius: 8px;
  background: #eaf6ff;
}

.call-info span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.call-info a {
  color: var(--blue);
  font-size: 28px;
  font-weight: 900;
  text-decoration: none;
}

.call-info p {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.call-info.checking {
  border-color: #b9d7f4;
  background: #eef7ff;
}

.call-info.missing {
  border-color: #edd0a5;
  background: #fff7ea;
}

.section {
  padding: 2px 0;
}

.gift-list {
  display: grid;
  gap: 10px;
}

.gift {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
}

.gift .mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: white;
  font-weight: 900;
}

.gift.ok .mark {
  background: var(--ok);
}

.gift.wait .mark {
  background: var(--wait);
}

.gift strong {
  display: block;
  margin-bottom: 4px;
}

.gift p {
  color: var(--muted);
  font-size: 14px;
}

.progress {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.progress-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #dfeceb;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.tab {
  min-height: 42px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  background: var(--white);
  color: var(--teal);
  box-shadow: 0 8px 18px rgba(17, 48, 51, 0.08);
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

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

.history-item strong {
  display: block;
}

.history-item small {
  color: var(--muted);
}

.qty {
  font-weight: 900;
  color: var(--teal);
}

.respect-link {
  display: grid;
  place-items: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--teal);
  font-weight: 900;
  text-decoration: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  width: min(440px, calc(100vw - 28px));
  transform: translateX(-50%);
  padding: 13px 14px;
  border-radius: 8px;
  background: #113033;
  color: white;
  font-weight: 700;
  box-shadow: 0 12px 36px rgba(17, 48, 51, 0.28);
}

.welcome-flash {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 24px;
  background: rgba(245, 251, 250, 0.86);
  color: var(--ink);
  text-align: center;
  backdrop-filter: blur(8px);
  animation: flashOut 1.15s ease forwards;
}

.welcome-flash strong {
  color: var(--teal);
  font-size: 30px;
}

.welcome-flash span {
  color: var(--muted);
  font-weight: 800;
}

@keyframes flashOut {
  0% { opacity: 0; transform: scale(0.98); }
  14% { opacity: 1; transform: scale(1); }
  76% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.02); pointer-events: none; }
}

.hidden {
  display: none !important;
}
