:root {
  /* Quick Qwest palette (from the app icon): sky blue background, cream cards, deep navy text.
     The theme is the same in light and dark VK schemes. */
  --safe-top: env(safe-area-inset-top, 0px);
  --bg: #93c8e0;
  --card: #fffaf1;
  --text: #1f3445;
  --muted: #7d8b95;
  --blue: #2b7fb8;
  --green: #3fa45b;
  --red: #d9534f;
  --ghost: #f3e6cf;
  --ghost-text: #2b5f84;
  --line: #ead9bb;
  --input: #fff4e2;
  --shadow: 0 6px 20px rgba(31, 79, 110, .16);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", Arial, sans-serif;
  padding: 12px 12px calc(24px + env(safe-area-inset-bottom));
  min-height: 100vh;
}
/* Native VK apps draw the status bar and their «… ✕» controls over the page: reserve that space. */
#bar { height: 0; }
#bar-title { display: none; }
.native #bar-title { display: flex; align-items: center; gap: 10px; }
#bar-title img { width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--card);
                 box-shadow: 0 2px 6px rgba(31, 79, 110, .2); }
.native #bar {
  display: flex; align-items: center; position: sticky; top: 0; z-index: 5;
  margin: -12px -12px 12px; padding: var(--safe-top) 110px 0 16px; height: calc(var(--safe-top) + 52px);
  background: var(--bg);
}
#bar-title { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bar-title span { overflow: hidden; text-overflow: ellipsis; }
#progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: transparent; z-index: 5; }
.native #progress { position: absolute; top: auto; bottom: 0; }
#progress-bar { height: 100%; width: 0; background: var(--card); transition: width .35s ease; }
#screen { max-width: 560px; margin: 0 auto; }
.card {
  background: var(--card); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow);
  animation: fade .28s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card img.cover { display: block; width: 100%; height: auto; background: var(--ghost); }
.video { position: relative; padding-top: 56.25%; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.body { padding: 16px 16px 8px; }
.text { white-space: normal; word-wrap: break-word; }
.text a.ext { color: var(--blue); text-decoration: none; word-break: break-all; }
.actions { padding: 8px 16px 16px; display: grid; gap: 10px; }
.btn {
  display: flex; align-items: center; justify-content: center; text-align: center; gap: 6px;
  min-height: 48px; padding: 12px 16px; border: 0; border-radius: 12px; font: inherit; font-weight: 600;
  color: #fff; background: var(--blue); text-decoration: none; cursor: pointer; width: 100%;
  transition: transform .08s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); opacity: .9; }
.btn.green { background: var(--green); }
.btn.red { background: var(--red); }
.btn.ghost { background: var(--ghost); color: var(--ghost-text); font-weight: 500; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.banks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.banks .btn { min-height: 44px; font-size: 15px; background: var(--ghost); color: var(--text); font-weight: 500; }
.field { width: 100%; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--input);
         color: var(--text); font: inherit; outline: none; }
.field:focus { border-color: var(--blue); }
.error { color: var(--red); font-size: 14px; margin-top: 6px; min-height: 1em; }
.hint { margin: 0 16px 8px; padding: 12px 14px; border-radius: 12px; background: var(--ghost); font-size: 15px;
        animation: fade .25s ease; }
.upload {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 120px; border: 2px dashed var(--blue); border-radius: 14px; color: var(--blue); font-weight: 600;
  text-align: center; padding: 14px; cursor: pointer;
}
.upload small { color: var(--muted); font-weight: 400; }
.upload img { max-height: 160px; max-width: 100%; border-radius: 10px; }
.upload.done { border-style: solid; border-color: var(--green); color: var(--green); }
.success { font-size: 48px; text-align: center; padding-top: 24px; }
.version { text-align: center; color: rgba(31, 52, 69, .55); font-size: 11px; margin-top: 10px; }
#uploads {
  position: fixed; top: calc(var(--safe-top) + 10px); right: 10px; z-index: 6; padding: 6px 12px; border-radius: 20px;
  background: var(--card); box-shadow: var(--shadow); font-size: 13px; color: var(--muted);
}
#toast {
  position: fixed; left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 8;
  max-width: 536px; margin: 0 auto; padding: 12px 14px; border-radius: 12px; background: var(--text); color: #fff;
  font-size: 15px; animation: fade .2s ease;
}
#overlay { position: fixed; inset: 0; background: rgba(31, 52, 69, .35); z-index: 7; display: flex;
           align-items: center; justify-content: center; }
#overlay[hidden], #toast[hidden], #uploads[hidden] { display: none; }
.native #uploads { top: calc(var(--safe-top) + 60px); left: 12px; right: auto; }
.overlay-box { background: var(--card); border-radius: 16px; padding: 22px 26px; text-align: center; max-width: 280px; }
#overlay-text { margin-top: 12px; color: var(--text); font-size: 15px; }
.loading { display: flex; justify-content: center; padding: 80px 0; }
.spinner { width: 32px; height: 32px; margin: 0 auto; border-radius: 50%; border: 3px solid var(--line);
           border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
