:root {
  --bg: #f3efe3;
  --panel: rgba(255, 252, 246, 0.94);
  --panel-strong: #fffdf8;
  --line: rgba(33, 41, 52, 0.12);
  --line-strong: rgba(33, 41, 52, 0.18);
  --text: #18202b;
  --muted: #5d6776;
  --accent: #0f6d66;
  --accent-2: #c45a3d;
  --accent-soft: rgba(15, 109, 102, 0.1);
  --accent-soft-2: rgba(196, 90, 61, 0.1);
  --secret: #7f223a;
  --shadow: 0 24px 80px rgba(24, 32, 43, 0.12);
  --radius: 22px;
  --radius-sm: 14px;
  --font-main: "Avenir Next", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  --font-mono: "SFMono-Regular", "Menlo", "Monaco", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 109, 102, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(196, 90, 61, 0.16), transparent 24%),
    linear-gradient(135deg, #ebe4d2 0%, #f7f2e7 42%, #efe6d6 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(24, 32, 43, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 32, 43, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  opacity: 0.45;
}

body.drawer-open {
  overflow: hidden;
}

.portal-shell {
  position: relative;
  z-index: 1;
  width: min(1400px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar,
.hero-panel,
.overview-panel,
.main-panel,
.drawer,
.modal-card {
  backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 28px 32px;
  border-radius: var(--radius);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
}

.subtitle {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.topbar-actions,
.editor-actions,
.modal-actions,
.detail-actions,
.command-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

.accent-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.accent-btn {
  background: linear-gradient(135deg, var(--accent), #2d9a90);
  color: #fff;
  box-shadow: 0 14px 28px rgba(15, 109, 102, 0.24);
}

.accent-btn.alt {
  background: linear-gradient(135deg, var(--accent-2), #dc7d5f);
  box-shadow: 0 14px 28px rgba(196, 90, 61, 0.24);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  border: 1px solid rgba(24, 32, 43, 0.08);
}

.ghost-btn.small {
  padding: 10px 14px;
  font-size: 0.92rem;
}

.hero-panel {
  margin-top: 20px;
  padding: 22px;
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}

.hero-card {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(24, 32, 43, 0.06);
  border-radius: 18px;
  padding: 20px;
}

.hero-card.compact {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-label,
.search-label,
.overview-mini-title,
.flow-kicker,
.reply-kicker,
.section-kicker {
  margin: 0 0 12px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 700;
}

.hero-list,
.overview-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.8;
}

.search-input,
.field-block input,
.field-block select,
.field-block textarea,
#passwordInput {
  width: 100%;
  border: 1px solid rgba(24, 32, 43, 0.12);
  border-radius: 16px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
}

.search-input:focus,
.field-block input:focus,
.field-block select:focus,
.field-block textarea:focus,
#passwordInput:focus {
  outline: 2px solid rgba(15, 109, 102, 0.2);
  border-color: rgba(15, 109, 102, 0.35);
}

.search-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.overview-panel {
  margin-top: 20px;
  padding: 24px;
  border-radius: var(--radius);
}

.overview-shell {
  display: grid;
  gap: 20px;
}

.summary-matrix-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(24, 32, 43, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.summary-matrix-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.summary-matrix-head h3 {
  margin: 0;
  font-size: 1.15rem;
}

.summary-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(24, 32, 43, 0.08);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.summary-table-wrap {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(24, 32, 43, 0.08);
  background: rgba(255, 255, 255, 0.88);
}

.summary-table {
  width: 100%;
  min-width: 1020px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.summary-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 10px;
  background: rgba(247, 244, 237, 0.98);
  border-bottom: 1px solid rgba(24, 32, 43, 0.08);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

.summary-table tbody td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(24, 32, 43, 0.06);
  vertical-align: top;
}

.summary-table tbody tr:hover {
  background: rgba(15, 109, 102, 0.05);
}

.summary-section-cell,
.summary-feature-cell {
  min-width: 180px;
}

.summary-section-title,
.summary-feature-title {
  font-weight: 700;
  color: var(--text);
}

.summary-section-meta,
.summary-feature-code {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  word-break: break-all;
}

.summary-mono {
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

.summary-copy-cell {
  min-width: 200px;
  color: var(--text);
}

.summary-muted {
  color: rgba(93, 103, 118, 0.8);
}

.summary-jump {
  min-width: 72px;
}

.summary-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border-radius: 16px;
  border: 1px dashed rgba(24, 32, 43, 0.12);
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  text-align: center;
}

.overview-shell.compact-jump {
  gap: 0;
}

.compact-reminder {
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  line-height: 1.8;
}

.overview-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.overview-head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

.overview-summary {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.85;
}

.overview-source-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.overview-frame-panel {
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(255, 251, 246, 0.92));
  border: 1px solid rgba(24, 32, 43, 0.08);
}

.overview-frame-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.frame-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}

.frame-strip.inline {
  margin-top: 0;
  min-width: 520px;
}

.frame-sep {
  color: var(--muted);
  font-weight: 700;
}

.frame-seg {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 14px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: rgba(24, 32, 43, 0.08);
  border: 1px solid transparent;
}

.frame-seg.head,
.frame-seg.tail {
  background: rgba(24, 32, 43, 0.08);
}

.frame-seg.addr {
  background: rgba(196, 90, 61, 0.1);
  border-color: rgba(196, 90, 61, 0.16);
}

.frame-seg.a {
  background: rgba(15, 109, 102, 0.14);
  border-color: rgba(15, 109, 102, 0.2);
  color: var(--accent);
}

.frame-seg.b {
  background: rgba(196, 90, 61, 0.16);
  border-color: rgba(196, 90, 61, 0.22);
  color: var(--accent-2);
}

.frame-seg.len {
  background: rgba(75, 112, 166, 0.12);
  border-color: rgba(75, 112, 166, 0.18);
  color: #34598b;
}

.frame-seg.payload {
  background: rgba(57, 111, 83, 0.12);
  border-color: rgba(57, 111, 83, 0.18);
  color: #2d6848;
}

.frame-seg.sum {
  background: rgba(118, 92, 44, 0.12);
  border-color: rgba(118, 92, 44, 0.18);
  color: #7c5727;
}

.overview-focus-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.focus-box {
  padding: 16px;
  border-radius: 16px;
  background: var(--panel-strong);
  border: 1px solid rgba(24, 32, 43, 0.08);
}

.focus-box strong {
  display: block;
  margin-bottom: 6px;
}

.focus-box span {
  color: var(--muted);
  line-height: 1.7;
}

.focus-a {
  box-shadow: inset 0 0 0 1px rgba(15, 109, 102, 0.08);
}

.focus-b {
  box-shadow: inset 0 0 0 1px rgba(196, 90, 61, 0.08);
}

.focus-len {
  box-shadow: inset 0 0 0 1px rgba(75, 112, 166, 0.08);
}

.focus-payload {
  box-shadow: inset 0 0 0 1px rgba(57, 111, 83, 0.08);
}

.overview-subgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.overview-subcard {
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(24, 32, 43, 0.08);
}

.overview-subcard p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.75;
}

.overview-subcard p:last-child {
  margin-bottom: 0;
}

.encoding-workshop {
  display: grid;
  gap: 16px;
}

.encoding-topgrid,
.encoding-code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.encoding-side-note {
  padding: 18px;
  border-radius: 18px;
  background: rgba(15, 109, 102, 0.06);
  border: 1px solid rgba(15, 109, 102, 0.12);
}

.encoding-side-note p {
  margin-bottom: 10px;
}

.encoding-tip {
  color: var(--text) !important;
}

.encoding-table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(24, 32, 43, 0.08);
  background: rgba(255, 255, 255, 0.8);
}

.encoding-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

.encoding-table th,
.encoding-table td {
  padding: 12px 10px;
  border: 1px solid rgba(24, 32, 43, 0.08);
  text-align: left;
  vertical-align: top;
}

.encoding-table th {
  background: rgba(196, 90, 61, 0.08);
  font-size: 0.92rem;
}

.encoding-table code {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.encoding-bytes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.byte-pill,
.step-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(24, 32, 43, 0.06);
  border: 1px solid rgba(24, 32, 43, 0.1);
  font-family: var(--font-mono);
  font-size: 0.86rem;
}

.encoding-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.step-chip {
  max-width: 100%;
  font-family: var(--font-main);
  border-radius: 16px;
  align-items: flex-start;
}

.step-chip strong {
  color: var(--text);
}

.step-chip span {
  color: var(--muted);
  line-height: 1.7;
}

.code-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(24, 32, 43, 0.08);
}

.code-card pre {
  margin: 0;
  overflow-x: auto;
  padding: 16px;
  border-radius: 16px;
  background: #18202b;
  color: #f4f7fb;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.type-card {
  padding: 14px;
  border-radius: 16px;
  background: var(--panel-strong);
  border: 1px solid rgba(24, 32, 43, 0.08);
}

.type-card strong,
.type-card span {
  display: block;
}

.type-card span {
  margin-top: 4px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
}

.type-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.92rem;
}

.main-panel {
  margin-top: 20px;
  padding: 24px;
  border-radius: var(--radius);
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.section-header h2 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.section-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.header-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(24, 32, 43, 0.08);
}

.pill.secret {
  background: rgba(127, 34, 58, 0.12);
  color: var(--secret);
}

.section-loopback {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.command-table-panel {
  margin-top: 22px;
}

.loopback-panel,
.table-panel {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(24, 32, 43, 0.08);
}

.loopback-head,
.table-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.loopback-head h3,
.table-panel-head h3 {
  margin: 0;
  font-size: 1.15rem;
}

.loopback-table-wrap,
.command-table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(24, 32, 43, 0.08);
  background: rgba(255, 255, 255, 0.78);
}

.loopback-table,
.command-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.command-table th:nth-child(1),
.command-table td:nth-child(1) {
  width: 160px;
}

.command-table th:nth-child(2),
.command-table td:nth-child(2),
.command-table th:nth-child(3),
.command-table td:nth-child(3),
.command-table th:nth-child(4),
.command-table td:nth-child(4) {
  width: 76px;
  white-space: nowrap;
}

.command-table th:nth-child(7),
.command-table td:nth-child(7) {
  width: 150px;
}

.loopback-table th,
.loopback-table td,
.command-table th,
.command-table td {
  padding: 14px 12px;
  border: 1px solid rgba(24, 32, 43, 0.08);
  vertical-align: top;
  text-align: left;
}

.loopback-table th,
.command-table th {
  background: rgba(15, 109, 102, 0.08);
  font-size: 0.92rem;
}

.table-head-note {
  margin: 0;
  max-width: 420px;
  color: var(--muted);
  line-height: 1.75;
}

.table-code {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 126px;
}

.table-delete {
  padding: 10px 12px;
}

.payload-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px 8px 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 109, 102, 0.07);
  border: 1px solid rgba(15, 109, 102, 0.12);
  font-size: 0.88rem;
}

.payload-chip strong {
  color: var(--text);
  font-size: 0.85rem;
}

.payload-chip span,
.payload-empty,
.note-line,
.note-subline {
  color: var(--muted);
  line-height: 1.7;
}

.note-subline {
  margin-top: 8px;
  font-size: 0.92rem;
}

.flow-note {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.locked-notice,
.mini-note,
.editor-locked {
  border-radius: 18px;
  padding: 18px;
  background: rgba(127, 34, 58, 0.08);
  color: #5b2032;
  border: 1px dashed rgba(127, 34, 58, 0.28);
}

.hidden {
  display: none !important;
}

.portal-note code,
.detail-body code,
.overview-subcard code,
.overview-frame-copy code,
.flow-note code {
  font-family: var(--font-mono);
  background: rgba(24, 32, 43, 0.08);
  padding: 2px 6px;
  border-radius: 8px;
}

.detail-panel {
  margin-top: 22px;
  padding: 22px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(24, 32, 43, 0.08);
}

.detail-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.detail-toolbar h2,
.drawer-head h2,
.editor-head h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.detail-body {
  line-height: 1.85;
}

.detail-body h3,
.detail-body h4 {
  margin-top: 26px;
  margin-bottom: 10px;
}

.detail-body p,
.detail-body li {
  color: var(--muted);
}

.detail-body pre {
  overflow-x: auto;
  padding: 16px;
  border-radius: 16px;
  background: #18202b;
  color: #f4f7fb;
}

.detail-body table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 16px;
  margin: 18px 0;
}

.detail-body th,
.detail-body td {
  padding: 12px 14px;
  border: 1px solid rgba(24, 32, 43, 0.08);
  vertical-align: top;
}

.detail-body th {
  background: rgba(15, 109, 102, 0.08);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 32, 43, 0.28);
  z-index: 9;
}

.drawer {
  position: fixed;
  top: 18px;
  bottom: 18px;
  width: min(380px, calc(100vw - 28px));
  padding: 22px;
  border-radius: 24px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: transform 220ms ease;
}

.drawer-left {
  left: 18px;
  transform: translateX(calc(-100% - 30px));
}

.drawer-right {
  right: 18px;
  transform: translateX(calc(100% + 30px));
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.drawer-head p,
.editor-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.drawer-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 18px;
  padding-right: 4px;
}

.drawer-note {
  margin-top: 6px;
}

.section-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-item {
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid transparent;
}

.nav-item button {
  width: 100%;
  background: transparent;
  text-align: left;
  color: inherit;
  padding: 0;
}

.nav-item.active {
  border-color: rgba(15, 109, 102, 0.32);
  background: rgba(15, 109, 102, 0.12);
}

.nav-item.locked {
  border-color: rgba(127, 34, 58, 0.22);
}

.nav-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-weight: 700;
}

.nav-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.editor-body {
  display: grid;
  gap: 16px;
}

.field-block {
  display: grid;
  gap: 8px;
}

.field-block span {
  font-weight: 700;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.editor-subpanel {
  padding-top: 8px;
  border-top: 1px solid rgba(24, 32, 43, 0.08);
}

.editable-entry-list {
  display: grid;
  gap: 10px;
}

.editable-entry-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(24, 32, 43, 0.05);
}

.editable-entry-item strong {
  display: block;
  margin-bottom: 4px;
}

.editable-entry-item span {
  color: var(--muted);
  font-size: 0.92rem;
}

.delete-btn {
  align-self: center;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(127, 34, 58, 0.12);
  color: var(--secret);
  font-weight: 700;
}

.drawer-fab {
  position: fixed;
  top: 50%;
  z-index: 8;
  padding: 12px 16px;
  border-radius: 999px;
  box-shadow: 0 14px 28px rgba(24, 32, 43, 0.18);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(24, 32, 43, 0.08);
  font-weight: 700;
}

.drawer-fab.left {
  left: 12px;
  transform: translateY(-50%);
}

.drawer-fab.right {
  right: 12px;
  transform: translateY(-50%);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(24, 32, 43, 0.36);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 11;
}

.modal-card {
  width: min(420px, 100%);
  border-radius: 26px;
  padding: 24px;
}

.modal-card h2 {
  margin: 0 0 10px;
}

.modal-card p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.7;
}

.password-error {
  color: var(--secret) !important;
  font-weight: 700;
}

@media (max-width: 1200px) {
  .portal-shell {
    width: min(100vw - 24px, 1400px);
    padding-top: 18px;
  }

  .topbar,
  .hero-panel,
  .overview-panel,
  .main-panel {
    padding-left: 20px;
    padding-right: 20px;
  }

  .encoding-topgrid,
  .encoding-code-grid {
    grid-template-columns: 1fr;
  }

  .overview-focus-grid,
  .overview-subgrid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .portal-shell {
    width: calc(100vw - 16px);
    padding-top: 12px;
  }

  .summary-matrix-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .summary-counts {
    justify-content: flex-start;
  }

  .topbar,
  .hero-panel,
  .overview-panel,
  .main-panel {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar,
  .hero-panel,
  .overview-head,
  .section-header,
  .detail-toolbar,
  .reply-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .overview-focus-grid,
  .overview-subgrid,
  .type-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .drawer {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw;
    height: min(82vh, 760px);
    border-radius: 24px 24px 0 0;
  }

  .drawer-left,
  .drawer-right {
    transform: translateY(110%);
  }

  .drawer.open {
    transform: translateY(0);
  }

  .drawer-fab {
    top: auto;
    bottom: 14px;
    transform: none;
  }

  .drawer-fab.left {
    left: 14px;
  }

  .drawer-fab.right {
    right: 14px;
  }
}
