:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #1a1a18;
  --ink-soft: #4d4d49;
  --muted: #8f8f89;
  --faint: #bcbcb6;
  --hairline: #dcdcd6;
  --hairline-soft: #e7e7e2;
  --tint: #f4f4ef;
  --signal: #c8391b;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body.ops-tool-page {
  min-height: 100vh;
  max-width: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

h1,
p {
  margin: 0;
}

.ops-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
}

.ops-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(100%, 1140px);
  min-height: 62px;
  margin: 0 auto;
  padding: 10px 20px;
}

.ops-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.ops-brand-mark {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  background: var(--signal);
}

.ops-brand strong {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ops-context {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.tool-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 30px 20px 72px;
}

.page-head {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ink);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  background: var(--signal);
}

h1 {
  color: var(--ink);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.15;
}

.sub {
  max-width: 620px;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.5;
}

.tool-panel {
  min-width: 0;
  border: 1px solid var(--hairline);
  border-top: 2px solid var(--ink);
  background: var(--paper);
  padding: 14px;
}

label {
  display: block;
  margin: 20px 0 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tool-panel > label:first-child,
.row label {
  margin-top: 0;
}

.hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.4;
  text-transform: none;
}

input:not([type="checkbox"]),
select,
textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 46px;
  border: 1px solid var(--ink);
  border-radius: 0;
  outline: none;
  background: var(--paper);
  color: var(--ink);
  padding: 0 12px;
}

textarea {
  min-height: 96px;
  padding: 11px 12px;
  resize: vertical;
}

#thesis,
#changed {
  min-height: 132px;
}

input:not([type="checkbox"]):focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

.ac {
  position: relative;
  min-width: 0;
}

.ac-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 50;
  display: none;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.ac-list.open {
  display: block;
}

.ac-item,
.ac-empty {
  padding: 11px 12px;
}

.ac-item {
  cursor: pointer;
  border-bottom: 1px solid var(--hairline);
}

.ac-item:last-child {
  border-bottom: 0;
}

.ac-item.active,
.ac-item:hover {
  background: var(--tint);
}

.ac-empty {
  color: var(--muted);
}

button {
  min-height: 46px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0 16px;
}

button:hover:not(:disabled) {
  background: #000000;
}

button:disabled {
  cursor: not-allowed;
  border-color: var(--hairline);
  background: var(--hairline);
  color: var(--muted);
}

#btn {
  width: 100%;
  margin-top: 26px;
}

.retest-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 22px 0 0;
  border: 1px solid var(--hairline);
  background: var(--paper);
  cursor: pointer;
  padding: 14px;
  letter-spacing: normal;
  text-transform: none;
}

.retest-toggle input {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  margin: 2px 0 0;
  accent-color: var(--ink);
}

.retest-toggle input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.retest-toggle b {
  display: block;
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 2px;
}

.retest-toggle span {
  min-width: 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.45;
}

.retest-panel {
  display: none;
  margin-top: 10px;
  border: 1px solid var(--ink);
  background: var(--paper);
  padding: 16px;
}

.retest-panel.open {
  display: block;
}

.grid2,
.row,
.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.mini {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 12px 0 2px;
}

.mini button,
#open {
  border-color: var(--ink);
  background: var(--paper);
  color: var(--ink);
}

.mini button:hover:not(:disabled),
#open:hover:not(:disabled) {
  background: var(--tint);
}

.prompt-btn {
  width: 100%;
  margin-top: 10px;
}

.rulebox {
  margin-top: 12px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.5;
  padding: 13px;
}

.rulebox code,
.url {
  color: var(--ink);
  font-family: Menlo, ui-monospace, SFMono-Regular, monospace;
  font-weight: 700;
}

.ok,
.err {
  display: none;
  margin-top: 14px;
  background: var(--paper);
  font-size: 13px;
  font-weight: 500;
  padding: 12px;
}

.ok {
  border: 1px solid var(--ink);
  color: var(--ink);
}

.err {
  border: 1.5px solid var(--signal);
  color: var(--signal);
}

.ok::before,
.err::before,
.status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  vertical-align: 1px;
}

.ok::before {
  background: var(--ink);
}

.err::before {
  background: var(--signal);
}

.create-action {
  margin-top: 16px;
}

#create {
  width: 100%;
}

.status,
.result {
  margin-top: 14px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  color: var(--ink-soft);
  padding: 13px;
}

.status::before {
  border: 1.5px solid var(--ink);
  background: transparent;
}

.status.good {
  border-color: var(--ink);
  color: var(--ink);
}

.status.good::before {
  background: var(--ink);
}

.status.mid {
  border-color: var(--ink);
  color: var(--ink-soft);
}

.status.bad {
  border: 1.5px solid var(--signal);
  color: var(--signal);
}

.status.bad::before {
  border-color: var(--signal);
  background: var(--signal);
}

.result {
  display: none;
}

.result.visible {
  display: block;
}

.url {
  margin: 6px 0 12px;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.muted {
  color: var(--ink-soft);
  font-size: 12.5px;
}

.actions {
  margin-top: 10px;
}

.copy {
  background: var(--ink);
  color: var(--paper);
}

@media (max-width: 640px) {
  .ops-topbar-inner {
    gap: 10px;
    min-height: 56px;
    padding: 9px 16px;
  }

  .ops-brand {
    gap: 8px;
  }

  .ops-brand strong {
    font-size: 12px;
    letter-spacing: 0.12em;
  }

  .ops-context {
    max-width: 38%;
    font-size: 9px;
  }

  .tool-shell {
    padding: 22px 16px 52px;
  }

  .page-head {
    margin-bottom: 18px;
    padding-bottom: 20px;
  }

  .row > *,
  .grid2 > *,
  .actions > * {
    min-width: 0;
  }
}

@media (min-width: 900px) {
  h1 {
    font-size: 28px;
  }

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

  .actions {
    grid-template-columns: minmax(0, 1fr) 130px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
