﻿:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --surface: var(--tg-theme-bg-color, #ffffff);
  --surface-2: var(--tg-theme-secondary-bg-color, #f3f4f6);
  --text: var(--tg-theme-text-color, #222222);
  --muted: var(--tg-theme-hint-color, #8f8f8f);
  --line: rgba(0, 0, 0, 0.08);
  --accent: var(--tg-theme-button-color, #2481cc);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --success: #34c759;
  --danger: #ff3b30;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: var(--tg-viewport-stable-height, 100vh);
}

.wrap {
  max-width: 430px;
  margin: 0 auto;
  padding: 18px 14px 26px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.04);
}

.hero {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
  text-align: center;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.grid {
  display: grid;
  gap: 10px;
}

@media (min-width: 700px) {
  .grid.cols-2 {
    grid-template-columns: 1fr 1fr;
  }
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 14px;
}

input,
select,
button,
.menu-link {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  font-size: 16px;
}

input,
select {
  border: 2px solid var(--surface-2);
  background: var(--surface);
  color: var(--text);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
}

button,
.menu-link {
  border: none;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  font-weight: 600;
  background: var(--accent);
  color: var(--accent-text);
}

button.secondary {
  background: var(--surface-2);
  color: var(--text);
}

button.warn {
  background: #ff6b61;
  color: #ffffff;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status {
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 14px;
  text-align: center;
}

.status.success {
  color: var(--success);
  font-weight: 600;
}

.status.error {
  color: var(--danger);
  font-weight: 600;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--muted);
}

.actions {
  display: grid;
  gap: 10px;
}


.pdf-pages {
  display: grid;
  gap: 14px;
  padding: 14px;
  background: #dfe7f2;
  max-height: min(74vh, 900px);
  overflow: auto;
}

.pdf-page-canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
}