/* Small, keyboard-friendly side sheet. */
.settings-fab {
  align-items: center;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 50%;
  bottom: 1rem;
  color: var(--paper);
  display: grid;
  font-size: 1.15rem;
  height: 44px;
  justify-content: center;
  position: fixed;
  right: 1rem;
  width: 44px;
  z-index: 950;
}

.settings-fab:hover {
  background: var(--accent);
}
.settings-overlay {
  background: rgba(24, 20, 16, 0.5);
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transition: opacity var(--transition);
  z-index: 980;
}
.settings-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.settings-panel {
  background: var(--paper-soft);
  border-left: 1px solid var(--rule);
  bottom: 0;
  max-width: 90vw;
  overflow: auto;
  padding: 1.25rem;
  position: fixed;
  right: 0;
  top: 0;
  transform: translateX(105%);
  transition: transform var(--transition);
  width: 320px;
  z-index: 990;
}
.settings-panel.is-open {
  transform: none;
}
.settings-panel__title {
  border-bottom: var(--rule-double);
  font-size: var(--fs-xl);
  padding-bottom: 0.6rem;
}
.settings-close {
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--ink);
  float: right;
  height: 32px;
  width: 32px;
}
.settings-group {
  border-bottom: 1px solid var(--ink-rule);
  padding: 1rem 0;
}
.settings-group__label {
  color: var(--ink-muted);
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
}
.settings-seg {
  border: 1px solid var(--rule);
  display: flex;
}
.settings-seg button {
  background: var(--paper);
  border-right: 1px solid var(--rule);
  color: var(--ink);
  flex: 1;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  padding: 0.45rem 0.2rem;
  text-transform: uppercase;
}
.settings-seg button:last-child {
  border-right: 0;
}
.settings-seg button.is-selected {
  background: var(--ink);
  color: var(--paper);
}
.settings-toggle {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
}
.settings-toggle input {
  accent-color: var(--accent);
  height: 18px;
  width: 18px;
}
.settings-advanced summary {
  cursor: pointer;
  list-style: none;
}
.settings-advanced summary::-webkit-details-marker {
  display: none;
}
.font-grid,
.texture-grid {
  display: grid;
  gap: 0.35rem;
  grid-template-columns: repeat(2, 1fr);
}
.font-option,
.texture-option {
  background: var(--paper);
  border: 1px solid var(--ink-rule);
  color: var(--ink);
  padding: 0.4rem;
  text-align: left;
}
.texture-option {
  align-items: center;
  display: flex;
  gap: 0.45rem;
}
.texture-option::before {
  background: var(--paper-deep);
  border: 1px solid var(--ink-rule);
  content: "";
  display: block;
  flex: 0 0 1.3rem;
  height: 1.3rem;
}
.texture-option[data-texture="natural"]::before {
  background: #eee7d9;
}
.texture-option[data-texture="fibers"]::before {
  background: repeating-linear-gradient(135deg, #eee8dc 0 2px, #d7cdbd 2px 3px);
}
.texture-option[data-texture="rice"]::before {
  background: #f4ecd7;
}
.texture-option[data-texture="linen"]::before {
  background: repeating-linear-gradient(0deg, #ded5c8 0 2px, #c8beb1 2px 3px);
}
.texture-option[data-texture="groove"]::before {
  background: repeating-linear-gradient(90deg, #e2d5ba 0 3px, #c3ae88 3px 4px);
}
.texture-option[data-texture="wall"]::before {
  background: #cfc4ae;
}
.font-option.is-selected,
.texture-option.is-selected {
  border-color: var(--accent);
  box-shadow: inset 3px 0 var(--accent);
}
.font-option__preview {
  display: block;
  font-size: var(--fs-md);
}
