:root {
  color-scheme: light;
  --bg: #f7f7f8;
  --panel: #ffffff;
  --ink: #1d1d1f;
  --muted: #74747a;
  --line: #e2e2e5;
  --soft: #f1f1f3;
  --useful: #32d74b;
  --useless: #ffd60a;
  --wrong: #ff453a;
  --focus: #0a84ff;
  font-family: "Google Sans", "Product Sans", Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.auth-open,
body.modal-open {
  overflow: hidden;
}

body.admin-gate {
  visibility: hidden;
}

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

button {
  cursor: pointer;
}

.shell {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 56px;
}

.topbar,
.intro,
.feed-header,
.lesson-footer,
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  min-height: 48px;
  flex-wrap: wrap;
  justify-content: space-between;
  padding-bottom: 18px;
/*  border-bottom: 1px solid var(--line);*/
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.brand-logo {
  height: 60px;
  object-fit: contain;
  flex: 0 0 auto;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 38px;
}

.user-chip {
  display: inline-flex;
  max-width: 120px;
  min-height: 34px;
  align-items: center;
  min-width: 0;
  padding: 0 10px;
  color: var(--ink);
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu {
  position: relative;
}

.account-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: none;
  width: min(260px, calc(100vw - 32px));
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 16px 36px rgb(0 0 0 / 0.12);
  color: var(--muted);
  font-size: 0.88rem;
}

.account-menu.open .account-popover {
  display: grid;
}

.account-popover strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-popover span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-popover .secondary {
  margin-top: 4px;
  width: 100%;
  justify-content: center;
}

.intro {
  display: block;
  padding: 4px 0 34px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

#page-title {
  max-width: 360px;
  min-height: 3.2em;
  color: var(--ink);
  font-family: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  font-size: clamp(1.08rem, 1.55vw, 1.36rem);
  line-height: 1.22;
  font-weight: 400;
  letter-spacing: 0;
  opacity: 1;
  transition: opacity 220ms ease;
}

#page-title.is-fading {
  opacity: 0;
}

#page-title span {
  display: block;
  color: inherit;
}

h2 {
  font-size: 1rem;
}

.primary {
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}

#composeButton {
  right: 20px;
  bottom: 20px;
  position: fixed;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 190px;
  min-height: 48px;
  padding: 0 22px;
  font-size: 1.05rem;
  white-space: nowrap;
  z-index: 9;
  overflow: hidden;
  isolation: isolate;
}

#composeButton::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -35%;
  width: 34%;
  transform: skewX(-18deg);
  background: linear-gradient(
    90deg,
    transparent,
    rgb(255 255 255 / 0.18),
    transparent
  );
  animation: compose-shine 4.8s ease-in-out infinite;
  pointer-events: none;
}

#composeButton > * {
  position: relative;
  z-index: 1;
}

@keyframes compose-shine {
  0%,
  68% {
    transform: translateX(0) skewX(-18deg);
    opacity: 0;
  }
  74% {
    opacity: 1;
  }
  88%,
  100% {
    transform: translateX(460%) skewX(-18deg);
    opacity: 0;
  }
}

.button-icon {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
}

.button-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.3;
}

.primary:hover,
.primary:focus-visible {
  background: #333336;
}

.secondary,
.text-button {
  min-height: 36px;
  border-radius: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.icon-only {
  flex: 0 0 42px;
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.profile-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 12px;
}

.profile-button img {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.profile-button span {
  font-size: 0.9rem;
}

.icon-only svg,
.icon-only img {
  width: 20px;
  height: 20px;
}

.icon-only img {
  display: block;
  object-fit: contain;
}

.icon-only svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--focus);
}

.auth-panel {
  display: none;
  position: fixed;
  z-index: 10;
  inset: 0;
  place-items: center;
  padding: 20px;
  border: 0;
  background: rgb(247 247 248 / 0.96);
  backdrop-filter: blur(12px);
}

.auth-panel.open {
  display: grid;
}

.auth-shell {
  position: relative;
  display: grid;
  width: min(440px, 100%);
  gap: 22px;
  padding: 32px;
/*  border: 1px solid var(--line);*/
  border-radius: 8px;
  background: var(--panel);
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.2;
}

.auth-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.auth-copy {
  padding-right: 42px;
}

.auth-copy h2 {
  font-size: 2rem;
  line-height: 1.05;
  font-weight: 740;
}

.auth-copy p,
.form-message {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.form-message.error {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgb(255 69 58 / 0.32);
  border-radius: 8px;
  background: rgb(255 69 58 / 0.08);
  color: #b42318;
}

.form-message.success {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgb(48 209 88 / 0.32);
  border-radius: 8px;
  background: rgb(48 209 88 / 0.08);
  color: #167a2d;
}

.auth-form {
  align-self: center;
  padding: 0;
}

.auth-fields {
  display: grid;
  gap: 12px;
}

.field:first-child {
  display: none;
}

.auth-panel.signup .field:first-child {
  display: block;
}

.reset-field {
  display: none;
}

.auth-panel.reset .auth-fields .field:nth-child(3) {
  display: none;
}

.auth-panel.reset .reset-field {
  display: block;
}

.field label {
  margin-bottom: 7px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--ink);
}

input {
  min-height: 44px;
  padding: 0 14px;
}

select {
  min-height: 44px;
  margin-bottom: 14px;
  padding: 0 38px 0 14px;
  appearance: none;
  -webkit-appearance: none;
  background:
    url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1.5 1.75 6 6.25l4.5-4.5' fill='none' stroke='%2374747a' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      calc(100% - 14px) 50% / 12px 8px no-repeat,
    #fff;
  color: var(--ink);
}

.composer {
  display: none;
  position: fixed;
  z-index: 9;
  inset: 0;
  place-items: center;
  padding: 20px;
  border: 0;
  background: rgb(247 247 248 / 0.96);
  backdrop-filter: blur(12px);
}

.composer.open {
  display: grid;
}

.composer-shell {
  bottom: 0;
  position: relative;
  display: grid;
  width: min(520px, 100%);
  gap: 22px;
  padding: 0;
/*  border: 1px solid var(--line);*/
  border-radius: 8px;
/*  background: var(--panel);*/
}

.composer-close {
  position: absolute;
  top: 18px;
  right: 0;
}

.composer-close[hidden] {
  display: none;
}

.composer form {
  padding: 0;
}

.composer-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.writing-counts {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 10px;
  color: var(--muted);
  font-size: 0.88em;
  font-weight: 600;
}

.admin-panel {
  display: none;
  margin-bottom: 26px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.admin-panel.open {
  display: grid;
  gap: 18px;
}

.admin-header,
.admin-item,
.admin-item-actions {
  display: flex;
  align-items: center;
}

.admin-header,
.admin-item {
  justify-content: space-between;
  gap: 14px;
}

.admin-header h2,
.admin-create h3,
.admin-columns h3 {
  margin: 0;
  color: var(--ink);
}

.admin-create {
  display: grid;
  gap: 14px;
  padding: 0;
}

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

.admin-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
}

.admin-pagination span {
  min-width: 0;
}

.admin-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.admin-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-item-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.admin-item-copy strong,
.admin-item-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-item-copy span {
  color: var(--muted);
  font-size: 0.84rem;
}

.admin-item-actions {
  flex: 0 0 auto;
  gap: 6px;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  text-decoration: none;
}

.secondary.danger {
  color: #b42318;
}

form {
  padding: 18px;
}

label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

textarea {
  resize: vertical;
  min-height: 136px;
  padding: 14px;
  line-height: 1.55;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 72%);
  outline-offset: 2px;
}

.form-row {
  gap: 6px;
  width: 100%;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-row button {
  width: 100%;
}

.auth-alt {
  display: inline-flex;
  width: 100%;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.auth-alt .text-button {
  min-height: 0;
  font-size: inherit;
  font-weight: 700;
  line-height: inherit;
}

.auth-reset-link {
  margin-top: 8px;
}

.feed-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 16px;
  padding: 18px 0 12px;
/*  border-top: 1px solid var(--line);*/
  color: var(--muted);
}

.feed-header h2 {
  display: none;
}

.feed-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.feed-search {
  display: grid;
  grid-column: 1 / -1;
  gap: 4px;
}

.feed-select {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.feed-search span,
.feed-select span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.feed-search input {
  min-height: 42px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 700;
}

.feed-select select {
  min-height: 38px;
  min-width: 142px;
  padding: 0 34px 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: var(--panel);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
}

.feed-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-weight: 600;
}

#lessonCount {
  max-width: 12ch;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scope-chip {
  min-height: 28px;
  max-width: 240px;
  padding: 0 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scope-chip::after {
  content: " x";
  color: var(--muted);
  font-weight: 700;
}

.feed {
  display: grid;
  gap: 20px;
}

.lesson {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.lesson-skeleton {
  display: grid;
  gap: 18px;
  padding: 20px;
  overflow: hidden;
}

.skeleton-line,
.skeleton-actions span {
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, #ededf0, #f8f8fa, #ededf0);
  background-size: 220% 100%;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.skeleton-line.meta {
  width: min(72%, 360px);
  height: 20px;
}

.skeleton-line.text {
  width: 80%;
  height: 28px;
}

.skeleton-line.text.wide {
  width: 96%;
}

.skeleton-footer {
  display: grid;
  gap: 18px;
  padding-top: 10px;
}

.skeleton-line.bar {
  width: 100%;
  height: 7px;
}

.skeleton-actions {
  display: flex;
  gap: 12px;
}

.skeleton-actions span {
  width: 48px;
  height: 48px;
  border-radius: 8px;
}

@keyframes skeleton-pulse {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.lesson-card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
}

.quiet-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: color-mix(in srgb, var(--muted), transparent 18%);
}

.quiet-icon[hidden] {
  display: none;
}

.quiet-icon:hover,
.quiet-icon:focus-visible {
  background: var(--soft);
  color: var(--ink);
}

.quiet-icon.active {
  background: rgb(255 69 58 / 0.1);
  color: var(--wrong);
}

.quiet-icon.copied {
  background: rgb(50 215 75 / 0.12);
  color: var(--useful);
}

.quiet-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px 50px 0 20px;
  color: var(--muted);
  font-family: "Google Sans", "Product Sans", Arial, Helvetica, sans-serif;
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 500;
  line-height: 1.4;
}

.lesson-meta div {
  display: inline-block;
}

.author,
.lesson-category {
  display: inline;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #4c4c52;
  font-size: inherit;
  font-weight: inherit;
  text-align: left;
}

.author:hover,
.lesson-category:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lesson-text {
  margin: 0;
  padding: 14px 20px 22px;
  font-family: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  font-size: 1.6rem;
  line-height: 1.55;
  word-break: break-word;
}

.lesson-footer {
  padding: 14px 20px 16px;
/*  border-top: 1px solid var(--line);*/
  color: var(--muted);
}

.vote-summary {
  display: grid;
  flex: 1;
  min-width: 220px;
  gap: 12px;
}

.vote-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vote-bar {
  display: flex;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.bar-part {
  min-width: 0;
  transition: flex-basis 160ms ease;
}

.bar-part.is-empty {
  display: none;
}

.bar-part.useful {
  background: var(--useful);
}

.bar-part.useless {
  background: var(--useless);
}

.bar-part.wrong {
  background: var(--wrong);
}

.vote-total {
  min-width: 64px;
  color: var(--muted);
  font-family: "Google Sans", "Product Sans", Arial, Helvetica, sans-serif;
  font-size: 0.86rem;
  text-align: right;
  white-space: nowrap;
}

.vote-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.vote-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vote {
  position: relative;
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.vote-icon {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
}

.vote-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.vote.selected {
  border-color: currentColor;
  background: #fff;
}

.vote.useful.selected {
  color: var(--useful);
  background: rgb(48 209 88 / 0.12);
}

.vote.useless.selected {
  color: var(--useless);
  background: rgb(255 214 10 / 0.18);
}

.vote.wrong.selected {
  color: var(--wrong);
  background: rgb(255 69 58 / 0.12);
}

.vote::after {
  position: absolute;
  z-index: 2;
  bottom: calc(100% + 8px);
  left: 50%;
  width: max-content;
  max-width: 160px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  content: attr(data-tooltip);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(3px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.vote:hover::after,
.vote:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

time,
.empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.lesson-meta .lesson-category::after,
.lesson-meta .author::after {
  content: none;
}

.empty {
  padding: 34px 0;
}

.load-sentinel {
  align-self: center;
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  margin: 12px auto 0;
  padding: 0 16px;
  border: 2px solid black;
  border-radius: 8px;
  background: var(--panel);
  color: black;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

.load-sentinel.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.site-footer {
  display: flex;
  width: min(760px, calc(100% - 32px));
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 auto;
  padding: 0 0 36px;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
}

.site-footer nav a {
  margin: 5px;
}

.static-page {
  display: grid;
  gap: 18px;
  padding-top: 22px;
}

.static-page p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.static-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 28px;
}

.static-header .brand-logo {
  height: 54px;
}

.back-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.static-copy {
  display: grid;
  gap: 18px;
}

.static-copy h1 {
  min-height: 0;
  margin: 0;
  font-family: "Google Sans", "Product Sans", Arial, Helvetica, sans-serif;
  font-size: clamp(2.4rem, 10vw, 4rem);
  line-height: 0.95;
}

.static-copy h2 {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1.25;
}

.static-copy ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.error-page {
  min-height: 100vh;
}

.error-copy {
  align-content: center;
  min-height: 52vh;
}

.error-copy h1 {
  max-width: 720px;
}

.error-code {
  color: var(--accent);
  font-family: "Google Sans", "Product Sans", Arial, Helvetica, sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.link-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  text-decoration: none;
}

.admin-page h1 {
  min-height: 0;
}

.admin-topbar {
  align-items: center;
  padding-bottom: 12px;
}

.admin-topbar .brand-logo {
  height: 46px;
}

.admin-hero {
  display: grid;
  gap: 6px;
  padding: 10px 0 2px;
}

.admin-hero h1 {
  margin: 0;
  font-family: "Google Sans", "Product Sans", Arial, Helvetica, sans-serif;
  font-size: clamp(2rem, 7vw, 3.2rem);
  line-height: 1;
}

.admin-tabs {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  gap: 4px;
  margin: 12px 0 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.admin-tabs .mode-tab {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.admin-tabs .mode-tab.active {
  background: var(--ink);
  color: #fff;
}

.admin-view {
  display: none;
}

.admin-view.active {
  display: grid;
  gap: 16px;
}

.admin-filter label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.admin-filter input {
  width: auto;
  min-height: auto;
}

.admin-item.removed {
  background: var(--soft);
}

@media (max-width: 680px) {

  body {
    padding-bottom: 60px;
  }

  .shell {
    width: min(100% - 24px, 760px);
    padding-top: 14px;
  }

  .topbar,
  .intro {

  }

  .topbar {
    gap: 12px;
  }

  .brand img {
    height: 40px;
  }

  #composeButton {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: auto;
  }

  .composer.open {
    display: grid;
    align-items: flex-end;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 48px 22px 24px;
  }

  .auth-actions {
    justify-content: stretch;
  }

  .auth-actions > * {
    flex: 1;
    justify-content: center;
  }

  .auth-actions > .icon-only {
    flex: 0 0 42px;
  }

  .auth-actions > .profile-button {
    flex: 0 0 auto;
  }

  .auth-fields {
    grid-template-columns: 1fr;
  }

  .admin-grid,
  .admin-columns {
    grid-template-columns: 1fr;
  }

  .admin-item {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-item-actions {
    justify-content: flex-start;
  }

  .admin-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-tabs {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .feed-controls,
  .primary,
  .secondary {
    width: 100%;
  }

  .feed-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .feed-select select {
    width: 100%;
    min-width: 0;
    margin: 0;
  }

  .feed-header {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
  }

  .feed-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    min-height: 20px;
    text-align: right;
  }

  .scope-chip {
    max-width: min(220px, 58vw);
  }

  #lessonCount {
    max-width: 9ch;
    white-space: nowrap;
    margin-left: auto;
  }

  .secondary,
  .primary {
    justify-content: center;
  }

  .vote-summary {
    min-width: 0;
  }

  .vote-bar {
    width: 100%;
  }

  .intro {
    padding: 4px 0 4px;
  }

  #page-title {
    max-width: 260px;
    min-height: 3.7em;
    font-size: 1.02rem;
  }

  .site-footer {
    width: min(100% - 24px, 760px);
    gap: 6px 14px;
    text-align: center;
  }

  .site-footer span {
    flex: 0 0 100%;
  }

  .site-footer nav {
    width: 100%;
    display: block;
    text-align: center;
  }

  .feed-header {
/*    align-items: stretch;*/
/*    flex-direction: column;*/
  }

  .feed {
    gap: 0;
  }

  .lesson {
    position: relative;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: var(--panel);
    margin: 0 -12px;
  }

  .lesson:last-child {
    border-bottom: 1px solid var(--line);
  }

}

@media (prefers-reduced-motion: reduce) {
  #composeButton::after,
  #page-title,
  .skeleton-line,
  .skeleton-actions span {
    transition: none;
    animation: none;
  }
}
