/* TKJ Legal Services — templates and precedents (staff library).
   Chrome in the house style (Poppins / Inter, navy / gold); the document itself in Arial, as the Word files are. */
:root { --navy: #0F2540; --gold: #C9A227; --gold-soft: #E7D08A; --ink: #1A1A1A; --body: #4A5A70; --grey: #5B6777; --pale: #EEF2F7; --line: #D5DAE2;
        --ph: #FFF2A8; --ph-filled: #FDF7DD; --note: #FBF6E6; --warn: #FDECEC; --maroon: #800020; }
* { box-sizing: border-box; }
html { background: #F4F6FA; }
body { margin: 0; font-family: Inter, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); font-size: 16px; line-height: 1.6; }
h1, h2, h3 { font-family: Poppins, Inter, sans-serif; color: var(--navy); line-height: 1.2; margin: 0 0 .4em; }
a { color: var(--navy); }
.sr { position: absolute; left: -9999px; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; padding-top: 48px; padding-bottom: 48px; }
.btn { display: inline-block; padding: 10px 18px; border-radius: 8px; background: var(--gold); color: var(--navy); font: 600 15px Poppins, Inter, sans-serif; border: 0; cursor: pointer; text-decoration: none; }
.btn:hover { background: #B08E20; }
.btn.ghost { background: transparent; border: 1.5px solid var(--navy); color: var(--navy); }
.btn:disabled { opacity: .55; cursor: wait; }
.link { background: none; border: 0; padding: 0; color: var(--navy); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; }
.link.danger { color: var(--maroon); }
.link input[type=file] { display: none; }

/* top bar */
.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.bar { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand img { display: block; height: 22px; width: auto; }
.links { margin-left: auto; display: flex; gap: 18px; align-items: center; font-size: 14px; }
.links a { text-decoration: none; font-weight: 600; }
.who { color: var(--grey); }
.foot { margin-top: 48px; padding: 20px 0 36px; color: var(--grey); font-size: 13px; border-top: 1px solid var(--line); }

/* index */
.lede { padding: 40px 0 8px; max-width: 820px; }
.lede h1 { font-size: 34px; }
.lede p { color: var(--body); }
.search input { width: 100%; max-width: 520px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; font-size: 16px; }
.search input:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.group h2 { font-size: 20px; margin: 32px 0 12px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.card a { display: block; height: 100%; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: 12px; padding: 16px 18px; text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.card a:hover { border-color: var(--gold); box-shadow: 0 6px 18px rgba(15,37,64,.08); }
.card .id { font: 600 12px Poppins, sans-serif; color: var(--navy); letter-spacing: .04em; }
.card .kind { float: right; font-size: 11px; color: var(--grey); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.card strong { display: block; font: 600 16px Poppins, sans-serif; color: var(--navy); margin: 6px 0 4px; }
.card .short { display: block; font-size: 13.5px; color: var(--body); }
.card .meta { display: block; margin-top: 8px; font-size: 12px; color: var(--grey); }
.empty { color: var(--grey); padding: 24px 0; }
.error { background: var(--warn); border-left: 4px solid #A12A2A; padding: 12px 16px; }
.loading { color: var(--grey); padding: 48px 0; }

/* template page */
.tpl-head { padding: 28px 0 12px; }
.tpl-head .back { font-size: 14px; text-decoration: none; font-weight: 600; }
.tpl-head h1 { font-size: 26px; margin-top: 6px; }
.tpl-head .short { color: var(--body); max-width: 900px; margin: 0; }
.tpl-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; padding-bottom: 40px; }
.side { position: sticky; top: 76px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; max-height: calc(100vh - 92px); overflow: auto; font-size: 14px; }
.side h2 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--grey); margin: 16px 0 6px; }
.progress { font: 600 15px Poppins, sans-serif; color: var(--navy); margin-bottom: 10px; }
.actions { display: flex; flex-direction: column; gap: 8px; }
.actions .btn { text-align: center; }
.opts { margin: 14px 0 6px; display: grid; gap: 6px; }
.opt { display: flex; gap: 8px; align-items: flex-start; }
.opt.off { color: var(--grey); }
.draft { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0 4px; }
.fields { list-style: none; margin: 0; padding: 0; }
.fields li { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid #F0F2F6; }
.fields .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ph); border: 1px solid #D9C45A; flex: none; }
.fields li.done .dot { background: #4C9A5B; border-color: #3C7A48; }
.fields .goto { flex: 1; text-align: left; background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: pointer; }
.fields .goto:hover { color: var(--navy); text-decoration: underline; }
.fields .apply { font-size: 11px; color: var(--navy); background: var(--pale); border: 0; border-radius: 999px; padding: 2px 8px; cursor: pointer; }
.side .note { color: var(--grey); font-size: 12.5px; margin-top: 12px; }

/* the paper */
.sheet { min-width: 0; }
.guidance { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; }
.guidance summary { cursor: pointer; padding: 14px 18px; font: 600 15px Poppins, sans-serif; color: var(--navy); }
.front-wrap { padding: 0 18px 18px; }
.doc { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 56px 64px 72px; font-family: Arial, "Liberation Sans", Arimo, Helvetica, sans-serif; font-size: 14px; line-height: 1.5; color: var(--ink); }
.doc p, .doc h1, .doc h2, .doc h3 { font-family: inherit; }
.doc .title { text-align: center; font-size: 20px; font-weight: 700; color: var(--navy); border-bottom: 1.5px solid var(--gold); padding-bottom: 6px; margin: 8px 0 6px; }
.doc .subtitle { text-align: center; color: var(--grey); font-size: 13.5px; margin: 0 0 20px; }
.doc .head { font-size: 14px; font-weight: 700; color: var(--navy); text-transform: uppercase; margin: 18px 0 8px; }
.doc .sh { font-size: 14px; font-weight: 700; color: var(--navy); margin: 14px 0 4px; }
.doc .p, .doc .def, .doc .pi { margin: 0 0 8px; text-align: justify; }
.doc .def, .doc .pi { margin-left: 48px; }
.doc .party, .doc .recital, .doc .n, .doc .b, .doc .bb, .doc .h { margin: 0 0 8px; padding-left: var(--left, 48px); text-indent: calc(-1 * var(--hang, 48px)); }
.doc .n .txt { text-align: justify; }
.doc .num { display: inline-block; width: var(--hang, 48px); text-indent: 0; }
.doc .h { font-weight: 700; color: var(--navy); text-transform: uppercase; margin-top: 14px; }
.doc .h .txt { text-transform: uppercase; }
.doc .txt { display: inline; text-indent: 0; }
.doc table { border-collapse: collapse; width: 100%; margin: 4px 0 10px; font-size: 12.5px; }
.doc table.grid th { background: var(--navy); color: #fff; font-weight: 700; text-align: left; padding: 6px 8px; border: 1px solid #C9CFD8; font-size: 11.5px; }
.doc table.grid td { padding: 5px 8px; border: 1px solid #C9CFD8; vertical-align: top; }
.doc table.form th { background: var(--pale); color: var(--navy); text-align: left; width: 35%; padding: 6px 8px; border: 1px solid #C9CFD8; font-size: 12px; vertical-align: top; }
.doc table.form td { padding: 6px 8px; border: 1px solid #C9CFD8; vertical-align: top; }
.doc .box { display: block; margin: 4px 0 10px; padding: 8px 12px; font-size: 12.5px; color: #3A4555; border-left: 4px solid var(--gold); background: var(--note); border-radius: 0 6px 6px 0; }
.doc .box.warn { border-left-color: #A12A2A; background: var(--warn); }
.doc .box-label { font-weight: 700; font-size: 10.5px; letter-spacing: .04em; color: var(--gold); }
.doc .box.warn .box-label { color: #A12A2A; }
.doc .check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 6px; }
.doc .check input { width: 16px; height: 16px; margin-top: 3px; accent-color: var(--navy); flex: none; }
.doc .sched { text-align: center; font-weight: 700; color: var(--navy); margin: 16px 0 2px; }
.doc .sched-title { text-align: center; font-weight: 700; color: var(--navy); text-transform: uppercase; margin: 0 0 16px; }
.doc .pb { border-top: 1px dashed var(--line); margin: 28px -64px; position: relative; }
.doc .pb::after { content: "page break"; position: absolute; right: 12px; top: -9px; font-size: 10px; color: var(--grey); background: #fff; padding: 0 6px; font-family: Inter, sans-serif; }
.doc .pb.orient[data-orient=landscape]::after { content: "page break — landscape pages"; }
.doc .pb.orient[data-orient=portrait]::after { content: "page break — portrait pages"; }
.doc .space { height: 10px; }
.doc table.sig td { width: 50%; padding: 6px 4px 14px; vertical-align: top; }
.doc .sigline { margin-top: 24px; letter-spacing: .5px; }
.doc .sigrole, .doc .sigdate { color: var(--grey); font-size: 12.5px; margin-top: 4px; }
.doc .to { margin: 0; }
.doc .ref { color: var(--grey); font-size: 13px; margin: 10px 0 0; }
.doc .dateline { margin: 0 0 14px; }
.doc .subject { font-weight: 700; color: var(--navy); margin: 8px 0; }
.doc .salute { margin: 8px 0; }
.doc .signoff { margin: 12px 0 28px; }
.doc .signoff-who { margin: 0; }
.doc .letterhead { color: var(--grey); font-size: 12px; margin-bottom: 20px; }
.doc .letterfoot { color: var(--grey); font-size: 11px; margin-top: 28px; }

/* the front sheet */
.front-band { background: var(--navy); color: #fff; border-radius: 10px; padding: 18px 22px; margin: 8px 0 14px; }
.front-kicker { color: var(--gold); font: 600 11px Poppins, sans-serif; letter-spacing: .08em; }
.front-title { color: #fff; font-size: 24px; margin: 4px 0 6px; }
.front-short { color: #EAF0F8; margin: 0; font-size: 14px; }
.front-status, .front-how { font-size: 13px; color: var(--grey); margin: 0 0 8px; }
.front-status strong, .front-how strong { color: var(--navy); }
.front-rows { border-collapse: collapse; width: 100%; font-size: 13.5px; margin: 6px 0 10px; }
.front-rows th { background: var(--pale); color: var(--navy); text-align: left; width: 28%; padding: 7px 10px; border: 1px solid var(--line); font-size: 12.5px; vertical-align: top; }
.front-rows td { padding: 7px 10px; border: 1px solid var(--line); vertical-align: top; }
.front-h { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; margin: 16px 0 6px; }
.front-h.maroon { color: var(--maroon); }
.front-list { margin: 0 0 8px 18px; padding: 0; font-size: 13.5px; }
.front-list.small { font-size: 12.5px; color: var(--grey); }
.front-list li { margin-bottom: 4px; }
.checklist .check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; margin-bottom: 6px; }
.checklist .check input { width: 16px; height: 16px; margin-top: 3px; accent-color: var(--navy); flex: none; }

/* fields */
.fld { display: inline; background: var(--ph); color: var(--ink); border-bottom: 1px solid #D9C45A; padding: 0 2px; white-space: pre-wrap; border-radius: 2px; min-width: 2ch; outline: none; cursor: text; }
.fld:empty::before { content: attr(data-ph); color: #6B5A10; }
.fld.filled { background: var(--ph-filled); border-bottom-style: dotted; }
.fld:focus { box-shadow: 0 0 0 2px var(--gold); background: #FFF8CC; }
body.busy { cursor: progress; }

@media (max-width: 900px) {
  .tpl-grid { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
  .doc { padding: 28px 22px 40px; }
  .doc .pb { margin-left: -22px; margin-right: -22px; }
  .bar { gap: 12px; } .links { gap: 10px; } .who { display: none; }
}
@media print {
  .top, .side, .foot, .tpl-head .back, .guidance summary { display: none; }
  .tpl-grid { display: block; }
  .doc { border: 0; padding: 0; }
  .fld { background: none; border: 0; }
}
