/* Member portal, admin and auth pages */
.app-body { background: var(--paper); }
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px; }
.side-logo { padding: 4px 10px 26px; text-decoration: none; }
.side nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--muted-d); font-weight: 600; font-size: 15px; }
.side nav a .ic { width: 20px; height: 20px; }
.side nav a:hover { color: #fff; background: rgba(255,255,255,.04); }
.side nav a.is-active { color: #fff; background: var(--ink-3); }
.side nav a.is-active .ic { color: var(--lime); }
.side-foot { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid var(--line-d); display: grid; gap: 6px; font-size: 13px; color: var(--muted-d); }
.side-foot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkish { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 14px; text-align: left; }
.main { padding: clamp(24px, 4vw, 48px); max-width: 1280px; width: 100%; }
.small { font-size: 14px; }

.page-head { margin-bottom: 28px; }
.page-title { font-size: clamp(28px, 3vw, 38px); font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.page-sub { color: var(--muted); margin-top: 6px; }

.banner { display: flex; align-items: center; gap: 12px; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; margin-bottom: 28px; font-size: 15px; }
.banner .ic { color: var(--lime); }
.banner a { color: var(--lime); font-weight: 700; }
.banner--warn { background: #3A1512; }
.banner--warn .ic, .banner--warn a { color: #FFB4AC; }

.panel { background: var(--white); border-radius: var(--r-lg); padding: 24px; box-shadow: 0 1px 0 var(--line); margin-bottom: 40px; }
.onboard-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.onboard-head h2 { font-size: 19px; letter-spacing: -.02em; }
.onboard-steps { list-style: none; margin: 0; padding: 0; }
.onboard-steps li { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.onboard-steps li:first-child { border-top: 0; }
.onboard-steps h3 { font-size: 16px; }
.onboard-steps p { color: var(--muted); font-size: 14.5px; }
.ob-check { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px #C9CFC9; color: transparent; }
.ob-check .ic { width: 16px; height: 16px; }
.is-done .ob-check { background: var(--lime); box-shadow: none; color: var(--ink); }
.is-done h3 { text-decoration: line-through; color: var(--muted); }

.block { margin-bottom: 48px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.block-head h2 { font-size: 21px; letter-spacing: -.025em; }
.block-head a { font-size: 15px; font-weight: 600; color: var(--lime-ink); }
.empty { background: var(--white); border-radius: var(--r); padding: 40px 24px; text-align: center; color: var(--muted); box-shadow: 0 1px 0 var(--line); display: grid; gap: 16px; justify-items: center; }

.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; }
.tcard { position: relative; display: block; background: var(--white); border-radius: var(--r); padding: 8px; text-decoration: none; box-shadow: 0 1px 0 var(--line); transition: box-shadow .15s ease, transform .15s ease; }
.tcard:hover { box-shadow: 0 0 0 2px var(--lime-deep); }
.tcard-img { border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--paper); }
.tcard-img img { width: 100%; height: 100%; object-fit: cover; }
.tcard-body { padding: 12px 6px 6px; }
.tcard-body h3 { font-size: 15.5px; letter-spacing: -.015em; line-height: 1.3; }
.tcard-body p { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.badge--new { position: absolute; top: 16px; left: 16px; background: var(--lime); color: var(--ink); }
.badge--draft { background: #FFF1C2; color: #6B5200; margin-bottom: 12px; }
.tcard-saved { position: absolute; top: 16px; right: 16px; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--lime); display: grid; place-items: center; }
.tcard-saved .ic { width: 16px; height: 16px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 28px; }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; background: var(--white); border-radius: 999px; padding: 0 16px; box-shadow: inset 0 0 0 1px var(--line); }
.search .ic { width: 18px; color: var(--muted); }
.search input { border: 0; background: none; padding: 11px 0; width: 100%; outline: none; }
.search:focus-within { box-shadow: inset 0 0 0 2px var(--lime-deep); }
.sel-wrap select { appearance: none; border: 0; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2359635C' stroke-width='1.8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E") no-repeat right 14px center; padding: 11px 38px 11px 16px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; cursor: pointer; }

.back { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; text-decoration: none; color: var(--muted); margin-bottom: 20px; }
.ic--flip { transform: scaleX(-1); width: 18px; height: 18px; }
.tpl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; margin-bottom: 56px; }
.tpl-img { border-radius: var(--r); overflow: hidden; box-shadow: 0 30px 60px -30px rgba(15,21,17,.35); }
.tpl-img img { width: 100%; display: block; }
.tpl-media { position: sticky; top: 24px; }
.chips { list-style: none; padding: 0; margin: 14px 0 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--white); box-shadow: inset 0 0 0 1px var(--line); }
.tpl-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.tpl-actions .ic { width: 18px; height: 18px; }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--lime); box-shadow: none; }
.hint { font-size: 14px; color: var(--muted); margin-top: 12px; }
.tpl-sec { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.tpl-sec h2 { font-size: 17px; letter-spacing: -.015em; margin-bottom: 8px; }

.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 4px; }
.prose h2, .prose h3, .prose h4 { margin: 28px 0 10px; letter-spacing: -.02em; line-height: 1.25; }
.prose h2 { font-size: 22px; } .prose h3 { font-size: 18px; }
.prose blockquote { border-left: 3px solid var(--lime-deep); padding: 4px 0 4px 16px; color: var(--muted); }
.prose code { background: var(--paper); padding: 2px 6px; border-radius: 5px; font-size: .92em; }
.prose pre { background: var(--ink); color: #E6EDE7; padding: 16px; border-radius: 12px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose a { color: var(--lime-ink); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

.copylist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.copylist li { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; background: var(--white); border-radius: 12px; padding: 14px 14px 14px 18px; box-shadow: 0 1px 0 var(--line); }
.copylist p { font-weight: 600; }
.copylist--long p { font-weight: 400; white-space: pre-line; }
.copy-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--paper); border-radius: 999px; padding: 8px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.copy-btn .ic { width: 16px; height: 16px; }
.copy-btn:hover { background: #E7EBE3; }
.copy-btn.is-copied { background: var(--lime); }

.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.rcard { display: block; background: var(--ink); color: #fff; border-radius: var(--r); padding: 22px; text-decoration: none; min-height: 150px; }
.rcard:hover { box-shadow: 0 0 0 2px var(--lime); }
.rcard-kind { font-size: 13px; font-weight: 700; color: var(--lime-ink); }
.rcard .rcard-kind { color: var(--lime); }
.rcard h3 { margin-top: 10px; font-size: 18px; letter-spacing: -.02em; }
.rcard p { margin-top: 6px; color: var(--muted-d); font-size: 14.5px; }
.resource { max-width: 720px; }
.resource .page-title { margin-top: 6px; }
.resource .btn { margin: 20px 0 8px; }
.resource .prose { margin-top: 28px; }

.acct { max-width: 640px; display: grid; gap: 0; padding: 8px 24px 24px; }
.acct-row { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.acct-status-box { padding: 20px 0 0; display: grid; gap: 8px; justify-items: start; }
.acct-status { font-weight: 800; font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--lime); color: var(--ink); }
.acct-status--warn { background: #FFE2DE; color: #8F1D16; }
.acct-status--off { background: var(--paper); color: var(--muted); }
.acct-status-box .btn { margin-top: 8px; }
.acct-billing { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 8px; justify-items: start; }

/* Auth / message pages */
.auth-body { background: var(--ink); color: #fff; }
.auth { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 28px; padding: 40px 16px; }
.auth-logo { text-decoration: none; }
.auth-card { width: min(420px, calc(100vw - 32px)); background: var(--white); color: var(--text); border-radius: var(--r-lg); padding: 32px; }
.auth-title { font-size: 24px; letter-spacing: -.03em; line-height: 1.2; }
.auth-text { color: var(--muted); margin: 10px 0 22px; }
.auth-foot { margin-top: 20px; font-size: 14px; color: var(--muted); }
.auth-foot a { color: var(--lime-ink); font-weight: 600; }
.dev-note { background: #FFF1C2; padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.field input, .field select, .field textarea { font-weight: 400; font-size: 16px; padding: 12px 14px; border-radius: 10px; border: 0; box-shadow: inset 0 0 0 1px #CBD1CB; background: #fff; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--lime-deep); }
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.field small { font-weight: 400; color: var(--muted); }
.form-error { background: #FFE2DE; color: #8F1D16; padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }

/* Legal */
.legal-head { padding: 22px 0; border-bottom: 1px solid var(--line); }
.legal-head a { text-decoration: none; }
.legal { max-width: 760px; padding-block: 48px 96px; }
.legal h1 { margin-bottom: 24px; }

/* Admin */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 40px; }
.stat { background: var(--white); border-radius: var(--r); padding: 18px 20px; box-shadow: 0 1px 0 var(--line); }
.stat b { display: block; font-size: 30px; letter-spacing: -.03em; line-height: 1.1; }
.stat span { font-size: 14px; color: var(--muted); }
.table-wrap { overflow-x: auto; background: var(--white); border-radius: var(--r); box-shadow: 0 1px 0 var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td a { color: var(--lime-ink); font-weight: 600; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--paper); }
.pill--active, .pill--published, .pill--trialing { background: #E3FFC8; color: var(--lime-ink); }
.pill--past_due, .pill--flag { background: #FFE2DE; color: #8F1D16; }
.admin-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; max-width: 980px; }
.admin-form .full { grid-column: 1 / -1; }
.admin-form .actions { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.admin-preview { width: 160px; border-radius: 10px; overflow: hidden; }
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.subnav { display: flex; gap: 8px; margin-bottom: 28px; flex-wrap: wrap; }
.subnav a { padding: 8px 14px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 14px; background: var(--white); box-shadow: inset 0 0 0 1px var(--line); }
.subnav a.is-active { background: var(--ink); color: #fff; box-shadow: none; }
.notice { background: #E3FFC8; color: #1F4D00; padding: 10px 14px; border-radius: 10px; margin-bottom: 20px; font-size: 14.5px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 8px; overflow-x: auto; }
  .side-logo { padding: 0 6px 0 0; }
  .side-logo .logo span { display: none; }
  .side nav ul { display: flex; gap: 2px; }
  .side nav a { padding: 8px 10px; font-size: 14px; white-space: nowrap; }
  .side nav a .ic { display: none; }
  .side-foot { display: none; }
  .tpl { grid-template-columns: 1fr; }
  .tpl-media { position: static; max-width: 480px; }
  .admin-form { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .tgrid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tcard-body h3 { font-size: 14px; }
  .onboard-steps li { grid-template-columns: auto 1fr; }
  .onboard-steps li > :last-child { grid-column: 2; justify-self: start; }
  .copylist li { grid-template-columns: 1fr; }
  .copylist .copy-btn { justify-self: start; }
}
.prose .md-table { overflow-x: auto; margin-bottom: 14px; } .prose table { background: var(--white); border-radius: 10px; }

.ad-frame img { display: block; width: 100%; height: auto; }
