/* UltraPass-Website – Demo: Blatt „Weitere Optionen“, Raster der einzelnen Zeichen und
   „Vergrößern“ wie in App 1.17 (weitereOptionen.dart, schalterZeile.dart,
   zeichenRaster.dart). Maße in Punkten der App (--u, css/demo.css). */

.app__backdrop {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: rgb(0 0 0 / 0.54);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.app__screen.has-sheet .app__backdrop {
  opacity: 1;
  pointer-events: auto;
}

.app-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  border-radius: calc(24 * var(--u)) calc(24 * var(--u)) 0 0;
  background: var(--a-sheet);
}

.app-sheet[hidden] {
  display: none;
}

.app-sheet__handle {
  flex: 0 0 auto;
  width: calc(36 * var(--u));
  height: calc(4 * var(--u));
  margin: calc(8 * var(--u)) auto calc(10 * var(--u));
  border-radius: 2px;
  background: color-mix(in srgb, var(--a-text) 40%, transparent);
}

.app-sheet__head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: calc(8 * var(--u));
  padding: 0 calc(16 * var(--u)) calc(4 * var(--u)) calc(20 * var(--u));
}

.app-sheet__head:has(.app-sheet__back:not([hidden])) {
  padding-left: calc(4 * var(--u));
}

.app-sheet__back {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: calc(44 * var(--u));
  height: calc(44 * var(--u));
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--a-text);
  cursor: pointer;
}

.app-sheet__back[hidden] {
  display: none;
}

.app-sheet__back svg {
  width: calc(24 * var(--u));
  height: calc(24 * var(--u));
}

.app-sheet__titles {
  flex: 1 1 auto;
  min-width: 0;
}

.app-sheet__title {
  margin: 0;
  font-size: calc(20 * var(--u));
  font-weight: 500;
  line-height: 1.2;
  color: var(--a-text);
}

/* Der Titel bekommt beim Öffnen den Fokus nur als Startpunkt, er ist kein Bedienelement */
.app .app-sheet__title:focus-visible {
  outline: none;
}

.app-sheet__subtitle {
  margin: 0;
  font-size: calc(13 * var(--u));
  color: var(--a-muted);
}

.app-sheet__done {
  flex: 0 0 auto;
  min-height: calc(40 * var(--u));
}

.app-sheet__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 calc(16 * var(--u)) calc(28 * var(--u));
  overscroll-behavior: contain;
}

.app-sheet__group-title {
  margin: 0;
  padding: calc(16 * var(--u)) calc(4 * var(--u)) calc(2 * var(--u));
  font-size: calc(13 * var(--u));
  font-weight: 500;
  color: var(--a-muted);
}

.app-sheet__group:first-child .app-sheet__group-title {
  padding-top: calc(8 * var(--u));
}

/* Zeilen: ganze Zeile antippbar, Trennlinie darunter */
.app-row {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
  width: 100%;
  min-height: calc(64 * var(--u));
  padding: calc(8 * var(--u)) 0 calc(8 * var(--u)) calc(4 * var(--u));
  border: 0;
  border-bottom: 1px solid var(--a-line);
  background: transparent;
  color: var(--a-text);
  text-align: left;
  cursor: pointer;
}

.app-row:disabled {
  cursor: default;
}

.app-row--nav {
  min-height: calc(56 * var(--u));
  padding-right: calc(4 * var(--u));
}

.app-row__text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: calc(3 * var(--u));
  min-width: 0;
}

.app-row--nav .app-row__name {
  flex: 1 1 auto;
}

.app-row__name {
  font-size: calc(16 * var(--u));
}

.app-row:disabled .app-row__name {
  color: var(--a-muted);
}

.app-row__sub {
  font-size: calc(13 * var(--u));
  color: var(--a-muted);
}

.app-row__sub.is-reason {
  color: var(--a-reason);
}

.app-row__value {
  font-size: calc(14 * var(--u));
  color: var(--a-muted);
  text-align: right;
}

.app-row__value.is-accent {
  color: var(--a-primary);
}

.app-row__chevron {
  flex: 0 0 auto;
  width: calc(24 * var(--u));
  height: calc(24 * var(--u));
  color: var(--a-muted);
}

.app-mono {
  font-family: "Ubuntu Mono", ui-monospace, monospace;
  font-size: calc(15 * var(--u));
  letter-spacing: calc(1 * var(--u));
}

/* Switch wie auf dem iPhone (Switch.adaptive) */
.app-switch-visual {
  position: relative;
  flex: 0 0 auto;
  width: calc(51 * var(--u));
  height: calc(31 * var(--u));
  margin: 0 calc(10 * var(--u));
  border-radius: calc(16 * var(--u));
  background: var(--a-switch-off);
  transition: background-color 0.2s;
}

.app-switch-visual::after {
  content: "";
  position: absolute;
  top: calc(2 * var(--u));
  left: calc(2 * var(--u));
  width: calc(27 * var(--u));
  height: calc(27 * var(--u));
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.2);
  transition: transform 0.2s;
}

[aria-checked="true"] > .app-switch-visual {
  background: #34c759;
}

[aria-checked="true"] > .app-switch-visual::after {
  transform: translateX(calc(20 * var(--u)));
}

.app-row:disabled .app-switch-visual {
  opacity: 0.5;
}

/* Raster der einzelnen Zeichen */
.app-raster__hints {
  padding: calc(12 * var(--u)) calc(4 * var(--u)) calc(4 * var(--u));
  font-size: calc(14 * var(--u));
  line-height: 1.4;
  color: var(--a-muted);
}

.app-raster__hints p {
  margin: 0 0 calc(4 * var(--u));
}

.app-raster {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: calc(6 * var(--u));
  margin-top: calc(8 * var(--u));
}

.app-raster.is-off {
  opacity: 0.4;
}

.app-raster__cell {
  position: relative;
  display: grid;
  place-items: center;
  height: calc(48 * var(--u));
  padding: 0;
  border: 0;
  border-radius: calc(14 * var(--u));
  background: var(--a-neutral);
  color: var(--a-unselected);
  font-family: "Ubuntu Mono", ui-monospace, monospace;
  font-size: calc(20 * var(--u));
  cursor: pointer;
}

.app-raster__cell.is-on {
  background: var(--a-tonal);
  color: var(--a-primary);
  box-shadow: inset 0 0 0 calc(1.5 * var(--u)) currentColor;
}

.app-raster__cell.is-fixed {
  font-weight: 700;
}

.app-raster__cell:disabled {
  cursor: default;
}

/* Fällt durch „Nur eindeutige Zeichen“ weg: blass, ohne Fläche */
.app-raster__cell.is-locked {
  background: transparent;
  color: color-mix(in srgb, var(--a-muted) 45%, transparent);
  cursor: default;
}

.app-raster__cell.is-locked::after {
  background: linear-gradient(to bottom right, transparent calc(50% - 0.5 * var(--u)), currentColor calc(50% - 0.5 * var(--u)), currentColor calc(50% + 0.5 * var(--u)), transparent calc(50% + 0.5 * var(--u)));
}

.app-raster__all {
  margin-top: calc(10 * var(--u));
  min-height: calc(48 * var(--u));
}

/* Vergrößern */
.app-enlarge {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(60 * var(--u)) calc(24 * var(--u));
  background: var(--a-bg);
}

.app-enlarge[hidden] {
  display: none;
}

.app-enlarge__close {
  position: absolute;
  top: calc(54 * var(--u));
  right: calc(16 * var(--u));
  display: grid;
  place-items: center;
  width: calc(44 * var(--u));
  height: calc(44 * var(--u));
  border: 0;
  border-radius: 50%;
  background: var(--a-neutral);
  color: var(--a-text);
  cursor: pointer;
}

.app-enlarge__close svg {
  width: calc(24 * var(--u));
  height: calc(24 * var(--u));
}

.app-enlarge__text {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(10 * var(--u));
  margin: 0;
  font-family: "Ubuntu Mono", ui-monospace, monospace;
  font-size: calc(40 * var(--u));
  color: var(--a-text);
  overflow-wrap: anywhere;
}

.app-enlarge__text .app-pwd__group {
  padding: calc(4 * var(--u)) calc(10 * var(--u));
  border-radius: calc(10 * var(--u));
  background: var(--a-card);
}
