/* Claim Splitter (/gemmaclaim): the tool page, in the site's jelly system.
   Cream panels on the sky field, navy ink, jelly-red for the one main action.
   The head sprite is a claim split into jelly-coloured pieces. Motion is the
   shared press-and-release spring on buttons only. */

.gc {
  --gc-panel: var(--color-bg-card);
  --gc-ink: var(--color-navy);
  --gc-text: var(--color-text-primary);
  --gc-dim: var(--color-text-secondary);
  --gc-line: var(--color-border-strong);
  max-width: 880px;
  color: var(--gc-text);
}

.gc *,
.gc *::before,
.gc *::after {
  box-sizing: border-box;
}

/* ---------- buttons ---------- */
.gc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin: 4px;
  padding: 10px 24px 11px;
  border: 2px solid var(--color-jelly);
  border-radius: var(--radius-full);
  background: var(--color-jelly);
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), inset 0 -3px 0 rgba(120, 8, 8, 0.28), 0 6px 14px -6px rgba(184, 15, 13, 0.55);
  transition: transform 320ms var(--ease-jelly), background-color var(--transition-fast);
}
.gc-btn:hover {
  background: var(--color-jelly-hover);
  border-color: var(--color-jelly-hover);
  color: #fff;
  transform: scale(1.04, 0.97);
}
.gc-btn:active {
  transform: scale(0.95, 1.06);
}
.gc-btn:focus-visible,
.gc-input:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 3px;
}
.gc-btn[disabled] {
  background: var(--color-sky-soft);
  border-color: var(--color-sky-soft);
  color: var(--color-text-tertiary);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.gc-btn-ghost {
  background: var(--color-bg-card);
  border-color: var(--color-navy);
  color: var(--color-navy);
  box-shadow: 0 3px 0 var(--color-navy);
}
.gc-btn-ghost:hover {
  background: var(--color-sky-soft);
  border-color: var(--color-navy);
  color: var(--color-navy);
}

.gc-back {
  margin-left: 0;
}

/* ---------- head ---------- */
.gc-head {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 24px 0 40px;
}
.gc-sprite {
  flex: none;
  width: 96px;
  height: auto;
}
.gc-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 600;
  line-height: 1.05;
  max-width: none;
}
.gc-lead {
  margin: 0 0 12px;
  max-width: 34em;
  color: var(--gc-dim);
  font-size: var(--text-lg);
  line-height: 1.55;
}
.gc-links {
  margin: 0;
}

/* ---------- chat panel ---------- */
.gc-chat {
  position: relative;
  margin: 8px 0 12px;
  padding: 24px;
  background: var(--gc-panel);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
}

.gc-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding-bottom: 16px;
  border-bottom: 2px dotted var(--gc-line);
}
.gc-state {
  flex: 1 1 220px;
  margin: 0;
  color: var(--gc-dim);
  font-size: var(--text-sm);
}
.gc-bar {
  flex: 1 1 100%;
  height: 16px;
  padding: 3px;
  border-radius: var(--radius-full);
  background: var(--color-sky-soft);
}
.gc-bar[hidden] {
  display: none;
}
.gc-bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: var(--radius-full);
  background: var(--color-jelly);
}

.gc-label {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gc-dim);
}

/* ---------- conversation ---------- */
.gc-log {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 140px;
  max-height: 68vh;
  overflow-y: auto;
  padding: 20px 8px 20px 4px;
  overscroll-behavior: contain;
}
.gc-log:empty::before {
  content: 'Nothing here yet. Load the model, then paste a claim or pick an example.';
  color: var(--gc-dim);
}

.gc-user {
  align-self: flex-end;
  max-width: 88%;
  padding: 12px 18px;
  border-radius: var(--radius-xl) var(--radius-xl) 6px var(--radius-xl);
  background: var(--color-navy);
  color: var(--color-text-inverse);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gc-reply {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* One brick per section of the model's answer. */
.gc-brick {
  position: relative;
  padding: 14px 18px 16px;
  background: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow-wrap: anywhere;
}
.gc-brick-head {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
  max-width: none;
}
.gc-brick p,
.gc-brick ul {
  margin: 0;
  padding: 0;
  max-width: none;
  font-size: var(--text-base);
  color: var(--gc-text);
  line-height: 1.55;
}
.gc-brick p + p,
.gc-brick p + ul,
.gc-brick ul + p {
  margin-top: 6px;
}
.gc-brick ul {
  list-style: none;
}
.gc-brick li {
  position: relative;
  padding-left: 22px;
  margin: 5px 0;
}
.gc-brick li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-jelly);
}
.gc-plain {
  color: var(--gc-text);
}
.gc-meta {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--gc-dim);
  max-width: none;
}
.gc-system {
  padding: 10px 16px;
  border: 2px dashed var(--gc-line);
  border-radius: var(--radius-lg);
  color: var(--gc-dim);
  max-width: none;
}

/* ---------- examples + form ---------- */
.gc-examples {
  padding-top: 12px;
  border-top: 2px dotted var(--gc-line);
}
.gc-example-list {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -4px;
}
.gc-example-list .gc-btn {
  min-height: 40px;
  padding: 7px 18px 8px;
  font-size: var(--text-sm);
}
.gc-examples[hidden] {
  display: none;
}

.gc-form {
  margin-top: 16px;
}
.gc-input {
  display: block;
  width: 100%;
  min-height: 108px;
  padding: 14px 16px;
  resize: vertical;
  border: 2px solid var(--color-control-border);
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--gc-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
}
.gc-input:focus {
  outline: 0;
  border-color: var(--color-navy);
  box-shadow: 0 0 0 4px rgba(105, 176, 249, 0.55);
}
.gc-input::placeholder {
  color: var(--color-text-tertiary);
}
.gc-input:disabled {
  opacity: 0.6;
}
.gc-form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 8px;
  margin-top: 8px;
}
.gc-hint {
  flex: 1 1 160px;
  margin: 0;
  color: var(--gc-dim);
  font-size: var(--text-sm);
  max-width: none;
}

/* ---------- how it works ---------- */
.gc-how {
  margin-top: 56px;
  max-width: 44rem;
}
.gc-h2 {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  max-width: none;
}
.gc-facts {
  margin: 0;
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 8px 24px;
}
.gc-facts > div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 4px 16px;
  padding: 14px 0;
  border-top: 2px dotted var(--gc-line);
}
.gc-facts > div:first-child {
  border-top: 0;
}
.gc-facts dt {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent);
}
.gc-facts dd {
  margin: 0;
  color: var(--gc-text);
  line-height: 1.55;
}
.gc-note {
  margin: 20px 0 0;
  color: var(--gc-dim);
  max-width: none;
}

/* ---------- small screens ---------- */
@media (max-width: 600px) {
  .gc-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin: 20px 0 32px;
  }
  .gc-sprite {
    width: 72px;
  }
  .gc-chat {
    padding: 16px;
  }
  .gc-log {
    max-height: 60vh;
    padding-right: 6px;
  }
  .gc-user {
    max-width: 96%;
  }
  .gc-facts > div {
    grid-template-columns: 1fr;
  }
  .gc-form-row .gc-btn {
    flex: 1 1 auto;
  }
  .gc-hint {
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gc-btn:hover,
  .gc-btn:active {
    transform: none;
  }
}
