:root {
  color-scheme: light dark;
  --main-background-color: #eee;
  --button-background-color: #fff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --main-background-color: #222;
    --button-background-color: #555;
  }
}

/* Light material design boilerplate. */
html,
body {
  width: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--main-background-color);
}

/* Only apply min-height to non-print media */
@media not print {
  html,
  body {
    min-height: 100%;
  }
}

body {
  font-family: Verdana, Helvetica, sans-serif;
  text-align: center;
  box-sizing: border-box;
  padding: 2em;
  display: flex;
  flex-direction: column;
}

.content {
  align-self: center;
}

.before {
  flex: 1 1 5%;
}

.after {
  flex: 2 2 10%;
}

button {
  background-color: var(--button-background-color);
  color: currentColor;
  border: none;
  font-size: 1.5em;
  width: 400px;
  padding: 0.5em;
  margin: 10px 10px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
  transition: all 150ms;
}

button:hover {
  background: color-mix(in oklab, #ff0 50%, transparent);
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
  transform: translateY(-2px);
}

button.success {
  background: color-mix(in oklab, #0f0 50%, transparent);
}

button.error {
  background: color-mix(in oklab, #f00 50%, transparent);
}

table {
  margin: 1em auto;
  border-collapse: collapse;
}

table td {
  border: 1px solid #888;
  padding: 8px;
}

table td:first-child {
  text-align: right;
}

#toggle-wrapper {
  display: block;
  margin: 2em 0 3em;
}

#toggle {
  font-size: 1.5em;
  padding: 1em;
  margin: 1em;
  color: currentColor;
  text-decoration: none;
}

#toggle .http,
#toggle .https {
  color: color-mix(in oklab, currentColor 50%, transparent);
  transition: color 0.25s ease-in-out;
}

#toggle.https .http,
#toggle.http .https {
  color: color-mix(in oklab, currentColor 50%, transparent);
}

#toggle.http:not(:hover) .http {
  color: #db4437;
}

#toggle.https:not(:hover) .https {
  color: #1ac222;
}

#toggle.http:hover .https {
  text-decoration: underline;
  color: #1ac222;
}

#toggle.https:hover .http {
  text-decoration: underline;
  color: #db4437;
}

a#toggle:hover {
  color: currentColor;
}

.switch {
  display: inline-block;
  width: 34px;
  height: 14px;
  border-radius: 7px;
  background-color: rgba(34, 31, 31, 0.26);
  margin: auto 0.5em;
  transition: background-color 0.25s ease-in-out;
}

.switch .knob {
  width: 20px;
  height: 20px;
  margin: -3px;
  border-radius: 10px;
  background-color: #f1f1f1;
  border: inset 0.5px rgba(255, 255, 255, 0.12), inset 0.5px
    rgba(255, 255, 255, 0.12);
  box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.12), 0px 2px 2px 0px
    rgba(0, 0, 0, 0.24);

  transform: translateX(10px);
  transition: transform 0.25s ease-in-out, background-color 0.25s ease-in-out;
}

#toggle.instant .switch,
#toggle.instant .switch .knob,
#toggle.instant .http,
#toggle.instant .https {
  transition: transform 0s;
}

.http:not(:hover) .switch,
.https:hover .switch {
  background-color: rgba(219, 68, 55, 0.26);
}

.http:not(:hover) .switch .knob,
.https:hover .switch .knob {
  background-color: rgb(219, 68, 55);
  transform: translateX(0px);
}

.http:hover .switch,
.https:not(:hover) .switch {
  background-color: rgba(29, 194, 34, 0.5);
}

.http:hover .switch .knob,
.https:not(:hover) .switch .knob {
  background-color: rgb(29, 194, 34);
  transform: translateX(20px);
}

.jswarning {
  color: rgb(219, 68, 55);
  font-size: 2em;
}

.permission-status,
.access-status {
  font-size: small;
  text-transform: uppercase;
  padding-top: .4rem;
  text-align: left;
}

.permission-status > span,
.access-status > span {
  font-weight: 800;
}

.demo-instructions {
  padding: .5rem 1rem;
  text-align: left;
  border: solid 1px;
  max-width: 80rem;
  align-self: center;
  margin: 1rem auto;
}

permission {
  --color: #2192ef;
  position: relative;
  background: color-mix(in oklab, currentColor 30%, transparent);
  border: solid color-mix(in oklab, currentColor 70%, transparent);
  border-radius: 5px;
  width: 400px;
  padding: 0.5em;
  margin: 10px 10px;
  z-index: 99999;
  /* github-fork-ribbon-wrapper uses 9999 */
}

.permission-element-box {
  display: inline-block;
}

geolocation {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: var(--button-background-color);
  color: currentColor;
  cursor: pointer;
  user-select: none;
}

geolocation:hover {
  background-color: #e0e0e0;
}

.geolocation-event-logger {
  font-family: monospace;
  border: 1px solid #ddd;
  padding: 15px;
  margin-top: 10px;
  background-color: var(--button-background-color);
  min-height: 80px;
  white-space: pre-wrap;
}
