/* Toolbox notebook: inherit Alpha's paper, ink, sea and sand. */
.tb-tool,
.tb-home,
.tb-directory {
  min-width: 0;
  overflow-wrap: anywhere;
}
.tb-header {
  max-width: 980px;
  padding: 0.8rem 0 2rem;
}
.tb-header h1 {
  font-size: clamp(2.4rem, 4.1vw, 4.2rem);
  max-width: 900px;
}
.tb-header > p:not(.eyebrow) {
  max-width: 730px;
  font-size: 1.05rem;
  color: var(--muted);
  margin: 1.2rem 0 0.7rem;
}
.tb-local {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
}
.tb-guide {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 3%;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--line);
}
.tb-instruction {
  margin: 0;
  background: var(--sea);
  padding: 1.5rem;
  min-width: 0;
}
.tb-instruction figcaption {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.3;
  margin-bottom: 1.3rem;
}
.tb-instruction b,
.tb-instruction dt {
  font-weight: 600;
  font-size: 0.83rem;
}
.tb-instruction span,
.tb-instruction dd {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
  line-height: 1.6;
}
.tb-gates,
.tb-http-diagram {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 1rem;
}
.tb-gates li,
.tb-http-diagram li {
  border-top: 2px solid var(--ink);
  padding-top: 0.8rem;
  min-width: 0;
}
.tb-gates li:last-child {
  border-color: var(--accent);
}
.tb-http-diagram {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}
.tb-steps {
  padding: 0 0 0 1.5rem;
  margin: 0.2rem 0;
  counter-reset: none;
  font-size: 0.88rem;
}
.tb-steps li {
  padding-left: 0.5rem;
  margin: 0 0 1rem;
}
.tb-steps li::marker {
  color: var(--accent);
  font-weight: 600;
}
.tb-quota-diagram > div {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}
.tb-quota-diagram .tb-full-window {
  padding: 0.5rem 0.8rem;
  background: var(--ink);
  color: var(--paper);
  margin: 0;
}
.tb-quota-diagram ol {
  display: grid;
  grid-template-columns: 1fr 0.7fr 1fr;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.7rem;
}
.tb-quota-diagram li {
  padding: 0.5rem 0.4rem;
  border: 1px solid var(--ink);
  text-align: center;
}
.tb-quota-diagram li:nth-child(2) {
  border: 0;
  color: var(--accent);
}
.tb-clock-diagram {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
}
.tb-clock-diagram > div {
  padding-top: 0.8rem;
  border-top: 2px solid var(--ink);
}
.tb-clock-diagram > div:last-child {
  border-color: var(--accent);
}
.tb-path-diagram {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.tb-path-diagram > div {
  padding: 0.7rem;
  border: 1px solid var(--ink);
}
.tb-path-diagram > p {
  grid-column: 1/-1;
  font-size: 0.8rem;
  background: var(--sand);
  margin: 0;
  padding: 0.6rem 0.7rem;
}
.tb-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 5%;
  align-items: start;
  margin: 1rem 0 3rem;
}
.tb-workbench form {
  min-width: 0;
}
.tb-workbench fieldset {
  border: 0;
  border-top: 1px solid var(--line);
  padding: 1.1rem 0 1.9rem;
  margin: 0;
  min-width: 0;
}
.tb-workbench legend {
  font-family: var(--serif);
  font-size: 1.65rem;
  line-height: 1.25;
  padding: 0 1rem 0 0;
  max-width: 100%;
}
.tb-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem 1.3rem;
}
.tb-field {
  display: block;
  font-size: 0.8rem;
  min-width: 0;
}
.tb-field input,
.tb-field select {
  font-size: 1rem;
  min-height: 48px;
  padding: 0.6rem 0.7rem;
  width: 100%;
}
.tb-field input[type="datetime-local"] {
  font-size: 0.87rem;
  min-width: 0;
}
.tb-note {
  display: block;
  font-size: 0.74rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0.3rem 0 0;
}
.tb-field-error {
  display: block;
  font-size: 0.76rem;
  color: var(--accent);
  line-height: 1.5;
  margin-top: 0.25rem;
}
.tb-field-error:empty,
.tb-note:empty {
  display: none;
}
.tb-tool [aria-invalid="true"] {
  border: 2px solid var(--accent);
}
.tb-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.tb-actions button {
  min-height: 44px;
  max-width: 100%;
  padding: 0.65rem 0.8rem;
  line-height: 1.4;
  border: 1px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.82rem;
  text-align: left;
}
.tb-actions button.button {
  background: var(--ink);
  color: var(--paper);
  padding: 0.8rem 1.1rem;
}
.tb-actions button:hover:not(:disabled) {
  background: var(--sea);
  color: var(--ink);
}
.tb-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.tb-actions .tb-secondary {
  border: 0;
  background: none;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.tb-result {
  position: sticky;
  top: 1.5rem;
  padding: 1.9rem;
  background: var(--ink);
  color: var(--paper);
  min-width: 0;
}
.tb-result .eyebrow {
  color: #f1c2aa;
}
.tb-result h2 {
  font-size: 1.9rem;
  line-height: 1.2;
}
.tb-result > p:not(.eyebrow) {
  font-size: 0.9rem;
  line-height: 1.7;
}
.tb-result [data-tool-issues] {
  padding-left: 1.15rem;
  font-size: 0.81rem;
  line-height: 1.65;
  margin: 1rem 0 1.5rem;
}
.tb-result [data-tool-issues] li {
  margin: 0.7rem 0;
}
.tb-result .tb-note {
  color: #d4e2d6;
  font-size: 0.73rem;
  margin-top: 1rem;
}
.tb-result .tb-actions {
  border-top: 1px solid #4b6c61;
  padding-top: 1rem;
  gap: 0.4rem;
}
.tb-result button {
  background: transparent;
  border: 1px solid #7c9c8c;
  color: var(--paper);
  font-size: 0.76rem;
  flex: 1 1 150px;
}
.tb-result button:focus-visible {
  outline-color: #f1c2aa;
}
.tb-result-facts {
  border-top: 1px solid #4b6c61;
  padding-top: 1rem;
  margin: 1rem 0;
}
.tb-result-facts dt {
  font-size: 0.71rem;
  color: #d4e2d6;
  margin-top: 0.6rem;
}
.tb-result-facts dd {
  font-size: 0.81rem;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.tb-tool [data-tool-errors] {
  font-size: 0.83rem;
  color: var(--accent);
  margin-top: 1rem;
}
.tb-tool [data-tool-errors] ul {
  padding-left: 1.2rem;
}
.tb-tool [data-tool-errors] a {
  display: inline-block;
  min-height: 44px;
  padding: 0.5rem 0;
}
.tb-reading {
  max-width: 850px;
}
.tb-reading section {
  margin: 0 0 2.5rem;
}
.tb-reading h2 {
  font-size: 2rem;
}
.tb-reading p {
  color: var(--muted);
  max-width: 780px;
}
.tb-example {
  padding: 1.6rem;
  background: var(--sand);
}
.tb-example p:last-child {
  margin-bottom: 0;
  color: var(--ink);
}
.tb-noscript {
  padding: 1rem;
  background: var(--sand);
}
.tb-related,
.tb-real-service,
.tb-comparison {
  border-top: 1px solid var(--line);
  padding-top: 2rem;
  margin-top: 3rem;
  max-width: 960px;
}
.tb-related h2,
.tb-real-service h2,
.tb-comparison h2 {
  font-size: 1.9rem;
  margin-bottom: 1rem;
}
.tb-related ul {
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 2rem;
}
.tb-related li {
  break-inside: avoid;
}
.tb-related li a {
  display: inline-block;
  min-height: 44px;
  padding: 0.5rem 0;
  font-size: 0.88rem;
}
.tb-consent > p {
  font-size: 0.85rem;
  color: var(--muted);
}
.tb-check {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 44px;
  padding: 0.4rem 0;
  cursor: pointer;
  font-size: 0.87rem;
}
.tb-check input[type="checkbox"] {
  flex: 0 0 24px;
  width: 24px;
  min-width: 24px;
  min-height: 44px;
  height: 44px;
  margin: 0;
  accent-color: var(--ink);
  padding: 0;
}
.tb-transfer-facts {
  font-size: 0.81rem;
  border-top: 1px solid #4b6c61;
  margin-top: 1rem;
}
.tb-transfer-facts p {
  margin: 0.8rem 0;
}
.tb-comparison table {
  width: 100%;
  table-layout: fixed;
  margin: 1rem 0;
  font-size: 0.83rem;
}
.tb-comparison th,
.tb-comparison td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  padding: 0.7rem;
}
.tb-home {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 7%;
  border-top: 1px solid var(--ink);
  padding-top: 2rem;
  margin-top: 4rem;
}
.tb-home-intro h2 {
  font-size: 2.5rem;
  max-width: 420px;
}
.tb-home-intro > p:not(.eyebrow) {
  font-size: 0.92rem;
  color: var(--muted);
  max-width: 430px;
}
.tb-home-scenarios {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tb-home-scenarios li {
  border-bottom: 1px solid var(--line);
}
.tb-home-scenarios a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  min-height: 60px;
  text-decoration: none;
  padding: 1rem 0;
  font-size: 0.94rem;
}
.tb-home-scenarios a span:last-child {
  color: var(--accent);
}
.tb-directory {
  margin: 3rem 0;
}
.tb-directory > p {
  max-width: 700px;
  color: var(--muted);
  font-size: 0.92rem;
}
.tb-scenarios {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}
.tb-scenarios li {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) 20px;
  gap: 1rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--line);
}
.tb-index,
.tb-arrow {
  font-size: 0.8rem;
  color: var(--accent);
  padding-top: 0.4rem;
}
.tb-scenarios h3 {
  font-family: var(--serif);
  font-size: 1.5rem;
}
.tb-scenarios h3 a {
  display: inline-block;
  text-decoration: none;
  min-height: 44px;
  padding: 0.2rem 0;
}
.tb-scenarios p {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.3rem 0 0;
}
@media (max-width: 1000px) {
  .tb-result {
    padding: 1.4rem;
  }
  .tb-workbench {
    gap: 3%;
  }
  .tb-guide {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.8fr);
  }
  .tb-fields {
    gap: 1rem;
  }
  .tb-http-diagram {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .tb-header {
    padding: 0 0 1.5rem;
  }
  .tb-header h1 {
    font-size: 2.5rem;
  }
  .tb-guide {
    display: block;
    padding-top: 1rem;
  }
  .tb-instruction {
    padding: 1.2rem;
  }
  .tb-steps {
    margin: 1.3rem 0 0;
  }
  .tb-workbench {
    display: block;
    margin-top: 0;
  }
  .tb-result {
    position: static;
    margin-top: 1.7rem;
  }
  .tb-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .tb-workbench legend {
    font-size: 1.5rem;
  }
  .tb-gates,
  .tb-clock-diagram {
    gap: 0.6rem;
  }
  .tb-instruction b,
  .tb-instruction dt {
    font-size: 0.76rem;
  }
  .tb-instruction span,
  .tb-instruction dd {
    font-size: 0.68rem;
  }
  .tb-quota-diagram > div {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
  .tb-result h2 {
    font-size: 1.8rem;
  }
  .tb-reading h2 {
    font-size: 1.7rem;
  }
  .tb-example {
    padding: 1.2rem;
  }
  .tb-related ul {
    columns: 1;
  }
  .tb-home {
    display: block;
    margin-top: 2.5rem;
  }
  .tb-home-intro h2 {
    font-size: 2rem;
  }
  .tb-home-scenarios {
    margin-top: 1rem;
  }
  .tb-scenarios li {
    grid-template-columns: 24px minmax(0, 1fr) 15px;
    gap: 0.7rem;
  }
  .tb-scenarios h3 {
    font-size: 1.3rem;
  }
  .tb-comparison th,
  .tb-comparison td {
    font-size: 0.72rem;
    padding: 0.5rem 0.3rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tb-tool * {
    scroll-behavior: auto;
    transition: none;
  }
}
