/*
 * reseller.css — the mobile app at /.
 *
 * Mobile-first and single column. The wireframe framed the app inside a phone
 * mock; production is the phone, so the frame is gone and the same layout just
 * grows a max-width on a tablet or desktop.
 */

body.app {
  background: #e8eee9;
}

.app-shell {
  width: 100%;
  max-width: 520px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
  position: relative;
}

/* ---------- screens ---------- */

.screen {
  display: block;
}

.screen.is-hidden {
  display: none !important;
}

/* ---------- header ---------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: calc(12px + env(safe-area-inset-top)) 14px 10px;
  background: rgba(248, 250, 247, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(220, 226, 221, 0.75);
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(198, 146, 45, 0.4);
  background: radial-gradient(circle at 35% 30%, #f8dfa6, #c6922d 64%, #8f671c);
  color: #fff8e6;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.05em;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.25);
}

.brand-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.brand-copy strong {
  display: block;
  font-size: 15px;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy span {
  display: block;
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--muted);
}

.sub-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: var(--tap) 1fr var(--tap);
  align-items: center;
  gap: 8px;
  min-height: 68px;
  padding: calc(12px + env(safe-area-inset-top)) 12px 10px;
  background: rgba(248, 250, 247, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(220, 226, 221, 0.75);
}

.sub-header h1 {
  margin: 0;
  text-align: center;
  font-size: 17px;
  letter-spacing: -0.03em;
}

/* ---------- notices strip ---------- */

.notices {
  display: grid;
  gap: 10px;
  padding: 12px 14px 0;
}

.notices:empty {
  padding: 0;
}

/* ---------- hero ---------- */

.hero {
  margin: 14px 14px 0;
  border-radius: 22px;
  padding: 20px;
  background: var(--forest);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  width: 155px;
  height: 155px;
  right: -66px;
  top: -55px;
  border: 34px solid rgba(255, 255, 255, 0.055);
  border-radius: 50%;
}

.hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hero-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #bfd3c6;
}

.hero-price {
  margin-top: 6px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.hero-unit {
  font-size: 12px;
  font-weight: 600;
  color: #cbd9d0;
}

.hero-pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 46%;
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.13);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.hero-pill .dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #65d49d;
  box-shadow: 0 0 0 3px rgba(101, 212, 157, 0.16);
}

.hero-pill.is-blocked .dot {
  background: #efc45c;
  box-shadow: 0 0 0 3px rgba(239, 196, 92, 0.18);
}

.hero-meta {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 11px;
  color: #c2d1c7;
}

.hero-meta strong {
  display: block;
  margin-top: 3px;
  color: #ffffff;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* ---------- content blocks ---------- */

.content {
  padding: 16px 14px 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-head h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 340px) {
  .action-grid {
    grid-template-columns: 1fr;
  }
}

.action-card {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 17px;
  padding: 15px;
  text-align: left;
  cursor: pointer;
  min-height: 128px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.action-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.action-card:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.action-card .card-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--forest);
}

.action-card.sell .card-icon {
  background: var(--gold-soft);
  color: var(--gold-dark);
}

.action-card strong {
  display: block;
  margin-top: 12px;
  font-size: 15px;
}

.action-card span {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}

/* ---------- evidence ---------- */

.evidence {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--white);
  overflow: hidden;
}

.evidence > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 12px 14px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  list-style: none;
}

.evidence > summary::-webkit-details-marker {
  display: none;
}

.evidence > summary .spacer {
  margin-left: auto;
}

.evidence-body {
  padding: 0 14px 14px;
}

.evidence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 340px) {
  .evidence-grid {
    grid-template-columns: 1fr;
  }
}

.evidence-item {
  background: #f3f6f3;
  border-radius: 11px;
  padding: 10px;
  min-width: 0;
}

.evidence-item .k {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  margin-bottom: 4px;
}

.evidence-item .v {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

/* ---------- quote flow ---------- */

.segmented {
  margin: 14px 14px 0;
  padding: 4px;
  background: #e9eeea;
  border-radius: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.segment {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  min-height: var(--tap);
  padding: 10px 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.segment[aria-pressed="true"] {
  background: var(--white);
  color: var(--forest);
  box-shadow: 0 2px 8px rgba(22, 32, 25, 0.08);
}

.quote-summary {
  margin: 14px 14px 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px;
}

.summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.summary-title {
  font-size: 12px;
  color: var(--muted);
}

.summary-value {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 2px;
}

.rule-box {
  margin-top: 13px;
  background: #f1f4f1;
  border-radius: 13px;
  padding: 11px 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: #4f5d54;
}

.margin-control {
  margin-top: 16px;
  border-top: 1px solid #edf0ed;
  padding-top: 14px;
}

.margin-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.margin-line .field-label {
  margin: 0;
  font-size: 13px;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stepper button {
  width: var(--tap);
  height: var(--tap);
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--white);
  color: var(--forest);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.stepper button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.stepper .readout {
  min-width: 62px;
  text-align: center;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
}

.margin-hint {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- denominations ---------- */

.denoms {
  margin: 18px 14px 0;
}

.helper {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: -4px 0 11px;
}

.denom-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.denom-list > legend {
  padding: 0;
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}

.denom-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  min-height: var(--tap);
  cursor: pointer;
}

.denom-row:has(input:checked) {
  border-color: var(--forest);
  background: #fbfdfb;
}

.denom-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--forest);
}

.denom-text {
  min-width: 0;
}

.denom-text .weight {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.denom-text .base {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.denom-row .quoted {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

/* ---------- sticky call to action ---------- */

.sticky-cta {
  position: sticky;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 8;
  margin-top: 16px;
  padding: 14px;
  background: linear-gradient(to top, var(--paper) 72%, rgba(248, 250, 247, 0));
}

/* ---------- message preview ---------- */

.preview-card {
  margin: 14px 14px 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #edf0ed;
  font-size: 13px;
  font-weight: 700;
}

.message {
  margin: 0;
  padding: 15px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.65;
  color: #2b352e;
}

.line-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.line-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #edf0ed;
  font-size: 13px;
}

.line-list li:last-child {
  border-bottom: 0;
}

.line-list .w {
  font-weight: 700;
}

.line-list .p {
  font-family: var(--mono);
  font-weight: 600;
  text-align: right;
}

.line-list .ref {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.fine-print {
  margin: 14px 14px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

/* ---------- settings ---------- */

.settings-block {
  margin: 18px 14px 0;
}

.settings-block > h2 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 4px 14px 16px;
}

.form-card .field:first-child {
  margin-top: 12px;
}

.readonly-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #edf0ed;
  font-size: 13px;
}

.readonly-row:last-child {
  border-bottom: 0;
}

.readonly-row > span {
  color: var(--muted);
}

.readonly-row > strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- payment methods & claims ---------- */

.method-list,
.claim-list {
  display: grid;
  gap: 10px;
}

.method-card,
.claim-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 13px 14px;
}

.method-head,
.claim-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.method-head .method-type {
  order: -1;
  width: 100%;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.method-head .method-label {
  font-size: 15px;
  letter-spacing: -0.01em;
  min-width: 0;
  word-break: break-word;
}

.method-head .method-badge {
  margin-left: auto;
}

.method-card .kv-row {
  gap: 8px;
  font-size: 12.5px;
}

.method-card .kv-row > strong {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.copy-value {
  flex: 0 0 auto;
  min-height: 32px;
  min-width: 0;
  padding: 4px 9px;
  font-size: 11.5px;
  border-radius: 9px;
}

.method-instructions {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.method-instructions:empty {
  display: none;
}

.claim-item .claim-amount {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.claim-head .badge {
  margin-left: auto;
}

.claim-meta,
.claim-reason {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
  word-break: break-word;
}

.claim-reason {
  margin-top: 6px;
  color: var(--red);
  font-weight: 600;
}

.claim-reason:empty,
.claim-meta:empty {
  display: none;
}

/* The file picker is a native control; only its box is ours. */
.field input[type="file"] {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 13px;
}

.file-info {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
  word-break: break-all;
}

.file-info:empty {
  display: none;
}

/* ---------- bottom navigation ---------- */

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 520px;
  padding: 6px 12px max(10px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.nav-btn {
  border: 0;
  background: transparent;
  color: #8b968f;
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.nav-btn[aria-current="page"] {
  color: var(--forest);
}

.nav-btn .nav-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0;
}

.nav-btn[aria-current="page"] .nav-dot {
  opacity: 1;
}

/* ---------- blocked state ---------- */

.blocked-panel {
  margin: 14px 14px 0;
}

.hero.is-masked .hero-price,
.hero.is-masked .hero-meta strong {
  /* Subscription block hides price detail entirely — wireframe precedence:
     a tenant that may not use the app is told about its own account only. */
  color: #9fb3a6;
}
