.sa-calendar { font-family: var(--font-body, inherit); background: #fff; border: 1px solid rgba(20,32,44,.12); border-radius: 8px; padding: 14px; position: relative; }
.sa-calendar-header { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.sa-calendar-header h3 { margin:0; font-family:var(--font-headings, inherit); font-size:22px; }
.sa-header-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.sa-controls { display:flex !important; gap:6px; flex-wrap:nowrap !important; align-items:center; overflow-x:auto; overflow-y:hidden; padding-bottom:2px; -webkit-overflow-scrolling:touch; }
.sa-btn { border:1px solid #cfd7e3; background:#fff; padding:6px 12px; border-radius:999px; cursor:pointer; font-family:inherit; font-size:13px; line-height:1.2; white-space:nowrap; font-weight:600; width:auto !important; max-width:none !important; display:inline-flex !important; align-items:center; justify-content:center; }
.sa-controls .sa-btn { flex: 0 0 auto; }
.sa-segmented { display:inline-flex; align-items:center; gap:3px; padding:3px; border-radius:999px; background:#fff; border:1px solid #cfd7e3; }
.sa-segment { border:0; background:transparent; color:#647184; padding:6px 12px; border-radius:999px; cursor:pointer; font-family:inherit; font-size:12px; line-height:1; font-weight:700; letter-spacing:-0.01em; min-width:72px; transition:background .18s ease,color .18s ease, box-shadow .18s ease; }
.sa-segment.active { background:#2f3746; color:#fff; box-shadow:0 1px 0 rgba(255,255,255,.18) inset; }
.sa-segment:not(.active):hover { color:#223044; background:#f4f7fb; }
.sa-category-key { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 12px; }
.sa-category-badge { --sa-category-color:#2c3440; display:inline-flex; align-items:center; gap:6px; font-size:12px; line-height:1.2; padding:5px 8px; border-left:3px solid var(--sa-category-color); border-radius:6px; background:#f8fafc; color:#24303d; }
.sa-category-badge i { color:var(--sa-category-color); font-size:11px; }
.sa-btn.active { background: #2f3746; color: #fff; border-color: #2f3746; }
.sa-btn-icon { width: 34px; min-width: 34px; padding: 6px 0; text-align: center; border-radius: 10px; font-weight: 700; }
.sa-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; }
.sa-head { text-align:center; font-size:12px; font-weight:700; color:#556; text-transform:uppercase; }
.sa-day { min-height:105px; border:1px solid rgba(20,32,44,.1); border-radius:6px; padding:8px; position:relative; background:#fff; }
.sa-day-empty { background:transparent; border:none; }
.sa-day-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.sa-day-num { font-size:12px; font-weight:700; color:#223; }
.sa-day-add { width:22px; height:22px; border:1px solid #d6dee7; background:#fff; border-radius:999px; font-family:inherit; font-size:14px; line-height:1; font-weight:700; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; color:#2f3746; padding:0; }
.sa-day-add:hover { background:#f4f7fb; }
.sa-pill { --sa-category-color:transparent; display:flex; width:100%; text-align:left; border:0; border-left:3px solid var(--sa-category-color); border-radius:6px; padding:5px 8px; margin-top:6px; font-family:inherit; font-size:12px; cursor:pointer; color:#111; align-items:center; gap:6px; }
.sa-pill-icon { color:var(--sa-category-color); font-size:11px; flex:0 0 auto; }
.sa-pill-text { min-width:0; flex:1 1 auto; }
.sa-priority-low { background:#cfe8ff; }
.sa-priority-medium { background:#fff1b0; }
.sa-priority-high { background:#ffd0a3; }
.sa-status-completed { background:#e4e4e4; color:#555; }
.sa-list { margin-top:12px; display:grid; gap:10px; }
.sa-list-item { border:1px solid rgba(20,32,44,.1); border-radius:6px; padding:10px; background:#fff; }
.sa-list-category { margin-top:8px; }
.sa-modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.45); display:flex; align-items:center; justify-content:center; padding:16px; z-index:99999; }
.sa-modal { width:min(680px,100%); max-height:92vh; overflow:auto; background:#fff; border-radius:8px; padding:14px; }
.sa-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.sa-form-grid .sa-full { grid-column:1 / -1; }
.sa-form-grid input, .sa-form-grid select, .sa-form-grid textarea { width:100%; box-sizing:border-box; padding:8px; border:1px solid #ccd; border-radius:6px; font:inherit; }
.sa-form-actions { margin-top:10px; display:flex; gap:8px; flex-wrap:wrap; }
.sa-danger { background:#b3261e; color:#fff; border-color:#b3261e; }
.sa-today { border: 2px solid #1f5fae; box-shadow: 0 0 0 1px rgba(31,95,174,.25); }
.sa-drop-target { outline: 2px dashed #1f5fae; outline-offset: -2px; }
.sa-loading-msg { display: none; font-size: 12px; color: #475569; margin-bottom: 8px; }
.sa-calendar.is-loading .sa-loading-msg { display: block; }
.sa-toast-host { position: absolute; top: 10px; right: 10px; display: grid; gap: 6px; z-index: 5; pointer-events: none; }
.sa-toast { background: rgba(15,23,42,.9); color: #fff; border-radius: 6px; padding: 6px 8px; font-size: 12px; opacity: 0; transform: translateY(-4px); transition: opacity .2s ease, transform .2s ease; }
.sa-toast.ok { background: rgba(11,94,45,.92); }
.sa-toast.show { opacity: 1; transform: translateY(0); }
@media print {
  .sa-header-actions,
  .sa-btn {
    display: none;
  }

  button.sa-pill {
    display: table;
    overflow-wrap: break-word;
  }

  .sa-today {
    border: 1px solid rgba(20, 32, 44, .1);
    box-shadow: none;
  }
}
@media (max-width: 900px) {
  .sa-grid { overflow-x:auto; min-width:700px; }
  .sa-form-grid { grid-template-columns:1fr; }
}
@media (max-width: 760px) {
  .sa-calendar-header { align-items: flex-start; }
  .sa-header-actions { width:100%; justify-content:flex-start; }
  .sa-segment { min-width: 66px; padding: 6px 11px; font-size: 12px; }
  .sa-controls { width: 100%; gap: 6px; flex-wrap: nowrap !important; order: 3; }
  .sa-btn { font-size: 12px; padding: 6px 10px; }
  .sa-day { min-height: 112px; }
}
