:root {
  --forest: #123a35;
  --forest-deep: #0b2a27;
  --cream: #f4f0e7;
  --surface: rgba(255, 255, 255, 0.86);
  --line: rgba(23, 60, 56, 0.12);
  --coral-soft: #f17b67;
  --gold: #d6a654;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 8% 14%, rgba(241, 123, 103, 0.11), transparent 25%),
    radial-gradient(circle at 92% 90%, rgba(49, 124, 114, 0.1), transparent 28%),
    var(--cream);
}

header {
  position: relative;
  z-index: 5;
  height: 92px;
  padding: 0 30px;
  border-bottom: 0;
  background:
    radial-gradient(circle at 75% -80%, rgba(255, 255, 255, 0.15), transparent 38%),
    linear-gradient(118deg, var(--forest-deep), var(--forest) 55%, #174b43);
  box-shadow: 0 8px 30px rgba(11, 42, 39, 0.2);
}

header::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--coral-soft), var(--gold), #62a294);
  content: "";
}

.institution {
  gap: 16px;
  min-width: 0;
}

.institution img {
  display: block;
  width: 204px;
  height: 62px;
  object-fit: contain;
  object-position: left center;
}

.institution .officeName {
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  font: 700 21px Georgia, serif;
  letter-spacing: 2.7px;
  white-space: nowrap;
}

.dateTime {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 99px;
  background: rgba(5, 28, 25, 0.2);
  white-space: nowrap;
}

#date {
  font-weight: 700;
}

#clock {
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  font: 22px Georgia, serif;
  letter-spacing: 1.5px;
}

#weather {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 238px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

#weatherIcon {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.16));
}

.weatherInfo {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.weatherInfo strong {
  font-size: 10px;
  letter-spacing: 1.6px;
}

.weatherInfo small,
.weatherDegrees small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 9px;
}

.weatherDegrees {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.weatherDegrees b {
  font: 22px Georgia, serif;
}

main {
  grid-template-columns: minmax(500px, 40%) minmax(0, 1fr);
  gap: 18px;
  height: calc(100vh - 92px);
  min-height: 0;
  padding: 18px;
  overflow: hidden;
}

aside,
.calendar {
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.47);
  box-shadow: 0 16px 45px rgba(27, 54, 50, 0.09);
  backdrop-filter: blur(10px);
}

aside {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.announcements {
  position: relative;
  flex: 0 0 auto;
  min-height: 102px;
  margin-bottom: 14px;
  padding: 16px 50px 15px 19px;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background:
    radial-gradient(circle at 94% 10%, rgba(255, 255, 255, 0.22), transparent 28%),
    linear-gradient(128deg, #d85f50, #ef8069 64%, #e8a05d);
  box-shadow: 0 10px 25px rgba(190, 81, 65, 0.2);
  color: #fff;
}

.announcements::before {
  position: absolute;
  right: 54px;
  bottom: -42px;
  width: 118px;
  height: 118px;
  border: 18px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
}

.announcements h1 {
  position: relative;
  margin: 0 0 9px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  letter-spacing: 2.6px;
}

.announcements > p {
  position: relative;
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font: 700 13px/1.45 Arial, sans-serif;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

#editAnnouncements {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

#people {
  flex: 1;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  min-height: 0;
  gap: 12px;
}

article {
  min-height: 0;
  padding: 15px 17px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(250, 248, 242, 0.9));
  box-shadow: 0 7px 18px rgba(31, 60, 56, 0.07);
}

article::before {
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 14px 0 0 14px;
}

article:nth-child(2)::before,
article:nth-child(5)::before {
  background: #d6a654;
}

article:nth-child(3)::before,
article:nth-child(6)::before {
  background: #4d9184;
}

article.status-office::before {
  background: #4d9184;
}

article.status-field::before {
  background: #3f8497;
}

article.status-meeting::before {
  background: #d09a45;
}

article.status-away::before {
  background: #8d9995;
}

article > div {
  width: 100%;
}

article h2 {
  margin-top: 0;
  color: #153b36;
  font-size: 18px;
}

article p {
  display: -webkit-box;
  margin: 12px 0 9px;
  overflow: hidden;
  color: #284842;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cardMeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  color: #697875;
  font-size: 9px;
}

.locationLabel {
  color: #405f59;
  font-weight: 700;
}

.cardMeta time {
  color: #8a9592;
  white-space: nowrap;
}

.edit {
  top: 11px;
  right: 11px;
  width: 29px;
  height: 29px;
  border: 1px solid rgba(23, 60, 56, 0.1);
  border-radius: 8px;
  background: #f4f4ef;
  font-size: 14px;
}

.calendar {
  padding: 18px 20px 13px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.62);
}

.calendar .title {
  flex: 0 0 auto;
  margin-bottom: 13px;
}

.calendar .title span {
  color: #d96655;
}

.calendar .title h1 {
  color: #143d37;
  font-size: 27px;
}

.calendar .title a {
  border: 1px solid rgba(23, 60, 56, 0.13);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(31, 60, 56, 0.07);
}

iframe {
  flex: 1;
  min-height: 0;
  border: 6px solid #fff;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(31, 60, 56, 0.09);
}

.calendar footer {
  flex: 0 0 auto;
  margin-top: 9px;
  padding: 0 3px;
}

dialog {
  border-radius: 16px;
  overflow: hidden;
}

dialog form {
  border-top: 5px solid var(--coral-soft);
}

#announcementForm textarea {
  min-height: 130px;
}

select {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid #ccd3ce;
  background: #fff;
  color: #183330;
  font: 14px Arial, sans-serif;
}

.expiryOption {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #d9ddd8;
  border-radius: 8px;
  background: #f4f5f1;
  cursor: pointer;
}

.expiryOption input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--coral-soft);
}

#updateFlash {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(12, 53, 48, 0);
  opacity: 0;
  pointer-events: none;
}

#updateFlash::before {
  position: absolute;
  top: -30%;
  left: -45%;
  width: 36%;
  height: 160%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  filter: blur(5px);
  transform: rotate(12deg);
  content: "";
}

#updateFlash > div {
  display: flex;
  padding: 16px 24px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  background: rgba(18, 58, 53, 0.94);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  color: #fff;
  flex-direction: column;
  text-align: center;
  transform: translateY(10px) scale(0.96);
}

#updateFlash span {
  color: #f4b18c;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2.5px;
}

#updateFlash strong {
  margin-top: 5px;
  font: 22px Georgia, serif;
}

body.newData #updateFlash {
  animation: flashBackdrop 3s ease both;
}

body.newData #updateFlash::before {
  animation: lightSweep 1.2s ease-out both;
}

body.newData #updateFlash > div {
  animation: noticePop 3s ease both;
}

@keyframes flashBackdrop {
  0%,100% { opacity: 0; background: rgba(12, 53, 48, 0); }
  12%,70% { opacity: 1; background: rgba(12, 53, 48, 0.13); }
}

@keyframes lightSweep {
  from { left: -45%; }
  to { left: 120%; }
}

@keyframes noticePop {
  0%,100% { opacity: 0; transform: translateY(10px) scale(0.96); }
  14%,72% { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1050px) {
  body {
    overflow: auto;
  }

  main {
    display: block;
    height: auto;
    overflow: visible;
  }

  aside,
  .calendar {
    min-height: 720px;
    margin-bottom: 18px;
  }
}

@media (max-width: 650px) {
  header {
    padding: 0 16px;
  }

  .institution {
    gap: 10px;
  }

  .institution img {
    width: 145px;
    height: 54px;
  }

  .institution .officeName {
    padding-left: 10px;
    font-size: 15px;
    letter-spacing: 1.4px;
  }

  #weather {
    min-width: 0;
    padding: 7px 9px;
  }

  .dateTime,
  .weatherInfo {
    display: none;
  }

  main {
    padding: 10px;
  }
}
