.signed-in-dashboard #dashboardPlannerPanel #timetableMode {
  background: #eaf3fd;
  border-radius: 9px;
  color: #173f77;
}

.signed-in-dashboard #dashboardPlannerPanel #myTimetableOpen { gap: 9px; }
.my-timetable-menu-icon {
  width: 28px;
  height: 28px;
  flex: none;
  padding: 5px;
  background: #d2f3e9;
  color: #087b65;
  border-radius: 7px;
}

#myTimetableDialog {
  width: min(1320px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  background: #fff;
  color: #131f39;
  border: 1px solid #cedaea;
  border-radius: 20px;
  box-shadow: 0 18px 54px #0e1e4563;
}

#myTimetableDialog::backdrop { background: #0f203477; }
#myTimetableDialog [hidden] { display: none !important; }
.my-timetable-layout { display: flex; flex-direction: column; max-height: inherit; }
.my-timetable-header {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.6vw, 20px);
  flex: none;
  padding: clamp(11px, 2.3vw, 24px);
  background: #111e36;
  color: #fff;
}

.my-timetable-header-icon { width: 34px; height: 34px; flex: none; color: #ffc752; }
.my-timetable-identity { flex: 1; min-width: 0; }
.my-timetable-identity h2 { margin: 0; color: inherit; font-size: clamp(1.2rem, 2.8vw, 1.85rem); }
.my-timetable-meta {
  width: fit-content;
  margin: 5px 0 0;
  padding: 4px 8px;
  font-size: .78rem;
  line-height: 1.25;
  border-radius: 999px;
  background: #26385a;
  color: #deebff;
}

#myTimetableDialog button { font: inherit; cursor: pointer; }
#myTimetableDialog button:disabled { opacity: .6; cursor: default; }
#myTimetableDialog :focus-visible { outline: 3px solid #dfa429; outline-offset: 1px; }
#editTimetableBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 40%;
  min-height: 38px;
  padding: 5px 9px;
  background: #ffd06519;
  color: #ffd065;
  border: 1px solid #dfad38;
  border-radius: 9px;
}

#editTimetableBtn::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: none;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 21l5-1 12-12a2.8 2.8 0 0 0-4-4L4 16l-1 5zm11-15 4 4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

#myTimetableClose {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  background: #2b3b58;
  color: #eef4ff;
  border: 0;
  border-radius: 50%;
  font-size: 1.4rem !important;
}

.my-timetable-week {
  min-height: 0;
  margin: 0;
  padding: clamp(9px, 2vw, 23px);
  overflow: auto;
  overscroll-behavior: contain;
}

.my-timetable-table {
  width: 100%;
  border: 1px solid #d9e1ee;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  color: #152541;
  text-align: start;
}

.my-timetable-table th, .my-timetable-table td { border-block-end: 1px solid #d9e1ee; padding: 6px; }
.my-timetable-table tbody tr:last-child > * { border-block-end: 0; }
.my-timetable-table th {
  background: #f2f6fb;
  font-size: .85rem;
  text-align: start;
}

.my-timetable-table thead th { position: sticky; inset-block-start: 0; z-index: 2; }
.my-timetable-table .my-timetable-weekday {
  position: sticky;
  inset-inline-start: 0;
  padding: 8px 10px;
  border-inline-end: 1px solid #d9e1ee;
  z-index: 1;
}

.my-timetable-table thead .my-timetable-weekday { z-index: 3; }
.my-timetable-table tbody .my-timetable-weekday { background: #fbfcfe; }
.my-timetable-table .my-timetable-period-heading { min-width: 75px; text-align: center; }
.my-timetable-weekday :is(.my-timetable-today, .my-timetable-closure) { display: table; margin-block-start: 5px; }
.my-timetable-table thead th:first-child { border-start-start-radius: 11px; }
.my-timetable-table thead th:last-child { border-start-end-radius: 11px; }
.my-timetable-closure, .my-timetable-day-notice { color: #865a07; }
.my-timetable-empty { display: block; text-align: center; color: #627593; }
.my-timetable-time {
  display: block;
  color: #425773;
  font-size: .76rem;
  line-height: 1.2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.my-timetable-period {
  display: flex;
  align-items: flex-start;
  align-content: center;
  flex-wrap: wrap;
  gap: 3px 6px;
  min-height: 53px;
  padding: 6px 7px;
  background: var(--period-tint, #e3f2ff);
  color: var(--period-ink, #174c87);
  border-inline-start: 4px solid var(--period-line, #4187d6);
  border-radius: 9px;
}

.my-timetable-class { flex: 1; min-width: 0; font-weight: 800; overflow-wrap: anywhere; }
.my-timetable-class-code { flex-basis: auto; white-space: nowrap; }
.my-timetable-period .my-timetable-time { flex: 1 0 100%; order: 1; }
.my-timetable-period[data-color="1"] { --period-tint: #e1f6ed; --period-ink: #12614c; --period-line: #28a382; }
.my-timetable-period[data-color="2"] { --period-tint: #eeeafe; --period-ink: #4b3292; --period-line: #7f63dd; }
.my-timetable-period[data-color="3"] { --period-tint: #fff2d8; --period-ink: #7b4b03; --period-line: #d2932b; }
.my-timetable-period[data-color="4"] { --period-tint: #fce9f0; --period-ink: #882d53; --period-line: #d45d8e; }
.my-timetable-period[data-color="5"] { --period-tint: #e0f6f6; --period-ink: #115965; --period-line: #339aa7; }
.my-timetable-period.my-timetable-free { --period-tint: #f0f2f5; --period-ink: #53647c; --period-line: transparent; }
.my-timetable-period[aria-current="time"] { outline: 2px solid #df9b1b; outline-offset: -1px; box-shadow: 0 0 9px #ffd56d69; }
.my-timetable-closed .my-timetable-period { filter: saturate(.3); }

.my-timetable-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.my-timetable-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  display: inline-block;
  margin-inline-end: 2px;
  background: currentColor;
  border-radius: 50%;
}

.my-timetable-today { color: #125498; background: #e3f2ff; }
.my-timetable-now { margin-inline-start: auto; color: #784c03; background: #ffedbe; }
.my-timetable-table .my-timetable-break-cell {
  width: 34px;
  min-width: 30px;
  padding: 4px;
  border-inline: 1px dashed #ccd7e8;
  background: #f2f5f9;
}

.my-timetable-break-label {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin: auto;
  color: #465e80;
  font-size: .68rem;
  white-space: nowrap;
}

.my-timetable-break-cell[rowspan] .my-timetable-break-label {
  width: max-content;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.my-timetable-break-cell:not([rowspan]) .my-timetable-break-label { flex-direction: column; gap: 3px; }
.my-timetable-break-cell:not([rowspan]) .my-timetable-time { font-size: .58rem; }
.my-timetable-break-label .my-timetable-time { font-size: inherit; }
.my-timetable-footer {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px clamp(10px, 2vw, 23px) max(10px, env(safe-area-inset-bottom));
  border-block-start: 1px solid #d9e1ee;
  background: #f5f8fc;
  font-size: .84rem;
}

.my-timetable-footer p { margin: 0; color: #3f5573; }
.my-timetable-footer .my-timetable-today { margin-inline-start: 6px; }
#myTimetablePrintButton {
  flex: none;
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid #bfcde2;
  border-radius: 8px;
  background: #fff;
  color: #19375d;
}

.my-timetable-days, .my-timetable-day, .my-timetable-print { display: none; }

@media (orientation: portrait) and (max-width: 700px) {
  #myTimetableDialog {
    width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh;
    margin: 0; border: 0; border-radius: 0;
  }
  .my-timetable-layout { height: 100%; }
  .my-timetable-header { padding-block-start: max(11px, env(safe-area-inset-top)); }
  .my-timetable-header-icon { display: none; }
  #myTimetableDialog #editTimetableBtn { font-size: 0; white-space: nowrap; }
  #editTimetableBtn::after { content: "Edit"; font-size: .87rem; }
  [dir="rtl"] #editTimetableBtn::after { content: "تعديل"; }
  #myTimetableClose { order: -1; font-size: 0 !important; }
  #myTimetableClose::before { content: "←"; font-size: 1.3rem; }
  [dir="rtl"] #myTimetableClose::before { content: "→"; }
  .my-timetable-week { display: none; }
  .my-timetable-days {
    display: flex;
    gap: 6px;
    padding: 9px 11px;
    overflow: auto;
    flex: none;
    border-block-end: 1px solid #d9e1ee;
    background: #ebf3fb;
  }
  .my-timetable-days:empty { display: none; }
  #myTimetableDialog .my-timetable-day-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: none;
    min-height: 36px;
    padding: 4px 9px;
    border: 1px solid #c2d2e7;
    border-radius: 999px;
    color: #16345b;
    background: #f5f9fe;
    font-size: .84rem;
    font-weight: 750;
  }
  #myTimetableDialog .my-timetable-day-button[aria-pressed="true"] {
    border-color: #192f4f;
    background: #192f4f;
    color: white;
  }
  .my-timetable-day { display: block; flex: 1; overflow: auto; padding: 10px; overscroll-behavior: contain; }
  .my-timetable-day-list { display: grid; gap: 7px; padding: 0; margin: 0; list-style: none; }
  .my-timetable-day-entry { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 8px; align-items: center; }
  .my-timetable-when { display: grid; gap: 4px; font-weight: 800; font-size: .9rem; }
  .my-timetable-day-break { display: flex; align-items: center; gap: 5px; padding-block: 3px; }
  .my-timetable-day-break::before, .my-timetable-day-break::after { content: ""; flex: 1; border-block-start: 1px solid #d9e1ee; }
  .my-timetable-day-break-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 7px;
    border: 1px solid #d9e1ee;
    border-radius: 999px;
    color: #425773;
    font-size: .76rem;
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  #myTimetableDialog { width: 100%; max-height: 100dvh; border-radius: 0; }
  .my-timetable-layout { height: 100dvh; }
  .my-timetable-header { padding: 5px 12px; }
  .my-timetable-header-icon { width: 24px; height: 24px; }
  .my-timetable-meta { margin-block-start: 2px; padding: 2px 6px; font-size: .68rem; }
  .my-timetable-week { flex: 1; padding: 7px; }
  .my-timetable-table th, .my-timetable-table td { padding: 3px; }
  .my-timetable-table .my-timetable-period-heading { min-width: 66px; font-size: .75rem; }
  .my-timetable-period { min-height: 39px; padding: 3px 4px; font-size: .82rem; }
  .my-timetable-now { padding-inline: 3px; gap: 2px; font-size: .6rem; }
  .my-timetable-now::before { width: 4px; height: 4px; margin: 0; }
  .my-timetable-time { font-size: .67rem; }
  .my-timetable-footer { padding-block: 3px max(3px, env(safe-area-inset-bottom)); }
  #myTimetablePrintButton { min-height: 28px; }
}

@media print {
  @page my-timetable { size: A4 landscape; margin: 10mm; }
  html:has(body.my-timetable-printing), body.my-timetable-printing {
    background: #fff !important;
    min-block-size: 0;
  }
  body.my-timetable-printing > :not(#myTimetablePrint), body.my-timetable-printing #myTimetableDialog { display: none !important; }
  #myTimetablePrint { display: block; page: my-timetable; color: black; font-size: 11pt; inline-size: 100%; }
  #myTimetablePrint h1 { font-size: 22pt; margin: 0; }
  #myTimetablePrint p { margin-block: 5pt 9pt; }
  #myTimetablePrint .my-timetable-table {
    --print-label-size: 12pt;
    --print-time-size: 9pt;
    --print-break-width: 20pt;
    inline-size: 100%;
    table-layout: fixed;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  #myTimetablePrint [data-print-dense] {
    --print-body-height: 126mm;
    --print-label-size: 9pt;
    --print-time-size: 8pt;
    --print-break-width: 15pt;
  }
  #myTimetablePrint th, #myTimetablePrint td { padding: 2pt; position: static; vertical-align: middle; }
  #myTimetablePrint thead th { height: 13mm; }
  #myTimetablePrint tr { break-inside: avoid; }
  #myTimetablePrint .my-timetable-weekday { inline-size: 66pt; overflow-wrap: anywhere; }
  #myTimetablePrint .my-timetable-break-cell { inline-size: var(--print-break-width); min-inline-size: 0; }
  #myTimetablePrint .my-timetable-period-heading { min-inline-size: 0; font-size: var(--print-label-size); }
  #myTimetablePrint .my-timetable-period {
    box-sizing: border-box;
    justify-content: center;
    text-align: center;
    min-block-size: calc(var(--print-body-height, 141mm) / var(--print-days) - 4pt);
    padding: 3pt 2pt;
    border-inline-start-width: 2pt;
    font-size: var(--print-label-size);
  }
  #myTimetablePrint :is(.my-timetable-class-code, .my-timetable-time, .my-timetable-break-label) {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #myTimetablePrint .my-timetable-time { font-size: var(--print-time-size); }
  #myTimetablePrint .my-timetable-break-label { gap: 2pt; }
  #myTimetablePrint .my-timetable-break-cell:not([rowspan]) .my-timetable-time { font-size: 7pt; }
  #myTimetablePrint .my-timetable-badge { display: none !important; }
  #myTimetablePrint [aria-current="time"] { outline: none; box-shadow: none; }
}
