:root {
  --charcoal: #1C1F1E; --charcoal-mid: #272B2A; --charcoal-light: #343938;
  --green: #2D6A4F; --green-mid: #388A65; --green-light: #52B788; --green-pale: #D8F3DC;
  --cream: #F5F2ED; --white: #FFFFFF; --gray: #8A908E; --gray-light: #E4E8E6; --line: #E9E5DE;
  --text: #1C1F1E; --red: #B42318; --red-pale: #FDECEA; --amber: #8A5A00; --amber-pale: #FFF4D6;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'DM Sans', system-ui, sans-serif; color: var(--text); background: var(--cream); min-height: 100vh; display: flex; flex-direction: column; font-size: 15px; line-height: 1.5; }
a { color: var(--green); }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* nav */
.pt-nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 40px; height: 68px; background: rgba(28,31,30,0.98); border-bottom: 1px solid rgba(255,255,255,0.06); }
.pt-logo img { height: 34px; width: auto; display: block; }
.pt-links { display: flex; align-items: center; gap: 28px; }
.pt-links a, .pt-linkbtn { font-size: 14px; color: rgba(255,255,255,0.55); text-decoration: none; background: none; border: 0; letter-spacing: 0.02em; transition: color .2s; }
.pt-links a:hover, .pt-linkbtn:hover, .pt-links a.on { color: var(--white); }
.pt-links a.pt-cta { background: var(--green); color: var(--white); padding: 9px 18px; border-radius: 4px; font-weight: 600; }
.pt-links a.pt-cta:hover { background: var(--green-mid); }
.pt-inline { display: inline; }
.pt-badge { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 9px; background: var(--green-light); color: var(--charcoal); font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; }

/* layout */
.pt-main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 44px 40px 72px; }
.pt-foot { text-align: center; padding: 24px 16px 32px; font-size: 12px; color: var(--gray); }
.pt-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.pt-tag { font-size: 11px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--green); display: block; margin-bottom: 10px; }
.pt-h1 { font-family: 'Playfair Display', serif; font-weight: 800; font-size: clamp(30px, 4vw, 42px); line-height: 1.1; color: var(--charcoal); }
.pt-h1-sm { font-size: clamp(24px, 3vw, 32px); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pt-h2 { font-size: 18px; font-weight: 700; color: var(--charcoal); margin-bottom: 10px; }
.pt-sub { color: #4A504E; margin-top: 8px; max-width: 640px; }
.pt-muted { color: var(--gray); font-size: 13px; }
.pt-small { font-size: 12px; margin-top: 10px; }
.pt-warn { color: var(--amber); font-weight: 600; font-size: 13px; }
.pt-crumb { font-size: 13px; color: var(--gray); margin-bottom: 14px; }
.pt-crumb a { color: var(--gray); }
.pt-card { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 26px; }
.pt-narrow { max-width: 460px; }
.pt-empty { text-align: center; padding: 48px 26px; }
.pt-empty p { color: #4A504E; max-width: 480px; margin: 6px auto 0; }
.pt-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.pt-stack { display: grid; gap: 20px; }

/* flash */
.pt-flash { padding: 12px 16px; border-radius: 6px; margin-bottom: 20px; font-size: 14px; background: var(--green-pale); color: #1B4332; border: 1px solid #B7E4C7; word-break: break-word; }
.pt-flash-err { background: var(--red-pale); color: var(--red); border-color: #F5C2BD; }
.pt-flash-warn { background: var(--amber-pale); color: var(--amber); border-color: #F1D78A; }

/* auth */
.pt-auth { max-width: 420px; margin: 24px auto 0; background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 36px; }
.pt-auth-wide { max-width: 640px; }
.pt-auth .pt-sub { margin-bottom: 24px; }
.pt-alt { margin-top: 20px; font-size: 14px; color: var(--gray); }

/* forms */
.pt-form { display: grid; gap: 16px; }
.pt-form label { display: block; font-size: 13px; font-weight: 600; color: var(--charcoal-light); }
.pt-form label > input, .pt-form label > select, .pt-form label > textarea { display: block; margin-top: 6px; }
.pt-form small { display: block; font-weight: 400; color: var(--gray); margin-top: 4px; }
.pt-opt { font-weight: 400; color: var(--gray); font-size: 12px; margin-left: 4px; }
input[type=text], input:not([type]), input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; font-weight: 400; font-size: 15px; color: var(--text); background: var(--white); border: 1px solid #D6D2CA; border-radius: 6px; padding: 10px 12px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(45,106,79,0.15); }
textarea { resize: vertical; }
select { height: 44px; padding: 8px 10px; }
.pt-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pt-span2 { grid-column: span 2; }
.pt-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pt-check { display: flex !important; align-items: flex-start; gap: 10px; font-weight: 400 !important; font-size: 14px; cursor: pointer; }
.pt-check input { margin-top: 3px; accent-color: var(--green); width: 16px; height: 16px; flex-shrink: 0; }
.pt-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* buttons */
.pt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--green); color: var(--white); border: 1px solid var(--green); font-weight: 600; font-size: 14px; padding: 11px 20px; border-radius: 5px; text-decoration: none; transition: background .15s, border-color .15s; white-space: nowrap; list-style: none; }
.pt-btn:hover { background: var(--green-mid); border-color: var(--green-mid); }
.pt-btn-ghost { background: var(--white); color: var(--charcoal); border-color: #D6D2CA; }
.pt-btn-ghost:hover { background: var(--cream); border-color: var(--gray); }
.pt-btn-danger { background: var(--white); color: var(--red); border-color: #F0C4BF; }
.pt-btn-danger:hover { background: var(--red-pale); border-color: var(--red); }
.pt-btn-sm { padding: 7px 13px; font-size: 13px; }
.pt-btn[disabled] { opacity: .45; cursor: not-allowed; }
.pt-btnrow { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-dangerzone { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

/* pills */
.pt-pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; vertical-align: middle; font-family: 'DM Sans', sans-serif; }
.pt-pill-active { background: var(--green-pale); color: #1B4332; }
.pt-pill-pending { background: var(--amber-pale); color: var(--amber); }
.pt-pill-disabled { background: #EEE; color: #666; }
.pt-pill-admin { background: var(--charcoal); color: var(--white); }

/* tabs + segmented */
.pt-tabs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.pt-tabs a { padding: 8px 14px; border-radius: 5px; font-size: 14px; color: var(--charcoal-light); text-decoration: none; }
.pt-tabs a span { color: var(--gray); font-size: 12px; margin-left: 2px; }
.pt-tabs a.on { background: var(--white); border: 1px solid var(--line); font-weight: 600; }
.pt-tabs input { margin-left: auto; max-width: 280px; padding: 8px 12px; font-size: 14px; }
.pt-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pt-filters input { width: 240px; }
.pt-seg { display: inline-flex; background: var(--white); border: 1px solid #D6D2CA; border-radius: 6px; padding: 3px; gap: 2px; }
.pt-seg button, .pt-seg label span { display: block; background: none; border: 0; padding: 6px 12px; border-radius: 4px; font-size: 13px; color: var(--charcoal-light); cursor: pointer; }
.pt-seg button.on, .pt-seg input:checked + span { background: var(--charcoal); color: var(--white); }
.pt-seg label { cursor: pointer; }
.pt-seg input { position: absolute; opacity: 0; pointer-events: none; }
.pt-seg input:focus-visible + span { box-shadow: 0 0 0 2px var(--green-light); }

/* library */
.pt-product { margin-bottom: 36px; }
.pt-product-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 2px solid var(--charcoal); margin-bottom: 14px; }
.pt-product-head .pt-h2 { font-family: 'Playfair Display', serif; font-size: 24px; margin: 0; }
.pt-section { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gray); margin: 18px 0 10px; }
.pt-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.pt-item { display: flex; gap: 14px; align-items: flex-start; background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 16px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s, box-shadow .15s; }
.pt-item:hover { border-color: var(--green-light); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(28,31,30,0.06); }
.pt-ico { flex-shrink: 0; width: 38px; height: 38px; border-radius: 6px; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--cream); color: var(--charcoal); }
.pt-ico-video { background: var(--charcoal); color: var(--green-light); font-size: 13px; }
.pt-ico-manual { background: var(--green-pale); color: var(--green); }
.pt-item-body { display: grid; gap: 3px; min-width: 0; }
.pt-item-body strong { font-size: 15px; color: var(--charcoal); }
.pt-item-desc { font-size: 13px; color: #4A504E; }
.pt-item-meta { font-size: 12px; color: var(--gray); }
.pt-draft { font-style: normal; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--amber); background: var(--amber-pale); padding: 1px 6px; border-radius: 3px; margin-left: 4px; }
.pt-none { padding: 8px 0; }
.pt-nomatch { text-align: center; padding: 24px; }

/* viewer */
.pt-viewer { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; align-items: start; }
.pt-viewer-main > .pt-muted { margin: 8px 0 18px; }
.pt-video { width: 100%; max-height: 72vh; background: #000; border-radius: 8px; display: block; }
.pt-pdf { width: 100%; height: 78vh; border: 1px solid var(--line); border-radius: 8px; background: var(--white); margin-bottom: 12px; }
.pt-img { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.pt-desc { margin-top: 20px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 20px; color: #3A403E; }
.pt-viewer-side { position: sticky; top: 92px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 6px 16px 14px; }
.pt-sib { list-style: none; display: grid; gap: 2px; }
.pt-sib a { display: block; padding: 8px 10px; border-radius: 5px; font-size: 14px; text-decoration: none; color: var(--charcoal); }
.pt-sib a:hover { background: var(--cream); }
.pt-sib a.on { background: var(--green-pale); font-weight: 600; }
.pt-sib-k { display: block; font-size: 11px; color: var(--gray); text-transform: uppercase; letter-spacing: .06em; }

/* tables */
.pt-tablewrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 28px; }
.pt-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pt-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gray); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pt-table td { padding: 14px 16px; border-bottom: 1px solid #F1EEE8; vertical-align: top; }
.pt-table tr:last-child td { border-bottom: 0; }
.pt-table td a { color: var(--charcoal); text-decoration: none; }
.pt-table td a:hover { color: var(--green); }
.pt-table td a.pt-btn { color: var(--white); }
.pt-table td a.pt-btn-ghost { color: var(--charcoal); }

/* grants */
.pt-grant { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin: 0 0 12px; }
.pt-grant legend { font-weight: 700; padding: 0 6px; margin-left: -6px; }
.pt-seg-sm { margin-top: 2px; }
.pt-picks { margin-top: 12px; display: grid; gap: 8px; padding: 12px; background: var(--cream); border-radius: 6px; max-height: 340px; overflow-y: auto; }
.pt-picks-sec { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gray); margin-top: 6px; }
.pt-picks-sec:first-child { margin-top: 0; }
.pt-picks-all { font-size: 13px; }
.pt-picks-all button { background: none; border: 0; color: var(--green); text-decoration: underline; font-size: 13px; }
.pt-activity { list-style: none; display: grid; gap: 8px; font-size: 14px; }
.pt-activity li { display: flex; justify-content: space-between; gap: 12px; }

/* add user */
.pt-add { position: relative; }
.pt-add summary::-webkit-details-marker { display: none; }
.pt-add[open] form { position: absolute; right: 0; top: calc(100% + 8px); width: 340px; z-index: 20; box-shadow: 0 16px 40px rgba(28,31,30,0.14); }

/* uploads */
.pt-drop { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 28px 16px; border: 2px dashed #D6D2CA; border-radius: 8px; cursor: pointer; transition: border-color .15s, background .15s; font-size: 14px; margin-top: 12px; }
.pt-drop:hover, .pt-drop.over { border-color: var(--green); background: #F4FBF6; }
.pt-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pt-drop small { color: var(--gray); font-size: 12px; }
.pt-progress { margin-top: 12px; position: relative; height: 34px; background: var(--cream); border-radius: 6px; overflow: hidden; }
.pt-progress div { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--green-pale); transition: width .2s; }
.pt-progress span { position: relative; display: block; padding: 7px 12px; font-size: 13px; font-weight: 600; }
.pt-progress.err { background: var(--red-pale); }
.pt-progress.err div { display: none; }
.pt-progress.err span { color: var(--red); }

/* products editor */
#products { margin-top: 8px; }
.pt-prodrow { display: flex; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid #F1EEE8; }
.pt-inlineform { display: flex; gap: 8px; flex: 1; align-items: center; }
.pt-inlineform input { padding: 8px 10px; font-size: 14px; }
.pt-inlineform input[name=name] { flex: 1.1; }
.pt-inlineform input[name=tagline] { flex: 2; }
.pt-num { width: 74px !important; flex: none; }
.pt-prodnew { margin-top: 14px; }

/* responsive */
@media (max-width: 900px) {
  .pt-cols, .pt-viewer { grid-template-columns: 1fr; }
  .pt-viewer-side { position: static; }
}
@media (max-width: 640px) {
  .pt-nav { padding: 0 16px; height: auto; min-height: 60px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .pt-logo img { height: 28px; }
  .pt-links { gap: 14px; flex-wrap: wrap; }
  .pt-main { padding: 28px 16px 56px; }
  .pt-auth { padding: 26px 20px; }
  .pt-grid2 { grid-template-columns: 1fr; }
  .pt-span2 { grid-column: auto; }
  .pt-grid2 > span:empty { display: none; }
  .pt-items { grid-template-columns: 1fr; }
  .pt-filters input, .pt-tabs input { width: 100%; max-width: none; margin-left: 0; }
  .pt-add[open] form { position: static; width: auto; margin-top: 10px; }
  .pt-prodrow, .pt-inlineform { flex-wrap: wrap; }
}

/* lessons */
.pt-sib-sec { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gray); padding: 12px 10px 4px; }
.pt-sib a { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pt-sib-d { flex-shrink: 0; font-size: 12px; color: var(--gray); font-weight: 400; }
.pt-viewer-side { max-height: calc(100vh - 120px); overflow-y: auto; }
.pt-next { margin-top: 14px; }
.pt-notes h3 { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gray); margin: 18px 0 8px; }
.pt-notes h3:first-child { margin-top: 0; }
.pt-notes p { margin: 0 0 10px; }
.pt-notes ul { margin: 0 0 10px 20px; }
.pt-notes li { margin-bottom: 4px; }
.pt-notes code { font-size: 13px; background: var(--cream); padding: 1px 5px; border-radius: 3px; }
.pt-ts { font: inherit; font-size: 12px; font-weight: 600; color: var(--green); background: var(--green-pale); border: 0; border-radius: 3px; padding: 1px 6px; margin-left: 4px; vertical-align: 1px; }
.pt-ts:hover { background: var(--green); color: var(--white); }
.pt-video::cue { font-family: 'DM Sans', sans-serif; font-size: 18px; }
.pt-drop-sm { padding: 14px; margin-top: 8px; }
.pt-poster { width: 100%; border-radius: 6px; border: 1px solid var(--line); display: block; }
