// Template detail page — ATELIER (paper engineering)

const AT_DET = {
  paperCream: '#efe5d2',
  paperRecipe: '#f7efe1',
  blueprint: '#1a3d5c',
  ink: '#1b1916',
  inkDim: 'rgba(27,25,22,0.55)',
  oxblood: '#8a1a1a',
  gold: '#f5e6c8',
  accent: '#8a4a3e',
  hand: 'Caveat, cursive',
  tw: 'Special Elite, IBM Plex Mono, monospace',
  display: 'DM Serif Display, IBM Plex Serif, serif',
};
const D = AT_DET;

// ── component previews ──────────────────────────────────────
function ATC01_Shell() {
  return (
    <div style={{ position: 'absolute', inset: 0, padding: 10, background: D.paperRecipe, backgroundImage: 'linear-gradient(to bottom, transparent 21px, #d4b8a0 21px, #d4b8a0 22px, transparent 22px)', backgroundSize: '100% 22px' }}>
      <div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
        {['events','file','workflow','audit'].map((t, i) => (
          <span key={t} style={{
            padding: '4px 10px', borderTop: '1px solid #8a6f44', borderLeft: '1px solid #8a6f44', borderRight: '1px solid #8a6f44',
            background: i === 0 ? '#fbf3e1' : 'rgba(0,0,0,0.04)',
            fontFamily: D.tw, fontSize: 9.5, letterSpacing: '0.1em', textTransform: 'uppercase',
          }}>{t}</span>
        ))}
        <span style={{ flex: 1 }} />
        <span style={{ fontFamily: D.tw, fontSize: 9.5, color: D.inkDim }}>· acting as M. STERLING</span>
      </div>
      <div style={{ marginTop: 14 }}>
        <div style={{ fontFamily: D.tw, fontSize: 9, letterSpacing: '0.12em', color: D.inkDim, textTransform: 'uppercase' }}>DOC G702 · APP 07</div>
        <div style={{ fontFamily: D.display, fontSize: 24, lineHeight: 1, marginTop: 4 }}>Riverline Plaza</div>
      </div>
      <span style={{ position: 'absolute', top: 36, right: 12, fontFamily: D.tw, fontSize: 9, fontWeight: 700, border: '2px solid ' + D.oxblood, color: D.oxblood, padding: '3px 7px', transform: 'rotate(-4deg)', letterSpacing: '0.1em' }}>UNDER REVIEW</span>
      <div style={{ position: 'absolute', bottom: 10, left: 12, fontFamily: D.tw, fontSize: 8, color: D.inkDim, letterSpacing: '0.06em' }}>// folder tabs · masthead · stamp · margin</div>
    </div>
  );
}
function ATC02_Signin() {
  return (
    <div style={{ position: 'absolute', inset: 0, display: 'flex', alignItems: 'center', justifyContent: 'center', background: D.paperCream }}>
      <div style={{ width: 220, padding: 18, background: '#fbf7eb', border: '1px solid #d8d4c8', boxShadow: '2px 4px 0 rgba(0,0,0,0.05), 4px 8px 14px rgba(0,0,0,0.08)' }}>
        <div style={{ fontFamily: D.tw, fontSize: 9, letterSpacing: '0.14em', color: D.inkDim, textAlign: 'center' }}>BY APPOINTMENT</div>
        <div style={{ fontFamily: D.display, fontSize: 18, textAlign: 'center', marginTop: 6, lineHeight: 1.1 }}>Sign in to DrawRequest</div>
        <div style={{ fontFamily: D.hand, fontSize: 14, color: D.accent, textAlign: 'center', marginTop: 2 }}>magic link · no password</div>
        <div style={{ marginTop: 12, padding: '6px 10px', borderBottom: '1px solid ' + D.ink, fontFamily: D.tw, fontSize: 10, color: D.inkDim }}>marcus@cornerstone.cap</div>
        <div style={{ marginTop: 10, padding: '7px 10px', background: D.ink, color: D.gold, textAlign: 'center', fontFamily: D.tw, fontSize: 10.5, letterSpacing: '0.1em' }}>SEND ME A LINK →</div>
      </div>
    </div>
  );
}
function ATC03_Actors() {
  return (
    <div style={{ position: 'absolute', inset: 0, padding: 12, background: D.paperCream }}>
      <div style={{ fontFamily: D.tw, fontSize: 9, letterSpacing: '0.12em', color: D.inkDim, textTransform: 'uppercase' }}>// CAST · 8 ACTORS · ACTING AS · M. STERLING</div>
      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 6, marginTop: 6 }}>
        {TPL_SAMPLE.actors.map((a, i) => (
          <div key={i} style={{ padding: 6, background: i === 0 ? '#fbf3e1' : '#fbf7eb', border: '1px solid #d8c9a8', position: 'relative', boxShadow: i === 0 ? '2px 3px 0 rgba(138,26,26,0.15)' : 'none' }}>
            <div style={{ width: 26, height: 26, borderRadius: '50%', background: a[3], color: 'white', display: 'flex', alignItems: 'center', justifyContent: 'center', font: '700 9px ' + D.tw, margin: '0 auto' }}>{a[0]}</div>
            <div style={{ fontFamily: D.display, fontSize: 10.5, textAlign: 'center', marginTop: 4 }}>{a[1].split(' ')[1]}</div>
            <div style={{ fontFamily: D.tw, fontSize: 8, color: D.inkDim, textAlign: 'center', letterSpacing: '0.04em' }}>{a[2]}</div>
            {i === 0 && <div style={{ position: 'absolute', top: -4, right: -4, fontFamily: D.tw, fontSize: 8, fontWeight: 700, border: '1.5px solid ' + D.oxblood, color: D.oxblood, padding: '1px 4px', transform: 'rotate(-6deg)', background: D.paperCream }}>YOU</div>}
          </div>
        ))}
      </div>
    </div>
  );
}
function ATC04_Home() {
  return (
    <div style={{ position: 'absolute', inset: 0, background: D.paperRecipe, backgroundImage: 'linear-gradient(to bottom, transparent 21px, #d4b8a0 21px, #d4b8a0 22px, transparent 22px)', backgroundSize: '100% 22px', padding: '12px 16px' }}>
      <div style={{ fontFamily: D.tw, fontSize: 9, letterSpacing: '0.12em', color: D.inkDim, textTransform: 'uppercase' }}>FRIDAY · MAY 15 · LATE AFTERNOON</div>
      <div style={{ fontFamily: D.display, fontSize: 22, marginTop: 4, lineHeight: 1 }}>Good afternoon, <span style={{ fontStyle: 'italic' }}>Marcus.</span></div>
      <div style={{ fontFamily: D.hand, fontSize: 18, color: D.accent, marginTop: 4 }}>five things await your eye →</div>
      <div style={{ display: 'flex', gap: 12, marginTop: 12, paddingTop: 8, borderTop: '1px solid ' + D.ink }}>
        {[['EXPOSURE','$62.6M'],['RELEASED','$127.8K'],['FLAGS','1']].map(([l,v], i) => (
          <div key={i} style={{ flex: 1 }}>
            <div style={{ fontFamily: D.tw, fontSize: 8, letterSpacing: '0.1em', color: D.inkDim }}>{l}</div>
            <div style={{ fontFamily: D.tw, fontSize: 18, marginTop: 2, color: i === 2 ? D.oxblood : D.ink, fontWeight: i === 2 ? 700 : 400 }}>{v}</div>
          </div>
        ))}
      </div>
      <div style={{ position: 'absolute', bottom: 12, right: 16, fontFamily: D.hand, fontSize: 16, color: D.oxblood, transform: 'rotate(-3deg)' }}>1 of 1</div>
    </div>
  );
}
function ATC05_List() {
  return (
    <div style={{ position: 'absolute', inset: 0, padding: 10, background: D.paperRecipe, backgroundImage: 'linear-gradient(to bottom, transparent 21px, #d4b8a0 21px, #d4b8a0 22px, transparent 22px)', backgroundSize: '100% 22px' }}>
      <div style={{ fontFamily: D.tw, fontSize: 9, letterSpacing: '0.12em', color: D.inkDim, textTransform: 'uppercase' }}>// INDEX · 08 DRAWS IN FLIGHT</div>
      <div style={{ marginTop: 4 }}>
        {TPL_SAMPLE.draws.map((d, i) => (
          <div key={i} style={{ display: 'grid', gridTemplateColumns: '70px 1fr 60px 80px', gap: 6, padding: '2px 0', alignItems: 'baseline' }}>
            <span style={{ fontFamily: D.tw, fontSize: 10, color: D.inkDim }}>{d[0]}</span>
            <span style={{ fontFamily: D.display, fontSize: 12 }}>{d[1]}</span>
            <span style={{ fontFamily: D.tw, fontSize: 10, textAlign: 'right' }}>{d[2]}</span>
            <span style={{ fontFamily: D.tw, fontSize: 9, fontStyle: 'italic', color: d[3] === 'correction' ? D.oxblood : D.inkDim, textAlign: 'right' }}>{d[3]}</span>
          </div>
        ))}
      </div>
      <div style={{ position: 'absolute', top: 8, right: 10, fontFamily: D.tw, fontSize: 8, fontWeight: 700, border: '1.5px solid #2c5f3a', color: '#2c5f3a', padding: '2px 6px', transform: 'rotate(3deg)', letterSpacing: '0.1em' }}>FILED</div>
    </div>
  );
}
function ATC06_Detail() {
  return (
    <div style={{ position: 'absolute', inset: 0, padding: 12, background: D.blueprint, backgroundImage: 'linear-gradient(to right, rgba(255,255,255,0.08) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,0.08) 1px, transparent 1px)', backgroundSize: '16px 16px', color: '#e6efe6' }}>
      <div style={{ fontFamily: D.tw, fontSize: 9, letterSpacing: '0.12em', color: 'rgba(230,239,230,0.65)' }}>DOC G702 · DRAW-2031</div>
      <div style={{ fontFamily: D.display, fontSize: 22, color: D.gold, marginTop: 4, lineHeight: 1 }}>Riverline Plaza</div>
      <div style={{ fontFamily: D.tw, fontSize: 22, color: D.gold, marginTop: 6 }}>$142,000</div>
      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(2,1fr)', gap: 6, marginTop: 8, borderTop: '1px solid rgba(255,255,255,0.3)', paddingTop: 6 }}>
        {[['CONTRACT','$ 2,377,000'],['EARNED','$ 1,585,521'],['NET','$ 127,800'],['WAIVERS','5 of 5']].map(([l,v], i) => (
          <div key={i}><div style={{ fontFamily: D.tw, fontSize: 8, color: 'rgba(230,239,230,0.55)' }}>{l}</div><div style={{ fontFamily: D.tw, fontSize: 11, color: D.gold }}>{v}</div></div>
        ))}
      </div>
      <div style={{ position: 'absolute', bottom: 8, right: 10, fontFamily: D.hand, fontSize: 17, color: D.gold }}>Diego O.</div>
    </div>
  );
}
function ATC07_Form() {
  return (
    <div style={{ position: 'absolute', inset: 0, padding: 12, background: D.paperRecipe, backgroundImage: 'linear-gradient(to bottom, transparent 21px, #d4b8a0 21px, #d4b8a0 22px, transparent 22px)', backgroundSize: '100% 22px' }}>
      <div style={{ fontFamily: D.tw, fontSize: 9, letterSpacing: '0.12em', color: D.inkDim }}>// SUBMIT DRAW · 03 / 05 · SCHEDULE OF VALUES</div>
      <div style={{ marginTop: 12, display: 'grid', gridTemplateColumns: '24px 1fr 80px', gap: 4 }}>
        {[['03','Concrete','$ 18,400'],['04','Masonry','$ 22,800'],['05','Structural steel','$ 31,200'],['06','Drywall · L3','$ 18,400']].map((r, i) => (
          <React.Fragment key={i}>
            <span style={{ fontFamily: D.tw, fontSize: 10, color: D.inkDim }}>{r[0]}</span>
            <span style={{ fontFamily: D.hand, fontSize: 16, color: D.ink, borderBottom: '1px solid ' + D.ink, lineHeight: 1 }}>{r[1]}</span>
            <span style={{ fontFamily: D.tw, fontSize: 11, textAlign: 'right' }}>{r[2]}</span>
          </React.Fragment>
        ))}
      </div>
      <div style={{ position: 'absolute', bottom: 8, left: 12, fontFamily: D.tw, fontSize: 9, color: D.inkDim }}>← back</div>
      <div style={{ position: 'absolute', bottom: 8, right: 12, padding: '4px 10px', background: D.ink, color: D.gold, fontFamily: D.tw, fontSize: 10, letterSpacing: '0.06em' }}>NEXT · WAIVERS →</div>
    </div>
  );
}
function ATC08_Workflow() {
  return (
    <div style={{ position: 'absolute', inset: 0, padding: 12, background: D.paperCream }}>
      <div style={{ fontFamily: D.tw, fontSize: 9, letterSpacing: '0.12em', color: D.inkDim }}>// SIGNATURES · 3 OF 5</div>
      <div style={{ marginTop: 10, display: 'flex', flexDirection: 'column', gap: 10 }}>
        {[
          ['CONTRACTOR · D. ORTEGA',  'Diego Ortega',  '2026·05·12', true],
          ['INSPECTOR · H. MENDEZ',   'Hank Mendez',   '2026·05·12', true],
          ['LENDER · A. PATEL',       'Aisha Patel',   '2026·05·13', true],
          ['OWNER · S. KIM',          '',              'pending',    false],
        ].map(([role, sig, date, done], i) => (
          <div key={i}>
            <div style={{ borderTop: '1px solid ' + D.ink, paddingTop: 2, fontFamily: D.hand, fontSize: 19, color: done ? D.blueprint : 'transparent', lineHeight: 1, minHeight: 19 }}>{sig || 'awaiting'}</div>
            <div style={{ display: 'flex', justifyContent: 'space-between', fontFamily: D.tw, fontSize: 8, color: D.inkDim, letterSpacing: '0.05em' }}>
              <span>{role}</span><span style={{ color: done ? '#2c5f3a' : D.oxblood }}>{date}</span>
            </div>
          </div>
        ))}
      </div>
    </div>
  );
}
function ATC09_Audit() {
  return (
    <div style={{ position: 'absolute', inset: 0, padding: 12, background: D.paperRecipe, backgroundImage: 'linear-gradient(to bottom, transparent 21px, #d4b8a0 21px, #d4b8a0 22px, transparent 22px)', backgroundSize: '100% 22px' }}>
      <div style={{ fontFamily: D.tw, fontSize: 9, letterSpacing: '0.12em', color: D.inkDim }}>// LEDGER · LAST 5 ENTRIES</div>
      <div style={{ marginTop: 4 }}>
        {TPL_SAMPLE.audit.map((a, i) => (
          <div key={i} style={{ display: 'grid', gridTemplateColumns: '40px 1fr', gap: 8, alignItems: 'baseline' }}>
            <span style={{ fontFamily: D.tw, fontSize: 10, color: D.inkDim }}>{a[0]}</span>
            <div>
              <span style={{ fontFamily: D.display, fontSize: 12, fontStyle: 'italic', color: a[3] ? D.oxblood : D.ink }}>{a[1]}</span>
              <span style={{ fontFamily: D.hand, fontSize: 14, color: D.accent, marginLeft: 6 }}>{a[2]}</span>
            </div>
          </div>
        ))}
      </div>
    </div>
  );
}
function ATC10_Output() {
  return (
    <div style={{ position: 'absolute', inset: 0, padding: 12, background: D.paperCream }}>
      <div style={{ fontFamily: D.tw, fontSize: 9, letterSpacing: '0.12em', color: D.inkDim, marginBottom: 4 }}>// PACKET · READY · 4 PAGES</div>
      <div style={{
        height: 152, background: D.blueprint,
        backgroundImage: 'linear-gradient(to right, rgba(255,255,255,0.08) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,0.08) 1px, transparent 1px)',
        backgroundSize: '12px 12px',
        padding: 10, position: 'relative', color: '#e6efe6',
        boxShadow: '0 12px 24px rgba(0,0,0,0.18)',
      }}>
        <div style={{ fontFamily: D.tw, fontSize: 7, color: 'rgba(230,239,230,0.6)', letterSpacing: '0.1em' }}>G702 · APPLICATION 07</div>
        <div style={{ fontFamily: D.display, fontSize: 14, color: D.gold, marginTop: 2 }}>Riverline Plaza</div>
        <div style={{ fontFamily: D.tw, fontSize: 18, color: D.gold, marginTop: 8 }}>$142,000</div>
        <div style={{ marginTop: 6, display: 'flex', flexDirection: 'column', gap: 2 }}>
          {[100, 92, 78, 85].map((p, i) => (
            <div key={i} style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
              <span style={{ fontFamily: D.tw, fontSize: 7, color: 'rgba(230,239,230,0.55)', width: 12 }}>0{i+1}</span>
              <div style={{ flex: 1, height: 3, background: 'rgba(255,255,255,0.15)' }}><div style={{ height: '100%', width: p + '%', background: D.gold }} /></div>
              <span style={{ fontFamily: D.tw, fontSize: 7, color: D.gold, width: 20, textAlign: 'right' }}>{p}%</span>
            </div>
          ))}
        </div>
        <div style={{ position: 'absolute', top: 8, right: 10, fontFamily: D.tw, fontSize: 7, fontWeight: 700, color: D.oxblood, border: '1.5px solid ' + D.oxblood, padding: '2px 4px', transform: 'rotate(-4deg)' }}>READY</div>
      </div>
    </div>
  );
}
function ATC11_Settings() {
  const roles = ['Admin','Loan','GC','Sub','Insp','Owner'];
  return (
    <div style={{ position: 'absolute', inset: 0, padding: 10, background: D.paperRecipe }}>
      <div style={{ fontFamily: D.tw, fontSize: 9, letterSpacing: '0.12em', color: D.inkDim }}>// AUTHORIZATIONS · STAMP MATRIX</div>
      <div style={{ marginTop: 6, padding: 8, background: '#fbf7eb', border: '1px solid #d8c9a8' }}>
        {['read','submit','approve','release'].map((p, j) => (
          <div key={j} style={{ display: 'grid', gridTemplateColumns: '70px repeat(6, 1fr)', gap: 4, padding: '3px 0', alignItems: 'center' }}>
            <span style={{ fontFamily: D.tw, fontSize: 9, color: D.inkDim, letterSpacing: '0.06em', textTransform: 'uppercase' }}>{p}</span>
            {roles.map((r, i) => {
              const granted = (j === 0) || (i === 0) || (i < 3 && j < 3) || (i === 5 && j === 3);
              return <span key={r} style={{
                fontFamily: D.tw, fontSize: 9, textAlign: 'center',
                color: granted ? D.oxblood : '#c8c3b5', fontWeight: granted ? 700 : 400,
              }}>{granted ? '✓' : '·'}</span>;
            })}
          </div>
        ))}
      </div>
    </div>
  );
}
function ATC12_Empty() {
  return (
    <div style={{ position: 'absolute', inset: 0, background: D.paperCream, padding: 14, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', textAlign: 'center' }}>
      <div style={{ width: 130, height: 100, background: '#fbf7eb', border: '1px dashed #c8c3b5', boxShadow: '2px 4px 0 rgba(0,0,0,0.04)' }} />
      <div style={{ fontFamily: D.display, fontSize: 17, marginTop: 14, letterSpacing: '-0.005em' }}>The desk is clear.</div>
      <div style={{ fontFamily: D.hand, fontSize: 18, color: D.accent, marginTop: 4 }}>Start with a draw → invite your GC</div>
      <span style={{ marginTop: 10, padding: '5px 14px', background: D.ink, color: D.gold, fontFamily: D.tw, fontSize: 10, letterSpacing: '0.08em' }}>+ INVITE GC</span>
    </div>
  );
}

// === detail page ===
function TemplateDetailAtelier() {
  return (
    <div style={{ height: '100%', display: 'flex', flexDirection: 'column', background: '#f6f4ef', overflow: 'auto', fontFamily: 'IBM Plex Sans, system-ui', color: '#1a1814' }}>
      <TplNav />
      <TplBreadcrumb tplId="atelier" />

      {/* HERO */}
      <div style={{ display: 'grid', gridTemplateColumns: '1fr 1.1fr', borderBottom: '1px solid #d8d4c8' }}>
        <div style={{ padding: '20px 36px 32px', borderRight: '1px solid #d8d4c8' }}>
          <div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
            <span style={{ fontFamily: 'IBM Plex Mono', fontSize: 11, letterSpacing: '0.16em', textTransform: 'uppercase', color: '#6b6557' }}>// 02 of 06 · template</span>
            <span style={{ padding: '2px 8px', borderRadius: 99, background: '#fbfaf7', border: '1px solid #d8d4c8', fontFamily: 'IBM Plex Mono', fontSize: 10, color: D.accent, display: 'inline-flex', alignItems: 'center', gap: 5 }}><span style={{ width: 6, height: 6, borderRadius: '50%', background: D.accent }} /> differentiator</span>
          </div>
          <h1 style={{ font: '500 64px ' + D.display, letterSpacing: '-0.025em', lineHeight: 1, marginTop: 12 }}>Atelier.</h1>
          <div style={{ font: '400 22px "IBM Plex Serif", serif', fontStyle: 'italic', color: '#6b6557', marginTop: 6, lineHeight: 1.2 }}>The artifact is the screen. The app retreats to the margin.</div>
          <p style={{ marginTop: 16, fontSize: 14.5, lineHeight: 1.55, color: '#3a362d', maxWidth: 540 }}>
            Atelier renders the marquee document — the G702 packet, the BEO, the policy, the grant award letter — at full page scale, on real paper stock. Each vertical gets its own paper: blueprint cyan for construction, ruled cream for restaurants, linen for weddings, manila for compliance.
            The app shrinks to <b>folder tabs across the top</b>, <b>handwritten margin notes</b>, <b>stamps</b>, and <b>sticky-note actions</b>. The customer is reading their business, not their software.
          </p>
          <TplBestForPills items={['VenueFlow', 'PolicyDesk', 'GrantCycle', 'AuditField (alt)', 'CampaignGate (alt)']} />
        </div>
        <div style={{ padding: '18px', display: 'flex', alignItems: 'center', justifyContent: 'center', background: '#f0eee9' }}>
          <div style={{ width: '100%', height: 380, borderRadius: 10, overflow: 'hidden', boxShadow: '0 16px 44px rgba(28,24,16,0.20)', background: D.blueprint, backgroundImage: 'linear-gradient(to right, rgba(255,255,255,0.08) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,0.08) 1px, transparent 1px)', backgroundSize: '20px 20px', position: 'relative', padding: '22px 26px', color: '#e6efe6' }}>
            <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end', borderBottom: '1px solid rgba(255,255,255,0.5)', paddingBottom: 10 }}>
              <div>
                <div style={{ fontFamily: D.tw, fontSize: 9, letterSpacing: '0.14em', color: 'rgba(230,239,230,0.7)' }}>DOC G702 · APPLICATION & CERTIFICATE FOR PAYMENT</div>
                <div style={{ fontFamily: D.display, fontSize: 32, color: D.gold, marginTop: 6, lineHeight: 1 }}>Riverline Plaza</div>
                <div style={{ fontFamily: D.tw, fontSize: 9, color: 'rgba(230,239,230,0.7)', marginTop: 2 }}>CORNERSTONE CAPITAL · APP NO. 07 · 2026·05·31</div>
              </div>
              <div style={{ textAlign: 'right' }}>
                <div style={{ fontFamily: D.tw, fontSize: 9, letterSpacing: '0.12em', color: 'rgba(230,239,230,0.7)' }}>THIS PERIOD</div>
                <div style={{ fontFamily: D.display, fontSize: 38, color: D.gold, lineHeight: 1 }}>$142,000</div>
                <div style={{ fontFamily: D.tw, fontSize: 8, color: 'rgba(230,239,230,0.6)', marginTop: 2 }}>NET RETAINAGE $14,200</div>
              </div>
            </div>
            <div style={{ marginTop: 16, fontFamily: D.tw, fontSize: 9, color: 'rgba(230,239,230,0.65)' }}>G703 · SCHEDULE OF VALUES · 12 LINES</div>
            <div style={{ marginTop: 6, display: 'flex', flexDirection: 'column', gap: 3 }}>
              {[['03','Concrete','410,000','92'],['05','Structural steel','540,000','85'],['06','Drywall · L3','92,000','82'],['07','MEP rough','380,000','64'],['09','Glazing','145,000','55']].map(r => (
                <div key={r[0]} style={{ display: 'grid', gridTemplateColumns: '24px 1fr 80px 30px 70px', gap: 4, fontFamily: D.tw, fontSize: 10.5, color: '#e6efe6', borderBottom: '1px solid rgba(255,255,255,0.1)', paddingBottom: 2 }}>
                  <span style={{ color: 'rgba(230,239,230,0.5)' }}>{r[0]}</span>
                  <span style={{ fontFamily: D.display }}>{r[1]}</span>
                  <span style={{ textAlign: 'right' }}>{r[2]}</span>
                  <span style={{ textAlign: 'right' }}>{r[3]}</span>
                  <div style={{ display: 'flex', alignItems: 'center' }}><div style={{ width: '100%', height: 3, background: 'rgba(255,255,255,0.15)' }}><div style={{ height: '100%', width: r[3] + '%', background: D.gold }} /></div></div>
                </div>
              ))}
            </div>
            <div style={{ position: 'absolute', top: 20, right: 22, fontFamily: D.tw, fontSize: 11, fontWeight: 700, border: '3px solid #ffb0a8', color: '#ffb0a8', padding: '4px 10px', transform: 'rotate(-6deg)', letterSpacing: '0.14em', opacity: 0.85 }}>UNDER REVIEW</div>
            <div style={{ position: 'absolute', bottom: 14, left: 26, fontFamily: D.hand, fontSize: 26, color: D.gold }}>Diego Ortega</div>
            <div style={{ position: 'absolute', bottom: 14, right: 26, fontFamily: D.tw, fontSize: 8, color: 'rgba(230,239,230,0.55)' }}>SHEET 1 / 4</div>
          </div>
        </div>
      </div>

      <TplWhy title="The document is the proof — so make it the screen." reasons={[
        ['You sell paperwork that matters.',         'Every uStack app generates something a real human signs, files, or hands to a regulator. Atelier promotes that artifact to first-class status.'],
        ['Different paper per vertical.',            'Five paper stocks ship: blueprint, ledger, ruled recipe, linen, chalkboard. Each comes with its own type pairing and stamp set.'],
        ['Margin chrome stays out of the way.',      'Tabs across the top, sticky notes on the side, handwritten cues — never a sidebar competing with the document.'],
      ]} />

      <TplInProduction items={[
        { name: 'VenueFlow',   industry: 'Event venues',    url: 'venueflow.ustack.ai',   actors: 7, signature: 'Banquet event order on linen · run-of-show timeline · signatures', accent: D.accent,
          preview: (
            <div style={{ position: 'absolute', inset: 0, background: '#f9f3ea', backgroundImage: 'repeating-linear-gradient(0deg, transparent 0 3px, rgba(180,140,100,0.04) 3px 4px), repeating-linear-gradient(90deg, transparent 0 3px, rgba(180,140,100,0.04) 3px 4px)', padding: 14, textAlign: 'center' }}>
              <div style={{ fontFamily: D.tw, fontSize: 8, letterSpacing: '0.16em', color: 'rgba(27,25,22,0.5)' }}>BANQUET · EVENT · ORDER</div>
              <div style={{ fontFamily: D.display, fontSize: 22, marginTop: 4, lineHeight: 1 }}>Whitfield &amp; Choi</div>
              <div style={{ fontFamily: D.hand, fontSize: 17, color: D.accent, marginTop: 2 }}>Saturday, June twenty-second</div>
              <div style={{ fontFamily: D.tw, fontSize: 7.5, color: 'rgba(27,25,22,0.55)', marginTop: 4, letterSpacing: '0.1em' }}>THE ALDER BARN · 187 GUESTS</div>
              <div style={{ marginTop: 10, display: 'flex', justifyContent: 'space-around', fontFamily: D.tw, fontSize: 7.5 }}>
                {[['5:00','CEREMONY'],['7:00','DINNER'],['9:00','DANCING']].map(([t, l], i) => (
                  <div key={i}><div style={{ fontWeight: 700 }}>{t}</div><div style={{ color: 'rgba(27,25,22,0.55)' }}>{l}</div></div>
                ))}
              </div>
            </div>
          ) },
        { name: 'PolicyDesk',  industry: 'Policy + attestation', url: 'policydesk.ustack.ai',  actors: 7, signature: 'Policy as a document · multi-stage review · employee attestation', accent: D.accent,
          preview: (
            <div style={{ position: 'absolute', inset: 0, background: D.paperRecipe, backgroundImage: 'linear-gradient(to bottom, transparent 18px, #d4b8a0 18px, #d4b8a0 19px, transparent 19px)', backgroundSize: '100% 19px', padding: 12 }}>
              <div style={{ fontFamily: D.tw, fontSize: 8, letterSpacing: '0.12em', color: D.inkDim }}>HR-2026-014 · ACCEPTABLE USE POLICY</div>
              <div style={{ fontFamily: D.display, fontSize: 18, marginTop: 4, lineHeight: 1.1 }}>Acceptable Use</div>
              <div style={{ fontFamily: D.hand, fontSize: 13, color: D.accent, marginTop: 2 }}>v3 · effective Aug 1</div>
              <div style={{ marginTop: 8, fontFamily: D.tw, fontSize: 9, color: D.ink, lineHeight: 1.55 }}>1. Scope · all employees and contractors<br/>2. Substantive changes require re-attestation<br/>3. Reviewed annually or upon material change</div>
              <div style={{ position: 'absolute', bottom: 10, right: 12, fontFamily: D.tw, fontSize: 8, fontWeight: 700, border: '1.5px solid #2c5f3a', color: '#2c5f3a', padding: '2px 5px', transform: 'rotate(-3deg)' }}>APPROVED</div>
            </div>
          ) },
        { name: 'GrantCycle',  industry: 'Grant lifecycle',  url: 'grantcycle.ustack.ai',  actors: 7, signature: 'LOI · application · award letter · grantee reporting', accent: D.accent,
          preview: (
            <div style={{ position: 'absolute', inset: 0, background: D.paperCream, padding: 12, textAlign: 'center' }}>
              <div style={{ fontFamily: D.tw, fontSize: 7.5, letterSpacing: '0.16em', color: D.inkDim }}>THE HALLOWELL FOUNDATION</div>
              <div style={{ fontFamily: D.display, fontSize: 16, marginTop: 6, lineHeight: 1.1 }}>Letter of Award</div>
              <div style={{ fontFamily: D.hand, fontSize: 14, color: D.accent, marginTop: 4 }}>To: Riverside Youth Coalition</div>
              <div style={{ fontFamily: D.tw, fontSize: 14, marginTop: 12, fontWeight: 700 }}>$ 120,000</div>
              <div style={{ fontFamily: D.tw, fontSize: 8, color: D.inkDim, marginTop: 2 }}>over 18 months · paid quarterly</div>
              <div style={{ position: 'absolute', bottom: 8, left: 14, right: 14, fontFamily: D.hand, fontSize: 15, color: D.blueprint, borderTop: '1px solid ' + D.ink, paddingTop: 1, textAlign: 'center' }}>R. Hallowell, Chair</div>
            </div>
          ) },
      ]} />

      <TplComponentsGrid title="Twelve canonical components — every one rendered on paper.">
        <TplCComp no="01" name="App shell"        sub="folder tabs · margin">       <ATC01_Shell /></TplCComp>
        <TplCComp no="02" name="Sign-in"          sub="by appointment">              <ATC02_Signin /></TplCComp>
        <TplCComp no="03" name="Persona switcher" sub="the cast · 8 cards">           <ATC03_Actors /></TplCComp>
        <TplCComp no="04" name="Home · dashboard" sub="recipe-card greeting">         <ATC04_Home /></TplCComp>
        <TplCComp no="05" name="Object list"      sub="ruled index">                  <ATC05_List /></TplCComp>
        <TplCComp no="06" name="Object detail"    sub="blueprint G702">               <ATC06_Detail /></TplCComp>
        <TplCComp no="07" name="Form · multi-step"sub="fountain pen lines">           <ATC07_Form /></TplCComp>
        <TplCComp no="08" name="Workflow chain"   sub="signature progression">        <ATC08_Workflow /></TplCComp>
        <TplCComp no="09" name="Audit feed"       sub="leather ledger">                <ATC09_Audit /></TplCComp>
        <TplCComp no="10" name="Generated output" sub="the packet">                    <ATC10_Output /></TplCComp>
        <TplCComp no="11" name="Settings · admin" sub="stamp matrix">                   <ATC11_Settings /></TplCComp>
        <TplCComp no="12" name="Empty state"      sub="a clear desk">                   <ATC12_Empty /></TplCComp>
      </TplComponentsGrid>

      <TplTokens
        tokens={[
          { kind: 'TYPE',     v: 'DM Serif Display + Caveat + Special Elite', sub: 'editorial · handwriting · typewriter — all three' },
          { kind: 'COLOR',    v: 'Paper cream + blueprint cyan + oxblood',     sub: 'per-vertical paper stock; accents stay constant' },
          { kind: 'DENSITY',  v: 'Generous · document-scale',                  sub: 'the artifact fills the canvas; chrome retreats' },
          { kind: 'CHROME',   v: 'Folder tabs · stamps · stickies',            sub: 'no sidebars · no modals · margin notes only' },
          { kind: 'TONE',     v: 'Craft · physicality · permanence',           sub: 'feels signed, not transacted' },
        ]}
        swatches={[
          ['cream',    D.paperCream],
          ['blueprint',D.blueprint],
          ['oxblood',  D.oxblood],
          ['ink',      D.ink],
          ['gold',     D.gold],
        ]}
      />

      <TplCTA title="Build your app in Atelier, or browse the other five." ctaColor={D.accent} ctaLabel="Build in Atelier →" />
      <TplFooter text="© 2026 ustack · atelier template · all 12 components live" />
    </div>
  );
}

window.TemplateDetailAtelier = TemplateDetailAtelier;
