:root {
  --sheet-line: #d5d7da;
  --sheet-line-strong: #b9bdc3;
  --sheet-chrome: #f7f8f9;
  --sheet-ink: #111111;
  --sheet-blue: #0000ee;
  --sheet-select: #1a73e8;
  --sheet-green: #188038;
}

body:has(.recipe-sheet-app) {
  min-width: 0;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  background: #ffffff;
}

body:has(.recipe-sheet-app) .site-footer {
  display: none !important;
}

.recipe-sheet-app,
.recipe-sheet-app * {
  box-sizing: border-box;
}

.recipe-sheet-app {
  position: fixed;
  inset: 72px 0 0;
  z-index: 20;
  display: grid;
  grid-template-rows: 108px 32px minmax(0, 1fr) 25px;
  width: 100vw;
  height: calc(100dvh - 72px);
  color: var(--sheet-ink);
  background: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.2;
}

.sheet-toolbar {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 32px minmax(250px, 1fr) minmax(520px, 760px);
  align-items: center;
  gap: 12px;
  padding: 6px 14px 6px 8px;
  border-bottom: 1px solid var(--sheet-line);
  background: #ffffff;
  box-shadow: 0 1px 2px rgb(60 64 67 / 10%);
}

.sheet-toolbar__filters {
  display: grid;
  grid-template-columns: 112px 155px minmax(210px, 1fr);
  gap: 7px;
  min-width: 0;
}

.sheet-toolbar__back {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #3c4043;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
}

.sheet-toolbar__back:hover,
.sheet-toolbar__back:focus-visible {
  color: #202124;
  background: #f1f3f4;
  outline: none;
}

.sheet-toolbar__identity {
  min-width: 0;
}

.sheet-toolbar__identity h1,
.sheet-toolbar__identity p {
  margin: 0;
}

.sheet-toolbar__identity h1 {
  overflow: hidden;
  color: #202124;
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(26px, 3vw, 43px);
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-toolbar__identity p {
  padding-top: 2px;
  color: #5f6368;
  font-family: "Times New Roman", Times, serif;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

.sheet-toolbar__identity small { display: block; padding-top: 5px; color: #5f6368; font-size: 9px; letter-spacing: .05em; text-transform: uppercase; }

.sheet-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: #f8f9fa;
}

.sheet-search:focus-within {
  border-color: var(--sheet-select);
  background: #ffffff;
  box-shadow: 0 0 0 1px var(--sheet-select);
}

.sheet-search span {
  margin-right: 9px;
  color: #5f6368;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sheet-search input {
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  color: #202124;
  background: transparent;
  font: 12px/1.2 Arial, Helvetica, sans-serif;
}

.sheet-search input::placeholder {
  color: #80868b;
}

.sheet-day-filter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: #f8f9fa;
}

.sheet-day-filter span { color: #5f6368; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.sheet-day-filter select { min-width: 0; border: 0; color: #202124; background: transparent; font: 12px/1.2 Arial, sans-serif; }

.sheet-formula {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 64px 34px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  border-bottom: 1px solid var(--sheet-line);
  color: #3c4043;
  background: #ffffff;
  font-size: 11px;
}

.sheet-formula__name,
.sheet-formula__fx,
.sheet-formula__value {
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0 9px;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
}

.sheet-formula__name {
  border-right: 1px solid var(--sheet-line);
  text-align: center;
}

.sheet-formula__fx {
  color: #5f6368;
  font-family: Georgia, serif;
  font-style: italic;
  text-align: center;
}

.sheet-formula__value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #bdc1c6 #f1f3f4;
  scrollbar-width: thin;
  outline: none;
  background: #ffffff;
}

.recipe-grid {
  display: grid;
  grid-template-columns: 34px repeat(7, minmax(0, 1fr));
  grid-template-rows: 26px repeat(18, minmax(47px, auto));
  align-content: start;
  width: 100%;
  min-width: 0;
  min-height: 100%;
  background: #ffffff;
}

.sheet-corner,
.sheet-column,
.sheet-row {
  position: sticky;
  z-index: 3;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--sheet-line-strong);
  border-bottom: 1px solid var(--sheet-line-strong);
  color: #4b4f52;
  background: var(--sheet-chrome);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  font-weight: 400;
  user-select: none;
}

.sheet-corner {
  top: 0;
  left: 0;
  z-index: 5;
}

.sheet-corner::after {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 0;
  height: 0;
  border-right: 0;
  border-bottom: 0;
  border-top: 7px solid transparent;
  border-left: 7px solid #9aa0a6;
  content: "";
}

.sheet-column {
  top: 0;
}

.sheet-row {
  left: 0;
}

.sheet-cell {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 47px;
  padding: 5px 9px;
  border-right: 1px solid var(--sheet-line);
  border-bottom: 1px solid var(--sheet-line);
  color: #050505;
  background: #ffffff;
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(8px, .7vw, 13px);
  font-weight: 400;
  line-height: 1.02;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.sheet-cell__day {
  position: absolute;
  top: 3px;
  left: 4px;
  color: #5f6368;
  font: 700 7px/1 Arial, sans-serif;
  letter-spacing: .04em;
}

.sheet-cell--major {
  font-size: clamp(9px, .8vw, 15px);
  font-weight: 700;
}

.sheet-cell:hover,
.sheet-cell:focus-visible {
  z-index: 2;
  color: var(--sheet-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  outline: 2px solid var(--sheet-select);
  outline-offset: -2px;
}

.sheet-cell[aria-current="true"] {
  z-index: 2;
  outline: 2px solid var(--sheet-select);
  outline-offset: -2px;
}

.sheet-cell[aria-current="true"]::after {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 6px;
  height: 6px;
  border: 1px solid #ffffff;
  background: var(--sheet-select);
  content: "";
}

.sheet-cell[data-live-url]::before {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sheet-green);
  content: "";
}

.sheet-cell.is-filtered-out {
  color: transparent;
  background: #fafafa;
  pointer-events: none;
}

.recipe-grid.is-filtering {
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: 26px repeat(126, minmax(48px, auto));
}
.recipe-grid.is-filtering .sheet-cell { min-height: 48px; padding-inline: 18px; font-size: 15px; }
.sheet-cell.is-access-locked { cursor: not-allowed; }
.sheet-cell.is-access-locked::after { content: "LOCKED"; position: absolute; right: 4px; bottom: 3px; color: #777; font: 700 6px/1 Arial, sans-serif; letter-spacing: .05em; }

.sheet-status {
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  margin: 0;
  padding: 0 12px;
  border-top: 1px solid var(--sheet-line);
  color: #5f6368;
  background: var(--sheet-chrome);
  font: 10px/1 Arial, Helvetica, sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.recipe-reader {
  width: min(920px, calc(100vw - 36px));
  height: min(820px, calc(100dvh - 36px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #aeb2b7;
  border-radius: 0;
  color: #111111;
  background: #fdfcf8;
  box-shadow: 0 18px 60px rgb(0 0 0 / 28%);
}

.recipe-reader::backdrop {
  background: rgb(32 33 36 / 52%);
  backdrop-filter: blur(2px);
}

.recipe-reader__paper {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  margin: 0;
  background-color: #fdfcf8;
  background-image: linear-gradient(to bottom, transparent 31px, rgb(45 68 89 / 8%) 32px);
  background-size: 100% 32px;
}

.recipe-reader__day { display: flex; gap: 12px; margin: 7px 0 0; color: #5f6368; font: 700 10px/1.2 Arial, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.recipe-reader__day a { color: var(--sheet-blue); }

@media (max-width: 700px) {
  .sheet-toolbar { grid-template-columns: 30px minmax(148px, .7fr) minmax(350px, 1.3fr); gap: 6px; padding-right: 6px; }
  .sheet-toolbar__filters { grid-template-columns: 76px 112px minmax(150px, 1fr); gap: 4px; }
  .sheet-search { padding: 0 6px; }
  .sheet-search span { display: none; }
  .sheet-day-filter { grid-template-columns: 1fr; padding: 0 4px; }
  .sheet-day-filter span { display: none; }
}

.recipe-reader__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 20px;
  align-items: start;
  padding: 28px clamp(24px, 5vw, 60px) 20px;
  border-bottom: 2px solid #111111;
  background: rgb(253 252 248 / 97%);
}

.recipe-reader__eyebrow,
.recipe-reader__header h2 {
  margin: 0;
}

.recipe-reader__eyebrow {
  padding-bottom: 7px;
  color: #5d5a53;
  font: 10px/1.2 Arial, Helvetica, sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.recipe-reader__header h2 {
  max-width: 760px;
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(24px, 4vw, 45px);
  font-weight: 700;
  line-height: .95;
  text-transform: uppercase;
}

.recipe-reader__close {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid #9a978f;
  border-radius: 0;
  color: #111111;
  background: #fdfcf8;
  font: 26px/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.recipe-reader__close:hover,
.recipe-reader__close:focus-visible,
.recipe-reader__footer button:hover,
.recipe-reader__footer button:focus-visible {
  color: #ffffff;
  background: #111111;
  outline: none;
}

.recipe-reader__note {
  margin: 0;
  padding: 14px clamp(24px, 5vw, 60px);
  border-bottom: 1px solid #c7bfae;
  color: #4b3d21;
  background: #f1e9d8;
  font: 12px/1.4 Arial, Helvetica, sans-serif;
}

.recipe-reader__source {
  min-height: 0;
  padding: 24px clamp(24px, 5vw, 60px) 48px;
  overflow: auto;
  scrollbar-color: #8c8981 transparent;
}

.recipe-source-page {
  max-width: 72ch;
  margin: 0 auto 34px;
  padding-bottom: 32px;
  border-bottom: 1px solid #b7b2a7;
}

.recipe-source-page:last-child {
  margin-bottom: 0;
  border-bottom: 0;
}

.recipe-source-page__label {
  display: block;
  margin-bottom: 11px;
  color: #706d66;
  font: 10px/1.2 Arial, Helvetica, sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.recipe-source-page__text {
  margin: 0;
  color: #111111;
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(15px, 2vw, 19px);
  line-height: 1.55;
  white-space: pre-line;
}

.recipe-source-page__empty {
  margin: 0;
  padding: 32px;
  border: 1px solid #b7b2a7;
  background: rgb(255 255 255 / 58%);
  font-family: "Times New Roman", Times, serif;
  font-size: 18px;
  line-height: 1.5;
  text-align: center;
}

.recipe-reader__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px clamp(24px, 5vw, 60px);
  border-top: 1px solid #9a978f;
  background: #f5f2ea;
  font: 10px/1.3 Arial, Helvetica, sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.recipe-access-dialog {
  width: min(360px, calc(100vw - 34px));
  padding: 29px;
  border: 2px solid #111;
  color: #111;
  background: #fffdf2;
  box-shadow: 9px 9px 0 rgba(0,0,0,.28);
  text-align: center;
}
.recipe-access-dialog::backdrop { background: rgba(0,0,0,.34); }
.recipe-access-dialog h2 { margin: 0 0 20px; font: 700 27px/1.05 "Times New Roman", Times, serif; }
.recipe-access-dialog > a { display: inline-block; border: 2px solid #111; padding: 10px 20px; color: #fff; background: #111; font: 700 12px/1 Arial, sans-serif; text-decoration: none; text-transform: uppercase; }
.recipe-access-dialog__close { position: absolute; top: 6px; right: 8px; border: 0; color: #111; background: transparent; font: 24px/1 Arial, sans-serif; cursor: pointer; }

.recipe-reader__footer button {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #111111;
  color: #111111;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

@media (max-width: 680px) {
  .recipe-sheet-app {
    grid-template-rows: 151px 32px minmax(0, 1fr) 23px;
  }

  .sheet-toolbar {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 7px;
    padding-right: 8px;
  }

  .sheet-toolbar__identity h1 { font-size: 29px; }
  .sheet-toolbar__identity p { font-size: 11px; }
  .sheet-toolbar__identity small { display: none; }

  .sheet-toolbar__filters { grid-column: 1 / -1; grid-template-columns: 78px 112px minmax(0, 1fr); }

  .sheet-search {
    padding: 0 8px;
  }

  .sheet-search span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .recipe-grid {
    grid-template-columns: 26px repeat(7, minmax(0, 1fr));
    min-width: 0;
  }

  .sheet-cell {
    min-height: 44px;
    padding: 3px 2px;
    font-size: 7px;
  }

  .sheet-cell--major {
    font-size: 8px;
  }

  .sheet-cell__day { top: 2px; left: 2px; font-size: 5px; }
  .recipe-grid.is-filtering { grid-template-columns: 26px minmax(0, 1fr); }
  .recipe-grid.is-filtering .sheet-cell { min-height: 50px; padding-inline: 10px; font-size: 14px; }

  .recipe-reader {
    width: 100vw;
    height: 100dvh;
    border: 0;
  }

  .recipe-reader__header {
    gap: 10px;
    padding: 20px 18px 16px;
  }

  .recipe-reader__header h2 {
    font-size: 27px;
  }

  .recipe-reader__note,
  .recipe-reader__source,
  .recipe-reader__footer {
    padding-right: 18px;
    padding-left: 18px;
  }

  .recipe-reader__footer span { display: none; }

  .recipe-reader__footer { justify-content: space-between; }
  .recipe-reader__footer [data-reader-close] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .recipe-sheet-app *,
  .recipe-sheet-app *::before,
  .recipe-sheet-app *::after {
    scroll-behavior: auto !important;
  }
}

@media print {
  body:has(.recipe-sheet-app) {
    overflow: visible;
  }

  .recipe-sheet-app {
    position: static;
    display: block;
    width: auto;
    height: auto;
  }

  .sheet-toolbar,
  .sheet-formula,
  .sheet-status,
  .recipe-reader {
    display: none;
  }

  .sheet-viewport {
    overflow: visible;
  }

  .recipe-grid {
    min-width: 0;
    grid-template-columns: 28px repeat(7, minmax(0, 1fr));
  }

  .sheet-corner,
  .sheet-column,
  .sheet-row {
    position: static;
  }

  .sheet-cell {
    min-height: 38px;
    padding: 3px;
    font-size: 8px;
  }
}
