/*
 * B2 Zenseana customer portal - scoped stylesheet (only pages rendered by includes/member_layout.php load it).
 * Colours/images come from CSS variables set by includes/member_appearance.php (B3-ready); no brand literals here
 * except neutral fallbacks. Logical properties are used throughout so Arabic (dir=rtl) mirrors automatically.
 */
.zp {
  --zp-font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, "Noto Sans", sans-serif;
  --zp-font-display: Georgia, "Times New Roman", serif;
  --zp-shadow: 0 10px 30px rgba(33, 38, 36, .07);
  --zp-shadow-lg: 0 18px 48px rgba(33, 38, 36, .12);
  --zp-max: 1200px;
  --zp-header-h: 64px;
  --zp-tabbar-h: 64px;
  --zp-gap: 20px;
  --zp-touch: 44px;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ml-bg, #f7f3ed);
  color: var(--ml-text, #2f3438);
  font-family: var(--zp-font);
  font-size: 16px;
  line-height: 1.55;
  text-align: start;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}
.zp:lang(th) { --zp-font: "Leelawadee UI", "Noto Sans Thai", "Noto Sans Thai UI", Thonburi, "Sukhumvit Set", Tahoma, sans-serif; line-height: 1.7; }
.zp:lang(zh-Hans) { --zp-font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif; }
.zp:lang(ja) { --zp-font: "Yu Gothic UI", "Yu Gothic", Meiryo, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", sans-serif; }
.zp:lang(ko) { --zp-font: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", sans-serif; word-break: keep-all; }
.zp:lang(ar) { --zp-font: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif; line-height: 1.75; }
.zp *, .zp *::before, .zp *::after { box-sizing: border-box; }
.zp img { max-width: 100%; height: auto; }
.zp a { color: var(--ml-gold-dark, #806536); text-underline-offset: 2px; }
.zp a:hover { color: var(--ml-ink, #343a40); }
.zp h1, .zp h2, .zp h3, .zp h4 { margin: 0 0 .5em; color: var(--ml-ink, #343a40); line-height: 1.25; font-weight: 700; overflow-wrap: anywhere; }
.zp h1 { font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2rem); text-wrap: balance; }
.zp h2 { font-size: 1.25rem; }
.zp h3 { font-size: 1.05rem; }
.zp p { margin: 0 0 .8em; }
.zp :focus-visible { outline: 3px solid var(--ml-gold, #ad8a4f); outline-offset: 2px; }
.zp-ltr { direction: ltr; unicode-bidi: isolate; }
.zp [hidden] { display: none !important; }
.zp-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.zp-skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--ml-ink, #343a40); color: var(--zp-on-ink, #fff) !important; border-radius: 6px; }
.zp-skip:focus { top: 8px; }
[dir="rtl"] .zp-flip { transform: scaleX(-1); }

/* ------------------------------------------------------------------ header */
.zp-header { position: sticky; top: 0; z-index: 30; background: var(--zp-header-bg, rgba(255, 253, 249, .97)); border-bottom: 1px solid var(--ml-line, #e7ded0); backdrop-filter: saturate(1.2) blur(6px); }
.zp-header__inner { max-width: var(--zp-max); margin: 0 auto; min-height: var(--zp-header-h); padding: 0 16px; display: flex; align-items: center; gap: 16px; }
.zp-brand { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; min-width: 0; color: var(--ml-ink, #343a40); text-decoration: none; }
.zp-brand:hover { color: var(--ml-ink, #343a40); }
.zp-brand__logo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 40px; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.zp-brand__text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.zp-brand__name { font-family: var(--zp-font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: .14em; }
.zp-brand__program { font-size: .68rem; letter-spacing: .18em; color: var(--ml-muted, #6a716d); font-weight: 600; }
.zp-nav { margin-inline-start: auto; }
.zp-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.zp-nav a { display: inline-flex; align-items: center; gap: 8px; min-height: var(--zp-touch); padding: 0 14px; border-radius: 999px; color: var(--ml-text, #2f3438); text-decoration: none; font-weight: 600; font-size: .95rem; white-space: nowrap; }
.zp-nav a:hover { background: var(--ml-bg-soft, #fbf8f3); color: var(--ml-ink, #343a40); }
.zp-nav a.is-active { background: var(--ml-ink, #343a40); color: var(--zp-on-ink, #fff); }
.zp-header__tools { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.zp--member .zp-header__tools { margin-inline-start: 8px; }
.zp-icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: var(--zp-touch); min-height: var(--zp-touch); padding: 0 12px; border-radius: 999px; color: var(--ml-text, #2f3438); text-decoration: none; font-weight: 600; font-size: .9rem; border: 1px solid transparent; }
.zp-icon-btn:hover { border-color: var(--ml-line, #e7ded0); color: var(--ml-ink, #343a40); background: var(--ml-surface, #fffdf9); }

/* language selector (works without JavaScript: <details>) */
.zp-lang { position: relative; }
.zp-lang__toggle { list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: var(--zp-touch); padding: 0 14px; border: 1px solid var(--ml-line, #e7ded0); border-radius: 999px; background: var(--ml-surface, #fffdf9); cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--ml-ink, #343a40); user-select: none; white-space: nowrap; }
.zp-lang__toggle::-webkit-details-marker { display: none; }
.zp-lang__chev { font-size: .7rem; opacity: .65; transition: transform .15s ease; }
.zp-lang[open] .zp-lang__chev { transform: rotate(180deg); }
.zp-lang__menu { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 40; min-width: 200px; margin: 0; padding: 6px; list-style: none; background: var(--ml-surface, #fffdf9); border: 1px solid var(--ml-line, #e7ded0); border-radius: 12px; box-shadow: var(--zp-shadow-lg); }
.zp-lang__menu a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--zp-touch); padding: 0 12px; border-radius: 8px; color: var(--ml-text, #2f3438); text-decoration: none; font-weight: 500; text-align: start; }
.zp-lang__menu a:hover, .zp-lang__menu a.is-current { background: var(--ml-bg-soft, #fbf8f3); color: var(--ml-ink, #343a40); }
.zp-lang__menu a.is-current { font-weight: 700; }

/* ------------------------------------------------------------------ main / footer / tab bar */
.zp-main { flex: 1 0 auto; width: 100%; max-width: var(--zp-max); margin: 0 auto; padding: 28px 16px 48px; outline: none; }
.zp-footer { border-top: 1px solid var(--ml-line, #e7ded0); background: var(--ml-surface, #fffdf9); color: var(--ml-muted, #6a716d); font-size: .85rem; }
.zp-footer__inner { max-width: var(--zp-max); margin: 0 auto; padding: 20px 16px; display: flex; flex-wrap: wrap; gap: 4px 24px; justify-content: space-between; }
.zp-footer p { margin: 0; }
.zp-footer__brand { font-weight: 700; color: var(--ml-ink, #343a40); }
.zp-footer__who { flex: 1 0 100%; color: var(--ml-ink, #343a40); overflow-wrap: anywhere; }
.zp-tabbar { display: none; }

/* ------------------------------------------------------------------ building blocks */
.zp-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 22px; }
.zp-page-head p { margin: 0; color: var(--ml-muted, #6a716d); max-width: 760px; }
.zp-eyebrow { display: block; margin-bottom: 6px; color: var(--ml-gold-dark, #806536); font-size: .8rem; font-weight: 700; }
.zp:lang(en) .zp-eyebrow, .zp:lang(ru) .zp-eyebrow { text-transform: uppercase; letter-spacing: .12em; }
.zp-card { background: var(--ml-surface, #fffdf9); border: 1px solid var(--ml-line, #e7ded0); border-radius: var(--zp-radius, 10px); box-shadow: var(--zp-shadow); padding: 22px; min-width: 0; }
.zp-card + .zp-card { margin-top: var(--zp-gap); }
.zp-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.zp-card__head h2 { margin: 0; }
.zp-card__head > a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.zp-grid { display: grid; gap: var(--zp-gap); }
.zp-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.zp-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.zp-grid--sidebar { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
.zp-stack > * + * { margin-top: var(--zp-gap); }
.zp-muted { color: var(--ml-muted, #6a716d); }
.zp-small { font-size: .875rem; }

.zp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--zp-touch); padding: 10px 20px; border: 1px solid transparent; border-radius: 999px; font: inherit; font-weight: 700; font-size: .95rem; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.zp .zp-btn--primary { background: var(--zp-btn-bg, var(--ml-ink, #343a40)); color: var(--zp-btn-text, var(--zp-on-ink, #fff)); }
.zp .zp-btn--primary:hover, .zp .zp-btn--primary:focus { background: var(--zp-btn-hover, #23272b); color: var(--zp-btn-text, var(--zp-on-ink, #fff)); }
.zp .zp-btn--accent { background: var(--ml-gold, #ad8a4f); color: #fff; }
.zp .zp-btn--accent:hover { background: var(--ml-gold-dark, #806536); color: #fff; }
.zp .zp-btn--ghost { background: transparent; border-color: var(--ml-line, #e7ded0); color: var(--ml-ink, #343a40); }
.zp .zp-btn--ghost:hover { background: var(--ml-bg-soft, #fbf8f3); border-color: var(--ml-gold, #ad8a4f); color: var(--ml-ink, #343a40); }
.zp-btn--block { display: flex; width: 100%; }
.zp-btn--sm { min-height: 40px; padding: 6px 14px; font-size: .88rem; }
.zp-btn[disabled], .zp-btn.disabled { opacity: .55; pointer-events: none; }
.zp-btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.zp-alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 18px; border-radius: 10px; border: 1px solid; font-weight: 500; }
.zp-alert > i { margin-top: 3px; }
.zp-alert--success { background: #edf6f0; border-color: #b9d9c6; color: var(--zp-success, #2f6b4f); }
.zp-alert--danger { background: #fbefed; border-color: #ecc2bd; color: var(--zp-danger, #a23b32); }
.zp-alert--warning { background: #fdf5e7; border-color: #ecd3a5; color: var(--zp-warning, #8a5a12); }
.zp-alert--info { background: #f2f4f6; border-color: #d9dee3; color: var(--ml-ink, #343a40); }

.zp-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; background: #eef0f2; color: var(--ml-ink, #343a40); }
.zp-badge--approved, .zp-badge--used { background: #e3f1e8; color: var(--zp-success, #2f6b4f); }
.zp-badge--pending { background: #fbf0d9; color: var(--zp-warning, #8a5a12); }
.zp-badge--rejected, .zp-badge--void { background: #eceeef; color: #5c6166; }

.zp-empty { padding: 36px 20px; text-align: center; color: var(--ml-muted, #6a716d); }
.zp-empty i { display: block; margin-bottom: 10px; font-size: 1.8rem; color: var(--ml-line, #e7ded0); }
.zp-empty p { margin: 0 auto; max-width: 440px; }

/* forms */
.zp-form { display: grid; gap: 16px; }
.zp-form__row { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.zp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.zp-field > label, .zp-label { font-weight: 600; font-size: .92rem; color: var(--ml-ink, #343a40); }
.zp-req { color: var(--zp-danger, #a23b32); margin-inline-start: 2px; }
.zp-optional { color: var(--ml-muted, #6a716d); font-weight: 400; font-size: .85rem; }
.zp-input, .zp select, .zp textarea { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid #d6cdbf; border-radius: 10px; background: #fff; color: var(--ml-text, #2f3438); font: inherit; font-size: 16px; text-align: start; }
.zp textarea { min-height: 96px; resize: vertical; }
.zp-input:focus, .zp select:focus, .zp textarea:focus { outline: none; border-color: var(--ml-gold, #ad8a4f); box-shadow: 0 0 0 3px rgba(173, 138, 79, .18); }
.zp-input[readonly], .zp-input:disabled { background: #f3efe8; color: var(--ml-muted, #6a716d); }
.zp-input[dir="ltr"] { text-align: left; }
[dir="rtl"] .zp-input[dir="ltr"] { text-align: right; }
.zp-input.is-invalid, .zp select.is-invalid { border-color: var(--zp-danger, #a23b32); }
.zp-hint { margin: 0; color: var(--ml-muted, #6a716d); font-size: .85rem; }
.zp-error { margin: 0; color: var(--zp-danger, #a23b32); font-size: .85rem; font-weight: 600; }
.zp-error:empty { display: none; }
.zp-password { position: relative; }
.zp-password .zp-input { padding-inline-end: 52px; }
.zp-password__toggle { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 40px; border: 0; background: transparent; color: var(--ml-muted, #6a716d); cursor: pointer; border-radius: 8px; }
.zp-check { display: flex; gap: 10px; align-items: flex-start; }
.zp-file { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.zp-file input[type="file"] { max-width: 100%; font-size: .9rem; }
.zp .select2-container { width: 100% !important; }
.zp .select2-container--bootstrap4 .select2-selection { min-height: 48px; border-radius: 10px; border-color: #d6cdbf; display: flex; align-items: center; }
.zp .select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered { padding-inline: 14px 36px; line-height: 1.4; text-align: start; }
[dir="rtl"] .zp .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow { left: 10px; right: auto; }
.zp .select2-dropdown { border-color: #d6cdbf; border-radius: 10px; overflow: hidden; }

/* ------------------------------------------------------------------ auth pages (login / register) */
.zp--auth { background: linear-gradient(180deg, var(--zp-login-overlay-top, rgba(247, 243, 237, .90)), var(--zp-login-overlay-bottom, rgba(247, 243, 237, .97))), var(--zp-login-bg, none) center / cover no-repeat fixed; }
.zp--auth .zp-header { background: var(--zp-header-bg-auth, rgba(255, 253, 249, .82)); }
.zp-auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 40px; align-items: center; min-height: calc(100vh - var(--zp-header-h) - 140px); }
.zp-auth--wide { grid-template-columns: minmax(0, .8fr) minmax(0, 680px); }
.zp-auth--single { grid-template-columns: minmax(0, 560px); justify-content: center; }
.zp-auth__intro h1 { font-family: var(--zp-font-display); font-size: clamp(1.8rem, 1.2rem + 2vw, 2.8rem); letter-spacing: .02em; }
.zp:lang(th) .zp-auth__intro h1, .zp:lang(ar) .zp-auth__intro h1, .zp:lang(zh-Hans) .zp-auth__intro h1, .zp:lang(ja) .zp-auth__intro h1, .zp:lang(ko) .zp-auth__intro h1 { font-family: var(--zp-font); }
.zp-auth__intro p { color: var(--ml-muted, #6a716d); font-size: 1.05rem; max-width: 480px; }
.zp-auth__points { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.zp-auth__points li { display: flex; gap: 10px; align-items: flex-start; }
.zp-auth__points i { color: var(--ml-gold, #ad8a4f); margin-top: 4px; }
.zp-auth__panel { padding: 28px; }
.zp-auth__panel h2 { font-size: 1.35rem; }
.zp-auth__alt { margin: 18px 0 0; text-align: center; color: var(--ml-muted, #6a716d); }
.zp-auth__alt a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.zp-section-label { margin: 6px 0 -4px; padding-top: 14px; border-top: 1px solid var(--ml-line, #e7ded0); font-size: .82rem; font-weight: 700; color: var(--ml-gold-dark, #806536); }
.zp-form > .zp-section-label:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

/* ------------------------------------------------------------------ member home */
.zp-welcome { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
.zp-welcome h1 { margin: 0; }
.zp-identity { display: flex; gap: 16px; align-items: center; min-width: 0; }
.zp-avatar { width: 72px; height: 72px; flex: 0 0 72px; border-radius: 50%; overflow: hidden; border: 3px solid #fff; box-shadow: 0 6px 18px rgba(33, 38, 36, .14); background: #eee; }
.zp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.zp-identity__meta { min-width: 0; }
.zp-identity__meta .zp-name { margin: 0; font-size: 1.25rem; }
.zp-code { font-weight: 700; color: var(--ml-gold-dark, #806536); letter-spacing: .06em; }
.zp-status-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.zp-cardview { display: grid; gap: 14px; }
.zp-cardview__frame { position: relative; border-radius: 18px; background: #e9e4dc; aspect-ratio: 1016 / 640; overflow: hidden; box-shadow: var(--zp-shadow-lg); }
.zp-cardview__frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.zp-cardview__frame img:not([src]) { visibility: hidden; }
.zp-cardview__loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ml-muted, #6a716d); }
.zp-cardview__frame.is-ready .zp-cardview__loading { display: none; }
.zp-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.zp-stat { padding: 16px; border-radius: 10px; background: var(--ml-bg-soft, #fbf8f3); border: 1px solid var(--ml-line, #e7ded0); min-width: 0; }
.zp-stat__label { display: block; color: var(--ml-muted, #6a716d); font-size: .82rem; font-weight: 600; }
.zp-stat__value { display: block; margin-top: 4px; font-size: 1.6rem; font-weight: 700; color: var(--ml-ink, #343a40); line-height: 1.15; }
.zp-stat__hint { display: block; margin-top: 2px; font-size: .78rem; color: var(--ml-muted, #6a716d); }
.zp-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.zp-action { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 14px; border: 1px solid var(--ml-line, #e7ded0); border-radius: 10px; background: var(--ml-surface, #fffdf9); color: var(--ml-ink, #343a40); text-decoration: none; font-weight: 600; }
.zp-action:hover { border-color: var(--ml-gold, #ad8a4f); color: var(--ml-ink, #343a40); }
.zp-action > i:first-child { width: 36px; height: 36px; flex: 0 0 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--ml-bg-soft, #fbf8f3); color: var(--ml-gold-dark, #806536); }
.zp-action span { flex: 1 1 auto; min-width: 0; }
.zp-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin: 0; }
.zp-dl div { min-width: 0; }
.zp-dl dt { color: var(--ml-muted, #6a716d); font-size: .82rem; font-weight: 600; }
.zp-dl dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.zp-lock { display: inline-flex; align-items: center; gap: 6px; color: var(--ml-muted, #6a716d); font-size: .8rem; font-weight: 600; }
.zp-teasers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.zp-teaser { display: flex; flex-direction: column; border: 1px solid var(--ml-line, #e7ded0); border-radius: 10px; overflow: hidden; background: #fff; color: var(--ml-ink, #343a40); text-decoration: none; min-width: 0; }
.zp-teaser img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #e9e4dc; display: block; }
.zp-teaser span { padding: 10px 12px; font-weight: 600; font-size: .92rem; overflow-wrap: anywhere; }
.zp-teaser:hover { border-color: var(--ml-gold, #ad8a4f); color: var(--ml-ink, #343a40); }

/* ------------------------------------------------------------------ history */
.zp-tabs { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 4px; margin-bottom: 18px; border: 1px solid var(--ml-line, #e7ded0); border-radius: 999px; background: var(--ml-surface, #fffdf9); }
.zp-tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; color: var(--ml-text, #2f3438); text-decoration: none; font-weight: 600; }
.zp-tabs a.is-active { background: var(--ml-ink, #343a40); color: var(--zp-on-ink, #fff); }
.zp-table-wrap { overflow-x: auto; }
.zp-table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.zp-table th { padding: 10px 12px; text-align: start; font-size: .8rem; font-weight: 700; color: var(--ml-muted, #6a716d); border-bottom: 1px solid var(--ml-line, #e7ded0); white-space: nowrap; }
.zp-table td { padding: 12px; border-bottom: 1px solid #efe8dd; vertical-align: top; text-align: start; }
.zp-table td.zp-num, .zp-table th.zp-num { text-align: end; font-variant-numeric: tabular-nums; }
.zp-table tbody tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------------------------ promotions */
.zp-promos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--zp-gap); align-items: start; }
.zp-promo { overflow: hidden; padding: 0; }
.zp-promo__media { position: relative; aspect-ratio: 16 / 10; background: #e9e4dc; overflow: hidden; }
.zp-promo__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.zp-promo__media.is-fallback img { filter: saturate(.6) brightness(.95); }
.zp-promo__body { padding: 20px; }
.zp-promo__room { display: block; margin-bottom: 6px; color: var(--ml-gold-dark, #806536); font-size: .8rem; font-weight: 700; }
.zp-promo__title { font-size: 1.2rem; margin-bottom: 12px; }
.zp-periods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.zp-periods div { padding: 10px 12px; border-radius: 8px; background: var(--ml-bg-soft, #fbf8f3); border: 1px solid var(--ml-line, #e7ded0); min-width: 0; }
.zp-periods dt { font-size: .76rem; font-weight: 700; color: var(--ml-muted, #6a716d); }
.zp-periods dd { margin: 2px 0 0; font-size: .9rem; font-weight: 600; }
.zp-source-note { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; padding: 8px 10px; border-radius: 8px; background: #f2f4f6; color: var(--ml-muted, #6a716d); font-size: .82rem; }
.zp-promo__desc { color: var(--ml-text, #2f3438); overflow-wrap: anywhere; }
.zp-package { margin-top: 12px; border: 1px solid var(--ml-line, #e7ded0); border-radius: 10px; background: #fff; }
.zp-package[open] { border-color: rgba(173, 138, 79, .6); }
.zp-package summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 12px 16px; cursor: pointer; font-weight: 700; }
.zp-package summary::-webkit-details-marker { display: none; }
.zp-package summary .zp-package__price { margin-inline-start: auto; color: var(--ml-gold-dark, #806536); white-space: nowrap; font-weight: 700; }
.zp-package summary .fa-chevron-down { transition: transform .15s ease; color: var(--ml-gold, #ad8a4f); }
.zp-package[open] summary .fa-chevron-down { transform: rotate(180deg); }
.zp-package__body { padding: 0 16px 16px; overflow-wrap: anywhere; }
.zp-package__content { margin-bottom: 14px; line-height: 1.6; }
.zp-package__content img { height: auto; }
.zp-package__content table { max-width: 100%; display: block; overflow-x: auto; }
.zp-inquiry { padding: 16px; border-radius: 10px; background: var(--ml-bg-soft, #fbf8f3); border: 1px solid var(--ml-line, #e7ded0); }
.zp-inquiry h4 { font-size: .98rem; margin-bottom: 12px; }
.zp-inquiry .zp-form { gap: 12px; }
.zp-prefill { margin: -4px 0 4px; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1023.98px) {
  .zp-grid--sidebar { grid-template-columns: 1fr; }
  .zp-auth, .zp-auth--wide { grid-template-columns: 1fr; gap: 20px; min-height: 0; }
  .zp-auth__intro { text-align: center; }
  .zp-auth__intro p { margin-inline: auto; }
  .zp-auth__points { display: none; }
}
@media (max-width: 1023.98px) {
  /* bottom tab bar below 1024 px: long menu labels (ru / th / ar) no longer squeeze the brand */
  .zp-nav { display: none; }
  .zp-signout__label { display: none; }
  .zp--member .zp-header__tools { margin-inline-start: auto; }
  .zp--member { padding-bottom: calc(var(--zp-tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  .zp-tabbar { display: block; position: fixed; inset-inline: 0; bottom: 0; z-index: 30; background: rgba(255, 253, 249, .98); border-top: 1px solid var(--ml-line, #e7ded0); padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: 0 -6px 20px rgba(33, 38, 36, .06); }
  .zp-tabbar ul { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }   /* M8: one column per nav item (5 with Contact) */
  .zp-tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: var(--zp-tabbar-h); padding: 6px 2px; color: var(--ml-muted, #6a716d); text-decoration: none; font-size: .72rem; font-weight: 600; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
  .zp-tabbar a i { font-size: 1.15rem; }
  .zp-tabbar a.is-active { color: var(--ml-ink, #343a40); }
  .zp-tabbar a.is-active i { color: var(--ml-gold, #ad8a4f); }
}
@media (max-width: 899.98px) {
  /* tables become stacked cards */
  .zp-table--cards thead { display: none; }
  .zp-table--cards, .zp-table--cards tbody, .zp-table--cards tr, .zp-table--cards td { display: block; width: 100%; }
  .zp-table--cards tr { margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--ml-line, #e7ded0); border-radius: 10px; background: #fff; }
  .zp-table--cards td { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border: 0; text-align: end; }
  .zp-table--cards td::before { content: attr(data-label); flex: 0 0 auto; max-width: 50%; color: var(--ml-muted, #6a716d); font-weight: 600; font-size: .85rem; text-align: start; }
  .zp-table--cards td.zp-num { text-align: end; }
  .zp-table--cards td.zp-empty-cell { display: block; text-align: center; }
  .zp-table--cards td.zp-empty-cell::before { content: none; }
}
@media (max-width: 767.98px) {
  .zp-main { padding: 18px 12px 32px; }
  .zp-card { padding: 18px 16px; }
  .zp-grid--2, .zp-grid--3, .zp-form__row, .zp-dl { grid-template-columns: 1fr; }
  .zp-auth__panel { padding: 22px 18px; }
  .zp-periods { grid-template-columns: 1fr; }
  .zp-btn-row > .zp-btn { flex: 1 1 auto; }
  .zp-tabs { display: flex; }
  .zp-tabs a { flex: 1 1 0; justify-content: center; }
}
@media (max-width: 479.98px) {
  .zp-brand__program { display: none; }
  .zp-brand__name { font-size: 1rem; letter-spacing: .1em; }
  .zp-lang__toggle { padding: 0 10px; }
  .zp-stats, .zp-actions { grid-template-columns: 1fr 1fr; }
  .zp-identity { align-items: flex-start; }
  .zp-avatar { width: 56px; height: 56px; flex-basis: 56px; }
}
@media (max-width: 359.98px) {   /* FINAL: very narrow phones (320px) - header fits without horizontal scroll */
  .zp-header__inner { padding: 0 12px; gap: 8px; }
  .zp-lang__toggle { padding: 0 8px; gap: 4px; }
  .zp-lang__current { display: none; }   /* globe + chevron only; the toggle keeps its translated "Language" label */
}
@media (prefers-reduced-motion: reduce) {
  .zp * { transition: none !important; animation: none !important; }
}
@media print {
  .zp-header, .zp-footer, .zp-tabbar { display: none; }
}

/* ------------------------------------------------------------------ Layout rework (2026-10-15): spacing rhythm, balance, uniform media */
/* One vertical rhythm between page sections; cards inside grids never get the stacked-card margin (it misaligned grid rows). */
.zp-main > * + * { margin-top: var(--zp-gap); }
.zp-grid > .zp-card + .zp-card, .zp-promos > .zp-card + .zp-card { margin-top: 0; }
/* Member Home: card column and points / quick-links column end on the same line. */
.zp-grid--sidebar { align-items: stretch; }
.zp-grid--sidebar > .zp-stack { display: flex; flex-direction: column; }
.zp-grid--sidebar > .zp-stack > :last-child { flex: 1 1 auto; }
@media (min-width: 1024px) {
  /* quick links fill the stretched card instead of leaving an empty band */
  .zp-grid--sidebar > .zp-stack > :last-child { display: flex; flex-direction: column; }
  .zp-grid--sidebar > .zp-stack > :last-child > .zp-actions { flex: 1 1 auto; grid-auto-rows: 1fr; }
}
/* Offers: equal-height cards whose packages line up; teaser and offer images share one 16:10 ratio. */
.zp-promos { align-items: stretch; }
.zp-promo { display: flex; flex-direction: column; }
.zp-promo__body { flex: 1 1 auto; }
.zp-teaser span { flex: 1 1 auto; }
@media (max-width: 767.98px) {
  /* compact offer list on phones: thumbnail + title instead of three full-width photos */
  .zp-teasers { grid-template-columns: 1fr; gap: 10px; }
  .zp-teaser { flex-direction: row; align-items: center; }
  .zp-teaser img { width: 112px; flex: 0 0 112px; }
  .zp-teaser span { padding: 10px 14px; }
}
/* ------------------------------------------------------------------ M5 (2026-10-15): Account Settings group, phone link, country search */
.zp-settings__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 18px 0 10px; }
.zp-settings__head:first-of-type { margin-top: 4px; }
.zp-settings__head h3 { margin: 0; font-size: 1.02rem; }
.zp-settings__note { margin-top: 14px; }
.zp-settings__forms { margin-top: 18px; }
.zp-settings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
/* items reuse the approved .zp-action tile (same theme tokens); only the trailing chevron is added */
.zp-settings__item > span { overflow-wrap: anywhere; }
.zp-settings__chev { flex: 0 0 auto; opacity: .45; font-size: .8em; }
.zp-settings__item:focus-visible { border-color: var(--ml-gold, #ad8a4f); }
@media (max-width: 767.98px) { .zp-settings { grid-template-columns: 1fr; } }
.zp-dl a[data-m5-tel] { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.zp .select2-container--bootstrap4 .select2-results__option { padding: 10px 12px; }            /* touch-friendly rows */
.zp .select2-container--bootstrap4 .select2-search__field { min-height: 40px; }
body.zp > .select2-container { width: auto !important; max-width: calc(100vw - 8px); }   /* floating dropdown must not widen the page while open */
/* long translations (e.g. ru "Бронирования", the PNG button) wrap instead of widening a grid column past the screen */
.zp-grid > *, .zp-stack > *, .zp-actions > * { min-width: 0; }
.zp-action span, .zp-stat__label, .zp-card__head h2 { overflow-wrap: anywhere; }
.zp-card__head { flex-wrap: wrap; }
.zp-btn { max-width: 100%; white-space: normal; }
/* ------------------------------------------------------------------ M6 (2026-10-15): loyalty statement */
.zp-amount { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.zp-amount--neg { color: var(--zp-danger, #b42318); }
.zp-reconcile { margin: 12px 0 0; }
.zp-reconcile i { color: var(--zp-success, #2f7a4a); }
[data-m6-balance] .zp-stat__hint { overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ B3: optional Member Home hero (only when a hero image is published) */
.zp--hero .zp-welcome { position: relative; padding: 28px 24px; border-radius: var(--zp-radius, 10px); color: var(--zp-on-ink, #fff); background: linear-gradient(90deg, var(--zp-hero-overlay, rgba(52, 58, 64, .78)), var(--zp-hero-overlay, rgba(52, 58, 64, .78))), var(--zp-hero-bg, none) center / cover no-repeat; box-shadow: var(--zp-shadow); }
.zp--hero .zp-welcome .zp-eyebrow, .zp--hero .zp-welcome .zp-code, .zp--hero .zp-welcome .zp-muted { color: var(--zp-on-ink, #fff); }
.zp--hero .zp-welcome .zp-name { color: var(--zp-on-ink, #fff); }

/* ------------------------------------------------------------------ B3: staff preview banner (appearance_preview.php only) */
.zp-preview-banner { position: relative; z-index: 60; margin: 0; padding: 8px 16px; background: #8a5a12; color: #fff; font-weight: 700; font-size: .85rem; text-align: center; letter-spacing: .04em; }
