.icon-button {
  background: none;
  border: 0;
  border-radius: 9px;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-button:hover {
  background: #f1f1f1;
}

.btn {
  border: 0;
  border-radius: 999px;
  height: 29px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition:
  background var(--motion-press),
  box-shadow var(--motion-press);
}

.btn.primary {
  background: var(--color-action);
  color: white;
  box-shadow: var(--shadow-button-primary);
}

.btn.primary:hover {
  background: var(--color-action-hover);
  box-shadow: var(--shadow-button-primary-hover);
}

.btn.primary:active {
  background: #1d1d1d;
  box-shadow:
  inset 0 2px 3px #00000070,
  0 0 0 1px #00000020;
}

.btn.secondary {
  background: var(--color-surface-soft);
  color: #303030;
  box-shadow:
  inset 0 1px 0 var(--color-surface),
  0 1px 1px #00000006;
}

.btn.secondary:hover {
  background: #eaeaea;
}

.btn.secondary:active {
  background: #e0e0e0;
  box-shadow: inset 0 1px 2px #00000012;
}

.btn .icon {
  width: 14px;
  height: 14px;
}

.btn.primary .icon {
  filter: invert(1);
  opacity: 0.95;
}

.btn.split {
  padding-right: 6px;
}

.btn.split .split-end {
  border-left: 1px solid #ddd;
  display: flex;
  padding: 0 4px 0 8px;
  margin-left: 2px;
}

.subtle-link {
  padding: 0;
  background: none;
  border: 0;
  color: #666;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 11px;
  margin-top: 12px;
}

.btn-samples {
  margin-top: 25px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn-samples small {
  margin-right: auto;
  font-size: 10px;
}

@media (max-width: 900px) {
  .btn-samples {
    display: none;
  }
}

.action-pill {
  display: flex;
  gap: 0;
  padding: 2px 3px;
  background: var(--color-surface);
  border: 1px solid #e6e6e6;
  border-radius: 999px;
  box-shadow: 0 2px 6px #00000007;
}

.action-pill .icon-button {
  width: 27px;
  height: 26px;
  border-radius: 999px;
  padding: 5px;
  color: #444;
}

.action-pill .icon-button:active {
  background: #e8e8e8;
}

@media (max-width: 640px) {
  .action-pill {
    padding: 2px;
  }
  .action-pill .icon-button {
    width: 32px;
    height: 32px;
  }
}

.subtle-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}

.subtle-link:hover {
  text-decoration: underline;
}

.subtle-link .detail-icon {
  width: 13px;
  height: 13px;
  flex-basis: 13px;
}

.action-pill #context-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero .btn {
  align-self: center;
}

/* Back links use a distinct round control followed by the destination context. */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  padding: 0;
  border: 0;
  background: none;
  color: #777;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.back-link-control {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid #e7e7e7;
  border-radius: 50%;
  background: #fff;
  color: #242424;
  box-shadow: 0 1px 3px #0000000a;
  transition:
  background var(--motion-ui),
  border-color var(--motion-ui),
  box-shadow var(--motion-ui);
}

.back-link-chevron {
  width: 14px;
  height: 14px;
  transform: rotate(90deg);
}

.back-link-context-icon,
.back-link > .icon {
  display: block;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  object-fit: contain;
  opacity: 0.72;
}

.back-link-context-icon {
  font-size: 15px;
  line-height: 1;
}

.back-link-label {
  white-space: nowrap;
}

.back-link:hover {
  color: #292929;
  text-decoration: none;
}

.back-link:hover .back-link-control {
  background: #fafafa;
  border-color: #d9d9d9;
  box-shadow: 0 2px 5px #0000000d;
}

.back-link:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 4px;
  border-radius: 999px;
}

.app .content > .back-link,
.app .hero-copy > .back-link {
  display: inline-flex;
  align-items: center;
  flex-direction: row;
}

.content > .back-link {
  margin-top: 10px;
  font-size: 11px;
}

.hero-copy > .back-link {
  margin-bottom: 10px;
  font-size: 11px;
}

@scope (body[data-design]) {
  .button,
  .landing-button,
  .auth-layout .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 32px;
    padding: 7px 15px;
    border: 0;
    border-radius: 999px;
    background: var(--color-action);
    color: white;
    font: 500 12px var(--font-app);
    text-decoration: none;
    cursor: pointer;
  }
  .button.secondary {
    background: var(--color-surface-soft);
    color: var(--color-text);
  }
  .button.danger {
    background: #b42332;
    color: white;
  }
  .button.full {
    width: 100%;
  }
  .button:hover,
  .landing-button:hover {
    filter: brightness(0.92);
  }
  .link-button,
  .text-button {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
  }
  .text-link {
    text-underline-offset: 3px;
  }
}

@scope (body[data-design]) {
  /* Default action buttons share Open course's rounded, softly raised surface. */
  :is(.btn, .button) {
    --button-shadow: var(--shadow-button-primary);
    --button-shadow-hover: var(--shadow-button-primary-hover);
    --button-shadow-active: var(--shadow-button-primary-active);
  }
  :is(.btn, .button).secondary {
    --button-shadow: var(--shadow-button-secondary);
    --button-shadow-hover: var(--shadow-button-secondary-hover);
    --button-shadow-active: var(--shadow-button-secondary-active);
  }
  .app .main :is(.btn, .button),
  .app dialog :is(.btn, .button) {
    border-radius: 999px;
    box-shadow: var(--button-shadow);
    transition:
    background var(--motion-press),
    box-shadow var(--motion-press);
  }
  .app .main :is(.btn, .button):hover,
  .app dialog :is(.btn, .button):hover {
    box-shadow: var(--button-shadow-hover);
  }
  .app .main :is(.btn, .button):active,
  .app dialog :is(.btn, .button):active {
    box-shadow: var(--button-shadow-active);
  }
  .app :is(.btn, .button):disabled {
    box-shadow: none;
    opacity: 0.45;
    cursor: default;
  }
}
