:root {
  --bg: #f3f5f1;
  --panel: #ffffff;
  --ink: #17211c;
  --muted: #69746d;
  --line: #dfe5df;
  --brand: #dcff38;
  --brand-dark: #182116;
  --success: #16764a;
  --danger: #b83232;
  --sidebar: #152019;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.login-body { display: grid; place-items: center; padding: 30px; }
.login-card { width: min(420px, 100%); }
.login-brand { display: flex; align-items: center; gap: 12px; font-weight: 750; margin-bottom: 26px; }
.login-brand span.mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--brand); color: var(--brand-dark); font-weight: 900; }
.login-lang { display: block; text-align: center; margin-top: 18px; color: var(--muted); font-size: 13px; font-weight: 700; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 245px; padding: 28px 20px;
  background: var(--sidebar); color: #f7faf6; display: flex; flex-direction: column;
}
.sidebar-menu { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.mobile-menu-toggle, .mobile-panel-label { display: none; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 750; margin: 0 8px 40px; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: var(--brand); color: var(--brand-dark); font-size: 13px; font-weight: 900;
}
nav { display: grid; gap: 5px; }
nav a { padding: 12px 14px; border-radius: 9px; color: #bfc9c1; font-weight: 600; }
nav a:hover, nav a.active { background: #26332a; color: #fff; }
.language-switch {
  display: inline-flex; align-items: center; justify-content: center; margin: 18px 8px 0;
  padding: 9px 12px; border: 1px solid #3b4a3f; border-radius: 8px; color: #f7faf6;
  font-size: 13px; font-weight: 750;
}
.language-switch:hover { background: #26332a; }
.system-state { margin-top: auto; color: #aebbb1; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.system-state span { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 12px var(--brand); }

.content { margin-left: 245px; padding: 42px 48px 70px; max-width: 1600px; }
.page-header { display: flex; justify-content: space-between; align-items: end; gap: 25px; margin-bottom: 28px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(30px, 4vw, 45px); letter-spacing: -0.04em; margin-bottom: 6px; }
h2 { font-size: 20px; letter-spacing: -0.02em; margin-bottom: 18px; }
.eyebrow { color: #77837a; font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; margin-bottom: 8px; }
.subtitle { color: var(--muted); margin-bottom: 0; }

.button {
  display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 9px;
  background: var(--brand-dark); color: white; padding: 11px 17px; font-weight: 700; cursor: pointer;
}
.button:hover { opacity: .88; }
.button.secondary { color: var(--ink); background: #e7ebe7; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.stats article, .panel { border: 1px solid var(--line); background: var(--panel); border-radius: 15px; box-shadow: 0 6px 24px rgba(23,33,28,.035); }
.stats article { padding: 22px; }
.stats span { display: block; color: var(--muted); font-size: 13px; font-weight: 650; }
.stats strong { display: block; font-size: 32px; margin-top: 7px; letter-spacing: -.04em; }
.panel { padding: 25px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(320px, .85fr) minmax(430px, 1.15fr); gap: 18px; }
.two-column { display: grid; grid-template-columns: 1.3fr .7fr; gap: 18px; }
.dashboard-grid > *, .two-column > *, .panel-stack, .panel { min-width: 0; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 15px; }
.reader-status { background: #efffd3; color: #476b10; padding: 6px 9px; border-radius: 99px; font-size: 11px; font-weight: 800; }

form { display: grid; gap: 16px; }
label { color: #4d5951; display: grid; gap: 7px; font-size: 13px; font-weight: 700; }
input, select, textarea {
  width: 100%; border: 1px solid #d4dbd5; border-radius: 9px; background: #fbfcfb;
  color: var(--ink); padding: 11px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: #778969; box-shadow: 0 0 0 3px rgba(119,137,105,.12); }
.scan-result { min-height: 68px; margin-top: 18px; padding: 15px; border-radius: 10px; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.scan-result.neutral { background: #f0f2ef; color: var(--muted); }
.scan-result.allowed { background: #e3f8eb; color: var(--success); }
.scan-result.denied { background: #fde9e7; color: var(--danger); }

.event-list { display: grid; }
.event { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid #edf0ed; }
.event:last-child { border: 0; }
.event-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-size: 12px; font-weight: 900; }
.event-icon.allowed { color: var(--success); background: #e3f8eb; }
.event-icon.denied { color: var(--danger); background: #fde9e7; }
.event p { color: var(--muted); font-size: 12px; margin: 3px 0 0; }
.event time { color: var(--muted); font-size: 12px; }

.search { grid-template-columns: 1fr auto; margin-bottom: 20px; }
.table-wrap, .member-table-wrap { overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
table { border-collapse: collapse; width: 100%; min-width: 720px; }
th, td { padding: 14px 12px; text-align: left; border-bottom: 1px solid #edf0ed; font-size: 13px; }
th { color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
th, td, code { overflow-wrap: anywhere; }
code { border-radius: 6px; background: #f0f2ef; padding: 4px 7px; }
.badge { display: inline-flex; border-radius: 99px; padding: 5px 8px; font-size: 11px; font-weight: 800; }
.badge.success { color: var(--success); background: #e3f8eb; }
.badge.danger { color: var(--danger); background: #fde9e7; }
.link-button { border: 0; background: none; color: #4c654e; padding: 0; cursor: pointer; font-weight: 700; }
.empty { color: var(--muted); text-align: center; padding: 30px; }

.form-panel { max-width: 860px; }
.form-grid { grid-template-columns: 1fr 1fr; }
.full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.alert { border-radius: 9px; padding: 12px; margin-bottom: 18px; }
.alert.danger { background: #fde9e7; color: var(--danger); }
.card-list { display: grid; gap: 10px; }
.card-list article { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 15px; }
.card-list p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* --- panel shell additions ------------------------------------------- */
.panel-badge {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 8px 18px;
  padding: 5px 10px; border-radius: 99px; background: #26332a; color: var(--brand);
  align-self: flex-start; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.side-meta { margin: 16px 8px 0; color: #aebbb1; font-size: 12px; line-height: 1.6; }
.side-meta strong { display: block; color: #f7faf6; font-size: 13px; }
.side-foot { margin: 14px 8px 0; padding-top: 14px; border-top: 1px solid #2c3a30; color: #8d9a92; font-size: 11px; line-height: 1.6; }
.side-actions { display: grid; gap: 8px; margin: 14px 8px 0; }
.side-actions a, .side-actions button {
  display: block; width: 100%; text-align: center; padding: 9px 12px; border-radius: 8px;
  border: 1px solid #3b4a3f; background: none; color: #f7faf6; font-size: 13px; font-weight: 750; cursor: pointer;
}
.side-actions a:hover, .side-actions button:hover { background: #26332a; }
.facility-switch { margin: 0 8px 14px; }
.facility-switch select { background: #1d2a22; border-color: #3b4a3f; color: #f7faf6; padding: 9px 10px; }

.banner { border-radius: 10px; padding: 13px 16px; margin-bottom: 20px; font-size: 13px; font-weight: 650; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.banner.warn { background: #fff4d6; color: #7a5a00; }
.banner.info { background: #e6efff; color: #234b8f; }
.banner.ok { background: #e3f8eb; color: var(--success); }
.banner a { text-decoration: underline; font-weight: 800; }

.stats.four { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stats.six { grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); }
.stats.six strong { font-size: 25px; }
.panel + .panel, .panel-stack > * + * { margin-top: 18px; }
.panel-stack { display: grid; }
.muted { color: var(--muted); font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.inline-form input, .inline-form select { min-width: 120px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.button.small { padding: 7px 11px; font-size: 12px; border-radius: 7px; }
.button.ghost { background: #eef1ee; color: var(--ink); }
.button.danger { background: var(--danger); color: #fff; }
.button.brand { background: var(--brand); color: var(--brand-dark); }
.badge.neutral { color: #4d5951; background: #eef1ee; }
.badge.warn { color: #7a5a00; background: #fff4d6; }
.badge.info { color: #234b8f; background: #e6efff; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 20px; }
.filter-bar label { min-width: 140px; }
.filter-bar .grow { flex: 1; min-width: 220px; }

.chart { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 10px; }
.chart div { flex: 1; background: var(--brand-dark); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; opacity: .85; }
.chart div span { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 9px; color: var(--muted); }
.chart-wrap { padding-bottom: 24px; }

.kv { display: grid; grid-template-columns: 190px 1fr; gap: 10px 18px; font-size: 13px; }
.kv dt { color: var(--muted); font-weight: 650; }
.kv dd { margin: 0; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 14px; font-weight: 700; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--brand-dark); }

.post { border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.post + .post { margin-top: 14px; }
.post h3 { margin: 0 0 6px; font-size: 17px; }
.post .meta { color: var(--muted); font-size: 12px; margin-bottom: 10px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.post .body { font-size: 14px; line-height: 1.65; white-space: pre-wrap; }
.post .body, .post h3 { overflow-wrap: anywhere; }

.checks { display: flex; flex-wrap: wrap; gap: 14px; }
.checks label { flex-direction: row; align-items: center; gap: 7px; display: flex; }
.checks input { width: auto; }
.weekday-picker { display: flex; gap: 6px; }
.weekday-picker label { display: grid; justify-items: center; gap: 4px; font-size: 11px; }
.weekday-picker input { width: auto; }

@media (max-width: 900px) {
  body { overflow-x: hidden; }
  .sidebar {
    position: sticky; inset: 0 0 auto; z-index: 40; width: 100%; padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
    display: block; box-shadow: 0 5px 22px rgba(9, 16, 11, .18);
  }
  .sidebar-head { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .sidebar-identity { min-width: 0; display: grid; gap: 1px; }
  .brand { min-width: 0; margin: 0; gap: 9px; }
  .brand > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brand-mark { width: 36px; height: 36px; flex: 0 0 auto; }
  .mobile-panel-label { display: block; margin-left: 45px; color: #aebbb1; font-size: 10px; font-weight: 750; }
  .mobile-menu-toggle {
    flex: 0 0 auto; width: 44px; height: 44px; border: 1px solid #3b4a3f; border-radius: 10px;
    background: #1d2a22; color: #fff; display: grid; place-items: center; cursor: pointer;
  }
  .mobile-menu-toggle span, .mobile-menu-toggle span::before, .mobile-menu-toggle span::after {
    display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .18s ease, opacity .18s ease;
  }
  .mobile-menu-toggle span { position: relative; }
  .mobile-menu-toggle span::before, .mobile-menu-toggle span::after { content: ""; position: absolute; left: 0; }
  .mobile-menu-toggle span::before { top: -6px; }
  .mobile-menu-toggle span::after { top: 6px; }
  .sidebar.menu-open .mobile-menu-toggle span { background: transparent; }
  .sidebar.menu-open .mobile-menu-toggle span::before { top: 0; transform: rotate(45deg); }
  .sidebar.menu-open .mobile-menu-toggle span::after { top: 0; transform: rotate(-45deg); }
  .sidebar-menu { display: none; max-height: calc(100dvh - 72px); overflow-y: auto; padding: 12px 1px max(8px, env(safe-area-inset-bottom)); }
  .sidebar.menu-open .sidebar-menu { display: flex; }
  .panel-badge { margin: 0 0 10px; }
  .sidebar nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; overflow: visible; }
  .sidebar nav a { min-width: 0; min-height: 44px; display: flex; align-items: center; padding: 10px 12px; white-space: normal; }
  .sidebar nav a.active { background: var(--brand); color: var(--brand-dark); }
  .side-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 12px 0 0; }
  .side-actions a, .side-actions button { min-height: 44px; }
  .side-actions form { display: block; }
  .side-meta { margin: 10px 2px 0; overflow-wrap: anywhere; }
  .side-foot { display: none; }
  .facility-switch { margin: 0 0 10px; }
  .facility-switch select { min-height: 44px; font-size: 16px; }
  .system-state { display: none; }
  .content {
    margin: 0; padding: 24px max(16px, env(safe-area-inset-right)) max(46px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }
  .stats, .stats.four, .stats.six { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
  .stats article { padding: 18px; }
  .stats strong, .stats.six strong { font-size: 27px; }
  .dashboard-grid, .two-column { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .full { grid-column: auto; }
  .kv { grid-template-columns: 1fr; gap: 4px 0; }
  .page-header { align-items: start; flex-direction: column; gap: 16px; margin-bottom: 22px; }
  .page-header > .button, .page-header > .row-actions { width: 100%; }
  .page-header > .row-actions .button { flex: 1; }
  .panel { padding: 19px 16px; }
  .panel-heading { flex-wrap: wrap; }
  .panel-heading > * { min-width: 0; }
  .banner { align-items: flex-start; flex-direction: column; }
  .card-list article { align-items: flex-start; flex-direction: column; overflow-wrap: anywhere; }
  .card-list article > form, .card-list article > .row-actions { width: 100%; }
  .event { grid-template-columns: 38px minmax(0, 1fr); align-items: start; }
  .event time { grid-column: 2; }
  .search { grid-template-columns: 1fr; }
  .filter-bar { display: grid; grid-template-columns: 1fr; }
  .filter-bar label, .filter-bar .grow { width: 100%; min-width: 0; }
  .filter-bar .button { width: 100%; }
  .form-actions { width: 100%; flex-direction: column; }
  .form-actions .button { width: 100%; }
  .row-actions { align-items: stretch; }
  .row-actions .inline-form { flex: 1 1 210px; }
  .inline-form { flex-wrap: wrap; }
  .inline-form input, .inline-form select { min-width: min(120px, 100%); }
  .tabs { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
  .tabs a { flex: 0 0 auto; min-height: 44px; display: flex; align-items: center; }
  .table-wrap { margin-inline: -8px; padding-inline: 8px; box-shadow: inset -12px 0 12px -14px rgba(23, 33, 28, .5); }
  .chart-wrap { overflow-x: auto; }
  .chart { min-width: 560px; }
  .weekday-picker { flex-wrap: wrap; }
  .button, .link-button { min-height: 44px; }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px; min-height: 44px; }
  .login-body { padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .login-card .panel { padding: 22px 18px; }
  .login-card .button { width: 100%; }
}

/* --- level IV: member-facing, mobile-first panel --------------------- */
.member-body { --brand: var(--member-brand); background: #f5f7f3; color: #17211c; }
.member-topbar { height: 76px; padding: 0 max(22px, calc((100vw - 1240px) / 2)); background: #152019; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.member-brand { min-width: 0; display: flex; align-items: center; gap: 11px; }
.member-brand > span { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--member-brand); color: #152019; font-size: 13px; font-weight: 900; }
.member-brand div { min-width: 0; display: grid; }
.member-brand strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-brand small { color: #aebbb1; font-size: 11px; margin-top: 2px; }
.member-top-actions { display: flex; align-items: center; gap: 16px; font-size: 13px; font-weight: 700; }
.member-top-actions form { display: block; }
.member-top-actions button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; }
.member-nav { height: 58px; padding: 0 max(22px, calc((100vw - 1240px) / 2)); background: #fff; border-bottom: 1px solid #e4e9e3; display: flex; align-items: stretch; gap: 6px; overflow-x: auto; }
.member-nav a { display: flex; align-items: center; padding: 0 15px; color: #000; background: transparent; font-size: 13px; font-weight: 750; border-bottom: 3px solid transparent; white-space: nowrap; }
.member-nav a:hover { color: #000; background: #f2f5ed; border-color: var(--member-brand); }
.member-nav a.active { color: #000; background: var(--member-brand); border-color: var(--member-brand); }
.member-nav a:focus-visible { outline: 3px solid rgba(23, 33, 28, .35); outline-offset: -3px; }
.member-content { max-width: 1240px; margin: 0 auto; padding: 38px 22px 80px; }
.member-auth-content { min-height: calc(100vh - 76px); min-height: calc(100dvh - 76px); display: grid; place-items: center; }
.member-page-header { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 26px; }
.member-page-header h1 { font-size: clamp(31px, 4vw, 48px); }
.member-alert { max-width: 760px; margin: 0 auto 18px; border-radius: 11px; padding: 13px 16px; font-weight: 700; font-size: 13px; }
.member-alert.success { background: #e3f8eb; color: #16764a; }
.member-alert.danger { background: #fde9e7; color: #b83232; }
.member-auth-card, .member-card, .member-hero-card, .member-plan-card, .member-quick-card, .member-news-card { background: #fff; border: 1px solid #e0e6df; border-radius: 20px; box-shadow: 0 12px 40px rgba(23,33,28,.055); }
.member-auth-card { width: min(440px, 100%); padding: 34px; }
.member-auth-wide { width: min(760px, 100%); }
.member-auth-card h1 { font-size: 34px; }
.member-auth-card form { margin-top: 25px; }
.member-auth-foot { margin: 22px 0 0; text-align: center; color: #4c654e; font-weight: 750; font-size: 13px; }
.member-primary { background: #17211c; }
.member-form-grid { grid-template-columns: 1fr 1fr; }
.member-full { grid-column: 1 / -1; }
.member-help { color: #69746d; font-size: 12px; margin: -5px 0 0; line-height: 1.55; }
.member-checks { display: grid; gap: 10px; }
.member-checks label, .member-inline-check { display: flex; flex-direction: row; align-items: center; gap: 9px; }
.member-checks input, .member-inline-check input { width: auto; }
.member-inline-note { border-radius: 11px; padding: 12px 14px; background: #e6efff; color: #234b8f; font-size: 13px; margin: 18px 0; }
.member-inline-note.warn { background: #fff4d6; color: #7a5a00; }
.member-code-input { text-align: center; font-size: 26px; font-weight: 850; letter-spacing: .3em; }
.member-resend { margin-top: 18px !important; text-align: center; display: block !important; }
.member-dashboard-grid { display: grid; grid-template-columns: 1.6fr .8fr; gap: 18px; }
.member-hero-card { padding: 28px; background: #18231c; color: #fff; border: 0; overflow: hidden; position: relative; }
.member-hero-card::after { content: ""; position: absolute; width: 210px; height: 210px; border-radius: 50%; background: var(--member-brand); opacity: .09; right: -60px; top: -80px; }
.member-hero-card .eyebrow, .member-hero-card .member-help { color: #aebbb1; }
.member-hero-row { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.member-hero-row h2 { font-size: 27px; margin: 0; }
.member-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 28px; }
.member-kpi-row div { min-width: 0; }
.member-kpi-row span { display: block; color: #aebbb1; font-size: 11px; font-weight: 700; margin-bottom: 5px; }
.member-kpi-row strong { font-size: 17px; overflow-wrap: anywhere; }
.member-status { display: inline-flex; border-radius: 99px; padding: 5px 9px; background: #eef1ee; color: #4d5951; font-size: 10px; font-weight: 850; text-transform: uppercase; }
.member-status.active, .member-status.paid { background: #e3f8eb; color: #16764a; }
.member-status.frozen, .member-status.pending_payment, .member-status.pending { background: #fff4d6; color: #7a5a00; }
.member-status.cancelled, .member-status.expired, .member-status.failed { background: #fde9e7; color: #b83232; }
.member-quick-card { padding: 24px; display: flex; align-items: center; gap: 15px; }
.member-quick-card > b { margin-left: auto; }
.member-quick-card div { min-width: 0; display: grid; gap: 4px; }
.member-quick-card small { color: #69746d; line-height: 1.45; }
.member-quick-icon { flex: 0 0 auto; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--member-brand); font-size: 24px; }
.member-two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.member-card { padding: 24px; }
.member-section { margin-top: 24px; }
.member-section-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.member-section-head h2 { margin: 0; }
.member-section-head a { color: #4c654e; font-size: 12px; font-weight: 800; }
.member-list { display: grid; }
.member-list article { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 0; border-bottom: 1px solid #edf0ed; }
.member-list article:last-child { border: 0; }
.member-list article div { min-width: 0; display: grid; gap: 4px; }
.member-list article strong, .member-list article small { overflow-wrap: anywhere; }
.member-list small { color: #69746d; }
.member-empty { color: #69746d; text-align: center; padding: 22px; }
.member-chip, .member-pin { display: inline-flex; width: fit-content; padding: 5px 9px; border-radius: 99px; background: #eef1ee; font-size: 10px; font-weight: 850; text-transform: uppercase; }
.member-pin { background: var(--member-brand); color: #17211c; }
.member-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; position: relative; z-index: 1; }
.member-actions form { display: block; }
.member-plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.member-plan-card { padding: 23px; display: flex; flex-direction: column; }
.member-plan-card h3 { font-size: 20px; margin: 11px 0 5px; }
.member-price { font-size: 29px; margin: 12px 0; }
.member-price small { font-size: 12px; color: #69746d; }
.member-plan-card ul { color: #69746d; font-size: 13px; line-height: 1.8; padding-left: 18px; flex: 1; }
.member-plan-card form { margin-top: 15px; }
.member-table-wrap table { min-width: 640px; }
.member-table-wrap a { color: #4c654e; font-weight: 750; }
.member-qr-grid { display: grid; grid-template-columns: repeat(2, minmax(280px, 430px)); gap: 18px; }
.member-qr-card { background: #fff; border: 1px solid #e0e6df; border-radius: 22px; padding: 28px; text-align: center; box-shadow: 0 12px 40px rgba(23,33,28,.055); }
.member-qr { background: #fff; border-radius: 16px; padding: 10px; margin: 8px auto 16px; max-width: 290px; }
.member-qr svg { display: block; width: 100%; height: auto; }
.member-qr-card code { display: inline-block; max-width: 100%; overflow-wrap: anywhere; font-size: 11px; }
.member-qr-card p:last-child { color: #69746d; font-size: 13px; line-height: 1.55; margin: 16px 0 0; }
.member-news-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.member-news-card { overflow: hidden; }
.member-news-card img { width: 100%; height: 220px; object-fit: cover; display: block; }
.member-news-card > div { padding: 24px; }
.member-news-card small { color: #69746d; margin-left: 8px; }
.member-news-card h2 { margin: 14px 0 9px; }
.member-news-card p { color: #4d5951; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.member-news-card h2 { overflow-wrap: anywhere; }
.member-profile-grid { align-items: start; }
.member-notification-button { margin-top: 16px; }
.member-danger-zone { border: 1px solid #f2c8c4; background: #fff; border-radius: 16px; padding: 18px 22px; color: #8f2929; }
.member-danger-zone summary { cursor: pointer; font-weight: 800; }
.member-danger-zone form { max-width: 520px; margin-top: 18px; }

@media (max-width: 900px) {
  .member-dashboard-grid, .member-two-column { grid-template-columns: 1fr; }
  .member-form-grid, .member-plan-grid, .member-qr-grid { grid-template-columns: 1fr; }
  .member-full { grid-column: auto; }
  .member-kpi-row { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .member-news-grid { grid-template-columns: 1fr; }
  .member-topbar {
    height: calc(66px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  }
  .member-brand { flex: 1 1 auto; overflow: hidden; }
  .member-brand > span { width: 38px; height: 38px; flex: 0 0 auto; }
  .member-brand small { display: none; }
  .member-brand strong { max-width: min(32vw, 190px); }
  .member-top-actions { flex: 0 0 auto; gap: 2px; font-size: 11px; }
  .member-top-actions a, .member-top-actions button { min-height: 44px; display: flex; align-items: center; padding: 0 7px; }
  .member-top-actions form { display: block; }
  .member-nav {
    position: fixed; z-index: 20; inset: auto 0 0; height: auto; min-height: calc(116px + env(safe-area-inset-bottom));
    padding: 6px max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(48px, 1fr)); gap: 4px;
    overflow: visible; box-shadow: 0 -4px 20px rgba(23,33,28,.09);
  }
  .member-nav a { min-width: 0; min-height: 48px; justify-content: center; padding: 6px 4px; font-size: 11px; text-align: center; border: 0; border-radius: 10px; overflow-wrap: anywhere; }
  .member-nav a:hover { border: 0; }
  .member-content { padding: 25px max(16px, env(safe-area-inset-right)) calc(142px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .member-auth-content { min-height: calc(100vh - 66px - env(safe-area-inset-top)); min-height: calc(100dvh - 66px - env(safe-area-inset-top)); padding-bottom: max(30px, env(safe-area-inset-bottom)); }
  .member-auth-card { padding: 25px 20px; }
  .member-auth-card h1 { font-size: 31px; }
  .member-page-header { align-items: start; flex-direction: column; gap: 14px; margin-bottom: 22px; }
  .member-page-header > .button { width: 100%; }
  .member-hero-card { padding: 23px 19px; }
  .member-hero-row { flex-direction: column; }
  .member-card, .member-plan-card, .member-quick-card, .member-news-card > div, .member-qr-card { padding: 19px 17px; }
  .member-quick-card { align-items: flex-start; }
  .member-actions form { flex: 1 1 100%; }
  .member-actions .button, .member-plan-card .button, .member-auth-card .button { width: 100%; min-height: 46px; }
  .member-list article { align-items: flex-start; }
  .member-list article > span:last-child { flex: 0 0 auto; }
  .member-section-head { flex-wrap: wrap; }
  .member-table-wrap { margin-inline: -5px; padding-inline: 5px; box-shadow: inset -12px 0 12px -14px rgba(23, 33, 28, .5); }
  .member-checks label { align-items: flex-start; }
  .member-checks input { margin-top: 3px; }
  .member-code-input { letter-spacing: .2em; }
  .member-notification-button { width: 100%; min-height: 46px; }
  .member-danger-zone { padding: 18px 16px; }
}
