/* src/styles.css */
:root {
  --hig-font: "Geneva", "Helvetica Neue", Verdana, sans-serif;
  --ink: #000;
  --paper: #fff;
  --dim: gray;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--hig-font);
  color: var(--ink);
  -webkit-font-smoothing: none;
  background-color: #9a9a9a;
  background-image: linear-gradient(45deg, #8a8a8a 25%, #0000 25% 75%, #8a8a8a 75%), linear-gradient(45deg, #8a8a8a 25%, #0000 25% 75%, #8a8a8a 75%);
  background-position: 0 0, 2px 2px;
  background-size: 4px 4px;
  font-size: 12px;
  line-height: 1.25;
}

.menubar {
  position: sticky;
  z-index: 50;
  display: flex;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  user-select: none;
  align-items: stretch;
  gap: 0;
  height: 20px;
  padding-left: 8px;
  top: 0;
}

.menu-title {
  display: flex;
  align-items:  center;
  padding: 0 10px;
  font-size: 12px;
}

.menu-title.apple {
  font-weight: bold;
}

.desktop {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 940px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.window {
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 2px 2px #00000073;
}

.titlebar {
  position: relative;
  display: flex;
  border-bottom: 1px solid var(--ink);
  align-items:  center;
  height: 20px;
  padding: 0 6px;
}

.titlebar .stripes {
  position: absolute;
  pointer-events: none;
  background-image: repeating-linear-gradient(#000 0 1px, #0000 1px 3px);
  inset: 0;
}

.titlebar.inactive .title {
  color: var(--dim);
}

.closebox {
  position: relative;
  z-index: 2;
  border: 1px solid var(--ink);
  background: var(--paper);
  width: 11px;
  height: 11px;
  margin-right: 8px;
}

.titlebar .title {
  position: relative;
  z-index: 2;
  background: var(--paper);
  margin: 0 auto;
  padding: 0 8px;
  font-weight: bold;
}

.window-body {
  padding: 14px 16px;
}

.window-body h2 {
  margin: 0 0 4px;
  font-size: 13px;
}

.window-body p.note {
  color: #333;
  max-width: 70ch;
  margin: 0 0 12px;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px 24px;
}

.panel-label {
  border-bottom: 1px dotted #aaa;
  margin: 0 0 8px;
  padding-bottom: 3px;
  font-weight: bold;
}

.cite {
  color: var(--dim);
  margin-top: 6px;
  font-size: 10px;
}

.btn {
  font-family: var(--hig-font);
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: default;
  border-radius: 8px;
  height: 20px;
  padding: 0 12px;
  font-size: 12px;
}

.btn:active {
  background: var(--ink);
  color: var(--paper);
}

.btn.default {
  box-shadow: 0 0 0 1px #fff, 0 0 0 4px #000;
}

.btn.okcancel {
  width: 59px;
  padding: 0;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items:  center;
  gap: 16px;
}

.control-row {
  display: flex;
  cursor: default;
  align-items:  center;
  gap: 7px;
  padding: 3px 0;
}

.glyph {
  display: inline-block;
  border: 1px solid var(--ink);
  background: var(--paper);
  position: relative;
  flex: none;
  width: 12px;
  height: 12px;
}

.glyph.radio {
  border-radius: 50%;
}

.glyph.radio[aria-checked="true"]:after {
  content: "";
  position: absolute;
  background: var(--ink);
  border-radius: 50%;
  inset: 3px;
}

.glyph.check[aria-checked="true"]:after {
  content: "✓";
  position: absolute;
  font-size: 13px;
  line-height: 12px;
  inset: -3px 0 0 1px;
}

fieldset {
  border: 1px solid #bbb;
  margin: 0;
  padding: 8px 12px;
}

legend {
  color: #333;
  padding: 0 4px;
}

.menu-open {
  display: inline-block;
  background: var(--paper);
  border: 1px solid var(--ink);
  min-width: 180px;
  box-shadow: 2px 2px #00000073;
}

.menu-open .mtitle {
  background: #eee;
  border-bottom: 1px solid #000;
  padding: 2px 10px;
  font-weight: bold;
}

.menu-item {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 2px 10px;
}

.menu-item .keq {
  color: #333;
}

.menu-item:not([aria-disabled="true"]):hover {
  background: var(--ink);
  color: var(--paper);
}

.menu-item:not([aria-disabled="true"]):hover .keq {
  color: var(--paper);
}

.menu-item[aria-disabled="true"] {
  opacity: .4;
}

.menu-sep {
  border-top: 1px dotted #999;
  height: 0;
  margin: 2px 0;
}

.popup {
  display: inline-flex;
  border: 1px solid var(--ink);
  background: var(--paper);
  align-items:  center;
  gap: 18px;
  height: 20px;
  padding: 0 8px;
  box-shadow: 1px 1px #000;
}

.popup .tri {
  font-size: 9px;
}

.alert {
  border: 2px solid var(--ink);
  background: var(--paper);
  display: flex;
  gap: 16px;
  padding: 16px;
  box-shadow: 2px 2px #00000073;
}

.alert-icon {
  border: 2px solid var(--ink);
  display: flex;
  border-radius: 50%;
  flex: none;
  justify-content: center;
  align-items:  center;
  width: 40px;
  height: 40px;
  font-size: 26px;
  font-weight: bold;
}

.alert-body {
  flex: 1;
}

.alert-body .btn-row {
  justify-content: flex-end;
  margin-top: 14px;
}

.scroll {
  border: 1px solid var(--ink);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  width: 16px;
  height: 120px;
}

.scroll .arrow {
  border-bottom: 1px solid var(--ink);
  display: flex;
  justify-content: center;
  align-items:  center;
  height: 16px;
  font-size: 9px;
}

.scroll .arrow:last-child {
  border-bottom: 0;
  border-top: 1px solid var(--ink);
}

.scroll .track {
  position: relative;
  background: repeating-linear-gradient(45deg, #ccc 0 1px, #0000 1px 2px);
  flex: 1;
}

.scroll .thumb {
  position: absolute;
  border: 1px solid var(--ink);
  background: #ddd;
  height: 40px;
  top: 8px;
  left: 1px;
  right: 1px;
}

.scroll[data-inactive] {
  color: var(--dim);
}

.scroll[data-inactive] .track {
  background: var(--paper);
}

.field {
  display: flex;
  align-items:  center;
  gap: 8px;
  margin: 6px 0;
}

.field input {
  font-family: var(--hig-font);
  border: 1px solid var(--ink);
  height: 20px;
  padding: 2px 4px;
  font-size: 12px;
}

.probes {
  display: flex;
  flex-wrap: wrap;
  align-items:  center;
  gap: 14px;
  font-size: 11px;
}

.probe-reset {
  border: 1px solid var(--ink);
  display: inline-flex;
  cursor: pointer;
  background: #eee;
  align-items:  center;
  height: 20px;
  padding: 2px 10px;
}

.mouse-target {
  border: 1px solid var(--ink);
  background: var(--paper);
  display: inline-flex;
  align-items:  center;
  height: 28px;
  padding: 4px 14px;
}

.mouse-target[data-pressing="1"] {
  background: var(--ink);
  color: var(--paper);
}

.mouse-target[data-activated="1"] {
  background: #cfc;
}

code.kbd {
  background: #f3f3f3;
  border: 1px solid #999;
  border-radius: 3px;
  padding: 0 4px;
}

.probe-cat {
  margin-bottom: 14px;
}

.probe-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.probe-chip {
  display: flex;
  background: #fafafa;
  border: 1px solid #ccc;
  flex-direction: column;
  align-items:  center;
  gap: 3px;
  min-width: 64px;
  max-width: 150px;
  padding: 6px;
}

.probe-el {
  display: inline-flex;
  overflow: hidden;
  justify-content: center;
  align-items:  center;
  font-size: 11px;
}

.probe-el.text {
  white-space: nowrap;
  padding: 1px 4px;
  font-size: 11px;
}

.geo-box {
  border: 1px solid var(--ink);
  background: var(--paper);
  display: inline-flex;
  justify-content: center;
  align-items:  center;
  min-width: 14px;
  height: 14px;
  font-size: 9px;
}

.probe-id {
  color: #555;
  word-break: break-all;
  text-align: center;
  font-size: 9px;
  line-height: 1.1;
}

ul.principles {
  margin: 0;
  padding-left: 18px;
}

ul.principles li {
  margin: 4px 0;
}

ul.principles b {
  font-weight: bold;
}
