:root{
  --avocado:#5a7f22; --avocado-dark:#3e5c14; --avocado-light:#eef4e2;
  --yellow:#f5c518; --ink:#14210a; --muted:#5c6b52; --line:#dde5d2;
  --bg:#ffffff; --card:#f7faf2; --danger:#b42318;
}
*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:var(--ink);background:var(--bg);line-height:1.45}
.top{display:flex;justify-content:space-between;align-items:center;gap:.75rem;padding:.9rem 1rem;max-width:960px;margin:0 auto;position:sticky;top:0;background:rgba(255,255,255,.96);z-index:5;border-bottom:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:.7rem;min-width:0}
.brand img{width:auto;height:56px;max-width:220px;object-fit:contain;flex:0 0 auto}
.logo-btn{background:none;border:0;padding:0;cursor:pointer;line-height:0;flex:0 0 auto}
.logo-btn:focus-visible{outline:2px solid var(--avocado);outline-offset:3px;border-radius:8px}
.brand h1{margin:0;font-size:1.35rem;line-height:1.1}
.brand .sub{color:var(--muted);margin:.15rem 0 0;font-size:.9rem}
.top-actions{display:flex;gap:.5rem;flex-wrap:wrap;justify-content:flex-end}
h1{margin:0} h2{font-size:1.3rem;margin:.5rem 0} h3{margin:1.25rem 0 .5rem}
main{max-width:960px;margin:0 auto;padding:0 1rem 2.5rem}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:.85rem;margin:1rem 0}
.tile,.card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:1.05rem;text-align:left;cursor:pointer;font:inherit;min-height:88px}
.tile:hover,.card:hover{border-color:var(--avocado);box-shadow:0 4px 14px rgba(90,127,34,.12)}
.tile b{display:block;font-size:1.02rem}
.tile span,.path,.hint{color:var(--muted);font-size:.9rem}
.search{display:flex;gap:.5rem;align-items:center;border:1.5px solid var(--line);border-radius:999px;padding:.7rem 1rem;margin:1.1rem 0;background:#fff}
.search:focus-within{border-color:var(--avocado);box-shadow:0 0 0 3px var(--avocado-light)}
.search input{border:0;outline:0;flex:1;font-size:1rem;min-width:0}
.add-btn{display:block;width:100%;min-height:52px;padding:.9rem;background:var(--avocado);color:#fff;border:0;border-radius:14px;font-size:1.05rem;font-weight:700;cursor:pointer}
.add-btn:hover{background:var(--avocado-dark)}
button{cursor:pointer;min-height:44px}
.icon-btn,.back{background:#fff;border:1px solid var(--line);border-radius:999px;padding:.55rem .95rem;font:inherit}
.primary{background:var(--avocado);color:#fff;border:0;border-radius:12px;padding:.75rem 1.1rem;font-weight:700}
.danger{background:var(--danger);color:#fff;border:0;border-radius:12px;padding:.75rem 1.1rem;font-weight:700}
.card img{width:100%;height:130px;object-fit:cover;border-radius:10px;background:#eef4e2}
.badge{display:inline-block;background:#e6f2d8;border:1px solid #bcd69a;color:#2f5210;border-radius:999px;padding:.2rem .65rem;font-size:.8rem;font-weight:600}
.badge.out{background:#fdeeee;border-color:#f0c9c9;color:#7a1f1a}
.row{display:flex;gap:.6rem;flex-wrap:wrap;margin-top:1rem;align-items:center}
.row button{flex:1 1 auto}
dialog{border:1px solid var(--line);border-radius:18px;padding:1.35rem;max-width:540px;width:calc(100% - 2rem);box-shadow:0 16px 40px rgba(0,0,0,.16)}
dialog label{display:block;margin:.8rem 0;font-weight:600}
dialog input, dialog select, dialog textarea{width:100%;padding:.7rem;border:1px solid var(--line);border-radius:10px;margin-top:.3rem;font:inherit;font-weight:400}
.stepper{display:flex;gap:.3rem;align-items:center}
.stepper input{flex:1;text-align:center}
.stepper button{padding:.6rem 1.1rem}
.notice{background:#fff8d6;border:1px solid #f0d95a;border-radius:12px;padding:.8rem;margin:1rem 0}
footer{max-width:960px;margin:0 auto;padding:0 1rem 2rem;color:var(--muted)}
.unit-photo{font-size:.85rem}
.admin-note{color:var(--muted);font-size:.9rem;background:var(--avocado-light);border-radius:10px;padding:.65rem .8rem}
.out-group{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:1rem 1.1rem;margin:1rem 0}
.out-group h3{margin:.25rem 0 .75rem}
.out-row{display:flex;gap:.75rem;justify-content:space-between;align-items:center;border-top:1px solid var(--line);padding:.7rem 0}
.out-row:first-of-type{border-top:0;padding-top:.25rem}
.out-row button{flex:0 0 auto;background:#fff;border:1px solid var(--line);border-radius:999px;padding:.55rem .95rem;font:inherit}
.small{color:var(--muted);font-size:.85rem}
@media (max-width:520px){
  .brand h1{font-size:1.15rem}
  .brand .sub{display:none}
  .grid{grid-template-columns:repeat(2,1fr);gap:.65rem}
  .top-actions{flex-direction:column}
}
