:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #f8faf9;
  --ink: #17201d;
  --muted: #66736f;
  --quiet: #8a9692;
  --line: #dce3e0;
  --line-strong: #c3ccc8;
  --green: #17684f;
  --green-soft: #eaf6f0;
  --blue: #285e9f;
  --blue-soft: #eaf1fb;
  --amber: #a46312;
  --red: #9d3c33;
  --shadow: 0 10px 30px rgba(21, 32, 29, 0.08);
  --radius: 8px;
  --topbar: 66px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.doc-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(320px, 760px) auto;
  gap: 18px;
  align-items: center;
  min-height: var(--topbar);
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.brand-block {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
  font-weight: 900;
  letter-spacing: 0;
  flex: 0 0 auto;
}

.brand-block h1 {
  font-size: 16px;
  line-height: 1.2;
}

.brand-block p,
.sidebar-section label,
.summary-grid span,
.resource-heading p,
.column-header p,
.detail-meta,
.small-note,
.topbar p {
  color: var(--muted);
  font-size: 13px;
}

.top-search {
  width: 100%;
}

.top-actions,
.toolbar,
.link-list,
.day-card-top,
.resource-link,
.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions {
  justify-content: flex-end;
}

.secondary-button.mobile-nav-button,
.secondary-button.mobile-header-nav-button,
.sidebar-mobile-header,
.nav-backdrop {
  display: none;
}

.doc-layout {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(250px, 300px);
  align-items: start;
  min-height: calc(100vh - var(--topbar));
}

.sidebar,
.context-rail {
  position: sticky;
  top: var(--topbar);
  height: calc(100vh - var(--topbar));
  overflow-y: auto;
  background: #fbfcfd;
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 18px 16px 24px;
}

.context-rail {
  border-left: 1px solid var(--line);
  padding: 18px 16px 24px;
}

.main-panel {
  min-width: 0;
  padding: 26px 24px 54px;
}

.topbar,
.summary-grid,
.workspace,
.reader-view {
  max-width: 1040px;
  margin-inline: auto;
}

.topbar {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.eyebrow {
  display: block;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 7px;
}

.topbar h2 {
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: 0;
}

.topbar p {
  max-width: 780px;
  line-height: 1.6;
  margin-top: 8px;
}

.progress-card,
.rail-card,
.resource-card,
.detail-card,
.summary-grid article,
.learning-page {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.progress-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  margin-bottom: 18px;
}

.progress-ring {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 54%, transparent 56%),
    conic-gradient(var(--green) var(--progress, 0deg), #dfe7e2 0deg);
  font-size: 13px;
  font-weight: 900;
}

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

.progress-card strong {
  font-size: 14px;
}

.progress-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.sidebar-section {
  margin-top: 18px;
}

.sidebar-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

.phase-list {
  display: grid;
  gap: 4px;
}

.phase-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  padding: 7px 9px;
  text-align: left;
}

.phase-button:hover,
.phase-button.active {
  border-color: var(--line);
  background: var(--green-soft);
}

.phase-button span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phase-button span:last-child {
  color: var(--muted);
  font-size: 12px;
  flex: 0 0 auto;
}

select,
input[type="search"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
}

select {
  min-height: 38px;
  padding: 0 10px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 0 10px;
}

.search-box:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 104, 79, 0.12);
}

.search-box input {
  min-height: 42px;
  border: 0;
  outline: 0;
  padding: 0;
}

.primary-button,
.secondary-button,
.ghost-button,
.inline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border-radius: var(--radius);
  padding: 0 13px;
  font-weight: 900;
}

.primary-button {
  border: 1px solid var(--green);
  background: var(--green);
  color: white;
}

.secondary-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.ghost-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}

.icon-button {
  width: 38px;
  padding: 0;
}

.full {
  width: 100%;
  margin-top: 8px;
}

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

.summary-grid article {
  padding: 15px;
  box-shadow: none;
}

.summary-grid strong {
  display: block;
  margin: 6px 0;
  font-size: 15px;
}

.summary-grid p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.workspace {
  display: block;
}

.main-panel.reader-open .topbar,
.main-panel.reader-open .summary-grid,
.main-panel.reader-open .workspace {
  display: none;
}

.hidden {
  display: none !important;
}

.day-nav {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.column-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.column-header h3,
.resource-heading h3 {
  font-size: 15px;
}

.all-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.day-list {
  display: grid;
  gap: 2px;
}

.day-group {
  border-radius: var(--radius);
}

.day-card {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  text-align: left;
  padding: 10px 9px;
}

.day-card:hover,
.day-card.active {
  border-color: var(--line);
  background: white;
}

.day-card.active {
  box-shadow: inset 3px 0 0 var(--green);
}

.day-card-top {
  justify-content: space-between;
}

.day-index {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.phase-pill,
.kind-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
}

.kind-pill.buy {
  background: #fff0d9;
  color: var(--amber);
}

.kind-pill.verify {
  background: #f9e5e1;
  color: var(--red);
}

.kind-pill.build {
  background: var(--green-soft);
  color: var(--green);
}

.day-card h4 {
  margin: 7px 0 4px;
  font-size: 14px;
  line-height: 1.35;
}

.day-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.day-subtasks {
  display: grid;
  gap: 5px;
  padding: 0 4px 10px 18px;
}

.subtask-button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  padding: 8px;
  text-align: left;
}

.subtask-button:hover,
.subtask-button.active {
  border-color: var(--green);
  background: var(--green-soft);
}

.subtask-index {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--green);
  color: white;
  font-size: 11px;
  font-weight: 900;
}

.subtask-button strong {
  display: block;
  font-size: 12px;
  line-height: 1.35;
}

.subtask-button span:last-child span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.detail-card {
  padding: 22px;
  box-shadow: var(--shadow);
}

.detail-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.detail-title h3 {
  font-size: 24px;
  line-height: 1.22;
}

.detail-meta {
  margin-top: 7px;
}

.small-note {
  line-height: 1.65;
}

.action-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.action-row {
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.action-row strong {
  display: block;
  font-size: 14px;
  line-height: 1.4;
}

.action-row p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin-top: 4px;
}

.link-list {
  flex-wrap: wrap;
  margin-top: 8px;
}

.link-list a,
.resource-link,
.rail-link-list a {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  text-decoration: none;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.link-list a:hover,
.resource-link:hover,
.rail-link-list a:hover {
  border-color: var(--green);
}

.inline-button {
  min-height: 30px;
  margin-top: 8px;
  border: 1px solid var(--green);
  background: white;
  color: var(--green);
  padding: 0 10px;
  font-size: 12px;
}

.inline-button:hover {
  background: var(--green-soft);
}

.notes-box {
  margin-top: 16px;
}

.notes-box label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
}

.notes-box textarea {
  min-height: 98px;
  resize: vertical;
  padding: 10px;
  line-height: 1.55;
}

.reader-view {
  max-width: 1040px;
}

.reader-toolbar {
  position: sticky;
  top: var(--topbar);
  z-index: 12;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 247, 249, 0.94);
  backdrop-filter: blur(10px);
}

.reader-toolbar h3 {
  font-size: 22px;
  line-height: 1.25;
}

.reader-toolbar p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin-top: 4px;
}

.learning-page {
  padding: 22px;
  scroll-margin-top: 126px;
  box-shadow: var(--shadow);
}

.module-tabs {
  position: sticky;
  top: calc(var(--topbar) + 72px);
  z-index: 10;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: -4px -2px 18px;
  padding: 4px 2px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.module-tab {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.module-tab.active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.learning-header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.learning-header h3 {
  max-width: 820px;
  font-size: 28px;
  line-height: 1.2;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.media-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  overflow: hidden;
}

.video-frame,
.image-frame {
  aspect-ratio: 16 / 9;
  background: #eef2f1;
}

.video-frame {
  background: #111a18;
}

.image-frame,
.video-frame a {
  display: block;
}

.image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-frame a {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: white;
  text-decoration: none;
  font-weight: 900;
}

.media-card figcaption {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.media-card figcaption strong,
.diagram-card strong {
  font-size: 13px;
}

.media-card figcaption span,
.diagram-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.diagram-card {
  display: grid;
  gap: 8px;
  min-height: 178px;
  padding: 12px;
}

.diagram-card > span {
  justify-self: start;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 900;
}

.diagram-card a {
  align-self: end;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.learning-sections {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}

.learning-sections section {
  scroll-margin-top: 158px;
}

.learning-page h4 {
  margin: 0 0 9px;
  font-size: 17px;
  line-height: 1.35;
}

.learning-page p,
.learning-page li {
  color: #35413d;
  font-size: 15px;
  line-height: 1.78;
}

.learning-page p + p {
  margin-top: 9px;
}

.learning-page ul,
.learning-page ol {
  margin: 9px 0 0;
  padding-left: 21px;
}

.structured-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.structured-table {
  width: 100%;
  min-width: 880px;
  border-collapse: separate;
  border-spacing: 0;
}

.structured-table caption {
  padding: 10px 12px 0;
  color: var(--muted);
  text-align: left;
  font-size: 12px;
  font-weight: 800;
}

.structured-table th,
.structured-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.structured-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f8f6;
  color: #43504b;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.structured-table td {
  color: #35413d;
  font-size: 14px;
  line-height: 1.58;
}

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

.structured-table tbody tr:hover td {
  background: #fbfdfc;
}

.purchase-table td:nth-child(1) {
  width: 78px;
  color: var(--green);
  font-weight: 900;
  white-space: nowrap;
}

.purchase-table td:nth-child(2) {
  min-width: 180px;
}

.purchase-table td:nth-child(3) {
  width: 62px;
  font-weight: 800;
  white-space: nowrap;
}

.purchase-table td:nth-child(5) {
  min-width: 156px;
}

.table-item-title {
  display: block;
  color: #17231f;
  font-weight: 900;
}

.table-item-meta,
.purchase-check {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.table-link-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.table-link-group a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #33413c;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.table-link-group a:first-child {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.table-link-group a:hover {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.table-link-group a:first-child:hover {
  background: #11583f;
  color: #fff;
}

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

.learning-grid section,
.source-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 14px;
}

.learning-grid .completeness-section {
  grid-column: 1 / -1;
  border-color: rgba(23, 104, 79, 0.35);
  background: var(--green-soft);
}

.completeness-section h4 {
  color: var(--green);
}

.source-block {
  margin-top: 12px;
}

.rail-card,
.resource-card {
  padding: 14px;
}

.resource-card {
  margin-top: 14px;
}

.rail-heading {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.rail-heading span {
  display: block;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 5px;
}

.rail-heading strong {
  display: block;
  font-size: 16px;
  line-height: 1.35;
}

.rail-heading p,
.rail-section p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin-top: 6px;
}

.rail-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.rail-metrics span {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 8px;
  color: var(--muted);
  font-size: 11px;
}

.rail-metrics strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.rail-section h4 {
  font-size: 13px;
  margin-bottom: 8px;
}

.rail-button-list,
.anchor-list,
.rail-link-list,
.resource-list {
  display: grid;
  gap: 7px;
}

.rail-button-list button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  padding: 7px;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
}

.rail-button-list button:hover,
.rail-button-list button.active {
  border-color: var(--green);
  background: var(--green-soft);
}

.rail-button-list span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 11px;
  font-weight: 900;
}

.anchor-list a {
  display: block;
  border-left: 2px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0 4px 9px;
  font-size: 12px;
  line-height: 1.45;
}

.anchor-list a:hover {
  border-left-color: var(--green);
  color: var(--ink);
}

.rail-link-list {
  align-items: start;
}

.resource-heading {
  margin-bottom: 12px;
}

.resource-list {
  max-height: 46vh;
  overflow: auto;
}

.resource-link {
  justify-content: space-between;
}

.resource-link small {
  color: var(--muted);
  font-weight: 700;
}

.empty-state {
  padding: 22px 10px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

@media (max-width: 1120px) {
  .doc-layout {
    grid-template-columns: minmax(260px, 310px) minmax(0, 1fr);
  }

  .context-rail {
    display: none;
  }

  .doc-topbar {
    grid-template-columns: minmax(250px, 310px) minmax(280px, 1fr) auto;
  }
}

@media (max-width: 940px) {
  :root {
    --topbar: auto;
  }

  .doc-topbar,
  .doc-layout {
    display: block;
  }

  .doc-topbar {
    position: relative;
    z-index: 40;
    padding: 14px 16px;
  }

  .top-search,
  .top-actions {
    margin-top: 12px;
  }

  .top-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .secondary-button.mobile-header-nav-button {
    display: inline-flex;
  }

  .context-rail,
  .reader-toolbar,
  .module-tabs {
    position: static;
    height: auto;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 90;
    width: min(88vw, 360px);
    height: 100dvh;
    padding: 0 16px 24px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    box-shadow: 18px 0 38px rgba(21, 32, 29, 0.18);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    overscroll-behavior: contain;
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-mobile-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    margin: 0 -16px 14px;
    padding: 0 14px 0 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(251, 252, 253, 0.96);
    backdrop-filter: blur(10px);
  }

  .sidebar-mobile-header strong {
    font-size: 15px;
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: block;
    border: 0;
    border-radius: 0;
    background: rgba(12, 18, 16, 0.38);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  body.nav-open .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .secondary-button.mobile-nav-button {
    position: fixed;
    left: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 70;
    display: inline-flex;
    min-height: 44px;
    padding: 0 15px;
    border-color: var(--green);
    background: var(--green);
    color: white;
    box-shadow: 0 10px 26px rgba(23, 104, 79, 0.28);
  }

  .context-rail {
    display: block;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .main-panel {
    padding: 22px 16px 92px;
  }

  .summary-grid,
  .media-grid,
  .learning-grid {
    grid-template-columns: 1fr;
  }

  .learning-grid .completeness-section {
    grid-column: auto;
  }

  .structured-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .structured-table {
    display: block;
    min-width: 0;
  }

  .structured-table caption,
  .structured-table thead,
  .structured-table tbody,
  .structured-table tr,
  .structured-table td {
    display: block;
    width: 100%;
  }

  .structured-table thead {
    display: none;
  }

  .structured-table tr {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
  }

  .structured-table td {
    padding: 8px 0;
    border-bottom: 0;
  }

  .structured-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
  }

  .purchase-table td:nth-child(n) {
    width: auto;
    min-width: 0;
    white-space: normal;
  }

  .table-link-group a {
    flex: 1 1 76px;
  }
}

@media (max-width: 620px) {
  .topbar h2 {
    font-size: 24px;
  }

  .detail-card,
  .learning-page {
    padding: 16px;
  }

  .detail-title,
  .reader-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .learning-header h3 {
    font-size: 23px;
  }
}
