/* CWD members area: shared styles (matches the main site's design tokens) */
:root{
  --teal-50:#f0fdfa;--teal-100:#ccfbf1;--teal-200:#99f6e4;--teal-300:#5eead4;--teal-400:#2dd4bf;
  --teal-500:#14b8a6;--teal-600:#0d9488;--teal-700:#0f766e;--teal-800:#115e59;--teal-900:#134e4a;--teal-950:#042f2e;
  --white:#fff;--gray-50:#f9fafb;--gray-100:#f3f4f6;--gray-200:#e5e7eb;--gray-300:#d1d5db;--gray-400:#9ca3af;
  --gray-500:#6b7280;--gray-600:#4b5563;--gray-700:#374151;--gray-800:#1f2937;--gray-900:#111827;
  --red-50:#fef2f2;--red-200:#fecaca;--red-700:#b91c1c;--amber-50:#fffbeb;--amber-200:#fde68a;--amber-800:#92400e;
  --shadow-sm:0 1px 2px rgba(0,0,0,.05);--shadow-md:0 4px 6px rgba(0,0,0,.07),0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:0 10px 15px rgba(0,0,0,.08),0 4px 6px rgba(0,0,0,.05);
  --radius:8px;--radius-lg:12px;--radius-xl:16px;--t:.2s ease;
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{-webkit-font-smoothing:antialiased}
body{font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;background:var(--gray-50);color:var(--gray-800);line-height:1.6;font-size:16px;min-height:100vh;display:flex;flex-direction:column}
[hidden]{display:none!important}
a{color:var(--teal-700)}
.serif{font-family:'Source Serif 4',Georgia,serif}

/* top bar */
.topbar{background:var(--white);border-bottom:1px solid var(--gray-200);padding:0 24px;position:sticky;top:0;z-index:50}
.topbar-inner{max-width:1180px;margin:0 auto;height:68px;display:flex;align-items:center;justify-content:space-between;gap:16px}
.brand{display:flex;align-items:baseline;gap:12px;text-decoration:none;min-width:0}
.brand-name{font-weight:700;font-size:1.35rem;color:var(--teal-700);letter-spacing:-.02em;white-space:nowrap}
.brand-tag{font-size:.78rem;font-weight:600;color:var(--gray-500);text-transform:uppercase;letter-spacing:.08em;white-space:nowrap}
.topbar-right{display:flex;align-items:center;gap:14px;min-width:0}
.whoami{font-size:.85rem;color:var(--gray-600);text-align:right;line-height:1.3;min-width:0}
.whoami strong{display:block;color:var(--gray-900);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.whoami span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* buttons and forms */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:11px 22px;border-radius:var(--radius);font-weight:600;font-size:.9rem;text-decoration:none;border:1px solid transparent;cursor:pointer;font-family:inherit;transition:all var(--t);white-space:nowrap;line-height:1.2}
.btn-primary{background:var(--teal-700);color:var(--white);box-shadow:var(--shadow-md)}
.btn-primary:hover{background:var(--teal-800)}
.btn-outline{background:var(--white);color:var(--teal-800);border-color:var(--teal-200)}
.btn-outline:hover{border-color:var(--teal-500);background:var(--teal-50)}
.btn-ghost{background:transparent;color:var(--gray-600);border-color:var(--gray-200)}
.btn-ghost:hover{color:var(--gray-900);border-color:var(--gray-300);background:var(--white)}
.btn-danger{background:var(--white);color:var(--red-700);border-color:var(--red-200)}
.btn-danger:hover{background:var(--red-50)}
.btn-sm{padding:7px 12px;font-size:.8rem}
.btn[disabled]{opacity:.55;cursor:not-allowed}
label{display:block;font-size:.85rem;font-weight:600;color:var(--gray-700);margin-bottom:6px}
.field{margin-bottom:16px}
.hint{font-size:.8rem;color:var(--gray-500);margin-top:5px;font-weight:400}
input[type=text],input[type=email],input[type=password],input[type=date],input[type=search],textarea,select{width:100%;padding:11px 13px;border:1px solid var(--gray-300);border-radius:var(--radius);font:inherit;font-size:.95rem;color:var(--gray-900);background:var(--white);transition:border-color var(--t),box-shadow var(--t)}
textarea{resize:vertical;min-height:84px}
input:focus,textarea:focus,select:focus{outline:none;border-color:var(--teal-500);box-shadow:0 0 0 3px rgba(20,184,166,.18)}
.check{display:flex;gap:10px;align-items:flex-start;font-weight:400;font-size:.9rem;color:var(--gray-700)}
.check input{margin-top:4px;accent-color:var(--teal-700);width:16px;height:16px;flex:0 0 16px}
.alert{padding:12px 14px;border-radius:var(--radius);font-size:.88rem;margin-bottom:16px;border:1px solid}
.alert-error{background:var(--red-50);border-color:var(--red-200);color:var(--red-700)}
.alert-ok{background:var(--teal-50);border-color:var(--teal-200);color:var(--teal-800)}
.alert-warn{background:var(--amber-50);border-color:var(--amber-200);color:var(--amber-800)}

/* auth card */
.auth-wrap{flex:1;display:flex;align-items:center;justify-content:center;padding:48px 16px;background:linear-gradient(170deg,#fff 0%,#f0fdfa 50%,#e6f7f5 100%)}
.auth-card{width:100%;max-width:440px;background:var(--white);border:1px solid var(--gray-200);border-radius:var(--radius-xl);box-shadow:var(--shadow-lg);padding:36px 32px}
.auth-card h1{font-family:'Source Serif 4',Georgia,serif;font-size:1.7rem;line-height:1.25;color:var(--gray-900);margin-bottom:8px}
.auth-card .lead{color:var(--gray-600);font-size:.95rem;margin-bottom:24px}
.auth-card .btn-primary{width:100%;padding:13px}
.auth-foot{margin-top:20px;padding-top:18px;border-top:1px solid var(--gray-100);font-size:.85rem;color:var(--gray-500)}
.kicker{display:inline-block;background:var(--teal-100);color:var(--teal-800);font-weight:600;font-size:.72rem;padding:5px 12px;border-radius:var(--radius);letter-spacing:.06em;text-transform:uppercase;margin-bottom:14px}

/* library */
.main{flex:1;width:100%;max-width:1180px;margin:0 auto;padding:36px 24px 64px}
.feature{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(0,1fr);gap:32px;align-items:start;background:var(--white);border:1px solid var(--gray-200);border-radius:var(--radius-xl);padding:28px;box-shadow:var(--shadow-sm)}
.feature h1{font-family:'Source Serif 4',Georgia,serif;font-size:clamp(1.5rem,2.6vw,2rem);line-height:1.22;color:var(--gray-900);margin-bottom:10px}
.feature .meta{font-size:.85rem;color:var(--gray-500);font-weight:500;margin-bottom:14px}
.feature p.summary{color:var(--gray-700);font-size:.95rem;margin-bottom:16px}
.topics{list-style:none;display:flex;flex-direction:column;gap:9px}
.topics li{display:flex;gap:10px;font-size:.92rem;color:var(--gray-700);line-height:1.5}
.topics li::before{content:'';flex:0 0 6px;height:6px;border-radius:50%;background:var(--teal-500);margin-top:8px}
.pdf-card{display:flex;gap:14px;align-items:center;margin-top:20px;padding:14px 16px;border:1px solid var(--teal-200);border-radius:var(--radius-lg);background:var(--teal-50);color:var(--gray-800);text-decoration:none;transition:border-color var(--t),box-shadow var(--t)}
.pdf-card:hover,.pdf-card:focus-visible{border-color:var(--teal-500);box-shadow:var(--shadow-md);outline:none}
.pdf-card strong{display:block;color:var(--teal-900);font-size:.95rem;line-height:1.3}
.pdf-sub{display:block;font-size:.82rem;color:var(--gray-600);margin-top:2px}
.pdf-icon{flex:0 0 42px;height:42px;border-radius:10px;background:var(--teal-700);color:var(--white);display:flex;align-items:center;justify-content:center}
.ask{margin-top:44px;background:var(--white);border:1px solid var(--gray-200);border-radius:var(--radius-xl);padding:28px;box-shadow:var(--shadow-sm)}
.ask-head h2{font-family:'Source Serif 4',Georgia,serif;font-size:1.45rem;color:var(--gray-900)}
.ask-head .sub{color:var(--gray-600);font-size:.92rem;margin:4px 0 20px}
.ask-grid{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:32px;align-items:start}
.kinds{border:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:16px}
.kinds legend{font-size:.85rem;font-weight:600;color:var(--gray-700);margin-bottom:8px}
.kind{display:flex;gap:10px;align-items:flex-start;border:1px solid var(--gray-200);border-radius:var(--radius);padding:12px;cursor:pointer;margin:0;font-weight:400;transition:border-color var(--t),background var(--t)}
.kind:has(input:checked){border-color:var(--teal-500);background:var(--teal-50)}
.kind input{margin-top:3px;accent-color:var(--teal-700)}
.kind strong{display:block;font-size:.9rem;color:var(--gray-900)}
.kind em{display:block;font-style:normal;font-size:.78rem;color:var(--gray-500);line-height:1.35}
.ask-list h3{font-size:.95rem;color:var(--gray-900);margin-bottom:10px}
.muted-p{color:var(--gray-500);font-size:.88rem}
.req{border:1px solid var(--gray-200);border-radius:var(--radius);padding:12px 14px;margin-bottom:10px}
.req-top{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:6px}
.req-kind{font-size:.78rem;font-weight:700;color:var(--teal-800);text-transform:uppercase;letter-spacing:.05em}
.req-msg{font-size:.88rem;color:var(--gray-700);white-space:pre-wrap;word-break:break-word}
.req-meta{font-size:.76rem;color:var(--gray-500);margin-top:6px}
.player{position:relative;width:100%;aspect-ratio:16/9;border-radius:var(--radius-lg);overflow:hidden;background:var(--teal-950);box-shadow:var(--shadow-lg)}
.player iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
.poster{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;cursor:pointer;color:var(--white);background:radial-gradient(circle at 30% 20%,var(--teal-800),var(--teal-950) 70%);border:0;font:inherit;width:100%;padding:24px;text-align:center}
.poster .play{width:72px;height:72px;border-radius:50%;background:rgba(255,255,255,.14);border:2px solid rgba(255,255,255,.6);display:flex;align-items:center;justify-content:center;transition:transform var(--t),background var(--t)}
.poster:hover .play{transform:scale(1.06);background:rgba(255,255,255,.22)}
.poster .poster-title{font-family:'Source Serif 4',Georgia,serif;font-size:1.15rem;font-weight:600;max-width:90%;line-height:1.3}
.poster .poster-sub{font-size:.8rem;color:var(--teal-200);text-transform:uppercase;letter-spacing:.08em;font-weight:600}
.watermark{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:2}
.watermark span{position:absolute;font-size:12px;font-weight:600;color:rgba(255,255,255,.16);white-space:nowrap;transform:rotate(-18deg);user-select:none}
.player-note{font-size:.78rem;color:var(--gray-500);margin-top:10px}
.section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin:44px 0 16px;flex-wrap:wrap}
.section-head h2{font-family:'Source Serif 4',Georgia,serif;font-size:1.45rem;color:var(--gray-900)}
.section-head input{max-width:300px}
.archive{display:flex;flex-direction:column;gap:10px}
.archive-month{font-size:.75rem;font-weight:700;color:var(--gray-500);text-transform:uppercase;letter-spacing:.08em;margin:18px 0 2px}
.row{display:grid;grid-template-columns:120px minmax(0,1fr) auto;gap:20px;align-items:center;background:var(--white);border:1px solid var(--gray-200);border-radius:var(--radius-lg);padding:16px 20px;cursor:pointer;text-align:left;font:inherit;color:inherit;width:100%;transition:border-color var(--t),box-shadow var(--t)}
.row:hover,.row:focus-visible{border-color:var(--teal-300);box-shadow:var(--shadow-md);outline:none}
.row.current{border-color:var(--teal-500);background:var(--teal-50)}
.row-date{font-size:.85rem;font-weight:600;color:var(--teal-800)}
.row-title{font-weight:600;color:var(--gray-900);font-size:.98rem;line-height:1.35}
.row-sum{font-size:.85rem;color:var(--gray-600);margin-top:3px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.row-side{display:flex;align-items:center;gap:10px;font-size:.8rem;color:var(--gray-500);white-space:nowrap}
.badge{display:inline-block;font-size:.7rem;font-weight:700;padding:3px 9px;border-radius:999px;text-transform:uppercase;letter-spacing:.05em;white-space:nowrap}
.badge-teal{background:var(--teal-100);color:var(--teal-800)}
.badge-gray{background:var(--gray-100);color:var(--gray-600)}
.badge-red{background:var(--red-50);color:var(--red-700)}
.badge-amber{background:var(--amber-50);color:var(--amber-800)}
.empty{background:var(--white);border:1px dashed var(--gray-300);border-radius:var(--radius-lg);padding:40px 24px;text-align:center;color:var(--gray-500)}
.footer-mini{background:var(--teal-950);color:var(--gray-400);font-size:.8rem;padding:22px 24px;text-align:center}
.footer-mini a{color:var(--gray-300)}
.loading{display:flex;align-items:center;justify-content:center;flex:1;padding:80px 16px;color:var(--gray-500)}

/* admin */
.tabs{display:flex;gap:6px;border-bottom:1px solid var(--gray-200);margin-bottom:24px;overflow-x:auto}
.tab{background:none;border:0;border-bottom:2px solid transparent;padding:12px 16px;font:inherit;font-weight:600;font-size:.92rem;color:var(--gray-500);cursor:pointer;white-space:nowrap}
.tab.active{color:var(--teal-800);border-bottom-color:var(--teal-600)}
.card{background:var(--white);border:1px solid var(--gray-200);border-radius:var(--radius-lg);padding:24px;box-shadow:var(--shadow-sm);margin-bottom:24px}
.card h2{font-family:'Source Serif 4',Georgia,serif;font-size:1.25rem;color:var(--gray-900);margin-bottom:4px}
.card .sub{color:var(--gray-500);font-size:.88rem;margin-bottom:20px}
.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 20px}
.grid-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 20px}
.progress{height:10px;background:var(--gray-100);border-radius:999px;overflow:hidden;margin:10px 0 6px}
.progress div{height:100%;width:0;background:var(--teal-600);transition:width .3s ease}
.table-wrap{overflow-x:auto;border:1px solid var(--gray-200);border-radius:var(--radius)}
table{width:100%;border-collapse:collapse;font-size:.87rem}
th{text-align:left;font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:var(--gray-500);font-weight:700;background:var(--gray-50);padding:10px 12px;border-bottom:1px solid var(--gray-200);white-space:nowrap}
td{padding:12px;border-bottom:1px solid var(--gray-100);vertical-align:top}
tr:last-child td{border-bottom:0}
td .muted{color:var(--gray-500);font-size:.8rem}
.actions{display:flex;flex-wrap:wrap;gap:6px}
.firm-row td{background:var(--teal-50);font-weight:700;color:var(--teal-900)}
.copybox{display:flex;gap:8px;margin-top:8px}
.copybox input{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.8rem}
.checklist{list-style:none;display:flex;flex-direction:column;gap:10px}
.checklist li{display:flex;gap:10px;align-items:flex-start;font-size:.92rem}
dialog{margin:auto;border:0;border-radius:var(--radius-xl);padding:0;width:min(640px,calc(100vw - 32px));box-shadow:0 25px 50px rgba(0,0,0,.25)}
dialog::backdrop{background:rgba(4,47,46,.45)}
.dialog-body{padding:26px}
.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:8px}

@media (max-width:900px){
  .feature{grid-template-columns:1fr;padding:20px}
  .ask-grid{grid-template-columns:1fr}
  .ask{padding:20px}
  .grid-3{grid-template-columns:1fr 1fr}
}
@media (max-width:640px){
  .brand-tag{display:none}
  .whoami{display:none}
  .topbar{padding:0 16px}
  .main{padding:24px 16px 48px}
  .row{grid-template-columns:1fr;gap:6px;padding:14px 16px}
  .row-side{justify-content:flex-start}
  .grid-2,.grid-3{grid-template-columns:1fr}
  .kinds{grid-template-columns:1fr}
  .auth-card{padding:28px 20px}
  .section-head input{max-width:none}
}
