/* TERA OPTIONS — public trade receipt. Builds on auth.css (background, brand). */
.rc-main {
  position: relative; z-index: 1; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center;
  /* 16px gutters, and clear of the notch and home bar (a phone held sideways too) */
  padding: max(20px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(32px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.rc-top { width: 100%; max-width: 760px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.rc-brand { flex-direction: row; margin: 0; gap: 10px; min-height: 44px; }
.rc-top-actions { display: flex; gap: 8px; }
.rc-loading { display: grid; place-items: center; gap: 12px; min-height: 50vh; color: var(--c-text-2); }
.rc-missing { margin-top: 10vh; }

.rc-card {
  width: 100%; max-width: 760px; padding: clamp(20px, 4vw, 36px); border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(16, 31, 51, 0.92), rgba(11, 23, 40, 0.94)); border: 1px solid var(--c-border-strong);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: viewIn var(--dur-3) var(--ease-out) both;
  position: relative; overflow: hidden;
}
.rc-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.6), transparent); }

.rc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.rc-kicker { margin: 0 0 6px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--c-cyan); }
.rc-title { margin: 0; font-family: var(--font-display); font-size: clamp(24px, 4vw, 32px); font-weight: 600; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.rc-dir { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; font-size: 16px; color: #fff; }
.rc-dir.higher { background: #1e9c86; }
.rc-dir.lower { background: #d9454d; }
.rc-sub { margin: 6px 0 0; color: var(--c-text-2); font-size: var(--fs-sm); }
.rc-result { text-align: right; }
.rc-result b { display: block; font-family: var(--font-display); font-size: clamp(28px, 5vw, 38px); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.rc-result span { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-text-2); }
.rc-result.win b { color: #2fc1b2; }
.rc-result.loss b { color: #ff7c80; }

.rc-checks { list-style: none; margin: 24px 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rc-checks li { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--c-border); background: rgba(7, 17, 31, 0.5); transition: border-color var(--dur-3), background var(--dur-3); }
.rc-checks b { display: block; font-size: var(--fs-sm); margin-bottom: 2px; }
.rc-checks small { font-size: 12px; color: var(--c-text-2); line-height: 1.5; }
.rc-ck { flex: none; width: 24px; height: 24px; border-radius: 50%; position: relative; border: 2px solid var(--c-border-strong); }
.rc-checks li.pending .rc-ck { border-top-color: var(--c-cyan); animation: spin .8s linear infinite; }
.rc-checks li.ok { border-color: rgba(47, 193, 178, 0.35); background: rgba(38, 166, 154, 0.07); }
.rc-checks li.ok .rc-ck { border-color: #2fc1b2; background: #2fc1b2; }
.rc-checks li.ok .rc-ck::after { content: ''; position: absolute; left: 6px; top: 3.5px; width: 6px; height: 10px; border: solid #062420; border-width: 0 2.4px 2.4px 0; transform: rotate(45deg); }
.rc-checks li.bad { border-color: rgba(240, 82, 90, 0.45); background: rgba(240, 82, 90, 0.07); }
.rc-checks li.bad .rc-ck { border-color: #ff7c80; background: #ff7c80; }
.rc-checks li.bad .rc-ck::after { content: '!'; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #2a0709; }
.rc-checks li.info .rc-ck { border-color: var(--c-text-3); }
.rc-checks li.info .rc-ck::after { content: 'i'; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--c-text-2); }

.rc-chart-wrap { border-radius: var(--r-lg); border: 1px solid var(--c-border); background: #0a1626; padding: 10px 10px 8px; }
#rcChart { display: block; width: 100%; height: 240px; }
.rc-legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 6px 4px 0; font-size: 11.5px; color: var(--c-text-2); }
.rc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rc-legend i { display: inline-block; width: 16px; height: 0; border-top: 2px dashed rgba(168, 180, 204, 0.8); }
.rc-legend i.lg-exp { border-top: 2px dashed #f5b942; width: 0; height: 12px; border-top: 0; border-left: 2px dashed #f5b942; }
.rc-legend i.lg-close { width: 9px; height: 9px; border: 0; border-radius: 50%; background: var(--c-cyan); }

.rc-practice { margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid rgba(242, 184, 75, 0.4); background: rgba(242, 184, 75, 0.08); font-size: var(--fs-sm); color: #f6d58e; line-height: 1.55; }

.rc-dl { margin: 20px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--c-border); border: 1px solid var(--c-border); border-radius: var(--r-md); overflow: hidden; }
.rc-dl div { padding: 11px 14px; background: rgba(11, 23, 40, 0.96); display: grid; gap: 2px; min-width: 0; }
.rc-dl div.wide { grid-column: 1 / -1; }
.rc-dl dt { font-size: 11.5px; color: var(--c-text-3); }
.rc-dl dd { margin: 0; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rc-dl dd.mono, .rc-how code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.rc-dl dd.up { color: #2fc1b2; }
.rc-dl dd.down { color: #ff7c80; }

.rc-how { margin-top: 16px; border: 1px solid var(--c-border); border-radius: var(--r-md); background: rgba(7, 17, 31, 0.4); }
.rc-how summary { cursor: pointer; min-height: 48px; padding: 13px 16px; font-weight: 600; font-size: var(--fs-sm); list-style: none; display: flex; align-items: center; justify-content: space-between; border-radius: var(--r-md); -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.rc-how summary:active { background: rgba(148, 163, 184, 0.06); }
.rc-how summary::-webkit-details-marker { display: none; }
.rc-how summary::after { content: '+'; color: var(--c-text-3); font-weight: 400; font-size: 18px; line-height: 1; }
.rc-how[open] summary::after { content: '−'; }
.rc-how-body { padding: 0 16px 16px; font-size: var(--fs-sm); color: var(--c-text-2); line-height: 1.65; }
.rc-how-body ol { margin: 0 0 14px; padding-left: 18px; display: grid; gap: 8px; }
.rc-how-body b { color: var(--c-text); }
.rc-how code { background: rgba(148, 163, 184, 0.1); border-radius: 4px; padding: 1px 5px; overflow-wrap: anywhere; color: var(--c-text); }
.rc-how-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.rc-foot { margin-top: 24px; }
.rc-foot nav { gap: 0 8px; }
.rc-foot nav a { display: inline-block; padding: 12px 6px; } /* touch-sized without changing the look */

/* touch screens: buttons at least 44px tall, pressed feedback instead of the grey flash */
@media (pointer: coarse) {
  .rc-top .btn-sm, .rc-how-btns .btn-sm, .vp-card .btn-sm { height: 44px; padding: 0 16px; font-size: var(--fs-sm); }
  .rc-main .btn { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
}

@media (max-width: 600px) {
  .rc-top { margin-bottom: 16px; }
  .rc-card { padding: 20px 16px; border-radius: var(--r-lg); }
  .rc-checks { grid-template-columns: 1fr; margin: 20px 0; }
  .rc-checks li { padding: 12px; gap: 10px; }
  /* details: short values two to a row, dates wrap after the comma, the long ids take a full row */
  .rc-dl div { padding: 10px 12px; }
  .rc-result { text-align: left; }
  #rcChart { height: 200px; }
  .rc-chart-wrap { padding: 8px 6px 6px; }
  .rc-top-actions .btn-secondary { display: none; }
  .rc-how-btns .btn { flex: 1 1 100%; justify-content: center; }
  .rc-how-body { padding: 0 14px 14px; }
  .rc-how-body ol { padding-left: 16px; }
}
/* a phone held sideways: the chart keeps a usable height */
@media (max-height: 500px) and (orientation: landscape) { #rcChart { height: 180px; } }

/* Phones and touch screens: the drifting, blurred background lights and the frosted card cost a lot of GPU time
   for little visible effect (the card is nearly opaque), so the lights hold still and the card is plain. */
@media (max-width: 760px), (pointer: coarse) {
  .au-bg .orb { animation: none; filter: none; }
  .rc-card { -webkit-backdrop-filter: none; backdrop-filter: none; background: linear-gradient(180deg, #101f33, #0b1728); }
}
@media (prefers-reduced-motion: reduce) { .rc-card { animation: none; } .rc-checks li.pending .rc-ck { animation: none; } }
.rc-checks li[hidden], .rc-how li[hidden] { display: none; }
.rc-checks li[data-check="fair"] { grid-column: 1 / -1; }

/* Arabic (right to left) */
html[dir="rtl"] .rc-result { text-align: left; }
html[dir="rtl"] .rc-how-body ol { padding-left: 0; padding-right: 18px; }
html[dir="rtl"] .rc-checks li.ok .rc-ck::after { left: auto; right: 6px; }
html[dir="rtl"] #rcKey, html[dir="rtl"] #rcFp { direction: ltr; unicode-bidi: isolate; }
/* signed amounts keep their sign in front: −$10.00, not $10.00− */
html[dir="rtl"] .rc-result b { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .rc-dl dd.up, html[dir="rtl"] .rc-dl dd.down, html[dir="rtl"] .rc-dl dd.mono { direction: ltr; text-align: right; }
@media (max-width: 600px) { html[dir="rtl"] .rc-result { text-align: right; } }
