/*
 * Dapar product UI
 * One light, mobile-first visual system for every existing /dapar/ route.
 * This stylesheet changes presentation only; templates, copy and behavior stay intact.
 */

html.dap-skin-v2,
.dap-wrap {
  --dap-ink: #14263a;
  --dap-ink-soft: #334a62;
  --dap-muted: #68788b;
  --dap-navy: #12324f;
  --dap-navy-2: #193f61;
  --dap-blue: #1769e0;
  --dap-blue-dark: #0f58c4;
  --dap-blue-soft: #edf4ff;
  --dap-lime: #c5ee45;
  --dap-lime-hover: #b9e238;
  --dap-canvas: #f3f7fb;
  --dap-surface: #ffffff;
  --dap-surface-soft: #f8fafc;
  --dap-line: #dce5ee;
  --dap-line-strong: #c8d5e1;
  --dap-success: #278650;
  --dap-success-soft: #eaf7ef;
  --dap-warning: #ad6800;
  --dap-warning-soft: #fff5df;
  --dap-danger: #c63f49;
  --dap-danger-soft: #fff0f1;
  --dap-radius-sm: 11px;
  --dap-radius-md: 16px;
  --dap-radius-lg: 21px;
  --dap-shadow-card: 0 7px 24px rgba(18, 50, 79, 0.07);
  --dap-shadow-raised: 0 14px 36px rgba(18, 50, 79, 0.14);
}

html.dap-skin-v2,
html.dap-skin-v2 body,
html.dap-app-shell,
body.dap-app-shell {
  background: var(--dap-canvas);
}

.dap-wrap {
  box-sizing: border-box;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px calc(96px + env(safe-area-inset-bottom, 0px));
  direction: rtl;
  color: var(--dap-ink);
  background: transparent;
  font-family: "Heebo", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.dap-wrap *,
.dap-app-nav *,
.dap-sheet *,
.dap-calc *,
.pt-dialog * {
  box-sizing: border-box;
}

@media (min-width: 900px) {
  .dap-wrap {
    max-width: 760px;
    padding-top: 28px;
  }
}

/* Typography */
.dap-h1 {
  margin: 0 0 9px;
  color: var(--dap-navy);
  font-size: clamp(26px, 7vw, 30px);
  font-weight: 850;
  line-height: 1.16;
  letter-spacing: -0.015em;
}

.dap-sub {
  margin: 0 0 18px;
  color: var(--dap-muted);
  font-size: 15px;
  line-height: 1.58;
}

.dap-meta {
  margin-top: 10px;
  color: var(--dap-muted);
  font-size: 13px;
  line-height: 1.55;
}

.dap-sec-title,
.dap-panel-title,
.dap-lesson-group-title,
.dap-mod-title {
  color: var(--dap-navy);
  font-weight: 850;
}

.dap-sec-title {
  margin: 0 0 7px;
  font-size: 18px;
  line-height: 1.3;
}

.dap-section {
  padding-top: 14px;
}

.dap-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 2px 11px;
  color: var(--dap-navy);
  font-size: 18px;
  font-weight: 850;
}

.dap-section-title a {
  color: var(--dap-blue);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.dap-eyebrow,
.dap-mod-eyebrow {
  margin: 0 0 6px;
  color: var(--dap-blue);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.dap-when,
.dap-panel-desc,
.dap-mod-desc,
.dap-link-meta {
  color: var(--dap-muted);
}

.dap-when {
  margin: 0 0 5px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

/* Shared surfaces */
.dap-card,
.dap-mod-card,
.dap-panel-card,
.dap-path-card,
.dap-more-sheet,
.dap-more {
  border: 1px solid var(--dap-line);
  border-radius: var(--dap-radius-lg);
  background: var(--dap-surface);
  box-shadow: var(--dap-shadow-card);
}

.dap-card {
  margin-bottom: 14px;
  padding: 18px;
}

.dap-panel-card,
.dap-path-card,
.dap-mod-card {
  margin-bottom: 14px;
  padding: 18px;
}

.dap-more-sheet {
  margin: 18px 0 8px;
  overflow: hidden;
}

.dap-more-sheet > summary,
.dap-more > summary,
.dap-collapsible-sum {
  cursor: pointer;
  list-style: none;
  color: var(--dap-navy);
  font-size: 15px;
  font-weight: 800;
}

.dap-more-sheet > summary {
  padding: 14px 16px;
}

.dap-more-sheet > summary::-webkit-details-marker,
.dap-more > summary::-webkit-details-marker,
.dap-collapsible-sum::-webkit-details-marker {
  display: none;
}

.dap-more-sheet[open] > summary,
.dap-more[open] > summary {
  border-bottom: 1px solid var(--dap-line);
}

.dap-more-body {
  padding: 12px 14px 16px;
}

.dap-more {
  margin-top: 9px;
  padding: 4px 13px;
}

.dap-more > summary {
  padding: 10px 0;
}

.dap-more[open] > summary {
  margin-bottom: 8px;
}

.dap-badge {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--dap-success-soft);
  color: var(--dap-success);
  font-size: 12px;
  font-weight: 850;
}

/* Navigation */
.dap-app-nav {
  box-sizing: border-box;
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1200;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  width: 100%;
  margin: 0;
  padding: 8px 6px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--dap-line, #dce5ee);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -7px 24px rgba(18, 50, 79, 0.07);
  backdrop-filter: blur(12px);
}

.dap-app-nav-item {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  min-height: 56px;
  padding: 3px 2px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 12px;
  color: #8190a0;
  font-family: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.dap-app-nav-item:hover,
.dap-app-nav-item:focus-visible,
.dap-app-nav-item.is-active {
  color: var(--dap-blue, #1769e0);
}

.dap-app-nav-item:focus-visible {
  outline: 2px solid var(--dap-blue, #1769e0);
  outline-offset: 1px;
}

.dap-app-nav-ico {
  display: flex;
  width: 40px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  line-height: 0;
}

.dap-app-nav-item.is-active .dap-app-nav-ico {
  background: var(--dap-blue-soft, #edf4ff);
}

.dap-app-nav-item.is-active .dap-app-nav-lbl {
  color: var(--dap-blue, #1769e0);
  font-weight: 850;
}

.dap-app-nav-ico svg {
  display: block;
}

.dap-app-nav-lbl {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.15;
  text-align: center;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

@media (min-width: 900px) {
  .dap-app-nav {
    right: auto;
    left: 50%;
    width: min(760px, 100%);
    transform: translateX(-50%);
    border: 1px solid var(--dap-line, #dce5ee);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
  }
}

html.dap-focus-on .dap-app-nav,
.dap-wrap.dap-focus-on .dap-focus-hide,
html.dap-focus-on .dap-focus-hide {
  display: none !important;
}

/* Links and buttons */
.dap-links {
  display: flex;
  margin-top: 14px;
  flex-direction: column;
  gap: 10px;
}

.dap-link {
  display: block;
  padding: 14px 15px;
  border: 1px solid var(--dap-line);
  border-radius: var(--dap-radius-md);
  background: var(--dap-surface-soft);
  color: var(--dap-navy);
  font-size: 15px;
  font-weight: 750;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.dap-link:hover,
.dap-link:focus-visible {
  border-color: var(--dap-blue);
  background: var(--dap-blue-soft);
}

.dap-link:focus-visible,
.dap-cta:focus-visible,
.dap-btn:focus-visible,
.dap-opt:focus-visible,
.dap-text-btn:focus-visible,
.dap-btn-chip:focus-visible,
.dap-btn-outline:focus-visible,
.dap-fab:focus-visible,
.dap-icon-btn:focus-visible,
.dap-tool-btn:focus-visible,
.dap-mini:focus-visible,
.dap-icon-round:focus-visible,
.dap-check input:focus-visible {
  outline: 3px solid var(--dap-blue);
  outline-offset: 2px;
}

.dap-link-meta {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.dap-link.is-on,
.dap-grid .dap-link.is-on {
  border-color: var(--dap-blue);
  background: var(--dap-blue-soft);
  box-shadow: inset 0 0 0 1px var(--dap-blue);
}

.dap-cta {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--dap-blue);
  box-shadow: 0 8px 20px rgba(23, 105, 224, 0.2);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.dap-cta:hover {
  background: var(--dap-blue-dark);
  box-shadow: 0 10px 24px rgba(23, 105, 224, 0.25);
}

.dap-cta:active,
.dap-btn:active {
  transform: translateY(1px);
}

.dap-cta:disabled,
.dap-btn:disabled {
  opacity: 0.46;
  cursor: default;
  transform: none;
}

.dap-cta.secondary {
  border-color: var(--dap-line-strong);
  background: var(--dap-surface);
  box-shadow: none;
  color: var(--dap-navy);
}

.dap-cta.secondary:hover {
  border-color: var(--dap-blue);
  background: var(--dap-blue-soft);
  color: var(--dap-blue-dark);
}

.dap-cta.danger {
  border-color: var(--dap-danger);
  background: var(--dap-danger);
  box-shadow: 0 8px 20px rgba(198, 63, 73, 0.2);
  color: #fff;
}

.dap-cta.danger:hover {
  background: #ae333d;
}

.dap-cta-hero {
  min-height: 58px;
  padding: 16px 20px;
  border-radius: 15px;
  font-size: 18px;
}

.dap-btn {
  width: 100%;
  min-height: 48px;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: 850;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.dap-btn-primary {
  background: var(--dap-blue);
  color: #fff;
}

.dap-btn-next {
  background: var(--dap-lime);
  color: var(--dap-navy);
}

.dap-btn-ghost {
  border-color: var(--dap-line-strong);
  background: #fff;
  color: var(--dap-navy);
}

.dap-btn-outline {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--dap-line-strong);
  border-radius: 13px;
  background: #fff;
  color: var(--dap-navy);
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.dap-btn-outline:hover {
  border-color: var(--dap-blue);
  background: var(--dap-blue-soft);
  color: var(--dap-blue-dark);
}

.dap-btn-chip {
  display: inline-flex;
  min-height: 36px;
  padding: 7px 14px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--dap-blue);
  border-radius: 999px;
  background: var(--dap-blue);
  box-shadow: 0 4px 12px rgba(23, 105, 224, 0.18);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.dap-btn-chip:hover {
  border-color: var(--dap-blue-dark);
  background: var(--dap-blue-dark);
  color: #fff;
}

.dap-text-btn {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--dap-blue);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dap-text-danger {
  color: var(--dap-danger) !important;
}

.dap-inline,
.dap-back {
  color: var(--dap-blue);
  font-weight: 750;
  text-decoration: none;
}

.dap-inline {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dap-back {
  font-size: 14px;
}

.dap-back:hover,
.dap-inline:hover {
  color: var(--dap-blue-dark);
}

.dap-top {
  display: flex;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dap-topbar {
  display: flex;
  margin-bottom: 18px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dap-page-head {
  margin: 4px 0 16px;
}

.dap-logo {
  color: var(--dap-navy);
  font-size: 22px;
  font-weight: 850;
  text-decoration: none;
}

.dap-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--dap-blue-soft);
  color: var(--dap-blue-dark);
  font-size: 15px;
  font-weight: 850;
  place-items: center;
  text-decoration: none;
}

/* Forms */
.dap-field {
  margin: 13px 0;
}

.dap-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--dap-ink-soft);
  font-size: 13px;
  font-weight: 750;
}

.dap-field input,
.dap-field textarea,
.dap-field select,
.dap-note {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--dap-line-strong);
  border-radius: var(--dap-radius-sm);
  background: #fff;
  color: var(--dap-ink);
  font-family: inherit;
  font-size: 16px;
}

.dap-field textarea,
.dap-note {
  resize: vertical;
}

.dap-field input:focus,
.dap-field textarea:focus,
.dap-field select:focus,
.dap-note:focus {
  border-color: var(--dap-blue);
  outline: 3px solid rgba(23, 105, 224, 0.14);
}

.dap-check {
  display: flex;
  min-height: 46px;
  padding: 10px 2px;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--dap-line);
  color: var(--dap-ink);
  font-size: 14px;
  font-weight: 650;
}

.dap-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--dap-blue);
}

.dap-form-sec {
  margin-bottom: 14px;
}

.dap-form-sec-title {
  margin: 0 0 10px;
  color: var(--dap-navy);
  font-size: 17px;
  font-weight: 850;
}

.dap-danger-zone {
  border-color: #efc5c8;
  background: var(--dap-danger-soft);
}

/* Grids, lists and tables */
.dap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dap-grid .dap-link {
  min-height: 76px;
}

.dap-weak,
.dap-group-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dap-weak li,
.dap-group-list li {
  padding: 9px 0;
  border-bottom: 1px solid var(--dap-line);
  font-size: 13px;
  line-height: 1.55;
}

.dap-weak li:last-child,
.dap-group-list li:last-child {
  border-bottom: 0;
}

.dap-table-wrap {
  overflow-x: auto;
  border-radius: var(--dap-radius-md);
}

.dap-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--dap-ink);
  font-size: 14px;
}

.dap-table th,
.dap-table td {
  padding: 11px 7px;
  border-bottom: 1px solid var(--dap-line);
  text-align: right;
  vertical-align: middle;
}

.dap-table th {
  color: var(--dap-muted);
  font-size: 12px;
  font-weight: 800;
}

.dap-table tr:last-child td {
  border-bottom: 0;
}

.dap-row-pending {
  background: var(--dap-warning-soft);
}

/* Home */
.dap-home-wrap {
  max-width: 520px;
}

.dap-home-hero {
  margin-bottom: 18px;
}

.dap-home-title {
  margin: 0 0 9px;
  color: var(--dap-navy);
  font-size: 29px;
  font-weight: 850;
  line-height: 1.18;
  letter-spacing: -0.015em;
}

.dap-home-lead,
.dap-home-intro,
.dap-intro {
  color: var(--dap-muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.58;
}

.dap-home-lead {
  margin: 0 0 11px;
  font-size: 15px;
}

.dap-home-intro,
.dap-intro {
  margin: 0 0 10px;
}

.dap-intro-wrap {
  margin: 0 0 4px;
}

.dap-intro-block .dap-intro {
  margin: 0 0 10px;
}

.dap-path-card {
  position: relative;
  overflow: hidden;
  border: 0;
  background: var(--dap-navy);
  box-shadow: var(--dap-shadow-raised);
  color: #fff;
}

.dap-path-card::after {
  position: absolute;
  top: -62px;
  inset-inline-start: -50px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: var(--dap-lime);
  content: "";
  opacity: 0.1;
  pointer-events: none;
}

.dap-path-card > * {
  position: relative;
  z-index: 1;
}

.dap-path-title {
  margin: 0 0 6px;
  color: #fff;
  font-size: 23px;
  font-weight: 850;
  line-height: 1.25;
}

.dap-path-stage,
.dap-path-extra,
.dap-path-step,
.dap-path-foot,
.dap-path-tune {
  color: #cbd9e7;
}

.dap-path-stage {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.45;
}

.dap-path-extra {
  margin: -3px 0 10px;
  font-size: 13px;
}

.dap-path-bar {
  height: 8px;
  margin-bottom: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #365775;
}

.dap-path-bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--dap-lime);
}

.dap-path-step {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 650;
}

.dap-path-status {
  display: flex;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  flex-direction: column;
  gap: 3px;
  color: #fff;
  font-size: 12px;
  line-height: 1.45;
}

.dap-path-status span {
  color: #cbd9e7;
}

.dap-guided-mode {
  display: flex;
  margin-bottom: 10px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--dap-muted);
  font-size: 13px;
  line-height: 1.4;
}

.dap-mode-change {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--dap-blue);
  border-radius: 999px;
  background: #fff;
  color: var(--dap-blue);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.dap-mode-picker {
  display: grid;
  margin-bottom: 8px;
  padding: 4px;
  border: 1px solid var(--dap-line);
  border-radius: 12px;
  background: var(--dap-surface-soft);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.dap-mode-picker.is-collapsed {
  display: none;
}

.dap-mode-option {
  min-width: 0;
  padding: 9px 5px;
  border-radius: 9px;
  color: var(--dap-navy);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

.dap-mode-option:hover,
.dap-mode-option:focus-visible {
  background: #fff;
}

.dap-mode-option.is-on {
  background: var(--dap-blue);
  color: #fff;
}

.dap-mode-help {
  margin: 0 0 10px;
  color: var(--dap-muted);
  font-size: 12px;
}

@media (max-width: 390px) {
  .dap-guided-mode {
    align-items: flex-start;
    flex-direction: column;
  }

  .dap-mode-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dap-cta-path {
  border-color: var(--dap-lime);
  background: var(--dap-lime);
  box-shadow: 0 9px 22px rgba(6, 22, 35, 0.28);
  color: var(--dap-navy);
}

.dap-cta-path:hover {
  border-color: var(--dap-lime-hover);
  background: var(--dap-lime-hover);
  color: var(--dap-navy);
}

.dap-path-foot {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 550;
  text-align: center;
}

.dap-path-tune {
  margin: 14px 0 8px;
  font-size: 13px;
  line-height: 1.45;
}

.dap-path-tune-row {
  display: flex;
  margin-top: 5px;
  justify-content: flex-end;
}

.dap-path-tune-row .dap-path-tune-btn {
  width: auto;
  min-height: 34px;
  margin: 0;
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: #fff;
  font-size: 12px;
  font-weight: 750;
}

.dap-path-tune-row .dap-path-tune-btn:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.dap-panel-title {
  margin: 0 0 4px;
  font-size: 18px;
}

.dap-panel-desc {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
}

.dap-score-arena {
  padding-bottom: 18px;
}

.dap-arena-top {
  display: flex;
  margin: 11px 0 13px;
  align-items: center;
  gap: 14px;
}

.dap-arena-gauge {
  position: relative;
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
}

.dap-arena-ring {
  display: block;
  width: 100%;
  height: 100%;
}

.dap-arena-ring-bg {
  fill: none;
  stroke: #e7edf3;
  stroke-width: 8;
}

.dap-arena-ring-fg {
  fill: none;
  stroke: var(--dap-blue);
  stroke-linecap: round;
  stroke-width: 8;
  transition: stroke-dasharray 0.4s ease;
}

.dap-arena-gauge-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--dap-navy);
  line-height: 1;
}

.dap-arena-gauge-num b {
  font-size: 26px;
  font-weight: 850;
}

.dap-arena-gauge-num span {
  margin-top: 3px;
  color: var(--dap-muted);
  font-size: 12px;
  font-weight: 700;
}

.dap-arena-gauge-num .dap-arena-empty {
  color: #94a4b4;
  font-size: 22px;
}

.dap-arena-stats {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
}

.dap-arena-stat {
  display: flex;
  padding: 8px 10px;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--dap-line);
  border-radius: 12px;
  background: var(--dap-surface-soft);
}

.dap-arena-stat-lbl {
  color: var(--dap-muted);
  font-size: 12px;
  font-weight: 700;
}

.dap-arena-stat-val {
  color: var(--dap-navy);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.dap-arena-stat-val small {
  margin-inline-start: 3px;
  color: var(--dap-muted);
  font-size: 11px;
  font-weight: 600;
}

.dap-arena-stat-week {
  align-items: stretch;
  flex-direction: column;
  gap: 6px;
}

.dap-arena-stat-week .dap-arena-stat-val {
  align-self: flex-end;
}

.dap-arena-mini-bar,
.dap-arena-dom-bar,
.dap-lb-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4ebf2;
}

.dap-arena-mini-bar > i,
.dap-arena-dom-bar > i,
.dap-lb-bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--dap-blue);
}

.dap-arena-band {
  margin: 0 0 12px;
  color: var(--dap-muted);
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}

.dap-arena-domains,
.dap-arena-pending {
  display: flex;
  margin: 0;
  padding: 0;
  flex-direction: column;
  gap: 8px;
  list-style: none;
}

.dap-arena-dom {
  display: flex;
  padding: 9px 10px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--dap-line);
  border-radius: 13px;
  background: var(--dap-surface-soft);
}

.dap-arena-dom-rank {
  display: flex;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e7edf3;
  color: var(--dap-navy);
  font-size: 12px;
  font-weight: 850;
}

.dap-arena-dom-top1 .dap-arena-dom-rank { background: #f2ce5b; }
.dap-arena-dom-top2 .dap-arena-dom-rank { background: #d2dce5; }
.dap-arena-dom-top3 .dap-arena-dom-rank { background: #d8aa7e; }

.dap-arena-dom-main {
  min-width: 0;
  flex: 1 1 auto;
}

.dap-arena-dom-head {
  display: flex;
  margin-bottom: 5px;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--dap-navy);
  font-size: 13px;
  font-weight: 750;
}

.dap-arena-dom-head span {
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.dap-arena-dom-meta {
  margin-top: 4px;
  color: var(--dap-muted);
  font-size: 11px;
  font-weight: 650;
}

.dap-arena-sec-title {
  margin: 14px 0 8px;
  color: var(--dap-navy);
  font-size: 14px;
  font-weight: 850;
}

.dap-arena-pending li {
  padding: 8px 0;
  border-bottom: 1px solid var(--dap-line);
  color: var(--dap-navy);
  font-size: 13px;
  font-weight: 700;
}

.dap-home-ev-list {
  display: flex;
  margin: 0 0 13px;
  padding: 0;
  flex-direction: column;
  gap: 8px;
  list-style: none;
}

.dap-home-ev-row,
.dap-home-group-bar {
  display: flex;
  padding: 12px 13px;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--dap-line);
  border-radius: 14px;
  background: var(--dap-surface-soft);
  color: inherit;
  text-decoration: none;
}

.dap-home-ev-row:hover,
.dap-home-group-bar:hover {
  border-color: var(--dap-blue);
  background: var(--dap-blue-soft);
}

.dap-home-ev-ico,
.dap-home-group-ico {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: var(--dap-blue);
  line-height: 0;
}

.dap-home-ev-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--dap-blue-soft);
}

.dap-home-ev-body {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 3px;
}

.dap-home-ev-name,
.dap-home-group-name {
  overflow: hidden;
  color: var(--dap-navy);
  font-size: 15px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dap-home-ev-meta {
  color: var(--dap-muted);
  font-size: 12px;
  font-weight: 650;
}

.dap-home-join-cta {
  display: flex;
  width: 100%;
  max-width: none;
  margin: 8px 0 0;
  padding: 13px 16px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 14px;
}

.dap-home-join-text {
  display: flex;
  align-items: center;
  flex-direction: column;
  color: #fff;
  line-height: 1.2;
}

.dap-home-join-line1 { font-size: 16px; font-weight: 850; }
.dap-home-join-line2 { margin-top: 2px; font-size: 13px; font-weight: 600; opacity: 0.92; }

.dap-home-join-ico {
  display: flex;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  color: #fff;
  line-height: 0;
}

.dap-home-group-block {
  margin-top: 14px;
}

.dap-home-group-block:first-of-type {
  margin-top: 8px;
}

.dap-home-group-bar {
  margin-bottom: 10px;
}

.dap-home-group-name {
  min-width: 0;
  flex: 1 1 auto;
}

.dap-home-chev {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: var(--dap-blue);
  line-height: 0;
}

.dap-save-tab {
  position: fixed;
  top: 34%;
  left: 0;
  z-index: 1250;
  display: flex;
  min-width: 44px;
  padding: 11px 8px 10px;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--dap-line);
  border-left: 0;
  border-radius: 0 14px 14px 0;
  background: #fff;
  box-shadow: 4px 8px 20px rgba(18, 50, 79, 0.12);
  color: var(--dap-blue);
  text-decoration: none;
}

.dap-save-tab-label {
  padding: 2px 0;
  color: inherit;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  line-height: 1.1;
  transform: rotate(180deg);
  writing-mode: vertical-rl;
}

.dap-save-tab-ico { display: flex; line-height: 0; }
.dap-save-tab-chev { color: #94a4b4; font-size: 16px; font-weight: 750; line-height: 1; }
html.dap-focus-on .dap-save-tab { display: none !important; }

/* Training, lessons and information cards */
.dap-mod-card {
  padding: 19px;
}

.dap-mod-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.dap-mod-card-link:hover {
  border-color: var(--dap-blue);
  box-shadow: 0 10px 28px rgba(18, 50, 79, 0.1);
}

.dap-mod-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 13px;
}

.dap-mod-title {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.3;
}

.dap-mod-desc {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.dap-mod-ico {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  color: var(--dap-blue);
  opacity: 0.95;
}

.dap-mod-ico svg {
  width: 48px;
  height: 48px;
}

/* Existing train destination cards have equal visual weight. */
.dap-mod-card > .dap-cta,
.dap-mod-card > .dap-cta.secondary {
  border-color: var(--dap-blue);
  background: var(--dap-blue);
  box-shadow: 0 8px 20px rgba(23, 105, 224, 0.2);
  color: #fff;
}

.dap-mod-card > .dap-cta:hover,
.dap-mod-card > .dap-cta.secondary:hover {
  border-color: var(--dap-blue-dark);
  background: var(--dap-blue-dark);
  color: #fff;
}

.dap-lesson-group {
  margin-bottom: 18px;
}

.dap-lesson-group-title {
  margin: 0 2px 8px;
  font-size: 15px;
}

.dap-done-mark {
  margin-left: 6px;
  color: var(--dap-success);
  font-weight: 850;
}

.dap-how-list {
  margin: 8px 0 0;
  padding: 0 20px 0 0;
  color: var(--dap-ink-soft);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
}

.dap-how-list li {
  margin-bottom: 8px;
  padding-inline-start: 3px;
}

/* Progress and results */
.dap-progress {
  height: 7px;
  margin-bottom: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4ebf2;
}

.dap-progress > i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--dap-blue);
  transition: width 0.22s ease;
}

.dap-mot-bar {
  display: flex;
  margin-bottom: 11px;
  flex-direction: column;
  gap: 8px;
}

.dap-mot-chip,
.dap-auth-bar {
  display: flex;
  padding: 10px 12px;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  border: 1px solid #d5e3f3;
  border-radius: 13px;
  background: var(--dap-blue-soft);
  color: var(--dap-navy);
  font-size: 13px;
  font-weight: 750;
}

.dap-mot-ico { font-size: 16px; line-height: 1; }
.dap-mot-main { font-size: 14px; }
.dap-mot-explain { flex: 1 1 100%; color: var(--dap-muted); font-size: 12px; font-weight: 500; line-height: 1.45; }
.dap-goal-bar { height: 8px; margin-bottom: 14px; }

.dap-auth-bar {
  margin-bottom: 14px;
  align-items: center;
  border-color: #cce5d6;
  background: var(--dap-success-soft);
}

.dap-auth-link { color: var(--dap-success); font-size: 15px; font-weight: 850; text-decoration: none; }
.dap-auth-hint, .dap-auth-count { color: #466a54; font-size: 12px; font-weight: 650; }
.dap-auth-cta { align-items: stretch; flex-direction: column; }
.dap-auth-cta-main .dap-cta { font-size: 16px; }
.dap-auth-cta-sub { margin: 8px 0 0; color: #466a54; font-size: 13px; font-weight: 600; line-height: 1.45; text-align: center; }

.dap-podium {
  display: flex;
  min-height: 140px;
  margin: 4px 0 16px;
  padding: 8px 4px 0;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
}

.dap-podium-slot {
  display: flex;
  min-width: 0;
  flex: 1 1 0;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

.dap-podium-medal {
  display: flex;
  width: 28px;
  height: 28px;
  margin-bottom: 6px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--dap-navy);
  font-size: 13px;
  font-weight: 850;
}

.dap-podium-1 .dap-podium-medal { width: 34px; height: 34px; background: #f2ce5b; font-size: 15px; }
.dap-podium-2 .dap-podium-medal { background: #d2dce5; }
.dap-podium-3 .dap-podium-medal { background: #d8aa7e; }
.dap-podium-pct { color: var(--dap-navy); font-size: 18px; font-variant-numeric: tabular-nums; font-weight: 850; line-height: 1.1; }
.dap-podium-1 .dap-podium-pct { font-size: 22px; }
.dap-podium-name { display: -webkit-box; max-width: 100%; margin: 4px 2px 8px; overflow: hidden; color: var(--dap-muted); font-size: 11px; font-weight: 700; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.dap-podium-stand { width: 100%; border-radius: 10px 10px 4px 4px; background: #d9e8fa; }
.dap-podium-1 .dap-podium-stand { height: 72px; background: #f2d978; }
.dap-podium-2 .dap-podium-stand { height: 52px; background: #dbe3ea; }
.dap-podium-3 .dap-podium-stand { height: 40px; background: #dfb991; }

/* Practice, diagnosis and simulation */
.dap-session-shell {
  max-width: min(760px, 100%);
  min-height: 100dvh;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

.dap-qhead {
  display: flex;
  margin-bottom: 11px;
  align-items: center;
  justify-content: space-between;
  color: var(--dap-muted);
  font-size: 13px;
  font-weight: 700;
}

.dap-qhead-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dap-timer {
  padding: 4px 11px;
  border: 1px solid var(--dap-line-strong);
  border-radius: 999px;
  color: var(--dap-navy);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.dap-timer.warn {
  border-color: var(--dap-danger);
  color: var(--dap-danger);
}

.dap-stem,
.dap-q-stem {
  margin: 10px 0 15px;
  color: var(--dap-ink);
  font-size: 18px;
  font-weight: 750;
  line-height: 1.5;
}

.dap-passage {
  margin-bottom: 13px;
  padding: 13px;
  border: 1px solid var(--dap-line);
  border-radius: 13px;
  background: var(--dap-surface-soft);
  color: var(--dap-ink-soft);
  font-size: 14px;
  line-height: 1.7;
}

.dap-opts {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.dap-opt {
  width: 100%;
  min-height: 56px;
  padding: 14px;
  border: 2px solid var(--dap-line-strong);
  border-radius: 15px;
  background: #fff;
  color: var(--dap-navy);
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  text-align: right;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dap-opt:hover:not(:disabled) {
  border-color: var(--dap-blue);
  background: var(--dap-blue-soft);
}

.dap-opt.sel {
  border-color: var(--dap-blue);
  background: var(--dap-blue-soft);
}

.dap-opt.correct {
  border-color: var(--dap-success);
  background: var(--dap-success-soft);
  color: var(--dap-success);
}

.dap-opt.wrong {
  border-color: var(--dap-danger);
  background: var(--dap-danger-soft);
  color: var(--dap-danger);
}

.dap-opt:disabled {
  cursor: default;
}

.dap-actions {
  display: flex;
  margin-top: 16px;
  flex-direction: column;
  gap: 8px;
}

.dap-fb {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.65;
}

.dap-fb.ok { color: var(--dap-success); font-weight: 750; }
.dap-fb.bad { color: var(--dap-danger); font-weight: 750; }
.dap-fb[aria-live] { outline: none; }
.dap-fb-status { display: inline-flex; align-items: center; gap: 6px; }
.dap-exp { margin-top: 8px; color: var(--dap-ink-soft); font-weight: 500; }
.dap-why-choice,
.dap-faster,
.dap-elim,
.dap-sanity,
.dap-shape-steps {
  margin-top: 8px;
  color: var(--dap-ink-soft);
  font-weight: 500;
}

.dap-followup {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #cddff3;
  border-radius: 13px;
  background: var(--dap-blue-soft);
}

.dap-followup-title {
  margin-bottom: 4px;
  color: var(--dap-blue-dark);
  font-size: 13px;
}

.dap-followup-fb {
  margin-top: 9px;
  font-size: 13px;
  font-weight: 750;
}

.dap-followup-fb.ok { color: var(--dap-success); }
.dap-followup-fb.bad { color: var(--dap-danger); }
.dap-opt-num { color: var(--dap-blue-dark); font-weight: 850; }

.dap-rule,
.dap-hint,
.dap-why,
.dap-steps {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--dap-line);
  border-radius: 11px;
  background: var(--dap-surface-soft);
  color: var(--dap-ink-soft);
  font-size: 13px;
  font-weight: 500;
}

.dap-rule,
.dap-hint { border-color: #eed7a7; background: var(--dap-warning-soft); }
.dap-why { border-color: #efc5c8; background: var(--dap-danger-soft); color: #7d3339; }
.dap-steps { border-color: #cddff3; background: var(--dap-blue-soft); }

.dap-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 10px;
  border: 1px solid var(--dap-line);
  border-radius: 13px;
  background: var(--dap-surface-soft);
}

.dap-exam-tools {
  display: flex;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.dap-tool-btn,
.dap-icon-btn,
.dap-report-btn {
  border: 1px solid var(--dap-line-strong);
  border-radius: 11px;
  background: #fff;
  color: var(--dap-navy);
  cursor: pointer;
  font-family: inherit;
  font-weight: 750;
}

.dap-tool-btn { padding: 8px 12px; font-size: 13px; }
.dap-icon-btn { width: 36px; height: 36px; font-size: 18px; line-height: 1; }
.dap-report-btn { display: block; width: 100%; margin-top: 12px; padding: 12px; border-style: dashed; font-size: 14px; }
.dap-tool-btn:hover, .dap-icon-btn:hover, .dap-report-btn:hover { border-color: var(--dap-blue); background: var(--dap-blue-soft); }

.dap-band {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #cddff3;
  border-radius: 13px;
  background: var(--dap-blue-soft);
}

.dap-band-label { margin-bottom: 4px; color: var(--dap-navy); font-size: 15px; font-weight: 750; }
.dap-keyhint { margin-top: 8px; color: var(--dap-muted); font-size: 12px; font-weight: 650; }
.dap-break .dap-h1 { margin-top: 0; }

.dap-focus-only { display: none; width: 100%; margin-top: 10px; text-align: center; }
.dap-wrap.dap-focus-on .dap-focus-only { display: block; }
.dap-wrap.dap-focus-on .dap-home-sub { display: none; }

/* Groups, events and leaderboards */
.dap-fab {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  left: 18px;
  z-index: 1210;
  display: flex;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--dap-blue);
  box-shadow: 0 9px 24px rgba(23, 105, 224, 0.3);
  color: #fff;
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
  text-decoration: none;
}

.dap-fab:hover { background: var(--dap-blue-dark); color: #fff; }

.dap-group-entry-list,
.dap-lb,
.dap-lb-pending-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dap-group-entry {
  display: flex;
  padding: 12px 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--dap-line);
}

.dap-group-entry:last-child { border-bottom: 0; }
.dap-group-entry-info { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.dap-group-entry-info b { color: var(--dap-navy); font-size: 15px; }

.dap-group-head-row {
  display: flex;
  margin-bottom: 12px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.dap-group-icon-acts { display: flex; flex: 0 0 auto; gap: 8px; }

.dap-icon-round {
  display: inline-flex;
  width: 44px;
  height: 44px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--dap-blue);
  box-shadow: 0 6px 16px rgba(23, 105, 224, 0.25);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
}

.dap-icon-round:hover { background: var(--dap-blue-dark); }
.dap-icon-share { font-size: 0; }
.dap-icon-share svg { display: block; }

.dap-lb {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dap-lb-row {
  display: flex;
  padding: 10px 12px;
  align-items: stretch;
  gap: 10px;
  border: 1px solid var(--dap-line);
  border-radius: 14px;
  background: var(--dap-surface-soft);
}

.dap-lb-top1 { border-color: #ecd68b; background: #fff9e8; }
.dap-lb-top2 { border-color: #d4dde6; background: #f7f9fb; }
.dap-lb-top3 { border-color: #e3cfbe; background: #fcf8f4; }
.dap-lb-you { box-shadow: inset 0 0 0 2px var(--dap-blue); }

.dap-lb-rank {
  display: flex;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  align-self: center;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e4ebf2;
  color: var(--dap-navy);
  font-size: 14px;
  font-weight: 850;
}

.dap-lb-top1 .dap-lb-rank { background: #f2ce5b; }
.dap-lb-top2 .dap-lb-rank { background: #d2dce5; }
.dap-lb-top3 .dap-lb-rank { background: #d8aa7e; }
.dap-lb-main { min-width: 0; flex: 1 1 auto; }
.dap-lb-name { margin-bottom: 6px; color: var(--dap-navy); font-size: 14px; font-weight: 850; }
.dap-lb-badge { display: inline-block; margin-right: 4px; padding: 2px 8px; border-radius: 999px; background: var(--dap-blue-soft); color: var(--dap-blue); font-size: 11px; font-weight: 850; vertical-align: middle; }
.dap-lb-meta { color: var(--dap-muted); font-size: 12px; font-weight: 650; }
.dap-lb-pending { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--dap-line-strong); }
.dap-lb-pending-title { margin: 0 0 8px; color: var(--dap-muted); font-size: 13px; font-weight: 850; }
.dap-lb-pending-list li { display: flex; padding: 6px 0; align-items: center; gap: 8px; color: var(--dap-navy); font-size: 13px; font-weight: 650; }
.dap-lb-pending-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #e7a823; }
.dap-lb-invited-dot { background: var(--dap-blue); }

.dap-admin-panel { margin-top: 8px; }
.dap-admin-row { display: flex; padding: 8px 0; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--dap-line); font-size: 13px; font-weight: 650; }
.dap-admin-row:last-child { border-bottom: 0; }
.dap-admin-row .dap-admin-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

.dap-mini {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--dap-line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--dap-navy);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.dap-mini:hover { border-color: var(--dap-blue); background: var(--dap-blue-soft); }
.dap-mini.danger { border-color: #e5b6ba; color: var(--dap-danger); }
.dap-share-link { margin: 8px 0 14px; padding: 10px; border: 1px solid var(--dap-line); border-radius: 10px; background: var(--dap-surface-soft); color: var(--dap-navy); font-size: 13px; font-weight: 700; word-break: break-all; }
.dap-delete-soft { margin: 8px 0 20px; text-align: center; }

.dap-leader-table { width: 100%; font-size: 14px; }
.dap-leader-table th, .dap-leader-table td { padding: 9px 6px; text-align: right; }
.dap-leader-big { font-size: 17px; }
.dap-leader-big th, .dap-leader-big td { padding: 12px 8px; }
.dap-fs-board { max-width: 960px; }

/* Live host and clicker */
.dap-live-host {
  box-sizing: border-box;
  width: 100%;
  max-width: 1040px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 22px 18px calc(24px + env(safe-area-inset-bottom, 0px));
  background: var(--dap-canvas);
  color: var(--dap-ink);
  font-family: "Heebo", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.dap-live-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dap-live-pin {
  color: var(--dap-navy);
  font-size: clamp(30px, 8vw, 44px);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.dap-live-qr {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  padding: 11px;
  border: 1px solid var(--dap-line);
  border-radius: var(--dap-radius-md);
  background: #fff;
  box-shadow: var(--dap-shadow-card);
  text-align: center;
}

.dap-live-qr .dap-meta { max-width: 100%; color: var(--dap-muted); overflow-wrap: anywhere; }
.dap-live-title { margin: 20px 0 12px; color: var(--dap-navy); font-size: 26px; font-weight: 850; }

.dap-live-body {
  min-height: 42vh;
  padding: 20px;
  border: 1px solid var(--dap-line);
  border-radius: var(--dap-radius-lg);
  background: #fff;
  box-shadow: var(--dap-shadow-card);
}

.dap-live-stem { margin: 12px 0 20px; color: var(--dap-ink); font-size: clamp(21px, 4vw, 28px); font-weight: 800; line-height: 1.45; }
.dap-live-qmeta, .dap-live-hint { color: var(--dap-muted); font-weight: 700; }
.dap-live-qmeta { margin-bottom: 8px; }

.dap-live-opt {
  display: flex;
  margin: 9px 0;
  padding: 14px 16px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--dap-line);
  border-radius: var(--dap-radius-md);
  background: var(--dap-surface-soft);
  color: var(--dap-ink);
  font-size: 18px;
}

.dap-live-num {
  display: flex;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--dap-lime);
  color: var(--dap-navy);
  font-weight: 850;
}

.dap-live-players {
  display: flex;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
}

.dap-live-players li {
  padding: 8px 14px;
  border: 1px solid var(--dap-line);
  border-radius: 999px;
  background: var(--dap-blue-soft);
  color: var(--dap-navy);
  font-weight: 750;
}

.dap-live-controls {
  position: sticky;
  bottom: 0;
  display: flex;
  margin-top: 18px;
  padding: 12px 0 calc(2px + env(safe-area-inset-bottom, 0px));
  flex-wrap: wrap;
  gap: 10px;
  background: linear-gradient(to top, var(--dap-canvas) 78%, rgba(243, 247, 251, 0));
}

.dap-live-controls .dap-cta {
  width: auto;
  min-width: 140px;
  flex: 1 1 160px;
}

.dap-click-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
  gap: 12px;
}

.dap-click-btn {
  min-height: 120px;
  border: 0;
  border-radius: var(--dap-radius-md);
  box-shadow: 0 8px 18px rgba(18, 50, 79, 0.13);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 42px;
  font-weight: 900;
}

/* Sheets, calculator and dialogs */
.dap-sheet {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  padding: 12px;
  align-items: flex-end;
  justify-content: center;
  background: rgba(9, 29, 47, 0.5);
}

.dap-sheet-panel {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--dap-line);
  border-radius: 19px 19px 13px 13px;
  background: #fff;
  box-shadow: 0 -10px 36px rgba(9, 29, 47, 0.2);
}

.dap-sheet-title { margin-bottom: 8px; color: var(--dap-navy); font-size: 18px; font-weight: 850; }
.dap-radio { display: block; padding: 10px 4px; border-bottom: 1px solid var(--dap-line); font-size: 14px; font-weight: 650; }

.dap-calc {
  position: fixed;
  bottom: 16px;
  left: 50%;
  z-index: 9000;
  width: min(320px, 92vw);
  padding: 12px;
  transform: translateX(-50%);
  border: 1px solid var(--dap-line-strong);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(18, 50, 79, 0.22);
}

.dap-calc-head { display: flex; margin-bottom: 8px; align-items: center; justify-content: space-between; color: var(--dap-navy); font-weight: 850; }
.dap-calc-x { border: 0; background: transparent; cursor: pointer; font-size: 18px; }
.dap-calc-display { width: 100%; margin-bottom: 8px; padding: 12px; border: 1px solid var(--dap-line-strong); border-radius: 10px; font-size: 22px; font-variant-numeric: tabular-nums; font-weight: 750; text-align: left; }
.dap-calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dap-calc-key { padding: 12px 0; border: 1px solid var(--dap-line); border-radius: 10px; background: var(--dap-surface-soft); color: var(--dap-navy); cursor: pointer; font-family: inherit; font-size: 16px; font-weight: 750; }

.pt-dialog {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  padding: 20px;
  align-items: center;
  justify-content: center;
}

.pt-dialog.open { display: flex; }
.pt-dialog-backdrop { position: absolute; inset: 0; background: rgba(9, 29, 47, 0.5); }
.pt-dialog-card { position: relative; width: 100%; max-width: 400px; padding: 22px; border: 1px solid var(--dap-line); border-radius: 18px; background: #fff; box-shadow: 0 14px 42px rgba(9, 29, 47, 0.22); direction: rtl; text-align: right; }
.pt-dialog-title { margin: 0 0 10px; color: var(--dap-navy); font-size: 18px; font-weight: 850; }
.pt-dialog-body { margin: 0 0 18px; color: var(--dap-muted); font-size: 15px; line-height: 1.6; white-space: pre-line; }
.pt-dialog-actions { display: flex; justify-content: flex-start; gap: 10px; }
.pt-dialog-btn { min-height: 42px; padding: 9px 19px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 750; }
.pt-dialog-ok { background: var(--dap-blue); color: #fff; }
.pt-dialog-cancel { border-color: var(--dap-line); background: #fff; color: var(--dap-muted); }

/* Small reusable patterns retained by existing templates */
.dap-ai { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--dap-line-strong); }
.dap-ai-report { margin: 10px 0; padding: 14px; border: 1px solid var(--dap-line); border-radius: 11px; background: var(--dap-surface-soft); font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.dap-guest { margin-bottom: 12px; padding: 10px; border: 1px solid #eed7a7; border-radius: 11px; background: var(--dap-warning-soft); color: #77521d; font-size: 12px; }
.dap-ver { margin-top: 20px; color: var(--dap-muted); font-size: 11px; opacity: 0.65; text-align: center; }
.dap-start-block { margin-top: 12px; padding-top: 4px; }
.dap-start-next { margin: 10px 0 0; color: var(--dap-navy); font-size: 14px; font-weight: 750; line-height: 1.45; text-align: center; }
.dap-start-extra { margin: 4px 0 0; color: var(--dap-muted); font-size: 13px; font-weight: 500; line-height: 1.4; text-align: center; }
.dap-start-hint { margin: 8px 0 0; color: var(--dap-muted); font-size: 12px; text-align: center; }
.dap-cta-sub { margin-top: 6px; font-size: 13px; font-weight: 600; line-height: 1.4; opacity: 0.92; }
.dap-cta-extra { margin-top: 4px; font-size: 12px; font-weight: 500; opacity: 0.85; }
.dap-collapsible { padding-top: 10px; }
.dap-collapsible-sum { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dap-collapsible-hint { color: var(--dap-muted); font-size: 12px; font-weight: 650; }

/* Accessibility modes */
html.dap-a11y-lg .dap-wrap,
body.dap-a11y-lg .dap-wrap { font-size: 18px; }
html.dap-a11y-lg .dap-stem,
body.dap-a11y-lg .dap-stem { font-size: 20px; }
html.dap-a11y-lg .dap-opt,
body.dap-a11y-lg .dap-opt { padding: 16px 14px; font-size: 17px; }

html.dap-a11y-hc .dap-wrap,
body.dap-a11y-hc .dap-wrap { background: #fff; color: #000; }
html.dap-a11y-hc .dap-card,
body.dap-a11y-hc .dap-card { border-color: #000; background: #fff; box-shadow: none; }
html.dap-a11y-hc .dap-opt,
body.dap-a11y-hc .dap-opt { border-color: #000; background: #fff; color: #000; }
html.dap-a11y-hc .dap-opt.sel,
body.dap-a11y-hc .dap-opt.sel { background: #e8e8e8; outline: 3px solid #000; }
html.dap-a11y-hc .dap-opt.correct,
body.dap-a11y-hc .dap-opt.correct { background: #dff0df; outline: 3px solid #006600; }
html.dap-a11y-hc .dap-opt.wrong,
body.dap-a11y-hc .dap-opt.wrong { background: #f5d0d0; outline: 3px solid #990000; }
html.dap-a11y-hc .dap-cta,
body.dap-a11y-hc .dap-cta,
html.dap-a11y-hc .dap-btn-primary,
body.dap-a11y-hc .dap-btn-primary { background: #000; box-shadow: none; color: #fff; }
html.dap-a11y-hc .dap-fb.ok,
body.dap-a11y-hc .dap-fb.ok { color: #006600; }
html.dap-a11y-hc .dap-fb.bad,
body.dap-a11y-hc .dap-fb.bad { color: #990000; }

html.dap-a11y-dyslexia .dap-wrap,
body.dap-a11y-dyslexia .dap-wrap {
  font-family: "Comic Sans MS", "OpenDyslexic", Tahoma, Arial, sans-serif;
  line-height: 1.7;
  letter-spacing: 0.03em;
}

html.dap-a11y-calm .dap-badge,
body.dap-a11y-calm .dap-badge,
html.dap-a11y-calm .dap-mot-ico,
body.dap-a11y-calm .dap-mot-ico { display: none; }
html.dap-a11y-calm .dap-mot-bar,
body.dap-a11y-calm .dap-mot-bar { gap: 4px; }
html.dap-a11y-calm .dap-card,
body.dap-a11y-calm .dap-card { box-shadow: none; }
html.dap-a11y-noanim *,
body.dap-a11y-noanim * { animation: none !important; transition: none !important; }

@media (max-width: 380px) {
  .dap-grid { grid-template-columns: 1fr; }
  .dap-home-title { font-size: 26px; }
  .dap-arena-top { align-items: stretch; flex-direction: column; }
  .dap-arena-gauge { align-self: center; }
  .dap-live-top { align-items: stretch; flex-direction: column; }
  .dap-live-qr { align-self: center; }
}

@media (min-width: 520px) {
  .dap-sheet { align-items: center; }
  .dap-sheet-panel { border-radius: 18px; }
}

@media (min-width: 900px) {
  .dap-session-shell { max-width: 860px; padding-top: 28px; }
  .dap-live-host { padding: 30px 28px; }
  .dap-live-body { padding: 26px; }
}

/* Centered busy overlay for slow API / background calls */
.dap-busy {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 38, 58, 0.28);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  direction: rtl;
}
.dap-busy.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.dap-busy-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 140px;
  padding: 26px 34px;
  border-radius: var(--dap-radius-lg, 21px);
  background: var(--dap-surface, #fff);
  box-shadow: var(--dap-shadow-raised, 0 14px 36px rgba(18, 50, 79, 0.14));
  transform: translateY(8px) scale(0.96);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.dap-busy.is-visible .dap-busy-card {
  transform: translateY(0) scale(1);
}
.dap-busy-ring {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(23, 105, 224, 0.16);
  border-top-color: var(--dap-blue, #1769e0);
  animation: dap-busy-spin 0.75s linear infinite;
}
.dap-busy-label {
  color: var(--dap-ink-soft, #334a62);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
@keyframes dap-busy-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .dap-cta,
  .dap-btn,
  .dap-opt,
  .dap-progress > i,
  .dap-arena-ring-fg { transition: none; }
  .dap-busy,
  .dap-busy-card { transition: none; }
  .dap-busy-ring { animation: none; border-top-color: var(--dap-blue, #1769e0); }
}
