/* Student viewer: access screens + the reader (top bar, sandboxed iframe, watermark, notices). */

body.viewer { min-height: 100vh; min-height: 100dvh; }

/* ------------------------------------------------------------------ centred state screens */
.v-state {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding: max(20px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
  background:
    radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, var(--kernel-100) 80%, transparent), transparent 70%),
    var(--bg);
}
.v-state[hidden], .v-reader[hidden] { display: none; }
.v-card {
  width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: clamp(24px, 6vw, 36px); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 14px; text-align: center;
}
.v-logo { height: 64px; width: auto; margin: 0 auto 4px; }
html[lang="en"] .v-logo { height: 42px; }
@media (prefers-color-scheme: dark) { .v-logo { content: url("../brand/logo-ar-dark.svg"); } html[lang="en"] .v-logo { content: url("../brand/logo-en-dark.svg"); } }
.v-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.45rem, 5vw, 1.8rem); line-height: 1.3; margin: 0; }
.v-subtitle { color: var(--text-muted); margin: -8px 0 0; font-size: 0.95rem; }
.v-made-for, .v-lead { font-size: 1.06rem; color: var(--text-soft); margin: 0; }
.v-card p { margin: 0; }
.v-facts { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 8px; text-align: start; }
.v-facts li {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
  background: var(--bg-soft); font-weight: 500;
}
.v-facts .icon { color: var(--kernel-600); margin-top: 3px; }
.v-facts .v-last { background: var(--danger-soft); color: var(--danger); }
.v-facts .v-last .icon { color: var(--danger); }
.v-pledge-form { display: grid; gap: 12px; text-align: start; margin-top: 4px; }
.v-pledge {
  position: relative; padding: 14px 16px; border-radius: var(--radius); text-align: center;
  background: var(--ink-900); color: var(--kernel-200); font-weight: 600; line-height: 1.7;
}
.v-check {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
  border: 2px solid var(--border-strong); cursor: pointer; font-weight: 500;
}
.v-check:has(input:checked) { border-color: var(--kernel-500); background: var(--kernel-50); }
@media (prefers-color-scheme: dark) { .v-check:has(input:checked) { background: rgba(147, 197, 83, 0.12); } }
.v-check input { width: 22px; height: 22px; margin: 3px 0 0; accent-color: var(--kernel-600); flex: none; }
.v-form-hint { color: var(--danger); font-weight: 600; font-size: 0.95rem; }
.v-privacy, .v-small, .v-hint, .v-logged { font-size: 0.88rem; color: var(--text-muted); }
.v-privacy { display: flex; gap: 6px; align-items: flex-start; justify-content: center; text-align: start; }
.v-privacy .icon, .v-logged .icon { width: 1.05em; height: 1.05em; margin-top: 0.3em; flex: none; }
.v-logged { display: flex; gap: 6px; justify-content: center; align-items: flex-start; }
.v-hint { margin-top: -6px !important; }

.v-blocked-art { width: 120px; height: auto; margin: 0 auto; filter: drop-shadow(0 14px 18px rgba(48, 66, 34, 0.25)); }
.v-state-blocked .v-blocked-art { transform: rotate(-8deg); }

.v-inapp {
  text-align: start; padding: 14px 16px; border-radius: var(--radius); background: var(--warning-soft);
  border: 1px solid var(--border-strong); display: grid; gap: 6px; font-size: 0.95rem;
}
.v-inapp-title { display: flex; gap: 8px; align-items: center; font-weight: 700; }
.v-inapp-title .icon { color: var(--amber-700); }
.v-inapp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.v-inapp[hidden], [data-inapp-ios][hidden], [data-inapp-android][hidden], [data-last][hidden], [data-pledge-hint][hidden] { display: none; }

.v-loading { display: grid; justify-items: center; gap: 14px; color: var(--text-soft); font-weight: 500; }
.v-loading-mark { width: 96px; height: auto; animation: wobble 1.6s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(3deg); } }

/* ------------------------------------------------------------------ reader */
.v-reader { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.v-bar {
  flex: none; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 10px;
  padding-top: env(safe-area-inset-top); box-sizing: content-box;
  background: var(--surface); border-bottom: 1px solid var(--border); z-index: 3;
  transition: margin-top 0.25s var(--ease);
}
body.bar-hidden .v-bar { margin-top: calc(-53px - env(safe-area-inset-top)); }
.v-brand img { width: 34px; height: 34px; border-radius: 9px; }
.v-bar-title { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; }
.v-bar-title strong {
  font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.v-owner, .v-badge {
  flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; background: var(--bg-soft); color: var(--text-soft);
}
.v-owner .icon { width: 0.95em; height: 0.95em; color: var(--kernel-600); }
.v-badge { background: var(--kernel-400); color: var(--ink-900); }
@media (max-width: 520px) { .v-owner { display: none; } }
.v-bar-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.v-btn {
  display: inline-flex; align-items: center; gap: 6px; min-width: 40px; height: 40px; padding: 0 10px; justify-content: center;
  border-radius: 12px; color: var(--text-soft); text-decoration: none; font-weight: 600; font-size: 0.9rem;
}
.v-btn:hover { background: var(--bg-soft); color: var(--text); }
.v-btn-label { display: none; }
@media (min-width: 720px) { .v-btn-label { display: inline; } }

.v-stage { position: relative; flex: 1; min-height: 0; background: #fff; }
.v-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.v-mark { position: absolute; inset: 0; pointer-events: none; background-repeat: repeat; z-index: 2; }
@media print { .v-bar, .v-toasts { display: none; } }

.v-toasts {
  position: fixed; inset-inline: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 5;
  display: grid; gap: 8px; justify-items: center; pointer-events: none;
}
.v-toast {
  pointer-events: auto; width: min(560px, 100%); display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius); background: var(--ink-900); color: #EEF0E4;
  box-shadow: var(--shadow-lg); animation: rise 0.35s var(--ease);
}
.v-toast p { margin: 0; flex: 1; font-size: 0.95rem; line-height: 1.6; }
.v-toast-attempt { background: #4a1d17; border: 1px solid #a8483b; }
.v-toast-close {
  flex: none; border: 0; border-radius: 999px; padding: 6px 14px; cursor: pointer;
  background: var(--kernel-400); color: var(--ink-900); font-weight: 700;
}
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-color-scheme: dark) {
  .v-state { background: radial-gradient(1000px 420px at 50% -10%, rgba(147, 197, 83, 0.14), transparent 70%), var(--bg); }
  .v-pledge { background: rgba(147, 197, 83, 0.1); border: 1px solid rgba(147, 197, 83, 0.35); color: var(--kernel-300); }
  .v-inapp-title .icon { color: var(--amber-500); }
}
