:root{
  --bg:#f5f6f8; --card:#fff; --ink:#1d2733; --muted:#6b7785; --line:#e2e7ee;
  --brand:#e8821f; --brand-d:#cf7012; --ok:#1aa260; --ng:#e23b3b;
  --shadow:0 1px 3px rgba(20,30,45,.08),0 1px 2px rgba(20,30,45,.06);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:system-ui,-apple-system,"Segoe UI","Noto Sans JP",sans-serif;background:var(--bg);color:var(--ink);line-height:1.6}
#app{max-width:880px;margin:0 auto;padding:0 16px 60px}

.toolbar{position:sticky;top:0;z-index:10;display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between;padding:12px 16px;margin:0 -16px 18px;background:#fff;border-bottom:1px solid var(--line)}
.tb-left{display:flex;align-items:center;gap:8px;font-size:16px}.logo{font-size:20px}
.tb-right{display:flex;flex-wrap:wrap;gap:8px;align-items:center}

.btn{font-size:14px;font-weight:700;padding:10px 14px;border-radius:9px;border:1px solid var(--line);background:#fff;color:var(--ink);cursor:pointer;min-height:42px;text-decoration:none;display:inline-flex;align-items:center;justify-content:center}
.btn.primary{background:var(--brand);border-color:var(--brand);color:#fff}.btn.primary:active{background:var(--brand-d)}
.btn.ghost{background:#fff}.btn.sm{min-height:34px;padding:6px 10px;font-size:13px}

.section-title{font-size:15px;color:var(--muted);margin:18px 2px 8px}
.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:14px;box-shadow:var(--shadow);margin-bottom:12px}
.field{display:block;margin-bottom:12px}.field:last-child{margin-bottom:0}
.field-label{display:block;font-size:13px;color:var(--muted);margin-bottom:5px}
.inp{width:100%;font-size:16px;padding:10px 12px;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--ink);-webkit-appearance:none;font-family:inherit}
.inp:focus-visible{outline:3px solid rgba(232,130,31,.3);border-color:var(--brand)}
textarea.inp{resize:vertical}
.hdr-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}

.items-head{display:flex;align-items:center;justify-content:space-between}
.ky-list{display:flex;flex-direction:column;gap:10px}
.ky-card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:12px;box-shadow:var(--shadow)}
.ky-card-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.item-no{width:26px;text-align:center;color:var(--muted);font-size:13px;font-weight:700}
.icon-btn{width:36px;height:36px;border-radius:8px;border:1px solid var(--line);background:#fff;color:var(--muted);font-size:18px;cursor:pointer}
.ky-fields{display:flex;flex-direction:column;gap:8px}
.ky-l{display:block;font-size:12px;color:var(--muted);margin-bottom:3px;font-weight:700}
.ky-l.warn{color:var(--ng)}.ky-l.ok{color:var(--ok)}

.pro-card{margin-top:20px;background:linear-gradient(180deg,#fff,#fff7ef);border:1px solid #f3dcc0;border-radius:14px;padding:18px;box-shadow:var(--shadow)}
.pro-title{font-weight:800;font-size:16px;margin-bottom:8px}
.pro-list{margin:0 0 12px;padding-left:18px;color:var(--muted);font-size:14px}.pro-list li{padding:2px 0}
.flex{display:flex;gap:8px;flex-wrap:wrap;align-items:center}

.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%) translateY(10px);background:#222d3a;color:#fff;padding:10px 16px;border-radius:999px;font-size:14px;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;z-index:50;max-width:90%}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
@media (max-width:560px){.hdr-grid{grid-template-columns:1fr}}

#print-area{display:none}
@media print{
  @page{size:A4;margin:12mm}
  body{background:#fff}
  #app,.toolbar,.app-ui,.toast{display:none !important}
  #print-area{display:block}
  .sheet{color:#000;font-size:11px}
  .sheet-title{font-size:18px;text-align:center;margin:0 0 8px;border-bottom:2px solid #000;padding-bottom:6px}
  .sheet-meta,.sheet-foot{width:100%;border-collapse:collapse;margin-bottom:8px}
  .sheet-meta th,.sheet-meta td,.sheet-foot th,.sheet-foot td{border:1px solid #555;padding:4px 8px;font-size:10.5px;text-align:left}
  .sheet-meta th,.sheet-foot th{background:#f0f0f0;width:96px;white-space:nowrap}
  .sheet-items{width:100%;border-collapse:collapse;margin-bottom:8px}
  .sheet-items th,.sheet-items td{border:1px solid #555;padding:6px 8px;vertical-align:top}
  .sheet-items thead th{background:#f0f0f0;font-size:10.5px}
  .sheet-items .c-no{width:30px;text-align:center}
  .sheet-items tbody tr{page-break-inside:avoid}
  .sheet-note{font-size:9.5px;color:#333;margin-top:6px}
  .sheet-credit{margin-top:10px;text-align:right;font-size:9px;color:#999}
}
