/* JWT Expiry Checker — status, dates, checks, claims and signature verification.
   Colours come from the shared tokens, so the panel follows the light and dark themes. */
.jxc {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
  padding: clamp(16px, 2.4vw, 32px);
  text-align: left;
  color: var(--ink);
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: 12px;
  box-shadow: 4px 4px 0 var(--shade);
}
.jxc *, .jxc *::before, .jxc *::after { box-sizing: border-box; }
.jxc [hidden] { display: none !important; }
/* Single-column grids never grow past their box, so long JSON and keys scroll inside it. */
.jxc, .jxc-result, .jxc-input, .jxc-status, .jxc-dates, .jxc-checks, .jxc-part, .jxc-verify, .jxc-verify-form { grid-template-columns: minmax(0, 1fr); }
.jxc h2 { margin: 0 0 .35rem; font-size: 1.45rem; letter-spacing: -.02em; }
.jxc h3 { margin: 0; font-size: 1.1rem; }
.jxc h4 { margin: 0; font-size: .95rem; }
.jxc p { margin: 0; color: var(--ink-soft); }
.jxc code, .jxc pre, .jxc textarea { font-family: var(--font-mono); }
.jxc-head p { max-width: 76ch; }
.jxc-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.jxc-sub { display: block; font-size: .82rem; font-weight: 450; color: var(--ink-soft); }
.jxc-label, .jxc-field { display: grid; gap: .3rem; min-width: 0; font-size: .88rem; font-weight: 650; color: var(--ink); }
.jxc-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; min-width: 0; }

.jxc textarea, .jxc input[type="number"], .jxc input[type="datetime-local"] {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: .55rem .65rem;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: var(--field);
  border: 1.5px solid var(--border-soft);
  border-radius: 6px;
}
.jxc textarea { font-family: var(--font-mono); font-size: .88rem; line-height: 1.5; resize: vertical; word-break: break-all; }
.jxc input[type="number"] { max-width: 12rem; }
.jxc input[type="datetime-local"] { max-width: 18rem; }
.jxc [aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
.jxc :is(input, textarea, select, button, summary, pre):focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.jxc button {
  min-height: 42px;
  padding: .5rem .95rem;
  font: inherit;
  font-weight: 650;
  color: var(--ink);
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.jxc button:hover:not(:disabled) { background: var(--paper-3); }
.jxc button:disabled { opacity: .5; cursor: default; }

.jxc-privacy { padding: .75rem 1rem; font-size: .92rem; color: var(--ink) !important; background: var(--green-tint); border: 2px solid var(--line); border-radius: 10px; }
.jxc-privacy strong { color: var(--ink); }

.jxc-input { display: grid; gap: .6rem; }
.jxc-input textarea { min-height: 7.5rem; }
.jxc-cleanup { flex: 1 1 16rem; font-size: .85rem; }
.jxc-error { display: grid; gap: .45rem; padding: .65rem .85rem; color: var(--ink); background: var(--error-soft); border-left: 4px solid var(--error); border-radius: 6px; }
.jxc-error p { color: var(--ink); }
.jxc-error-text { font-weight: 600; }
.jxc-error-preview { font-size: .85rem; overflow-wrap: anywhere; }
.jxc-error-preview code { font-size: .82rem; }

.jxc-result { display: grid; gap: 1.25rem; min-width: 0; }

/* Status */
.jxc-status { display: grid; gap: .5rem; padding: 1.1rem 1.2rem; background: var(--paper-3); border: 2px solid var(--line); border-radius: 10px; box-shadow: 3px 3px 0 var(--shade); }
.jxc-status[data-state="valid"] { background: var(--green-tint); }
.jxc-status:is([data-state="expired"], [data-state="never"], [data-state="invalid"]) { background: var(--pink-tint); }
.jxc-status:is([data-state="not-yet"], [data-state="no-exp"]) { background: var(--yellow-tint); }
.jxc-status[data-state="jwe"] { background: var(--blue-tint); }
.jxc-status-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.jxc-state { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; color: var(--ink) !important; }
.jxc .jxc-sig { display: inline-flex; align-items: center; min-height: 42px; padding: .25rem .9rem; font-size: .85rem; font-weight: 700; color: var(--ink); background: var(--bg-2); border: 2px solid var(--line); border-radius: 999px; }
.jxc .jxc-sig:hover { text-decoration: underline; }
.jxc .jxc-sig[data-sig="verified"] { background: var(--success-soft); border-color: var(--success); }
.jxc .jxc-sig[data-sig="mismatch"] { background: var(--error-soft); border-color: var(--error); }
.jxc-countdown { font-size: clamp(1.05rem, 2.6vw, 1.3rem); font-weight: 700; color: var(--ink) !important; font-variant-numeric: tabular-nums; }
.jxc-state-note, .jxc-at-note { font-size: .9rem; color: var(--ink) !important; }
.jxc-at-note { font-weight: 600; }
.jxc-life { display: grid; gap: .35rem; }
.jxc-life p { font-size: .88rem; color: var(--ink) !important; font-variant-numeric: tabular-nums; }
.jxc-bar { height: 12px; overflow: hidden; background: var(--field); border: 2px solid var(--line); border-radius: 999px; }
.jxc-bar span { display: block; height: 100%; width: 0; background: var(--action); }

/* Settings */
.jxc-settings { display: flex; flex-wrap: wrap; align-items: end; gap: .9rem 1.5rem; padding: 1rem; background: var(--blue-tint); border: 2px solid var(--line); border-radius: 10px; }
.jxc-settings-help { flex: 1 1 100%; }
.jxc-field-error { flex: 1 1 100%; padding: .45rem .7rem; font-size: .88rem; color: var(--ink) !important; background: var(--error-soft); border-left: 4px solid var(--error); border-radius: 6px; }
.jxc-pills { display: flex; flex-wrap: wrap; gap: .45rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.jxc-pills legend { width: 100%; margin-bottom: .4rem; padding: 0; font-size: .88rem; font-weight: 700; }
.jxc-pills label { position: relative; display: inline-flex; align-items: center; min-height: 42px; padding: .4rem .85rem; font-size: .92rem; font-weight: 600; background: var(--bg-2); border: 2px solid var(--line); border-radius: 999px; cursor: pointer; }
.jxc-pills input { position: absolute; opacity: 0; pointer-events: none; }
.jxc-pills label:has(input:checked) { color: var(--on-action); background: var(--action); box-shadow: 2px 2px 0 var(--shade); }
.jxc-pills label:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }

/* Dates */
.jxc-dates { display: grid; gap: .6rem; }
.jxc-date-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); gap: .75rem; }
.jxc-date { display: grid; gap: .5rem; align-content: start; min-width: 0; padding: .8rem .9rem; background: var(--bg-2); border: 1.5px solid var(--border-soft); border-radius: 10px; }
.jxc-date h4 { display: flex; flex-wrap: wrap; align-items: baseline; gap: .45rem; }
.jxc-date h4 code { padding: .05rem .4rem; font-size: .88rem; background: var(--paper-3); border-radius: 4px; }
.jxc-date dl { display: grid; gap: .35rem; margin: 0; }
.jxc-date dl div { display: grid; gap: .05rem; min-width: 0; }
.jxc-date dt { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.jxc-date dd { margin: 0; font-family: var(--font-mono); font-size: .86rem; color: var(--ink); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* Checks */
.jxc-checks { display: grid; gap: .6rem; }
.jxc-warnings { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.jxc-check { display: grid; grid-template-columns: 5.5rem 1fr; gap: .2rem .7rem; align-items: baseline; padding: .6rem .8rem; font-size: .9rem; line-height: 1.5; color: var(--ink); background: var(--bg-2); border: 1.5px solid var(--border-soft); border-left: 5px solid var(--info); border-radius: 8px; }
.jxc-check span { min-width: 0; overflow-wrap: anywhere; }
.jxc-check[data-level="danger"] { background: var(--error-soft); border-left-color: var(--error); }
.jxc-check[data-level="warning"] { background: var(--warning-soft); border-left-color: var(--warning); }
.jxc-level { font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); }

/* Header and payload */
.jxc-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: 1.25rem; align-items: start; }
.jxc-part { display: grid; gap: .6rem; min-width: 0; }
.jxc-part-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.jxc-part-error { padding: .5rem .75rem; font-size: .9rem; color: var(--ink) !important; background: var(--error-soft); border-left: 4px solid var(--error); border-radius: 6px; overflow-wrap: anywhere; }
.jxc-part-error button { margin-top: .4rem; }
.jxc-table-wrap { min-width: 0; overflow-x: auto; border: 1.5px solid var(--border-soft); border-radius: 8px; }
.jxc-claims { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .86rem; }
.jxc-claims thead th { font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); background: var(--paper-3); }
.jxc-claims th, .jxc-claims td { padding: .45rem .6rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border-faint); overflow-wrap: anywhere; }
.jxc-claims tbody tr:last-child > * { border-bottom: 0; }
.jxc-claims thead th:nth-child(1) { width: 28%; }
.jxc-claims thead th:nth-child(2) { width: 37%; }
.jxc-claims tbody th { font-weight: 600; }
.jxc-claims tbody th code { font-size: .86rem; }
.jxc-value { display: block; color: var(--ink); white-space: pre-wrap; }
.jxc-mono .jxc-value { font-family: var(--font-mono); font-size: .8rem; }
.jxc-value-note { display: block; margin-top: .15rem; font-size: .78rem; color: var(--ink-soft); }
.jxc-custom { color: var(--ink-soft); font-style: italic; }
.jxc-raw summary { min-height: 32px; font-weight: 700; cursor: pointer; }
.jxc-json { max-height: 24rem; margin: .5rem 0 0; padding: .8rem 1rem; overflow: auto; font-size: .84rem; line-height: 1.55; color: var(--ink); white-space: pre; background: var(--field); border: 1.5px solid var(--border-soft); border-radius: 6px; }
.jxc-j-key { color: var(--action-text); }
.jxc-j-string { color: var(--success); }
.jxc-j-number { color: var(--info); }
.jxc-j-boolean, .jxc-j-null { color: var(--warning); font-weight: 600; }
.jxc-j-punctuation, .jxc-j-text { color: var(--ink-soft); }
.jxc-status-line { min-height: 1.4em; font-weight: 600; color: var(--ink) !important; }
.jxc-status-line:empty { display: none; }

/* Signature */
.jxc-verify { display: grid; gap: .7rem; padding: 1rem 1.1rem; background: var(--paper-3); border: 2px solid var(--line); border-radius: 10px; }
.jxc-verify h3 { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.jxc-optional { padding: .1rem .55rem; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); background: var(--bg-2); border: 1.5px solid var(--border-soft); border-radius: 999px; }
.jxc-alg { font-size: .92rem; color: var(--ink) !important; overflow-wrap: anywhere; }
.jxc-verify-form { display: grid; gap: .65rem; }
.jxc-verify textarea { min-height: 6.5rem; }
.jxc-verdict { display: grid; gap: .4rem; padding: .65rem .85rem; color: var(--ink); background: var(--bg-2); border: 1.5px solid var(--border-soft); border-left-width: 5px; border-radius: 8px; }
.jxc-verdict:empty { display: none; }
.jxc-verdict p, .jxc-verdict li { color: var(--ink); overflow-wrap: anywhere; }
.jxc-verdict .jxc-sub { color: var(--ink-soft); }
.jxc-verdict-main { font-weight: 650; }
.jxc-verdict[data-status="verified"] { background: var(--success-soft); border-left-color: var(--success); }
.jxc-verdict[data-status="mismatch"] { background: var(--error-soft); border-left-color: var(--error); }
.jxc-verdict:is([data-status="error"], [data-status="unsupported"]) { background: var(--warning-soft); border-left-color: var(--warning); }
.jxc-verdict[data-status="pending"] { opacity: .6; }
.jxc-notes { display: grid; gap: .25rem; margin: 0; padding-left: 1.1rem; font-size: .88rem; }
.jxc-foot { font-size: .85rem; }

@media (max-width: 520px) {
  .jxc-check { grid-template-columns: 1fr; }
  .jxc-date { padding: .75rem .8rem; }
  .jxc-date dl div { grid-template-columns: 4.6rem minmax(0, 1fr); gap: .45rem; align-items: baseline; }
  .jxc-date dt { font-size: .66rem; }
  .jxc-date dd { font-size: .8rem; }
  .jxc-claims { font-size: .82rem; }
  .jxc-claims th, .jxc-claims td { padding: .4rem .45rem; }
  .jxc-claims thead th { font-size: .66rem; letter-spacing: .02em; }
  .jxc-claims thead th:nth-child(1) { width: 30%; }
  .jxc-claims thead th:nth-child(2) { width: 36%; }
}

/* Space the page holds for this view until it mounts (see .tool-view-placeholder in _workspace.css).
   Each height is a little under the space the view takes at that width, measured as how far the
   content below moves when the view replaces the placeholder, so nothing below it moves. Re-measure
   after changing the view's layout: node scripts/measure-tool-views.js --apply jwt-expiry-checker. */
.tool-view-placeholder[data-tool="jwt-expiry-checker"] { min-height: 2456px; }
@media (max-width: 1128px) { .tool-view-placeholder[data-tool="jwt-expiry-checker"] { min-height: 2804px; } }
@media (max-width: 580px) { .tool-view-placeholder[data-tool="jwt-expiry-checker"] { min-height: 3552px; } }
@media (max-width: 400px) { .tool-view-placeholder[data-tool="jwt-expiry-checker"] { min-height: 4257px; } }
