/* Tarot (Tools 12 and 13, prefix tz-) — the Daily Draw, the Card Directory and the card detail pages.
   Loaded through the `styles:` list, so it sits in <head>, BEFORE the tool kit's inline <style> blocks. Rules are scoped `.tz .x` (one class
   more than the kit's `.tk .x`), token overrides use `.tk.tz`. Depends on tokens.css, partials/tool-kit-css.njk and partials/result-kit-css.njk.

   The page accent is Royal Violet (--accent-tarot) for buttons and focus. The cards themselves sit on the night ink of the share card and
   carry their own tone: Major rose, Wands amber, Cups cyan, Swords slate, Pentacles jade (core/tarot-art.js writes literal colours into the SVG). */
.tk.tz {
  --tk-accent: var(--accent-tarot, #7C3AED);
  --tone-flow: #0284C7;
  --tone-friction: #D97706;
  --tone-fusion: #7C3AED;
  --tone-quiet: #94A3B8;
  --night: #0B1020;
  --night-raised: #141B30;
  --on-night: #F8FAFC;
  --on-night-muted: #94A3B8;
  --on-night-soft: #CBD5E1;
  --tz-tone: #FB7185;
}
.tz[data-group="wands"] { --tz-tone: #E5A04A; }
.tz[data-group="cups"] { --tz-tone: #4CB8E8; }
.tz[data-group="swords"] { --tz-tone: #B8C4D6; }
.tz[data-group="pentacles"] { --tz-tone: #4FC9A0; }

/* ---- shapes: colour never works alone ---- */
.tz .tz-sh { display: inline-block; flex: none; width: 11px; height: 11px; background: var(--tone); }
.tz .tz-sh.fusion { --tone: var(--tone-fusion); border-radius: 50%; }
.tz .tz-sh.flow { --tone: var(--tone-flow); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.tz .tz-sh.friction { --tone: var(--tone-friction); border-radius: 2px; }
.tz .tz-sh.quiet { --tone: var(--tone-quiet); background: transparent; border: 2.5px solid var(--tone); border-radius: 50%; }

.tz .tz-kick { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-night-muted); }
.tz .tz-kick.on-paper { color: var(--c-accent-ink); margin-bottom: 4px; }
.tz .tz-svg { display: block; width: 100%; height: 100%; }

/* ================= The Bento: one card, one orientation (shared by Tool 12 and Tool 13) ================= */
.tz .tz-state { container: tzs / inline-size; display: grid; gap: 14px; align-content: start; min-width: 0; }
.tz .tz-state-head { display: flex; align-items: center; gap: 12px; }
.tz .tz-state-head h2, .tz .tz-state-head h3 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.tz .tz-dir { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px; background: var(--c-accent-tint); color: var(--c-accent-ink); }
.tz .tz-dir svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tz .is-reversed .tz-dir { background: #FFFBEB; color: #92400E; }
.tz .tz-tiles { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@container tzs (min-width: 540px) {
  .tz .tz-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tz .tz-tile.core, .tz .tz-tile.shadow { grid-column: 1 / -1; }
}
.tz .tz-tile { border: 1px solid var(--c-line); border-radius: var(--r-box); padding: 18px 20px; background: #fff; min-width: 0; }
.tz .tz-tile h3 { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--c-muted); }
.tz .tz-tile p { margin-top: 10px; font-size: 1.0625rem; font-weight: 600; line-height: 1.45; color: #334155; text-wrap: balance; }
.tz .tz-tile.core { background: var(--c-accent-tint); border-color: color-mix(in srgb, var(--c-accent) 20%, #fff); }
.tz .tz-tile .tz-lead { margin-top: 12px; font-size: clamp(1.1875rem, 0.95rem + 1vw, 1.5rem); font-weight: 800; line-height: 1.25; letter-spacing: -0.02em; color: var(--c-ink); }
.tz .tz-tile.shadow { background: var(--c-ink); border-color: var(--c-ink); }
.tz .tz-tile.shadow h3 { color: rgba(255, 255, 255, 0.64); }
.tz .tz-tile.shadow p { color: #fff; }
.tz .tz-kw { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tz .tz-kw li { display: inline-block; padding: 0 12px; height: 28px; line-height: 26px; border-radius: 999px; background: #fff; border: 1px solid color-mix(in srgb, var(--c-accent) 28%, #fff); font-size: 0.8125rem; font-weight: 700; color: var(--c-accent-ink); }
.tz .tz-kw li::first-letter { text-transform: uppercase; }
.tz .tz-kw.sm { gap: 4px; margin-top: 8px; }
.tz .tz-kw.sm li { height: 22px; line-height: 20px; padding: 0 8px; font-size: 0.6875rem; }

/* ================= Tool 13: the directory ================= */
.tz .tz-bar { position: sticky; top: 56px; z-index: 20; margin: 0 -16px 20px; padding: 8px 16px; background: color-mix(in srgb, var(--bg-app, #F4F5F7) 92%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--c-line); display: grid; gap: 10px; }
@media (min-width: 980px) { .tz .tz-bar { grid-template-columns: minmax(0, 1fr) 320px; align-items: center; gap: 16px; border-radius: 0 0 var(--r-card) var(--r-card); } }
.tz .tz-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.tz .tz-chips::-webkit-scrollbar { display: none; }
.tz .tz-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--c-line); border-radius: 999px; background: #fff; color: var(--c-ink); font: inherit; font-size: 0.875rem; font-weight: 700; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.tz .tz-chip svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.tz .tz-chip .n { font-weight: 600; font-size: 0.8125rem; color: var(--c-muted); }
.tz .tz-chip:hover { background: var(--c-accent-tint); border-color: color-mix(in srgb, var(--c-accent) 40%, #fff); }
.tz .tz-chip[aria-pressed="true"] { background: var(--c-ink); border-color: var(--c-ink); color: #fff; }
.tz .tz-chip[aria-pressed="true"] .n { color: rgba(255, 255, 255, 0.64); }
.tz .tz-find { display: flex; align-items: center; gap: 12px; }
.tz .tz-search { position: relative; flex: 1 1 auto; display: block; }
.tz .tz-search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; fill: none; stroke: var(--c-muted); stroke-width: 1.75; stroke-linecap: round; pointer-events: none; }
.tz .tz-search input { width: 100%; height: 44px; padding: 0 14px 0 42px; border: 1px solid var(--c-field); border-radius: 999px; background: #fff; font: inherit; font-size: 1rem; color: var(--c-ink); }
.tz .tz-search input:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-accent) 20%, transparent); }
.tz .tz-count { flex: none; font-size: 0.8125rem; font-weight: 600; color: var(--c-muted); white-space: nowrap; }
.tz .tz-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .tz .tz-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 820px) { .tz .tz-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .tz .tz-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.tz .tz-cell[hidden] { display: none; }
.tz .tz-item { display: flex; flex-direction: column; height: 100%; padding: 12px; border: 1px solid var(--c-line); border-radius: 14px; background: #fff; color: inherit; text-decoration: none; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s; }
.tz .tz-item:hover { transform: translateY(-4px); box-shadow: 0 16px 32px -8px rgba(15, 23, 42, 0.12); border-color: color-mix(in srgb, var(--c-accent) 35%, #fff); }
.tz .tz-thumb { display: block; width: 100%; aspect-ratio: 3 / 5; }
.tz .tz-thumb svg { filter: drop-shadow(0 10px 14px rgba(15, 23, 42, 0.22)); }
.tz .tz-item-name { margin-top: 12px; font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.tz .tz-item-meta { margin-top: 2px; font-size: 0.8125rem; color: var(--c-muted); }
.tz .tz-none { margin: 24px 0; padding: 20px; border: 1px dashed var(--c-line); border-radius: var(--r-card); text-align: center; color: var(--c-muted); font-weight: 600; }
.tz .tz-nexts { display: grid; gap: 12px; margin-top: 24px; }
@media (min-width: 720px) { .tz .tz-nexts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ================= Tool 13: the detail page ================= */
.tz .tz-hero { position: relative; overflow: hidden; display: grid; justify-items: center; gap: 20px; margin-bottom: 16px; padding: 36px 16px 28px; border-radius: var(--r-card); background: radial-gradient(ellipse 60% 60% at 50% 38%, color-mix(in srgb, var(--tz-tone) 24%, transparent), transparent 70%), var(--night); color: var(--on-night); }
@media (min-width: 720px) { .tz .tz-hero { padding: 48px 40px 36px; } }
.tz .tz-hero::before { content: ""; position: absolute; left: 50%; top: 38%; width: min(120%, 760px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 1px solid rgba(248, 250, 252, 0.07); pointer-events: none; }
.tz .tz-art { position: relative; width: min(78%, 340px); aspect-ratio: 3 / 5; transition: transform 0.7s var(--ease); }
@media (min-width: 720px) { .tz .tz-art { width: min(100%, 360px); } }
.tz .tz-art.is-reversed { transform: rotate(180deg); }
.tz .tz-art svg { filter: drop-shadow(0 28px 44px rgba(0, 0, 0, 0.55)); }
.tz .tz-toggle { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(248, 250, 252, 0.08); border: 1px solid rgba(248, 250, 252, 0.12); }
.tz .tz-tog { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 132px; height: 40px; padding: 0 16px 0 8px; border: 0; border-radius: 999px; background: transparent; color: var(--on-night-soft); font: inherit; font-size: 0.875rem; font-weight: 700; cursor: pointer; transition: background 0.15s, color 0.15s; }
.tz .tz-tog .tz-dir { width: 26px; height: 26px; border-radius: 999px; background: rgba(248, 250, 252, 0.1); color: inherit; }
.tz .tz-tog .tz-dir svg { width: 16px; height: 16px; }
.tz .tz-tog[aria-pressed="true"] { background: var(--on-night); color: var(--night); }
.tz .tz-tog[aria-pressed="true"] .tz-dir { background: color-mix(in srgb, var(--tz-tone) 55%, #fff); color: var(--night); }
.tz .tz-tog:focus-visible { outline: 3px solid color-mix(in srgb, var(--tz-tone) 70%, transparent); outline-offset: 2px; }
.tz .tz-facts { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tz .tz-facts > div { display: flex; align-items: baseline; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; background: rgba(248, 250, 252, 0.08); border: 1px solid rgba(248, 250, 252, 0.12); align-items: center; }
.tz .tz-facts dt { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-night-muted); }
.tz .tz-facts dd { font-size: 0.9375rem; font-weight: 700; color: var(--on-night); }
.tz .tz-split { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .tz .tz-split { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.tz .tz-pane { transition: border-color 0.2s, box-shadow 0.2s; }
.tz[data-orient="upright"] .tz-pane:first-child, .tz[data-orient="reversed"] .tz-pane:last-child { border-color: color-mix(in srgb, var(--c-accent) 45%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-accent) 10%, transparent); }
.tz .tz-related { margin-top: 28px; }
.tz .tz-related-list { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 560px; }
@media (min-width: 720px) { .tz .tz-related-list { grid-template-columns: repeat(4, minmax(0, 120px)); max-width: none; } }
.tz .tz-rel { display: block; color: inherit; text-decoration: none; }
.tz .tz-rel .tz-thumb svg { transition: transform 0.2s var(--ease); }
.tz .tz-rel:hover .tz-thumb svg { transform: translateY(-4px); }
.tz .tz-rel-name { display: block; margin-top: 8px; font-size: 0.8125rem; font-weight: 700; line-height: 1.25; }
.tz .tz-pager { display: grid; gap: 12px; margin-top: 28px; }
@media (min-width: 720px) { .tz .tz-pager { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tz .tz-pager .rk-next small { margin: 0 0 2px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.tz .tz-pager .rk-next b { font-size: 1.0625rem; }
.tz .tz-pager .tz-next { text-align: right; }
.tz .tz-pager .tz-next > span { order: 1; margin-left: auto; }
.tz .tz-pager .tz-next svg { order: 2; }

/* ================= Tool 12: the table ================= */
.tz .tz-table { position: relative; overflow: hidden; margin-bottom: 16px; padding: 28px 12px 20px; border-radius: var(--r-card); background: radial-gradient(ellipse 70% 55% at 50% 52%, rgba(129, 140, 248, 0.16), transparent 70%), var(--night); color: var(--on-night); text-align: center; }
@media (min-width: 720px) { .tz .tz-table { padding: 40px 28px 26px; } }
.tz .tz-table::before, .tz .tz-table::after { content: ""; position: absolute; left: 50%; top: 55%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 1px solid rgba(248, 250, 252, 0.07); pointer-events: none; }
.tz .tz-table::before { width: min(125%, 900px); }
.tz .tz-table::after { width: min(88%, 640px); border-color: rgba(248, 250, 252, 0.05); }
.tz .tz-prompt { position: relative; margin-top: 6px; font-size: clamp(1.625rem, 1.1rem + 2.4vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; color: var(--on-night); outline: none; }
.tz .tz-prompt-sub { position: relative; margin-top: 8px; min-height: 1.5em; color: var(--on-night-muted); font-size: 0.9375rem; }
.tz .tz-stage { position: relative; width: 100%; max-width: 980px; height: 320px; margin: 18px auto 0; }
.tz .tz-noscript { position: relative; margin-top: 16px; color: var(--on-night-soft); }
.tz .tz-noscript a { color: inherit; font-weight: 700; }
.tz .tz-controls { position: relative; display: flex; justify-content: center; gap: 10px; margin-top: 6px; min-height: 40px; }
.tz .tz-ctl { height: 40px; padding: 0 18px; border: 1px solid rgba(248, 250, 252, 0.2); border-radius: 999px; background: rgba(248, 250, 252, 0.06); color: var(--on-night); font: inherit; font-size: 0.875rem; font-weight: 700; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.tz .tz-ctl:hover { background: rgba(248, 250, 252, 0.14); border-color: rgba(248, 250, 252, 0.4); }
.tz .tz-ctl:focus-visible { outline: 3px solid rgba(129, 140, 248, 0.8); outline-offset: 2px; }
.tz .tz-keys { position: relative; margin-top: 8px; font-size: 0.75rem; color: var(--on-night-muted); }
@media (hover: none) { .tz .tz-keys { display: none; } }

/* a card slot: placed by the script with transform; the card inside lifts on hover */
.tz .tz-slot { position: absolute; left: 50%; top: 0; width: var(--cw, 120px); height: var(--ch, 200px); margin-left: calc(var(--cw, 120px) / -2); transform-origin: 50% 50%; transition: transform 0.85s cubic-bezier(0.22, 0.8, 0.24, 1), opacity 0.5s ease; will-change: transform; }
.tz .tz-table[data-fast="1"] .tz-slot { transition-duration: 0.01s; transition-delay: 0s !important; }
.tz .tz-slot.is-out { opacity: 0; pointer-events: none; }
.tz .tz-slot:focus-within { z-index: 60 !important; }
.tz .tz-card { all: unset; box-sizing: border-box; display: block; position: relative; width: 100%; height: 100%; cursor: pointer; perspective: 1100px; transition: transform 0.25s var(--ease); -webkit-tap-highlight-color: transparent; }
.tz .tz-card:disabled { cursor: default; }
@media (hover: hover) { .tz .tz-table[data-stage="ready"] .tz-slot:hover { z-index: 60 !important; } .tz .tz-table[data-stage="ready"] .tz-card:hover { transform: translateY(-18px) scale(1.03); } }
.tz .tz-table[data-stage="ready"] .tz-card:focus-visible { transform: translateY(-18px) scale(1.03); outline: 3px solid rgba(129, 140, 248, 0.9); outline-offset: 4px; border-radius: 10px; }
.tz .tz-slot.is-chosen .tz-card, .tz .tz-slot.is-chosen .tz-card:hover { transform: none; cursor: default; }
.tz .tz-flip { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; -webkit-transform-style: preserve-3d; transition: transform 1s cubic-bezier(0.3, 0.7, 0.2, 1); }
.tz .tz-table[data-fast="1"] .tz-flip { transition-duration: 0.01s; }
.tz .is-flipped .tz-flip { transform: rotateY(180deg); }
.tz .tz-face { position: absolute; inset: 0; display: block; border-radius: 7.5% / 4.5%; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 10px 18px -6px rgba(0, 0, 0, 0.6); }
.tz .tz-face.tz-front { transform: rotateY(180deg); }
.tz .tz-face.tz-front.is-reversed .tz-svg { transform: rotate(180deg); }
.tz .is-flipped .tz-face.tz-front { box-shadow: 0 0 60px -6px color-mix(in srgb, var(--tz-tone) 60%, transparent), 0 24px 40px -10px rgba(0, 0, 0, 0.7); }

/* ================= Tool 12: the result ================= */
.tz .tz-result { display: grid; gap: 16px; margin-bottom: 16px; scroll-margin-top: 80px; outline: none; }
.tz .tz-result.is-in > * { animation: rise 0.6s var(--ease) both; }
.tz .tz-result.is-in > *:nth-child(2) { animation-delay: 0.08s; }
.tz .tz-result.is-in > *:nth-child(n+3) { animation-delay: 0.14s; }
.tz .tz-hero-card .rk-name { font-size: clamp(2.75rem, 17cqw, 7.5rem); }
.tz .tz-hero-card .rk-ribbon.is-reversed { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }
.tz .tz-hero-card .rk-ribbon svg { width: 16px; height: 16px; margin-right: 6px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tz .tz-hero-card .rk-line { max-width: 34ch; }
.tz .tz-bento-card { padding: 20px; }
@media (min-width: 720px) { .tz .tz-bento-card { padding: 28px; } }
.tz .tz-next-draw { margin-top: 14px; font-size: 0.8125rem; color: var(--c-muted); }
.tz .tz-proof { margin-top: 16px; }
.tz .tz-bento { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); margin-top: 20px; }
@media (min-width: 720px) { .tz .tz-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tz .tz-ptile h3 { display: flex; align-items: center; gap: 8px; }
.tz .tz-ptile p { margin-top: 10px; font-size: 0.9375rem; line-height: 1.5; color: #334155; }
.tz .tz-local { margin-top: 16px; font-size: 0.875rem; font-weight: 600; color: var(--c-muted); }
.tz .rk-stat dt { display: flex; align-items: center; gap: 6px; }
.tz .tz-stage { transition: height 0.7s var(--ease); }
.tz .tz-table[data-fast="1"] .tz-stage { transition-duration: 0.01s; }
