
:root {
  --bg:#f7f5ef; --bg-elevated:#fffdf8; --surface:#fffdf8; --ink:#19342b; --ink-soft:#354b40;
  --muted:#596b5e; --line:#dedfd3; --line-strong:#c8cec0; --accent:#224d3b; --accent-invert:#fffdf8;
  --accent-soft:#e8eee2; --brand:#ffd2b5; --brand-ink:#37271d; --ok:#247450; --danger:#a02e37;
  --radius:18px; --radius-sm:12px; --header-h:74px; --surface-dim:#eeeee5; --pine:#17372b;
  --shadow:0 8px 24px #2437280b; --shadow-hover:0 14px 32px #24372819;
  --font:"DM Sans","Noto Sans SC",system-ui,sans-serif;
  --display:"DM Sans","Noto Sans SC",system-ui,sans-serif; --sidebar-w:232px;
}
body { background:var(--bg); color:var(--ink); font-family:var(--font); }
:focus-visible { outline:3px solid #a15d35; outline-offset:3px; }
[hidden] { display:none!important; }
.container { width:min(1220px,calc(100% - 64px)); }
main { min-width:0; }
.section { padding:clamp(34px,5vw,72px) 0; }
.section-head { margin-bottom:clamp(20px,3vw,35px); }
.section-head h1,.section-head h2 { font-size:clamp(28px,3.5vw,44px); font-weight:750; line-height:1.16; letter-spacing:-.035em; margin:0; }
.section-head p { margin-top:9px; color:var(--muted); }
.panel,.form-card,.cs-card,.cs-main { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); }
.panel { padding:clamp(16px,2.5vw,28px); min-width:0; }
.panel h2,.panel h3 { margin-top:0; }
a:not(.btn):not(.chip):not(.logo):not(.nav a):not(.mobile-rail a):hover { color:#246344; }
.btn { min-height:44px; height:auto; border-radius:11px; font-weight:700; padding:9px 16px; }
.btn:active { transform:scale(.98); }
.btn-primary,.btn-brand { background:var(--accent); color:#fffdf8; border-color:var(--accent); box-shadow:none; }
.btn-primary:hover,.btn-brand:hover { background:#2c624b; color:#fff; border-color:#2c624b; }
.btn-secondary,.btn-ghost { background:var(--surface); color:var(--ink); border:1px solid var(--line); box-shadow:none; }
.btn-secondary:hover,.btn-ghost:hover { background:var(--accent-soft); color:var(--ink); border-color:var(--line-strong); }
.btn:disabled { cursor:not-allowed; opacity:.55; transform:none; }
.form-control { min-height:46px; border-radius:11px; border:1px solid var(--line-strong); background:#fffefa; }
.form-control:focus { border-color:#507358; box-shadow:0 0 0 3px #648e6a22; }
textarea.form-control { min-height:120px; }
.chip { min-height:42px; border-radius:10px; color:var(--ink-soft); background:var(--surface); border-color:var(--line); }
.chip.active { background:var(--accent-soft); color:var(--pine); border-color:#b1c5ae; }
.alert { border-radius:11px; }
.alert-success { color:#225d44;background:#e5f1e5; }
.alert-error { color:#852832;background:#f9e6e6; }
.site-header { background:#fffdf8f2; height:var(--header-h); border-color:var(--line); box-shadow:none; }
.header-inner { display:grid;grid-template-columns:minmax(140px,1fr) auto minmax(140px,1fr); align-items:center; }
.logo { justify-self:start; gap:10px;font-weight:800;font-size:20px; letter-spacing:-.025em; white-space:nowrap; }
.logo-mark { background:var(--pine); color:#fff9ea; width:39px;height:39px; border-radius:11px; box-shadow:none; }
.nav { margin:0;gap:3px;display:flex; justify-content:center; background:#f0f1e8; border:1px solid #e7e8dd; padding:4px; border-radius:13px; }
.nav a { padding:8px 16px; color:var(--muted); min-height:38px; border-radius:9px; line-height:1.35; white-space:nowrap; }
.nav a.active,.nav a:hover { background:#fffdf8;color:var(--pine);box-shadow:0 1px 3px #27392b16; }
.header-actions { justify-self:end; display:flex; gap:8px; margin:0; min-width:0; }
.header-actions .account-label { max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:block; }
.mobile-rail { display:none; }
.site-footer { margin-top:40px; background:#eeeee5; border-top-color:var(--line); padding-bottom:26px; }
.footer-inner { gap:18px; }
.footer-links { gap:20px; }
.footer-links a { display:inline-flex; min-height:44px; align-items:center; }
.home-studio { padding:clamp(28px,5vw,65px) 0 0; }
.home-studio__grid { display:grid;grid-template-columns:minmax(0,.87fr) minmax(0,1.13fr); gap:clamp(28px,5vw,70px); align-items:center; }
.home-studio__text { min-width:0; }
.home-studio__text h1 { color:var(--pine); margin:0; font-weight:800;font-size:clamp(36px,5.7vw,83px); line-height:1.05; letter-spacing:-.065em; }
.home-studio__text h1 span { display:block; color:#805139; }
.home-studio__text p { margin:20px 0 26px; max-width:33em; color:var(--ink-soft); font-size:clamp(15px,1.5vw,19px); }
.home-studio__actions { display:flex; gap:10px; flex-wrap:wrap; }
.home-studio__actions .btn { min-height:50px; padding-inline:20px; }
.home-studio__image { position:relative; margin:0; background:#d7d9c4; border-radius:24px 24px 72px 24px; overflow:hidden; aspect-ratio:1.36; }
.home-studio__image img { width:100%; height:100%; object-fit:cover; object-position:56% 50%; }
.home-studio__image::after { content:""; position:absolute; left:0; bottom:0; width:34%; height:8px; background:#eeb18c; }
.home-plans { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.home-plan { display:flex; flex-direction:column; gap:8px; padding:22px; border:1px solid var(--line); border-radius:16px; background:#f3f4e9; }
.home-plan h3,.home-plan p { margin:0; }
.home-plan strong { font-size:26px; }
.home-plan p { color:var(--muted); }
.home-plan a { align-self:flex-start; margin-top:4px; }
.library { display:grid; grid-template-columns:174px minmax(0,1fr); gap:24px; align-items:start; }
.library__filter { background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:12px; }
.library__filter h2 { margin:6px 9px 12px; font-size:14px; }
.library__filter .chip-row { display:grid; gap:5px; margin:0; }
.library__filter .chip { border-color:transparent; background:none; }
.library__filter .chip.active { background:#e8eee2; border-color:#d5e4cf; }
.library__search { display:flex; align-items:center; gap:8px; }
.library__search input { width:min(270px,36vw); }
.library__empty { grid-column:1/-1; padding:32px; background:var(--surface); border:1px dashed var(--line-strong); border-radius:15px; }
.tpl-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.tpl-card { display:flex;flex-direction:column; min-width:0; border-radius:18px; background:var(--surface); }
.tpl-cover { aspect-ratio:1.8; background:#dce9d9; }
.tpl-cover::after { display:none; }
.tpl-cover img { object-fit:cover; }
.tpl-cover--placeholder { display:grid;place-items:center; background:var(--tile-bg,#dce9d9); }
.tpl-cover--placeholder::before { content:""; position:absolute; width:145px;height:81px; right:-18px;bottom:-18px; border:1px solid #17372b31; border-radius:34px; transform:rotate(-32deg); box-shadow:0 0 0 12px #ffffff38,0 0 0 26px #17372b11; }
.tpl-monogram { z-index:1; font-size:40px; font-weight:800; line-height:1; color:#244436; }
.tpl-card[data-template="flash-caption"] { --tile-bg:#ead9d4; }
.tpl-card[data-template="logic-tree"] { --tile-bg:#e1e6ce; }
.tpl-card[data-template="sketch-lecture"] { --tile-bg:#f3e6cf; }
.tpl-card[data-template="material-lecture"] { --tile-bg:#e8e1ed; }
.tpl-card[data-template="time-capsule"] .tpl-cover img { object-fit:contain; background:#dbe4db; }
.tpl-cover .badges { top:10px;left:10px; gap:4px; flex-wrap:wrap; }
.badge { background:#fffdf4; color:#304235; border-radius:7px; backdrop-filter:none; }
.badge.hot,.badge.new { background:var(--brand); color:var(--brand-ink); }
.tpl-body { display:flex;flex:0 1 auto;flex-direction:column; gap:6px;padding:12px 14px 14px; }
.tpl-body h3,.tpl-body p { margin:0; }
.tpl-body h3 { font-size:18px; }
.tpl-desc { display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;min-height:0; }
.tpl-meta { margin-top:0; margin-bottom:0; font-size:12px; color:var(--muted); }
.tpl-actions { display:block;width:100%;margin-top:6px; }
.tpl-actions .btn,.tpl-actions .tpl-make-btn { display:flex;align-items:center;justify-content:center;width:100%;min-width:0;min-height:44px;box-sizing:border-box;white-space:nowrap;padding:10px 14px;border-radius:14px; }
.tpl-actions .btn-ghost { background:transparent; }
.preview-pane { min-height:0; aspect-ratio:16/10; background:#e6ebde; border-radius:18px; box-shadow:none; }
.create-layout { grid-template-columns:minmax(0,1.48fr) minmax(0,.67fr); gap:24px; }
.create-layout aside .panel { top:calc(var(--header-h) + 18px)!important; }
.create-studio { display:grid; grid-template-columns:minmax(0,280px) minmax(0,1fr); gap:24px; padding:32px 0 48px; background:none; }
.cs-aside { top:calc(var(--header-h) + 16px);min-width:0; }
.cs-preview { border-color:var(--line); background:var(--pine); color:#fff9ea; border-radius:17px; }
.cs-preview img { background:#dce5dc; }
.cs-preview-mark { background:var(--brand);color:var(--brand-ink); }
.cs-main { padding:clamp(16px,3vw,29px); min-width:0; }
.cs-head { padding-bottom:16px; border-bottom:1px solid var(--line); }
.cs-head h1 { font-size:clamp(25px,4vw,40px); line-height:1.2; }
.cs-kicker { color:#596b5e; }
.cs-quota { background:#e8eee2; color:var(--pine); }
.cs-card { box-shadow:none; border-radius:14px; padding:16px; background:#fbfaf4; }
.cs-card--hero { background:#f0f3e8; border-color:#d6e1ce; }
.cs-card-h h3 { font-size:17px; }
.cs-script { background:#fffef9!important; border-radius:11px!important; resize:vertical; }
.cs-seg-btn,.cs-ratio-btn,.cs-swatch { min-height:44px; background:#fffdf8; }
.cs-seg-btn.is-on,.cs-ratio-btn.is-on { background:#e5efe1; color:var(--pine); border-color:#93ac95; }
.cs-swatch.is-on { border-color:#507358; box-shadow:0 0 0 2px #648e6a30; }
.cs-actions { padding:10px; background:#fffdf8f5; box-shadow:0 -4px 18px #25452f0b; border:1px solid var(--line); border-radius:14px; z-index:8; }
.cs-submit { background:var(--accent)!important; color:white!important; min-width:0; }
.cs-field label { line-height:1.45; }
[data-material-picker] { min-width:0; background:#e7efe2; overflow-wrap:anywhere; border-color:#bfd0bb!important; }
.plan-grid { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px; }
.plan-card { display:flex;flex-direction:column;gap:8px;min-width:0; box-shadow:none;border-radius:18px;padding:clamp(16px,2vw,25px); }
.plan-card.featured { color:var(--ink); background:#e8efe1; border-color:#adbd9e; box-shadow:none; transform:none; }
.plan-card h3 { font-size:23px; }
.plan-card .plan-price,.plan-card.featured .plan-price { color:var(--pine); font-size:clamp(30px,3.2vw,45px); }
.plan-card .plan-days,.plan-card.featured .plan-days { color:var(--muted); }
.plan-card .plan-features li,.plan-card.featured .plan-features li { color:var(--ink-soft); border-color:var(--line); }
.plan-card p { color:var(--muted); margin:0 0 8px; font-size:13px; }
.plan-card>form,.plan-card>a.btn,.plan-card>button { margin-top:auto; }
.stats-row { gap:12px; }
.stat-box { padding:17px;background:#edf1e6; border-color:#dce1d3;box-shadow:none; }
.stat-box .value { color:var(--pine);font-variant-numeric:tabular-nums; }
.form-card { padding:clamp(22px,4vw,38px); max-width:460px; }
.auth-shell { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; align-items:stretch; max-width:940px; margin:clamp(28px,6vw,75px) auto; }
.auth-shell .form-card { margin:0; max-width:none; width:auto; }
.auth-banner { background:var(--pine); border-radius:18px; padding:32px; color:#fff9ea; display:flex;flex-direction:column; justify-content:flex-end; min-height:250px; }
.auth-banner strong { font-size:clamp(26px,4vw,43px); max-width:9em; line-height:1.18; }
.auth-banner a { color:var(--brand); margin-bottom:auto; }
.progress { background:#dce8db; height:11px; }
.progress>span { background:#367356; }
.task-page { max-width:900px; }
.task-page .panel { border-top:5px solid #648e6a; }
.table { min-width:520px; }
.table th,.table td { padding:12px; border-color:var(--line); }
.table th { background:#f0f2e9;color:var(--ink-soft); }
main .grid2 { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px; }
.admin-shell { gap:0; }
.admin-main { padding:22px clamp(16px,3vw,38px) 38px; }
.sidebar { background:var(--pine); color:#ecf0e5; padding:23px 13px; }
.sidebar .brand { color:#fffdf4; padding:8px 10px 24px; }
.sidebar .brand span { background:var(--brand); color:var(--brand-ink); }
.side-nav a { color:#e4eadf; min-height:44px; border-radius:8px; }
.side-nav a.active { background:#365849; color:#fffdf5; box-shadow:inset 3px 0 #f2bca3; }
.side-nav .nav-group { color:#bdcfbf; margin-top:16px; }
.admin-top { padding:18px 0 20px;border-bottom:1px solid var(--line);margin-bottom:20px; }
.admin-top h1 { font-size:clamp(26px,3vw,43px); }
.admin-topbar { border-bottom:1px solid var(--line); padding-bottom:9px; }
.admin-menu-btn { width:auto;min-width:48px; min-height:44px; }
.admin-main .cards { gap:14px; }
.admin-main .card { border:1px solid var(--line); background:#f2f4eb; }
.admin-main .chart .bar { background:#4c765d; }
.admin-main .card,.admin-main .panel { min-width:0; }
.admin-table-region { overflow-x:auto; max-width:100%; margin-bottom:16px; }
@media(max-width:980px) {
  .container { width:calc(100% - 36px); }
  .header-inner { grid-template-columns:minmax(0,1fr) auto; }
  .nav { display:none; }
  .tpl-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .plan-grid { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
  .create-studio { grid-template-columns:minmax(0,210px) minmax(0,1fr); }
  .admin-topbar { position:sticky;top:0;z-index:20;background:var(--bg); }
  .sidebar { width:min(300px,86vw); }
  body:not(.admin-nav-open) .sidebar { visibility:hidden; }
  body.admin-nav-open .sidebar { visibility:visible; }
}
@media(max-width:720px) {
  :root { --header-h:58px; --mobile-nav-h:calc(62px + env(safe-area-inset-bottom)); }
  body.public-ui { padding-bottom:var(--mobile-nav-h); }
  .container { width:calc(100% - 28px); }
  .site-header .logo { font-size:17px; }
  .logo-mark { width:34px;height:34px; }
  .header-actions .btn { min-height:44px; padding-inline:10px; }
  .header-actions .account-label { max-width:min(32vw,115px); }
  .header-actions .account-top { display:none; }
  .mobile-rail { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));position:fixed;z-index:55;left:0;right:0;bottom:0;background:#fffdf9f8;border-top:1px solid var(--line); padding:4px 6px env(safe-area-inset-bottom); }
  .mobile-rail a { display:flex; min-height:54px; flex-direction:column; justify-content:center; align-items:center;gap:4px;color:var(--muted);font-size:12px;border-radius:10px; }
  .mobile-rail a.active { color:var(--pine);background:#e8efe3;font-weight:750; }
  .mobile-glyph { font-size:16px; line-height:1; }
  .home-studio { padding-top:28px; }
  .home-studio__grid { grid-template-columns:1fr;gap:21px; }
  .home-studio__text h1 { font-size:clamp(36px,10.5vw,59px); }
  .home-studio__text p { margin:13px 0 17px; }
  .home-studio__image { aspect-ratio:1.78;border-radius:18px 18px 44px 18px; }
  .home-studio__actions .btn { width:auto;flex:1;min-width:0; }
  .home-plans { grid-template-columns:1fr; }
  .home-plan { display:grid;grid-template-columns:minmax(0,1fr) auto; align-items:center; }
  .home-plan p { grid-row:2; }
  .home-plan a { grid-column:2;grid-row:2; }
  .section-head { align-items:stretch; }
  .library { display:block; }
  .library__filter { background:none;border:0;padding:0 0 12px; }
  .library__filter h2 { position:absolute;clip:rect(0,0,0,0); }
  .library__filter .chip-row { display:flex; flex-wrap:nowrap; overflow:auto; padding-bottom:5px; }
  .library__filter .chip { flex-shrink:0; }
  .library__search { width:100%; }
  .library__search input { width:auto; min-width:0; flex:1; }
  .tpl-grid { gap:10px; }
  .tpl-card { border-radius:13px; }
  .tpl-cover { aspect-ratio:1.55; }
  .tpl-body { padding:10px; gap:6px; }
  .tpl-body h3 { font-size:15px; }
  .tpl-desc { font-size:12px; }
  .tpl-actions { display:block;width:100%; }
  .tpl-actions .btn,.tpl-actions .tpl-make-btn { width:100%; flex:none; font-size:15px; min-height:46px; padding:12px 16px; }
  .tpl-actions .btn-ghost { min-width:0; }
  .create-layout,.create-studio,.auth-shell,main .grid2 { grid-template-columns:minmax(0,1fr); }
  .create-layout { padding-top:22px; gap:12px; }
  .create-layout aside .panel { position:static!important; }
  .create-studio { padding-top:14px; gap:12px; }
  .create-studio .cs-aside { position:static; }
  .create-studio .cs-preview { display:none; }
  .create-studio .cs-steps { display:none; }
  .cs-main { padding:14px; }
  .cs-card { padding:13px; }
  .cs-actions { bottom:calc(var(--mobile-nav-h) + 7px); }
  .cs-actions .btn { flex:1 1 auto; }
  .cs-field .form-control,.form-card .form-control { font-size:16px; }
  .plan-grid { grid-template-columns:minmax(0,1fr)!important; }
  .stats-row { grid-template-columns:repeat(2,minmax(0,1fr));gap:8px; }
  .stat-box .value { font-size:23px; }
  .auth-shell { margin:18px auto 24px;gap:11px; }
  .auth-banner { min-height:0;padding:18px;gap:6px; }
  .auth-banner strong { font-size:22px; }
  .auth-banner a { margin:0; }
  .site-footer { margin-top:24px; }
}
@media (max-width:370px) {
  .tpl-grid { grid-template-columns:minmax(0,1fr); }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; animation:none!important; transition:none!important; }
  .reveal { opacity:1;transform:none; }
}

.cs-quota em { color:var(--pine); }
.cs-steps span { background:#dfeadb;color:var(--pine); }
.create-studio .cs-preview { min-height:225px; }
.create-studio .cs-cover { min-height:225px; }
.dashboard-actions { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:16px 0; }
.dashboard-actions .btn { display:flex;justify-content:space-between; }
.auth-banner a:hover { color:#ffecd5!important; }
.skip-link { position:fixed;z-index:100;left:14px;top:-80px;padding:10px 16px;background:#fffdf9;color:var(--pine);border-radius:9px; }
.skip-link:focus { top:10px; }
@media (min-width:721px) and (max-width:980px) {
  .header-inner { grid-template-columns:minmax(100px,1fr) auto minmax(100px,1fr);gap:10px; }
  .public-ui .nav { display:flex; }
  .nav a { padding-inline:9px; }
}
@media(max-width:720px) {
  .dashboard-actions { grid-template-columns:1fr;gap:7px; }
}

.admin-ui .btn.primary,.admin-ui .btn.btn-primary { background:var(--accent); border-color:var(--accent); color:white; }
.admin-ui .table-wrap { max-width:100%; }
@media (max-width:720px) {
  .header-actions .btn-ghost { display:inline-flex; }
  .create-studio .cs-aside:has(.cs-preview:only-child) { display:none; }
}

.tpl-miniview { position:relative;z-index:1;display:grid;gap:6px;width:64%;padding:15px 16px 17px;border:1px solid #17372b22;border-radius:10px;background:#fffdf9d6;box-shadow:0 5px 13px #29403812;transform:rotate(-4deg); }
.tpl-miniview .tpl-monogram { font-size:clamp(14px,2vw,26px);white-space:nowrap; }
.tpl-miniview i { height:4px;width:70%;background:#78948750;border-radius:6px; }
.tpl-miniview i:last-child { width:49%; }
.tpl-card[data-template="flash-caption"] .tpl-miniview { background:#172f33;transform:rotate(3deg); }
.tpl-card[data-template="flash-caption"] .tpl-monogram { color:#fff7eb;text-shadow:2px 2px #aa5448; }
.tpl-card[data-template="flash-caption"] .tpl-miniview i { background:#e6a9976b; }
.tpl-card[data-template="logic-tree"] .tpl-miniview,.tpl-card[data-template="material-lecture"] .tpl-miniview { grid-template-columns:repeat(3,minmax(0,1fr)); }
.tpl-card[data-template="logic-tree"] .tpl-monogram,.tpl-card[data-template="material-lecture"] .tpl-monogram { grid-column:1/-1; }
.tpl-card[data-template="logic-tree"] .tpl-miniview i,.tpl-card[data-template="material-lecture"] .tpl-miniview i { margin-top:4px;width:100%;height:15px;background:#b8c9ab; }
.tpl-card[data-template="logic-tree"] .tpl-miniview i:nth-of-type(2) { background:#e3ba9f; }
.tpl-card[data-template="logic-tree"] .tpl-miniview i:nth-of-type(3) { background:#bfd1dd; }
.tpl-card[data-template="sketch-lecture"] .tpl-miniview { transform:rotate(3deg);background:#fbf7e7; }
.tpl-card[data-template="sketch-lecture"] .tpl-miniview i { background:#a97e46;height:2px; }
.tpl-card[data-template="material-lecture"] .tpl-miniview i { background:#c2aecc; }
@media(max-width:720px) { .tpl-miniview { padding:9px 10px 10px;gap:4px;width:70%; } }

.tpl-cover img { position:absolute; inset:0; width:100%; height:100%; }
.admin-ui .form-row,.admin-ui .form-control { min-width:0; max-width:100%; }
@media(max-width:980px) {
  .admin-ui .grid2,.admin-ui .grid3 { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:720px) {
  .tpl-actions { display:block; width:100%; }
  .tpl-actions .btn-ghost { min-width:0; }
  .cs-script { height:185px; min-height:185px!important; }
}

.admin-ui .admin-main { overflow-wrap:anywhere; }
.admin-ui .panel { max-width:100%; overflow-x:auto; }

@media(max-width:560px) { .admin-main .cards { grid-template-columns:repeat(2,minmax(0,1fr));gap:9px; } .admin-main .cards .card { padding:13px; } }

/* Membership purchase */
.membership-pricing { padding-block:clamp(28px,5vw,66px); }
.pricing-header { display:flex;justify-content:space-between;align-items:end;gap:18px;margin-bottom:28px; }
.pricing-header h1 { margin:0;line-height:1.14;font-size:clamp(37px,5.1vw,65px);letter-spacing:-.055em; }
.pricing-header p { margin:10px 0 0;color:var(--muted); }
.pricing-notice { margin-bottom:18px;padding:13px 16px;border:1px solid #e5d9c8;border-radius:10px;background:#fbf0e0;color:#664a30;font-size:14px; }
.pricing-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px; }
.pricing-tier { display:flex;flex-direction:column;min-width:0;overflow:hidden;border:1px solid var(--line-strong);border-radius:20px;background:var(--surface);box-shadow:var(--shadow); }
.pricing-tier__header { padding:22px 23px 17px;background:#edf1e6;border-bottom:1px solid #d6ded1; }
.pricing-tier__header h2,.pricing-voice h2 { margin:0;font-size:24px;letter-spacing:-.02em; }
.pricing-tier__price { display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;margin-top:6px; }
.pricing-tier__price strong { font-size:clamp(33px,4.5vw,52px);font-weight:800;line-height:1.1;letter-spacing:-.055em;white-space:nowrap; }
.pricing-tier__price span { color:var(--muted);font-size:14px;white-space:nowrap; }
.pricing-tier__quota { display:inline-flex;margin-top:12px;padding:4px 9px;border-radius:6px;background:#dce9d5;color:#264831;font-size:13px;font-weight:750; }
.pricing-tier--annual { border-color:#73927d; }
.pricing-tier--annual .pricing-tier__header { background:#234b38;color:#fffdf8;border-color:#234b38; }
.pricing-tier--annual .pricing-tier__price span { color:#e0eadc; }
.pricing-tier--annual .pricing-tier__quota { background:#ffe0c8;color:#533921; }
#member-brand .pricing-tier__header { background:#f4e8d9;border-color:#e6d6c3; }
#member-brand .pricing-tier__quota { background:#efdbc1;color:#62482f; }
.pricing-tier__body { display:flex;flex:1;flex-direction:column;gap:12px;padding:19px 23px 23px; }
.pricing-benefits { display:grid;gap:9px;margin:0;padding:0;list-style:none;font-size:14px;color:var(--ink-soft); }
.pricing-benefits li { position:relative;padding-inline-start:19px;line-height:1.45; }
.pricing-benefits li::before { content:"";position:absolute;left:1px;top:.45em;width:9px;height:5px;border-left:2px solid #497955;border-bottom:2px solid #497955;transform:rotate(-45deg); }
.pricing-note { margin:0;color:var(--muted);font-size:12px;line-height:1.55; }
.purchase-form { margin-top:auto;display:grid;gap:8px; }
.purchase-methods { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px; }
.purchase-methods .chip { justify-content:center; white-space:nowrap; min-height:44px; }
.purchase-button { margin-top:auto;width:100%;gap:8px; }
.pricing-rule { margin:14px 0 22px;line-height:1.65;color:var(--muted);font-size:13px; }
.pricing-rule strong { color:var(--ink);margin-right:8px; }
.pricing-voice { display:grid;grid-template-columns:minmax(0,1.5fr) minmax(180px,.55fr);gap:24px;align-items:center;padding:22px;border:1px solid var(--line);border-radius:17px;background:#f0f1e9;scroll-margin-top:calc(var(--header-h) + 14px); }
.pricing-voice .pricing-benefits { margin-top:10px; }
.pricing-voice__buy { display:grid;gap:9px; }
.pricing-voice__buy .pricing-tier__price { margin:0; }
.pricing-tier {scroll-margin-top:calc(var(--header-h) + 14px);}
/* Template authoring */
.creation-page { padding-top:24px; }
.creation-header { padding:0 0 18px;display:flex;gap:14px;align-items:end;justify-content:space-between;border-bottom:1px solid var(--line); }
.creation-header h1 { margin:6px 0 0;font-size:clamp(30px,4.7vw,54px);line-height:1.13;letter-spacing:-.045em; }
.creation-breadcrumb { display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted); }
.creation-breadcrumb a { display:inline-flex;align-items:center;min-height:35px; }
.creation-page .create-studio { width:100%;margin:0;grid-template-columns:minmax(0,1fr) minmax(200px,285px);gap:18px;padding-top:18px; }
.creation-page .cs-main { background:transparent;border:0;box-shadow:none;padding:0;min-width:0; }
.creation-page .cs-preview { background:#274c3b;min-height:0;aspect-ratio:4/3; }
.creation-page .cs-cover { min-height:0; }
.creation-page .cs-preview-empty { padding:20px; }
.creation-page .cs-preview-empty h2 { font-size:19px; }
.creation-index { display:grid;gap:4px;padding:9px;margin-top:12px;background:var(--surface);border:1px solid var(--line);border-radius:13px; }
.creation-index a { display:flex;align-items:center;justify-content:space-between;gap:6px;padding:8px 10px;min-height:42px;border-radius:8px;color:var(--ink-soft); }
.creation-index a:hover { background:#eaf0e5; }
.creation-page .cs-card { border-radius:16px;background:var(--surface);padding:clamp(14px,2vw,23px); }
.creation-page .cs-card--hero,.creation-page .creation-script { background:#eff4e9;border:1px solid #d1dfc9; }
.creation-page .cs-card-h { border-bottom:1px solid var(--line);padding-bottom:10px; }
.creation-page .cs-card-h h2,.creation-page .cs-card-h h3 { margin:0;font-size:20px; }
.creation-page .cs-script { width:100%;height:255px;min-height:175px!important; }
.creation-page .cs-card,.creation-page .form-group[id] { scroll-margin-top:calc(var(--header-h) + 12px); }
.creation-page .cs-actions { margin-top:12px; }
.creation-page .cs-actions .btn { padding-inline:13px; }
.creation-page .creation-script > label { display:block;font-size:20px;font-weight:700;margin-bottom:10px; }
.creation-page .creation-settings { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px; }
.creation-page .creation-settings .cs-field { min-width:0;margin-bottom:0; }
.creation-page .creation-setting--full { grid-column:1/-1; }
.creation-page .creation-extra-link { display:inline-flex;align-items:center;min-height:40px;color:#2c6046;font-size:13px;font-weight:700; }
.creation-page .cs-swatch-face { height:42px; }
.creation-page .cs-swatches { grid-template-columns:repeat(6,minmax(0,1fr)); }
.creation-page .cs-row2 { align-items:start; }
@media(max-width:1000px) {
  .pricing-tier__header,.pricing-tier__body { padding-inline:15px; }
  .creation-page .create-studio { grid-template-columns:minmax(0,1fr) minmax(160px,210px); }
  .creation-page .cs-swatches { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media(max-width:720px) {
  .pricing-header { align-items:flex-start;flex-direction:column;gap:9px;margin-bottom:16px; }
  .pricing-header h1 { font-size:38px; }
  .pricing-grid { grid-template-columns:minmax(0,1fr);gap:12px; }
  .pricing-tier__header { padding:15px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;align-items:center; }
  .pricing-tier__header h2 { font-size:21px; }
  .pricing-tier__price { margin:0;gap:4px; }
  .pricing-tier__price strong { font-size:32px; }
  .pricing-tier__price span { font-size:12px; }
  .pricing-tier__quota { margin:0;justify-self:start; }
  .pricing-voice { grid-template-columns:minmax(0,1fr);gap:14px;padding:16px; }
  .pricing-voice .pricing-tier__price strong { font-size:36px; }
  .creation-page { padding-top:9px; }
  .creation-header { align-items:center;padding-bottom:12px;gap:8px; }
  .creation-header h1 { font-size:31px; }
  .creation-page .create-studio { display:block;padding-top:12px; }
  .creation-page .cs-aside { display:none; }
  .creation-page .cs-script { height:188px; }
  .creation-page .creation-settings { grid-template-columns:minmax(0,1fr);gap:14px; }
  .creation-page .cs-swatches { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(max-width:370px) {
  .pricing-tier__header { grid-template-columns:minmax(0,1fr); }
  .creation-page .cs-swatches { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

.tpl-card-entry { display:flex; flex:1; flex-direction:column; min-width:0; color:var(--ink); }
.tpl-card-entry .tpl-actions { display:block; }
.tpl-card-entry .tpl-actions .btn { width:100%; justify-content:space-between; }

/* Tutorials */
.tutorial-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px; }
.tutorial-entry { display:flex;flex-direction:column;align-items:flex-start;gap:12px; }
.tutorial-entry h2 { font-size:21px;line-height:1.4;margin:0;overflow-wrap:anywhere; }
.tutorial-entry p { color:var(--muted);font-size:13px;margin:0; }
.tutorial-entry .btn { margin-top:auto;gap:10px; }
.tutorial-entry time,.tutorial-document time { color:var(--muted);font-variant-numeric:tabular-nums;font-size:13px; }
.tutorial-document { max-width:870px; }
.tutorial-document__head { padding-bottom:16px;border-bottom:1px solid var(--line); }
.tutorial-document__head h1 { margin:8px 0 0;line-height:1.25;font-size:clamp(27px,4.5vw,52px);overflow-wrap:anywhere; }
.tutorial-document__body { white-space:pre-wrap;overflow-wrap:anywhere;font-size:16px;line-height:1.85;margin-top:20px; }
.tutorial-lock { display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:15px;border-radius:11px;background:var(--accent-soft);margin-top:16px; }
.tutorial-lock strong { flex:1 1 210px; }
.tutorial-pager { display:flex;justify-content:center;align-items:center;gap:12px;margin-top:22px; }
@media(max-width:980px){.tutorial-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:720px){
  .mobile-rail { grid-template-columns:repeat(5,minmax(0,1fr)); }
  .tutorial-grid { grid-template-columns:minmax(0,1fr); }
}

/* Tutorial editor and rendered article */
.tutorial-editor { margin-bottom:12px; }
.tutorial-editor__toolbar { display:flex;flex-wrap:wrap;gap:6px;padding:9px;background:#eff2e9;border:1px solid var(--line-strong);border-radius:11px 11px 0 0; }
.tutorial-editor__toolbar .btn { background:#fffdf8;min-height:44px;border-color:var(--line);padding:6px 10px; }
.tutorial-editor__toolbar .btn:hover { background:#e2ebdd; }
.tutorial-editor__surface { min-height:290px;max-width:100%;padding:15px;background:#fffdf8;border:1px solid var(--line-strong);border-top:none;border-radius:0 0 11px 11px;overflow-wrap:anywhere;line-height:1.7; }
.tutorial-editor__surface:focus { outline:2px solid #54775d;outline-offset:-2px; }
.tutorial-editor__url { padding:12px;border-inline:1px solid var(--line-strong);background:#fbf1e3; }
.tutorial-editor__url label,.tutorial-editor__url .form-control { display:block;margin-bottom:7px; }
.tutorial-editor__url p:empty { display:none; }
.tutorial-document__body--rich { white-space:normal; }
.tutorial-editor__surface p,.tutorial-document__body--rich p { margin:.6em 0; }
.tutorial-editor__surface h2,.tutorial-document__body--rich h2 { font-size:1.5em;margin:1em 0 .4em; }
.tutorial-editor__surface h3,.tutorial-document__body--rich h3 { font-size:1.2em;margin:.85em 0 .4em; }
.tutorial-editor__surface img,.tutorial-document__body--rich img { display:block;max-width:100%;height:auto;border-radius:9px;margin:.7em 0; }
.tutorial-editor__surface a,.tutorial-document__body--rich a { color:#285f48;text-decoration:underline;text-underline-offset:2px; }
.tutorial-editor__surface blockquote,.tutorial-document__body--rich blockquote { margin:1em 0;padding:8px 14px;border-left:3px solid #7a9880;background:#edf2e9; }
.tutorial-editor__surface pre,.tutorial-document__body--rich pre { padding:12px;background:#eef0e9;border-radius:8px;overflow:auto; }
.tutorial-editor__surface ul,.tutorial-editor__surface ol,.tutorial-document__body--rich ul,.tutorial-document__body--rich ol { padding-left:1.5em; }
@media(max-width:720px) { .tutorial-editor__surface { min-height:245px;font-size:16px; } }

a.tpl-body--link{display:flex;flex:1;flex-direction:column;gap:8px;color:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent;}
a.tpl-body--link .tpl-make-btn{pointer-events:none;}
@media(max-width:720px){
  a.tpl-body--link{padding:12px 12px 14px;}
  .tpl-cover{aspect-ratio:16/10;}
  .tpl-play{width:48px;height:48px;margin:-24px 0 0 -24px;}
}



/* === new tpl card === */
.tpl-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
}
.tpl-card{
  display:flex;
  flex-direction:column;
  min-width:0;
  height:auto !important;
  background:var(--surface,#fff);
  border:1px solid var(--line,#e8e4dc);
  border-radius:18px;
  overflow:hidden;
  box-shadow:0 8px 24px rgba(40,50,40,.06);
}
.tpl-media{
  position:relative;
  aspect-ratio:16/10;
  background:#1a1f1c;
  overflow:hidden;
  cursor:default;
}
.tpl-media.is-video{cursor:pointer;}
.tpl-media__video,
.tpl-media__img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
.tpl-media__ph{
  width:100%;height:100%;
  display:grid;place-items:center;
  background:linear-gradient(145deg,#e7ebe4,#d5ddd4);
  color:#2f4a3a;
  font-weight:800;
  font-size:22px;
}
.tpl-media__play{
  position:absolute;left:50%;top:50%;
  width:48px;height:48px;
  margin:-24px 0 0 -24px;
  border-radius:50%;
  background:rgba(255,255,255,.94);
  box-shadow:0 8px 22px rgba(0,0,0,.22);
  z-index:2;
}
.tpl-media__play::before{
  content:"";
  position:absolute;left:50%;top:50%;
  width:0;height:0;
  margin:-7px 0 0 -4px;
  border-style:solid;
  border-width:7px 0 7px 12px;
  border-color:transparent transparent transparent #173528;
}
.tpl-media.is-video:hover .tpl-media__play,
.tpl-media.is-video:focus-visible .tpl-media__play{
  transform:scale(1.06);
}
.tpl-media__tags{
  position:absolute;left:10px;top:10px;z-index:2;
  display:flex;gap:6px;
}

.tpl-info{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:12px 12px 12px;
  color:inherit;
  text-decoration:none;
  -webkit-tap-highlight-color:transparent;
}
.tpl-info__top{display:grid;gap:4px;min-width:0;}
.tpl-info__title{
  margin:0;
  font-size:16px;
  font-weight:700;
  line-height:1.3;
  letter-spacing:-.02em;
  color:var(--ink,#173528);
}
.tpl-info__desc{
  margin:0;
  font-size:12px;
  line-height:1.45;
  color:var(--muted,#6b746c);
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
}
.tpl-info__foot{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  font-size:12px;
  color:var(--muted,#6b746c);
}
.tpl-info__cta{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:42px;
  border-radius:12px;
  background:var(--accent,#355f48);
  color:#fff;
  font-size:14px;
  font-weight:700;
}
.tpl-info:hover .tpl-info__cta,
.tpl-info:focus-visible .tpl-info__cta{
  filter:brightness(1.05);
}

@media (max-width:980px){
  .tpl-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
}
@media (max-width:720px){
  .tpl-grid{grid-template-columns:1fr 1fr;gap:10px;}
  .tpl-card{border-radius:14px;}
  .tpl-media{aspect-ratio:4/3;}
  .tpl-media__play{width:40px;height:40px;margin:-20px 0 0 -20px;}
  .tpl-media__play::before{margin:-6px 0 0 -3px;border-width:6px 0 6px 10px;}
  .tpl-info{padding:10px;gap:8px;}
  .tpl-info__title{font-size:14px;}
  .tpl-info__desc{font-size:11px;-webkit-line-clamp:2;}
  .tpl-info__foot{font-size:11px;}
  .tpl-info__cta{min-height:38px;font-size:13px;border-radius:10px;}
}
@media (max-width:380px){
  .tpl-grid{grid-template-columns:1fr;}
}
/* === end new tpl card */


/* site logo image */
.logo-img{
  display:block;
  height:36px;
  width:auto;
  max-width:160px;
  object-fit:contain;
}
@media (max-width:720px){
  .logo-img{height:30px;max-width:130px;}
}
.admin-ui .logo-img{height:32px;max-width:140px;}

/* Fixed toasts — do not push page layout */
.toast-host {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(520px, calc(100vw - 28px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 560;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.14);
  border: 1px solid transparent;
  backdrop-filter: blur(10px);
  animation: toast-in .28s ease both;
}
.toast.is-leaving {
  animation: toast-out .22s ease both;
}
.toast-success {
  background: rgba(232, 248, 239, 0.96);
  color: #147a45;
  border-color: rgba(20, 122, 69, 0.18);
}
.toast-error {
  background: rgba(255, 236, 236, 0.97);
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.16);
}
.toast-info {
  background: rgba(245, 245, 247, 0.97);
  color: #344054;
  border-color: rgba(16, 24, 40, 0.08);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(.98); }
}
