:root {
  --line: #000;
  --bg: #fff;
  --muted: #444;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: inherit; }

html { scroll-padding-top: env(safe-area-inset-top, 0px); }

body {
  margin: 0;
  background: var(--bg);
  color: #000;
  font-family: "Times New Roman", Times, Georgia, serif;
  font-size: 17px;
  line-height: 1.45;
}

h1 { font-size: 1.15rem; margin: 0 0 .5rem; letter-spacing: .01em; }
h2 { font-size: 1.05rem; margin: 1.4rem 0 .4rem; border-bottom: 1px solid var(--line); padding-bottom: .2rem; }

.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: .6rem .8rem .4rem;
  z-index: 10;
}

.tabs { display: flex; gap: .4rem; flex-wrap: wrap; }
.tab {
  flex: 1 1 auto;
  background: var(--bg);
  border: 1px solid var(--line);
  color: #000;
  padding: .45rem .3rem;
  font: inherit;
  font-size: .92rem;
  cursor: pointer;
}
.tab[aria-current="true"] { border-width: 2px; font-weight: 700; }

main { padding: .8rem; max-width: 46rem; margin: 0 auto; }

button {
  background: var(--bg);
  color: #000;
  border: 1px solid var(--line);
  font: inherit;
  padding: .5rem .7rem;
  cursor: pointer;
  min-height: 2.6rem;
}
button:active { background: #000; color: #fff; }
button:focus-visible, input:focus-visible, select:focus-visible, .tab:focus-visible {
  outline: 3px solid #000;
  outline-offset: 2px;
}
button.link { border: 0; text-decoration: underline; padding: .2rem 0; min-height: auto; }

input, select {
  background: var(--bg);
  color: #000;
  border: 1px solid var(--line);
  font: inherit;
  padding: .45rem .5rem;
  width: 100%;
  min-height: 2.6rem;
}
label { display: block; margin: .6rem 0; font-size: .95rem; }
label.chk { display: flex; align-items: center; gap: .5rem; }
label.chk input { width: auto; min-height: auto; }

.mic-wrap { display: flex; justify-content: center; margin: 1rem 0 .4rem; }
.mic {
  width: 11rem; height: 11rem;
  border: 2px solid var(--line);
  border-radius: 50%;
  font-size: 1rem;
  padding: 1rem;
}
.mic[data-active="1"] { background: #000; color: #fff; }

.heard { text-align: center; min-height: 1.5rem; font-style: italic; margin: .2rem 0 .8rem; }

.cmdrow { display: flex; gap: .5rem; align-items: stretch; margin: .5rem 0; }
.cmdrow input { flex: 1 1 auto; }
.cmdrow button { flex: 0 0 auto; }

.transport { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 1rem 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0 .8rem; }

.log {
  border: 1px solid var(--line);
  padding: .5rem;
  margin: .6rem 0;
  min-height: 3rem;
  max-height: 16rem;
  overflow-y: auto;
  font-size: .9rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.log p { margin: 0 0 .35rem; }

.list { border: 1px solid var(--line); max-height: 24rem; overflow-y: auto; }
.list .row {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  padding: .45rem .5rem;
  border-bottom: 1px solid var(--line);
  font-size: .9rem;
}
.list .row:last-child { border-bottom: 0; }
.list .row input { width: auto; min-height: auto; margin-top: .25rem; }
.list .row .meta { color: var(--muted); font-size: .82rem; }
.list .grow { flex: 1 1 auto; min-width: 0; }

.pager { display: flex; gap: .5rem; align-items: center; justify-content: space-between; margin: .5rem 0 1.5rem; }
.pager span { font-size: .9rem; }

.muted { color: var(--muted); font-size: .88rem; }
.code { word-break: break-all; border: 1px solid var(--line); padding: .3rem .4rem; display: inline-block; font-family: "Courier New", monospace; font-size: .85rem; }

progress { width: 100%; height: 1rem; }
progress::-webkit-progress-bar { background: #fff; border: 1px solid #000; }
progress::-webkit-progress-value { background: #000; }
progress::-moz-progress-bar { background: #000; }

details.help { margin-top: 1.2rem; font-size: .9rem; }
details.help ul { margin: .4rem 0 0; padding-left: 1.1rem; }
details.help li { margin-bottom: .3rem; }

.view[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
