:root {
  --navy: #0E1B2C; --gold: #C9A227; --gold-deep: #9C7E1B;
  --paper: #F7F4ED; --card: #FFFFFF; --ink: #0E1B2C;
  --soft: #3D4B61; --faint: #6B7A90; --line: #E4DDCE;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  --disp: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper); line-height: 1.6; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 22px; }
.tile-header { background: var(--navy); color: #fff; padding: 14px 0; }
.tile-header .wrap { display: flex; align-items: center; gap: 16px; }
.tile-brand { color: #fff; text-decoration: none; font-weight: 700; }
.tile-brand span { color: var(--gold); font-weight: 400; font-size: .85em; }
.tile-name { margin-left: auto; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.tile-hero { padding: 56px 0 30px; }
.tile-hero h1 { font-family: var(--disp); font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 10px; letter-spacing: -.01em; }
.lede { color: var(--soft); font-size: 1.1rem; margin: 0; }
.tile-tool { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 30px; margin-bottom: 26px; box-shadow: 0 16px 40px -20px rgba(14,27,44,.25); }
.placeholder { color: var(--faint); }
.tile-monetize { text-align: center; padding: 34px; border: 2px dashed var(--gold); border-radius: 18px; margin-bottom: 40px; }
.tile-monetize h2 { font-family: var(--disp); margin: 0 0 8px; }
.btn { display: inline-block; background: var(--navy); color: #fff; text-decoration: none; font-weight: 600; padding: 13px 30px; border-radius: 999px; margin-top: 12px; }
.tile-footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--faint); font-size: .85rem; }
.tile-footer a { color: var(--gold-deep); }
label { display: block; font-weight: 600; font-size: .9rem; margin: 14px 0 6px; }
input, textarea, select { width: 100%; font: inherit; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px; }
.inv-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-bottom: 26px; align-items: start; }
@media (max-width: 900px) { .inv-layout { grid-template-columns: 1fr; } }
.inv-form h2, .inv-form h3 { font-family: var(--disp); margin: 22px 0 6px; }
.inv-form h2:first-child { margin-top: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.item-row { display: grid; grid-template-columns: 1fr 64px 96px 36px; gap: 8px; margin-top: 8px; }
.i-del { background: none; border: none; color: var(--faint); font-size: 1.3rem; cursor: pointer; }
.i-del:hover { color: #b00; }
.btn-ghost { background: none; border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 22px; font: inherit; font-weight: 600; cursor: pointer; margin-top: 10px; }
.btn-ghost:hover { border-color: var(--gold); }
.inv-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
button.action { background: var(--gold); border: none; font: inherit; font-weight: 700; padding: 13px 30px; border-radius: 999px; cursor: pointer; margin-top: 10px; }
.saved-list { list-style: none; padding: 0; margin: 8px 0 0; }
.saved-list li { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.saved-list a { color: var(--navy); font-weight: 600; text-decoration: none; }
.hint { color: var(--faint); }
/* preview sheet */
.inv-preview { position: sticky; top: 20px; }
.sheet { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 34px 30px; box-shadow: 0 24px 60px -30px rgba(14,27,44,.35); }
.sheet-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--navy); padding-bottom: 16px; margin-bottom: 16px; }
.sheet-head h2 { font-family: var(--disp); margin: 0; letter-spacing: .06em; }
.sheet-head p { margin: 2px 0 0; color: var(--faint); }
.sheet-from { text-align: right; font-size: .9rem; }
.sheet-from p { margin: 2px 0; color: var(--soft); }
.sheet-meta { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; margin-bottom: 18px; font-size: .92rem; }
.sheet-meta span { display: block; text-transform: uppercase; font-size: .72rem; letter-spacing: .1em; color: var(--faint); }
.sheet-meta p { margin: 2px 0; color: var(--soft); }
.sheet-items { width: 100%; border-collapse: collapse; font-size: .92rem; }
.sheet-items th { text-align: left; text-transform: uppercase; font-size: .72rem; letter-spacing: .1em; color: var(--faint); border-bottom: 1px solid var(--line); padding: 8px 4px; }
.sheet-items td { padding: 10px 4px; border-bottom: 1px solid var(--line); }
.sheet-items .empty { text-align: center; color: var(--faint); }
.sheet-totals { margin-top: 16px; max-width: 260px; margin-left: auto; font-size: .95rem; }
.sheet-totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.sheet-totals .grand { border-top: 2px solid var(--navy); margin-top: 8px; padding-top: 10px; font-size: 1.15rem; }
.sheet-totals .grand strong { color: var(--gold-deep); }
.sheet-notes { margin-top: 18px; font-size: .88rem; color: var(--soft); white-space: pre-wrap; }
@media print {
  .tile-header, .tile-hero, .inv-form, .tile-monetize, .tile-footer { display: none; }
  .inv-layout { display: block; }
  .sheet { border: none; box-shadow: none; padding: 0; }
  body { background: #fff; }
}
