.ms-calendar-shell{
  --cal-border:rgba(148,163,184,.22);
  --cal-muted:#64748b;
  --cal-surface:rgba(255,255,255,.78);
  --cal-surface-strong:#fff;
  --cal-accent:#2563eb;
  width:100%;
  min-width:0;
  padding:24px;
  box-sizing:border-box;
}

.ms-calendar-header,
.ms-calendar-toolbar,
.ms-calendar-nav,
.ms-calendar-header-actions,
.ms-cal-form-row,
.ms-cal-dialog footer{
  display:flex;
  align-items:center;
}

.ms-calendar-header{
  justify-content:space-between;
  gap:20px;
  margin-bottom:18px;
}

.ms-calendar-header h1{
  margin:3px 0 0;
  font-size:clamp(25px,3vw,34px);
  line-height:1.1;
}

.ms-calendar-eyebrow{
  color:var(--cal-muted);
  font-size:12px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.ms-calendar-header-actions,
.ms-calendar-nav{
  gap:8px;
}

.ms-cal-button,
.ms-cal-icon-button,
.ms-cal-sidebar-title button,
.ms-cal-category-edit{
  border:1px solid var(--cal-border);
  background:var(--cal-surface-strong);
  color:inherit;
  border-radius:10px;
  min-height:40px;
  padding:0 14px;
  font:inherit;
  font-weight:650;
  cursor:pointer;
}

.ms-cal-icon-button,
.ms-cal-sidebar-title button{
  width:40px;
  padding:0;
  font-size:23px;
}

.ms-cal-button.primary{
  background:var(--cal-accent);
  border-color:var(--cal-accent);
  color:#fff;
}

.ms-cal-button.danger{
  color:#b91c1c;
}

.ms-calendar-toolbar{
  min-width:0;
  justify-content:space-between;
  gap:16px;
  padding:12px 14px;
  border:1px solid var(--cal-border);
  border-bottom:0;
  border-radius:16px 16px 0 0;
  background:var(--cal-surface);
  backdrop-filter:blur(12px);
}

.ms-calendar-toolbar h2{
  margin:0;
  font-size:18px;
  text-transform:capitalize;
}

.ms-calendar-view-pill{
  border:1px solid var(--cal-border);
  border-radius:999px;
  padding:7px 12px;
  font-size:12px;
  font-weight:700;
}

.ms-calendar-layout{
  display:grid;
  grid-template-columns:230px minmax(0,1fr);
  min-width:0;
  border:1px solid var(--cal-border);
  border-radius:0 0 16px 16px;
  overflow:hidden;
  background:var(--cal-surface-strong);
  min-height:650px;
}

.ms-calendar-sidebar{
  padding:18px;
  border-right:1px solid var(--cal-border);
  min-width:0;
}

.ms-cal-sidebar-title{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:15px;
}

.ms-cal-category-list{
  display:flex;
  flex-direction:column;
  gap:5px;
}

.ms-cal-category{
  display:grid;
  grid-template-columns:auto auto minmax(0,1fr) auto;
  align-items:center;
  gap:8px;
  min-height:38px;
  font-size:13px;
}

.ms-cal-category input{
  margin:0;
}

.ms-cal-category-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background:var(--cal-category-color);
}

.ms-cal-category-name{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.ms-cal-category-kind{
  color:var(--cal-muted);
  font-size:10px;
}

.ms-cal-category-edit{
  grid-column:4;
  min-height:28px;
  width:30px;
  padding:0;
  border:0;
  background:transparent;
}

.ms-cal-sidebar-note,
.ms-cal-empty-small{
  margin-top:20px;
  color:var(--cal-muted);
  font-size:12px;
  line-height:1.5;
}

.ms-calendar-main{
  min-width:0;
  overflow:auto;
}

.ms-cal-weekdays,
.ms-cal-grid{
  display:grid;
  grid-template-columns:repeat(7,minmax(120px,1fr));
  min-width:840px;
}

.ms-cal-weekdays{
  position:sticky;
  top:0;
  z-index:2;
  background:var(--cal-surface-strong);
  border-bottom:1px solid var(--cal-border);
}

.ms-cal-weekdays span{
  padding:12px 10px;
  color:var(--cal-muted);
  font-size:11px;
  font-weight:750;
  text-align:center;
  text-transform:uppercase;
}

.ms-cal-grid{
  grid-template-rows:repeat(6,minmax(96px,1fr));
  min-height:600px;
}

.ms-cal-day{
  appearance:none;
  position:relative;
  min-width:0;
  min-height:96px;
  padding:9px;
  border:0;
  border-right:1px solid var(--cal-border);
  border-bottom:1px solid var(--cal-border);
  background:transparent;
  color:inherit;
  text-align:left;
  font:inherit;
  cursor:pointer;
}

.ms-cal-day:hover{
  background:rgba(59,130,246,.045);
}

.ms-cal-day.is-outside{
  opacity:.43;
}

.ms-cal-day-number{
  display:grid;
  place-items:center;
  width:27px;
  height:27px;
  border-radius:50%;
  font-size:12px;
  font-weight:700;
}

.ms-cal-day.is-today .ms-cal-day-number{
  background:var(--cal-accent);
  color:#fff;
}

.ms-cal-day-events{
  display:flex;
  flex-direction:column;
  gap:3px;
  margin-top:5px;
}

.ms-cal-event{
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  padding:4px 6px;
  border-left:3px solid var(--cal-event-color);
  border-radius:5px;
  background:color-mix(in srgb,var(--cal-event-color) 13%,transparent);
  font-size:11px;
  font-weight:650;
}

.ms-cal-more{
  color:var(--cal-muted);
  font-size:10px;
  padding-left:6px;
}

.ms-cal-loading{
  grid-column:1/-1;
  display:grid;
  place-items:center;
  min-height:400px;
  color:var(--cal-muted);
}

.ms-cal-dialog{
  width:min(620px,calc(100vw - 28px));
  max-height:calc(100dvh - 40px);
  overflow:auto;
  border:1px solid var(--cal-border);
  border-radius:18px;
  padding:0;
  color:inherit;
  background:var(--cal-surface-strong);
  box-shadow:0 24px 80px rgba(15,23,42,.28);
}

.ms-cal-dialog::backdrop{
  background:rgba(15,23,42,.52);
  backdrop-filter:blur(3px);
}

.ms-cal-dialog form{
  display:flex;
  flex-direction:column;
  gap:16px;
  padding:20px;
}

.ms-cal-dialog header{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
}

.ms-cal-dialog header small{
  color:var(--cal-muted);
}

.ms-cal-dialog h2{
  margin:3px 0 0;
}

.ms-cal-dialog header button{
  border:0;
  background:transparent;
  color:inherit;
  font-size:27px;
  cursor:pointer;
}

.ms-cal-dialog label{
  display:flex;
  flex-direction:column;
  gap:7px;
  font-size:12px;
  font-weight:700;
}

.ms-cal-dialog input,
.ms-cal-dialog select,
.ms-cal-dialog textarea{
  width:100%;
  box-sizing:border-box;
  border:1px solid var(--cal-border);
  border-radius:10px;
  padding:10px 11px;
  background:transparent;
  color:inherit;
  font:inherit;
}

.ms-cal-dialog input[type="color"]{
  min-height:43px;
  padding:5px;
}

.ms-cal-form-row{
  align-items:flex-start;
  gap:12px;
}

.ms-cal-form-row > label{
  flex:1 1 0;
}

.ms-cal-check{
  flex-direction:row !important;
  align-items:center;
}

.ms-cal-check input{
  width:auto;
}

.ms-cal-sharing-info{
  padding:11px 12px;
  border-radius:10px;
  background:rgba(59,130,246,.08);
  font-size:12px;
  line-height:1.45;
}

.ms-cal-dialog footer{
  justify-content:flex-end;
  gap:8px;
  padding-top:4px;
}

.ms-cal-dialog footer > span{
  flex:1;
}

.ms-cal-toast{
  position:fixed;
  right:24px;
  bottom:24px;
  z-index:10000;
  max-width:min(420px,calc(100vw - 32px));
  padding:12px 16px;
  border-radius:11px;
  background:#0f172a;
  color:#fff;
  box-shadow:0 15px 45px rgba(15,23,42,.3);
  font-size:13px;
}

.ms-cal-toast[data-danger="true"]{
  background:#991b1b;
}

html[data-theme="dark"] .ms-calendar-shell,
body[data-theme="dark"] .ms-calendar-shell,
.dark .ms-calendar-shell{
  --cal-border:rgba(148,163,184,.18);
  --cal-muted:#94a3b8;
  --cal-surface:rgba(15,23,42,.72);
  --cal-surface-strong:#111c2f;
}

@media (max-width:1000px){
  .ms-calendar-shell{
    padding:18px;
  }

  .ms-calendar-layout{
    grid-template-columns:190px minmax(0,1fr);
  }
}

@media (max-width:767px){
  .ms-calendar-shell{
    padding:12px;
  }

  .ms-calendar-header{
    align-items:flex-start;
    flex-direction:column;
  }

  .ms-calendar-header-actions{
    width:100%;
  }

  .ms-calendar-header-actions .ms-cal-button{
    flex:1;
  }

  .ms-calendar-toolbar{
    flex-wrap:wrap;
  }

  .ms-calendar-toolbar h2{
    order:-1;
    width:100%;
    text-align:center;
  }

  .ms-calendar-layout{
    display:block;
    min-height:0;
    overflow:visible;
  }

  .ms-calendar-sidebar{
    border-right:0;
    border-bottom:1px solid var(--cal-border);
  }

  .ms-cal-category-list{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:4px 12px;
  }

  .ms-calendar-main{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  .ms-cal-form-row{
    flex-direction:column;
  }

  .ms-cal-form-row > label{
    width:100%;
  }

  .ms-cal-toast{
    right:16px;
    bottom:16px;
  }
}


/* ============================================================
   OMNIA CALENDAR R1C — glossy navigation icon
   ============================================================ */

.ms-nav-icon-calendar-glossy{
  display:grid;
  place-items:center;
}

.ms-calendar-icon-art{
  position:relative;
  display:block;
  width:38px;
  height:38px;
  border-radius:11px;
  border:1px solid rgba(82,109,255,.48);
  background:
    linear-gradient(145deg,
      rgba(255,255,255,.96) 0%,
      rgba(219,229,255,.96) 43%,
      rgba(123,151,255,.92) 100%);
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,.95),
    inset 0 -3px 5px rgba(41,68,174,.24),
    0 4px 9px rgba(39,66,148,.28);
}

.ms-calendar-icon-art::before{
  content:"";
  position:absolute;
  left:5px;
  right:5px;
  top:6px;
  height:9px;
  border-radius:6px 6px 3px 3px;
  background:linear-gradient(180deg,#7958ff,#416cf4);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.55),
    0 1px 2px rgba(30,41,120,.24);
}

.ms-calendar-icon-rings::before,
.ms-calendar-icon-rings::after{
  content:"";
  position:absolute;
  z-index:2;
  top:2px;
  width:4px;
  height:9px;
  border-radius:3px;
  background:linear-gradient(#f8fbff,#8095d8);
  box-shadow:0 1px 2px rgba(23,42,105,.35);
}

.ms-calendar-icon-rings::before{left:10px}
.ms-calendar-icon-rings::after{right:10px}

.ms-calendar-icon-sheet{
  position:absolute;
  left:7px;
  right:7px;
  top:17px;
  bottom:6px;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:2px;
}

.ms-calendar-icon-sheet span{
  border-radius:2px;
  background:rgba(255,255,255,.94);
  box-shadow:
    inset 0 -1px 1px rgba(61,85,173,.16),
    0 1px 1px rgba(255,255,255,.7);
}

/* ============================================================
   View selector
   ============================================================ */

.ms-calendar-view-switch{
  display:flex;
  align-items:center;
  padding:3px;
  gap:2px;
  border:1px solid var(--cal-border);
  border-radius:12px;
  background:rgba(148,163,184,.07);
}

.ms-calendar-view-switch button{
  border:0;
  border-radius:8px;
  padding:7px 11px;
  background:transparent;
  color:var(--cal-muted);
  font:inherit;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}

.ms-calendar-view-switch button.active{
  background:var(--cal-surface-strong);
  color:inherit;
  box-shadow:
    0 1px 4px rgba(15,23,42,.12),
    inset 0 0 0 1px var(--cal-border);
}

/* ============================================================
   Week / day hourly grids
   ============================================================ */

.ms-cal-time-layout{
  min-width:0;
  background:var(--cal-surface-strong);
}

.ms-cal-week-layout{
  display:grid;
  grid-template-columns:
    68px repeat(7,minmax(130px,1fr));
  min-width:980px;
}

.ms-cal-day-layout{
  display:grid;
  grid-template-columns:78px minmax(500px,1fr);
  min-width:650px;
}

.ms-cal-time-corner,
.ms-cal-time-day-head{
  position:sticky;
  top:0;
  z-index:4;
  min-height:62px;
  border:0;
  border-right:1px solid var(--cal-border);
  border-bottom:1px solid var(--cal-border);
  background:var(--cal-surface-strong);
}

.ms-cal-time-corner{
  left:0;
  z-index:5;
}

.ms-cal-time-day-head{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  color:inherit;
  font:inherit;
  cursor:pointer;
}

.ms-cal-time-day-head strong{
  color:var(--cal-muted);
  font-size:10px;
  text-transform:uppercase;
}

.ms-cal-time-day-head span{
  display:grid;
  place-items:center;
  width:29px;
  height:29px;
  border-radius:50%;
  font-size:13px;
  font-weight:750;
}

.ms-cal-time-day-head.is-today span{
  background:var(--cal-accent);
  color:#fff;
}

.ms-cal-time-hour{
  min-height:58px;
  box-sizing:border-box;
  padding:7px 9px 0 0;
  border-right:1px solid var(--cal-border);
  border-bottom:1px solid var(--cal-border);
  color:var(--cal-muted);
  font-size:10px;
  text-align:right;
}

.ms-cal-time-cell{
  position:relative;
  min-height:58px;
  box-sizing:border-box;
  padding:3px;
  border-right:1px solid var(--cal-border);
  border-bottom:1px solid var(--cal-border);
  cursor:pointer;
}

.ms-cal-time-cell:hover{
  background:rgba(59,130,246,.04);
}

.ms-cal-timed-event{
  display:flex;
  flex-direction:column;
  width:100%;
  min-width:0;
  margin:0 0 2px;
  padding:5px 7px;
  overflow:hidden;
  border:0;
  border-left:3px solid var(--cal-event-color);
  border-radius:6px;
  background:
    color-mix(in srgb,var(--cal-event-color) 14%,transparent);
  color:inherit;
  text-align:left;
  font:inherit;
  cursor:pointer;
}

.ms-cal-timed-event strong{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:11px;
}

.ms-cal-timed-event span{
  margin-top:2px;
  color:var(--cal-muted);
  font-size:9px;
}

@media (max-width:767px){
  .ms-calendar-view-switch{
    width:100%;
    order:3;
  }

  .ms-calendar-view-switch button{
    flex:1;
  }

  .ms-cal-week-layout{
    min-width:900px;
  }

  .ms-cal-day-layout{
    min-width:520px;
  }
}


/* ============================================================
   OMNIA CALENDAR R1D — SIDEBAR ICON SCALE/COLOR
   ============================================================ */

.ms-nav-icon-calendar-glossy{
  width:28px !important;
  height:28px !important;
  min-width:28px !important;
  display:grid !important;
  place-items:center !important;
  overflow:visible;
}

.ms-nav-icon-calendar-glossy .ms-calendar-icon-art{
  width:24px !important;
  height:24px !important;
  border-radius:7px !important;
  border:1px solid rgba(84,74,230,.55) !important;

  background:
    linear-gradient(
      145deg,
      #ffffff 0%,
      #e9edff 27%,
      #9ba9ff 62%,
      #6a5cff 100%
    ) !important;

  box-shadow:
    inset 0 1px 2px rgba(255,255,255,.98),
    inset 0 -2px 3px rgba(61,45,173,.30),
    0 2px 5px rgba(45,54,155,.28) !important;
}

.ms-nav-icon-calendar-glossy
.ms-calendar-icon-art::before{
  left:3px !important;
  right:3px !important;
  top:4px !important;
  height:6px !important;
  border-radius:4px 4px 2px 2px !important;

  background:
    linear-gradient(
      90deg,
      #ef3d68 0%,
      #ff6a42 27%,
      #ffbd31 50%,
      #36c985 73%,
      #5577ff 100%
    ) !important;
}

.ms-nav-icon-calendar-glossy
.ms-calendar-icon-rings::before,
.ms-nav-icon-calendar-glossy
.ms-calendar-icon-rings::after{
  top:1px !important;
  width:3px !important;
  height:6px !important;
}

.ms-nav-icon-calendar-glossy
.ms-calendar-icon-rings::before{
  left:6px !important;
}

.ms-nav-icon-calendar-glossy
.ms-calendar-icon-rings::after{
  right:6px !important;
}

.ms-nav-icon-calendar-glossy
.ms-calendar-icon-sheet{
  left:4px !important;
  right:4px !important;
  top:11px !important;
  bottom:4px !important;
  gap:1px !important;
}

.ms-nav-icon-calendar-glossy
.ms-calendar-icon-sheet span:nth-child(1){
  background:#ff6c7c;
}

.ms-nav-icon-calendar-glossy
.ms-calendar-icon-sheet span:nth-child(2){
  background:#ffbd3d;
}

.ms-nav-icon-calendar-glossy
.ms-calendar-icon-sheet span:nth-child(3){
  background:#53d39a;
}

.ms-nav-icon-calendar-glossy
.ms-calendar-icon-sheet span:nth-child(4){
  background:#5ba9ff;
}

.ms-nav-icon-calendar-glossy
.ms-calendar-icon-sheet span:nth-child(5){
  background:#796cff;
}

.ms-nav-icon-calendar-glossy
.ms-calendar-icon-sheet span:nth-child(6){
  background:#dc6cff;
}

/* ============================================================
   EXTERNAL CALENDAR CONNECTION PANEL
   ============================================================ */

.ms-cal-external-dialog{
  width:min(650px,calc(100vw - 28px));
}

.ms-cal-external-content{
  display:flex;
  flex-direction:column;
  gap:18px;
  padding:22px;
}

.ms-cal-external-content header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
}

.ms-cal-external-content header small{
  color:var(--cal-muted);
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.07em;
}

.ms-cal-external-content header h2{
  margin:3px 0 5px;
}

.ms-cal-external-content header p{
  margin:0;
  color:var(--cal-muted);
  font-size:13px;
}

.ms-cal-external-content header > button{
  border:0;
  background:transparent;
  color:inherit;
  font-size:27px;
  cursor:pointer;
}

.ms-cal-provider-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.ms-cal-provider{
  display:grid;
  grid-template-columns:46px minmax(0,1fr) auto;
  align-items:center;
  gap:13px;
  width:100%;
  padding:12px;
  border:1px solid var(--cal-border);
  border-radius:13px;
  background:var(--cal-surface-strong);
  color:inherit;
  text-align:left;
  font:inherit;
  cursor:pointer;
  transition:
    transform .15s ease,
    border-color .15s ease,
    box-shadow .15s ease;
}

.ms-cal-provider:hover{
  transform:translateY(-1px);
  border-color:rgba(59,130,246,.40);
  box-shadow:0 5px 16px rgba(15,23,42,.08);
}

.ms-cal-provider-icon{
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border-radius:11px;
  font-weight:800;
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,.8),
    0 2px 5px rgba(15,23,42,.12);
}

.ms-cal-provider-icon.google{
  background:
    linear-gradient(
      135deg,
      #4285f4 0 25%,
      #34a853 25% 50%,
      #fbbc05 50% 75%,
      #ea4335 75%
    );
}

.ms-cal-provider-icon.google span{
  display:grid;
  place-items:center;
  width:27px;
  height:27px;
  border-radius:5px;
  background:#fff;
  color:#4285f4;
  font-size:13px;
}

.ms-cal-provider-icon.microsoft{
  grid-template-columns:repeat(2,12px);
  grid-template-rows:repeat(2,12px);
  gap:2px;
  background:#f4f7fb;
}

.ms-cal-provider-icon.microsoft i:nth-child(1){
  background:#f35325;
}
.ms-cal-provider-icon.microsoft i:nth-child(2){
  background:#81bc06;
}
.ms-cal-provider-icon.microsoft i:nth-child(3){
  background:#05a6f0;
}
.ms-cal-provider-icon.microsoft i:nth-child(4){
  background:#ffba08;
}

.ms-cal-provider-icon.icloud{
  background:linear-gradient(145deg,#5cc8ff,#2774ff);
  color:#fff;
  font-size:23px;
}

.ms-cal-provider-icon.caldav{
  background:linear-gradient(145deg,#55d7b0,#168b73);
  color:#fff;
  font-size:22px;
}

.ms-cal-provider-copy{
  display:flex;
  flex-direction:column;
  min-width:0;
  gap:3px;
}

.ms-cal-provider-copy strong{
  font-size:13px;
}

.ms-cal-provider-copy small{
  color:var(--cal-muted);
  font-size:11px;
}

.ms-cal-provider-status{
  padding:6px 9px;
  border-radius:8px;
  background:rgba(59,130,246,.08);
  color:#2563eb;
  font-size:11px;
  font-weight:750;
}

.ms-cal-provider-notice{
  padding:11px 13px;
  border-radius:10px;
  background:rgba(148,163,184,.08);
  color:var(--cal-muted);
  font-size:11px;
  line-height:1.5;
}

@media(max-width:767px){
  .ms-cal-provider{
    grid-template-columns:42px minmax(0,1fr);
  }

  .ms-cal-provider-status{
    grid-column:2;
    justify-self:start;
  }
}
