:root { color-scheme: dark; }
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--tg-theme-bg-color, #0f1115); color: var(--tg-theme-text-color, #eee);
}
.app { max-width: 520px; margin: 0 auto; padding: 16px; }
header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; }
h1 { font-size: 18px; margin: 0 0 8px; }
.points { font-size: 12px; opacity: .8; }
.input-row { display: flex; gap: 8px; margin: 14px 0; }
input {
  flex: 1; padding: 12px; border-radius: 10px; border: 1px solid #333;
  background: #171a21; color: inherit; font-size: 14px; min-width: 0;
}
button {
  padding: 12px 16px; border: 0; border-radius: 10px; cursor: pointer;
  background: #2a2f3a; color: inherit; font-size: 14px;
}
button.primary { background: #2aabee; color: #fff; width: 100%; font-weight: 600; margin-top: 10px; }
button:disabled { opacity: .5; }
.status { min-height: 20px; font-size: 13px; color: #ffb020; }
.hidden { display: none !important; }
#result { background: #171a21; border: 1px solid #262b36; border-radius: 12px; padding: 14px; }
#thumb { width: 100%; border-radius: 8px; margin-bottom: 10px; }
.title { font-weight: 600; margin-bottom: 4px; }
.meta { font-size: 12px; opacity: .7; margin-bottom: 10px; }
.lbl { font-size: 12px; opacity: .7; display: block; margin-bottom: 4px; }
select {
  width: 100%; padding: 10px; border-radius: 8px; border: 1px solid #333;
  background: #0f1115; color: inherit; margin-bottom: 6px;
}
.bar { height: 8px; background: #262b36; border-radius: 4px; overflow: hidden; margin: 10px 0 6px; }
#barFill { height: 100%; width: 0; background: #2aabee; transition: width .3s; }
#progressText { font-size: 13px; opacity: .85; }
.history-title { font-size: 14px; margin: 20px 0 6px; opacity: .8; }
#history { padding-left: 18px; font-size: 13px; opacity: .85; }
footer { margin-top: 24px; font-size: 11px; opacity: .5; text-align: center; }
