:root{
  --bg:#0b1220;
  --card:#121a2b;
  --text:#e8eefc;
  --muted:#a9b6d6;
  --line:rgba(255,255,255,.08);
  --accent:#7aa7ff;
  --accent2:#7dffa8;
  --danger:#ff6b6b;
  --radius:18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(122,167,255,.15), transparent 60%),
              radial-gradient(900px 500px at 80% 10%, rgba(125,255,168,.12), transparent 60%),
              var(--bg);
  color:var(--text);
}

a{color:inherit;text-decoration:none}
.container{width:min(1100px, 92vw); margin:0 auto}

.topbar{
  position:sticky; top:0; z-index:50;
  backdrop-filter: blur(10px);
  background: rgba(11,18,32,.7);
  border-bottom:1px solid var(--line);
}
.topbar__inner{display:flex; align-items:center; justify-content:space-between; padding:14px 0; gap:10px}
.brand{font-weight:900; letter-spacing:.3px}
.nav{display:flex; gap:12px; flex-wrap:wrap}
.nav a{padding:8px 10px; border:1px solid transparent; border-radius:999px; color:var(--muted)}
.nav a:hover{border-color:var(--line); color:var(--text)}

.hero{display:grid; grid-template-columns: 1.2fr .8fr; gap:18px; padding:20px 0 24px}
@media (max-width: 900px){
  .hero{grid-template-columns:1fr}
}

.title{font-size: clamp(26px, 3.6vw, 40px); margin: 12px 0 6px}
.subtitle{margin:0 0 14px; color:var(--muted)}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
  padding:16px;
}

.h2{margin:0 0 10px; font-size:18px}

.grid2{display:grid; grid-template-columns: 1fr 1fr; gap:10px; align-items:end}
@media (max-width: 520px){ .grid2{grid-template-columns:1fr} }

.field{display:flex; flex-direction:column; gap:6px; color:var(--muted); font-weight:800}
.field input,.field select{
  padding:12px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  color:var(--text);
  font-weight:900;
}

.toggle{
  display:flex; align-items:center; gap:10px;
  color:var(--muted); font-weight:800;
  padding:10px 0;
}
.toggle input{transform: translateY(1px)}

.row{display:flex; gap:10px; flex-wrap:wrap; margin-top:12px}

.btn{
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  color:var(--text);
  padding:12px 12px;
  border-radius: 14px;
  font-weight:900;
}
.btn:hover{border-color: rgba(255,255,255,.18)}
.btn:active{transform: translateY(1px)}
.btn-primary{border-color: rgba(125,255,168,.5); background: rgba(125,255,168,.12)}
.btn-danger{border-color: rgba(255,107,107,.45); background: rgba(255,107,107,.08); color: #ffd7d7}

.btn-small{
  padding:10px 12px;
  border-radius:12px;
  font-weight:900;
}

.small{color:var(--muted); line-height:1.6; margin:10px 0 0}

/* ---- Result header / pills ---- */
.resultHeader{
  display:flex; align-items:flex-start; justify-content:space-between; gap:10px;
}
.resultActions{
  display:flex;
  align-items:flex-start;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}
.pillRow{display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end}
.pill{
  border:1px solid var(--line);
  background: rgba(0,0,0,.12);
  color:var(--muted);
  padding:8px 10px;
  border-radius:999px;
  font-weight:900;
  font-size: 12px;
}
.pill.is-active{color:var(--text); border-color: rgba(122,167,255,.55); background: rgba(122,167,255,.12)}

.summary{
  margin:10px 0 8px;
  color:var(--muted);
  font-weight:800;
}

/* ---- Checklist items ---- */
.checklist{list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:10px}
.item{
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  background: rgba(0,0,0,.12);
  display:grid;
  grid-template-columns: auto 1fr auto;
  gap:10px;
  align-items:start;
}
.item input{width:20px; height:20px; margin-top:2px}
.item .main{min-width:0}
.item .titleLine{display:flex; gap:10px; flex-wrap:wrap; align-items:baseline}
.item .date{
  font-weight:1000;
  letter-spacing:.2px;
}
.item .text{font-weight:950}
.item .meta{margin-top:6px; color:var(--muted); font-weight:800; font-size:12px}

.badge{
  border:1px solid var(--line);
  border-radius:999px;
  padding:6px 10px;
  font-weight:950;
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
}
.badge.cat-ward{border-color: rgba(122,167,255,.45); background: rgba(122,167,255,.10)}
.badge.cat-life{border-color: rgba(125,255,168,.45); background: rgba(125,255,168,.10)}
.badge.cat-pack{border-color: rgba(255,240,122,.35); background: rgba(255,240,122,.08)}
.badge.cat-mail{border-color: rgba(255,186,122,.35); background: rgba(255,186,122,.08)}
.badge.cat-money{border-color: rgba(255,107,107,.40); background: rgba(255,107,107,.07)}
.badge.cat-day{border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.05)}

/* right container (badge + delete btn for custom) */
.item .right{
  display:flex;
  align-items:center;
  gap:8px;
}
.iconBtn{
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  color:var(--text);
  width:40px;
  height:40px;
  border-radius:12px;
  display:grid;
  place-items:center;
  font-weight:1000;
}
.iconBtn:hover{border-color: rgba(255,255,255,.18)}
.iconBtn.danger{
  border-color: rgba(255,107,107,.45);
  background: rgba(255,107,107,.08);
  color: #ffd7d7;
}

/* ---- Custom form ---- */
.customForm{
  margin: 10px 0 12px;
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  background: rgba(0,0,0,.12);
}
.customForm.is-hidden{ display:none; }

.customGrid{
  display:grid;
  grid-template-columns: 1.2fr .8fr .8fr;
  gap:10px;
  align-items:end;
}
@media (max-width: 720px){
  .customGrid{ grid-template-columns: 1fr; }
}

/* ---- Office plan block ---- */
.officePlan{
  margin: 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(122,167,255,.08);
}
.officePlan .titleRow{
  display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;
}
.officePlan .title{
  margin:0;
  font-size: 14px;
  font-weight: 950;
  color: var(--text);
}
.officePlan .tag{
  font-size: 12px;
  color: var(--muted);
  font-weight: 900;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(0,0,0,.10);
}
.officePlan ul{
  margin:10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.9;
}
.officePlan .note{
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

/* 役所セット印刷ボタン（画面表示時） */
.officePrintBtn{
  margin-top: 10px;
  display:flex;
  justify-content:flex-end;
}

/* 印刷用ヘッダ（通常は非表示） */
.officePrintHeader{
  display:none;
  margin-bottom: 10px;
  border-bottom: 1px solid #000;
  padding-bottom: 6px;
}
.officePrintTitle{
  font-size: 18px;
  font-weight: 900;
}
.officePrintMeta{
  font-size: 12px;
  margin-top: 4px;
  color: #333;
}

/* ---- Ads ---- */
.adCard{padding:14px}
.adLabel{font-size:12px; letter-spacing:.2px; color:var(--muted); font-weight:900; margin-bottom:8px}
.adBox{
  min-height: 140px;
  display:grid; place-items:center;
  border:1px dashed rgba(255,255,255,.18);
  border-radius: 14px;
  background: rgba(0,0,0,.12);
  overflow:hidden;
}
.adBox.tall{min-height: 240px}
.adInline{margin-top:16px}

/* ---- Aside / pages ---- */
.bullets{color:var(--muted); line-height:1.9; margin:0; padding-left:18px}
.link{display:inline-block; margin-top:10px; color:var(--accent); font-weight:950}
.link:hover{text-decoration:underline}

.page{padding:22px 0}

/* ---- Footer ---- */
.footer{
  border-top:1px solid var(--line);
  padding:18px 0 26px;
  color:var(--muted);
}
.footer__inner{display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap}
.footer__links{display:flex; gap:14px; flex-wrap:wrap}
.footer__links a:hover{color:var(--text)}

/* ---- Print base ---- */
@media print{
  .topbar, .hero__right, .adCard, .adInline, #btnShare, #btnClear{ display:none !important; }
  body{ background:#fff; color:#000; }
  .card, .item{ box-shadow:none; }
  .badge{ color:#000; }
}

/* ---- PrintOffice mode: show only office plan + pack checklist ---- */
@media print{
  body.printOffice .topbar,
  body.printOffice .hero__right,
  body.printOffice .formCard,
  body.printOffice .adCard,
  body.printOffice .adInline,
  body.printOffice .tipsCard,
  body.printOffice .miniCard,
  body.printOffice #btnShare,
  body.printOffice #btnClear,
  body.printOffice #btnPrint,
  body.printOffice #btnGenerate,
  body.printOffice .resultHeader,
  body.printOffice .checklist,
  body.printOffice .customForm{
    display:none !important;
  }

  body.printOffice .resultCard{
    padding:0 !important;
    border:none !important;
    background: transparent !important;
  }

  body.printOffice #officePlan{
    display:block !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
  }

  /* 印刷時にボタンは消す */
  body.printOffice .officePrintBtn{
    display:none !important;
  }

  /* 印刷モードのときだけ印刷用ヘッダを出す */
  body.printOffice .officePrintHeader{
    display:block !important;
  }
}
