/* Cookie consent UI for www.tradecraftsignal.com and /blog (see consent.js).
 * Everything is scoped under .tcs-root so page styles and these never collide.
 * z-index sits under the custom cursor (99998–99999) and the page loader
 * (100000) and over everything else. */

.tcs-root {
  --tcs-bg: rgba(11, 11, 11, 0.94);
  --tcs-panel: #0b0b0b;
  --tcs-raise: rgba(255, 255, 255, 0.025);
  --tcs-border: rgba(255, 255, 255, 0.09);
  --tcs-border-strong: rgba(255, 255, 255, 0.18);
  --tcs-text: #fafafa;
  --tcs-muted: #a8a8a8;
  --tcs-dim: #8c8c8c;
  --tcs-accent: #ff2d55;
  --tcs-accent-soft: rgba(255, 45, 85, 0.12);
  --tcs-accent-line: rgba(255, 45, 85, 0.38);
  --tcs-amber: #ffc800;
  --tcs-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --tcs-sans: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --tcs-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--tcs-text);
  font-family: var(--tcs-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
  text-align: left;
}
.tcs-root *,
.tcs-root *::before,
.tcs-root *::after {
  box-sizing: border-box;
}
:where(.tcs-root) :where(h2, h3, p) {
  margin: 0;
  padding: 0;
}

/* ---------------------------------------------------------------- shared */

.tcs-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 10.5px/1 var(--tcs-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tcs-accent);
}
.tcs-pulse {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tcs-accent);
  box-shadow: 0 0 10px rgba(255, 45, 85, 0.7);
}
.tcs-pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--tcs-accent);
  opacity: 0;
  animation: tcs-ping 2.4s var(--tcs-ease) infinite;
}
@keyframes tcs-ping {
  0% { transform: scale(0.6); opacity: 0.7; }
  80%, 100% { transform: scale(1.8); opacity: 0; }
}
.tcs-title {
  margin: 12px 0 8px;
  font: 600 19px/1.25 var(--tcs-sans);
  letter-spacing: -0.01em;
  color: var(--tcs-text);
}
.tcs-text {
  color: var(--tcs-muted);
  font-size: 14px;
  line-height: 1.6;
}
.tcs-text strong {
  color: var(--tcs-text);
  font-weight: 600;
}
.tcs-root a {
  color: var(--tcs-text);
  text-decoration: underline;
  text-decoration-color: var(--tcs-accent-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}
.tcs-root a:hover {
  text-decoration-color: var(--tcs-accent);
}
.tcs-root :focus-visible {
  outline: 2px solid var(--tcs-accent);
  outline-offset: 2px;
}

/* Reject and Accept share one style on purpose: neither is nudged. */
.tcs-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid var(--tcs-border-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--tcs-text);
  font: 600 11.5px/1 var(--tcs-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: border-color 0.25s, background 0.25s, transform 0.25s var(--tcs-ease);
}
.tcs-btn:hover {
  border-color: var(--tcs-accent);
  background: var(--tcs-accent-soft);
}
.tcs-btn:active {
  transform: translateY(1px);
}
.tcs-btn--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--tcs-muted);
}
.tcs-btn--quiet:hover {
  color: var(--tcs-text);
  border-color: var(--tcs-border);
  background: rgba(255, 255, 255, 0.03);
}
.tcs-btn--save {
  border-color: var(--tcs-text);
  background: var(--tcs-text);
  color: #050505;
}
.tcs-btn--save:hover {
  border-color: var(--tcs-text);
  background: #e4e4e4;
}

/* ---------------------------------------------------------------- banner */

.tcs-banner {
  position: fixed;
  z-index: 99994;
  left: 24px;
  bottom: 24px;
  width: min(452px, calc(100vw - 32px));
  padding: 22px 22px 18px;
  border: 1px solid var(--tcs-border);
  border-radius: 18px;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(255, 45, 85, 0.07), transparent 55%),
    var(--tcs-bg);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  opacity: 0;
  transform: translateY(16px) scale(0.985);
  transition: opacity 0.45s var(--tcs-ease), transform 0.55s var(--tcs-ease);
}
.tcs-banner::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 22px;
  right: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--tcs-accent), transparent);
  opacity: 0.8;
}
.tcs-banner.is-in {
  opacity: 1;
  transform: none;
}
.tcs-banner .tcs-text {
  margin-bottom: 18px;
}
.tcs-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tcs-actions .tcs-btn--quiet {
  grid-column: 1 / -1;
  min-height: 38px;
}

/* ---------------------------------------------------------------- dialog */

.tcs-dialog {
  position: fixed;
  inset: 0;
  width: min(640px, calc(100vw - 32px));
  max-width: none;
  height: fit-content;
  max-height: min(88vh, 780px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--tcs-border);
  border-radius: 20px;
  background:
    radial-gradient(90% 60% at 100% 0%, rgba(255, 45, 85, 0.06), transparent 60%),
    var(--tcs-panel);
  color: var(--tcs-text);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  cursor: auto;
}
.tcs-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: tcs-rise 0.45s var(--tcs-ease);
}
.tcs-dialog::backdrop {
  background: rgba(0, 0, 0, 0.66);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.tcs-dialog * {
  cursor: auto;
}
.tcs-dialog button,
.tcs-dialog summary,
.tcs-dialog a,
.tcs-dialog .tcs-switch input {
  cursor: pointer;
}
@keyframes tcs-rise {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.tcs-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 4px;
}
.tcs-dialog__head .tcs-title {
  margin-bottom: 0;
  font-size: 22px;
}
.tcs-close {
  appearance: none;
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  margin: -6px -8px 0 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--tcs-muted);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.tcs-close:hover {
  color: var(--tcs-text);
  border-color: var(--tcs-border);
  background: rgba(255, 255, 255, 0.04);
}
.tcs-dialog__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 10px 24px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.tcs-dialog__foot {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--tcs-border);
  background: rgba(255, 255, 255, 0.015);
}

.tcs-notice {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 200, 0, 0.22);
  border-left: 3px solid var(--tcs-amber);
  border-radius: 10px;
  background: rgba(255, 200, 0, 0.06);
  color: #ececec;
  font-size: 13.5px;
  line-height: 1.55;
}
.tcs-notice[hidden] {
  display: none;
}

.tcs-cat {
  margin-top: 14px;
  padding: 16px 18px 14px;
  border: 1px solid var(--tcs-border);
  border-radius: 14px;
  background: var(--tcs-raise);
  transition: border-color 0.3s, background 0.3s;
}
.tcs-cat[data-on="true"] {
  border-color: var(--tcs-accent-line);
  background: linear-gradient(180deg, rgba(255, 45, 85, 0.05), rgba(255, 45, 85, 0.015));
}
.tcs-cat__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.tcs-cat__title {
  margin-bottom: 6px;
  font: 600 15.5px/1.3 var(--tcs-sans);
  color: var(--tcs-text);
}
.tcs-cat__text {
  color: var(--tcs-muted);
  font-size: 13.5px;
  line-height: 1.6;
}
.tcs-badge {
  flex: none;
  padding: 7px 10px;
  border: 1px solid var(--tcs-border-strong);
  border-radius: 999px;
  color: var(--tcs-muted);
  font: 600 10px/1 var(--tcs-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tcs-switch {
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
  margin-top: 2px;
}
.tcs-switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
}
.tcs-switch__track {
  position: absolute;
  inset: 0;
  border: 1px solid var(--tcs-border-strong);
  border-radius: 999px;
  background: #222;
  transition: background 0.3s var(--tcs-ease), border-color 0.3s;
}
.tcs-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #8c8c8c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.35s var(--tcs-ease), background 0.3s;
}
.tcs-switch input:checked + .tcs-switch__track {
  border-color: var(--tcs-accent);
  background: var(--tcs-accent);
}
.tcs-switch input:checked + .tcs-switch__track::after {
  transform: translateX(20px);
  background: #fff;
}
.tcs-switch input:focus-visible + .tcs-switch__track {
  outline: 2px solid var(--tcs-accent);
  outline-offset: 3px;
}

.tcs-details {
  margin-top: 12px;
}
.tcs-details summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  list-style: none;
  color: var(--tcs-dim);
  font: 600 10.5px/1.2 var(--tcs-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.tcs-details summary::-webkit-details-marker {
  display: none;
}
.tcs-details summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.25s var(--tcs-ease);
}
.tcs-details[open] summary::before {
  transform: rotate(45deg);
}
.tcs-details summary:hover {
  color: var(--tcs-text);
}
.tcs-table-wrap {
  margin-top: 10px;
  overflow-x: auto;
  border: 1px solid var(--tcs-border);
  border-radius: 10px;
}
.tcs-table {
  width: 100%;
  min-width: 460px;
  margin: 0;
  border-collapse: collapse;
  font-size: 12.5px;
  line-height: 1.5;
}
.tcs-table th {
  padding: 9px 10px;
  border-bottom: 1px solid var(--tcs-border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--tcs-dim);
  font: 600 10px/1.2 var(--tcs-mono);
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
}
.tcs-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--tcs-muted);
  vertical-align: top;
}
.tcs-table tr:last-child td {
  border-bottom: none;
}
.tcs-table th,
.tcs-table td:nth-child(2),
.tcs-table td:nth-child(4) {
  white-space: nowrap;
}
.tcs-table code {
  color: var(--tcs-text);
  font: 500 12px/1.4 var(--tcs-mono);
  white-space: nowrap;
}

.tcs-meta {
  margin-top: 18px;
  color: var(--tcs-dim);
  font: 500 11px/1.6 var(--tcs-mono);
  letter-spacing: 0.02em;
}

/* ----------------------------------------------------------------- toast */

.tcs-toast {
  position: fixed;
  z-index: 99994;
  left: 50%;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border: 1px solid var(--tcs-border);
  border-radius: 999px;
  background: var(--tcs-bg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  font: 600 11px/1 var(--tcs-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.35s var(--tcs-ease), transform 0.45s var(--tcs-ease);
}
.tcs-toast.is-in {
  opacity: 1;
  transform: translate(-50%, 0);
}
.tcs-toast__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tcs-accent);
}

/* The site's custom cursor draws under the modal top layer: hide it there
 * and use the system cursor instead. */
html.tcs-modal-open .cursor-dot,
html.tcs-modal-open .cursor-ring {
  opacity: 0 !important;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 560px) {
  .tcs-banner {
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
    padding: 20px 18px 16px;
  }
  .tcs-title {
    font-size: 18px;
  }
  .tcs-dialog {
    width: 100vw;
    max-height: 92vh;
    margin: auto 0 0;
    border-right: none;
    border-bottom: none;
    border-left: none;
    border-radius: 20px 20px 0 0;
  }
  .tcs-dialog[open] {
    animation-name: tcs-sheet;
  }
  .tcs-dialog__head {
    padding: 20px 16px 4px;
  }
  .tcs-dialog__body {
    padding: 8px 16px 18px;
  }
  .tcs-dialog__foot {
    grid-template-columns: 1fr 1fr;
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  }
  .tcs-btn--save {
    grid-column: 1 / -1;
  }
  .tcs-cat {
    padding: 14px 14px 12px;
  }
  .tcs-toast {
    bottom: 16px;
  }
}
@keyframes tcs-sheet {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .tcs-banner,
  .tcs-toast,
  .tcs-dialog[open],
  .tcs-root *,
  .tcs-root *::before,
  .tcs-root *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  .tcs-banner,
  .tcs-toast {
    display: none !important;
  }
}
