/* Desktop layout. Linked with
   media="(min-width: 1024px) and (hover: hover) and (pointer: fine)"
   so these rules never apply to the phone layout. */

.app {
  max-width: 1120px;
}

html.is-desktop .app:has(.desk-nav) {
  max-width: none;
  margin: 0;
  padding:
    calc(18px + var(--safe-top))
    calc(36px + var(--safe-right))
    calc(32px + var(--safe-bottom))
    calc(308px + var(--safe-left));
}

html.is-desktop .app:has(.desk-nav) .desk-toolbar,
html.is-desktop .app:has(.desk-nav) .view,
html.is-desktop .app:has(.desk-nav) .status,
html.is-desktop .app:has(.desk-nav) .top {
  width: min(1120px, 100%);
  margin-left: auto;
  margin-right: auto;
}

html.is-desktop .desk-nav {
  position: fixed;
  z-index: 5;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: 280px;
  padding-top: var(--safe-top);
  background:
    linear-gradient(180deg, rgba(16, 36, 48, 0.94), rgba(7, 16, 24, 0.92));
  border-right: 1px solid var(--line);
  box-shadow: 16px 0 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.desk-nav::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--cyan));
}

.desk-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 24px);
  margin: 16px 12px 8px;
  padding: 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--gold);
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  text-align: left;
  cursor: pointer;
}

.desk-logo img {
  width: 36px;
  height: 36px;
  flex: none;
}

.desk-logo span {
  white-space: nowrap;
}

.desk-logo:hover {
  background: var(--gold-soft);
}

.desk-logo:focus-visible,
.desk-cat:focus-visible,
.desk-group:focus-visible,
.desk-more:focus-visible,
.desk-filter-clear:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.desk-scroll {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 4px 12px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(94, 200, 216, 0.35) transparent;
}

.desk-kicker {
  margin: 16px 8px 8px;
  font-family: var(--font-brand);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}

.desk-cats,
.desk-groups {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.desk-cats {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(94, 200, 216, 0.35) transparent;
}

.desk-scroll:has(#deskGroups:not(:empty)) .desk-cats {
  flex: 0 1 auto;
  max-height: 46%;
}

.desk-groups:empty {
  display: none;
}

.desk-groups:not(:empty) {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 8px;
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(94, 200, 216, 0.35) transparent;
}

.desk-cat,
.desk-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: 500 0.92rem/1.25 var(--font-body);
  text-align: left;
  cursor: pointer;
}

.desk-group {
  padding-left: 16px;
  font-size: 0.84rem;
  color: #d5e4ea;
}

.desk-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desk-count {
  flex: none;
  color: var(--muted);
  font-family: var(--font-brand);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.desk-cat:hover,
.desk-group:hover {
  background: var(--cyan-soft);
}

.desk-cat[aria-pressed="true"] {
  background: linear-gradient(90deg, rgba(226, 177, 74, 0.2), rgba(226, 177, 74, 0.05));
  color: var(--gold);
  box-shadow: inset 3px 0 0 var(--gold);
}

.desk-cat[aria-pressed="true"] .desk-count,
.desk-group[aria-pressed="true"] .desk-count {
  color: inherit;
}

.desk-group[aria-pressed="true"] {
  background: var(--cyan-soft);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--cyan);
}

.desk-keys {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.desk-keys ul {
  list-style: none;
  margin: 0;
  padding: 0 8px;
  display: grid;
  gap: 8px;
}

.desk-keys li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.desk-keys kbd,
.desk-kbd-float kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4em;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: var(--font-brand);
  font-size: 0.75rem;
  line-height: 1.4;
}

.desk-foot {
  border-top: 1px solid var(--line);
  padding: 14px 14px calc(14px + var(--safe-bottom));
}

.desk-nav .site-footer {
  margin: 0;
  padding: 0;
  border: 0;
  align-items: stretch;
  text-align: left;
}

.desk-nav .tip-link {
  width: 100%;
  margin: 0 0 10px;
}

.desk-nav .tip-link:hover {
  text-decoration: none;
  border-color: var(--gold);
  background: rgba(226, 177, 74, 0.28);
}

.desk-nav .credit {
  text-align: left;
  font-size: 0.72rem;
}

html.is-desktop .app:has(.desk-nav) .brand {
  display: none;
}

html.is-desktop .app:has(.desk-nav) .top {
  display: flex;
  justify-content: flex-start;
  margin: 0 auto 8px;
}

html.is-desktop .app:has(.desk-nav) .top:has(.back[hidden]),
html.is-desktop .app:has(.desk-nav) .top:not(:has(.back)) {
  display: none;
}

html.is-desktop .back:hover {
  border-color: rgba(94, 200, 216, 0.55);
  background: var(--cyan-soft);
}

.desk-toolbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 6px 0 12px;
  background: linear-gradient(180deg, rgba(7, 16, 24, 0.96) 0%, rgba(7, 16, 24, 0.88) 72%, rgba(7, 16, 24, 0) 100%);
}

html.is-desktop .desk-toolbar .back {
  flex: none;
}

html.is-desktop .desk-toolbar .back[hidden] {
  display: none !important;
}

html.is-desktop .desk-toolbar .search-form {
  flex: 1 1 280px;
  margin: 0;
}

html.is-desktop .desk-toolbar .desk-filter,
html.is-desktop .desk-toolbar .consent {
  flex: 1 0 100%;
  margin-top: 0;
}

html.is-desktop .search-form {
  position: relative;
  margin-top: 0;
}

html.is-desktop .desk-toolbar .search-input {
  min-height: 52px;
  padding-right: 64px;
  font-size: 1.05rem;
}

.desk-kbd-float {
  position: absolute;
  right: 16px;
  top: 50%;
  margin: 0;
  transform: translateY(-50%);
  pointer-events: none;
}

html.is-desktop .search-input:focus ~ .desk-kbd-float,
html.is-desktop .search-input:not(:placeholder-shown) ~ .desk-kbd-float {
  opacity: 0;
}

.desk-filter:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin-top: 10px;
  padding: 4px 4px 4px 12px;
  border: 1px solid rgba(226, 177, 74, 0.45);
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 0.84rem;
}

.desk-filter-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desk-filter-clear {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: 700 1rem/1 var(--font-brand);
  cursor: pointer;
}

.desk-filter-clear:hover {
  background: rgba(226, 177, 74, 0.2);
}

html.is-desktop .consent:not([hidden]) {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

html.is-desktop .consent-actions {
  grid-template-columns: auto auto;
}

html.is-desktop .consent-btn {
  width: auto;
  min-width: 124px;
}

html.is-desktop .consent-btn:hover {
  filter: brightness(1.08);
}

html.is-desktop .install-hint {
  display: none !important;
}

html.is-desktop .hint {
  font-size: 0.98rem;
}

html.is-desktop .desk-colhead[hidden] {
  display: none !important;
}

html.is-desktop .desk-colhead {
  display: grid;
  grid-template-columns: 36px minmax(0, 1.5fr) minmax(140px, 1fr) 108px 72px;
  gap: 10px 12px;
  align-items: end;
  padding: 0 14px 6px;
  color: var(--muted);
  font-family: var(--font-brand);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

html.is-desktop .desk-colhead .col-recipes,
html.is-desktop .result-kinds,
html.is-desktop .result-count {
  text-align: right;
}

html.is-desktop .results:has(.result) {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 18, 26, 0.55);
  overflow: hidden;
}

html.is-desktop .results > li {
  animation: none;
}

html.is-desktop .result {
  grid-template-columns: 36px minmax(0, 1.5fr) minmax(140px, 1fr) 108px 72px;
  gap: 10px 12px;
  align-items: center;
  min-height: 52px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

html.is-desktop .results > li:last-child .result {
  border-bottom: 0;
}

html.is-desktop .result-text {
  display: contents;
}

html.is-desktop .result-icon {
  width: 36px;
  height: 36px;
}

html.is-desktop .result-name,
html.is-desktop .result-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.is-desktop .result-name {
  font-size: 0.98rem;
}

html.is-desktop .result-meta {
  margin-top: 0;
  align-self: center;
}

html.is-desktop .result-kinds {
  align-self: center;
  font-size: 0.68rem;
}

html.is-desktop .result-count {
  font-family: var(--font-brand);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

html.is-desktop .result:hover {
  background: rgba(94, 200, 216, 0.1);
}

html.is-desktop .result.is-kbd {
  background: rgba(94, 200, 216, 0.14);
  box-shadow: inset 3px 0 0 var(--cyan);
}

html.is-desktop .desk-more {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--cyan);
  font-family: var(--font-brand);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  cursor: pointer;
}

html.is-desktop .desk-more:hover {
  background: var(--cyan-soft);
}

html.is-desktop .item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 36px;
  align-items: start;
}

html.is-desktop .item-hero,
html.is-desktop .item-desc {
  grid-column: 1 / -1;
}

html.is-desktop .item-hero {
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 20px;
}

html.is-desktop .item-icon {
  width: 96px;
  height: 96px;
}

html.is-desktop .item-name {
  font-size: 2.15rem;
}

html.is-desktop .item-desc {
  max-width: 78ch;
  font-size: 1.05rem;
}

html.is-desktop .section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

html.is-desktop .section-count {
  color: var(--gold);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
}

html.is-desktop .recipe {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "kind time"
    "op op"
    "flow flow";
  gap: 6px 12px;
  align-items: center;
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 20, 28, 0.55);
}

html.is-desktop .recipe-kind {
  grid-area: kind;
  margin: 0;
}

html.is-desktop .recipe-time {
  grid-area: time;
  justify-self: end;
  color: var(--muted);
  font-family: var(--font-brand);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

html.is-desktop .recipe-op {
  grid-area: op;
  margin: 0;
}

html.is-desktop .recipe-flow {
  grid-area: flow;
}

html.is-desktop .chip:hover {
  transform: translateY(-1px);
}

@media (max-width: 1280px) {
  html.is-desktop .item {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1240px) {
  html.is-desktop .desk-colhead,
  html.is-desktop .result {
    grid-template-columns: 36px minmax(0, 1fr) 108px 64px;
  }

  html.is-desktop .result-meta,
  html.is-desktop .col-group {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.is-desktop .chip:hover {
    transform: none;
  }
}

/* Top-right ad. Wide desktop windows reserve a rail; narrower ones float it
   at the top of the item. The phone stylesheet never includes these rules. */
html.is-desktop .ad-kicker {
  margin: 0 0 8px;
  font-family: var(--font-brand);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 1319px) {
  html.is-desktop .view-item .ad-slot:not([hidden]) {
    float: right;
    width: 324px;
    margin: 0 0 16px 18px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(8, 20, 28, 0.82);
  }

  html.is-desktop .view-item::after {
    content: "";
    display: table;
    clear: both;
  }
}

@media (min-width: 1320px) {
  html.is-desktop .desk-ad-rail:has(#adSlot:not([hidden])) {
    display: block;
    position: fixed;
    z-index: 6;
    top: calc(16px + var(--safe-top));
    right: calc(18px + var(--safe-right));
    width: 324px;
  }

  html.is-desktop .desk-ad-rail:has(#adSlot[hidden]) {
    display: none;
  }

  html.is-desktop .app:has(#deskAdRail):has(#adSlot:not([hidden])) {
    padding-right: calc(364px + var(--safe-right));
  }

  html.is-desktop #deskAdRail .ad-slot:not([hidden]) {
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(8, 20, 28, 0.9);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(16px);
  }

  html.is-desktop #deskAdRail .ad-slot[hidden] {
    display: none !important;
  }

}

@media (min-width: 1320px) and (max-width: 1560px) {
  html.is-desktop .app:has(#adSlot:not([hidden])) .item {
    grid-template-columns: minmax(0, 1fr);
  }
}
