:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #ebf1ef;
  background: #0f1516;
  --panel: #172021;
  --border: #344345;
  --muted: #a6b8b6;
  --accent: #bcf682;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }

.workspace {
  width: min(100% - 3rem, 65rem);
  margin-inline: auto;
  padding-block: clamp(2.25rem, 8vw, 6rem) 3rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1.5rem;
  margin-bottom: 2.25rem;
}

h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.6rem, 6vw, 4.1rem); letter-spacing: -0.065em; line-height: 1; }
.page-header p { margin-top: .75rem; color: var(--muted); }
h2 { font-size: 1.3rem; letter-spacing: -.025em; }

.connection {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .85rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 2rem;
  font-size: .875rem;
  white-space: nowrap;
}

.connection::before { content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.connection[data-state="ready"] { color: var(--accent); border-color: #4d623d; background: #1e2921; }
.connection[data-state="error"] { color: #f4ac96; }

.panels { display: grid; grid-template-columns: 1fr 1.1fr; align-items: start; gap: 1rem; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 1rem; padding: clamp(1.25rem, 3.3vw, 2rem); }
.counter { min-height: 24rem; display: flex; flex-direction: column; }

#value {
  margin-block: auto;
  padding-block: 1.25rem;
  font: 600 clamp(3.5rem, 8vw, 6.25rem)/1 var(--mono);
  letter-spacing: -.08em;
  color: var(--accent);
  overflow-wrap: anywhere;
}

#value[data-wide] { font-size: clamp(1.6rem, 3.6vw, 3.1rem); }
.counter-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }

button {
  min-height: 2.75rem;
  padding-inline: .85rem;
  border: 1px solid var(--border);
  border-radius: .55rem;
  background: #233031;
  color: #ebf1ef;
  cursor: pointer;
  font-weight: 600;
}

button:hover:not(:disabled) { background: #2d3d3f; }
button:disabled { opacity: .5; cursor: default; }
button.primary { color: #162010; background: var(--accent); border-color: transparent; }
button.primary:hover:not(:disabled) { background: #d0ffad; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.activity, .hint { color: var(--muted); font-size: .875rem; line-height: 1.5; }
.activity { margin-top: .85rem; }
.hint { margin-top: 1.15rem; }
.configuration h2 { margin-bottom: 1.25rem; }

label { display: block; margin-bottom: .4rem; font-size: .875rem; font-weight: 600; }
.endpoint-row { display: flex; gap: .5rem; }

input {
  min-width: 0;
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: .55rem;
  padding: .45rem .65rem;
  background: #111819;
  color: #f1f6f1;
  font-family: var(--mono);
  font-size: .875rem;
}

input::placeholder { color: #8d9e9c; }
#pair-fields, #pair-fields button, #activate { margin-top: 1rem; }
details { margin-top: 1.35rem; padding-top: 1rem; border-top: 1px solid var(--border); }
summary { cursor: pointer; font-size: .9rem; font-weight: 600; }
dl { margin: .9rem 0 0; font-size: .875rem; line-height: 1.5; }
dt { font-weight: 600; }
dd { margin: .25rem 0 .75rem; color: var(--muted); }
dd:last-child { margin-bottom: 0; }
code { font-family: var(--mono); overflow-wrap: anywhere; }

@media (max-width: 45rem) {
  .workspace { width: min(100% - 2rem, 38rem); }
  .page-header { align-items: start; flex-direction: column; margin-bottom: 1.5rem; }
  .panels { grid-template-columns: 1fr; }
  .counter { min-height: 19rem; }
}
