/* Contributor portal. Uses the txcyber-ops tokens; fallbacks keep it usable under any theme. */
.txc-portal,.wrap.txc-portal{
  --c-void:var(--void,#080705);--c-panel:var(--panel,#100e09);--c-panel2:var(--panel-2,#171309);
  --c-rule:var(--rule,#2c2517);--c-amber:var(--amber,#ffb000);--c-dim:var(--amber-dim,#a3761a);
  --c-paper:var(--paper,#e7ddcb);--c-muted:var(--muted,#8f8471);--c-rust:var(--rust,#c4512f);--c-jade:var(--jade,#54d1a0);
  --c-mono:var(--mono,"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace);
  --c-sans:var(--sans,"Archivo",system-ui,sans-serif);
}
.wrap.txc-portal{padding-top:44px;padding-bottom:88px}
.txc-portal{color:var(--c-paper);font-family:var(--c-sans)
}
.txc-portal *{box-sizing:border-box}
.txc-portal [hidden]{display:none!important}

/* header */
.txc-head{border-bottom:1px solid var(--c-rule);padding-bottom:22px;margin-bottom:28px;position:relative}
.txc-kicker{font-family:var(--c-mono);font-size:12.5px;color:var(--c-dim);letter-spacing:.04em;margin:0 0 14px}
.txc-head h1{font-family:var(--c-sans);font-size:clamp(1.9rem,4vw,2.6rem);line-height:1.1;margin:0;color:var(--c-paper)}
.txc-sub{color:var(--c-muted);margin:10px 0 0;font-size:.98rem}
.txc-usernav{display:flex;flex-wrap:wrap;gap:6px 18px;font-family:var(--c-mono);font-size:12.5px;margin:0 0 18px}
.txc-usernav a{color:var(--c-amber)}
.txc-usernav a:hover{text-decoration:underline}
.txc-who{color:var(--c-paper)}
.txc-who::before{content:"● ";color:var(--c-jade)}

/* controls */
.txc-btn{display:inline-block;font-family:var(--c-mono);font-size:13px;font-weight:500;padding:12px 20px;border:1px solid var(--c-amber);
  color:var(--c-amber);background:transparent;cursor:pointer;line-height:1.2;text-decoration:none;transition:background .12s,color .12s}
.txc-btn:hover{background:var(--c-amber);color:#0a0805}
.txc-btn.ghost{border-color:var(--c-rule);color:var(--c-paper)}
.txc-btn.ghost:hover{background:var(--c-panel2);color:var(--c-amber);border-color:var(--c-dim)}
.txc-btn[disabled]{opacity:.5;cursor:wait}
.txc-label{display:block;font-family:var(--c-mono);font-size:12px;color:var(--c-dim);letter-spacing:.04em;margin:22px 0 8px}
.txc-label:first-child,.txc-login .txc-label:first-of-type{margin-top:0}
.txc-hint{font-family:var(--c-mono);font-size:11.5px;color:var(--c-muted);margin:8px 0 0;letter-spacing:0}
.txc-label .txc-hint{margin:0 0 0 6px}
.txc-count{float:right;color:var(--c-muted);font-size:11.5px}
.txc-count.is-over{color:var(--c-rust)}
.txc-input{width:100%;background:var(--c-panel);border:1px solid var(--c-rule);color:var(--c-paper);font-family:var(--c-mono);
  font-size:14px;padding:11px 13px;border-radius:0;outline:none}
.txc-input:focus{border-color:var(--c-dim)}
.txc-input.txc-title{font-family:var(--c-sans);font-size:1.45rem;font-weight:700;padding:13px 14px}
textarea.txc-input{resize:vertical;line-height:1.55}
.txc-raw{font-size:13px}
input[type=datetime-local].txc-input{color-scheme:dark}
.txc-check,.txc-radio{display:flex;align-items:center;gap:10px;font-family:var(--c-mono);font-size:13px;color:var(--c-paper);margin:9px 0;cursor:pointer}
.txc-check input,.txc-radio input{accent-color:var(--c-amber);width:16px;height:16px;margin:0}
.txc-small{display:inline-block;font-family:var(--c-mono);font-size:12px;margin-top:14px}
.txc-actions{margin:0 0 24px}

/* notices */
.txc-notice{font-family:var(--c-mono);font-size:13px;padding:13px 16px;margin:0 0 24px;border:1px solid;background:var(--c-panel)}
.txc-notice ul{margin:0;padding-left:18px}
.txc-ok{border-color:var(--c-jade);color:var(--c-jade)}
.txc-error{border-color:var(--c-rust);color:#f0a08a}

/* panels */
.txc-panel{background:var(--c-panel);border:1px solid var(--c-rule);padding:20px;margin:0 0 18px;min-width:0}
.txc-panel legend{font-family:var(--c-mono);font-size:12px;color:var(--c-amber);padding:0 8px;margin-left:-8px;letter-spacing:.06em}
fieldset.txc-panel{padding-top:14px}
.txc-login{max-width:440px}
.txc-login .txc-btn{margin-top:20px}
.txc-h2{font-family:var(--c-mono);font-size:13px;color:var(--c-amber);margin:0 0 6px;font-weight:500;letter-spacing:.06em}
.txc-empty p{margin:0;color:var(--c-muted)}

/* centered gate (sign-in, contributors-only notice) */
.txc-center{max-width:460px;margin:0 auto;text-align:center}
.txc-center .txc-head{border-bottom:0;padding-bottom:6px}
.txc-center .txc-sub{max-width:40ch;margin-left:auto;margin-right:auto}
.txc-center .txc-notice{text-align:left}
.txc-center .txc-login{max-width:none;text-align:left}
.txc-wide{width:100%;margin-top:20px}
.txc-login .txc-wide{margin-top:20px}
.txc-turnstile{margin:18px 0 0;min-height:65px}
.txc-fine{font-family:var(--c-mono);font-size:11.5px;color:var(--c-muted);margin:14px 0 0}

/* sign-in stage: theme backdrop behind, lifted panel in front */
.txc-stage{min-height:calc(100vh - 60px);display:flex;align-items:center}
.txc-stage .wrap.txc-portal{width:100%;padding-top:56px;padding-bottom:72px}
.txc-gate .txc-head h1,.txc-gate .txc-sub{text-shadow:0 2px 18px rgba(8,7,5,.95)}
.txc-gate .txc-sub{color:var(--c-paper);opacity:.85;max-width:46ch;line-height:1.6}
.txc-gate .txc-sub a{color:var(--c-amber);text-decoration:underline;text-underline-offset:3px}
.txc-gate .txc-panel{
  position:relative;overflow:hidden;
  background:rgba(16,14,9,.88);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);
  border-color:rgba(163,118,26,.45);
  box-shadow:0 30px 70px -10px rgba(0,0,0,.85),0 12px 28px rgba(0,0,0,.6),0 0 0 1px rgba(255,176,0,.06),0 0 70px rgba(255,176,0,.14)
}
/* corner brackets */
.txc-gate .txc-panel::before{content:"";position:absolute;inset:6px;pointer-events:none;
  background:
    linear-gradient(var(--c-amber),var(--c-amber)) top left/14px 1px,linear-gradient(var(--c-amber),var(--c-amber)) top left/1px 14px,
    linear-gradient(var(--c-amber),var(--c-amber)) top right/14px 1px,linear-gradient(var(--c-amber),var(--c-amber)) top right/1px 14px,
    linear-gradient(var(--c-amber),var(--c-amber)) bottom left/14px 1px,linear-gradient(var(--c-amber),var(--c-amber)) bottom left/1px 14px,
    linear-gradient(var(--c-amber),var(--c-amber)) bottom right/14px 1px,linear-gradient(var(--c-amber),var(--c-amber)) bottom right/1px 14px;
  background-repeat:no-repeat;opacity:.7}
/* scan sweep across the panel */
.txc-gate .txc-panel::after{content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(90deg,transparent,rgba(255,176,0,.09),transparent);transform:translateX(-100%)}
.txc-gate .txc-panel > *{position:relative;z-index:1}
.txc-gate .txc-input{background:rgba(8,7,5,.75)}
.txc-gate .txc-input:focus{box-shadow:0 0 0 3px rgba(255,176,0,.12)}
@media (prefers-reduced-motion:no-preference){
  .txc-gate .txc-head{animation:txc-rise .6s cubic-bezier(.2,.7,.2,1) both}
  .txc-gate .txc-panel{animation:txc-rise .7s cubic-bezier(.2,.7,.2,1) .12s both,txc-glow 4.5s ease-in-out 1s infinite}
  .txc-gate .txc-panel::after{animation:txc-sweep 1.1s ease .55s 1 both}
  .txc-gate .txc-panel:hover::after{animation:txc-sweep .9s ease 1 both}
  .txc-gate .txc-notice{animation:txc-rise .4s ease both}
}
@keyframes txc-rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@keyframes txc-sweep{from{transform:translateX(-100%)}to{transform:translateX(100%)}}
@keyframes txc-glow{
  0%,100%{box-shadow:0 30px 70px -10px rgba(0,0,0,.85),0 12px 28px rgba(0,0,0,.6),0 0 0 1px rgba(255,176,0,.06),0 0 70px rgba(255,176,0,.14)}
  50%{box-shadow:0 30px 70px -10px rgba(0,0,0,.85),0 12px 28px rgba(0,0,0,.6),0 0 0 1px rgba(255,176,0,.12),0 0 95px rgba(255,176,0,.22)}
}
.txc-ts-msg{font-family:var(--c-mono);font-size:12px;color:#f0a08a;margin:12px 0 0}
.txc-signin[disabled]{cursor:wait;opacity:.6}
.txc-center .txc-actions{display:flex;gap:12px;justify-content:center;flex-wrap:wrap}
.txc-hp{position:absolute!important;left:-10000px!important;top:auto;width:1px;height:1px;overflow:hidden}

/* list */
.txc-list{list-style:none;margin:0;padding:0;border-top:1px solid var(--c-rule)}
.txc-row{display:grid;grid-template-columns:72px 1fr auto;gap:18px;align-items:center;padding:16px 0;border-bottom:1px solid var(--c-rule)}
.txc-row-thumb{width:72px;height:72px;border:1px solid var(--c-rule);background:var(--c-panel);display:flex;align-items:center;justify-content:center;overflow:hidden}
.txc-row-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.txc-noimg{font-family:var(--c-mono);color:var(--c-dim);font-size:15px}
.txc-row-title{font-family:var(--c-sans);font-weight:700;font-size:1.08rem;color:var(--c-paper);line-height:1.3}
.txc-row-title:hover{color:var(--c-amber)}
.txc-row-meta{display:flex;flex-wrap:wrap;gap:4px 16px;font-family:var(--c-mono);font-size:11.5px;color:var(--c-muted);margin-top:6px}
.txc-status::before{content:"● "}
.txc-live{color:var(--c-jade)}
.txc-future{color:var(--c-amber)}
.txc-pending{color:var(--c-dim)}
.txc-draft{color:var(--c-muted)}
.txc-row-links{display:flex;gap:16px;font-family:var(--c-mono);font-size:12.5px;white-space:nowrap}
.txc-pager{display:flex;gap:18px;font-family:var(--c-mono);font-size:12.5px;color:var(--c-muted);margin-top:26px}

/* editor */
.txc-grid{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:32px;align-items:start}
.txc-side{position:sticky;top:20px}
.txc-editor{border:1px solid var(--c-rule);background:var(--c-panel)}
.txc-editor:focus-within{border-color:var(--c-dim)}
.txc-toolbar{display:flex;flex-wrap:wrap;gap:2px;padding:6px;border-bottom:1px solid var(--c-rule);background:var(--c-panel2);position:sticky;top:0;z-index:2}
.txc-toolbar button{font-family:var(--c-mono);font-size:12px;color:var(--c-paper);background:transparent;border:1px solid transparent;
  padding:6px 9px;cursor:pointer;line-height:1;min-width:32px}
.txc-toolbar button:hover{border-color:var(--c-rule);color:var(--c-amber)}
.txc-toolbar button.is-on{border-color:var(--c-dim);color:var(--c-amber);background:rgba(255,176,0,.07)}
.txc-sep{width:1px;background:var(--c-rule);margin:3px 4px}
.txc-linkbar{display:flex;gap:8px;padding:8px;border-bottom:1px solid var(--c-rule);background:var(--c-panel2)}
.txc-linkbar .txc-input{flex:1;padding:8px 10px;font-size:13px}
.txc-linkbar .txc-btn{padding:8px 14px;font-size:12px}
.txc-surface{min-height:420px;padding:22px 24px;outline:none;font-family:var(--c-sans);font-size:1.06rem;line-height:1.75;color:var(--c-paper);overflow-wrap:break-word}
.txc-surface:empty::before{content:attr(data-placeholder);color:var(--c-muted);pointer-events:none}
.txc-surface > :first-child{margin-top:0}
.txc-surface h2{font-size:1.5rem;margin:1.4em 0 .5em;color:var(--c-paper)}
.txc-surface h3{font-size:1.2rem;margin:1.3em 0 .4em;color:var(--c-paper)}
.txc-surface h4{font-size:1.05rem;margin:1.2em 0 .4em}
.txc-surface p{margin:0 0 1em}
.txc-surface a{color:var(--c-amber);text-decoration:underline}
.txc-surface blockquote{border-left:2px solid var(--c-amber);margin:1em 0;padding:.2em 0 .2em 18px;color:var(--c-muted)}
.txc-surface code{font-family:var(--c-mono);font-size:.88em;background:var(--c-void);border:1px solid var(--c-rule);padding:1px 5px}
.txc-surface pre{font-family:var(--c-mono);font-size:.88rem;background:var(--c-void);border:1px solid var(--c-rule);padding:14px;overflow-x:auto;white-space:pre-wrap}
.txc-surface pre code{border:0;padding:0;background:none}
.txc-surface ul,.txc-surface ol{padding-left:1.4em;margin:0 0 1em}

/* image */
.txc-image-preview{aspect-ratio:1200/630;border:1px solid var(--c-rule);background:var(--c-void);display:flex;align-items:center;justify-content:center;overflow:hidden;margin-bottom:12px}
.txc-image-preview img{width:100%;height:100%;object-fit:cover;display:block}
.txc-image-preview span{font-family:var(--c-mono);font-size:12px;color:var(--c-muted)}
.txc-file{display:block;position:relative}
.txc-file input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%}
.txc-file input:focus-visible + .txc-btn{outline:2px solid var(--c-amber);outline-offset:2px}
.txc-submit{width:100%;margin-top:16px}

/* preview */
.txc-preview{max-width:78ch}
.txc-preview-img{border:1px solid var(--c-rule);line-height:0;margin-bottom:26px}
.txc-preview-img img{width:100%;height:auto}
.txc-preview-title{font-size:clamp(1.8rem,4vw,2.5rem);line-height:1.15;margin:0 0 22px}

@media (max-width:900px){
  .wrap.txc-portal{padding-top:28px}
  .txc-grid{grid-template-columns:1fr;gap:8px}
  .txc-side{position:static}
  .txc-row{grid-template-columns:56px 1fr;gap:14px}
  .txc-row-thumb{width:56px;height:56px}
  .txc-row-links{grid-column:2}
  .txc-surface{min-height:300px;padding:18px 16px}
  .txc-toolbar{position:static}
}
@media (prefers-reduced-motion:reduce){.txc-btn{transition:none}}
