/* ==========================================================================
   Order tickets — /order-status, /account, /account/orders, /account/orders/[id]
   The same sales-ticket language as Sweet City's invoice, in Tribeca colours:
   a rubber-stamp status, ticket stubs with a perforated tear line, a dark
   tracking bar. Prints as a plain list / invoice.
   ========================================================================== */

.tk {
	--ink: var(--color-blue, #2a1f16);
	--muted: var(--color-gray-600, #4b5563);
	--paper: #fffdf8;
	--wash: #fff6d6;
	--rule: #e8dfd0;
	--red: var(--color-red, #d21e2a);
	--gold: var(--color-yellow, #fbbf24);
	--green: #047857;
	--amber: #b45309;
	max-width: 900px;
	margin: 0 auto;
	padding: 1.5rem 0 4rem;
}

/* ---- Hero ---------------------------------------------------------------- */
.tk-hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 16px 26px;
	align-items: center;
	padding: 24px 26px;
	margin: 0 0 26px;
	background: var(--paper);
	border: 3px solid var(--ink);
	border-radius: 16px;
	box-shadow: 6px 6px 0 var(--ink);
	animation: tk-rise .5s ease-out both;
}
.tk-kicker {
	font-family: var(--font-heading);
	font-size: .8rem;
	font-weight: 600;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--red);
	margin: 0 0 6px;
}
.tk-title {
	font-family: var(--font-display);
	font-size: clamp(2.1rem, 5.5vw, 3.4rem);
	line-height: .95;
	letter-spacing: .01em;
	color: var(--ink);
	margin: 0;
}
.tk-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	align-items: center;
	margin-top: 10px;
	color: var(--muted);
	font-size: .95rem;
	overflow-wrap: anywhere;
}
.tk-meta a { color: var(--ink); font-family: var(--font-heading); font-weight: 600; font-size: .85rem; }
.tk-meta a:hover { color: var(--red); }

/* Rubber stamp: double ring, tilt, a thud on load. */
.tk-stamp {
	--s: var(--ink);
	justify-self: end;
	display: inline-block;
	transform: rotate(-7deg);
	font-family: var(--font-display);
	font-size: clamp(1.5rem, 4vw, 2.3rem);
	letter-spacing: .08em;
	line-height: 1;
	color: var(--s);
	padding: 10px 16px 8px;
	border: 3px solid var(--s);
	border-radius: 10px;
	box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 5px var(--s);
	text-align: center;
	white-space: nowrap;
	opacity: .93;
	animation: tk-stamp .55s cubic-bezier(.2, 1.6, .4, 1) .2s both;
}
.tk-stamp small {
	display: block;
	font-family: var(--font-heading);
	font-size: .66rem;
	letter-spacing: .12em;
	margin-top: 4px;
}
.tk-stamp.shipped, .tk-stamp.green { --s: var(--green); }
.tk-stamp.paid, .tk-stamp.amber, .tk-stamp.pending { --s: var(--amber); }
.tk-stamp.cancelled, .tk-stamp.red { --s: var(--red); }

/* ---- Buttons ------------------------------------------------------------- */
.tk-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 11px 18px;
	font-family: var(--font-heading);
	font-size: .9rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--ink);
	background: var(--gold);
	border: 2px solid var(--ink);
	border-radius: 10px;
	box-shadow: 3px 3px 0 var(--ink);
	cursor: pointer;
	transition: transform .12s ease, box-shadow .12s ease;
}
.tk-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); color: var(--ink); }
.tk-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.tk-btn:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.tk-btn.ghost { background: var(--paper); }
.tk-btn.dark { background: var(--ink); color: #fff; box-shadow: 3px 3px 0 var(--red); }
.tk-btn.dark:hover { color: #fff; }

/* ---- Claim ticket (forms, the "ordered here" card) ----------------------- */
.tk-claim {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 240px;
	background: var(--paper);
	border: 3px solid var(--ink);
	border-radius: 16px;
	box-shadow: 6px 6px 0 var(--ink);
	overflow: hidden;
	margin: 0 0 26px;
	animation: tk-rise .5s ease-out .08s both;
}
.tk-claim-main { padding: 26px 28px; min-width: 0; }
.tk-claim-stub {
	position: relative;
	background: var(--gold);
	border-left: 3px dashed var(--ink);
	padding: 26px 20px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 14px;
}
/* Punched notches where the stub tears off. */
.tk-claim-stub::before,
.tk-claim-stub::after {
	content: '';
	position: absolute;
	left: -14px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--bg-primary, #fff);
	border: 3px solid var(--ink);
}
.tk-claim-stub::before { top: -14px; }
.tk-claim-stub::after { bottom: -14px; }
.tk-step { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; line-height: 1.35; color: var(--ink); }
.tk-step b {
	flex: none;
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--ink);
	color: var(--gold);
	font-family: var(--font-heading);
	font-size: .85rem;
}
.tk-claim h2 {
	font-family: var(--font-display);
	font-size: clamp(1.7rem, 4vw, 2.3rem);
	line-height: 1;
	color: var(--ink);
	margin: 0 0 10px;
}
.tk-claim p { margin: 0 0 14px; color: var(--muted); line-height: 1.55; }
.tk-claim p strong { color: var(--ink); }
.tk-claim .tk-eyebrow, .tk-eyebrow {
	font-family: var(--font-heading);
	font-size: .76rem;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--red);
	margin: 0 0 4px !important;
}
.tk-fine { font-size: .86rem; }
.tk-field label {
	display: block;
	font-family: var(--font-heading);
	font-size: .78rem;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--ink);
	margin: 0 0 6px;
}
.tk-field input {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 13px 14px;
	font-size: 16px;
	border: 2px solid var(--ink);
	border-radius: 10px;
	background: #fff;
}
.tk-field input:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.tk-claim form .tk-btn { margin-top: 14px; }
.tk-alert {
	border-radius: 12px;
	padding: 12px 14px;
	margin: 0 0 16px;
	background: #fff5f5;
	border: 2px dashed var(--red);
	color: var(--ink);
}
.tk-sent { text-align: center; padding: 6px 0 2px; }
.tk-sent .big { font-size: 2.6rem; display: block; animation: tk-stamp .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.tk-sent strong { display: block; font-family: var(--font-heading); font-size: 1.25rem; color: var(--ink); margin: 8px 0 6px; }
.tk code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }

/* Marketplace ticket: dark, because it is the "not here" answer. */
.tk-claim.elsewhere .tk-claim-stub { background: var(--ink); color: #fff; }
.tk-claim.elsewhere .tk-claim-stub .tk-step { color: #fff; }
.tk-claim.elsewhere .tk-claim-stub .tk-step b { background: var(--gold); color: var(--ink); }
.tk-markets { list-style: none; margin: 0 0 14px; padding: 0; }
.tk-markets li {
	display: grid;
	grid-template-columns: 120px minmax(0, 1fr);
	gap: 10px;
	padding: 9px 0;
	border-top: 1px dotted var(--rule);
	font-size: .92rem;
	color: var(--muted);
}
.tk-markets li strong { font-family: var(--font-heading); color: var(--ink); letter-spacing: .03em; }

/* ---- Ticket stubs (order list) ------------------------------------------- */
.tk-list { display: grid; gap: 22px; }
.tk-stub {
	display: grid;
	grid-template-columns: 200px minmax(0, 1fr);
	background: var(--paper);
	border: 3px solid var(--ink);
	border-radius: 16px;
	box-shadow: 5px 5px 0 var(--ink);
	overflow: hidden;
	animation: tk-rise .45s ease-out both;
}
.tk-stub:nth-child(2) { animation-delay: .06s; }
.tk-stub:nth-child(3) { animation-delay: .12s; }
.tk-stub:nth-child(n+4) { animation-delay: .18s; }
.tk-stub-side {
	padding: 18px 16px;
	background: var(--wash);
	border-right: 3px dashed var(--ink);
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
}
.tk-stub-side .no { font-family: var(--font-heading); font-weight: 700; letter-spacing: .05em; color: var(--ink); overflow-wrap: anywhere; }
.tk-stub-side .meta { font-size: .85rem; color: var(--muted); }
.tk-stub-side .amt { font-family: var(--font-display); font-size: 1.9rem; line-height: 1; margin-top: 4px; color: var(--ink); font-variant-numeric: tabular-nums; }
.tk-stub-side .refunded { font-size: .85rem; color: var(--red); font-weight: 600; }
.tk-stub .tk-stamp {
	align-self: flex-start;
	justify-self: start;
	margin: 10px 0 2px 4px;
	font-size: 1.1rem;
	padding: 6px 10px 5px;
	border-width: 2px;
	box-shadow: inset 0 0 0 2px var(--wash), inset 0 0 0 3.5px var(--s);
	animation: none;
}
.tk-stub .tk-stamp small { font-size: .58rem; margin-top: 2px; }
.tk-stub-main { padding: 18px 20px; min-width: 0; }

.tk-mini { list-style: none; display: flex; gap: 6px; padding: 0; margin: 2px 0 12px; }
.tk-mini li {
	flex: 1;
	font-family: var(--font-heading);
	font-size: .7rem;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--muted);
	padding-top: 9px;
	border-top: 5px solid var(--rule);
	border-radius: 2px;
}
.tk-mini li.done { color: var(--ink); border-top-color: var(--red); }
.tk-note { margin: 0 0 12px; line-height: 1.5; color: var(--ink); }

.tk-tracking {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	padding: 12px 14px;
	background: var(--ink);
	color: #fff;
	border-radius: 12px;
	margin: 0 0 12px;
}
.tk-tracking .lbl { font-family: var(--font-heading); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.tk-tracking code { font-size: .98rem; letter-spacing: .03em; overflow-wrap: anywhere; flex: 1 1 180px; }
.tk-tracking .tk-btn { padding: 6px 11px; font-size: .78rem; box-shadow: 2px 2px 0 #000; }
.tk-tracking .tk-btn.ghost { background: transparent; color: #fff; border-color: #fff; box-shadow: none; }

.tk-items { margin: 0; padding: 0; list-style: none; font-size: .92rem; color: var(--ink); }
.tk-items li { padding: 6px 0; border-top: 1px dotted var(--rule); overflow-wrap: anywhere; }
.tk-items .q { display: inline-block; min-width: 2.2em; font-family: var(--font-heading); color: var(--red); }
.tk-more summary { cursor: pointer; font-size: .88rem; color: var(--red); padding: 6px 0; font-family: var(--font-heading); }
.tk-stub-foot { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; }
.tk-stub-foot .tk-btn { padding: 8px 13px; font-size: .8rem; box-shadow: 2px 2px 0 var(--ink); }
.tk-empty { text-align: center; background: var(--paper); border: 3px dashed var(--ink); border-radius: 16px; padding: 28px 22px; }
.tk-empty h2 { font-family: var(--font-display); font-size: 2rem; margin: 6px 0; }
.tk-empty .tk-btn { margin-top: 10px; }
.tk-foot { margin: 22px 0 0; color: var(--muted); font-size: .92rem; line-height: 1.55; }
.tk-foot a, .tk-claim a:not(.tk-btn) { color: var(--red); }

/* ---- Order detail -------------------------------------------------------- */
.tk-track {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	margin: 0 0 26px;
	padding: 0;
}
.tk-track li {
	position: relative;
	text-align: center;
	padding-top: 42px;
	font-family: var(--font-heading);
	font-size: .88rem;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--muted);
}
.tk-track li::before {
	content: '';
	position: absolute;
	top: 15px;
	left: -50%;
	width: 100%;
	height: 4px;
	background: repeating-linear-gradient(90deg, var(--rule) 0 8px, transparent 8px 14px);
}
.tk-track li:first-child::before { display: none; }
.tk-track li.done::before { background: var(--red); }
.tk-track .dot {
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #fff;
	border: 3px solid var(--rule);
	display: grid;
	place-items: center;
	font-size: .9rem;
	z-index: 1;
}
.tk-track li.done { color: var(--ink); }
.tk-track li.done .dot { background: var(--gold); border-color: var(--ink); color: var(--ink); }
.tk-track li.now .dot { animation: tk-pulse 1.8s ease-in-out infinite; }
.tk-track .when { display: block; font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-size: .78rem; color: var(--muted); margin-top: 2px; }

.tk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; align-items: start; }

/* The ticket: paper with scalloped tear edges. */
.tk-ticket {
	position: relative;
	background: var(--paper);
	border-left: 3px solid var(--ink);
	border-right: 3px solid var(--ink);
	padding: 28px 24px;
	margin: 14px 0;
	box-shadow: 0 18px 30px -18px rgba(24, 18, 12, .35);
	animation: tk-rise .5s ease-out .1s both;
}
.tk-ticket::before,
.tk-ticket::after {
	content: '';
	position: absolute;
	left: -3px;
	right: -3px;
	height: 14px;
	background: radial-gradient(circle at 10px 0, transparent 7px, var(--paper) 7.5px) 0 0 / 20px 14px repeat-x;
}
.tk-ticket::before { top: -13px; transform: scaleY(-1); }
.tk-ticket::after { bottom: -13px; }
.tk-ticket-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 14px;
	padding-bottom: 14px;
	border-bottom: 2px dashed var(--rule);
}
.tk-brand { font-family: var(--font-display); font-size: 1.8rem; line-height: 1; color: var(--ink); }
.tk-brand small { display: block; font-family: var(--font-body); font-size: .8rem; color: var(--muted); margin-top: 4px; letter-spacing: 0; }
.tk-ticket-head .right { text-align: right; font-size: .85rem; color: var(--muted); }
.tk-ticket-head .right strong { display: block; font-family: var(--font-heading); color: var(--ink); font-size: 1rem; letter-spacing: .04em; }

.tk-lines { width: 100%; border-collapse: collapse; margin: 14px 0 6px; font-size: .94rem; }
.tk-lines th {
	text-align: left;
	font-family: var(--font-heading);
	font-size: .72rem;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--muted);
	padding: 0 0 8px;
	border-bottom: 2px solid var(--ink);
}
.tk-lines td { padding: 10px 0; border-bottom: 1px dotted var(--rule); vertical-align: top; color: var(--ink); }
.tk-lines .num { text-align: right; white-space: nowrap; padding-left: 12px; font-variant-numeric: tabular-nums; }
.tk-lines a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.tk-lines a:hover { color: var(--red); }
.tk-lines tr.is-refunded td { color: var(--muted); }
.tk-lines tr.is-refunded .name, .tk-lines tr.is-refunded .num.line { text-decoration: line-through; }
.tk-tag {
	display: inline-block;
	margin-top: 4px;
	font-family: var(--font-heading);
	font-size: .68rem;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--red);
	border: 1.5px solid var(--red);
	border-radius: 999px;
	padding: 1px 8px;
	text-decoration: none;
}

.tk-totals { margin: 12px 0 0 auto; max-width: 320px; font-size: .95rem; }
.tk-totals div { display: flex; justify-content: space-between; gap: 14px; padding: 4px 0; color: var(--ink); }
.tk-totals dt, .tk-totals dd { margin: 0; }
.tk-totals dd { font-variant-numeric: tabular-nums; }
.tk-totals .minus dd, .tk-totals .refund { color: var(--red); }
.tk-totals .total { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 8px; font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem; }
.tk-totals .net { font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem; border-top: 2px dashed var(--red); margin-top: 4px; padding-top: 8px; }

.tk-slip {
	margin: 0 0 22px;
	padding: 16px 18px;
	background: #fff5f5;
	border: 2px dashed var(--red);
	border-radius: 12px;
	color: var(--ink);
}
.tk-slip h2 { font-family: var(--font-heading); font-size: 1rem; letter-spacing: .1em; text-transform: uppercase; color: var(--red); margin: 0 0 8px; }
.tk-slip ul { margin: 0; padding: 0; list-style: none; }
.tk-slip li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px dotted #f3c4c4; font-size: .92rem; }
.tk-slip li:first-child { border-top: 0; }
.tk-slip p { margin: 8px 0 0; font-size: .88rem; color: var(--muted); }

.tk-rail { display: grid; gap: 18px; position: sticky; top: 16px; }
.tk-card {
	background: var(--paper);
	border: 3px solid var(--ink);
	border-radius: 14px;
	box-shadow: 4px 4px 0 var(--ink);
	padding: 18px;
	animation: tk-rise .5s ease-out .16s both;
}
.tk-card h2 { font-family: var(--font-heading); font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin: 0 0 10px; }
.tk-card p { margin: 0 0 10px; line-height: 1.5; color: var(--ink); font-size: .94rem; }
.tk-card p:last-child { margin-bottom: 0; }
.tk-card .muted { color: var(--muted); }
.tk-card.dark { background: var(--ink); color: #fff; box-shadow: 4px 4px 0 var(--red); }
.tk-card.dark h2 { color: var(--gold); }
.tk-card.dark p { color: #fff; }
.tk-card.dark code { display: block; font-size: 1.05rem; letter-spacing: .04em; overflow-wrap: anywhere; margin: 4px 0 12px; }
.tk-card.dark .row { display: flex; flex-wrap: wrap; gap: 8px; }
.tk-card.dark .tk-btn.ghost { background: transparent; color: #fff; border-color: #fff; box-shadow: none; }
.tk-card address { font-style: normal; white-space: pre-line; line-height: 1.5; color: var(--ink); font-size: .94rem; }
.tk-actions { display: grid; gap: 10px; }

/* ---- Motion -------------------------------------------------------------- */
@keyframes tk-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes tk-stamp {
	0% { opacity: 0; transform: rotate(-7deg) scale(1.8); }
	70% { opacity: 1; transform: rotate(-7deg) scale(.94); }
	100% { opacity: .93; transform: rotate(-7deg) scale(1); }
}
@keyframes tk-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(210, 30, 42, .35); } 50% { box-shadow: 0 0 0 9px rgba(210, 30, 42, 0); } }
@media (prefers-reduced-motion: reduce) {
	.tk-hero, .tk-claim, .tk-stub, .tk-ticket, .tk-card, .tk-stamp, .tk-sent .big, .tk-track li.now .dot { animation: none !important; }
}

/* ---- Small screens ------------------------------------------------------- */
@media (max-width: 860px) {
	.tk-grid { grid-template-columns: minmax(0, 1fr); }
	.tk-rail { position: static; }
}
@media (max-width: 680px) {
	.tk { padding-top: 1rem; }
	.tk-hero { grid-template-columns: minmax(0, 1fr); padding: 20px 18px; box-shadow: 4px 4px 0 var(--ink); }
	.tk-hero .tk-stamp { justify-self: start; }
	.tk-claim { grid-template-columns: minmax(0, 1fr); box-shadow: 4px 4px 0 var(--ink); }
	.tk-claim-main { padding: 22px 18px; }
	.tk-claim-stub { border-left: 0; border-top: 3px dashed var(--ink); }
	.tk-claim-stub::before { left: -14px; top: -14px; }
	.tk-claim-stub::after { left: auto; right: -14px; top: -14px; bottom: auto; }
	.tk-markets li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
	.tk-stub { grid-template-columns: minmax(0, 1fr); box-shadow: 4px 4px 0 var(--ink); }
	.tk-stub-side { border-right: 0; border-bottom: 3px dashed var(--ink); }
	.tk-ticket { padding: 24px 16px; }
	.tk-ticket-head { flex-direction: column; }
	.tk-ticket-head .right { text-align: left; }
	.tk-track li { font-size: .74rem; }
}

/* ---- Print --------------------------------------------------------------- */
@media print {
	.tk-hero, .tk-claim, .tk-stub, .tk-ticket, .tk-card { box-shadow: none !important; animation: none !important; }
	.tk-stamp { animation: none !important; }
	.tk-stub-foot, .tk-btn, .tk-actions, .tk-more summary, .aff-invite, .account-header-actions { display: none !important; }
	.tk-more:not([open]) > *:not(summary) { display: block; }
	.tk-stub, .tk-ticket { break-inside: avoid; }
	.tk-grid { grid-template-columns: minmax(0, 1fr); }
	.tk-rail { position: static; }
}
.tk-slip li strong { white-space: nowrap; }
