.fe-page {
  --term-panel: var(--p-surface);
  --term-line: var(--p-line);
  --term-ink: var(--p-ink);
  --term-muted: var(--p-muted);
  --term-accent: var(--p-lavender);
  color: var(--term-ink);
}

.fe-page .term-design-picker,
.fe-page .term-directory-card,
.fe-page .term-design-panel {
  background: var(--term-panel);
  border: 1px solid var(--term-line);
  border-radius: 10px;
}

.fe-page .term-design-picker {
  margin: 16px 0;
  padding: 15px;
}

.fe-page .term-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.fe-page .term-kicker {
  margin: 0 0 5px;
  color: var(--term-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.fe-page .term-section-heading h2,
.fe-page .term-design-panel h2 {
  margin: 0;
  color: var(--term-ink);
  font-size: 17px;
}

.fe-page .term-mode-mark {
  color: var(--term-muted);
  font: 800 10px/1.4 ui-monospace, monospace;
}

.fe-page .term-design-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.fe-page .term-design-button {
  min-height: 40px;
  padding: 7px 11px;
  border: 1px solid var(--term-line);
  border-radius: 7px;
  background: transparent;
  color: var(--term-ink);
  cursor: pointer;
  font: 800 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.fe-page .term-design-button[aria-pressed="true"] {
  border-color: var(--term-accent);
  background: var(--term-accent);
  color: #fff;
}

.fe-page .term-design-button:focus-visible,
.fe-page .term-directory a:focus-visible,
.fe-page .term-digest a:focus-visible {
  outline: 3px solid #f4bd50;
  outline-offset: 2px;
}

.fe-page .term-design-status {
  margin: 9px 0 0;
  color: var(--term-muted);
  font-size: 12px;
}

.fe-page .term-directory {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin: 16px 0;
}

.fe-page .term-directory-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 14px;
}

.fe-page .term-directory-card h2 {
  margin: 0;
  color: var(--term-ink);
  font-size: 19px;
  text-transform: uppercase;
}

.fe-page .term-directory-card p:not(.term-kicker) {
  margin: 0 0 2px;
  color: var(--term-muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.fe-page .term-directory-card a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 0;
  border-top: 1px solid var(--term-line);
  color: var(--term-ink);
  font-size: 12.5px;
  font-weight: 800;
  text-decoration: none;
}

.fe-page .term-directory-card a:hover {
  color: var(--term-accent);
}

.fe-page .term-directory-card small {
  color: var(--term-muted);
  font-size: 11px;
  line-height: 1.5;
}

.fe-page .term-design-panel {
  margin: 16px 0;
  padding: 16px;
}

.fe-page .term-design-panel > p:not(.term-kicker) {
  max-width: 76ch;
  color: var(--term-muted);
  font-size: 13px;
  line-height: 1.6;
}

.fe-page .term-digest-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.fe-page .term-digest {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--term-line);
  border-radius: 8px;
}

.fe-page .term-digest strong {
  color: var(--term-ink);
  font-size: 13px;
}

.fe-page .term-tag {
  color: var(--term-accent);
  font: 900 9px/1.4 ui-monospace, monospace;
  letter-spacing: .08em;
}

.fe-page .term-digest-value {
  width: 100%;
  overflow-wrap: anywhere;
  color: var(--term-ink);
  font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.fe-page .term-digest-state,
.fe-page .term-digest a {
  color: var(--term-muted);
  font-size: 11px;
}

.fe-page .term-digest a {
  color: var(--term-ink);
  font-weight: 800;
}

.fe-page .term-concept-note {
  padding: 10px 12px;
  border-left: 3px solid var(--term-accent);
  background: color-mix(in srgb, var(--term-accent) 8%, transparent);
}

.fe-page .term-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
  padding: 0;
  list-style: none;
  counter-reset: flow;
}

.fe-page .term-flow li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--term-line);
  border-radius: 8px;
  counter-increment: flow;
}

.fe-page .term-flow li::before {
  content: "0" counter(flow);
  color: var(--term-accent);
  font: 900 11px/1 ui-monospace, monospace;
}

.fe-page .term-flow b {
  color: var(--term-ink);
  font-size: 12px;
}

.fe-page .term-flow span {
  color: var(--term-muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.fe-page[data-design="msdos"] {
  --term-panel: #001b74;
  --term-line: #a9b7e5;
  --term-ink: #fff;
  --term-muted: #d4dcff;
  --term-accent: #f8df52;
  padding: 12px;
  background: #000080;
  color: #fff;
  font-family: "Lucida Console", "Courier New", monospace;
}

.fe-page[data-design="msdos"] .term-design-button[aria-pressed="true"] {
  color: #000080;
}

.fe-page[data-design="msdos"] .term {
  border-color: #a9b7e5;
  border-radius: 0;
  background: #000;
}

.fe-page[data-design="msdos"] .term-bar,
.fe-page[data-design="msdos"] .term-row {
  border-color: #a9b7e5;
  border-radius: 0;
  background: #001b74;
}

.fe-page[data-design="msdos"] .term-body,
.fe-page[data-design="msdos"] .term-row .ps1,
.fe-page[data-design="msdos"] .term-row input {
  color: #fff;
}

.fe-page[data-design="msdos"] .term-directory-card a,
.fe-page[data-design="msdos"] .term-digest a {
  color: #f8df52;
}

.fe-page[data-design="linux"] {
  --term-panel: #26233a;
  --term-line: #51486e;
  --term-ink: #f5f1ff;
  --term-muted: #c3b9da;
  --term-accent: #ff8a3d;
  padding: 12px;
  border-radius: 12px;
  background: #171522;
  color: #f5f1ff;
}

.fe-page[data-design="linux"] .term {
  border-color: #51486e;
  background: #191724;
}

.fe-page[data-design="linux"] .term-bar,
.fe-page[data-design="linux"] .term-row {
  border-color: #51486e;
  background: #26233a;
}

.fe-page[data-design="linux"] .term-body {
  color: #a6e3a1;
}

.fe-page[data-design="linux"] .term-directory-card a,
.fe-page[data-design="linux"] .term-digest a {
  color: #ffb86c;
}

.fe-page[data-design="web3"] {
  --term-panel: #17152d;
  --term-line: #51418a;
  --term-ink: #f0ebff;
  --term-muted: #beb4df;
  --term-accent: #a98bff;
  padding: 12px;
  border-radius: 14px;
  background: radial-gradient(ellipse at top right, #282153, #11111f 72%);
  color: #f0ebff;
}

.fe-page[data-design="web3"] .term-design-picker,
.fe-page[data-design="web3"] .term-directory-card,
.fe-page[data-design="web3"] .term-design-panel {
  box-shadow: 0 10px 30px #08061266;
}

.fe-page[data-design="web3"] .term {
  border-color: #51418a;
  background: #11111f;
}

.fe-page[data-design="web3"] .term-bar,
.fe-page[data-design="web3"] .term-row {
  border-color: #51418a;
  background: #17152d;
}

.fe-page[data-design="web3"] .term-body {
  color: #76f0d0;
}

.fe-page[data-design="web3"] .term-digest-value {
  color: #9ef6df;
}

.fe-page[data-design="web4"] {
  --term-panel: #f4f8ff;
  --term-line: #bfd0e8;
  --term-ink: #13263c;
  --term-muted: #4c627b;
  --term-accent: #2167d5;
  padding: 12px;
  border: 1px solid #d4e0ef;
  border-radius: 16px;
  background: linear-gradient(150deg, #e7f5ff, #f6f1ff 58%, #fff);
  color: #13263c;
}

.fe-page[data-design="web4"] .term {
  border-color: #bfd0e8;
  background: #101d2b;
  box-shadow: 0 14px 35px #14376022;
}

.fe-page[data-design="web4"] .term-bar,
.fe-page[data-design="web4"] .term-row {
  border-color: #28435f;
  background: #17283a;
}

.fe-page[data-design="web4"] .term-body {
  color: #b9efdf;
}

.fe-page[data-design="web4"] .term-flow li {
  border-color: #bfd0e8;
  background: #ffffffb8;
}

.fe-page[data-design="terminal"] {
  --term-panel: #07130c;
  --term-line: #1b5030;
  --term-ink: #b7f7c8;
  --term-muted: #65a87a;
  --term-accent: #42e879;
  padding: 12px;
  border: 1px solid #1b5030;
  border-radius: 4px;
  background: #030906;
  color: #b7f7c8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.fe-page[data-design="terminal"] .term-design-button[aria-pressed="true"] {
  color: #031008;
}

.fe-page[data-design="terminal"] .term-design-picker,
.fe-page[data-design="terminal"] .term-directory-card,
.fe-page[data-design="terminal"] .term-design-panel,
.fe-page[data-design="terminal"] .term-flow li {
  border-radius: 2px;
  box-shadow: 0 0 16px #23d65a18;
}

.fe-page[data-design="terminal"] .term {
  border-color: #1b5030;
  border-radius: 2px;
  background: #030906;
  box-shadow: 0 0 24px #23d65a20;
}

.fe-page[data-design="terminal"] .term-bar,
.fe-page[data-design="terminal"] .term-row {
  border-color: #1b5030;
  background: #07130c;
}

.fe-page[data-design="terminal"] .term-body,
.fe-page[data-design="terminal"] .term-row .ps1 {
  color: #42e879;
}

.fe-page[data-design="terminal"] .term-directory-card a,
.fe-page[data-design="terminal"] .term-digest a {
  color: #7bd8ff;
}

.fe-page .term-design-panel[hidden] {
  display: none;
}

@media (max-width: 760px) {
  .fe-page .term-directory {
    grid-template-columns: 1fr;
  }

  .fe-page .term-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .fe-page .term-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .fe-page .term-digest-list,
  .fe-page .term-flow {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fe-page *,
  .fe-page *::before,
  .fe-page *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
