:root {
  --bg-top: #b8ecff;
  --bg-bottom: #eefcff;
  --panel: rgba(255, 255, 255, 0.5);
  --panel-strong: rgba(255, 255, 255, 0.74);
  --panel-border: rgba(255, 255, 255, 0.7);
  --panel-edge: rgba(82, 142, 181, 0.22);
  --text: #143347;
  --muted: #3e6b80;
  --blue: #4cc7ff;
  --blue-deep: #147fc4;
  --green: #b8ff8b;
  --green-deep: #2aa745;
  --removed-bg: rgba(255, 195, 208, 0.92);
  --removed-text: #8a274d;
  --added-bg: rgba(196, 255, 176, 0.96);
  --added-text: #246f19;
  --unchanged-bg: rgba(255, 255, 255, 0.64);
  --active-ring: #ffd966;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow: 0 28px 60px rgba(34, 106, 156, 0.18);
  --glow: 0 0 0 1px rgba(255, 255, 255, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  --sans: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
  --mono: "Cascadia Code", "Consolas", monospace;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.95), transparent 18%),
    radial-gradient(circle at 82% 12%, rgba(255, 255, 255, 0.88), transparent 15%),
    linear-gradient(180deg, var(--bg-top) 0%, #d9f8ff 34%, var(--bg-bottom) 100%);
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

.sky-glow {
  position: fixed;
  width: 34vw;
  height: 34vw;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.sky-glow-left {
  top: -8vw;
  left: -8vw;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(76, 199, 255, 0.18), transparent 70%);
}

.sky-glow-right {
  top: 20vh;
  right: -12vw;
  background: radial-gradient(circle, rgba(184, 255, 139, 0.75), rgba(76, 199, 255, 0.12), transparent 72%);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 44px;
}

.glass-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.45)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(168, 231, 255, 0.16));
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow), var(--glow);
  backdrop-filter: blur(16px) saturate(1.1);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 0.8fr);
  gap: 22px;
  border-radius: 36px;
  padding: 28px;
  margin-bottom: 20px;
  overflow: hidden;
}

.hero-copy {
  display: grid;
  gap: 14px;
}

.eyebrow {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--blue-deep);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.subtitle,
.section-header p,
.group-label,
.check,
.diff-title,
.stat-label {
  color: var(--muted);
}

.subtitle {
  line-height: 1.6;
  max-width: 60ch;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-badge {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(215, 245, 255, 0.75));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 700;
}

.hero-badge-link {
  color: var(--blue-deep);
  text-decoration: none;
}

.hero-badge-link:hover {
  text-decoration: underline;
}

.hero-orb {
  display: grid;
  place-items: center;
}

.orb-glass {
  width: min(100%, 230px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  color: #f5ffff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.16);
  background:
    radial-gradient(circle at 32% 25%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.22) 18%, transparent 19%),
    radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.45), transparent 58%),
    linear-gradient(180deg, rgba(91, 222, 255, 0.95) 0%, rgba(23, 137, 224, 0.9) 55%, rgba(39, 191, 133, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow:
    inset 0 8px 18px rgba(255, 255, 255, 0.35),
    0 20px 42px rgba(44, 122, 184, 0.24);
}

.orb-label,
.orb-small {
  opacity: 0.92;
}

.orb-glass strong {
  font-size: clamp(2rem, 4vw, 2.6rem);
  line-height: 1;
}

.app-grid {
  display: grid;
  gap: 18px;
}

.controls-panel,
.editor-panel,
.result-panel {
  border-radius: var(--radius-xl);
  padding: 24px;
}

.controls-panel,
.result-panel {
  display: grid;
  gap: 20px;
}

.section-header {
  display: grid;
  gap: 6px;
}

.controls-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(250px, 1fr);
  gap: 18px;
}

.control-group {
  display: grid;
  gap: 12px;
}

.group-label {
  font-size: 0.95rem;
  font-weight: 700;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.segment {
  position: relative;
  cursor: pointer;
}

.segment input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segment span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(223, 248, 255, 0.76));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  color: #25617d;
  font-weight: 700;
  transition: 160ms ease;
}

.segment input:checked + span {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.88), transparent 18%),
    linear-gradient(180deg, #76dbff, #249ef2 72%, #1489ca);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.check {
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.4;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: #249ef2;
}

.actions,
.jump-controls,
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.compact-btn {
  min-height: 40px;
  padding: 10px 14px;
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
}

.primary-btn {
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.9), transparent 16%),
    linear-gradient(180deg, #7ee7ff 0%, #2db7ff 52%, #1184d6 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 14px 28px rgba(22, 136, 206, 0.24);
}

.secondary-btn {
  color: #116b4a;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.9), transparent 16%),
    linear-gradient(180deg, #edffd1 0%, #bfff85 52%, #5ed14f 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 24px rgba(42, 167, 69, 0.18);
}

.ghost-btn {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(216, 244, 255, 0.56));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stat-card {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.8);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(225, 247, 255, 0.58));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.24rem;
}

.editor-toolbar,
.result-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.editor-panel {
  padding: 0;
  overflow: hidden;
}

.editor-toolbar {
  padding: 22px 24px 0;
}

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

.textarea-wrap {
  display: grid;
  gap: 12px;
  padding: 24px;
}

.textarea-wrap:first-child {
  border-right: 1px solid rgba(255, 255, 255, 0.62);
}

.textarea-wrap span {
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 290px;
  resize: vertical;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(235, 250, 255, 0.84));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -10px 30px rgba(124, 223, 255, 0.08);
  color: var(--text);
  padding: 16px 18px;
  line-height: 1.55;
}

textarea:focus,
button:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(20, 127, 196, 0.35);
  outline-offset: 2px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--muted);
}

.legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.86);
}

.legend-swatch.removed {
  background: var(--removed-bg);
}

.legend-swatch.added {
  background: var(--added-bg);
}

.legend-swatch.unchanged {
  background: rgba(255, 255, 255, 0.82);
}

.diff-grid {
  gap: 16px;
}

.diff-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.84);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(229, 249, 255, 0.74));
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.diff-title {
  padding: 14px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}

.diff-output {
  margin: 0;
  min-height: 240px;
  max-height: 440px;
  overflow: auto;
  padding: 18px 16px 22px;
  font-family: var(--mono);
  line-height: 1.58;
  white-space: pre-wrap;
  word-break: break-word;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.75), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(232, 250, 255, 0.4));
}

.token {
  border-radius: 10px;
  padding: 0.07em 0.12em;
}

.token.removed {
  background: var(--removed-bg);
  color: var(--removed-text);
}

.token.added {
  background: var(--added-bg);
  color: var(--added-text);
}

.token.unchanged {
  color: var(--text);
  background: transparent;
}

.change-fragment {
  scroll-margin: 20px;
}

.change-fragment.active-fragment {
  outline: 2px solid var(--active-ring);
  box-shadow: 0 0 0 4px rgba(255, 217, 102, 0.26);
}

@media (max-width: 980px) {
  .hero,
  .controls-layout,
  .textareas,
  .diff-grid {
    grid-template-columns: 1fr;
  }

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

  .textarea-wrap:first-child {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.62);
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 16px, 1220px);
    padding-top: 16px;
  }

  .hero,
  .controls-panel,
  .result-panel,
  .textarea-wrap,
  .editor-toolbar {
    padding: 18px;
  }

  .actions,
  .jump-controls,
  .legend {
    flex-direction: column;
  }

  .primary-btn,
  .secondary-btn,
  .ghost-btn {
    width: 100%;
  }
}
