:root {
  font-family: ui-rounded, "Avenir Next", system-ui, sans-serif;
  color: #24334f;
  background: #fcfaf3;
  --teal: #258478;
  --line: #e4e2d5;
  --mint: #e1f3e9;
  --sun: #fff1c4;
  --coral: #fbe7df;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 9px 18px;
  color: inherit;
  background: #fffdfa;
  font-weight: 650;
}
button:hover {
  background: var(--mint);
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #d29a35;
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.primary {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
  box-shadow: 0 4px 0 #b8d5c9;
}
.primary:hover {
  background: #1b7066;
}
.danger {
  color: #a43d2b;
}
.active {
  background: var(--mint);
  border-color: var(--teal);
}
header {
  border-bottom: 1px solid var(--line);
  background: #fcfaf3;
}
header > div,
main {
  max-width: 1152px;
  margin: auto;
  padding: 16px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 850;
  font-size: 22px;
  white-space: nowrap;
}
.brand img {
  height: 48px;
  width: 45px;
}
header > div,
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
nav button {
  border: 0;
  background: transparent;
  font-size: 14px;
}
.sync {
  font-size: 12px;
  background: var(--mint);
  padding: 8px 12px;
  border-radius: 20px;
}
main {
  padding-top: 28px;
  padding-bottom: 50px;
}
.card {
  border: 1px solid var(--line);
  background: #fffefa;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 5px 0 -2px #e4e2d5;
  margin-bottom: 22px;
}
.hero {
  display: flex;
  align-items: center;
  gap: 22px;
}
.hero > div {
  flex: 1;
}
.hero img {
  width: 112px;
  height: 120px;
  animation: bob 3.2s ease-in-out infinite;
}
.bubble {
  background: var(--sun);
  display: inline-block;
  padding: 7px 13px;
  border-radius: 15px 15px 15px 0;
  font-size: 13px;
  font-weight: 600;
}
h1 {
  font-size: 32px;
  letter-spacing: -1px;
  margin: 10px 0;
}
h2 {
  font-size: 21px;
  margin: 0 0 10px;
}
h3 {
  font-size: 16px;
  margin: 0 0 8px;
}
p {
  line-height: 1.6;
}
small,
.muted {
  color: #667180;
}
small {
  font-size: 13px;
}
.week {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}
.day {
  min-height: 178px;
  border: 2px solid transparent;
  border-radius: 23px;
  text-align: left;
  padding: 16px;
  background: #fffefa;
  box-shadow: 0 5px 0 -2px #e4e2d5;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.day.selected {
  border-color: var(--teal);
}
.day strong {
  font-size: 17px;
}
.pill {
  display: inline-block;
  background: var(--mint);
  border-radius: 14px;
  padding: 5px 10px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.off {
  background: var(--coral);
}
.leave {
  background: var(--sun);
}
.names {
  display: grid;
  gap: 5px;
}
.names .pill {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.columns {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.item:last-child {
  border-bottom: 0;
}
.item p {
  margin: 3px 0;
}
.empty {
  background: var(--mint);
  padding: 18px;
  border-radius: 16px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin: 20px 0;
}
.metric {
  border-radius: 20px;
  background: var(--mint);
  padding: 20px;
}
.metric:nth-child(2) {
  background: var(--sun);
}
.metric:nth-child(3) {
  background: var(--coral);
}
.number {
  font-size: 34px;
  font-weight: 850;
  display: block;
  margin-top: 8px;
}
.bar {
  display: grid;
  grid-template-columns: 48px 1fr 30px;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
}
progress {
  width: 100%;
  height: 17px;
  accent-color: var(--teal);
}
label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 650;
  margin: 14px 0;
}
input,
select {
  min-height: 46px;
  width: 100%;
  border: 1px solid #cacdc6;
  border-radius: 12px;
  background: white;
  padding: 10px;
  color: inherit;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 14px;
}
td,
th {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 24px;
  width: min(520px, calc(100% - 28px));
  padding: 26px;
  color: inherit;
  background: #fffefa;
}
dialog::backdrop {
  background: #24334f70;
  backdrop-filter: blur(3px);
}
dialog form > button {
  margin-top: 16px;
}
.error {
  background: var(--coral);
  border-radius: 12px;
  padding: 14px;
  color: #923e2e;
}
.gate {
  max-width: 470px;
  margin: 9vh auto;
  padding: 24px;
}
.gate .card {
  text-align: center;
  padding: 34px;
}
.gate img {
  height: 130px;
}
.gate label {
  text-align: left;
}
.gate button {
  width: 100%;
  margin-top: 12px;
}
footer {
  font-size: 12px;
  color: #667180;
  text-align: center;
  margin-top: 24px;
}
#notice:not(:empty) {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 16px 24px;
  border-radius: 16px;
  background: #24334f;
  color: white;
  z-index: 20;
  max-width: 90%;
  box-shadow: 0 5px 20px #0003;
}
@keyframes bob {
  50% {
    transform: translateY(-5px);
  }
}
@media (max-width: 700px) {
  header > div,
  main {
    padding: 14px;
  }
  .brand {
    font-size: 19px;
  }
  nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .sync {
    margin-left: auto;
  }
  .hero {
    gap: 12px;
    flex-wrap: wrap;
  }
  .hero img {
    width: 80px;
    height: 90px;
  }
  .hero h1 {
    font-size: 25px;
  }
  .hero .primary {
    width: 100%;
  }
  .card {
    padding: 18px;
  }
  .week {
    gap: 6px;
  }
  .day {
    padding: 8px 5px;
    min-height: 125px;
    gap: 8px;
  }
  .day strong {
    font-size: 12px;
  }
  .day small {
    font-size: 10px;
  }
  .day .row {
    gap: 3px;
  }
  .day .pill {
    padding: 4px 6px;
    font-size: 10px;
  }
  .day .names {
    display: none;
  }
  .columns {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .metrics {
    gap: 8px;
  }
  .metric {
    padding: 12px;
    font-size: 12px;
  }
  .number {
    font-size: 26px;
  }
  .grid2 {
    gap: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

.short-day {
  display: none;
}
@media (max-width: 700px) {
  .long-day {
    display: none;
  }
  .short-day {
    display: inline;
  }
  nav {
    flex-wrap: nowrap;
  }
  nav button {
    padding: 8px 12px;
    font-size: 13px;
  }
}

.doctor-picker {
  border: 1px solid var(--line);
  border-radius: 16px;
  max-height: 280px;
  overflow: auto;
  padding: 14px;
}
.doctor-picker legend {
  font-weight: 700;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: var(--mint);
  margin: 8px 0;
}
.check input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  accent-color: var(--teal);
}
.absence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: 16px;
  margin: 20px 0;
}
.absent-card {
  background: var(--sun);
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
}
.absent-card:nth-child(3n + 2) {
  background: var(--mint);
}
.absent-card:nth-child(3n + 3) {
  background: var(--coral);
}
.absent-info {
  flex: 1;
  min-width: 130px;
  overflow-wrap: anywhere;
}
.break-scene {
  position: relative;
  width: 110px;
  height: 116px;
  flex-shrink: 0;
  text-align: center;
  padding-top: 16px;
}
.break-face {
  display: block;
  font-size: 42px;
  animation: break-breathe 3s ease-in-out infinite;
}
.break-prop {
  position: absolute;
  right: 5px;
  top: 43px;
  font-size: 28px;
  animation: break-sip 3.6s ease-in-out infinite;
}
.sleep .break-prop {
  top: 2px;
  font-size: 22px;
  animation: break-float 3s ease-out infinite;
}
.break-puff {
  position: absolute;
  right: 0;
  top: 0;
  font-size: 17px;
  color: var(--teal);
  animation: break-float 2.8s ease-out infinite;
}
.break-scene small {
  display: block;
  font-size: 11px;
  margin-top: 12px;
  color: #475366;
}
.tea .break-prop {
  animation-delay: 1s;
}
.sleep .break-face {
  animation: break-snooze 4s ease-in-out infinite;
}
.doctor-link {
  background: transparent;
  border: 0;
  text-align: left;
  color: var(--teal);
  padding: 6px 0;
  border-radius: 4px;
}
summary {
  cursor: pointer;
  font-weight: 700;
  min-height: 32px;
}
@keyframes break-sip {
  0%,
  100% {
    transform: rotate(0) translateY(0);
  }
  45%,
  65% {
    transform: rotate(-18deg) translate(-8px, -12px);
  }
}
@keyframes break-breathe {
  50% {
    transform: translateY(-4px) rotate(4deg);
  }
}
@keyframes break-snooze {
  50% {
    transform: rotate(-12deg) translateY(3px);
  }
}
@keyframes break-float {
  0% {
    opacity: 0;
    transform: translateY(9px) scale(0.8);
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-12px) scale(1.1);
  }
}
/* Original little doctors: no emoji stand-ins for the break scenes. */
.doctor-scene {
  width: 155px;
  flex-shrink: 0;
  text-align: center;
}
.doctor-scene svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.doctor-scene small {
  font-size: 11px;
  color: #475366;
  display: block;
  margin-top: 4px;
}
.scene-head {
  transform-box: fill-box;
  transform-origin: 50% 90%;
  animation: doctor-nod 4s ease-in-out infinite;
}
.sleep .scene-head {
  animation: doctor-dream 4s ease-in-out infinite;
}
.scene-sip {
  transform-box: fill-box;
  transform-origin: 30% 85%;
  animation: doctor-sip 5s ease-in-out infinite;
}
.tea .scene-sip {
  animation-delay: 1.7s;
}
.scene-steam {
  animation: doctor-steam 3s ease-out infinite;
}
.scene-zzz text {
  animation: doctor-snore 3.5s ease-out infinite;
}
.scene-zzz text:nth-child(2) {
  animation-delay: 0.6s;
}
.scene-zzz text:nth-child(3) {
  animation-delay: 1.2s;
}
.scene-eyes {
  transform-box: fill-box;
  transform-origin: center;
  animation: doctor-blink 6s infinite;
}
.sleep .scene-eyes {
  animation: none;
}
.break-joke {
  font-size: 14px;
  font-style: italic;
  line-height: 1.5;
  margin: 14px 0 18px;
  min-height: 42px;
}
.absent-card > .row:first-child {
  align-items: center;
}
.roast-board {
  display: flex;
  align-items: center;
  gap: 24px;
  border: 2px dashed #d1b56c;
  background: #fff3cb;
  border-radius: 24px;
  padding: 24px;
  margin: 0 0 24px;
}
.roast-copy {
  flex: 1;
  min-width: 0;
}
.roast-copy > small:first-child {
  font-size: 10px;
  letter-spacing: 1px;
}
.roast-copy h2 {
  margin: 8px 0;
  overflow-wrap: anywhere;
}
.roast-copy p {
  margin: 8px 0 16px;
}
.roast-note {
  display: block;
  font-size: 11px;
  margin-top: 10px;
}
.trophy {
  position: relative;
  font-size: 64px;
  animation: pillow-wobble 5s ease-in-out infinite;
}
.trophy span {
  position: absolute;
  top: -15px;
  right: -16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--teal);
  animation: doctor-snore 4s infinite;
}
@keyframes doctor-nod {
  50% {
    transform: rotate(6deg);
  }
}
@keyframes doctor-dream {
  50% {
    transform: rotate(-7deg) translateY(2px);
  }
}
@keyframes doctor-sip {
  0%,
  25%,
  85%,
  100% {
    transform: none;
  }
  45%,
  65% {
    transform: translate(-7px, -10px) rotate(-15deg);
  }
}
@keyframes doctor-steam {
  0% {
    opacity: 0;
    transform: translateY(5px);
  }
  45% {
    opacity: 0.65;
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}
@keyframes doctor-snore {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-8px);
  }
}
@keyframes doctor-blink {
  0%,
  92%,
  100% {
    transform: scaleY(1);
  }
  95% {
    transform: scaleY(0.1);
  }
}
@keyframes pillow-wobble {
  0%,
  90%,
  100% {
    transform: rotate(0);
  }
  93% {
    transform: rotate(-9deg);
  }
  96% {
    transform: rotate(9deg);
  }
}
@media (max-width: 600px) {
  .roast-board {
    padding: 18px;
    gap: 12px;
    align-items: flex-start;
  }
  .trophy {
    font-size: 38px;
  }
  .roast-copy h2 {
    font-size: 19px;
  }
  .doctor-scene {
    width: 130px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .doctor-scene *,
  .trophy,
  .trophy * {
    animation: none !important;
  }
  .scene-zzz text,
  .scene-steam {
    opacity: 1;
  }
}

.break-joke {
  direction: rtl;
  text-align: right;
  font-style: normal;
}
.roast-copy[dir="rtl"] {
  text-align: right;
  line-height: 1.8;
  font-family: Tahoma, "Arial", sans-serif;
}
.roast-copy[dir="rtl"] > small:first-child {
  letter-spacing: 0;
}
.doctor-scene small {
  direction: rtl;
}
.bubble[lang="ar-EG"] {
  line-height: 1.6;
}
