:root {
  color-scheme: dark;
  --canvas: #070911;
  --canvas-soft: #0b0e19;
  --surface: rgba(18, 22, 36, 0.86);
  --surface-solid: #111522;
  --surface-raised: #171c2b;
  --surface-inset: #0a0d17;
  --surface-hover: #1d2335;
  --line: rgba(174, 184, 214, 0.14);
  --line-strong: rgba(174, 184, 214, 0.24);
  --line-focus: rgba(151, 130, 255, 0.72);
  --text: #f7f5ef;
  --text-soft: #d8d7dd;
  --muted: #9698aa;
  --muted-strong: #b5b6c4;
  --accent: #9b87f5;
  --accent-strong: #b09cff;
  --accent-soft: rgba(155, 135, 245, 0.13);
  --accent-glow: rgba(155, 135, 245, 0.22);
  --mint: #60d7a7;
  --mint-soft: rgba(96, 215, 167, 0.12);
  --amber: #f3ba61;
  --amber-soft: rgba(243, 186, 97, 0.12);
  --rose: #f27d99;
  --rose-soft: rgba(242, 125, 153, 0.12);
  --blue: #66a8ff;
  --blue-soft: rgba(102, 168, 255, 0.12);
  --shadow-xs: 0 1px 0 rgba(255, 255, 255, 0.025);
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 24px 70px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 38px 110px rgba(0, 0, 0, 0.42);
  --radius-sm: 10px;
  --radius-md: 15px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(72rem 38rem at 12% -6%, rgba(99, 83, 184, 0.20), transparent 58%),
    radial-gradient(62rem 34rem at 88% 2%, rgba(38, 113, 112, 0.10), transparent 62%),
    linear-gradient(180deg, #080a13 0%, #070911 58%, #060810 100%);
  font-family: "Segoe UI Variable Text", "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

::selection {
  color: #fff;
  background: rgba(155, 135, 245, 0.42);
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  width: min(1500px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-header::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 76px;
  z-index: -1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(7, 9, 17, 0.78);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-width: max-content;
}

.brand-mark {
  position: relative;
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: #f4efff;
  background:
    linear-gradient(145deg, rgba(155, 135, 245, 0.26), rgba(155, 135, 245, 0.04)),
    var(--surface-solid);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), var(--shadow-sm);
  font: 800 15px/1 "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  letter-spacing: -0.07em;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -50%;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.16), transparent 65%);
  transform: translateX(-70%) rotate(8deg);
  transition: transform 0.7s var(--ease);
}

.brand:hover .brand-mark::after {
  transform: translateX(70%) rotate(8deg);
}

.brand > span:last-child {
  display: grid;
  gap: 2px;
}

.brand strong {
  font-size: 15px;
  font-weight: 760;
  letter-spacing: -0.01em;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.01em;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.page-shell {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 24px;
}

.hero {
  position: relative;
  min-height: 430px;
  padding: 82px 6px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto;
  align-items: end;
  gap: 44px;
}

.hero::before {
  content: "";
  position: absolute;
  left: -12%;
  top: 32px;
  width: 520px;
  height: 310px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(155, 135, 245, 0.12), transparent 68%);
  filter: blur(16px);
  pointer-events: none;
}

.eyebrow,
.panel-label {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 10.5px;
  font-weight: 780;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 1020px;
  margin-bottom: 25px;
  font-size: clamp(48px, 6.2vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.055em;
  font-weight: 760;
}

h1 br {
  display: block;
}

h2 {
  margin-bottom: 0;
  color: var(--text);
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 720;
}

h3 {
  color: var(--text);
  letter-spacing: -0.01em;
}

.hero-copy {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--muted-strong);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.72;
  letter-spacing: -0.01em;
}

.hero-status {
  position: relative;
  min-width: 290px;
  padding: 17px 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(24, 29, 46, 0.92), rgba(13, 16, 28, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), var(--shadow-md);
}

.hero-status::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  right: -42px;
  top: -46px;
  border-radius: 50%;
  background: rgba(96, 215, 167, 0.08);
  filter: blur(3px);
}

.hero-status strong,
.hero-status small {
  display: block;
}

.hero-status strong {
  font-size: 13px;
  font-weight: 720;
}

.hero-status small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}

.live-dot {
  position: relative;
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 5px rgba(96, 215, 167, 0.08), 0 0 20px rgba(96, 215, 167, 0.45);
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(96, 215, 167, 0.28);
  border-radius: inherit;
  animation: pulse-ring 2.2s ease-out infinite;
}

.drop-zone {
  position: relative;
  padding: 64px 28px;
  overflow: hidden;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(27, 32, 50, 0.82), rgba(12, 15, 26, 0.92)),
    var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), var(--shadow-lg);
  outline: none;
  isolation: isolate;
  transition: transform 0.22s var(--ease), border-color 0.22s ease, background 0.22s ease;
}

.drop-zone::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.45;
  background:
    radial-gradient(48rem 14rem at 50% 0%, rgba(155, 135, 245, 0.12), transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(255, 255, 255, 0.016) 80px),
    repeating-linear-gradient(0deg, transparent 0 79px, rgba(255, 255, 255, 0.016) 80px);
}

.drop-zone::after {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: -1;
  border: 1px dashed rgba(174, 184, 214, 0.14);
  border-radius: 20px;
  pointer-events: none;
}

.drop-zone.dragging,
.drop-zone:focus-visible {
  transform: translateY(-3px);
  border-color: var(--line-focus);
  background: linear-gradient(145deg, rgba(35, 39, 63, 0.94), rgba(15, 18, 31, 0.96));
}

.drop-zone.dragging::after,
.drop-zone:focus-visible::after {
  border-color: rgba(155, 135, 245, 0.48);
}

.drop-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 21px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(145deg, #a18ff6, #7865dc);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 18px 45px rgba(102, 84, 205, 0.26);
  font-size: 27px;
  font-weight: 700;
}

.drop-zone h2 {
  margin-bottom: 9px;
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 730;
  letter-spacing: -0.035em;
}

.drop-zone > p {
  margin-bottom: 21px;
  color: var(--muted-strong);
}

.drop-zone > small {
  display: block;
  margin-top: 15px;
  color: var(--muted);
  font-size: 11.5px;
}

.drop-actions,
.button-row,
.modal-actions,
.archive-actions,
.entry-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.button,
.icon-button,
.tab {
  position: relative;
  border: 0;
  cursor: pointer;
  user-select: none;
  transition: transform 0.16s var(--ease), background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, opacity 0.16s ease, box-shadow 0.16s ease;
}

.button {
  min-height: 39px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 720;
  letter-spacing: -0.005em;
}

.button:hover:not(:disabled),
.icon-button:hover:not(:disabled),
.tab:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled),
.icon-button:active:not(:disabled),
.tab:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
}

.button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  filter: grayscale(0.3);
}

.button-primary {
  color: #0b0812;
  background: linear-gradient(180deg, #b09cff, #927cf0);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.30), 0 8px 24px rgba(126, 102, 224, 0.20);
}

.button-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #baa9ff, #9b87f5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 12px 28px rgba(126, 102, 224, 0.27);
}

.button-ghost {
  border: 1px solid var(--line);
  color: var(--text-soft);
  background: rgba(22, 27, 42, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.button-ghost:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: #fff;
  background: var(--surface-hover);
}

.button-full {
  width: 100%;
}

.workspace {
  padding-top: 20px;
}

.challenge-banner {
  position: relative;
  margin-bottom: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background:
    linear-gradient(90deg, rgba(155, 135, 245, 0.08), transparent 46%),
    rgba(15, 19, 31, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), var(--shadow-sm);
}

.challenge-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent-strong), rgba(155, 135, 245, 0.24));
}

.challenge-banner > div:first-child {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 11px;
}

.challenge-banner strong,
.challenge-banner small {
  display: inline;
}

.challenge-banner strong {
  font-size: 13.5px;
}

.challenge-banner small {
  color: var(--muted);
  font-size: 11.5px;
}

.challenge-banner-actions {
  display: flex;
  gap: 7px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.summary-card {
  position: relative;
  min-width: 0;
  min-height: 112px;
  padding: 17px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(155deg, rgba(25, 30, 47, 0.86), rgba(14, 17, 29, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), var(--shadow-sm);
}

.summary-card::after {
  content: "";
  position: absolute;
  width: 82px;
  height: 82px;
  right: -36px;
  bottom: -48px;
  border-radius: 50%;
  background: var(--accent-soft);
  filter: blur(2px);
}

.summary-card span,
.summary-card small {
  display: block;
  color: var(--muted);
}

.summary-card span {
  margin-bottom: 13px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: clamp(20px, 2vw, 25px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 740;
}

.summary-card small {
  margin-top: 7px;
  font-size: 11px;
}

.workspace-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.68fr) minmax(350px, 0.62fr);
  gap: 14px;
  align-items: start;
}

.sidebar-stack {
  display: grid;
  gap: 14px;
}

.panel {
  position: relative;
  min-width: 0;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(20, 24, 39, 0.92), rgba(13, 16, 28, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), var(--shadow-md);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent 28%);
}

.panel-heading {
  position: relative;
  z-index: 1;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.heading-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.pill,
.count,
.save-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(31, 37, 57, 0.72);
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1;
}

.pill {
  min-height: 28px;
  padding: 6px 10px;
}

.pill-neutral {
  color: var(--mint);
  border-color: rgba(96, 215, 167, 0.25);
  background: var(--mint-soft);
}

.count {
  min-width: 21px;
  height: 20px;
  padding: 0 6px;
  margin-left: 5px;
}

.save-status {
  padding: 6px 10px;
}

.tab-list {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 10, 19, 0.62);
  scrollbar-width: none;
}

.tab-list::-webkit-scrollbar {
  display: none;
}

.tab {
  min-height: 34px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 680;
}

.tab:hover {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.025);
}

.tab.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(155, 135, 245, 0.22), rgba(155, 135, 245, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.tab-panel {
  position: relative;
  z-index: 1;
  display: none;
  padding-top: 18px;
}

.tab-panel.active {
  display: block;
  animation: panel-in 0.24s var(--ease) both;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.detail-card {
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(24, 29, 47, 0.64);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.detail-card span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-card strong {
  overflow-wrap: anywhere;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 680;
}

.detail-wide {
  grid-column: 1 / -1;
}

.copy-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.copy-row code {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
  color: #dcd8ec;
  font: 11.5px/1.62 "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

.icon-button {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted-strong);
  background: rgba(17, 21, 34, 0.82);
  font-size: 10.5px;
  font-weight: 680;
}

.icon-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: #fff;
  background: var(--surface-hover);
}

.callout,
.hint-box,
.result-box,
.session-status,
.security-note {
  position: relative;
  margin-top: 14px;
  padding: 15px 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text-soft);
  background: rgba(7, 10, 19, 0.56);
  line-height: 1.62;
}

.callout::before,
.hint-box::before,
.session-status::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  bottom: 13px;
  width: 2px;
  border-radius: 2px;
  background: rgba(155, 135, 245, 0.52);
}

.callout p:last-child,
.hint-box p:last-child,
.security-note p:last-child {
  margin-bottom: 0;
}

.callout-warning {
  border-color: rgba(243, 186, 97, 0.35);
  color: #f7dfb8;
  background: var(--amber-soft);
}

.callout-warning::before {
  background: var(--amber);
}

.data-list,
.finding-list,
.candidate-list,
.evidence-list,
.archive-list,
.history-list,
.replay-list {
  display: grid;
  gap: 8px;
}

.data-row,
.finding-item,
.candidate-item,
.evidence-item,
.archive-card,
.history-item,
.replay-item {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(24, 29, 47, 0.58);
  transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s var(--ease);
}

.data-row:hover,
.finding-item:hover,
.candidate-item:hover,
.evidence-item:hover,
.archive-card:hover,
.history-item:hover,
.replay-item:hover {
  border-color: var(--line-strong);
  background: rgba(28, 34, 53, 0.78);
}

.data-row {
  display: grid;
  grid-template-columns: minmax(126px, 0.30fr) 1fr;
  gap: 14px;
}

.data-key {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 720;
}

.data-value,
.candidate-value,
.mono {
  overflow-wrap: anywhere;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 11.5px;
}

.finding-item {
  position: relative;
  padding-left: 16px;
}

.finding-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 3px;
  background: var(--blue);
}

.finding-item.info::before {
  background: var(--blue);
}

.finding-item.warning::before {
  background: var(--amber);
}

.finding-item.success::before {
  background: var(--mint);
}

.finding-item.danger::before {
  background: var(--rose);
}

.finding-item strong,
.finding-item p {
  display: block;
}

.finding-item p,
.evidence-item p,
.history-item p,
.replay-item p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.empty-state {
  padding: 25px 18px;
  border: 1px dashed rgba(174, 184, 214, 0.18);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(7, 10, 19, 0.32);
  text-align: center;
  font-size: 12.5px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-control {
  min-height: 39px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted-strong);
  background: rgba(20, 25, 40, 0.72);
  font-size: 11.5px;
  white-space: nowrap;
}

.inline-control input {
  accent-color: var(--accent);
}

.text-input,
.text-area,
.notes-area,
.select-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: rgba(9, 12, 22, 0.72);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.018);
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.text-input,
.select-input {
  min-height: 40px;
  padding: 10px 12px;
}

.text-area,
.notes-area {
  min-height: 118px;
  padding: 12px;
  resize: vertical;
  line-height: 1.58;
}

.notes-area {
  min-height: 235px;
}

.text-input:hover,
.text-area:hover,
.notes-area:hover,
.select-input:hover {
  border-color: rgba(174, 184, 214, 0.22);
}

.text-input:focus,
.text-area:focus,
.notes-area:focus,
.select-input:focus {
  border-color: var(--line-focus);
  background: rgba(11, 14, 25, 0.94);
  box-shadow: 0 0 0 3px rgba(155, 135, 245, 0.10);
}

::placeholder {
  color: #696c7e;
}

select {
  color-scheme: dark;
}

.field-label {
  display: block;
  margin: 13px 0 7px;
  color: var(--muted-strong);
  font-size: 11.5px;
  font-weight: 680;
}

.field-label.compact {
  margin: 0;
}

.offset-input {
  max-width: 165px;
}

.code-view {
  max-height: 510px;
  margin: 12px 0 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #d8d7e2;
  background:
    linear-gradient(180deg, rgba(9, 12, 22, 0.98), rgba(6, 8, 15, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.018);
  font: 12px/1.68 "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  scrollbar-color: rgba(155, 135, 245, 0.38) transparent;
}

.code-view::-webkit-scrollbar,
.text-area::-webkit-scrollbar,
.notes-area::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.code-view::-webkit-scrollbar-thumb,
.text-area::-webkit-scrollbar-thumb,
.notes-area::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(155, 135, 245, 0.32);
  background-clip: padding-box;
}

.archive-card-header,
.archive-entry,
.candidate-item,
.evidence-item-header,
.history-item-header,
.replay-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.archive-card h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 720;
}

.archive-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.archive-actions {
  justify-content: flex-start;
  margin-top: 12px;
}

.archive-entry {
  margin-top: 8px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(7, 10, 19, 0.48);
}

.archive-entry strong,
.archive-entry small {
  display: block;
}

.archive-entry strong {
  color: var(--text-soft);
  font-size: 12px;
}

.archive-entry small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
}

.entry-actions {
  justify-content: flex-end;
}

.timeline {
  display: grid;
  gap: 8px;
}

.timeline-step {
  position: relative;
  padding: 13px 13px 13px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(24, 29, 47, 0.56);
  transition: border-color 0.18s ease, opacity 0.18s ease, transform 0.18s var(--ease);
}

.timeline-step::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: transparent;
}

.timeline-step.completed {
  border-color: rgba(96, 215, 167, 0.30);
  background: linear-gradient(90deg, var(--mint-soft), rgba(24, 29, 47, 0.56) 45%);
}

.timeline-step.completed::after {
  background: var(--mint);
}

.timeline-step.current {
  border-color: rgba(155, 135, 245, 0.46);
  background: linear-gradient(90deg, var(--accent-soft), rgba(24, 29, 47, 0.56) 48%);
  box-shadow: 0 0 0 3px rgba(155, 135, 245, 0.07);
}

.timeline-step.current::after {
  background: var(--accent);
}

.timeline-step.locked {
  opacity: 0.46;
}

.timeline-number {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted-strong);
  background: rgba(9, 12, 22, 0.72);
  font-size: 11px;
  font-weight: 800;
}

.timeline-step.completed .timeline-number {
  color: #07130e;
  border-color: transparent;
  background: var(--mint);
  box-shadow: 0 0 20px rgba(96, 215, 167, 0.16);
}

.timeline-copy {
  min-width: 0;
  flex: 1;
}

.timeline-copy strong,
.timeline-copy small {
  display: block;
}

.timeline-copy strong {
  color: var(--text-soft);
  font-size: 12.5px;
}

.timeline-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.42;
}

.timeline-status {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(9, 12, 22, 0.50);
  font-size: 9.5px;
}

.tool-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(330px, 0.72fr) minmax(300px, 0.56fr);
  gap: 14px;
}

.decoder-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.decoder-input {
  min-height: 168px;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.result-box {
  min-height: 62px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--muted-strong);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 11.5px;
}

.result-box.success {
  color: #b7f2d8;
  border-color: rgba(96, 215, 167, 0.32);
  background: var(--mint-soft);
}

.result-box.error {
  color: #ffc2cf;
  border-color: rgba(242, 125, 153, 0.34);
  background: var(--rose-soft);
}

.candidate-block {
  margin-top: 17px;
}

.candidate-heading {
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted-strong);
  font-size: 11.5px;
  font-weight: 680;
}

.candidate-item {
  align-items: center;
}

.candidate-value {
  min-width: 0;
  flex: 1;
  color: var(--text-soft);
}

.candidate-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
}

.candidate-trust {
  color: var(--amber);
}

.candidate-verified {
  color: var(--mint);
}

.bottom-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(370px, 0.82fr);
  gap: 14px;
}

.security-note {
  color: var(--muted-strong);
}

.security-note strong {
  color: var(--text);
}

.security-note p {
  margin: 7px 0 0;
}

.evidence-source {
  color: var(--accent-strong);
}

.evidence-manual {
  border-left: 3px solid var(--amber);
}

.evidence-verified {
  border-left: 3px solid var(--mint);
}

footer {
  padding: 54px 20px 34px;
  color: #777a8b;
  text-align: center;
  font-size: 11.5px;
}

footer strong {
  color: var(--muted-strong);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: 380px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--text);
  background: rgba(23, 28, 44, 0.96);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.24s var(--ease);
  backdrop-filter: blur(16px);
}

.toast.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal {
  width: min(780px, calc(100% - 28px));
  max-height: min(88vh, 900px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  color: var(--text);
  background: linear-gradient(150deg, rgba(23, 28, 45, 0.98), rgba(11, 14, 25, 0.99));
  box-shadow: var(--shadow-lg);
}

.modal::backdrop {
  background: rgba(3, 4, 9, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-card {
  margin: 0;
  padding: 8px;
}

.modal-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.modal-copy {
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.form-grid label {
  color: var(--muted-strong);
  font-size: 11.5px;
  font-weight: 680;
}

.form-grid label input,
.form-grid label select,
.form-grid label textarea {
  margin-top: 7px;
}

.form-wide {
  grid-column: 1 / -1;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

@keyframes pulse-ring {
  0% { transform: scale(0.72); opacity: 0.75; }
  70%, 100% { transform: scale(1.45); opacity: 0; }
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1280px) {
  .site-header,
  .page-shell {
    width: min(100% - 28px, 1500px);
  }

  .site-header {
    align-items: flex-start;
  }

  .header-actions {
    max-width: 760px;
  }

  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workspace-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.72fr);
  }

  .tool-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  }

  .tool-grid > .panel:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .site-header {
    position: relative;
    min-height: auto;
    padding-top: 18px;
    flex-direction: column;
  }

  .site-header::before {
    display: none;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .hero {
    min-height: 0;
    padding: 58px 4px 42px;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .hero-status {
    width: min(100%, 360px);
  }

  .workspace-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }

  .sidebar-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-header,
  .page-shell {
    width: min(100% - 20px, 1500px);
  }

  .brand small {
    display: none;
  }

  .header-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .header-actions .button {
    width: 100%;
  }

  .hero {
    padding-top: 42px;
  }

  h1 {
    font-size: clamp(42px, 12vw, 68px);
  }

  .drop-zone {
    padding: 50px 18px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar-stack,
  .tool-grid,
  .decoder-controls,
  .detail-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .tool-grid > .panel:last-child,
  .detail-wide,
  .form-wide {
    grid-column: auto;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-control,
  .offset-input {
    max-width: none;
    width: 100%;
  }

  .data-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

@media (max-width: 520px) {
  .header-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-copy {
    font-size: 15px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 17px;
    border-radius: 15px;
  }

  .challenge-banner,
  .panel-heading,
  .archive-card-header,
  .archive-entry,
  .candidate-item,
  .evidence-item-header,
  .history-item-header,
  .replay-item-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .challenge-banner > div:first-child {
    align-items: flex-start;
    flex-direction: column;
  }

  .timeline-status {
    display: none;
  }

  .copy-row {
    flex-direction: column;
  }

  .copy-row .icon-button {
    align-self: flex-end;
  }

  .entry-actions {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
