/* DTR coupon ticket — shared styles for /coupons and the admin preview */
:root, .tk, .tk-scope {
  --navy: #0b1f3a;
  --navy-2: #13294a;
  --ink: #16202e;
  --ink-2: #4a5568;
  --ink-3: #7b8696;
  --paper: #eef1f7;
  --card: #ffffff;
  --rule: #e1e6f0;
  --gold: #b8953e;
  --gold-ink: #8a611f;
  --cream: #fbf2e2;
  --head: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Roboto Mono", Consolas, monospace;
  --gold-hi: #e0c06a;
  --gold-wash: #fbf5e6;
  --red: #cc2200;
  --green: #1f7a4d;
}

.tk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--rule);
  overflow: hidden;
  position: relative;
}
.tk-featured { box-shadow: 0 0 0 2px var(--gold), 0 14px 34px -16px rgba(184, 149, 62, .55); }

.tk-main { padding: 24px 26px 22px; min-width: 0; }
.tk-head { display: flex; align-items: center; gap: 14px; }
.tk-logo {
  width: 52px; height: 52px; flex: none; border-radius: 12px;
  background: var(--navy); color: var(--gold-hi);
  display: grid; place-items: center; overflow: hidden; position: relative;
  font: 700 17px/1 var(--head); letter-spacing: .02em;
}
.tk-logo img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.tk-logo-icon { background: #fff; border: 1px solid var(--rule); padding: 0; }
.tk-logo-icon img { width: 100%; height: 100%; object-fit: cover; }
.tk-logo-wide { width: auto; min-width: 52px; max-width: 170px; padding: 9px 14px; background: #fff; border: 1px solid var(--rule); }
.tk-logo-wide img { height: 100%; width: auto; }
.tk-logo-dark { background: var(--navy); border-color: var(--navy); }
.tk-title h3 {
  margin: 0; font: 800 22px/1.15 var(--head); letter-spacing: -.01em;
  color: var(--ink);
}
.tk-kind { margin: 4px 0 0; font: 500 11.5px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); }
.tk-kind strong { color: var(--gold-ink); font-weight: 600; }

.tk-desc { margin: 16px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.55; }

.tk-price { margin: 16px 0 0; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.tk-amount { font: 800 34px/1 var(--head); color: var(--green); letter-spacing: -.01em; }
.tk-unit { color: var(--ink-3); font-size: 14px; }

.tk-opts { margin: 16px 0 0; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.tk-opts table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.tk-opts th { font: 600 11px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); text-align: left; background: var(--paper); padding: 9px 12px; }
.tk-opts th:not(:first-child), .tk-opts td:not(:first-child) { text-align: right; }
.tk-opts td { padding: 9px 12px; border-top: 1px solid var(--rule); color: var(--ink); }
.tk-opts td:first-child { font-weight: 600; }
.tk-opts .tk-reg { color: var(--ink-3); text-decoration: line-through; text-decoration-color: rgba(204, 34, 0, .55); }
.tk-opts .tk-deal { color: var(--green); font-weight: 800; font-size: 16.5px; }
.tk-opts tbody tr:nth-child(even) td { background: #fafbfd; }
.tk-opts-note { margin: 0; padding: 8px 12px; font-size: 12.5px; color: var(--ink-3); border-top: 1px solid var(--rule); background: var(--paper); }
.tk-opts tr.tk-best td { background: #f1faf4; }
.tk-best-tag { display: inline-block; margin-left: 6px; padding: 2px 7px; border-radius: 999px; background: var(--green); color: #fff; font: 700 10px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; vertical-align: 2px; }
.tk-plans { margin: 0; padding: 10px 12px; border-top: 1px solid var(--rule); display: grid; gap: 6px; font-size: 13.5px; }
.tk-plans div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; }
.tk-plans dt { font-weight: 700; color: var(--ink); }
.tk-plans dd { margin: 0; color: var(--ink-2); }
@media (max-width: 560px) { .tk-plans div { grid-template-columns: 1fr; gap: 0; } }
.tk-specs {
  margin: 18px 0 0; padding: 14px 0 0; border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 22px;
}
.tk-spec { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; min-width: 0; }
.tk-spec dt { color: var(--ink-3); }
.tk-spec dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.tk-spec dd.tk-none { color: var(--green); }

/* The tear-off stub */
.tk-stub {
  background: var(--navy);
  color: #fff;
  padding: 24px 20px 20px;
  display: flex; flex-direction: column; align-items: stretch; gap: 12px;
  position: relative;
  text-align: center;
}
.tk-stub::before { /* perforation */
  content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 2px;
  background: repeating-linear-gradient(to bottom, var(--card) 0 6px, transparent 6px 12px);
}
.tk-notch { position: absolute; left: -11px; width: 22px; height: 22px; border-radius: 50%; background: var(--paper); }
.tk-notch.t { top: -11px; } .tk-notch.b { bottom: -11px; }
.tk-off {
  margin: 0; font: 800 40px/.95 var(--head); 
  color: var(--gold-hi); letter-spacing: -.01em; white-space: nowrap;
}
.tk-off small { font-size: .5em; font-weight: 700; letter-spacing: .02em; margin-left: 2px; }
.tk-code {
  appearance: none; border: 1.5px dashed var(--gold); background: rgba(224, 192, 106, .08);
  color: #fff; border-radius: 10px; padding: 12px 8px 9px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: background .15s, border-color .15s;
}
.tk-code:hover { background: rgba(224, 192, 106, .16); }
.tk-code:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 2px; }
.tk-code-val { font: 700 21px/1 var(--mono); letter-spacing: .06em; word-break: break-all; }
.tk-code-hint { font-size: 12px; color: #b9c4d4; }
.tk-copied { border-style: solid; border-color: var(--gold-hi); background: rgba(224, 192, 106, .22); }
.tk-copied .tk-code-hint { color: var(--gold-hi); }
.tk-exp { margin: 0; font-size: 13.5px; color: #b9c4d4; }
.tk-urgent { color: #fff; }
.tk-urgent::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff5a36; margin-right: 7px; vertical-align: 1px; box-shadow: 0 0 0 3px rgba(255, 90, 54, .25); }
.tk-cta {
  margin-top: auto; display: block; padding: 12px 10px; border-radius: 10px;
  background: var(--gold); color: var(--navy); font: 700 15px/1.2 var(--head);
  text-decoration: none; transition: background .15s;
}
.tk-cta:hover { background: var(--gold-hi); }
.tk-cta:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* Cards size to their container (page list, admin preview, phone) */
.tk-host { container-type: inline-size; }
@container (max-width: 640px) {
  .tk { grid-template-columns: 1fr; }
  .tk-main { padding: 20px 18px 18px; }
  .tk-specs { grid-template-columns: 1fr; }
  .tk-stub { padding: 20px 18px 18px; }
  .tk-stub::before { left: 14px; right: 14px; top: -1px; bottom: auto; width: auto; height: 2px;
    background: repeating-linear-gradient(to right, var(--card) 0 6px, transparent 6px 12px); }
  .tk-notch.t { left: -11px; top: -11px; } .tk-notch.b { left: auto; right: -11px; top: -11px; bottom: auto; }
  .tk-off { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) { .tk-code, .tk-cta { transition: none; } }
