:root {
  --error: red;
  --theme-light-bg: #f5f5f5;
  --theme-light-fg: #1a1a1a;
  --theme-dark-bg: #1a1a1a;
  --theme-dark-fg: #f5f5f5;
  --theme-border: #777;
}

body {
  font-family: Gill Sans, Gill Sans MT, Calibri, Trebuchet MS, sans-serif;
}

:is(my-counter, count-button, copy-btn, subscribe-form, render-demo, theme-provider, themed-card):not(:defined) {
  display: none;
}

:scope h2 {
  margin-bottom: .5rem;
}

p {
  margin-top: .5rem;
}

main {
  max-width: 40rem;
  margin: 0 auto;
}

input {
  border: 1px solid;
  border-radius: 0;
  outline: 1px solid #0000;
  padding: .4rem .75rem;
  font-size: 1rem;
  transition: all .2s;
}

input[aria-invalid="true"] {
  outline-color: var(--error);
  border-color: var(--error);
}

input[aria-invalid="true"]:focus {
  border-color: var(--error);
  outline-color: var(--error);
}

input[aria-invalid="true"]:focus-visible {
  border-color: var(--error);
  outline-color: var(--error);
}

input:focus {
  outline-color: initial;
}

input:focus-visible {
  outline-color: initial;
}

button {
  cursor: pointer;
  background-color: #0000;
  border: 1px solid;
  outline: 1px solid #0000;
  align-self: flex-start;
  padding: .4rem 1rem;
  font-size: 1rem;
  transition: all .2s;
  transform: translateY(0);
}

button:hover {
  outline-color: #000;
  transform: translateY(-1px);
}

button:focus {
  outline-color: #000;
  transform: translateY(-1px);
}

button:focus-visible {
  outline-color: #000;
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

:is(count-button, copy-btn) button {
  cursor: pointer;
  background-color: #0000;
  border: 1px solid;
  border-radius: 0;
  outline: 1px solid #0000;
  font-size: 1rem;
  transition: all .2s;
  transform: translateY(0);
}

:is(count-button, copy-btn) button:hover {
  outline-color: #000;
  transform: translateY(-1px);
}

:is(count-button, copy-btn) button:focus {
  outline-color: #000;
  transform: translateY(-1px);
}

:is(count-button, copy-btn) button:focus-visible {
  outline-color: #000;
  transform: translateY(-1px);
}

:is(count-button, copy-btn) button:active {
  transform: translateY(1px);
}

copy-btn button {
  min-width: 6rem;
}

copy-btn.copied button {
  outline-color: #000;
}

my-counter {
  text-align: center;
  border: 1px solid #000;
  margin: 2rem auto;
  padding: 1.5rem;
  display: block;
}

my-counter button {
  margin-right: 1rem;
  padding: .4rem 1rem;
}

my-counter .controls {
  margin-top: 2rem;
}

my-counter [data-ref="display"] {
  margin: 1rem 0;
  font-size: 1.5rem;
}

.subscribe {
  margin: 2rem 0;
}

.subscribe form {
  flex-direction: column;
  gap: .5rem;
  max-width: 22rem;
  display: flex;
}

.subscribe label {
  font-weight: 600;
}

.subscribe .error {
  color: var(--error);
  min-height: 1.25rem;
  margin: 0;
}

.subscribe .status {
  margin: 0;
}

.render-demo {
  margin: 2rem 0;
}

.render-demo ul {
  padding: 0;
  list-style: none;
}

.render-demo li {
  align-items: center;
  gap: .5rem;
  margin-bottom: .5rem;
  display: flex;
}

.render-demo .label {
  min-width: 4rem;
}

.render-demo button {
  margin-bottom: 1rem;
}

.render-demo .summary {
  margin-top: 1rem;
}

.theme-demo {
  margin: 2rem 0;
}

.theme-demo p {
  margin-top: 0;
}

.theme-demo theme-provider {
  border: 1px dashed var(--theme-border);
  margin-top: 1rem;
  padding: 1rem;
  display: block;
}

.theme-demo themed-card {
  border: 1px solid var(--theme-border);
  margin: .5rem 0;
  padding: 1rem;
  transition: background-color .2s, color .2s;
  display: block;
}

.theme-demo themed-card[data-theme="light"] {
  background-color: var(--theme-light-bg);
  color: var(--theme-light-fg);
}

.theme-demo themed-card[data-theme="dark"] {
  background-color: var(--theme-dark-bg);
  color: var(--theme-dark-fg);
}
