:root {
  color-scheme: light;
  --bg: #eef0e8;
  --surface: #f8f8f3;
  --surface-strong: #ffffff;
  --ink: #17211b;
  --muted: #657068;
  --line: #d9ddd4;
  --accent: #b64732;
  --accent-hover: #963825;
  --forest: #294b3b;
  --forest-soft: #dce6dc;
  --sand: #dfd4b8;
  --radius-card: 18px;
  --radius-control: 11px;
  --shadow: 0 18px 48px rgba(38, 55, 45, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111713;
    --surface: #18201b;
    --surface-strong: #202a23;
    --ink: #edf3ec;
    --muted: #a6b1a9;
    --line: #344138;
    --accent: #d66a52;
    --accent-hover: #e67a62;
    --forest: #7eac92;
    --forest-soft: #26372d;
    --sand: #746b54;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef0e8;
  --surface: #f8f8f3;
  --surface-strong: #ffffff;
  --ink: #17211b;
  --muted: #657068;
  --line: #d9ddd4;
  --accent: #b64732;
  --accent-hover: #963825;
  --forest: #294b3b;
  --forest-soft: #dce6dc;
  --sand: #dfd4b8;
  --shadow: 0 18px 48px rgba(38, 55, 45, 0.12);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111713;
  --surface: #18201b;
  --surface-strong: #202a23;
  --ink: #edf3ec;
  --muted: #a6b1a9;
  --line: #344138;
  --accent: #d66a52;
  --accent-hover: #e67a62;
  --forest: #7eac92;
  --forest-soft: #26372d;
  --sand: #746b54;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.auth-pending body {
  visibility: hidden;
}

[hidden] {
  display: none !important;
}

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

button,
select {
  cursor: pointer;
}

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

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

.skip-link {
  position: fixed;
  z-index: 20;
  top: 10px;
  left: 10px;
  transform: translateY(-150%);
  background: var(--ink);
  color: var(--surface);
  padding: 10px 14px;
  border-radius: var(--radius-control);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 18px 18px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  padding: 0 8px 26px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--surface);
  font-family: Georgia, serif;
  font-size: 23px;
  font-style: italic;
}

.brand strong,
.brand small,
.sidebar-footer strong,
.sidebar-footer small {
  display: block;
}

.brand strong {
  letter-spacing: -0.02em;
}

.brand small,
.sidebar-footer small {
  color: var(--muted);
  font-size: 12px;
}

.project-switcher {
  display: grid;
  gap: 6px;
  margin: 0 8px 20px;
}

.project-switcher label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-switcher select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 0 34px 0 10px;
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.project-switcher small {
  min-height: 16px;
  color: var(--muted);
  font-size: 11px;
}

.project-switcher small.error {
  color: var(--accent);
}

.main-nav {
  display: grid;
  gap: 5px;
}

.nav-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  width: 100%;
  gap: 9px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--muted);
  padding: 11px 12px;
  text-align: left;
  transition: background 180ms ease, color 180ms ease, transform 120ms ease;
}

.nav-item[href] {
  text-decoration: none;
}

.nav-item[hidden] {
  display: none;
}

.nav-item:hover,
.nav-item.active {
  background: var(--forest-soft);
  color: var(--ink);
}

.nav-item:active,
.button:active,
.filter:active {
  transform: translateY(1px);
}

.nav-count {
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--surface-strong);
  text-align: center;
  font-size: 12px;
}

.book-progress {
  margin-top: auto;
  padding: 18px 12px;
  border-top: 1px solid var(--line);
}

.progress-heading {
  display: flex;
  justify-content: space-between;
}

.progress-track {
  height: 5px;
  margin: 10px 0;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.progress-track span {
  display: block;
  width: 25%;
  height: 100%;
  background: var(--accent);
  transition: width 250ms ease;
}

.book-progress p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.family-stack {
  display: flex;
  min-height: 67px;
  padding: 10px 12px 22px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  margin-right: -7px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
}

.avatar-green {
  background: #617c68;
  color: #fff;
}

.avatar-blue {
  background: #7991a1;
  color: #fff;
}

.avatar-red {
  background: #b66b59;
  color: #fff;
}

.avatar-sand {
  background: var(--sand);
  color: #293128;
}

.invite-button {
  background: var(--surface-strong);
  border-color: var(--surface);
  color: var(--muted);
}

.sidebar-footer {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 15px 10px 0;
  border-top: 1px solid var(--line);
}

.sidebar-footer .avatar {
  margin: 0;
}

.sidebar-user {
  min-width: 0;
}

.sidebar-user strong,
.sidebar-user small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-logout {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 5px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.sidebar-logout:hover {
  background: var(--forest-soft);
  color: var(--ink);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-strong);
}

main {
  min-width: 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fade-in 260ms ease both;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  min-height: 72px;
  gap: 18px;
  padding: 13px clamp(20px, 4vw, 56px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.topbar > :last-child {
  margin-left: auto;
}

.topbar-subtitle {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.search-wrap {
  display: grid;
  grid-template-columns: auto minmax(160px, 420px) auto;
  align-items: center;
  width: min(100%, 520px);
  gap: 8px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}

.search-wrap input {
  width: 100%;
  padding: 10px 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.search-wrap kbd {
  color: var(--muted);
  font-size: 11px;
}

.mobile-menu {
  display: none;
  border: 0;
  background: transparent;
  font-size: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  gap: 7px;
  border-radius: var(--radius-control);
  padding: 9px 16px;
  border: 1px solid transparent;
  font-weight: 650;
  white-space: nowrap;
  transition: background 160ms ease, border-color 160ms ease, transform 120ms ease;
}

.button-primary {
  background: var(--accent);
  color: #fff;
}

.button-primary:hover {
  background: var(--accent-hover);
}

.button-secondary {
  background: var(--surface-strong);
  border-color: var(--line);
  color: var(--ink);
}

.button-secondary:hover {
  border-color: var(--muted);
}

.button-danger {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: transparent;
  color: var(--accent);
}

.button-danger:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.content {
  width: min(100%, 1420px);
  margin: 0 auto;
  padding: 52px clamp(20px, 4vw, 56px) 80px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  letter-spacing: -0.045em;
  line-height: 1.06;
}

.intro h1,
.family-heading h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(38px, 5vw, 72px);
  font-weight: 650;
}

.intro > div > p:last-child,
.family-heading p {
  max-width: 590px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.edition-note {
  min-width: 205px;
  padding: 18px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
}

.edition-note span,
.edition-note strong,
.edition-note small {
  display: block;
}

.edition-note span,
.edition-note small {
  color: var(--muted);
  font-size: 12px;
}

.edition-note strong {
  margin: 2px 0;
  font-size: 18px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 44px 0 24px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter {
  border: 1px solid transparent;
  border-radius: 99px;
  padding: 7px 13px;
  background: transparent;
  color: var(--muted);
}

.filter:hover,
.filter.active {
  background: var(--forest);
  color: var(--surface);
}

.toolbar select {
  min-height: 38px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 0 34px 0 12px;
  background: var(--surface);
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 22px;
}

.recipe-card {
  position: relative;
  grid-column: span 4;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--surface-strong);
  box-shadow: 0 1px 0 var(--line);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 220ms ease;
}

.recipe-card:first-child {
  grid-column: span 7;
}

.recipe-card:nth-child(2) {
  grid-column: span 5;
}

.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.recipe-image {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  background-image: url("assets/familieoppskrifter.png");
  background-repeat: no-repeat;
  background-size: 300% 100%;
}

.uploaded-recipe-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-card:first-child .recipe-image,
.recipe-card:nth-child(2) .recipe-image {
  min-height: 340px;
}

.recipe-image.image-0 {
  background-position: left center;
}

.recipe-image.image-1 {
  background-position: center center;
}

.recipe-image.image-2 {
  background-position: right center;
}

.recipe-image::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(14, 24, 18, 0.22), transparent 45%);
}

.recipe-favorite {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(247, 247, 241, 0.9);
  color: #26352b;
  backdrop-filter: blur(8px);
}

.recipe-favorite[aria-pressed="true"] {
  color: var(--accent);
}

.recipe-copy {
  padding: 19px 20px 21px;
}

.recipe-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.recipe-meta span + span::before {
  content: "/";
  padding-right: 9px;
  color: var(--line);
}

.recipe-copy h2 {
  margin-bottom: 8px;
  font-size: clamp(21px, 2.2vw, 30px);
}

.recipe-copy p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.card-actions button {
  border: 0;
  background: transparent;
  color: var(--forest);
  font-weight: 700;
}

.card-actions button:last-child {
  margin-left: auto;
  color: var(--muted);
}

.empty-state {
  padding: 74px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-card);
  text-align: center;
}

.empty-state > span {
  font-size: 34px;
}

.empty-state h2 {
  margin: 12px 0 6px;
}

.empty-state p {
  color: var(--muted);
}

.book-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(320px, 1.1fr);
  align-items: center;
  gap: clamp(40px, 7vw, 100px);
}

.book-cover {
  position: relative;
  aspect-ratio: 4 / 5.5;
  overflow: hidden;
  border-radius: 3px;
  background: #e9e5d9;
  box-shadow: 0 30px 80px rgba(21, 32, 25, 0.22), 12px 0 0 #c8c1ad;
  color: #1a2a20;
}

.cover-image {
  height: 47%;
  background: url("assets/familieoppskrifter.png") center / 300% 100%;
}

.cover-copy {
  padding: 9% 10%;
}

.cover-copy p,
.cover-copy span {
  color: #657068;
  font-size: 13px;
}

.cover-copy h1 {
  max-width: 500px;
  margin: 17px 0 35px;
  font-family: Georgia, serif;
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 400;
}

.publishing-panel {
  max-width: 540px;
}

.publishing-panel h2 {
  margin-bottom: 14px;
  font-size: clamp(34px, 4vw, 56px);
}

.publishing-panel > p {
  color: var(--muted);
  font-size: 17px;
}

.publish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 34px;
}

.publish-checklist {
  display: grid;
  gap: 13px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.family-view-content {
  max-width: 1000px;
}

.pricing-content {
  max-width: 1050px;
}

.family-heading {
  margin-bottom: 50px;
}

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

.member-list article {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  padding: 17px 18px;
  background: var(--surface);
}

.member-list article:first-child {
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.member-list article:last-child {
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}

.member-list article:only-child {
  border-radius: var(--radius-card);
}

.member-list article .avatar {
  width: 42px;
  height: 42px;
  margin: 0;
  border: 0;
}

.member-list article small,
.member-list article > span:last-child {
  display: block;
  color: var(--muted);
}

.member-list .locked-member {
  margin-top: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-card);
  background: transparent;
}

.member-list .locked-member .button {
  margin-left: auto;
}

.invite-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
  border-radius: var(--radius-control);
  background: var(--forest-soft);
}

.invite-result[hidden] {
  display: none;
}

.invite-result .field {
  margin: 0;
}

.invite-result input {
  font-size: 12px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 20px;
}

.price-card {
  display: flex;
  flex-direction: column;
  min-height: 440px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.price-card.featured {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.price-card h2 {
  margin-bottom: 20px;
  font-size: 36px;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.price strong {
  font-size: 38px;
  letter-spacing: -0.05em;
}

.price span {
  color: var(--muted);
}

.price-card ul {
  display: grid;
  gap: 12px;
  margin: 16px 0 32px;
  padding-left: 20px;
  color: var(--muted);
}

.price-card .button {
  width: 100%;
  margin-top: auto;
}

.price-card .button:disabled {
  opacity: 0.65;
  cursor: default;
}

.pricing-note {
  margin: 28px auto 0;
  color: var(--muted);
  text-align: center;
}

.paywall-value {
  display: grid;
  margin: 24px 0;
  padding: 20px;
  border-radius: var(--radius-control);
  background: var(--forest-soft);
}

.paywall-value strong {
  font-size: 24px;
}

.paywall-value span,
.paywall-list {
  color: var(--muted);
}

.paywall-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 24px;
}

dialog {
  width: min(700px, calc(100% - 28px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(11, 20, 15, 0.58);
  backdrop-filter: blur(5px);
}

dialog form,
#detail-content {
  padding: 28px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.dialog-header h2 {
  margin: 0;
  font-size: 34px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 17px;
}

.field {
  display: grid;
  gap: 7px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field > span {
  font-size: 13px;
  font-weight: 700;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 10px 12px;
  background: var(--surface-strong);
}

.field textarea {
  resize: vertical;
}

.recipe-image-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.recipe-image-field legend,
.image-upload-controls > label {
  font-size: 13px;
  font-weight: 700;
}

.recipe-image-field legend {
  margin-bottom: 7px;
}

.image-upload-layout {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(220px, 1.25fr);
  gap: 16px;
  align-items: stretch;
}

.image-preview {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 155px;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: var(--radius-control);
  background: var(--forest-soft);
  color: var(--muted);
  text-align: center;
}

.image-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview span {
  max-width: 18ch;
  padding: 16px;
  font-size: 13px;
}

.image-upload-controls {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
}

.image-upload-controls input[type="file"] {
  width: 100%;
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 8px;
  background: var(--surface-strong);
}

.image-upload-controls input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 0;
  border-radius: 8px;
  padding: 7px 10px;
  background: var(--forest-soft);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.image-upload-controls small,
.image-status {
  color: var(--muted);
  font-size: 12px;
}

.image-remove-button {
  min-height: 36px;
  padding: 8px 12px;
}

.image-remove-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.image-status {
  min-height: 18px;
  margin: 0;
}

.image-status.error {
  color: var(--accent);
  font-weight: 650;
}

.field input::placeholder,
.field textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 85%, var(--surface));
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.form-error {
  min-height: 21px;
  margin: 12px 0 0;
  color: var(--accent);
  font-weight: 650;
}

.detail-photo {
  position: relative;
  height: 260px;
  margin: -28px -28px 25px;
  overflow: hidden;
  background-image: url("assets/familieoppskrifter.png");
  background-size: 300% 100%;
}

.detail-photo.image-0 {
  background-position: left center;
}

.detail-photo.image-1 {
  background-position: center center;
}

.detail-photo.image-2 {
  background-position: right center;
}

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

.detail-heading h2 {
  margin-bottom: 8px;
  font-size: 40px;
}

.detail-columns {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 30px;
  margin-top: 28px;
}

.detail-delete-button {
  margin-right: auto;
}

#detail-content[aria-busy="true"] .button {
  cursor: wait;
  opacity: 0.58;
}

.detail-columns h3 {
  margin-bottom: 10px;
}

.detail-columns ul {
  padding-left: 19px;
}

.detail-note {
  margin-top: 24px;
  padding: 17px;
  border-left: 3px solid var(--accent);
  background: var(--forest-soft);
}

.toast {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 13px 17px;
  border-radius: var(--radius-control);
  background: var(--ink);
  color: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 10;
    width: min(300px, 88vw);
    transform: translateX(-105%);
    box-shadow: var(--shadow);
    transition: transform 220ms ease;
  }

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

  .mobile-menu {
    display: block;
  }

  .recipe-card,
  .recipe-card:first-child,
  .recipe-card:nth-child(2) {
    grid-column: span 6;
  }

  .recipe-card:first-child .recipe-image,
  .recipe-card:nth-child(2) .recipe-image {
    min-height: 250px;
  }
}

@media (max-width: 700px) {
  .topbar {
    min-height: 64px;
    padding-inline: 16px;
  }

  .search-wrap {
    grid-template-columns: auto 1fr;
  }

  .search-wrap kbd {
    display: none;
  }

  .topbar .button span {
    display: none;
  }

  .topbar .button {
    padding-inline: 12px;
  }

  .content {
    padding: 36px 16px 60px;
  }

  .intro {
    grid-template-columns: 1fr;
  }

  .intro h1,
  .family-heading h1 {
    font-size: 42px;
  }

  .edition-note {
    display: none;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar select {
    width: 100%;
    margin-left: 0;
  }

  .recipe-card,
  .recipe-card:first-child,
  .recipe-card:nth-child(2) {
    grid-column: 1 / -1;
  }

  .recipe-card .recipe-image,
  .recipe-card:first-child .recipe-image,
  .recipe-card:nth-child(2) .recipe-image {
    min-height: 235px;
  }

  .book-workspace {
    grid-template-columns: 1fr;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .book-cover {
    width: min(100%, 420px);
    margin: 0 auto;
  }

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

  .image-upload-layout {
    grid-template-columns: 1fr;
  }

  .image-preview {
    min-height: 200px;
  }

  .member-list article {
    grid-template-columns: 52px 1fr;
  }

  .member-list article > span:last-child {
    grid-column: 2;
  }

  .invite-result {
    grid-template-columns: 1fr;
  }
}

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

@media print {
  :root {
    --ink: #17211b;
    --muted: #566259;
    --surface: #fff;
    --surface-strong: #fff;
  }

  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .publishing-panel,
  .toast,
  dialog {
    display: none !important;
  }

  .app-shell,
  .book-workspace {
    display: block;
  }

  .view {
    display: none !important;
  }

  #book-view {
    display: block !important;
  }

  .content {
    padding: 0;
  }

  .book-cover {
    width: 100%;
    height: 100vh;
    box-shadow: none;
    break-after: page;
  }

  .book-cover::after {
    content: "Oppskriftene er samlet fra familiens digitale kokebok.";
    position: absolute;
    right: 10%;
    bottom: 7%;
    left: 10%;
    color: #657068;
    font-size: 12pt;
  }
}
