/* =====================================================================
   VEDA · REAL PAPER (app screens)
   Everyday paper objects, each with a job: fold, tape, ticket, ledger,
   receipt, index card, torn sheet, slip, ID card. Shape lives on ::before
   so drop-shadows follow the real outline. Landing uses veda-landing.css.
   ===================================================================== */
:root {
  --pbg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.02 .14' numOctaves='3' seed='9'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .42 0 0 0 0 .3 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23p)'/%3E%3C/svg%3E"), linear-gradient(170deg, #fdfcf7, #f6f2e8);
  --lift: drop-shadow(0 1px 1px rgba(70,50,20,.14)) drop-shadow(0 10px 14px rgba(70,50,20,.12));
}

/* ---------- HEADER: no bar. Left = the Veda mark (its own shape). Right = stamp button. ---------- */
.app-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: flex-start; justify-content: space-between;
  padding: calc(8px + var(--safe-t)) 16px 0; background: none !important; border: 0 !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; pointer-events: none; }
.app-top > * { pointer-events: auto; }
.logo-btn { width: 56px; height: 56px; display: grid; place-items: center; margin-top: 8px; filter: drop-shadow(0 4px 8px rgba(120,60,20,.25)); }
.logo-btn svg { width: 52px; height: 52px; }
.stamp { position: relative; width: 64px; height: 76px; margin-top: 8px; filter: var(--lift); transform: rotate(4deg); flex: none; }
.stamp:hover { transform: rotate(0deg) scale(1.03); }
.stamp > i { position: absolute; inset: 0; background: var(--pbg);
  -webkit-mask: linear-gradient(#000 0 0) center / calc(100% - 10px) calc(100% - 10px) no-repeat, radial-gradient(circle, #0000 3px, #000 3.5px) -5px -5px / 10px 10px round;
  mask: linear-gradient(#000 0 0) center / calc(100% - 10px) calc(100% - 10px) no-repeat, radial-gradient(circle, #0000 3px, #000 3.5px) -5px -5px / 10px 10px round; }
.stamp > span { position: absolute; inset: 9px; display: grid; justify-items: center; align-content: space-between; padding: 4px 0;
  border: 1px solid rgba(178,58,30,.4); background: linear-gradient(160deg, rgba(241,217,138,.35), rgba(188,197,238,.3)); }
.stamp b { font: 600 26px/1 var(--display); color: var(--vermilion); }
.stamp small { font: 600 8px/1 var(--ui); letter-spacing: .16em; color: var(--muted); }
.stamp small:first-child { font: 400 12px/1 var(--display); letter-spacing: 0; color: var(--accent); }
.stamp.big { width: 72px; height: 84px; margin: 0; transform: rotate(-3deg); }
.stamp.big b { font-size: 30px; }
/* the page's title lives in the page itself */
.page-head { max-width: 760px; margin: 0 auto; padding: 4px 20px 4px; display: grid; gap: 4px; }
.page-head .kick { font: 600 11px/1 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.page-head h1 { font: 500 40px/1 var(--display); letter-spacing: -.02em; }
.page-head .sub { font-size: 13px; color: var(--muted); }
.tabview { padding-top: 12px; }

/* ---------- PAPER BASE ---------- */
.pp { position: relative; isolation: isolate; background: none !important; border: 0 !important; box-shadow: none !important; border-radius: 4px; filter: var(--lift); color: var(--ink); }
.pp::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--pbg); border-radius: inherit; }
.pp.dx-tilt::after { display: none; }

/* fold — a letter with a dog-eared corner */
.pp-fold::before { clip-path: polygon(0 0, calc(100% - 36px) 0, 100% 36px, 100% 100%, 0 100%); border-radius: 4px; }
.pp-fold::after { content: ''; position: absolute; top: 0; right: 0; width: 36px; height: 36px; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom left, transparent 50%, #e7dfcd 50%, #f3eee2); filter: drop-shadow(-2px 2px 2px rgba(70,50,20,.18)); }

/* tape — a note pinned with haldi washi tape */
.pp-tape { margin-top: 28px; }
.pp-tape::after { content: ''; position: absolute; top: -12px; left: 50%; width: 104px; height: 26px; transform: translateX(-50%) rotate(-3deg); z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.35), transparent 40%), repeating-linear-gradient(90deg, rgba(240,205,110,.78) 0 8px, rgba(236,198,98,.72) 8px 16px);
  clip-path: polygon(0 0, 100% 0, 97% 20%, 100% 40%, 97% 60%, 100% 80%, 97% 100%, 0 100%, 3% 80%, 0 60%, 3% 40%, 0 20%); }

/* ticket — notched both sides, with a perforation line */
.pp-ticket::before {
  -webkit-mask: radial-gradient(circle 12px at 0 var(--ny, 50%), #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 12px at 100% var(--ny, 50%), #0000 98%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 12px at 0 var(--ny, 50%), #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 12px at 100% var(--ny, 50%), #0000 98%, #000) right / 51% 100% no-repeat; border-radius: 12px; }
.pp-ticket::after { content: ''; position: absolute; left: 20px; right: 20px; top: var(--ny, 50%); border-top: 2px dotted rgba(70,52,30,.22); pointer-events: none; }

/* ledger — ruled lines with a red margin, for tables */
.pp-ledger::before { background:
  linear-gradient(90deg, transparent 27px, rgba(178,58,30,.35) 27px 28px, transparent 28px),
  repeating-linear-gradient(180deg, transparent 0 31px, rgba(74,99,201,.12) 31px 32px), var(--pbg); }
.pp-ledger { padding-left: 40px !important; }

/* receipt — zig-zag tear at the bottom, for timelines */
.pp-receipt { padding-bottom: 28px !important; }
.pp-receipt::before {
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 9px) no-repeat, conic-gradient(from 135deg at top, #000 90deg, #0000 0) bottom / 18px 9px repeat-x;
  mask: linear-gradient(#000 0 0) top / 100% calc(100% - 9px) no-repeat, conic-gradient(from 135deg at top, #000 90deg, #0000 0) bottom / 18px 9px repeat-x; border-radius: 0; }

/* index card — red header rule, faint blue lines */
.pp-index::before { background:
  linear-gradient(180deg, transparent calc(var(--rule, 48px) - 1px), rgba(178,58,30,.45) calc(var(--rule, 48px) - 1px) var(--rule, 48px), transparent var(--rule, 48px)),
  repeating-linear-gradient(180deg, transparent 0 75px, rgba(74,99,201,.1) 75px 76px, transparent 76px 104px), var(--pbg); border-radius: 2px; }

/* torn — a sheet torn from a notebook */
.pp-torn::before { filter: url(#deckle); border-radius: 0; }

/* slip — chat replies as small paper slips */
.pp-slip { border-radius: 2px; transform: rotate(-.5deg); }
.pp-slip:nth-child(4n) { transform: rotate(.6deg); }
.pp-slip::before { border-radius: 2px 12px 12px 2px; }

/* ID card — lanyard slot punched at the top */
.pp-id { padding-top: 36px !important; }
.pp-id::before { border-radius: 14px;
  -webkit-mask: radial-gradient(22px 5px at 50% 16px, #0000 98%, #000); mask: radial-gradient(22px 5px at 50% 16px, #0000 98%, #000); }

/* gilded — premium gets a moving gold-foil band (status-reflecting border) */
.gild > .foil { position: absolute; left: 0; right: 0; top: 0; height: 6px; border-radius: 12px 12px 0 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, #c98a24, #f3d48a, #b8571f, #f3d48a, #c98a24); background-size: 200% 100%; animation: foil 4s ease-in-out infinite alternate; }
@keyframes foil { to { background-position: 100% 0; } }
.card.dark-ink { border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { .gild > .foil { animation: none; } }

/* scanner: wider stage for the realistic hand + outside labels */
.scan .hand { width: min(96vw, 60svh); }
.scan .lbls text:last-child { fill: #e8dccb; }
