:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #000000);
  --hint: var(--tg-theme-hint-color, #999999);
  --link: var(--tg-theme-link-color, #2481cc);
  --button: var(--tg-theme-button-color, #2481cc);
  --button-text: var(--tg-theme-button-text-color, #ffffff);
  --secondary-bg: var(--tg-theme-secondary-bg-color, #f0f0f0);
  --destructive: var(--tg-theme-destructive-text-color, #ff3b30);
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

#app {
  min-height: 100vh;
  padding: 16px;
  max-width: 640px;
  margin: 0 auto;
}

.loading { text-align: center; padding: 40px 0; color: var(--hint); }

h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 20px 0 8px; }

.hint { color: var(--hint); font-size: 13px; }
.destructive { color: var(--destructive); }

.card {
  background: var(--secondary-bg);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}

.card-title { font-weight: 600; margin-bottom: 4px; }
.card-sub { color: var(--hint); font-size: 13px; }

.row { display: flex; gap: 8px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.grow { flex: 1; }

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--secondary-bg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; color: var(--hint);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.btn {
  appearance: none;
  border: 0;
  background: var(--button);
  color: var(--button-text);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.secondary { background: var(--secondary-bg); color: var(--text); }
.btn.destructive { background: transparent; color: var(--destructive); }
.btn.full { width: 100%; }

input, textarea, select {
  width: 100%;
  appearance: none;
  border: 1px solid var(--secondary-bg);
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
}
textarea { min-height: 80px; resize: vertical; }

label { display: block; font-size: 13px; color: var(--hint); margin: 12px 0 4px; }

.list > * + * { margin-top: 8px; }

.badge {
  display: inline-block;
  background: var(--button);
  color: var(--button-text);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}
.badge.muted { background: var(--secondary-bg); color: var(--hint); }
.badge.approved { background: #34c759; color: white; }
.badge.rejected { background: var(--destructive); color: white; }

.empty {
  text-align: center;
  color: var(--hint);
  padding: 32px 16px;
}

.link-box {
  background: var(--secondary-bg);
  padding: 12px;
  border-radius: var(--radius);
  font-family: "SF Mono", Menlo, monospace;
  font-size: 13px;
  word-break: break-all;
}
