/* Stock Gift. Uses StoxCredit tokens only (--sc-*). */
/* Hidden for now: the sender's own "Sender details" box on the claim page. Delete this line to show it again. */
.gift-sender-details { display: none !important; }
.gift-x-actions { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 2px; }
.gift-x-actions .gift-check { font-size: 14px; }
.gift-xtasks { border-top: 1px solid var(--sc-border); padding-top: 10px; }
.gift-xtasks summary { cursor: pointer; color: var(--sc-accent); font-size: 14px; font-weight: 650; }
.gift-xtasks-body { display: grid; gap: 12px; margin-top: 12px; }
.gift-xtasks-body .gift-label { display: grid; gap: 6px; }
html[data-gift-route] body main:not(#giftView) { display: none !important; }
html[data-gift-route] body #giftView { display: block !important; }
#giftView[hidden] { display: none; }
html[data-gift-route] body.app-mode .site-nav { display: flex !important; }
html[data-gift-route] body.app-mode .site-nav a { display: inline-flex !important; }

html[data-gift-route] body.app-mode #giftView.gift-shell { box-sizing: border-box; width: 100%; max-width: 672px; margin: 0 auto; padding: 28px 16px 72px; color: var(--sc-text); }
.gift-heading { margin: 8px 0 22px; }
.gift-heading h1 { margin: 10px 0 8px; font: 650 40px/1.1 Inter, Geist, "Segoe UI", system-ui, sans-serif; letter-spacing: -.03em; color: var(--sc-text); }
.gift-heading p { margin: 0; max-width: 520px; color: var(--sc-muted); font-size: 15px; line-height: 1.55; }

.gift-tabs { display: flex; gap: 22px; margin: 0 0 20px; border-bottom: 1px solid var(--sc-border); }
.gift-tabs a { padding: 10px 0 11px; color: var(--sc-muted); font-size: 14px; font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.gift-tabs a[aria-current="page"] { color: var(--sc-text); border-bottom-color: var(--sc-accent); }
.gift-tabs a:hover { color: var(--sc-text); }

.gift-card { display: grid; gap: 18px; padding: 22px; border: 1px solid var(--sc-border); border-radius: 4px; background: var(--sc-surface); }
.gift-card + .gift-card { margin-top: 16px; }
.gift-field { display: grid; gap: 7px; min-width: 0; }
.gift-field label, .gift-label, .gift-fieldset legend { color: var(--sc-text); font-size: 13px; font-weight: 600; }
.gift-field small, .gift-fieldset legend small { color: var(--sc-muted); font-weight: 400; }
.gift-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.gift-balance, .gift-count { color: var(--sc-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.gift-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.gift-input, #giftView select {
  width: 100%; min-height: 44px; box-sizing: border-box; padding: 9px 12px;
  border: 1px solid var(--sc-border); border-radius: 4px; background: var(--sc-surface);
  color: var(--sc-text); font: 500 15px/1.3 Inter, Geist, "Segoe UI", system-ui, sans-serif; font-variant-numeric: tabular-nums;
}
#giftView select { appearance: auto; }
.gift-input::placeholder { color: var(--sc-muted); opacity: .8; }
.gift-input:focus, #giftView select:focus { outline: 2px solid var(--sc-accent); outline-offset: 1px; border-color: var(--sc-accent); }
#giftTokenOther { margin-top: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

.gift-amount { display: flex; align-items: center; border: 1px solid var(--sc-border); border-radius: 4px; background: var(--sc-surface); }
.gift-amount:focus-within { outline: 2px solid var(--sc-accent); outline-offset: 1px; border-color: var(--sc-accent); }
.gift-amount .gift-input { border: 0; outline: 0; min-width: 0; flex: 1; font-size: 20px; font-weight: 650; }
.gift-unit { color: var(--sc-muted); font-size: 13px; font-weight: 600; padding: 0 8px; white-space: nowrap; }
.gift-ghost { margin-right: 6px; min-height: 30px; padding: 0 10px; border: 1px solid var(--sc-border); border-radius: 4px; background: transparent; color: var(--sc-accent); font-size: 12px; font-weight: 650; cursor: pointer; }
.gift-ghost:disabled { opacity: .45; cursor: default; }

.gift-switch { display: inline-grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 4px; background: var(--sc-raised); width: 100%; max-width: 340px; }
.gift-switch button { min-height: 38px; border: 0; border-radius: 4px; background: transparent; color: var(--sc-text); font-size: 14px; font-weight: 600; cursor: pointer; }
.gift-switch button.on { background: var(--sc-accent); color: #fff; }

.gift-check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--sc-text); cursor: pointer; }
.gift-check input { width: 18px; height: 18px; accent-color: var(--sc-accent); }

.gift-fieldset { display: grid; gap: 14px; margin: 0; padding: 16px 0 0; border: 0; border-top: 1px solid var(--sc-border); }
.gift-fieldset legend { padding: 0 8px 0 0; }

.gift-primary, .gift-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; box-sizing: border-box;
  padding: 0 18px; border-radius: 4px; font: 650 15px/1 Inter, Geist, "Segoe UI", system-ui, sans-serif; text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, opacity .15s ease;
}
.gift-primary, #giftView a.gift-primary, #giftView a.gift-primary:visited { border: 1px solid transparent; background: var(--sc-accent); color: #fff; }
#giftView a.gift-secondary, #giftView a.gift-secondary:visited { color: var(--sc-text); }
.gift-primary:hover:not(:disabled) { filter: brightness(1.08); }
.gift-primary:disabled { opacity: .55; cursor: default; }
.gift-secondary { border: 1px solid var(--sc-border); background: transparent; color: var(--sc-text); }
.gift-secondary:hover { border-color: var(--sc-accent); }

.gift-error { margin: 0; padding: 11px 13px; border-left: 3px solid var(--sc-danger); border-radius: 4px; background: var(--sc-raised); color: var(--sc-danger); font-size: 14px; }
.gift-error.is-quiet { border-left-color: var(--sc-border); color: var(--sc-muted); }
.gift-note, .gift-muted { margin: 0; color: var(--sc-muted); font-size: 13px; line-height: 1.5; }
.gift-muted a, .gift-note a { color: var(--sc-accent); font-weight: 600; text-decoration: none; }
.gift-center { text-align: center; }

.gift-steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.gift-step { display: grid; grid-template-columns: 12px 1fr; column-gap: 10px; align-items: center; font-size: 14px; color: var(--sc-text); }
.gift-step small { grid-column: 2; color: var(--sc-muted); font-size: 12px; }
.gift-step small a { color: var(--sc-accent); text-decoration: none; font-weight: 600; }
.gift-step-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--sc-border); box-sizing: border-box; }
.gift-step.is-active .gift-step-dot { border-color: var(--sc-accent); animation: gift-pulse 1s ease-in-out infinite; }
.gift-step.is-done .gift-step-dot { border-color: var(--sc-success); background: var(--sc-success); }
.gift-step.is-failed .gift-step-dot { border-color: var(--sc-danger); background: var(--sc-danger); }
.gift-step.is-idle { color: var(--sc-muted); }
@keyframes gift-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .gift-step.is-active .gift-step-dot { animation: none; } }

.gift-share { text-align: center; justify-items: center; }
.gift-share h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.gift-share p { margin: 0; }
.gift-link { width: 100%; }
.gift-link .gift-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; text-align: center; }
.gift-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; width: 100%; }
.gift-success-mark { display: block; font-size: 34px; line-height: 1; }

.gift-envelope { display: grid; justify-items: center; gap: 8px; padding: 6px 0 4px; text-align: center; }
.gift-from { margin: 0; color: var(--sc-muted); font-size: 13px; }
.gift-from code { color: var(--sc-text); font-size: 13px; }
.gift-message { margin: 0; max-width: 460px; color: var(--sc-text); font-size: 22px; font-weight: 650; line-height: 1.3; letter-spacing: -.015em; overflow-wrap: anywhere; }
.gift-facts { display: grid; grid-template-columns: repeat(2, 1fr); margin: 0; border-top: 1px solid var(--sc-border); border-bottom: 1px solid var(--sc-border); }
.gift-facts > div { padding: 13px 12px 13px 0; }
.gift-facts > div:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--sc-border); }
.gift-facts > div:nth-child(n+3) { border-top: 1px solid var(--sc-border); }
.gift-facts dt { color: var(--sc-muted); font-size: 12px; }
.gift-facts dd { margin: 4px 0 0; color: var(--sc-text); font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.gift-rules { display: grid; gap: 6px; }
.gift-rules ul { margin: 0; padding-left: 18px; color: var(--sc-text); font-size: 14px; line-height: 1.6; }
.gift-claim-actions { display: grid; gap: 10px; }
.gift-sender-note { display: grid; gap: 6px; padding: 14px; border-left: 3px solid var(--sc-warning); border-radius: 4px; background: var(--sc-raised); color: var(--sc-text); font-size: 14px; line-height: 1.5; }
.gift-sender-note p { margin: 0; color: var(--sc-muted); font-size: 13px; }
.gift-won { display: grid; justify-items: center; gap: 4px; padding: 14px 0; text-align: center; }
.gift-won p { margin: 6px 0 0; color: var(--sc-muted); font-size: 14px; }
.gift-won strong { color: var(--sc-success); font-size: 30px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.gift-won.is-past strong { color: var(--sc-text); font-size: 22px; }
.gift-won small a { color: var(--sc-accent); font-weight: 600; text-decoration: none; }
.gift-won:not(.is-past) .gift-success-mark { animation: gift-pop .5s ease-out; }
@keyframes gift-pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }

.gift-logo { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; background: var(--sc-raised); }
.gift-logo img { width: 100%; height: 100%; object-fit: cover; }
.gift-logo.is-letter::before { content: attr(data-letter); color: var(--sc-text); font-size: 13px; font-weight: 700; }
.gift-picker { position: relative; }
.gift-picker-button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 12px; border: 1px solid var(--sc-border); border-radius: 4px; background: var(--sc-surface); color: var(--sc-text); font: 500 15px/1.3 Inter, Geist, "Segoe UI", system-ui, sans-serif; text-align: left; cursor: pointer; }
.gift-picker-button:focus-visible, .gift-picker-button[aria-expanded="true"] { outline: 2px solid var(--sc-accent); outline-offset: 1px; border-color: var(--sc-accent); }
.gift-picker-current { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--sc-text); }
.gift-picker-caret { color: var(--sc-muted); font-size: 16px; line-height: 1; }
.gift-picker-name { display: grid; gap: 1px; min-width: 0; flex: 1; }
.gift-picker-name strong { font-size: 15px; font-weight: 650; color: var(--sc-text); }
.gift-picker-name small { color: var(--sc-muted); font-size: 12px; }
.gift-picker-bal { margin-left: auto; color: var(--sc-text); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gift-picker-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 320px; overflow: auto; margin: 0; padding: 4px; list-style: none; border: 1px solid var(--sc-border); border-radius: 4px; background: var(--sc-surface); box-shadow: 0 12px 28px rgba(0, 0, 0, .14); }
.gift-picker-list [role="option"] { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 10px; border-radius: 4px; cursor: pointer; }
.gift-picker-list [role="option"]:hover, .gift-picker-list [role="option"]:focus { background: var(--sc-raised); outline: none; }
.gift-picker-list [role="option"][aria-selected="true"] { box-shadow: inset 3px 0 0 var(--sc-accent); }
.gift-picker-empty { display: grid; gap: 8px; justify-items: start; padding: 12px 10px; color: var(--sc-muted); font-size: 13px; border-bottom: 1px solid var(--sc-border); }

.gift-section-title { margin: 32px 0 12px; color: var(--sc-text); font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.gift-boxes { display: grid; gap: 14px; }
.gift-box { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--sc-border); border-radius: 4px; background: var(--sc-bg); }
.gift-box-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.gift-box-mark { font-size: 26px; line-height: 1; }
.gift-box-title { display: grid; gap: 2px; min-width: 0; }
.gift-box-title strong { font-size: 15px; color: var(--sc-text); }
.gift-box-title small { color: var(--sc-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gift-box-status { padding: 4px 9px; border: 1px solid var(--sc-border); border-radius: 4px; color: var(--sc-muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
.gift-box-status.is-active { border-color: var(--sc-success); color: var(--sc-success); }
.gift-box-status.is-expired { border-color: var(--sc-warning); color: var(--sc-warning); }
.gift-box-facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-top: 1px solid var(--sc-border); }
.gift-box-facts > div { padding: 10px 10px 0 0; min-width: 0; }
.gift-box-facts > div + div { padding-left: 12px; border-left: 1px solid var(--sc-border); }
.gift-box-facts dt { color: var(--sc-muted); font-size: 12px; }
.gift-box-facts dd { margin: 3px 0 0; color: var(--sc-text); font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.gift-box-actions { display: grid; grid-template-columns: 1.2fr 1fr 1.3fr; gap: 8px; }
.gift-box-actions :is(.gift-primary, .gift-secondary) { min-height: 42px; font-size: 13px; padding: 0 10px; text-align: center; line-height: 1.2; }
.gift-secondary:disabled { opacity: .55; cursor: default; }
@media (max-width: 520px) {
  .gift-box-actions { grid-template-columns: 1fr 1fr; }
  .gift-box-actions > :first-child { grid-column: 1 / -1; }
  .gift-box-facts { grid-template-columns: 1fr 1fr; }
  .gift-box-facts > div:nth-child(3) { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 1px solid var(--sc-border); margin-top: 10px; }
}

.gift-list { display: grid; }
.gift-row { display: flex; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--sc-border); color: var(--sc-text); text-decoration: none; }
.gift-row:first-child { padding-top: 0; }
.gift-row span { display: grid; gap: 3px; min-width: 0; }
.gift-row small { color: var(--sc-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gift-row-meta { text-align: right; flex-shrink: 0; }
.gift-row:hover strong { color: var(--sc-accent); }

@media (max-width: 520px) {
  html[data-gift-route] body.app-mode #giftView.gift-shell { padding: 18px 16px 56px; }
  .gift-heading h1 { font-size: 32px; }
  .gift-card { padding: 16px; gap: 16px; }
  .gift-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .gift-message { font-size: 19px; }
  .gift-switch { max-width: none; }
}
