/*
 * Tenka Farm v7.0.8
 * Final viewport, responsive navigation, account dropdown, invoice, and confirmation layer.
 * This file is intentionally loaded last so its constraints stay authoritative.
 */

:root {
  --container: min(1480px, calc(100% - 64px));
}

.ok-account-link > img,
.mobile-bottom-avatar {
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  object-fit: cover;
}

/* Desktop account navigation: cart sits before the account and the account is
   the final action. Every avatar is physically locked to a square so a tight
   header can never compress it into a vertical pill. */
@media (min-width: 1051px) {
  .ok-header-main__inner {
    grid-template-columns: minmax(190px, 214px) minmax(240px, 1fr) auto;
    gap: clamp(14px, 2vw, 32px);
  }

  .ok-header-actions {
    min-width: max-content;
    justify-content: flex-end;
  }

  .ok-header-actions > .ok-cart-pill,
  .ok-account-menu,
  .ok-account-menu__trigger,
  .ok-account-menu__trigger > img {
    flex-shrink: 0;
  }

  .ok-account-menu {
    position: relative;
    z-index: 20;
    display: inline-flex;
    min-width: 0;
  }

  .ok-account-menu__trigger {
    width: auto;
    min-width: 176px;
    max-width: 220px;
    min-height: 50px;
    justify-content: flex-start;
    gap: 10px;
    padding: 4px 11px 4px 5px;
    cursor: pointer;
    background: #fff;
    border: 1px solid #dce5df;
    box-shadow: 0 6px 18px rgba(7, 44, 34, .045);
    transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
  }

  .ok-account-link--guest {
    width: auto;
    min-width: 132px;
    min-height: 50px;
    flex: 0 0 auto;
    justify-content: flex-start;
    gap: 10px;
    order: 3;
    padding: 4px 14px 4px 5px;
    cursor: pointer;
    background: #fff;
    border: 1px solid #dce5df;
    box-shadow: 0 6px 18px rgba(7, 44, 34, .045);
  }

  .ok-account-link--guest:hover,
  .ok-account-link--guest:focus-visible {
    background: #f5f8f5;
    border-color: #aebfb5;
    box-shadow: 0 0 0 4px rgba(10, 91, 65, .07), 0 12px 28px rgba(7, 44, 34, .08);
    outline: 0;
  }

  .ok-account-link--guest > img {
    display: block;
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    aspect-ratio: 1 / 1;
    flex: 0 0 40px;
    object-fit: cover;
    background: #edf3ef;
    border: 1px solid #d3e0d8;
    border-radius: 50%;
  }

  .ok-account-link--guest > span {
    min-width: 0;
    text-align: left;
  }

  .ok-account-menu__trigger:hover,
  .ok-account-menu__trigger:focus-visible,
  .ok-account-menu__trigger[aria-expanded="true"] {
    color: var(--forest-deep);
    background: #f5f8f5;
    border-color: #aebfb5;
    box-shadow: 0 0 0 4px rgba(10, 91, 65, .07), 0 12px 28px rgba(7, 44, 34, .08);
    outline: 0;
  }

  .ok-account-menu__trigger > img,
  .ok-account-dropdown__identity > img {
    display: block;
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    aspect-ratio: 1 / 1;
    flex: 0 0 40px;
    object-fit: cover;
    background: #edf3ef;
    border: 1px solid #d3e0d8;
    border-radius: 50%;
  }

  .ok-account-menu__trigger > span {
    min-width: 0;
    flex: 1 1 auto;
    text-align: left;
  }

  .ok-account-menu__trigger > span strong {
    overflow: hidden;
    font-size: .72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ok-account-menu__trigger > span small {
    font-size: .54rem;
  }

  .ok-account-menu__chevron {
    width: 12px !important;
    min-width: 12px;
    height: 8px;
    margin-left: auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
    transition: transform .2s ease;
  }

  .ok-account-menu__trigger[aria-expanded="true"] .ok-account-menu__chevron {
    transform: rotate(180deg);
  }

  .ok-account-dropdown {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    z-index: 110;
    width: min(390px, calc(100vw - 40px));
    max-height: calc(100vh - 155px);
    padding: 14px;
    overflow-x: hidden;
    overflow-y: auto;
    color: var(--forest-deep);
    background: rgba(255, 255, 255, .985);
    border: 1px solid #d9e4dd;
    border-radius: 22px;
    box-shadow: 0 28px 70px rgba(5, 34, 26, .19), 0 7px 20px rgba(5, 34, 26, .08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(.985);
    transform-origin: top right;
    pointer-events: none;
    scrollbar-width: thin;
    scrollbar-color: #bacac0 transparent;
    transition: opacity .2s ease, visibility .2s ease, transform .24s cubic-bezier(.22, 1, .36, 1);
  }

  .ok-account-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  .ok-account-dropdown__identity {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    padding: 14px;
    overflow: hidden;
    background: linear-gradient(135deg, #edf5f0 0%, #fbfaf4 100%);
    border: 1px solid #e0e9e3;
    border-radius: 16px;
  }

  .ok-account-dropdown__identity::after {
    position: absolute;
    right: -24px;
    bottom: -34px;
    width: 92px;
    height: 92px;
    content: "";
    background: rgba(207, 163, 42, .11);
    border-radius: 50%;
  }

  .ok-account-dropdown__identity > img {
    width: 56px;
    min-width: 56px;
    max-width: 56px;
    height: 56px;
    min-height: 56px;
    max-height: 56px;
    flex-basis: 56px;
    border: 2px solid #fff;
    box-shadow: 0 5px 14px rgba(7, 44, 34, .11);
  }

  .ok-account-dropdown__identity > span,
  .ok-account-dropdown__identity small,
  .ok-account-dropdown__identity strong,
  .ok-account-dropdown__identity em {
    display: block;
    min-width: 0;
  }

  .ok-account-dropdown__identity > span {
    position: relative;
    z-index: 1;
    overflow: hidden;
  }

  .ok-account-dropdown__identity small {
    margin-bottom: 3px;
    color: #8c6a15;
    font-size: .48rem;
    font-weight: 800;
    letter-spacing: .08em;
  }

  .ok-account-dropdown__identity strong {
    overflow: hidden;
    font-size: .86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ok-account-dropdown__identity em {
    margin-top: 2px;
    overflow: hidden;
    color: #74827b;
    font-size: .58rem;
    font-style: normal;
    font-weight: 550;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ok-account-dropdown__verify {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    padding: 10px 12px;
    color: #785a11;
    background: #fff8e5;
    border: 1px solid #f0dea5;
    border-radius: 12px;
    font-size: .58rem;
    font-weight: 750;
  }

  .ok-account-dropdown__quick {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  .ok-account-dropdown__quick > a {
    display: grid;
    min-width: 0;
    min-height: 68px;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 10px;
    color: var(--forest-deep);
    background: #fff;
    border: 1px solid #e0e7e2;
    border-radius: 13px;
    transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
  }

  .ok-account-dropdown__quick > a:hover,
  .ok-account-dropdown__quick > a:focus-visible {
    background: #f3f8f4;
    border-color: #afc2b7;
    outline: 0;
    transform: translateY(-1px);
  }

  .ok-account-dropdown__quick svg,
  .ok-account-dropdown__links svg,
  .ok-account-dropdown__logout svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
  }

  .ok-account-dropdown__quick svg {
    width: 30px;
    height: 30px;
    padding: 6px;
    color: var(--forest);
    background: #edf5f0;
    border-radius: 9px;
  }

  .ok-account-dropdown__quick span,
  .ok-account-dropdown__quick strong,
  .ok-account-dropdown__quick small,
  .ok-account-dropdown__links span,
  .ok-account-dropdown__links strong,
  .ok-account-dropdown__links small {
    display: block;
    min-width: 0;
  }

  .ok-account-dropdown__quick strong,
  .ok-account-dropdown__links strong {
    font-size: .7rem;
  }

  .ok-account-dropdown__quick small,
  .ok-account-dropdown__links small {
    margin-top: 2px;
    color: #7f8b85;
    font-size: .55rem;
    font-weight: 550;
    line-height: 1.35;
  }

  .ok-account-dropdown__label {
    margin: 14px 5px 6px;
    color: #89958f;
    font-size: .48rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
  }

  .ok-account-dropdown__links {
    display: grid;
    gap: 2px;
  }

  .ok-account-dropdown__links > a {
    display: grid;
    min-width: 0;
    min-height: 54px;
    grid-template-columns: 28px minmax(0, 1fr) 14px;
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    color: var(--forest-deep);
    border-radius: 11px;
    transition: background-color .18s ease, color .18s ease;
  }

  .ok-account-dropdown__links > a:hover,
  .ok-account-dropdown__links > a:focus-visible {
    color: var(--forest);
    background: #f2f7f3;
    outline: 0;
  }

  .ok-account-dropdown__links > a > svg {
    color: #3f7462;
  }

  .ok-account-dropdown__links > a > b {
    color: #8c9992;
    font-size: .68rem;
  }

  .ok-account-dropdown__logout {
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid #e5ebe7;
  }

  .ok-account-dropdown__logout button {
    display: flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    color: #9b3f38;
    background: #fff7f6;
    border: 1px solid #f0d9d6;
    border-radius: 11px;
    cursor: pointer;
    font: inherit;
    font-size: .66rem;
    font-weight: 750;
  }

  .ok-account-dropdown__logout button:hover,
  .ok-account-dropdown__logout button:focus-visible {
    color: #fff;
    background: #9b3f38;
    border-color: #9b3f38;
    outline: 0;
  }
}

/* A real editorial container: content stays centred without becoming a narrow
   desktop island on large monitors. */
@media (min-width: 821px) {
  .container,
  .ok-header-main__inner,
  .ok-header-nav__inner,
  .announcement__inner,
  .ok-footer-grid,
  .footer-bottom,
  .ok-product-information--flow > .container {
    width: calc(100% - 64px) !important;
    max-width: 1480px !important;
    margin-right: auto !important;
    margin-left: auto !important;
  }
}

/* Compact desktop mega menus: the panel follows its content, not the screen. */
@media (min-width: 1051px) {
  .mega-menu {
    padding: 18px 0 28px;
  }

  .mega-menu .ok-mega-shell {
    width: min(1180px, calc(100vw - 80px));
    max-width: 1180px;
    min-height: 0;
    grid-template-columns: 260px repeat(3, minmax(0, 1fr));
    margin-inline: auto;
    overflow: hidden;
    border-radius: 22px;
  }

  .mega-menu .ok-mega-shell--programs {
    width: min(1240px, calc(100vw - 80px));
    max-width: 1240px;
    grid-template-columns: 270px repeat(3, minmax(0, 1fr));
  }

  .mega-menu .ok-mega-promo {
    min-height: 330px;
    padding: 31px 27px 27px;
  }

  .mega-menu .ok-mega-promo small {
    top: 31px;
    left: 27px;
  }

  .mega-menu .ok-mega-promo strong {
    font-size: clamp(1.45rem, 1.65vw, 1.95rem);
  }

  .mega-menu .ok-mega-promo p {
    max-width: 245px;
    margin: 13px 0 22px;
    line-height: 1.55;
  }

  .mega-menu .ok-mega-column {
    padding: 31px 23px 23px;
  }

  .mega-menu .ok-mega-column h3 {
    margin-bottom: 10px;
  }

  .mega-menu .ok-mega-column > a,
  .mega-menu .ok-mega-column > .ok-mega-link-disabled {
    min-height: 57px;
    padding: 8px 23px 8px 0;
  }

  .mega-menu .ok-mega-column > a > em {
    max-width: none;
    overflow: visible;
    line-height: 1.4;
    text-overflow: clip;
    white-space: normal;
  }

  .mega-menu .ok-mega-column > a.ok-mega-column__all {
    min-height: 62px;
    margin-top: 5px;
    padding: 11px 13px;
    border-radius: 13px;
  }
}

@media (min-width: 1600px) {
  .ok-header-main__inner {
    grid-template-columns: 220px minmax(440px, 760px) auto;
    justify-content: space-between;
  }

  .ok-header-search {
    width: 100%;
    max-width: 760px;
  }

  /* Full-bleed compositions become framed only on genuinely wide screens. */
  .home-hero {
    padding-block: 28px;
  }

  .home-hero__grid {
    position: relative;
    min-height: 700px;
    grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr);
    gap: 40px;
  }

  .home-hero__copy {
    max-width: 650px;
    padding: 72px 28px 58px 0;
  }

  .home-hero__visual {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: 100%;
    min-height: 700px;
    border-radius: 30px;
  }

  .farm-process {
    width: calc(100% - 64px);
    max-width: 1480px;
    margin-inline: auto;
    overflow: hidden;
    border-radius: 28px;
  }
}

@media (min-width: 2200px) {
  :root {
    --container: min(82vw, 2880px);
  }

  html {
    font-size: 18px;
    scroll-padding-top: 190px;
  }

  body {
    font-size: 17px;
  }

  .container,
  .ok-header-main__inner,
  .ok-header-nav__inner,
  .announcement__inner,
  .ok-footer-grid,
  .footer-bottom,
  .ok-product-information--flow > .container {
    width: min(82vw, 2880px) !important;
    max-width: 2880px !important;
  }

  .ok-header-main__inner {
    min-height: 108px;
    grid-template-columns: 270px minmax(560px, 1040px) auto;
    gap: clamp(40px, 2.4vw, 76px);
  }

  .ok-brand img {
    width: 250px;
  }

  .ok-header-search {
    max-width: 1040px;
  }

  .ok-header-nav,
  .ok-header-nav__inner {
    min-height: 62px;
  }

  .home-hero,
  .home-hero__grid,
  .home-hero__visual {
    min-height: 780px;
  }

  .home-hero__copy {
    max-width: 860px;
    padding: 94px 56px 68px 0;
  }

  .home-hero__lead,
  .home-hero__metrics,
  .home-hero__note {
    max-width: 730px;
  }

  .home-hero__visual {
    width: 100%;
    max-width: 100%;
  }

  .farm-process {
    width: min(82vw, 2880px);
    max-width: 2880px;
  }

  .home-categories .category-grid,
  .home-stock .product-grid {
    width: min(100%, 2480px);
    margin-inline: auto;
  }

  .home-stock .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .home-programs .program-grid {
    max-width: 2320px;
  }

  .ok-related-products .product-grid {
    max-width: 2640px;
  }
}

@media (min-width: 3000px) {
  html {
    font-size: 20px;
    scroll-padding-top: 208px;
  }

  body {
    font-size: 19px;
  }

  .ok-header-main__inner {
    min-height: 118px;
    grid-template-columns: 300px minmax(680px, 1180px) auto;
  }

  .ok-brand img {
    width: 278px;
  }

  .ok-header-search {
    max-width: 1180px;
    min-height: 66px;
  }

  .home-hero,
  .home-hero__grid,
  .home-hero__visual {
    min-height: 860px;
  }

  .home-hero__copy {
    max-width: 940px;
    padding-top: 112px;
  }

  .home-hero__lead,
  .home-hero__metrics,
  .home-hero__note {
    max-width: 800px;
  }
}

/* Mobile/tablet header: logo, product search, and menu only. Cart lives in
   the persistent bottom navigation so the same action is never duplicated. */
@media (max-width: 1050px) {
  .ok-header-actions .ok-account-menu,
  .ok-header-actions .ok-account-link,
  .ok-header-actions .ok-register-link,
  .ok-header-actions .ok-cart-pill {
    display: none !important;
  }

  body {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  .ok-header-main__inner {
    display: flex !important;
    width: calc(100% - 40px) !important;
    max-width: none !important;
    min-height: 76px;
    align-items: center;
    gap: 10px;
    padding-block: 8px;
  }

  .ok-brand {
    width: auto;
    max-width: calc(100% - 108px);
    flex: 0 1 auto;
    margin-right: auto;
    justify-self: auto;
  }

  .ok-brand img {
    width: clamp(154px, 22vw, 184px);
    height: auto;
  }

  .ok-header-search {
    display: inline-grid;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    grid-template-columns: 1fr;
    flex: 0 0 44px;
    place-items: center;
    gap: 0;
    margin: 0 0 0 auto;
    padding: 0;
    color: var(--forest-deep);
    background: #f2f6f3;
    border: 1px solid #d6e1da;
    border-radius: 50%;
  }

  .ok-header-search svg {
    width: 20px;
    height: 20px;
    margin: 0;
  }

  .ok-header-search > span,
  .ok-header-search > em {
    display: none !important;
  }

  .ok-header-actions {
    display: flex;
    width: 44px;
    min-width: 44px;
    flex: 0 0 44px;
    align-items: center;
    gap: 0;
  }

  .menu-trigger {
    display: inline-grid !important;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    place-items: center;
    overflow: visible;
    color: #fff;
    background: var(--forest);
    border: 1px solid var(--forest);
    border-radius: 50%;
    box-shadow: 0 7px 18px rgba(8, 45, 36, .14);
  }

  .menu-trigger:hover,
  .menu-trigger:focus-visible,
  .menu-trigger[aria-expanded="true"] {
    color: #fff;
    background: var(--forest-deep);
    border-color: var(--forest-deep);
    outline: 0;
  }

  .menu-trigger__icon {
    display: block;
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.9;
  }

  .mobile-bottom-nav {
    position: fixed;
    right: auto;
    bottom: 12px;
    left: 50%;
    z-index: 1050;
    display: grid !important;
    width: min(720px, calc(100% - 32px));
    min-width: 0;
    max-width: 720px;
    height: calc(66px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: start;
    padding: 8px 0 env(safe-area-inset-bottom);
    overflow: hidden;
    background: rgba(255, 253, 248, .97);
    border: 1px solid rgba(211, 222, 215, .92);
    border-radius: 19px;
    box-shadow: 0 16px 42px rgba(8, 45, 36, .16);
    backdrop-filter: blur(18px);
    transform: translateX(-50%);
  }

  .mobile-bottom-nav a,
  .mobile-bottom-nav button {
    position: relative;
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 0;
    color: #78847e;
    background: transparent;
    border: 0;
    font-size: .54rem;
    font-weight: 650;
  }

  .mobile-bottom-nav svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
  }

  .mobile-bottom-nav span {
    color: inherit;
    font-size: .54rem;
    line-height: 1.25;
  }

  .mobile-bottom-nav .is-active {
    color: var(--forest);
  }

  .mobile-bottom-nav em {
    position: absolute;
    top: -3px;
    left: calc(50% + 8px);
    display: grid;
    min-width: 17px;
    height: 17px;
    padding: 0 3px;
    place-items: center;
    color: #fff;
    background: var(--forest);
    border-radius: 999px;
    font-size: .46rem;
    font-style: normal;
  }
}

@media (max-width: 820px) {
  :root {
    --container: min(760px, calc(100% - 40px));
  }

  .ok-header-main__inner {
    width: calc(100% - 32px) !important;
    gap: 8px;
  }

  .ok-brand {
    max-width: calc(100% - 100px);
  }

  .ok-header-search {
    flex-basis: 42px;
  }

  .ok-header-actions {
    width: 42px;
    min-width: 42px;
    flex-basis: 42px;
  }

  .ok-brand img {
    width: 150px;
    height: auto;
  }

  .ok-header-search,
  .menu-trigger {
    width: 42px;
    height: 42px;
    min-height: 42px;
  }

  .mobile-bottom-nav {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: none;
    height: calc(64px + env(safe-area-inset-bottom));
    padding-top: 7px;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
    transform: none;
  }

  .journal-pagination {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .journal-pagination__pages {
    width: 100% !important;
    justify-content: center;
  }

  .article-sequence__inner {
    grid-template-columns: 1fr;
  }

  .article-sequence__index {
    grid-row: 1;
  }

  .article-sequence__item--next {
    text-align: left;
  }
}

@media (max-width: 520px) {
  :root {
    --container: min(480px, calc(100% - 32px));
  }

  .announcement__inner {
    width: 100%;
  }

  .ok-brand img {
    width: 136px;
  }

  .ok-header-main__inner {
    width: calc(100% - 28px) !important;
    gap: 7px;
    margin: auto;
  }

  .ok-brand {
    max-width: calc(100% - 94px);
  }

  .ok-header-search {
    flex-basis: 40px;
  }

  .ok-header-actions {
    width: 40px;
    min-width: 40px;
    flex-basis: 40px;
  }

  .ok-header-search,
  .menu-trigger {
    width: 40px;
    height: 40px;
    min-height: 40px;
  }
}

/* Logout is intentionally confirmed in an accessible in-site dialog. */
.logout-modal {
  position: fixed;
  inset: 0;
  z-index: 1900;
  display: grid;
  padding: 20px;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, visibility 0s linear .2s;
}

.logout-modal.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity .2s ease, visibility 0s;
}

.logout-modal__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  background: rgba(4, 28, 21, .62);
  border: 0;
  backdrop-filter: blur(7px);
}

.logout-dialog {
  position: relative;
  width: min(440px, 100%);
  padding: 34px;
  color: var(--forest-deep);
  background: #fffdf9;
  border: 1px solid rgba(219, 229, 222, .9);
  border-radius: 25px;
  box-shadow: 0 32px 80px rgba(3, 26, 19, .28);
  opacity: 0;
  transform: translateY(12px) scale(.98);
  transition: opacity .2s ease, transform .25s cubic-bezier(.22, 1, .36, 1);
}

.logout-modal.is-open .logout-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.logout-dialog__icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 19px;
  place-items: center;
  color: #a64239;
  background: #fbeae7;
  border-radius: 17px;
}

.logout-dialog__icon svg {
  width: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.logout-dialog h2 {
  margin: 7px 0 11px;
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  letter-spacing: -.035em;
}

.logout-dialog > p:not(.eyebrow) {
  margin: 0;
  color: #62736b;
  font-size: .82rem;
  line-height: 1.7;
}

.logout-dialog__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 27px;
}

@media (max-width: 520px) {
  .logout-modal {
    align-items: end;
    padding: 12px;
  }

  .logout-dialog {
    width: 100%;
    padding: 27px 22px 22px;
    border-radius: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .logout-modal,
  .logout-dialog {
    transition-duration: .01ms !important;
  }
}

/* Formal invoice: readable on screen, deterministic on A4, and safe for long rows. */
.invoice-page {
  padding: 42px 0 72px;
  background: #eef2ef;
}

.invoice-shell { width: min(1080px, calc(100% - 48px)); }

.invoice-statusbar {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  margin: 0 0 16px;
  padding: 15px 18px;
  background: #fff;
  border: 1px solid #dce5df;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(7, 44, 34, .045);
}

.invoice-statusbar > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: #b78126;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 800;
}

.invoice-statusbar strong,
.invoice-statusbar p { display: block; margin: 0; }
.invoice-statusbar strong { color: var(--forest-deep); font-size: .7rem; letter-spacing: .035em; }
.invoice-statusbar p { margin-top: 3px; color: #6e7d75; font-size: .63rem; line-height: 1.45; }
.invoice-statusbar > em { padding: 6px 9px; color: #76551e; background: #fff1d5; border-radius: 999px; font-size: .55rem; font-style: normal; font-weight: 800; }
.invoice-statusbar.status-paid > span { background: var(--forest); }
.invoice-statusbar.status-paid > em { color: #286347; background: #e5f2e8; }
.invoice-statusbar.status-cancelled > span { background: #a94239; }
.invoice-statusbar.status-cancelled > em { color: #8d3932; background: #f9e5e2; }
.invoice-statusbar.status-converted > span { background: #65736c; }
.invoice-statusbar.status-converted > em { color: #56625c; background: #e8ece9; }

.invoice-paper {
  position: relative;
  width: 100%;
  margin: 0;
  padding: clamp(36px, 5vw, 64px);
  overflow: hidden;
  background: #fff;
  border: 1px solid #dfe6e1;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(7, 44, 34, .09);
}

.invoice-paper--cancelled { border-color: #e0bcb7; }
.invoice-watermark { position: absolute; top: 46%; left: 50%; z-index: 0; color: rgba(166, 57, 48, .055); font-size: clamp(4rem, 12vw, 8rem); font-weight: 900; letter-spacing: .08em; transform: translate(-50%, -50%) rotate(-25deg); pointer-events: none; }
.invoice-paper > *:not(.invoice-watermark) { position: relative; z-index: 1; }

.invoice-head--formal {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  padding-bottom: 27px;
  border-bottom: 2px solid var(--forest-deep);
}

.invoice-brand-block img { display: block; width: 205px; height: auto; object-fit: contain; object-position: left center; }
.invoice-brand-block p { margin: 13px 0 0; color: #68766f; font-size: .61rem; line-height: 1.65; }
.invoice-identity { min-width: 290px; text-align: right; }
.invoice-identity .eyebrow { margin: 0 0 7px; }
.invoice-identity h1 { margin: 0 0 11px; overflow-wrap: anywhere; color: var(--forest-deep); font-size: clamp(1.45rem, 3vw, 2.1rem); letter-spacing: -.035em; }
.invoice-document-status { display: inline-flex; padding: 6px 9px; color: #77551b; background: #fff1d2; border-radius: 999px; font-size: .53rem; font-weight: 800; }
.invoice-document-status.status-paid { color: #2f664a; background: #e5f2e8; }
.invoice-document-status.status-cancelled { color: #8e3831; background: #f9e3e0; }
.invoice-document-status.status-converted { color: #5e6963; background: #e9ecea; }

.invoice-reference-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  background: #dfe6e1;
  border: 1px solid #dfe6e1;
  border-radius: 0 0 12px 12px;
}

.invoice-reference-grid div { display: grid; min-width: 0; gap: 4px; padding: 13px 15px; background: #f5f8f5; }
.invoice-reference-grid dt { color: #78857f; font-size: .51rem; }
.invoice-reference-grid dd { margin: 0; overflow-wrap: anywhere; color: var(--forest-deep); font-size: .62rem; font-weight: 750; }

.invoice-parties--formal {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px;
  margin: 35px 0;
  padding: 0;
}

.invoice-parties--formal > div { min-width: 0; }
.invoice-parties--formal small,
.invoice-parties--formal strong,
.invoice-parties--formal span { display: block; }
.invoice-parties--formal > div > small { margin-bottom: 10px; color: var(--gold); font-size: .53rem; font-weight: 800; letter-spacing: .11em; }
.invoice-parties--formal strong { margin-bottom: 5px; color: var(--forest-deep); font-size: .78rem; }
.invoice-parties--formal span { color: #66756e; font-size: .62rem; line-height: 1.65; overflow-wrap: anywhere; }

.invoice-line-items { margin-top: 0; }
.invoice-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.invoice-section-heading small { color: var(--gold); font-size: .5rem; font-weight: 800; letter-spacing: .11em; }
.invoice-section-heading h2 { margin: 3px 0 0; color: var(--forest-deep); font-size: 1.08rem; }
.invoice-section-heading > span { color: #77847d; font-size: .57rem; }

.invoice-table-wrap { width: 100%; overflow-x: auto; border: 1px solid #dfe6e1; border-radius: 11px; }
.invoice-table { width: 100%; min-width: 720px; table-layout: fixed; border-collapse: collapse; }
.invoice-table th { padding: 11px 13px; color: #64746c; background: #f1f5f2; border-bottom: 1px solid #dfe6e1; font-size: .51rem; font-weight: 800; letter-spacing: .045em; text-align: left; text-transform: uppercase; }
.invoice-table th:first-child { width: 39%; }
.invoice-table th:nth-child(2) { width: 20%; }
.invoice-table th:nth-child(3) { width: 17%; }
.invoice-table th:last-child { width: 24%; text-align: right; }
.invoice-table td { padding: 14px 13px; color: #41574d; border-bottom: 1px solid #e9edea; font-size: .61rem; line-height: 1.45; vertical-align: top; overflow-wrap: anywhere; }
.invoice-table tbody tr:last-child td { border-bottom: 0; }
.invoice-table td:last-child { text-align: right; }
.invoice-table td strong,
.invoice-table td small,
.invoice-table td em { display: block; }
.invoice-table td strong { color: var(--forest-deep); font-size: .64rem; }
.invoice-table td small { margin-top: 3px; color: #7e8a84; font-size: .53rem; }
.invoice-table td em { margin-top: 6px; color: #7c6a4c; font-size: .5rem; font-style: normal; line-height: 1.5; }

.invoice-settlement {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 39%);
  gap: 40px;
  align-items: start;
  margin-top: 27px;
}

.invoice-order-note small { color: var(--gold); font-size: .51rem; font-weight: 800; letter-spacing: .1em; }
.invoice-order-note p { margin: 8px 0; color: #66756e; font-size: .61rem; line-height: 1.65; }
.invoice-order-note > span { color: #74817a; font-size: .56rem; }

.invoice-total--formal { display: grid; width: 100%; gap: 0; padding: 0; background: transparent; border: 0; }
.invoice-total--formal div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; color: #64736c; border-bottom: 1px solid #e5ebe7; font-size: .62rem; }
.invoice-total--formal dt { color: inherit; }
.invoice-total--formal dd { margin: 0; color: var(--forest-deep); font-weight: 750; }
.invoice-total--formal div:last-child { margin-top: 4px; padding: 13px 14px; color: #fff; background: var(--forest-deep); border: 0; border-radius: 9px; font-weight: 800; }
.invoice-total--formal div:last-child dd { color: #fff; font-family: inherit; font-size: .79rem; }

.invoice-cancelled-note { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 15px; margin-top: 28px; padding: 18px; color: #74342f; background: #fff5f3; border: 1px solid #e5bbb6; border-radius: 12px; }
.invoice-cancelled-note > span { display: grid; width: 46px; height: 46px; place-items: center; color: #fff; background: #a94239; border-radius: 12px; font-size: 1.2rem; }
.invoice-cancelled-note small,
.invoice-cancelled-note strong,
.invoice-cancelled-note em { display: block; }
.invoice-cancelled-note small { margin-bottom: 4px; color: #aa5b54; font-size: .49rem; font-weight: 800; letter-spacing: .1em; }
.invoice-cancelled-note strong { font-size: .72rem; }
.invoice-cancelled-note p { margin: 6px 0; font-size: .62rem; line-height: 1.6; }
.invoice-cancelled-note em { color: #9c625d; font-size: .53rem; font-style: normal; }

.invoice-terms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; margin-top: 32px; padding: 20px; background: #f4f7f4; border-radius: 11px; }
.invoice-terms small,
.invoice-terms strong { display: block; }
.invoice-terms small { margin-bottom: 6px; color: var(--gold); font-size: .48rem; font-weight: 800; letter-spacing: .09em; }
.invoice-terms strong { color: var(--forest-deep); font-size: .64rem; }
.invoice-terms p { margin: 6px 0 0; color: #6c7973; font-size: .54rem; line-height: 1.65; }

.invoice-document-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 28px; padding-top: 16px; color: #89948f; border-top: 1px solid #e2e7e3; font-size: .48rem; }
.invoice-actions { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.invoice-security { margin: 13px 0 0; color: #74817a; font-size: .56rem; text-align: center; }

@media (max-width: 760px) {
  .invoice-page { padding: 20px 0 46px; }
  .invoice-shell { width: calc(100% - 24px); }
  .invoice-statusbar { grid-template-columns: 38px minmax(0, 1fr); padding: 13px; }
  .invoice-statusbar > span { width: 38px; height: 38px; }
  .invoice-statusbar > em { display: none; }
  .invoice-paper { padding: 27px 20px; border-radius: 14px; }
  .invoice-head--formal { display: grid; gap: 24px; }
  .invoice-brand-block img { width: 170px; }
  .invoice-identity { min-width: 0; text-align: left; }
  .invoice-reference-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .invoice-parties--formal { grid-template-columns: 1fr; gap: 24px; margin: 28px 0; }
  .invoice-settlement { grid-template-columns: 1fr; gap: 22px; }
  .invoice-terms { grid-template-columns: 1fr; gap: 18px; }
  .invoice-document-footer { align-items: flex-start; flex-direction: column; gap: 5px; }
  .invoice-actions { grid-template-columns: 1fr 1fr; }
  .invoice-actions .button:first-child { grid-column: 1 / -1; }
}

@media (max-width: 430px) {
  .invoice-reference-grid { grid-template-columns: 1fr; }
  .invoice-cancelled-note { grid-template-columns: 38px minmax(0, 1fr); padding: 14px; }
  .invoice-cancelled-note > span { width: 38px; height: 38px; }
}

@media print {
  @page { size: A4 portrait; margin: 12mm; }

  html,
  body {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    color: #132b23 !important;
    background: #fff !important;
    font-size: 9pt !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body > * { visibility: hidden !important; }
  .invoice-page,
  .invoice-page * { visibility: visible !important; }
  .invoice-page { position: absolute !important; inset: 0 auto auto 0 !important; width: 100% !important; padding: 0 !important; background: #fff !important; }
  .invoice-shell { width: 100% !important; max-width: none !important; margin: 0 !important; }
  .invoice-statusbar,
  .invoice-actions,
  .invoice-security { display: none !important; }
  .invoice-paper { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
  .invoice-head--formal { gap: 12mm !important; padding-bottom: 6mm !important; }
  .invoice-brand-block img { width: 46mm !important; }
  .invoice-brand-block p { margin-top: 2.5mm !important; font-size: 7pt !important; }
  .invoice-identity { min-width: 65mm !important; }
  .invoice-identity h1 { font-size: 17pt !important; }
  .invoice-reference-grid { margin: 0 !important; border-radius: 0 !important; }
  .invoice-reference-grid div { padding: 3mm !important; }
  .invoice-parties--formal { gap: 12mm !important; margin: 8mm 0 !important; }
  .invoice-table-wrap { overflow: visible !important; }
  .invoice-table { width: 100% !important; min-width: 0 !important; table-layout: fixed !important; }
  .invoice-table th { padding: 2.5mm !important; font-size: 6.5pt !important; }
  .invoice-table td { padding: 3mm 2.5mm !important; font-size: 7.5pt !important; }
  .invoice-table tr { break-inside: avoid; page-break-inside: avoid; }
  .invoice-settlement { grid-template-columns: minmax(0, 1fr) 68mm !important; gap: 9mm !important; margin-top: 6mm !important; break-inside: avoid; page-break-inside: avoid; }
  .invoice-cancelled-note,
  .invoice-terms,
  .invoice-document-footer { break-inside: avoid; page-break-inside: avoid; }
  .invoice-terms { gap: 8mm !important; margin-top: 7mm !important; padding: 4mm !important; }
  .invoice-watermark { position: fixed !important; }
}

/* Article listing: pagination is visible both above and below the cards. */
.journal-pagination {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0;
  padding: 11px 13px;
  background: rgba(255, 255, 255, .88);
  border: 1px solid #dfe7e2;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(8, 45, 36, .045);
}

.journal-pagination--top {
  margin: -6px 0 26px;
}

.journal-pagination--bottom {
  margin: 34px 0 0;
}

.journal-pagination > .journal-pagination__summary,
.journal-pagination > .journal-pagination__pages {
  display: flex;
  width: auto;
  min-width: 0;
  height: auto;
  align-items: center;
  gap: 7px;
  padding: 0;
  color: #6e7d75;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: .65rem;
}

.journal-pagination__summary strong {
  color: var(--forest-deep);
}

.journal-pagination__pages > a,
.journal-pagination__pages > span {
  display: grid;
  min-width: 38px;
  height: 38px;
  place-items: center;
  padding: 0 8px;
  color: var(--forest-deep);
  background: #fff;
  border: 1px solid #d9e3dd;
  border-radius: 10px;
  font-size: .68rem;
  font-weight: 750;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.journal-pagination__pages > a:hover {
  color: #fff;
  background: var(--forest);
  border-color: var(--forest);
  transform: translateY(-1px);
}

.journal-pagination__pages > .active {
  color: #fff;
  background: var(--forest);
  border-color: var(--forest);
}

.journal-pagination__pages > .is-disabled {
  color: #a9b3ad;
  background: #f5f6f3;
}

/* Detail pages also expose clear previous/index/next navigation. */
.article-sequence {
  background: #eef3ef;
  border-block: 1px solid #dbe5df;
}

.article-sequence__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  padding-block: 24px;
}

.article-sequence__item,
.article-sequence__index {
  display: flex;
  min-width: 0;
  min-height: 92px;
  padding: 17px 19px;
  flex-direction: column;
  justify-content: center;
  background: #fff;
  border: 1px solid #dbe5df;
  border-radius: 14px;
}

.article-sequence__item > span,
.article-sequence__index > span {
  margin-bottom: 6px;
  color: #78877f;
  font-size: .55rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.article-sequence__item > strong,
.article-sequence__index > strong {
  overflow: hidden;
  color: var(--forest-deep);
  font-size: .72rem;
  line-height: 1.45;
  text-overflow: ellipsis;
}

.article-sequence__item--next {
  text-align: right;
}

.article-sequence__index {
  align-items: center;
  color: #fff;
  background: var(--forest);
  border-color: var(--forest);
  text-align: center;
}

.article-sequence__index > span,
.article-sequence__index > strong {
  color: #fff;
}

.article-sequence__item:not(.article-sequence__item--empty):hover {
  border-color: #a9beb2;
  box-shadow: 0 12px 30px rgba(8, 45, 36, .07);
}

.article-sequence__item--empty {
  opacity: .68;
}

.program-coming-soon {
  display: inline-flex;
  width: max-content;
  margin-top: 7px;
  padding: 4px 8px;
  color: #735817;
  background: #f7e9bc;
  border-radius: 999px;
  font-size: .46rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

@media (max-width: 820px) {
  .journal-pagination {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .journal-pagination__pages {
    width: 100% !important;
    justify-content: center;
  }

  .article-sequence__inner {
    grid-template-columns: 1fr;
  }

  .article-sequence__index {
    grid-row: 1;
  }

  .article-sequence__item--next {
    text-align: left;
  }
}
