:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #17201b;
  background: #dfe3e0;
  font-synthesis: none;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  background: #dfe3e0;
}

button {
  font: inherit;
  letter-spacing: 0;
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: #f4f6f4;
  box-shadow: 0 0 32px rgba(22, 35, 27, 0.08);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: max(12px, env(safe-area-inset-top)) 20px 10px;
  background: rgba(244, 246, 244, 0.94);
  border-bottom: 1px solid rgba(23, 32, 27, 0.06);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 750;
}

.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #efffe5;
  font-size: 14px;
  background: #17201b;
  border-radius: 7px;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  color: #26332b;
  font-size: 23px;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.icon-button:active {
  background: #e6eae7;
}

.icon-button.is-spinning span {
  display: block;
  animation: spin 0.75s linear infinite;
}

.main-content {
  padding: 24px 20px calc(32px + env(safe-area-inset-bottom));
}

.eyebrow {
  margin: 0 0 8px;
  color: #477451;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.intro-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.intro h1 {
  max-width: 270px;
  margin: 0;
  font-size: 32px;
  line-height: 1.12;
  font-weight: 780;
  letter-spacing: 0;
}

.user-badge {
  display: flex;
  min-width: 0;
  max-width: 126px;
  align-items: center;
  gap: 7px;
  padding: 5px 8px 5px 5px;
  color: #425047;
  font-size: 11px;
  background: #e9ede9;
  border-radius: 7px;
}

.user-badge > span:first-child {
  display: grid;
  flex: 0 0 25px;
  height: 25px;
  place-items: center;
  color: white;
  font-weight: 750;
  background: #52785a;
  border-radius: 6px;
}

.user-badge > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.services,
.skeleton-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.service-card {
  --card-bg: #eef1ef;
  --card-fg: #17201b;
  --action-bg: #17201b;
  --action-fg: #fff;
  position: relative;
  display: flex;
  width: 100%;
  min-height: 154px;
  padding: 20px;
  overflow: hidden;
  color: var(--card-fg);
  text-align: left;
  background: var(--card-bg);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  isolation: isolate;
  transition: transform 150ms ease, filter 150ms ease;
}

.service-card:active {
  transform: scale(0.985);
}

.service-card:focus-visible,
.icon-button:focus-visible,
.primary-button:focus-visible,
.text-button:focus-visible {
  outline: 3px solid rgba(47, 112, 67, 0.34);
  outline-offset: 2px;
}

.service-card:disabled {
  cursor: wait;
}

.service-card:not(.is-launching):disabled {
  filter: saturate(0.6) opacity(0.72);
}

.service-copy {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(64%, 230px);
  flex-direction: column;
  gap: 7px;
}

.service-copy strong {
  font-size: 23px;
  line-height: 1.15;
  font-weight: 780;
}

.service-copy > span {
  display: -webkit-box;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0.72;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.service-action {
  position: absolute;
  bottom: 18px;
  left: 20px;
  z-index: 2;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--action-fg);
  font-size: 20px;
  background: var(--action-bg);
  border-radius: 50%;
}

.service-art {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.service-art--image {
  top: 18px;
  right: 13px;
  width: 116px;
  height: 116px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.service-art--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-art--globe {
  top: 14px;
  right: -7px;
  width: 132px;
  height: 132px;
  border: 1.5px solid #3978b1;
  border-radius: 50%;
}

.service-art--globe::before,
.service-art--globe::after,
.service-art--globe span {
  position: absolute;
  content: "";
  border: 1px solid #3978b1;
  border-radius: 50%;
}

.service-art--globe::before {
  inset: 12px 36px;
}

.service-art--globe::after {
  top: 46px;
  right: -10px;
  width: 145px;
  height: 44px;
  transform: rotate(-14deg);
}

.service-art--globe span {
  inset: 51px -1px;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

.service-art--pixel {
  right: 4px;
  bottom: -10px;
  width: 140px;
  height: 140px;
  background: linear-gradient(135deg, transparent 20%, #ff6748 20% 41%, #161918 41% 48%, #ff6748 48% 70%, transparent 70%);
  clip-path: polygon(50% 0, 100% 28%, 88% 83%, 50% 100%, 12% 83%, 0 28%);
}

.service-art--generic {
  top: 22px;
  right: 18px;
  width: 108px;
  height: 108px;
  border: 18px solid rgba(23, 32, 27, 0.12);
  border-radius: 50%;
}

.service-progress {
  position: absolute;
  z-index: 4;
  display: none;
  width: 30px;
  height: 30px;
  border: 3px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  animation: spin-centered 0.75s linear infinite;
}

.service-card.is-launching::after {
  position: absolute;
  z-index: 3;
  content: "";
  background: var(--card-bg);
  opacity: 0.82;
  inset: 0;
}

.service-card.is-launching .service-progress {
  display: block;
}

.skeleton-card {
  height: 154px;
  overflow: hidden;
  background: #e7eae7;
  border-radius: 8px;
}

.skeleton-card::after {
  display: block;
  width: 55%;
  height: 100%;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.66), transparent);
  animation: shimmer 1.1s ease-in-out infinite;
}

.status-box {
  display: flex;
  min-height: 330px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 30px;
  text-align: center;
}

.status-symbol,
.dialog-symbol {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #42604a;
  font-size: 22px;
  background: #e1e9e3;
  border-radius: 8px;
}

.status-box h2,
.auth-dialog h2 {
  margin: 16px 0 7px;
  font-size: 18px;
}

.status-box p,
.auth-dialog p {
  max-width: 280px;
  margin: 0 0 20px;
  color: #647068;
  font-size: 13px;
  line-height: 1.55;
}

.primary-button,
.text-button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.primary-button {
  color: white;
  background: #17201b;
}

.primary-button:disabled {
  opacity: 0.55;
}

.text-button {
  color: #4d5951;
  background: transparent;
}

.toast {
  position: fixed;
  z-index: 30;
  right: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  width: max-content;
  max-width: min(340px, calc(100vw - 40px));
  padding: 11px 14px;
  color: white;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  background: rgba(20, 27, 23, 0.94);
  border-radius: 7px;
  transform: translateX(50%);
  box-shadow: 0 10px 25px rgba(19, 28, 22, 0.2);
}

.auth-dialog {
  width: min(360px, calc(100vw - 36px));
  padding: 26px;
  color: #17201b;
  text-align: center;
  background: #f8faf8;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(20, 30, 23, 0.24);
}

.auth-dialog::backdrop {
  background: rgba(15, 23, 18, 0.42);
  backdrop-filter: blur(4px);
}

.auth-dialog .dialog-symbol {
  margin: 0 auto;
}

.dialog-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

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

@keyframes spin-centered {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes shimmer {
  from { transform: translateX(-120%); }
  to { transform: translateX(220%); }
}

@media (min-width: 700px) {
  .app-shell {
    margin-block: 20px;
    min-height: calc(100dvh - 40px);
    border-radius: 8px;
  }
}

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