.tem-commerce {
  --tem-rim: #5d4137;
  --tem-gold: #f1bd91;
  --tem-paper: #f5e7da;
  --tem-muted: #c8b6ac;
  --tem-display: "Trilli0N Display", Georgia, serif;
  color: var(--tem-paper);
}

.tem-commerce.tem-commerce .page-intro h1 {
  color: var(--tem-paper);
  font: 600 clamp(3rem, 6vw, 6rem)/.96 var(--tem-display);
  letter-spacing: -.04em;
}

.tem-commerce .page-intro { padding-bottom: clamp(1.5rem, 3.25vw, 2.75rem); }
.tem-commerce p { text-wrap: pretty; }
.tem-commerce .text-link { color: var(--tem-gold); text-decoration-color: #9f684c; }
.tem-commerce .text-link:hover, .tem-text-button:hover { color: #ffe1c2; text-decoration: underline; }

.tem-plate {
  min-width: 0;
  padding: clamp(1.25rem, 2.65vw, 2.6rem);
  border: 1px solid var(--tem-rim);
  border-top-color: #99654b;
  border-radius: 2px 16px 2px 2px;
  background: linear-gradient(135deg, #22191b, #111116 68%);
  box-shadow: inset 0 1px #ffd3aa0e, 0 14px 34px #0003;
}

.tem-plate h2 {
  color: var(--tem-paper);
  font: 600 clamp(1.8rem, 3.05vw, 3.1rem)/1 var(--tem-display);
  letter-spacing: -.027em;
}

.tem-plate h3 { font-size: 1.15rem; line-height: 1.25; }
.tem-plate p, .tem-identity div > span { color: var(--tem-muted); }
.tem-info > * + *, .tem-empty > * + *, .tem-stack > * + * { margin-top: .85rem; }
.tem-info, .tem-entry { min-height: 9.5rem; }

.tem-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  padding: 0;
  min-height: clamp(20rem, 31vw, 27rem);
  overflow: hidden;
}

.tem-entry-form { padding: clamp(1.55rem, 3.45vw, 3.35rem); align-self: center; }
.tem-entry-mark {
  display: grid;
  position: relative;
  place-items: center;
  overflow: hidden;
  border-left: 1px solid var(--tem-rim);
  background: radial-gradient(ellipse at 64% 45%, #3a2424, #130e13 75%);
}
.tem-entry-mark img { width: min(87%, 29rem); height: auto; aspect-ratio: 1.65; object-fit: cover; object-position: center 52%; }

.tem-form { max-width: 33rem; margin-top: .75rem; }
.tem-form h3, .tem-form p { margin-bottom: .85rem; }
.tem-form label { display: block; margin-bottom: .38rem; color: var(--tem-paper); font-size: .88rem; font-weight: 630; }
.tem-commerce :is(input, select) {
  display: block;
  width: 100%;
  max-width: 29rem;
  min-height: 46px;
  margin-bottom: .95rem;
  padding: .57rem .76rem;
  border: 1px solid #79564a;
  border-radius: 2px;
  color: var(--tem-paper);
  background: #141216;
  font: inherit;
}
.tem-commerce input::placeholder { color: #af9c92; }
.tem-commerce input[autocomplete="one-time-code"] { max-width: 15rem; letter-spacing: .17em; font-variant-numeric: tabular-nums; }
.tem-commerce .button:disabled { opacity: .62; cursor: wait; }
.tem-commerce select:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; }
.tem-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .75rem; }
.tem-text-button {
  min-height: 44px;
  padding: .3rem .14rem;
  border: 0;
  color: var(--tem-gold);
  background: transparent;
  font-size: .88rem;
  font-weight: 650;
  text-align: left;
}
.tem-text-button:disabled { opacity: .6; cursor: wait; }
.tem-feedback { margin-top: .85rem; color: var(--tem-gold); font-size: .93rem; }
.tem-commerce .tem-feedback[data-error="true"] { color: #ffc2b0; }
.tem-commerce .tem-feedback a { text-decoration: underline; }

.tem-identity {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.15rem;
  padding: .9rem 1.2rem;
  border-block: 1px solid var(--tem-rim);
  background: linear-gradient(90deg, #261a1b, #121116);
}
.tem-identity div > span { font-size: .86rem; margin-right: .65rem; }
.tem-identity strong { overflow-wrap: anywhere; }
.tem-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
}
.tem-dashboard .tem-plate { padding: clamp(1.2rem, 2.15vw, 2.1rem); }
.tem-panel-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .65rem; margin-bottom: 1.12rem; }
.tem-panel-heading a { font-size: .88rem; }
.tem-orders-panel, .tem-clans-panel { grid-column: 1 / -1; }
.tem-reminder-panel { background: linear-gradient(150deg, #20191d, #121217 68%); }
.tem-reminder-panel .tem-actions { margin-top: 1rem; }

.tem-license, .tem-clan { border-top: 1px solid var(--tem-rim); padding-block: 1rem; }
.tem-license:last-child, .tem-clan:last-child { padding-bottom: 0; }
.tem-license-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .45rem .7rem; }
.tem-status { color: var(--tem-gold); font-size: .88rem; font-weight: 650; }
.tem-status[data-good="true"] { color: #b1e6d6; }
.tem-facts {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 2rem;
  margin-block: .65rem 1rem;
}
.tem-facts div { min-width: 6rem; }
.tem-facts dt { color: var(--tem-muted); font-size: .83rem; }
.tem-facts dd { margin-left: 0; font-variant-numeric: tabular-nums; }
.tem-code-card { margin-top: 1rem; padding: .85rem; border: 1px solid #825842; background: #1a1518; }
.tem-code-card .tem-actions { margin-block: .4rem; }
.tem-code-card code { color: #ffe2c2; font: 650 1rem/1.45 var(--mono); overflow-wrap: anywhere; user-select: all; }
.tem-code-card p { font-size: .875rem; }

.tem-order-head, .tem-order-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(6rem, .58fr) minmax(8rem, .8fr) minmax(9rem, .9fr); gap: .65rem 1rem; align-items: center; }
.tem-order-head { color: var(--tem-muted); font-size: .85rem; }
.tem-order-row { border-top: 1px solid var(--tem-rim); padding-block: .72rem; }
.tem-order-head { padding-bottom: .6rem; }
.tem-order-row:last-child { padding-bottom: 0; }
.tem-order-row[data-resume] > div:last-child { display: flex; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; }
.tem-order-row .tem-text-button { min-height: 32px; }

.tem-checkout { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.tem-checkout-summary { background: radial-gradient(ellipse at 72% 4%, #55332280, transparent 66%), linear-gradient(135deg, #261d20, #121116 78%); }
#checkout-price.tem-total { display: block; margin-block: .8rem 1.05rem; color: #ffd5aa; font: 600 clamp(2.75rem, 5vw, 5rem)/1 var(--tem-display); font-variant-numeric: tabular-nums; }
.tem-terms { margin: .65rem 0 0; padding-left: 1.13rem; color: var(--tem-muted); }
.tem-terms li + li { margin-top: .42rem; }
.tem-checkout-action .tem-action { margin-top: 1rem; }
.tem-checkout-action h2 + p { margin-top: .65rem; }
.tem-commerce .tem-code-label { font-size: .86rem; }

.tem-access { margin-bottom: 1rem; }
.tem-check { display: flex; align-items: start; gap: .65rem; color: var(--tem-muted); cursor: pointer; }
.tem-commerce .tem-check input { width: 1.13rem; min-height: 1.13rem; margin: .18rem 0 0; accent-color: var(--tem-gold); }
.tem-invite-form { margin-top: 1.1rem; padding-block: .95rem; border-block: 1px solid var(--tem-rim); }
.tem-roster { margin-top: 1.1rem; }
.tem-roster h3 { margin-block: 1.15rem .6rem; }
.tem-roster-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(7.5rem, .35fr) minmax(8.5rem, auto); gap: .55rem .8rem; align-items: center; padding-block: .65rem; border-top: 1px solid var(--tem-rim); }
.tem-roster-row p { overflow-wrap: anywhere; font-size: .88rem; }
.tem-roster-row strong { overflow-wrap: anywhere; }

@media (max-width: 820px) {
  .tem-dashboard, .tem-checkout { grid-template-columns: minmax(0, 1fr); }
  .tem-entry { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
}

@media (max-width: 585px) {
  .tem-entry { display: block; min-height: initial; }
  .tem-entry-mark, .tem-order-head { display: none; }
  .tem-order-row { grid-template-columns: minmax(0, 1fr) auto; }
  .tem-order-row > :last-child { grid-column: 1 / -1; }
  .tem-roster-row { grid-template-columns: minmax(0, 1fr); }
}
