:root{
  --navy: #061B3A;
  --navy-dark: #02060F;
  --gold: #C0488E;
  --bg: #ffffff;
  --card: #fafafa;
  --text: #161616;
  --muted: #686868;
  --border: #dddddd;
  --hl: #ececec;
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth; font-size:16px;}
body{
  margin:0;
  font-family: "Yu Mincho","YuMincho","Hiragino Mincho ProN","HGS明朝E",serif;
  font-weight: 600;
  background: var(--bg);
  color: var(--text);
  line-height:1.7;
}

.fontsize-controls{
  position:fixed;
  top:12px;
  right:16px;
  z-index:1000;
  display:flex;
  align-items:center;
  gap:6px;
  background:rgba(255,255,255,.95);
  border:1px solid var(--border);
  border-radius:999px;
  padding:6px 10px;
  box-shadow:0 2px 10px rgba(0,0,0,.18);
}
.fontsize-controls .fs-label{
  font-size:.75rem;
  color:var(--muted);
  margin-right:2px;
  white-space:nowrap;
}
.fontsize-controls button{
  border:1px solid var(--border);
  background:#fff;
  color:var(--navy);
  font-family:inherit;
  font-weight:700;
  border-radius:999px;
  width:30px;
  height:30px;
  cursor:pointer;
  font-size:.8rem;
  line-height:1;
}
.fontsize-controls button.active{
  background:var(--navy);
  color:#fff;
  border-color:var(--navy);
}
@media (max-width:600px){
  .fontsize-controls{top:8px; right:8px; padding:4px 8px;}
  .fontsize-controls .fs-label{display:none;}
  .fontsize-controls button{width:26px; height:26px;}
}

.sync-status{
  position:fixed;
  top:12px;
  left:16px;
  z-index:1000;
  display:flex;
  align-items:center;
  gap:8px;
  background:rgba(255,255,255,.95);
  border:1px solid var(--border);
  border-radius:999px;
  padding:6px 12px;
  box-shadow:0 2px 10px rgba(0,0,0,.18);
  font-size:.78rem;
  color:var(--muted);
}
.sync-dot{
  width:9px;
  height:9px;
  border-radius:50%;
  background:#bbb;
  flex:0 0 auto;
}
.sync-status.ok .sync-dot{background:#2e8b57;}
.sync-status.offline .sync-dot{background:#b3261e;}
.sync-status.saving .sync-dot{background:#C0488E;}
.sync-status button{
  border:1px solid var(--border);
  background:#fff;
  color:var(--navy);
  font-family:inherit;
  font-weight:700;
  border-radius:999px;
  padding:4px 10px;
  cursor:pointer;
  font-size:.75rem;
}
.sync-status button:hover{background:var(--card);}
@media (max-width:600px){
  .sync-status{top:8px; left:8px; padding:4px 8px; font-size:.7rem;}
  .sync-status span#syncStatusText{display:none;}
}

.history-modal{
  position:fixed;
  inset:0;
  z-index:2000;
  background:rgba(0,0,0,.5);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}
.history-modal[hidden]{display:none;}
.history-modal-inner{
  background:#fff;
  border-radius:14px;
  max-width:520px;
  width:100%;
  max-height:80vh;
  overflow-y:auto;
  padding:22px 24px;
  box-shadow:0 10px 40px rgba(0,0,0,.35);
}
.history-modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:6px;
}
.history-modal-head h3{margin:0; color:var(--navy); font-size:1.05rem;}
.history-close{
  border:none;
  background:transparent;
  font-size:1.3rem;
  cursor:pointer;
  color:var(--muted);
  line-height:1;
}
.history-close:hover{color:#b3261e;}
.history-list{list-style:none; margin:14px 0 0; padding:0;}
.history-list li{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  border:1px solid var(--border);
  border-radius:8px;
  padding:10px 12px;
  margin-bottom:8px;
  font-size:.88rem;
}
.history-list .history-restore-btn{
  border:none;
  border-radius:6px;
  background:var(--navy);
  color:#fff;
  padding:6px 14px;
  font-family:inherit;
  font-weight:700;
  cursor:pointer;
  font-size:.8rem;
  white-space:nowrap;
}
.history-list .history-restore-btn:hover{background:var(--navy-dark);}

.hero{
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color:#fff;
  padding: 56px 20px 40px;
  text-align:center;
  border-bottom: 4px solid var(--gold);
}
.hero-inner{max-width:900px;margin:0 auto;}
.eyebrow{
  letter-spacing:.08em;
  font-size:.85rem;
  color: var(--gold);
  margin:0 0 10px;
  font-weight:600;
}
.hero h1{
  font-size:1.9rem;
  font-weight:800;
  letter-spacing:.04em;
  margin:0 0 18px;
  line-height:1.5;
}
.hero-meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px 18px;
  justify-content:center;
  font-size:.95rem;
}
.hero-meta span{
  background:rgba(255,255,255,.12);
  padding:6px 14px;
  border-radius:999px;
}

.topnav{
  position:sticky;
  top:0;
  z-index:10;
  background: var(--navy);
  border-bottom:3px solid var(--gold);
}
.topnav-inner{
  max-width:1100px;
  margin:0 auto;
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
}
.topnav a{
  color:#fff;
  text-decoration:none;
  white-space:nowrap;
  padding:10px 12px;
  font-size:.9rem;
  font-weight:600;
  opacity:.85;
}
.topnav a:hover{opacity:1; background:rgba(255,255,255,.08);}
.topnav a.active{opacity:1; color:var(--gold); border-bottom:3px solid var(--gold);}

main{max-width:1100px; margin:0 auto; padding:10px 20px 60px;}

.sec{padding:48px 0; display:none;}
.sec.active{display:block;}
.sec.alt{
  background: var(--card);
  margin:0 -20px;
  padding:48px 20px;
  border-radius:18px;
}
.sec.alt.active{display:block;}

h2{
  font-size:1.4rem;
  font-weight:800;
  letter-spacing:.03em;
  color: var(--navy);
  border-bottom:3px solid var(--gold);
  padding-bottom:10px;
  margin:0 0 24px;
}
h2 .num{
  display:inline-block;
  background:var(--navy);
  color:#fff;
  width:1.8em;
  height:1.8em;
  line-height:1.8em;
  text-align:center;
  border-radius:50%;
  margin-right:10px;
  font-size:.9em;
}

.lead{font-weight:600; color:var(--navy); margin-top:0;}
.lead.small{font-size:.9rem; color:var(--muted); font-weight:500;}

.card-row{
  display:flex;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom:24px;
}
.stat-card{
  background:var(--card);
  border:1px solid var(--border);
  border-top:4px solid var(--gold);
  border-radius:12px;
  padding:18px 22px;
  flex:1 1 180px;
  box-shadow:0 2px 6px rgba(0,37,139,.06);
}
.sec.alt .stat-card{background:var(--bg);}
.stat-label{font-size:.85rem; color:var(--muted); margin-bottom:6px;}
.stat-value{font-size:1.5rem; font-weight:800; color:var(--navy);}

.table-wrap{overflow-x:auto; margin-bottom:24px;}
table{
  width:100%;
  border-collapse:collapse;
  background:var(--card);
  border-radius:10px;
  overflow:hidden;
  font-size:.92rem;
  min-width:560px;
}
thead th{
  background:var(--navy);
  color:#fff;
  text-align:left;
  padding:10px 12px;
  font-weight:600;
  white-space:nowrap;
}
tbody td, tfoot td{
  padding:9px 12px;
  border-bottom:1px solid var(--border);
  vertical-align:top;
}
tbody tr:nth-child(even){background:rgba(0,0,0,.03);}
tbody tr.hl{background:var(--hl);}
tfoot td{
  font-weight:700;
  background: var(--navy);
  color:#fff;
  border-bottom:none;
}

.confirm-price{
  width:90px;
  padding:6px 8px;
  border:1px solid var(--border);
  border-radius:6px;
  font-family:inherit;
  font-size:.88rem;
  background:#fffdf2;
}
.confirm-price:focus{outline:2px solid var(--gold); border-color:var(--gold);}

.memo-input{
  width:100%;
  min-width:140px;
  padding:6px 8px;
  border:1px solid var(--border);
  border-radius:6px;
  font-family:inherit;
  font-size:.85rem;
  background:#fffdf2;
  resize:vertical;
}
textarea.memo-input{
  overflow:hidden;
  resize:none;
  box-sizing:border-box;
}
.memo-input:focus{outline:2px solid var(--gold); border-color:var(--gold);}

.li-memo{
  display:block;
  max-width:480px;
  margin:6px 0 2px;
}
.box-memo{
  display:block;
  max-width:480px;
  margin-top:10px;
}

.equip-add-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  margin:-8px 0 24px;
  padding:12px;
  background:var(--card);
  border:1px dashed var(--border);
  border-radius:10px;
}
.sec.alt .equip-add-row{background:var(--bg);}
.equip-add-row .ea-field{
  flex:1 1 120px;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:6px;
  font-family:inherit;
  font-size:.9rem;
}
.equip-add-row .ea-add-btn{
  padding:8px 18px;
  border:none;
  border-radius:6px;
  background:var(--navy);
  color:#fff;
  font-family:inherit;
  font-weight:700;
  cursor:pointer;
  font-size:.88rem;
}
.equip-add-row .ea-add-btn:hover{background:var(--navy-dark);}

.equip-row-del{
  border:none;
  background:transparent;
  color:var(--muted);
  font-size:1rem;
  cursor:pointer;
  margin-left:6px;
}
.equip-row-del:hover{color:#b3261e;}

.timeline-block{margin-bottom:32px;}
.tl-head{
  display:inline-block;
  background:var(--gold);
  color:var(--navy-dark);
  padding:6px 16px;
  border-radius:999px;
  font-size:1rem;
  margin:0 0 14px;
  font-weight:700;
}

.photo-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(110px,1fr));
  gap:14px;
  margin:0 0 24px;
}
.photo-grid figure{
  margin:0;
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px;
  text-align:center;
}
.sec.alt .photo-grid figure{background:#fff;}
.row-thumb-wrap{
  position:relative;
  display:inline-block;
  vertical-align:middle;
  margin-right:8px;
  line-height:0;
}
.row-thumb{
  width:30px;
  height:30px;
  object-fit:contain;
  border:1px solid var(--border);
  border-radius:5px;
  background:#fff;
  cursor:zoom-in;
  vertical-align:middle;
}
.row-thumb-zoom{display:none;}

.thumb-float-preview{
  display:none;
  position:fixed;
  z-index:999;
  width:85px;
  height:auto;
  border:1px solid var(--border);
  border-radius:8px;
  background:#fff;
  padding:5px;
  box-shadow:0 6px 20px rgba(0,0,0,.3);
  pointer-events:none;
}
.thumb-float-preview img{
  display:block;
  width:100%;
  height:auto;
}
.thumb-float-preview.show{display:block;}

.photo-grid a{display:block;}
.photo-grid img{
  max-width:100%;
  height:90px;
  object-fit:contain;
  display:block;
  margin:0 auto 8px;
  cursor:pointer;
  transition:transform .15s ease;
}
.photo-grid a:hover img{transform:scale(1.06);}
.photo-grid figcaption{
  font-size:.78rem;
  color:var(--muted);
  line-height:1.4;
}

.note-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(280px,1fr));
  gap:18px;
  margin-bottom:18px;
}
.note-box{
  background:var(--card);
  border:1px solid var(--border);
  border-left:4px solid var(--navy);
  border-radius:10px;
  padding:18px 20px;
}
.sec.alt .note-box{background:var(--bg);}
.note-box.wide{grid-column:1/-1;}
.note-box h3{
  margin:0 0 10px;
  font-size:1rem;
  color:var(--navy);
}
.note-box ul, .note-box ol{margin:0; padding-left:1.3em;}
.note-box li{margin-bottom:6px; font-size:.92rem;}
.note-box p{margin:0 0 8px; font-size:.92rem;}
.note-box .muted{color:var(--muted); font-size:.85rem;}

.legend{font-size:.85rem; color:var(--muted);}

.todo-form{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:22px;
}
.todo-form input[type="text"]{
  flex:1 1 240px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:8px;
  font-family:inherit;
  font-size:.95rem;
}
.todo-form input[type="date"]{
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:8px;
  font-family:inherit;
  font-size:.95rem;
}
.todo-form button{
  padding:10px 22px;
  border:none;
  border-radius:8px;
  background:var(--navy);
  color:#fff;
  font-family:inherit;
  font-weight:700;
  cursor:pointer;
  font-size:.95rem;
}
.todo-form button:hover{background:var(--navy-dark);}

.todo-list{list-style:none; margin:0 0 10px; padding:0;}
.todo-list li{
  display:flex;
  align-items:center;
  gap:12px;
  background:var(--card);
  border:1px solid var(--border);
  border-left:4px solid var(--navy);
  border-radius:10px;
  padding:12px 14px;
  margin-bottom:10px;
}
.sec.alt .todo-list li{background:var(--bg);}
.todo-list li.done{opacity:.55;}
.todo-list li.done .todo-text{text-decoration:line-through;}
.todo-list li.overdue{border-left-color:#b3261e;}
.todo-list .todo-text{flex:1 1 auto; font-size:.95rem; word-break:break-word;}
.todo-list .todo-due{
  font-size:.8rem;
  color:var(--muted);
  white-space:nowrap;
}
.todo-list li.overdue .todo-due{color:#b3261e; font-weight:700;}
.todo-list .todo-del{
  border:none;
  background:transparent;
  color:var(--muted);
  font-size:1.1rem;
  cursor:pointer;
  line-height:1;
  padding:4px 6px;
}
.todo-list .todo-del:hover{color:#b3261e;}
.todo-list input[type="checkbox"]{
  width:18px;
  height:18px;
  cursor:pointer;
  flex:0 0 auto;
}
.todo-list .todo-edit{
  border:none;
  background:transparent;
  color:var(--navy);
  font-size:.85rem;
  cursor:pointer;
  line-height:1;
  padding:4px 8px;
  white-space:nowrap;
}
.todo-list .todo-edit:hover{text-decoration:underline;}
.todo-list li.editing{flex-wrap:wrap;}
.todo-list li.editing .todo-edit-text{
  flex:1 1 160px;
  padding:6px 8px;
  border:1px solid var(--border);
  border-radius:6px;
  font-size:.95rem;
}
.todo-list li.editing .todo-edit-due{
  padding:6px 8px;
  border:1px solid var(--border);
  border-radius:6px;
  font-size:.85rem;
}
.todo-list .todo-edit-save,
.todo-list .todo-edit-cancel{
  border:none;
  border-radius:6px;
  padding:6px 10px;
  font-size:.85rem;
  cursor:pointer;
}
.todo-list .todo-edit-save{background:var(--navy); color:#fff;}
.todo-list .todo-edit-save:hover{background:var(--navy-dark);}
.todo-list .todo-edit-cancel{background:transparent; color:var(--muted);}
.todo-list .todo-edit-cancel:hover{color:#b3261e;}

.site-footer{
  text-align:center;
  padding:26px 20px 40px;
  color:var(--muted);
  font-size:.85rem;
}

@media (max-width:600px){
  .hero h1{font-size:1.4rem;}
  h2{font-size:1.2rem;}
}

/* ⑩ R8反省メモ */
.r8n-toolbar{display:flex; align-items:center; gap:10px; margin:0 0 14px;}
.r8n-toolbar button{padding:8px 14px; border:1px solid var(--navy); background:var(--bg); color:var(--navy); border-radius:6px; font-size:.9rem; cursor:pointer;}
.r8n-toolbar button:hover{background:var(--navy); color:#fff;}
.r8n-copy-msg{color:var(--gold); font-size:.85rem;}
.r8n-grid{display:grid; grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); gap:14px;}
.r8n-card{background:var(--bg); border:1px solid var(--border); border-top:4px solid var(--navy); border-radius:8px; padding:12px 14px;}
.r8n-card.r8n-wide{grid-column:1 / -1; border-top-color:var(--gold);}
.r8n-card h3{margin:0 0 8px; font-size:1rem; color:var(--navy);}
.r8n-list{list-style:none; margin:0 0 10px; padding:0;}
.r8n-list li{display:flex; align-items:flex-start; gap:6px; padding:6px 0; border-bottom:1px dashed var(--border);}
.r8n-list li::before{content:"・"; flex:0 0 auto; color:var(--navy); font-weight:700;}
.r8n-text{flex:1 1 auto; font-size:.95rem; word-break:break-word; cursor:pointer;}
.r8n-time{flex:0 0 auto; font-size:.75rem; color:var(--muted); padding-top:2px;}
.r8n-del{flex:0 0 auto; border:none; background:transparent; color:var(--muted); font-size:1.1rem; line-height:1; cursor:pointer; padding:0 4px;}
.r8n-del:hover{color:#b3261e;}
.r8n-edit{flex:1 1 auto; padding:6px 8px; border:1px solid var(--navy); border-radius:4px; font-size:.95rem; min-width:0;}
.r8n-form{display:flex; gap:6px;}
.r8n-form input{flex:1 1 auto; min-width:0; padding:9px 10px; border:1px solid var(--border); border-radius:6px; font-size:16px;}
.r8n-form button{flex:0 0 auto; padding:9px 14px; border:none; background:var(--navy); color:#fff; border-radius:6px; font-size:.9rem; cursor:pointer;}
.r8n-form button:hover{background:var(--navy-dark);}
@media (max-width:600px){ .r8n-grid{grid-template-columns:1fr;} }
