/* =========================
   Styles.css
========================= */

:root{
  --blue:#0563C1;
  --green:#006E4F;
  --blue-deep:#044f9a;

  --bg:#f3f5f8;
  --panel:#ffffff;
  --panel2:#fafbfc;
  --text:#0f172a;
  --muted:#516076;
  --line:rgba(15,23,42,.12);

  --radius:8px;
  --radius-sm:6px;
  --shadow: 0 10px 26px rgba(15,23,42,.08);

  --fs-base:17px;
  --fs-sm:15px;
  --fs-xs:14px;
  --fs-lg:20px;

  --w-regular:400;
  --w-medium:500;
  --w-semi:600;
  --week-header-h: 44px;

  --font-base:
    "BIZ UDPShinGo",
    Bahnschrift,
    "UDShinGo",
    system-ui,
    "Noto Sans JP",
    sans-serif;

  --font-display:
    "BIZ UDPShinGo",
    Bahnschrift,
    "UDShinGo",
    system-ui,
    "Noto Sans JP",
    sans-serif;

  --cell-minh: 180px;

  --z-modal: 50;
  --z-menu: 60;

  /* calendar shared sizing */
  --halfH: 36px;
  --hourH: calc(var(--halfH) * 2);
  --dayH: calc(var(--hourH) * 24);

  --dsTimeW: 64px;
  --dsColMinW: 260px;

  /* week view / daily shared scrollbar compensation */
  --sbw: 0px;
}

/* =========================
   Base / Layout
========================= */
*{ box-sizing:border-box; }

html,
body{
  height:100%;
  overflow:auto;
}

body{
  margin:0;
  font-family: var(--font-base);
  font-size: var(--fs-base);
  font-weight: var(--w-regular);
  letter-spacing:.2px;
  background: var(--bg);
  color: var(--text);
}

.appShell{
  height:100vh;
  display:flex;
  background: var(--bg);
}

/* =========================
   Sidebar
========================= */
.sideMenu.fixed{
  position: sticky;
  top: 0;
  height: 100vh;
  width: 260px;
  flex: 0 0 260px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  box-shadow: none;
  transform: none;
}

.sideMenu{
  padding: 14px;
  display:flex;
  flex-direction:column;
  gap:12px;
}

.sideHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding-bottom:10px;
  border-bottom:1px solid rgba(15,23,42,.08);
}

.sideTitle{
  font-size:16px;
  font-weight: var(--w-medium);
  color: rgba(15,23,42,.78);
}

.sideList{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.sideItem{
  text-align:left;
  width:100%;
  padding:10px 12px;
  border-radius: var(--radius-sm);
  border:1px solid rgba(15,23,42,.10);
  background:#fff;
  color: rgba(15,23,42,.80);
  font-weight: var(--w-medium);
  font-size:13px;
}

.sideItem:disabled{
  opacity:.65;
  cursor:not-allowed;
}

.sideItem:not(:disabled):hover{
  background: rgba(5,99,193,.06);
  border-color: rgba(5,99,193,.18);
}

.sideFoot{
  margin-top:auto;
  padding-top:10px;
  border-top:1px solid rgba(15,23,42,.08);
}

.sideNote{
  font-size:13px;
  color: rgba(81,96,118,.70);
}

.userBox{
  margin-top:auto;
  padding:12px;
  border-top:1px solid rgba(15,23,42,.08);
}

.userBoxInner{
  border:1px solid rgba(15,23,42,.10);
  background:#fff;
  border-radius:14px;
  padding:12px;
  display:grid;
  grid-template-columns:38px 1fr;
  gap:10px;
  align-items:center;
  box-shadow: 0 8px 20px rgba(15,23,42,.06);
}

.userBoxInner::before{
  content: attr(data-initial);
  width:38px;
  height:38px;
  border-radius:999px;
  display:grid;
  place-items:center;
  font-weight:800;
  color: rgba(255,255,255,.95);
  background: linear-gradient(135deg, rgba(5,99,193,.95), rgba(0,110,79,.95));
  letter-spacing:.5px;
}

.userName{
  font-weight:800;
  font-size:14px;
  line-height:1.2;
  color: rgba(15,23,42,.92);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.userSub{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-top:2px;
}

.userSub .pill{
  font-size:11px;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.12);
  background: rgba(15,23,42,.04);
  color: rgba(15,23,42,.70);
}

/* =========================
   Main area
========================= */
.mainArea{
  flex:1;
  min-width:0;
  height:100vh;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  width:100%;
  align-items:stretch;
  padding:16px;
}

/* =========================
   Buttons
========================= */
button{
  appearance:none;
  border:1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding:10px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  font-weight: var(--w-medium);
  cursor:pointer;
  transition: background .15s ease, border-color .15s ease, transform .06s ease;
}

button:hover{
  background:#f6f8fb;
  border-color: rgba(15,23,42,.18);
}

button:active{
  transform: translateY(1px);
}

.primary{
  border-color: rgba(5,99,193,.35);
  background: linear-gradient(135deg, rgba(5,99,193,.10), rgba(0,110,79,.08));
}

.primary:hover{
  background: linear-gradient(135deg, rgba(5,99,193,.14), rgba(0,110,79,.10));
  border-color: rgba(5,99,193,.45);
}

.danger{
  border-color: rgba(220,38,38,.35);
  background: rgba(220,38,38,.06);
}

.danger:hover{
  background: rgba(220,38,38,.08);
  border-color: rgba(220,38,38,.45);
}

/* =========================
   Topbar / Card
========================= */
.topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid rgba(15,23,42,.10);
  display:flex;
  align-items:center;
  gap:10px;
  padding:14px 16px;
  flex: 0 0 auto;
}

.pageTitle{
  font-family: var(--font-display);
  font-size:22px;
  font-weight: var(--w-semi);
  letter-spacing:.3px;
  color: rgba(15,23,42,.92);
}

.card{
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
  background: var(--panel);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin:0;
  width:100%;
  max-width:none;
  display:flex;
  flex-direction:column;
}

/* =========================
   Subhead
========================= */
.subhead{
  flex:0 0 auto;
  padding:12px 14px;
  border-bottom:1px solid var(--line);
  background:#fbfcfe;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.subLeft,
.subRight{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.subRight{
  justify-content:flex-end;
}

.hint{
  width:100%;
  margin-top:10px;
  font-size: var(--fs-sm);
  color: var(--muted);
}

.monthBtn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius: var(--radius-sm);
  border:1px solid rgba(5,99,193,.25);
  background: linear-gradient(135deg, rgba(5,99,193,.10), rgba(0,110,79,.06));
  font-weight: var(--w-semi);
}

.monthBtn:hover{
  border-color: rgba(5,99,193,.40);
  background: linear-gradient(135deg, rgba(5,99,193,.14), rgba(0,110,79,.08));
}

.monthBtn .label{
  font-size: var(--fs-sm);
  font-weight: var(--w-medium);
  color: rgba(15,23,42,.70);
}

.monthBtn .value{
  font-family: var(--font-base);
  font-size: var(--fs-lg);
  letter-spacing:.2px;
  color: rgba(15,23,42,.92);
}

.monthBtn .chev{
  margin-left:2px;
  font-weight: var(--w-medium);
  color: rgba(15,23,42,.70);
}

/* ===== Hint + Legend row ===== */
.hintRow{
  width:100%;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-top:10px;
}

.hintRow .hint{
  width:auto;
  flex:1 1 auto;
  margin-top:0;
}

.legend{
  flex:0 0 auto;
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:8px 12px;
  max-width:58%;
}

.legend .lg{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:13px;
  color: rgba(81,96,118,.85);
  white-space:nowrap;
}

.legend .lg i{
  width:10px;
  height:10px;
  border-radius:3px;
  background: var(--lg, #999);
  display:inline-block;
}

.legend .lg[data-tag="実験分析"],
.legend .lg[data-tag="デスク作業"]{ --lg:#0563C1; }

.legend .lg[data-tag="講義"]{ --lg:#00B0F0; }
.legend .lg[data-tag="ゼミ"]{ --lg:#006E4F; }

.legend .lg[data-tag="会議"],
.legend .lg[data-tag="出張"]{ --lg:#A953FF; }

.legend .lg[data-tag="締切"]{ --lg:#FF5757; }

.legend .lg[data-tag="休み"],
.legend .lg[data-tag="ほか"]{ --lg:#3F3F3F; }

@media (max-width: 760px){
  .hintRow{
    flex-direction:column;
    align-items:flex-start;
  }

  .legend{
    max-width:100%;
    justify-content:flex-start;
  }
}

/* =========================
   Month Calendar
========================= */
.dow{
  flex:0 0 auto;
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  background:#fbfcfe;
  border-bottom:1px solid var(--line);
}

.dow div{
  padding:12px 10px;
  text-align:center;
  font-weight: var(--w-medium);
  font-size: var(--fs-sm);
  color: var(--muted);
  letter-spacing:.4px;
}

.dow .sun{ color: var(--blue); }
.dow .sat{ color: var(--green); }

.grid{
  flex:1 1 auto;
  min-height:0;
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(var(--cell-minh), auto);
  gap:0;
  padding:0;
  position:relative;
  overflow-y:auto;
}

.cell{
  min-height: var(--cell-minh);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  padding:6px;
  cursor:pointer;
  background:#fff;
  border-right:1px solid var(--line);
  border-bottom:1px solid var(--line);
  border-radius:0;
  transition: background .12s ease;
}

.cell:nth-child(7n){
  border-right:none;
}

.cell:hover{
  background: rgba(5,99,193,.04);
}

.cell.out{
  background:#fafbfc;
  color: rgba(15,23,42,.55);
}

.cell.today{
  background: rgba(5,99,193,.05);
  outline:2px solid rgba(5,99,193,.20);
  outline-offset:-2px;
}

.dateRow{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:4px;
}

.dateNum{
  font-family: var(--font-display);
  display:flex;
  align-items:center;
  gap:8px;
  font-weight: var(--w-medium);
  font-size:12px;
  line-height:1;
  color: rgba(15,23,42,.82);
}

.todayDot{
  width:8px;
  height:8px;
  border-radius:999px;
  background: var(--blue);
  display:none;
}

.cell.today .todayDot{
  display:inline-block;
}

.count{
  font-size:11px;
  font-weight: var(--w-medium);
  padding:0 6px;
  border-radius:999px;
  border:1px solid var(--line);
  color: var(--muted);
  background:#fff;
}

.events{
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  gap:2px;
}

/* =========================
   Event item
========================= */
.ev{
  --tagColor: var(--blue);
  border:none;
  background: var(--tagColor);
  border-radius:6px;
  padding:4px 8px;
  display:flex;
  align-items:center;
  gap:8px;
  color:#fff;
  transition: filter .12s ease, transform .06s ease;
}

.ev:hover{
  filter: brightness(.92);
}

.evMain{
  min-width:0;
  flex:1;
  display:flex;
  align-items:center;
  gap:8px;
}

.evTitle.only{
  color:#fff;
  font-weight: var(--w-medium);
  font-size:12px;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.evBadge{
  flex:0 0 auto;
  height:18px;
  min-width:18px;
  padding:0 6px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:none;
  border-radius:4px;
  background:#fff;
  color: var(--tagColor);
  font-size:11px;
  font-weight: var(--w-semi);
  line-height:1;
  user-select:none;
}

.cell.out .ev{
  opacity:.92;
}

.empty{
  padding:16px 14px;
  text-align:center;
  color: var(--muted);
  font-size: var(--fs-base);
  background:#fbfcfe;
}

/* =========================
   Multi-day span layer
========================= */
.spanLayer{
  position:absolute;
  inset:0;
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(6, 1fr);
  pointer-events:none;
  z-index:3;
}

.ev.spanBar{
  pointer-events:auto;
  align-self:start;
  margin:28px 6px 0;
  transform: translateY(calc(var(--lane, 0) * 18px));
}

.ev.spanBar.isContLeft{
  border-top-left-radius:4px;
  border-bottom-left-radius:4px;
}

.ev.spanBar.isContRight{
  border-top-right-radius:4px;
  border-bottom-right-radius:4px;
}

/* =========================
   Backdrop / Modal
========================= */
.backdrop{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:14px;
  background: rgba(15,23,42,.40);
  z-index: var(--z-modal);
  opacity:0;
  pointer-events:none;
  visibility:hidden;
  transition: opacity .15s ease;
}

.backdrop.open{
  opacity:1;
  pointer-events:auto;
  visibility:visible;
}

.modal{
  width: min(820px, 100%);
  background: var(--panel);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(15,23,42,.18);
  overflow:hidden;
}

.modalHead{
  padding:12px 14px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  background:#fbfcfe;
}

.modalHead b{
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--w-semi);
}

.modalFoot{
  padding:12px 14px;
  border-top:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  background:#fbfcfe;
}

.small{
  font-size: var(--fs-sm);
  color: var(--muted);
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

.kbd{
  font-size: var(--fs-xs);
  padding:4px 8px;
  border-radius: var(--radius-sm);
  border:1px solid var(--line);
  background:#fff;
  color: rgba(15,23,42,.85);
  font-weight: var(--w-medium);
}

.modal.simple{
  font-family: var(--font-base);
}

.simpleHead{
  align-items:center;
}

.iconBtn{
  width:42px;
  height:42px;
  padding:0;
  display:grid;
  place-items:center;
  border-radius: var(--radius-sm);
  font-size:20px;
  line-height:1;
}

/* =========================
   Month Select Modal
========================= */
.monthModal.oneLine{
  width: min(520px, 100%);
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
  box-shadow: 0 18px 55px rgba(15,23,42,.14);
  overflow:hidden;
}

.mlBody{
  padding:18px 18px 14px;
}

.mlLine{
  display:flex;
  align-items:baseline;
  justify-content:center;
  gap:14px;
  padding:18px 10px;
  border:1px solid transparent;
  border-radius:8px;
  cursor:text;
}

.mlLine:hover{
  background:#fbfcfe;
  border-color: rgba(15,23,42,.08);
}

.mlInput{
  font-family: var(--font-display);
  border:none;
  outline:none;
  background:transparent;
  padding:0;
  margin:0;
  font-size:26px;
  font-weight: var(--w-medium);
  letter-spacing:.8px;
  color: rgba(15,23,42,.92);
  text-align:center;
}

.mlInput.year{ width:140px; }
.mlInput.month{ width:90px; }

.mlInput::placeholder{
  color: rgba(81,96,118,.45);
  font-weight: var(--w-regular);
  letter-spacing:.6px;
}

.mlSlash{
  font-family: var(--font-display);
  font-size:26px;
  color: rgba(81,96,118,.45);
  user-select:none;
}

.mlInput:focus{
  box-shadow: inset 0 -2px 0 rgba(5,99,193,.18);
}

.mlNav{
  display:flex;
  justify-content:center;
  gap:18px;
  padding:8px 0 14px;
}

.mlLink{
  border:none;
  background:transparent;
  padding:6px 0;
  font-size:14px;
  color: rgba(15,23,42,.55);
  font-weight: var(--w-medium);
  cursor:pointer;
}

.mlLink:hover{
  color: rgba(15,23,42,.85);
  text-decoration: underline;
  text-underline-offset:4px;
}

.mlFoot{
  display:flex;
  justify-content:center;
  gap:10px;
  padding-top:8px;
}

.mlBtn{
  font-size:15px;
  padding:10px 12px;
  border-radius:6px;
}

.mlBtn.primary{
  border-color: rgba(5,99,193,.28);
  background: linear-gradient(135deg, rgba(5,99,193,.10), rgba(0,110,79,.06));
}

/* =========================
   Stylish Form
========================= */
.stylishForm{
  padding:12px 14px;
  display:flex;
  flex-direction:column;
  gap:14px;
}

.fRow{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.fField{
  position:relative;
  padding:10px 10px 8px;
  border-radius:10px;
  transition: background .12s ease;
}

.fField:hover{
  background:#fbfcfe;
}

.fInput{
  width:100%;
  border:none;
  outline:none;
  background:transparent;
  padding:2px 0 6px;
  margin:0;
  font-family: var(--font-base);
  font-size: var(--fs-base);
  font-weight: var(--w-regular);
  color: rgba(15,23,42,.92);
  letter-spacing:.2px;
}

.fLine{
  height:1px;
  background: rgba(15,23,42,.10);
  transition: background .12s ease, height .12s ease;
  pointer-events:none;
  position:relative;
  z-index:1;
}

.fField:focus-within .fLine{
  height:2px;
  background: rgba(5,99,193,.28);
}

.fLabel{
  position:absolute;
  left:10px;
  top:10px;
  font-size: var(--fs-sm);
  font-weight: var(--w-medium);
  color: rgba(81,96,118,.75);
  cursor:text;
  user-select:none;
  transition: opacity .12s ease, transform .12s ease;
}

.fInput:focus + .fLabel,
.fInput:not(:placeholder-shown) + .fLabel{
  opacity:0;
  transform: translateY(-2px);
}

.fTextarea{
  min-height:110px;
  resize:vertical;
  padding-top:2px;
}

.fGroupHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.fGroupTitle{
  font-size: var(--fs-sm);
  font-weight: var(--w-medium);
  color: rgba(81,96,118,.82);
}

.fGroupToggles{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}

.fToggle{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(15,23,42,.04);
  color: rgba(15,23,42,.72);
  font-size:14px;
  user-select:none;
}

.fToggle:hover{
  background: rgba(15,23,42,.06);
}

.fToggle input{
  width:16px;
  height:16px;
  accent-color: var(--blue);
}

.fGrid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}

@media (max-width: 560px){
  .fGrid2{
    grid-template-columns: 1fr;
  }
}

.fRowLabel{
  display:flex;
  align-items:baseline;
  gap:12px;
  padding:6px 0;
}

.fSideLabel{
  flex:0 0 72px;
  font-size: var(--fs-sm);
  font-weight: var(--w-medium);
  color: rgba(81,96,118,.75);
  user-select:none;
  padding-top:10px;
}

.fSideValue{
  flex:1 1 auto;
  min-width:0;
  position:relative;
}

/* Date parts */
.dWrap{
  display:flex;
  align-items:baseline;
  gap:8px;
  padding:10px 2px 6px;
  position:relative;
  z-index:2;
}

.dPart{
  border:none;
  outline:none;
  background:transparent;
  padding:0;
  margin:0;
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: var(--w-regular);
  color: rgba(15,23,42,.92);
  letter-spacing:.2px;
  width:3.2em;
  text-align:center;
}

#startY,
#endY{
  width:4.6em;
}

.dPart::placeholder{
  color: rgba(81,96,118,.35);
}

.dSlash{
  color: rgba(81,96,118,.45);
  user-select:none;
  pointer-events:none;
}

.dPart::-webkit-outer-spin-button,
.dPart::-webkit-inner-spin-button{
  -webkit-appearance:none;
  margin:0;
}

.dPart{
  -moz-appearance:textfield;
}

/* Time parts */
.tWrap{
  display:flex;
  align-items:baseline;
  gap:10px;
  padding:10px 2px 6px;
  position:relative;
  z-index:2;
}

.tPart{
  border:none;
  outline:none;
  background:transparent;
  padding:0;
  margin:0;
  width:3.2ch;
  text-align:center;
  font-family: var(--font-display);
  font-size:22px;
  font-weight: var(--w-medium);
  letter-spacing:.6px;
  color: rgba(15,23,42,.92);
}

.tPart::placeholder{
  color: rgba(81,96,118,.40);
  font-weight: var(--w-regular);
  letter-spacing:.4px;
}

.tColon{
  font-family: var(--font-display);
  font-size:22px;
  color: rgba(81,96,118,.45);
  user-select:none;
  pointer-events:none;
}

.tWrap:focus-within + .fLine{
  background: rgba(5,99,193,.28);
}

/* =========================
   Tag Picker
========================= */
.tagPick{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.tagChips{
  display:none;
}

.tagBoard{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding:4px 0 2px;
}

.tagBtn{
  border:none;
  border-radius:8px;
  background: rgba(15,23,42,.06);
  color: rgba(81,96,118,.85);
  padding:8px 10px;
  font-size:14px;
  font-weight: var(--w-medium);
  cursor:pointer;
  transition: background .12s ease, transform .06s ease, filter .12s ease;
}

.tagBtn:hover{
  background: rgba(15,23,42,.10);
}

.tagBtn:active{
  transform: translateY(1px);
}

.tagBtn.isOn{
  background: var(--tag, var(--blue));
  color:#fff;
}

.tagBtn.isOn:hover{
  background: var(--tag-hover, var(--blue-deep));
}

.tagPick.hasSelection .tagBtn:not(.isOn){
  background: rgba(15,23,42,.05);
  color: rgba(81,96,118,.70);
}

.tagPick.invalid .tagBoard{
  outline:none;
  background:transparent;
  padding:4px 0 2px;
}

.tagField{
  padding-top:28px;
}

.tagField .fLabel{
  top:8px;
  opacity:1 !important;
  transform:none !important;
  cursor:default;
}

.tagBtn[data-tag="実験分析"],
.tagBtn[data-tag="デスク作業"]{
  --tag:#0563C1;
  --tag-hover:#044f9a;
}

.tagBtn[data-tag="講義"]{
  --tag:#00B0F0;
  --tag-hover:#008fc6;
}

.tagBtn[data-tag="ゼミ"]{
  --tag:#006E4F;
  --tag-hover:#00523b;
}

.tagBtn[data-tag="会議"],
.tagBtn[data-tag="出張"]{
  --tag:#A953FF;
  --tag-hover:#8b34ff;
}

.tagBtn[data-tag="締切"]{
  --tag:#FF5757;
  --tag-hover:#e54444;
}

.tagBtn[data-tag="休み"],
.tagBtn[data-tag="ほか"]{
  --tag:#3F3F3F;
  --tag-hover:#2f2f2f;
}

.isHidden{
  display:none !important;
}

/* =========================
   Week View (split layout)
========================= */
.wgutter{
  border-right:1px solid var(--line);
}

.wday{
  padding:10px 10px;
  text-align:center;
  border-right:1px solid var(--line);
  display:flex;
  align-items:baseline;
  justify-content:center;
  gap:8px;
}

.wday:last-child{
  border-right:none;
}

.wdayName{
  font-weight: var(--w-medium);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.wdayDate{
  font-family: var(--font-display);
  font-weight: var(--w-semi);
  font-size:14px;
  color: rgba(15,23,42,.86);
}

.weekHeadMain .sun .wdayName{ color: var(--blue); }
.weekHeadMain .sat .wdayName{ color: var(--green); }

.weekSplitWrap{
  flex:1 1 auto;
  min-height:0;
  height:100%;
  display:grid;
  grid-template-columns:64px 1fr;
  overflow:hidden;
  background:#fff;
}

.weekFixedCol{
  min-width:64px;
  max-width:64px;
  min-height:0;
  height:100%;
  display:flex;
  flex-direction:column;
  border-right:1px solid var(--line);
  background:#fff;
  position:relative;
  z-index:5;
}

.weekHeadFixed{
  flex:0 0 auto;
  background:#fbfcfe;
  border-bottom:1px solid var(--line);
}

.weekCornerCell{
  min-height:48px;
  background:#fbfcfe;
}

.allDayFixed{
  flex:0 0 auto;
  background:#fff;
  border-bottom:1px solid var(--line);
}

.allDayFixed .allDayLabel{
  min-height:56px;
  padding:10px 6px;
  font-size:12px;
  font-weight:var(--w-medium);
  color:rgba(81,96,118,.78);
  display:flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
  background:#fff;
  border-right:none;
}

.timeFixed{
  flex:1 1 auto;
  min-height:0;
  height:auto;
  background:#fff;
  overflow:hidden;
}

.weekMainScroll{
  flex:1 1 auto;
  min-width:0;
  min-height:0;
  height:100%;
  display:flex;
  flex-direction:column;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  background:#fff;
}

.weekMainInner{
  min-width:700px;
  min-height:0;
  height:100%;
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
}

.weekHeadMain{
  flex:0 0 auto;
  display:grid;
  grid-template-columns:repeat(7, minmax(100px, 1fr));
  background:#fbfcfe;
  border-bottom:1px solid var(--line);
}

.allDayMain{
  flex:0 0 auto;
  display:grid;
  grid-template-columns:repeat(7, minmax(100px, 1fr));
  border-bottom:1px solid var(--line);
  background:#fff;
}

.allDayCell{
  min-height:56px;
  padding:6px 6px;
  border-right:1px solid var(--line);
  display:flex;
  flex-direction:column;
  gap:4px;
  overflow:hidden;
}

.allDayCell:last-child{
  border-right:none;
}

.timeGridMain{
  flex:1 1 auto;
  min-height:0;
  height:100%;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  display:grid;
  grid-template-columns:repeat(7, minmax(100px, 1fr));
  position:relative;
  background:#fff;
}

.timeFixed .hourRow{
  height:var(--hourH);
  display:flex;
  align-items:flex-start;
  justify-content:flex-end;
  padding:0 8px 0 0;
  font-size:12px;
  line-height:1;
  color:rgba(81,96,118,.78);
  position:relative;
  background:#fff;
  overflow:visible;
}

.timeFixed .hourLabel{
  position:absolute;
  right:10px;
  top:0;
  transform:translateY(-50%);
  font-size:13px;
  font-weight:700;
  color:#0f172a;
  line-height:1;
  font-variant-numeric:tabular-nums;
  letter-spacing:.2px;
  background:rgba(255,255,255,.92);
  padding:0 4px;
  border-radius:4px;
}

.dayCol{
  border-right:1px solid var(--line);
  position:relative;
}

.dayCol:last-child{
  border-right:none;
}

.colInner{
  position:relative;
  min-height:var(--dayH);
}

.halfLine{
  height:var(--halfH);
  border-top:1px dashed rgba(148, 163, 184, 0.35);
  box-sizing:border-box;
  pointer-events:none;
}

.halfLine.hourTop{
  border-top-style:solid;
  border-top-color:rgba(148, 163, 184, 0.55);
}

.evBlock{
  position:absolute;
  border-radius:8px;
  padding:6px 8px;
  color:#fff;
  background: var(--tagColor, var(--blue));
  cursor:pointer;
  box-shadow: 0 8px 18px rgba(15,23,42,.12);
  overflow:hidden;
}

.evBlock:hover{
  filter: brightness(.92);
}

.evBlock .evLine{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}

.evBlock .evTitle{
  font-weight:var(--w-medium);
  font-size:12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.evBlock .evTime{
  font-size:11px;
  opacity:.92;
  white-space:nowrap;
}

.evBlock .evBadge{
  background:#fff;
  color: var(--tagColor, var(--blue));
}

.evBlock[data-lane]{
  right:auto;
}

/* =========================
   Daily Shared View (clean)
========================= */
.dsHead,
.dsAllDayRow{
  width: calc(100% - var(--sbw));
  min-width: 0;
  flex: 0 0 auto;
  overflow-x: hidden;
  overflow-y: hidden;
  box-sizing: border-box;
}

.dsHead::-webkit-scrollbar,
.dsAllDayRow::-webkit-scrollbar{
  display:none;
}

.dsHead{
  background:#fbfcfe;
  border-bottom:1px solid var(--line);
  position: sticky;
  top:0;
  z-index:12;
  min-height:44px;
}

.dsAllDayRow{
  background:#fff;
  border-bottom:1px solid var(--line);
  min-height:56px;
  z-index:11;
}

.dsHeadInner,
.dsAllDayInner{
  display: grid;
  grid-template-columns: var(--dsTimeW) repeat(var(--memberCols, 3), var(--dsColMinW));
  width: calc(var(--dsTimeW) + var(--memberCols, 3) * var(--dsColMinW));
  min-width: calc(var(--dsTimeW) + var(--memberCols, 3) * var(--dsColMinW));
}

.dsHGutter{
  position: sticky;
  left: 0;
  z-index:14;
  background:#fbfcfe;
  border-right:1px solid var(--line);
}

.dsHCell{
  padding:10px 10px;
  border-right:1px solid var(--line);
  font-weight: var(--w-medium);
  color: rgba(81,96,118,.85);
  text-align:center;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  background:#fbfcfe;
}

.dsHCell:last-child{
  border-right:none;
}

.dsAllDayLabel{
  position: sticky;
  left: 0;
  z-index:13;
  background:#fff;
  border-right:1px solid var(--line);
  padding:10px 10px;
  font-size:12px;
  font-weight: var(--w-medium);
  color: rgba(81,96,118,.78);
  display:flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
}

.dsAllDayCell{
  min-height:56px;
  padding:6px 6px;
  border-right:1px solid var(--line);
  display:flex;
  flex-direction:column;
  gap:4px;
  overflow:hidden;
  background:#fff;
}

.dsAllDayCell:last-child{
  border-right:none;
}

.dsTimeGrid{
  flex:1 1 auto;
  min-height:0;
  min-width:0;
  overflow:auto;
  display:grid;
  grid-template-columns: var(--dsTimeW) 1fr;
  background:#fff;
  position:relative;
}

.dsTimeGutter{
  position: sticky;
  left: 0;
  z-index:10;
  background:#fff;
  border-right:1px solid rgba(15,23,42,.18);
}

.dsHourRow{
  height: var(--hourH);
  position:relative;
  border:none;
  overflow:visible;
}

.dsHourLabel{
  position:absolute;
  right:10px;
  top:0;
  transform: translateY(-50%);
  font-size:13px;
  font-weight:700;
  color:#0f172a;
  line-height:1;
  font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,.92);
  padding:0 4px;
  border-radius:4px;
}

.dsCols{
  display: grid;
  grid-template-columns: repeat(var(--memberCols, 3), var(--dsColMinW));
  width: calc(var(--memberCols, 3) * var(--dsColMinW));
  min-width: calc(var(--memberCols, 3) * var(--dsColMinW));
}
.dsMemberCol{
  position:relative;
  min-height: var(--dayH);
  border-right:1px solid var(--line);
  background:#fff;
}

.dsMemberCol:last-child{
  border-right:none;
}

.dsColInner{
  position:relative;
  min-height: var(--dayH);
}

.dsHalfLine{
  height: var(--halfH);
  border-top: 1px dashed rgba(148, 163, 184, 0.35);
  box-sizing:border-box;
  pointer-events:none;
}

.dsHalfLine.hourTop{
  border-top-style:solid;
  border-top-color: rgba(148, 163, 184, 0.55);
}

.dsPlaceholder{
  font-size:12px;
  color: rgba(81,96,118,.70);
  padding:10px 8px;
}

.dsColNote{
  position:absolute;
  left:10px;
  right:10px;
  top:10px;
  font-size:12px;
  color: rgba(81,96,118,.65);
  pointer-events:none;
}

.dsNowLine{
  position:absolute;
  left:0;
  right:0;
  height:0;
  border-top:2px solid #0563C1;
  z-index:20;
  pointer-events:none;
}

.dsNowLabel{
  position:absolute;
  left:6px;
  top:-10px;
  font-size:12px;
  font-weight:700;
  color:#0563C1;
  background:#fff;
  padding:0 4px;
  border-radius:4px;
  font-variant-numeric: tabular-nums;
}

/* =========================
   Login page
========================= */
.loginPage{
  height:100vh;
  overflow:hidden;
}

.loginPage .backdrop{
  background: rgba(15,23,42,.22);
}

.loginPage .loginModal{
  width: min(520px, 100%);
}

.loginPage .loginMsg{
  min-height:1.2em;
  font-size:14px;
  color: rgba(81,96,118,.85);
  padding:2px 2px 0;
}

.loginPage .loginMsg.isErr{
  color:#dc2626;
}

.loginPage .stylishForm .hint{
  margin:2px 0 6px;
}

/* =========================
   Autofill
========================= */
.fInput:-webkit-autofill{
  -webkit-text-fill-color: rgba(15,23,42,.92) !important;
  font-family: var(--font-base) !important;
  font-size: var(--fs-base) !important;
  font-weight: var(--w-regular) !important;
  letter-spacing:.2px !important;
  box-shadow: 0 0 0 1000px #fbfcfe inset !important;
  transition: background-color 9999s ease-in-out 0s;
}

.fInput:-webkit-autofill + .fLabel{
  opacity:0;
  transform: translateY(-2px);
}

/* =========================
   Misc view text
========================= */
.evLoc{
  font-size:11px;
  line-height:1.2;
  opacity:.9;
  margin-top:2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.fStaticLabel{
  font-size:12px;
  color:#6b7280;
  margin-bottom:6px;
}

.fStaticValue{
  min-height:24px;
  line-height:1.65;
  white-space:pre-wrap;
  word-break:break-word;
  padding:6px 0 4px;
  border-bottom:1px solid rgba(0,0,0,0.08);
}

/* =========================
   View Modal
========================= */
#viewBackdrop .modal{
  border-top:4px solid var(--accentTagColor, #0563C1);
  box-shadow:
    0 10px 30px rgba(0,0,0,0.12),
    0 2px 8px rgba(0,0,0,0.08);
  overflow:hidden;
}

#viewBackdrop .viewHead{
  background: var(--accentTagColor, #0563C1);
  color:#fff;
  border-bottom:none;
}

#viewBackdrop .viewHead #viewModalTitle{
  color:#fff;
}

#viewBackdrop .viewHead .iconBtn{
  color:#fff;
}

#viewBackdrop .viewHead .iconBtn:hover{
  background: rgba(255,255,255,0.12);
}

#viewBackdrop .viewTitleRow{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

#viewBackdrop .viewTagChip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:2px 10px;
  min-height:32px;
  border-radius:999px;
  font-size:1rem;
  font-weight:700;
  line-height:1.2;
  color: var(--accentTagColor, #0563C1);
  background: color-mix(in srgb, var(--accentTagColor, #0563C1) 14%, white);
  border:1px solid color-mix(in srgb, var(--accentTagColor, #0563C1) 35%, white);
}

#viewBackdrop .viewTitleMain{
  flex:1 1 0;
  min-width:0;
  font-weight:700;
  font-size:1rem;
  border-bottom:1px solid rgba(0,0,0,0.08);
}

#viewBackdrop #viewEditBtn:hover{
  filter: brightness(0.96);
}

#viewBackdrop .iconBtn{
  color: var(--accentTagColor);
}

/* =========================
   Guest Picker
========================= */
.guestField{
  position:relative;
  padding-top:28px;
}

.guestField .fLabel.guestLabel{
  top:8px;
  opacity:1 !important;
  transform:none !important;
  cursor:default;
}

.guestTokenBox{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  min-height:50px;
  padding:8px 2px 8px;
  position:relative;
  z-index:2;
}

.guestPicked{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.guestSearch{
  flex:1 1 180px;
  min-width:160px;
  border:none;
  outline:none;
  background:transparent;
  color: rgba(15,23,42,.92);
  font-family: var(--font-base);
  font-size: var(--fs-base);
  font-weight: var(--w-regular);
  padding:4px 0 6px;
  margin:0;
}

.guestSearch::placeholder{
  color: rgba(81,96,118,.42);
}

.guestChip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  max-width:100%;
  border:1px solid rgba(5,99,193,.16);
  border-radius:999px;
  background: linear-gradient(135deg, rgba(5,99,193,.08), rgba(0,110,79,.06));
  color: rgba(15,23,42,.88);
  padding:6px 10px;
  font-size:13px;
  font-weight: var(--w-medium);
  line-height:1.2;
}

.guestChip:hover{
  border-color: rgba(5,99,193,.28);
  background: linear-gradient(135deg, rgba(5,99,193,.12), rgba(0,110,79,.08));
}

.guestChipName{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.guestChipUname{
  color: rgba(81,96,118,.80);
  font-weight: var(--w-regular);
}

.guestChipX{
  flex:0 0 auto;
  width:18px;
  height:18px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background: rgba(15,23,42,.08);
  color: rgba(15,23,42,.62);
  font-size:12px;
  line-height:1;
}

.guestSuggest{
  display:none;
  position:absolute;
  left:10px;
  right:10px;
  top: calc(100% + 6px);
  z-index:30;
  background: rgba(255,255,255,.98);
  border:1px solid rgba(15,23,42,.10);
  border-radius:12px;
  overflow:hidden;
  box-shadow: 0 16px 36px rgba(15,23,42,.14);
  backdrop-filter: blur(8px);
}

.guestSuggest.open{
  display:block;
}

.guestSuggestList{
  max-height:220px;
  overflow:auto;
}

.guestSuggestRow{
  width:100%;
  border:none;
  border-radius:0;
  background:transparent;
  color:inherit;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:11px 12px;
  text-align:left;
  cursor:pointer;
  border-bottom:1px solid rgba(15,23,42,.06);
}

.guestSuggestRow:last-child{
  border-bottom:none;
}

.guestSuggestRow:hover{
  background: rgba(5,99,193,.06);
}

.guestSuggestRow.isActive{
  background: linear-gradient(135deg, rgba(5,99,193,.10), rgba(0,110,79,.06));
}

.guestSuggestMain{
  min-width:0;
  display:flex;
  align-items:center;
  gap:10px;
}

.guestAvatar{
  width:30px;
  height:30px;
  border-radius:999px;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  font-size:12px;
  font-weight:800;
  color: rgba(255,255,255,.95);
  background: linear-gradient(135deg, rgba(5,99,193,.95), rgba(0,110,79,.95));
  letter-spacing:.3px;
}

.guestMeta{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}

.guestDisplay{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:14px;
  font-weight: var(--w-medium);
  color: rgba(15,23,42,.90);
}

.guestUsername{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:12px;
  color: rgba(81,96,118,.78);
}

.guestAddHint{
  flex:0 0 auto;
  font-size:12px;
  font-weight: var(--w-medium);
  color: rgba(5,99,193,.78);
}

.guestHint{
  margin-top:8px;
  font-size:13px;
}

.guestField:focus-within .guestTokenBox{
  background: linear-gradient(180deg, rgba(5,99,193,.025), rgba(5,99,193,0));
  border-radius:8px 8px 0 0;
}

@media (max-width: 560px){
  .guestSuggest{
    left:0;
    right:0;
  }

  .guestChip{
    max-width:100%;
  }

  .guestAddHint{
    display:none;
  }
}

/* =========================
   Duplicate Modal
========================= */
#duplicateBackdrop .modal{
  width: min(640px, 100%);
  border-top:4px solid var(--blue);
  box-shadow:
    0 16px 40px rgba(15,23,42,.14),
    0 4px 10px rgba(15,23,42,.08);
}

#duplicateBackdrop .modalHead{
  background: linear-gradient(135deg, rgba(5,99,193,.10), rgba(0,110,79,.05));
  border-bottom:1px solid rgba(5,99,193,.14);
}

#duplicateBackdrop .modalHead b{
  color: rgba(15,23,42,.92);
}

#duplicateBackdrop .stylishForm{
  gap:16px;
}

#duplicateBackdrop #duplicateSourceTitle{
  font-weight:700;
  font-size:1rem;
  color: rgba(15,23,42,.92);
}

#duplicateBackdrop #duplicateSourceDateTime{
  color: rgba(15,23,42,.84);
}

#duplicateBackdrop .fField{
  border-radius:12px;
}

#duplicateBackdrop #duplicateAddBtn{
  border-color: rgba(5,99,193,.22);
  background: linear-gradient(135deg, rgba(5,99,193,.08), rgba(0,110,79,.05));
  font-weight: var(--w-medium);
}

#duplicateBackdrop #duplicateAddBtn:hover{
  border-color: rgba(5,99,193,.36);
  background: linear-gradient(135deg, rgba(5,99,193,.12), rgba(0,110,79,.07));
}

#duplicateBackdrop #duplicateDatesChips{
  padding-top:2px;
}

#duplicateBackdrop #duplicateDatesChips .guestChip{
  border-color: rgba(5,99,193,.14);
  background: linear-gradient(135deg, rgba(5,99,193,.07), rgba(0,110,79,.05));
  color: rgba(15,23,42,.90);
  padding:7px 11px;
  font-size:13px;
}

#duplicateBackdrop #duplicateDatesChips .guestChip:hover{
  border-color: rgba(5,99,193,.26);
  background: linear-gradient(135deg, rgba(5,99,193,.11), rgba(0,110,79,.07));
}

#duplicateBackdrop #duplicateHint{
  color: rgba(81,96,118,.82);
}

#duplicateBackdrop .modalFoot{
  background:#fbfcfe;
  border-top:1px solid rgba(15,23,42,.08);
}

#duplicateBackdrop #duplicateRunBtn{
  min-width:124px;
}

#duplicateBackdrop #duplicateRunBtn:disabled{
  opacity:.72;
  cursor:wait;
}

#duplicateBackdrop #duplicateCancelBtn{
  background:#fff;
}

/* Duplicate modal date row */
#duplicateBackdrop .duplicateDateRow{
  display:flex;
  align-items:flex-end;
  gap:10px;
  flex-wrap:wrap;
}

#duplicateBackdrop .duplicateDateWrap{
  flex:1 1 280px;
  min-width:260px;
}

#duplicateBackdrop .duplicateDateWrap .dWrap{
  padding:10px 2px 6px;
}

#duplicateBackdrop .duplicateDateWrap .dPart{
  font-size: var(--fs-base);
}

#duplicateBackdrop #duplicateY{
  width:4.6em;
}

#duplicateBackdrop #duplicateM,
#duplicateBackdrop #duplicateD{
  width:3.2em;
}

#duplicateBackdrop #duplicateAddBtn{
  flex:0 0 auto;
  height:42px;
}

#duplicateBackdrop #duplicateY,
#duplicateBackdrop #duplicateM,
#duplicateBackdrop #duplicateD{
  border:none;
  background:transparent;
  box-shadow:none;
  border-radius:0;
  padding:0;
  text-align:center;
}

#duplicateBackdrop #duplicateY:focus,
#duplicateBackdrop #duplicateM:focus,
#duplicateBackdrop #duplicateD:focus{
  border:none;
  box-shadow:none;
  background:transparent;
}

@media (max-width: 560px){
  #duplicateBackdrop .modal{
    width:min(100%, 100%);
  }

  #duplicateBackdrop #duplicateY{
    width:100px !important;
  }

  #duplicateBackdrop #duplicateM,
  #duplicateBackdrop #duplicateD{
    width:76px !important;
  }

  #duplicateBackdrop .modalFoot{
    align-items:stretch;
  }

  #duplicateBackdrop .modalFoot > div:last-child{
    width:100%;
  }

  #duplicateBackdrop .modalFoot button{
    flex:1 1 auto;
  }

  #duplicateBackdrop .duplicateDateRow{
    align-items:stretch;
  }

  #duplicateBackdrop .duplicateDateWrap{
    min-width:100%;
  }

  #duplicateBackdrop #duplicateAddBtn{
    width:100%;
  }
}

/* ===== モーダルを縦レイアウトに ===== */
.modal{
  display:flex;
  flex-direction:column;
  max-height:90vh;
}

/* ===== フォーム部分をスクロール領域に ===== */
.modal .stylishForm{
  flex:1 1 auto;
  overflow-y:auto;
  min-height:0;
}

/* ===== ヘッダーは固定っぽく ===== */
.modalHead{
  flex:0 0 auto;
}

/* ===== フッター（保存ボタン）固定 ===== */
.modalFoot{
  position: sticky;
  bottom: 0;
  z-index: 5;
}

.dayPanel{
  flex: 0 0 220px;
  height: 220px;
  min-height: 220px;
  max-height: 220px;
  display: flex;
  flex-direction: column;
}

.dayPanelHead{
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.dayPanelLabel{
  font-size: 10px;
  line-height: 1.1;
  color: var(--muted);
}

.dayPanelTitle{
  margin-top: 0;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--text);
}

.dayPanelActions{
  display: flex;
  align-items: center;
  gap: 6px;
}

.dayPanelActions button{
  padding: 4px 8px;
  min-height: 28px;
  font-size: 12px;
  line-height: 1.1;
  border-radius: 5px;
}

.dayPanelBody{
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 10px 2px 12px;
}

.dayPanelRow{
  display: grid;
  grid-template-columns: 100px 30px minmax(0, 1fr);
  align-items: center;
  column-gap: 6px;
  min-height: 28px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(15,23,42,.08);
  cursor: pointer;
}

.dayPanelBadge{
  width: 14px;
  height: 14px;
  border-radius: 2px;
  display: grid;
  place-items: center;
  background: var(--tagColor, #0563C1);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}

.dayPanelTitleCell{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  line-height: 1.2;
  color: var(--text);
}

.dayPanelTimeCell{
  text-align: right;
  white-space: nowrap;
  font-size: 12.5px;
  line-height: 1;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.dayPanelEmpty{
  padding: 8px 0 6px 3px;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 768px){
  .dayPanelHead{
    padding: 5px 10px;
    gap: 6px;
  }

  .dayPanelTitle{
    font-size: 12.5px;
  }

  .dayPanelActions button{
    padding: 3px 7px;
    min-height: 26px;
    font-size: 11.5px;
  }

  .dayPanelBody{
    padding: 0 8px 2px 10px;
  }

  .dayPanelRow{
    grid-template-columns: 14px minmax(0, 1fr) 62px;
    column-gap: 6px;
    min-height: 28px;
    padding: 4px 0 4px 2px;
  }

  .dayPanelTitleCell{
    font-size: 13px;
  }

  .dayPanelTimeCell{
    font-size: 12px;
  }
}

/* ===== hamburger ===== */
.hamburger{
  display:none;
  width:40px;
  height:40px;
  padding:0;
  border-radius:10px;
  font-size:20px;
  line-height:1;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
}

.menuBackdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.36);
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
  z-index:55;
}

.menuBackdrop.open{
  opacity:1;
  pointer-events:auto;
}

/* ヘッダー全体 */
.weekHeadMain,
.weekHeadFixed{
  height: var(--week-header-h);
  min-height: var(--week-header-h);
}

/* 各日セル */
.wday{
  height: var(--week-header-h);
  min-height: var(--week-header-h);
  box-sizing: border-box;
}

/* 左上セル */
.weekCornerCell{
  height: var(--week-header-h);
  min-height: var(--week-header-h);
}

.spanLayer{
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:3;
}

.ev.spanBar{
  position:absolute;
  pointer-events:auto;
  margin:0;
  transform: translateY(calc(28px + var(--lane, 0) * 18px));
}

.ev.spanBar.isContLeft{
  border-top-left-radius:4px;
  border-bottom-left-radius:4px;
}

.ev.spanBar.isContRight{
  border-top-right-radius:4px;
  border-bottom-right-radius:4px;
}

.ev.spanBar{
  position:absolute;
  pointer-events:auto;
  margin:0;
  transform: translateY(calc(28px + var(--lane, 0) * 18px));
}

.ev.spanBar{
  position:absolute;
  pointer-events:auto;
  margin:0;
  transform: translateY(
    calc(
      var(--cell-pad-top, 6px) +
      var(--date-row-h, 18px) +
      var(--date-row-gap, 4px) +
      (var(--lane, 0) * 18px)
    )
  );
}

.ev.spanBar{
  position:absolute;
  pointer-events:auto;
  margin:0;

  transform: translateY(
    calc(
      var(--cell-pad-top, 6px) +
      var(--date-row-h, 18px) +
      var(--date-row-gap, 4px) +
      var(--lane, 0) * (var(--event-h, 20px) + var(--event-gap, 2px))
    )
  );
}

.events{
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  gap:2px;
  margin-top: calc(
    var(--span-rows, 0) * (var(--event-h, 20px) + var(--event-gap, 2px))
    + var(--span-bottom-gap, 0px)
  );
}

.dsAllDayCell{
  overflow: hidden;
}

.dsAllDayCell .ev{
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.dsAllDayCell .evMain{
  min-width: 0;
  flex: 1 1 auto;
}

.dsAllDayCell .evTitle.only{
  min-width: 0;
}