* { box-sizing: border-box; }
:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #161616;
  background: #f6f7f9;
}
body { margin: 0; min-height: 100vh; background: #f6f7f9; }
.topbar {
  height: 64px; background: #fff; border-bottom: 1px solid #e6e7ea;
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; }
.logo {
  display: grid; place-items: center; width: 42px; height: 42px;
  background: transparent;
}
.lamb-logo { width: 42px; height: 42px; display: block; }
.privacy { font-size: 13px; color: #39704a; font-weight: 650; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.ghost-btn {
  border: 1px solid #dfe1e5; background: #fff; color: #33363c; border-radius: 10px;
  padding: 9px 13px; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer;
}
.ghost-btn:hover { background: #f3f4f6; }
.coffee-btn {
  border: 0; border-radius: 10px; padding: 9px 14px; font: inherit; font-size: 13px; font-weight: 750;
  cursor: pointer; background: #ffb703; color: #161616;
}
.coffee-btn:hover { background: #ffc22e; }

.info-list { margin: 14px 0 4px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 11px; }
.info-list li { position: relative; padding-left: 22px; line-height: 1.5; font-size: 14px; color: #3a3d43; }
.info-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: #39704a; font-weight: 800; }
.info-list strong { color: #161616; }

.coffee-tiers { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 6px; }
.coffee-tier {
  display: grid; grid-template-columns: auto 1fr auto; column-gap: 12px; row-gap: 1px;
  border: 1px solid #e3e4e8; background: #fff; border-radius: 12px; padding: 12px 14px;
  font: inherit; cursor: pointer; text-align: left; transition: border-color .15s, background .15s, transform .1s;
}
.coffee-tier:hover { border-color: #ffb703; background: #fffaf0; transform: translateY(-1px); }
.coffee-tier .cup-svg { grid-column: 1; grid-row: 1 / 3; align-self: end; justify-self: center; color: #6f4e37; display: block; }
.coffee-tier .cup-s { width: 18px; height: 26px; }
.coffee-tier .cup-m { width: 24px; height: 34px; }
.coffee-tier .cup-l { width: 30px; height: 42px; }
.coffee-tier .size { grid-column: 2; grid-row: 1; font-weight: 750; color: #161616; }
.coffee-tier .pat { grid-column: 2; grid-row: 2; color: #8a8d94; font-size: 13px; }
.coffee-tier .amt { grid-column: 3; grid-row: 1 / 3; align-self: center; font-weight: 800; font-size: 18px; color: #161616; }
.coffee-note { margin: 8px 0 0; min-height: 16px; }

@media (max-width: 560px) {
  .ghost-btn { display: none; }
}
.app { max-width: 1120px; margin: 0 auto; padding: 46px 22px 70px; }
.hero { text-align: center; margin-bottom: 28px; }
.hero h1 { margin: 0 0 10px; font-size: clamp(30px, 5vw, 48px); letter-spacing: -1.5px; }
.hero p { max-width: 690px; margin: 0 auto; color: #666c75; line-height: 1.55; }
.drop-zone {
  max-width: 760px; margin: 0 auto; background: #fff; border: 2px dashed #c9ccd2;
  border-radius: 20px; padding: 48px 24px; text-align: center; transition: .18s ease;
}
.drop-zone.over { border-color: #161616; transform: translateY(-2px); box-shadow: 0 12px 35px #00000012; }
.upload-icon {
  width: 50px; height: 50px; border-radius: 14px; background: #f0f1f3;
  display: grid; place-items: center; margin: 0 auto 16px; font-size: 25px;
}
.drop-zone h2 { margin: 0 0 6px; font-size: 21px; }
.drop-zone p { margin: 6px 0; color: #777; }
.drop-zone small { display: block; margin-top: 17px; color: #888; }
.choose-btn, .secondary-btn, .primary-btn {
  border: 0; border-radius: 10px; padding: 11px 16px; font: inherit; font-weight: 700; cursor: pointer;
}
.choose-btn { display: inline-block; background: #161616; color: white; }
.secondary-btn { background: #fff; border: 1px solid #dfe1e5; color: #292b30; }
.primary-btn { background: #161616; color: #fff; min-width: 130px; }
button:disabled { opacity: .45; cursor: not-allowed; }
.workspace { margin-top: 28px; }
.hidden { display: none !important; }
.toolbar {
  background: #fff; border: 1px solid #e5e6e9; border-radius: 16px; padding: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 15px;
  position: sticky; top: 10px; z-index: 5; box-shadow: 0 5px 20px #00000008;
}
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.muted { color: #888; margin-left: 10px; font-size: 13px; }
.hint { color: #777; font-size: 13px; margin: 14px 2px; }
.page-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px;
}
.page-card {
  background: #fff; border: 1px solid #e3e4e8; border-radius: 14px; padding: 10px;
  cursor: grab; position: relative; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.page-card:active { cursor: grabbing; }
.page-card.selected { border-color: #161616; box-shadow: 0 0 0 2px #16161622; }
.page-card.dragging { opacity: .45; transform: scale(.98); }
.page-card.drop-target { outline: 2px dashed #777; }
.thumb {
  aspect-ratio: 0.707; width: 100%; background: #f0f1f3; border-radius: 9px;
  display: grid; place-items: center; overflow: hidden; position: relative;
}
.thumb canvas { max-width: 100%; max-height: 100%; display: block; }
.page-number {
  position: absolute; top: 7px; left: 7px; background: #161616; color: #fff;
  border-radius: 7px; padding: 3px 7px; font-size: 11px; font-weight: 750; z-index: 2;
}
.card-meta { padding: 9px 2px 1px; }
.card-title { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-subtitle { color: #8a8d94; font-size: 11px; margin-top: 3px; }
.controls { display: flex; gap: 6px; margin-top: 9px; }
.icon-btn {
  flex: 1; border: 1px solid #e1e2e5; background: #fafafa; border-radius: 8px;
  padding: 7px 5px; cursor: pointer; font-size: 13px;
}
.icon-btn:hover { background: #f0f1f3; }
.icon-btn.delete { color: #a22; }
.status { text-align: center; margin-top: 18px; color: #555; min-height: 22px; }
.status.error { color: #a22; }
.site-footer {
  padding: 26px 22px; border-top: 1px solid #e6e7ea; background: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; }
.footer-links a { color: #33363c; text-decoration: none; font-size: 13px; font-weight: 650; }
.footer-links a:hover { color: #161616; text-decoration: underline; }
.footer-meta { display: flex; flex-direction: column; gap: 3px; color: #9a9da3; font-size: 12px; }

/* brand as a link (sub-pages) */
.brand-link { text-decoration: none; color: inherit; }

/* content / legal pages */
.legal { max-width: 760px; }
.legal h1 { font-size: clamp(26px, 4vw, 38px); letter-spacing: -1px; margin: 0 0 6px; }
.legal .updated { color: #9a9da3; font-size: 13px; margin: 0 0 26px; }
.legal h2 { font-size: 20px; margin: 30px 0 10px; }
.legal h3 { font-size: 16px; margin: 20px 0 8px; }
.legal p, .legal li { color: #3a3d43; line-height: 1.65; font-size: 15px; }
.legal ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.legal a { color: #1a5fb4; }
.legal .lead { font-size: 17px; color: #4a4d53; }
.legal .callout {
  background: #f0f6f1; border: 1px solid #cfe6d4; border-radius: 12px; padding: 14px 16px;
  color: #2f5d3a; font-size: 14px; margin: 18px 0;
}
.legal .placeholder { background: #fff4d6; padding: 0 4px; border-radius: 4px; }
.legal .feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 18px 0; }
.legal .feature-card { background: #fff; border: 1px solid #e5e6e9; border-radius: 14px; padding: 16px; }
.legal .feature-card h3 { margin: 0 0 6px; }
.legal .feature-card p { margin: 0; font-size: 14px; }
.legal .btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.legal .cta { display: inline-block; text-decoration: none; }
.text-center { text-align: center; }
.btn-row.center { justify-content: center; }

/* ad slot — hidden until consent.js activates it (ads enabled + consent given) */
.ad-slot { display: none; margin: 26px auto; max-width: 970px; text-align: center; }
.ad-slot.active { display: block; }
.ad-label { font-size: 10px; letter-spacing: .6px; text-transform: uppercase; color: #b5b8bd; margin-bottom: 4px; }
ins.adsbygoogle { display: block; }

/* cookie-consent banner */
.consent-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: #161616; color: #f4f4f5; box-shadow: 0 -6px 24px #00000026;
}
.consent-inner {
  max-width: 1120px; margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between;
}
.consent-text { margin: 0; font-size: 13px; line-height: 1.5; flex: 1; min-width: 240px; }
.consent-text a { color: #ffd166; }
.consent-actions { display: flex; gap: 10px; }
.consent-actions .secondary-btn { background: transparent; color: #f4f4f5; border-color: #4a4a4a; }
.consent-actions .secondary-btn:hover { background: #2a2a2a; }
.consent-actions .primary-btn { background: #ffb703; color: #161616; }

.bug-form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; max-width: 560px; }
.bug-form .field { width: 100%; min-width: 0; }
.bug-form textarea.text-input { resize: vertical; font: inherit; }
.bug-note { min-height: 16px; margin: 0; }
.bug-note.error, .coffee-note.error { color: #a22; }
#reportBugBtn { margin-top: 6px; }

/* --- added: tool strip, options panel, selection, redaction, modal --- */
.tools-bar { display: flex; align-items: center; gap: 12px; margin: 16px 2px 0; flex-wrap: wrap; }
.tools-label { font-size: 11px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: #9a9da3; }
.tool-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tool-tab {
  border: 1px solid #dfe1e5; background: #fff; color: #33363c; border-radius: 999px;
  padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer;
}
.tool-tab:hover { background: #f3f4f6; }
.tool-tab.active { background: #161616; color: #fff; border-color: #161616; }
.secondary-btn.active { background: #161616; color: #fff; border-color: #161616; }

.out-name { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 650; color: #9a9da3; }
.out-name .text-input { width: 150px; padding: 7px 10px; }

.bulk-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 14px 2px 0; }
.link-btn {
  border: 1px solid #e1e2e5; background: #fff; color: #33363c; border-radius: 8px;
  padding: 6px 10px; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer;
}
.link-btn:hover:not(:disabled) { background: #f3f4f6; }
.link-btn.danger { color: #a22; }
.link-btn:disabled { opacity: .4; cursor: not-allowed; }
.bulk-sep { width: 1px; height: 20px; background: #e1e2e5; margin: 0 4px; }

.form-fields { display: flex; flex-direction: column; gap: 10px; width: 100%; max-height: 320px; overflow: auto; padding-right: 4px; }

.tool-panel {
  background: #fff; border: 1px solid #e5e6e9; border-radius: 16px; padding: 18px; margin-top: 14px;
  position: relative;
}
.panel-head h3 { margin: 0 0 4px; font-size: 17px; }
.panel-head .muted { margin: 0; display: block; line-height: 1.5; }
.panel-controls { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.row { display: flex; gap: 12px; flex-wrap: wrap; width: 100%; }
.row.row-center { align-items: center; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 650; color: #4a4d53; flex: 1; min-width: 130px; }
.text-input {
  border: 1px solid #dfe1e5; border-radius: 9px; padding: 9px 11px; font: inherit; font-weight: 500;
  background: #fff; color: #161616;
}
.text-input.color { padding: 4px; height: 40px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #4a4d53; }
.small { font-size: 12px; }
code { background: #f0f1f3; padding: 1px 5px; border-radius: 5px; font-size: 12px; }
.panel-close {
  position: absolute; top: 12px; right: 12px; border: 0; background: transparent;
  font-size: 18px; color: #999; cursor: pointer; line-height: 1;
}

.sel { position: absolute; top: 7px; right: 7px; width: 18px; height: 18px; z-index: 2; cursor: pointer; }
.page-grid.redact-mode .page-card, .page-grid.sign-mode .page-card { cursor: crosshair; }
.thumb.drawable { touch-action: none; }
.redaction-box, .redaction-live { position: absolute; background: #000; z-index: 1; }
.redaction-live { background: #000000cc; outline: 1px solid #fff; }
.stamp-box, .stamp-live {
  position: absolute; z-index: 1; background-size: contain; background-repeat: no-repeat; background-position: center;
}
.stamp-live { outline: 1px dashed #161616; }

.modal { position: fixed; inset: 0; background: #00000055; display: grid; place-items: center; z-index: 50; }
.modal-card { background: #fff; border-radius: 16px; padding: 22px; width: min(420px, 92vw); box-shadow: 0 20px 60px #00000030; }
.modal-card h3 { margin: 0 0 8px; }
.modal-card .text-input { width: 100%; margin: 12px 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

@media (max-width: 700px) {
  .topbar { padding: 0 15px; }
  .privacy { display: none; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions > * { flex: 1; text-align: center; }
  .page-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
