/* The two chat-export tools (crew-board #1079): /products/claude-chats/ and
   /products/messenger-extractor/. Ported from the owner's private apps; the styles are
   theirs, scoped to .xt and coloured for the site's dark pages. */

.xt {
  --xt-accent: #5eead4;
  --xt-warm: #fb923c;
  --xt-ink: #f2f1fa;
  --xt-muted: #b4b0c8;
  --xt-card: rgb(255 255 255 / 0.045);
  --xt-field: rgb(255 255 255 / 0.07);
  --xt-line: rgb(255 255 255 / 0.16);
  --xt-danger: #fca5a5;
  --xt-warn-bg: rgb(167 139 250 / 0.1);
  --xt-on-accent: #04201c;
  color: var(--xt-ink);
}

.xt .notice { max-width: 44rem; margin: 1.35rem 0 0; padding: 0.85rem 1rem; background: var(--xt-card); border-left: 4px solid var(--xt-warm); border-radius: 0 12px 12px 0; }
.xt .panel { margin-top: 2.25rem; }
.xt .panel h2 { margin: 0; font-size: 1.5rem; }
.xt .hint, .xt .summary, .xt .status { color: var(--xt-muted); }
.xt .hint { max-width: 44rem; margin: 0.5rem 0 0; }
.xt .summary, .xt .status { margin: 0.75rem 0 0; }
.xt .error { margin: 0.6rem 0 0; color: var(--xt-danger); font-weight: 650; }
.xt .error:not(:empty) { padding: 0.75rem 0.9rem; background: rgb(248 113 113 / 0.1); border: 1px solid rgb(252 165 165 / 0.35); border-radius: 12px; }
.xt .error:empty { margin: 0; }

.xt button { border: 0; border-radius: 8px; padding: 0.65rem 1rem; background: var(--xt-accent); color: var(--xt-on-accent); font: inherit; font-weight: 700; cursor: pointer; }
.xt button.secondary { background: transparent; color: var(--xt-accent); border: 1px solid rgb(94 234 212 / 0.45); }
.xt button:hover { filter: brightness(1.08); }
.xt button:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.xt button:focus-visible, .xt input:focus-visible, .xt select:focus-visible { outline: 2px solid var(--xt-accent); outline-offset: 2px; }

.xt .row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 0.85rem; }
.xt .field { display: grid; gap: 0.35rem; color: var(--xt-accent); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.xt input[type="search"], .xt select { width: 100%; box-sizing: border-box; padding: 0.55rem 0.65rem; color: var(--xt-ink); background: var(--xt-field); border: 1px solid var(--xt-line); border-radius: 8px; font: inherit; font-weight: 500; letter-spacing: 0; text-transform: none; }
.xt select option { background: #12121c; color: var(--xt-ink); }
.xt input[type="file"] { max-width: 100%; font: inherit; color: var(--xt-ink); }
.xt .file-input, .xt .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Claude chats */
.xt .controls { display: grid; gap: 0.85rem; margin-top: 1rem; }
.xt .table-wrap { margin-top: 1.25rem; overflow-x: auto; }
.xt .chat-table { width: 100%; border-collapse: collapse; background: var(--xt-card); border: 1px solid var(--xt-line); }
.xt .chat-table caption { caption-side: bottom; padding-top: 0.5rem; color: var(--xt-muted); font-size: 0.85rem; text-align: left; }
.xt .chat-table th, .xt .chat-table td { padding: 0.7rem 0.8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--xt-line); }
.xt .chat-table th { color: var(--xt-accent); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.xt .title-cell { min-width: 12rem; }
.xt .title-button { background: transparent; color: var(--xt-accent); border: 0; padding: 0; text-align: left; overflow-wrap: anywhere; }
.xt .count { font-variant-numeric: tabular-nums; }
.xt .conversation-title { margin: 1.25rem 0 0.35rem; font-size: clamp(1.6rem, 4vw, 2.2rem); }
.xt .turn { margin-top: 1rem; padding: 0.9rem 1rem; background: var(--xt-card); border: 1px solid var(--xt-line); border-radius: 12px; }
.xt .turn h3 { margin: 0; font-size: 1rem; }
.xt .turn-human { border-left: 4px solid var(--xt-warm); }
.xt .turn-assistant { border-left: 4px solid var(--xt-accent); }
.xt .turn-text { margin: 0.5rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.xt .attachments { margin: 0.35rem 0 0; padding-left: 1.2rem; }
.xt .attachments li { overflow-wrap: anywhere; }

/* Messenger extractor */
.xt .dropzone { display: grid; gap: 0.45rem; margin-top: 1rem; padding: 1.15rem 1.2rem 1.25rem; background: var(--xt-card); border: 1px dashed var(--xt-line); border-radius: 14px; }
.xt .dropzone.is-dragover { border-style: solid; border-color: var(--xt-accent); background: rgb(94 234 212 / 0.08); }
.xt .file-label, .xt .zip-badge, .xt .pick-badge { color: var(--xt-warm); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.xt .copy-feedback { margin: 0; color: var(--xt-muted); font-weight: 700; }
.xt .copy-feedback.error { color: var(--xt-danger); }
.xt .copy-feedback.error:not(:empty) { flex-basis: 100%; }
.xt .tip { display: inline-flex; }
.xt .tip button:disabled { pointer-events: none; }
.xt .date-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.9rem 0 0; padding: 0; list-style: none; }
.xt .date-list button { background: var(--xt-card); color: var(--xt-ink); border: 1px solid var(--xt-line); }
.xt .date-list button[aria-pressed="true"] { background: var(--xt-accent); color: var(--xt-on-accent); border-color: var(--xt-accent); }
.xt .range-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 0.75rem; align-items: end; margin-top: 1.1rem; }
.xt .preview { max-height: 28rem; overflow: auto; margin: 0.75rem 0 0; padding: 1rem 1.05rem; background: #0d0d16; border: 1px solid var(--xt-line); color: var(--xt-ink); border-radius: 12px; font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace; font-size: 0.82rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.xt .section-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; }
.xt .section-row .secondary, .xt .zip-tools .secondary { flex: none; }
.xt .zip-tools { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; margin-top: 0.9rem; }
.xt .zip-filter { flex: 1 1 16rem; margin: 0; }
.xt .zip-list, .xt .folder-list { display: grid; gap: 0.45rem; max-height: 24rem; margin: 0.9rem 0 0; padding: 0; overflow: auto; list-style: none; }
.xt .zip-list button, .xt .folder-list button { display: flex; justify-content: space-between; gap: 0.75rem; width: 100%; text-align: left; white-space: normal; background: var(--xt-card); color: var(--xt-ink); border: 1px solid var(--xt-line); font-weight: 600; }
.xt .zip-list button.is-messenger, .xt .folder-list button.is-messenger { background: var(--xt-warn-bg); border-color: rgb(167 139 250 / 0.55); }
.xt .zip-list button.is-selected, .xt .folder-list button.is-selected { border-color: var(--xt-accent); box-shadow: inset 3px 0 0 var(--xt-accent); }
.xt .zip-path { overflow-wrap: anywhere; font-weight: 650; }
.xt .zip-meta { display: flex; flex: none; gap: 0.5rem; align-items: center; color: var(--xt-muted); font-size: 0.85rem; font-weight: 650; }
.xt .pick-kinds { display: grid; gap: 0.55rem; margin: 0.9rem 0 0; padding: 0; list-style: none; }
.xt .pick-kinds li { margin: 0; padding: 0.7rem 0.85rem; background: var(--xt-field); border: 1px solid var(--xt-line); border-radius: 10px; }
.xt .pick-kinds strong { display: inline-block; min-width: 4.5rem; margin-right: 0.35rem; color: var(--xt-warm); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.xt .picked { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; margin: 0.9rem 0 0; }
.xt .saved-choices { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; margin-top: 0.9rem; padding: 0.75rem 0.9rem; background: var(--xt-card); border-radius: 12px; }
.xt .saved-choices p { flex: 1 1 16rem; margin: 0; overflow-wrap: anywhere; }
.xt .empty { margin: 0.85rem 0 0; padding: 0.85rem 1rem; background: var(--xt-warn-bg); border: 1px solid rgb(167 139 250 / 0.45); border-radius: 12px; }
.xt .empty p { margin: 0; }
.xt .empty .secondary { margin-top: 0.7rem; }
.xt [hidden] { display: none !important; }

@media (max-width: 760px) {
  .xt .range-controls { grid-template-columns: 1fr; }
  .xt .zip-list button, .xt .folder-list button { flex-direction: column; align-items: flex-start; }
  .xt .chat-table th:nth-child(2), .xt .chat-table td:nth-child(2) { display: none; }
}
