/* Shared tool chrome — matches suite vibes */
:root {
  --radius: 0.5rem;
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --accent: 240 4.8% 95.9%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 240 5.9% 10%;
  --success: 142 76% 36%;
  --warning: 38 92% 50%;
  --destructive: 0 84.2% 60.2%;
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
}

.dark {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 10% 3.9%;
  --card-foreground: 0 0% 98%;
  --primary: 0 0% 98%;
  --primary-foreground: 240 5.9% 10%;
  --secondary: 240 3.7% 15.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --accent: 240 3.7% 15.9%;
  --border: 240 3.7% 15.9%;
  --input: 240 3.7% 15.9%;
  --ring: 240 4.9% 83.9%;
  --success: 142 71% 45%;
  --warning: 38 92% 50%;
  --destructive: 0 62.8% 30.6%;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: min(36rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.wrap.wide { width: min(42rem, calc(100% - 2rem)); }

header { margin-bottom: 2rem; animation: rise 0.4s ease both; }

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
}

.sibling {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
}

.sibling:hover {
  color: hsl(var(--foreground));
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1 {
  font-size: clamp(1.5rem, 3.5vw, 1.875rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.lede {
  color: hsl(var(--muted-foreground));
  font-size: 0.9375rem;
  max-width: 42ch;
  line-height: 1.6;
}

form {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  animation: rise 0.4s 0.05s ease both;
}

.field { display: grid; gap: 0.5rem; }

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 520px) {
  .row { grid-template-columns: 1fr; }
}

.label {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
}

.hint {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.4;
}

.input {
  display: flex;
  height: 2.5rem;
  width: 100%;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--input));
  background: transparent;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  outline: none;
}

.input:focus-visible {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring) / 0.4);
}

.input::placeholder { color: hsl(var(--muted-foreground)); opacity: 0.7; }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  user-select: none;
  width: fit-content;
  line-height: 1.4;
}

.checkbox {
  appearance: none;
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
  border-radius: 0.25rem;
  border: 1px solid hsl(var(--primary));
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.checkbox:checked {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
}

.checkbox:checked::after {
  content: "";
  width: 0.35rem;
  height: 0.55rem;
  border: solid hsl(var(--primary-foreground));
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translateY(-1px);
}

#token-field { display: none; }
#token-field.visible { display: grid; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding: 0.5rem 1rem;
  margin-top: 0.25rem;
  border-radius: calc(var(--radius) - 2px);
  border: none;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  cursor: pointer;
}

.btn:hover:not(:disabled) { opacity: 0.9; }
.btn:disabled { opacity: 0.5; cursor: wait; }

.status {
  min-height: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1rem;
}

.status.error { color: hsl(var(--destructive)); }

.result {
  display: none;
  animation: rise 0.35s ease both;
}

.result.visible { display: grid; gap: 1rem; }

.alert {
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  padding: 1rem;
  background: hsl(var(--card));
}

.alert.found {
  border-color: hsl(var(--success) / 0.4);
  background: hsl(var(--success) / 0.08);
}

.alert.missing {
  border-color: hsl(var(--warning) / 0.4);
  background: hsl(var(--warning) / 0.08);
}

.alert.error-box {
  border-color: hsl(var(--destructive) / 0.5);
  background: hsl(var(--destructive) / 0.1);
}

.alert-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  color: hsl(var(--muted-foreground));
}

.alert.found .alert-label { color: hsl(var(--success)); }
.alert.missing .alert-label { color: hsl(var(--warning)); }
.alert.error-box .alert-label { color: hsl(0 72% 65%); }

.alert-main {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
  line-height: 1.3;
}

.alert-sub {
  margin-top: 0.35rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

.alert-sub a {
  color: hsl(var(--foreground));
  text-underline-offset: 3px;
}

.meta {
  display: grid;
  gap: 0.65rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  font-size: 0.875rem;
}

.meta:empty { display: none; }

.meta-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.5rem;
  align-items: baseline;
}

.meta-row dt {
  color: hsl(var(--muted-foreground));
  font-size: 0.8rem;
}

.meta-row dd {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  word-break: break-all;
}

.meta-row dd a {
  color: hsl(var(--foreground));
  text-decoration: none;
}

.meta-row dd a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.list-card {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  overflow: hidden;
}

.list-card-title {
  padding: 0.85rem 1.15rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-bottom: 1px solid hsl(var(--border));
}

.commit-list {
  list-style: none;
  max-height: 420px;
  overflow-y: auto;
}

.commit-list li {
  display: grid;
  gap: 0.2rem;
  padding: 0.7rem 1.15rem;
  border-bottom: 1px solid hsl(var(--border));
  font-size: 0.8rem;
}

.commit-list li:last-child { border-bottom: none; }

.commit-list a {
  color: hsl(var(--foreground));
  text-decoration: none;
  font-weight: 500;
}

.commit-list a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.commit-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: hsl(var(--muted-foreground));
}

.separator {
  height: 1px;
  background: hsl(var(--border));
  margin: 2rem 0;
  border: none;
}

footer {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
}

footer a {
  color: hsl(var(--foreground));
  text-underline-offset: 3px;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
