/* UX round 1: main-screen re-layout (R1), grouped top navigation (R2), 今月やること (R3),
   action buttons with labels / 「済」 / tooltips (R4), readable staff cards (R5), 翌月へのまとめ (R6),
   はじめてガイド (R7). Loaded after style.css / phase1.css / extras.css and overrides them. */

/* ---------------- top navigation ---------------- */
.topbar { gap: 6px; padding: 0 6px; align-items: flex-start; z-index: 15; }
.navfill { flex: 1; }
.navgroup { position: relative; flex: 0 0 auto; }
.topbar .navbtn { flex: 0 0 auto; }
.topbar .navbtn, .navbtn {
  height: 40px; min-width: 132px; padding: 0 18px; border: 1px solid #A8DDD7; border-top: 0; border-radius: 0 0 12px 12px; background: #fff;
  box-shadow: 0 4px 0 #5FA79E; font-weight: 700; color: var(--c-teal-700); cursor: pointer; font-size: 16px; position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
}
.navbtn:hover, .navgroup.open > .navbtn { color: var(--c-hover-exec); }
.navgroup.open > .navbtn { background: #FFF8E8; }
.navbtn .caret { font-size: 11px; transition: transform .12s; }
.navgroup.open .caret { transform: rotate(180deg); }
.topbar .navbtn .badge, .topbar .navitem .badge { min-width: 20px; height: 20px; border-radius: 10px; background: var(--c-warn); color: #fff; font-size: 12px; line-height: 20px; padding: 0 5px; text-align: center; }
.topbar .navbtn .badge { position: absolute; right: -4px; top: 2px; }
.topbar .navitem .badge { position: static; }
.navmenu {
  position: absolute; left: 0; top: 46px; min-width: 210px; padding: 6px; background: #fff; border-radius: 10px; border: 2px solid var(--c-accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22); display: flex; flex-direction: column; gap: 2px; z-index: 40;
}
.navmenu[hidden] { display: none; }
.topbar .navitem, .navitem {
  flex: none; box-shadow: none; position: static;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 40px; padding: 0 14px; border: 0; border-radius: 8px;
  background: transparent; text-align: left; font-size: 16px; font-weight: 700; color: var(--c-teal-800); cursor: pointer; white-space: nowrap;
}
.topbar .navitem:hover, .topbar .navitem:focus-visible { background: #FFF3D6; color: #A05C00; outline: none; }

/* ---------------- left column ---------------- */
.monthcard { position: absolute; left: 8px; top: 52px; width: 372px; height: 188px; }
.monthcard .thumb { position: absolute; left: 7px; top: 7px; width: 130px; height: 174px; overflow: hidden; border-radius: 6px; }
.monthcard .topicarea { position: absolute; left: 146px; top: 8px; width: 218px; height: 172px; }
.monthcard .topicarea .tag { font-size: 14px; }
.monthcard .topicarea .text { font-size: 15px; line-height: 1.6; padding: 8px 10px; }
.monthcard .topicarea .ymline { margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--c-teal-700); font-weight: 700; }

.todo { position: absolute; left: 388px; top: 52px; width: 380px; height: 188px; padding: 7px 10px 6px; display: flex; flex-direction: column; z-index: 5; }
.todo.expanded { height: auto; max-height: 470px; box-shadow: 0 10px 24px rgba(0, 0, 0, .25); z-index: 12; }
.todo-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 4px; height: 22px; }
.todo-title { margin: 0; font-size: 16px; font-weight: 900; color: var(--c-teal-800); display: flex; align-items: center; gap: 6px; }
.todo-title::before { content: ""; width: 6px; height: 16px; border-radius: 3px; background: var(--c-hover-exec); }
.todo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; min-height: 0; overflow: auto; flex: 1; }
.todo-btn {
  width: 100%; display: grid; grid-template-columns: 20px 1fr 12px; align-items: center; gap: 6px; padding: 0 8px; height: 27px;
  border: 0; border-radius: 6px; background: rgba(255, 255, 255, .85); text-align: left; font-size: 15px; color: var(--c-text); cursor: pointer;
}
.todo-btn:hover, .todo-btn:focus-visible { background: #FFF3D6; }
.todo-text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.todo-ico { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 900; color: #fff; background: var(--c-accent); }
.todo-go { color: var(--c-teal-600); font-weight: 900; }
.l-danger .todo-btn { background: #FFECEB; }
.l-danger .todo-ico { background: var(--c-warn); }
.l-danger .todo-text { font-weight: 700; color: #9a1c14; }
.l-warn .todo-ico { background: #F5A623; }
.l-warn .todo-text { font-weight: 700; }
.l-done .todo-ico { background: #2FA37A; }
.todo-more { border: 0; background: none; color: var(--c-link); font-size: 13px; font-weight: 700; cursor: pointer; padding: 0 4px; }
.todo-more[hidden] { display: none; }

/* lower-left: 社員ボード gets most of the column */
.lower { top: 248px; height: 464px; }
.ltab { height: 30px; font-size: 15px; }
.lowertabs { height: 32px; }
.board-legend { display: flex; gap: 6px; align-items: center; padding-bottom: 5px; margin-right: 8px; }
.board-legend .lg { font-size: 13px; font-weight: 700; padding: 0 8px; border-radius: 4px; border: 2px solid; background: #fff; }
.board-legend .lg.standby { border-color: #F5A623; color: #A05C00; }
.board-legend .lg.zero { border-color: var(--c-warn); color: #9a1c14; }
.board-sel { font-size: 14px; height: 27px; }
.board-grid { gap: 7px; }
.scard { gap: 3px; padding: 6px 9px; font-size: 13px; line-height: 1.4; }
.sc-name { font-size: 16px; }
.sc-role { font-size: 13px; }
.sc-assign { font-size: 13px; }
.sc-tanka { font-size: 13px; }
.sc-tanka b { font-size: 15px; }
.sc-motv { font-size: 13px; }
.sc-rank { font-size: 14px; }
.sc-bar { height: 7px; }
.sc-skill { display: flex; gap: 10px; font-size: 13px; color: #345; min-width: 0; white-space: nowrap; overflow: hidden; }
.sc-sk { display: inline-flex; align-items: baseline; gap: 3px; min-width: 0; }
.sc-skn { white-space: nowrap; }
.sc-sk b { font-variant-numeric: tabular-nums; color: var(--c-teal-800); margin: 0; }
.sc-foot { font-size: 13px; }
.infolog { font-size: 15px; }
.infolog .ym { font-size: 13px; }

/* staff card tooltip */
.sctip { min-width: 260px; }
.sctip-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sctip-sub { font-size: 13px; color: #456; margin: 2px 0 6px; }
.sctip-grid { display: grid; gap: 2px; }
.sctip-row { display: grid; grid-template-columns: 96px 1fr 28px; gap: 6px; align-items: center; font-size: 13px; }
.sctip-bar { height: 8px; border-radius: 4px; background: #E0F5F2; overflow: hidden; }
.sctip-bar i { display: block; height: 100%; background: linear-gradient(90deg, #5ECFC4, #3AB8AA); }
.sctip-row b { text-align: right; font-variant-numeric: tabular-nums; }
.sctip-foot { margin-top: 6px; font-size: 12px; color: var(--c-teal-700); }
.htip { max-width: 420px; }

/* ---------------- right column ---------------- */
.plate .name { font-size: 22px; }
.staffline { font-size: 14px; }
.staffline .standby b { color: #C26A00; }
.counter .sub { font-size: 12px; }
.rank .n { font-size: 13px; }

/* actions: icon of the original image + our label, 「済」 / off states */
.actbtn {
  background: no-repeat 0 0 / 153px 41px; border-radius: 8px; overflow: hidden;
}
.actbtn .act-lbl {
  position: absolute; left: 47px; right: 4px; top: 4px; bottom: 4px; display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 0 6px 6px 0; font-size: 15px; font-weight: 700; color: #2b3b3a; letter-spacing: .02em; white-space: nowrap;
}
.actbtn:hover:not(.off) .act-lbl, .actbtn:focus-visible .act-lbl { color: var(--c-hover-exec); }
.actbtn:hover:not(.off) { filter: brightness(1.04) drop-shadow(0 0 3px var(--c-hover-exec)); }
.actbtn .act-done { display: none; position: absolute; right: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #E08A00; color: #fff; font-size: 13px; font-weight: 900; line-height: 22px; text-align: center; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.actbtn.used .act-done { display: block; }
.actbtn.off { cursor: default; filter: grayscale(1); opacity: .5; }
.actbtn.used { opacity: .62; }
.actions.flash .actiongrid { animation: actFlash 1s ease-out; border-radius: 10px; }
@keyframes actFlash { 0%, 40% { box-shadow: 0 0 0 4px var(--c-hover-exec); } 100% { box-shadow: 0 0 0 0 transparent; } }
.autoquiz { font-size: 14px; }

/* action tooltip */
.acttip { font-size: 14px; }
.acttip-dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 6px 0 4px; }
.acttip-dl dt { font-weight: 900; color: var(--c-teal-700); white-space: nowrap; }
.acttip-dl dd { margin: 0; }
.tip-done { font-size: 12px; font-weight: 700; color: #fff; background: #E08A00; border-radius: 999px; padding: 0 8px; white-space: nowrap; }
.acttip-off { margin-top: 4px; font-weight: 700; color: var(--c-warn); }
.acttip-once { margin-top: 4px; font-size: 12px; color: #567; }

/* action dialog */
.modal.actdlg .with-pic .pic { width: 260px; height: 310px; position: relative; overflow: hidden; border-radius: 8px; }
.act-text { white-space: pre-line; font-size: 18px; line-height: 1.7; margin: 0 0 6px; background: #fff; border-radius: 8px; padding: 10px 14px; }
.act-text.result { font-size: 19px; }
.act-cost { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 8px 0 0; padding: 8px 12px; border-radius: 8px; background: rgba(255, 255, 255, .6); font-size: 14px; line-height: 1.55; }
.act-cost dt { font-weight: 900; color: var(--c-teal-700); white-space: nowrap; }
.act-cost dd { margin: 0; }

/* ---------------- 翌月へのまとめ (R6): instant texts, fixed primary button ---------------- */
.flowpanel .fl-entry { animation: fadeQuick .12s ease-out; }
.flowpanel .quiz .result { animation: fadeQuick .12s ease-out; }
.flowpanel .quiz .explain { animation: none; }
@keyframes fadeQuick { from { opacity: .4; } to { opacity: 1; } }
.fl-now { overflow: hidden; }
.fl-content { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.fl-foot { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 14px; height: 60px; padding-top: 10px; border-top: 1px solid rgba(42, 110, 102, .2); margin-top: 8px; }
.fl-foot .btn { height: 46px; font-size: 17px; }
.fl-foot .btn.fl-primary { order: 9; width: 240px; min-width: 240px; }
.fl-foot .fl-foot-hint { margin-right: auto; font-size: 14px; color: var(--c-teal-700); }
.fl-text { max-height: none; }
.fl-step { min-height: 0; }

/* ---------------- はじめてガイド (R7) ---------------- */
.modal-back.tour { background: transparent; display: block; z-index: 60; }
.tour-spot { position: absolute; border-radius: 12px; box-shadow: 0 0 0 4px var(--c-hover-exec), 0 0 0 1600px rgba(10, 40, 36, .55); pointer-events: none; transition: left .2s, top .2s, width .2s, height .2s; }
.tour-bubble { position: absolute; background: #fff; border-radius: 14px; padding: 16px 20px 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); border: 3px solid var(--c-hover-exec); }
.tour-count { font-size: 13px; font-weight: 700; color: #A05C00; }
.tour-h { margin: 2px 0 6px; font-size: 21px; font-weight: 900; color: var(--c-teal-800); }
.tour-text { margin: 0 0 12px; font-size: 16px; line-height: 1.65; }
.tour-btns { display: flex; align-items: center; gap: 8px; }
.tour-fill { flex: 1; }
.tour-btns .btn.primary { min-width: 120px; }
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }
