.pi-page {
  --pi-ink: #223c32; --pi-muted: #596a60; --pi-border: #d5dcd3; --pi-pine: #274e3b;
  --pi-accent: #a7471f; --pi-tint: #eef2e9;
  color: var(--pi-ink); max-width: 1480px;
}
.pi-page *, .pi-dialog * { box-sizing: border-box; }
.pi-page h1,.pi-page h2,.pi-page h3,.pi-page p,.pi-page dl,.pi-page dd,.pi-page ul,.pi-page ol { margin: 0; }
.pi-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin: 4px 0 25px; }
.pi-heading h1 { font-size: clamp(28px,3.2vw,43px); letter-spacing: -.055em; line-height: 1.12; color: #203b2e; overflow-wrap: anywhere; }
.pi-heading p, .pi-empty p { font-size: 15px; line-height: 1.55; color: var(--pi-muted); margin-top: 7px; }
.pi-page h2,.pi-dialog h2 { font-size: 18px; letter-spacing: -.03em; line-height: 1.32; font-weight: 650; }
.pi-page h3 { font-size: 16px; letter-spacing: -.015em; }
.pi-back,.pi-text-btn { background: transparent; color: var(--pi-pine); border: 0; font: inherit; text-align: left; cursor: pointer; padding: 0; }
.pi-back { margin-bottom: 16px; display: inline-flex; align-items:center; gap:7px; font-size: 13px; font-weight: 600; }
.pi-back:hover,.pi-text-btn:hover,.pi-links a:hover { text-decoration: underline; }
.pi-text-btn { font-weight: 640; overflow-wrap:anywhere; }
.pi-actions,.pi-tabs { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.pi-btn,.pi-chip,.pi-tabs button {
  display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:38px;
  border:1px solid var(--pi-border); border-radius:7px; padding:8px 13px;
  background:#fff; color:var(--pi-pine); font:inherit; font-size:14px; font-weight:600; cursor:pointer;
}
.pi-btn:hover,.pi-chip:hover,.pi-tabs button:hover { background:#edf2eb; }
.pi-btn.pi-primary { color:#fff; border-color:var(--pi-accent); background:var(--pi-accent); }
.pi-btn.pi-primary:hover { background:#873819; }
.pi-btn:disabled { opacity:.48; cursor:default; }
.pi-chip[aria-pressed="true"],.pi-tabs button[aria-pressed="true"] { color:#fff; background:var(--pi-pine); border-color:var(--pi-pine); }
.pi-page :focus-visible,.pi-dialog :focus-visible { outline:3px solid #b76831; outline-offset:2px; }
.pi-page[aria-busy="true"] { cursor:progress; }
.pi-panel, .pi-empty { background:#fff; border:1px solid var(--pi-border); border-radius:11px; min-width:0; }
.pi-empty { padding:36px; text-align:center; }
.pi-empty .pi-actions { margin-top:15px; justify-content:center; }
.pi-panel > .pi-empty { border:0; }
.pi-padded,.pi-form { padding:clamp(16px,2.5vw,28px); }
.pi-stack { display:flex; flex-direction:column; gap:16px; min-width:0; }
.pi-profile-grid { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(245px,1fr); gap:16px; align-items:start; }
.pi-panel-head,.pi-photo-foot,.pi-select-bar,.pi-form-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.pi-panel-head { padding:16px 20px; flex-wrap:wrap; }
.pi-flush { padding:0; }
.pi-scene,.pi-photo-empty { text-align:center; background:#eef0ea; }
.pi-scene { padding:12px; }
.pi-image-wrap { display:inline-block; position:relative; max-width:100%; vertical-align:middle; }
.pi-image-wrap img { display:block; max-width:100%; max-height:365px; width:auto; height:auto; }
.pi-outline { position:absolute; border:3px solid #f08840; box-shadow:0 0 0 1px #442b14, inset 0 0 0 1px #fff; border-radius:4px; pointer-events:none; }
.pi-photo-empty { height:158px; color:#687569; display:grid; gap:8px; align-content:center; justify-items:center; font-size:14px; border-radius:0 0 11px 11px; }
.pi-photo-foot { padding:12px 18px; }
.pi-photo-foot span { display:inline-flex; align-items:center; gap:8px; color:var(--pi-muted); font-size:13px; }
.pi-photo-foot i { display:inline-block; width:13px; height:13px; border:2px solid #e18137; border-radius:2px; }
.pi-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 16px; }
.pi-facts > div,.pi-place,.pi-notes { padding:13px 0 9px; border-bottom:1px solid #e8ece6; min-width:0; }
.pi-facts dt,.pi-place small,.pi-history small,.pi-row-body small,.pi-disposal small { color:var(--pi-muted); font-size:13px; }
.pi-facts dd,.pi-place,.pi-notes p,.pi-history span { font-size:15px; line-height:1.45; overflow-wrap:anywhere; }
.pi-place small,.pi-history small,.pi-row-body small { display:block; }
.pi-place small,.pi-facts dt { margin-bottom:4px; }
.pi-notes { border:0; }
.pi-notes p { white-space:pre-wrap; margin-top:7px; }
.pi-decide { margin:16px 0 10px; }
.pi-badge { display:inline-block; white-space:nowrap; padding:4px 9px; line-height:1.3; font-size:12px; font-weight:640; color:#48584b; background:#edf0ea; border-radius:50px; }
.pi-badge-keep { color:#2b583c; background:#e5efdf; }
.pi-badge-outgoing { color:#89431f; background:#fcf0df; }
.pi-history { list-style:none; padding:0; }
.pi-history li { padding:13px 0 10px; border-bottom:1px solid #e8ece6; }
.pi-history li:last-child { border:0; }
.pi-history strong,.pi-history span,.pi-history small { display:block; margin-top:3px; }
.pi-history strong { font-size:14px; }
.pi-dialog { --pi-border:#d5dcd3; --pi-pine:#274e3b; color:#223c32; width:min(750px,95vw); max-height:90vh; padding:0; border:0; border-radius:12px; }
.pi-dialog::backdrop { background:#202e25a6; }
.pi-crop { text-align:center; padding:12px; background:#edf0e9; }
.pi-crop canvas { max-width:100%; max-height:70vh; width:auto; height:auto; }
.pi-form { max-width:800px; }
.pi-form h2 + p { margin:6px 0 18px; }
.pi-fields,.pi-filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px 18px; }
.pi-form .pi-fields { margin:16px 0 24px; }
.pi-filters { grid-template-columns:repeat(3,minmax(0,1fr)); margin-bottom:17px; }
.pi-field { display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start; gap:6px; min-width:0; font-size:13px; color:var(--pi-muted); font-weight:600; }
.pi-field input,.pi-field select,.pi-field textarea { box-sizing:border-box; width:100%; min-height:40px; padding:9px 10px; font:inherit; font-weight:450; font-size:15px; background:#fff; border:1px solid #bdc8bb; border-radius:6px; color:var(--pi-ink); }
.pi-field textarea { resize:vertical; }
.pi-span { grid-column:1/-1; }
.pi-form-footer { justify-content:flex-end; margin-top:18px; flex-wrap:wrap; }
.pi-select-bar { padding:12px 0; border-top:1px solid var(--pi-border); border-bottom:1px solid var(--pi-border); flex-wrap:wrap; }
.pi-select-bar label,.pi-rows li { display:flex; align-items:center; gap:12px; font-size:14px; }
.pi-rows { list-style:none; padding:0; }
.pi-rows li { padding:14px 2px; border-bottom:1px solid #e1e6de; }
.pi-rows li:last-child { border:0; }
.pi-row-body { flex:1; min-width:0; }
.pi-row-body small { margin-top:3px; }
.pi-rows input[type=checkbox],.pi-select-bar input[type=checkbox] { width:16px; height:16px; accent-color:#456950; }
.pi-count { color:var(--pi-muted); font-weight:480; font-size:14px; }
.pi-tabs { margin-bottom:16px; }
.pi-tabs button { border-radius:30px; }
.pi-disposal { border-bottom:1px solid var(--pi-border); padding:7px 0; }
.pi-disposal:last-child { border-bottom:0; }
.pi-disposal summary { cursor:pointer; padding:8px 0; font-weight:600; }
.pi-disposal small { font-weight:400; margin-left:8px; }
.pi-disposal form { padding:8px 2px; }
.pi-hint,.pi-links { font-size:14px; line-height:1.5; color:var(--pi-muted); margin-top:12px !important; }
.pi-links { display:flex; flex-wrap:wrap; gap:12px; }
.pi-links a { color:var(--pi-pine); }
@media (max-width:760px) {
 .pi-profile-grid { grid-template-columns:1fr; }
 .pi-heading { gap:12px; }
 .pi-filters { grid-template-columns:1fr; }
}
@media (max-width:480px) {
 .pi-fields { grid-template-columns:1fr; }
 .pi-facts { gap:0 8px; }
 .pi-panel-head,.pi-photo-foot { padding:12px; }
 .pi-empty { padding:24px 12px; }
 .pi-btn { padding:8px 10px; }
}
