@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap");
:root {
  font-family: "DM Sans", system-ui, sans-serif;
  color: #253e36;
  background: #f5f7f6;
  font-size: 16px;
  --paper: #fff;
  --line: #e4eae7;
  --muted: #718078;
  --green: #31594c;
  --soft: #eaf1ed;
  --ink: #253e36;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 15px;
  font-weight: 600;
}
button:hover {
  background: var(--soft);
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.primary:hover {
  background: #24483b;
}
.danger {
  color: #a83e37;
}
.subtle {
  background: transparent;
  border-color: transparent;
}
.shell {
  display: grid;
  grid-template-columns: 238px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--paper);
  border-right: 1px solid var(--line);
  padding: 35px 22px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font:
    800 24px Manrope,
    system-ui;
  letter-spacing: -1px;
  margin: 0 8px 40px;
}
.brandmark {
  background: var(--green);
  color: white;
  border-radius: 11px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 38px;
  font-size: 23px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 13px;
}
.nav button.active {
  background: var(--soft);
  color: var(--green);
}
.ico {
  width: 22px;
  height: 22px;
  display: inline-flex;
  flex-shrink: 0;
}
.ico svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar-foot {
  margin-top: auto;
}
.little {
  font-size: 0.86rem;
  color: var(--muted);
}
.sidebar-note {
  padding: 17px;
  background: var(--soft);
  border-radius: 12px;
  margin: 25px 0;
  font-size: 0.88rem;
  line-height: 1.6;
}
.profile {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 16px 3px 0;
  border-top: 1px solid var(--line);
}
.avatar {
  border-radius: 50%;
  background: #e6ded0;
  color: #68553c;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.main {
  padding: 28px 40px;
  max-width: 1700px;
  width: 100%;
  margin: 0 auto;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
  gap: 12px;
}
.breadcrumb {
  color: var(--muted);
  font-size: 0.9rem;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.iconbtn {
  padding: 10px;
  display: inline-flex;
}
.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #fff4d9;
  color: #795f28;
  border: 1px solid #ecdfba;
  border-radius: 10px;
  padding: 11px 15px;
  font-size: 0.88rem;
  margin-top: 24px;
}
.demo-banner button {
  font-size: 0.83rem;
  border-color: #dfd0a7;
  background: transparent;
  color: #795f28;
  padding: 6px 10px;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0 26px;
  gap: 20px;
}
h1,
h2,
h3 {
  font-family: Manrope, system-ui, sans-serif;
}
h1 {
  font-size: 2rem;
  letter-spacing: -1px;
  margin: 0 0 10px;
  line-height: 1.25;
}
h2 {
  font-size: 1.13rem;
  margin: 0;
}
h3 {
  font-size: 1rem;
  margin: 0;
}
p {
  line-height: 1.6;
  margin: 8px 0;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 26px;
}
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 19px 21px;
}
.stat-top {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.88rem;
}
.stat strong {
  display: block;
  font:
    700 2rem Manrope,
    system-ui;
  margin: 9px 0;
}
.stat small {
  font-size: 0.83rem;
  color: var(--muted);
}
.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--green);
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 22px;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 21px 23px;
  border-bottom: 1px solid var(--line);
}
.card-body {
  padding: 22px;
}
.card-head button {
  font-size: 0.85rem;
  padding: 7px 10px;
}
.week-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 15px 23px;
  font-size: 0.8rem;
  color: var(--muted);
}
.legend span:before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 7px;
  background: var(--tag, #dce8e2);
}
.calendar-scroll {
  overflow: auto;
}
.calendar {
  min-width: 610px;
  display: grid;
  grid-template-columns: 45px repeat(7, minmax(76px, 1fr));
  padding: 0 12px 14px;
}
.day-head {
  text-align: center;
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.76rem;
  color: var(--muted);
}
.day-head b {
  display: block;
  font:
    600 1.2rem Manrope,
    system-ui;
  margin-top: 7px;
  color: var(--ink);
}
.day-head.today b {
  background: var(--green);
  color: white;
  width: 32px;
  height: 32px;
  line-height: 32px;
  border-radius: 50%;
  margin: 3px auto -4px;
}
.time-column,
.day-column {
  position: relative;
  height: 528px;
}
.time-label {
  position: absolute;
  font-size: 0.7rem;
  color: var(--muted);
  top: var(--top);
}
.day-column {
  border-left: 1px solid var(--line);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 43px,
    var(--line) 43px,
    var(--line) 44px
  );
}
.cal-event {
  position: absolute;
  top: var(--top);
  height: var(--height);
  left: 3px;
  right: 3px;
  min-height: 30px;
  border: 0;
  border-left: 3px solid var(--event-border, #8caf9e);
  background: var(--event-bg, #e4eee7);
  border-radius: 5px;
  padding: 5px 5px;
  font-size: 0.7rem;
  text-align: left;
  overflow: hidden;
  font-weight: 500;
  line-height: 1.35;
  color: #2e4e3e;
}
.cal-event b {
  display: block;
  font-size: 0.73rem;
}
.cal-event.revision {
  --event-bg: #eeebfa;
  --event-border: #afa0d2;
  color: #655087;
}
.cal-event.local {
  --event-bg: #f9ecd9;
  --event-border: #d9b16f;
  color: #80653c;
}
.cal-event.exam {
  --event-bg: #f9e5e2;
  --event-border: #d89b92;
  color: #8d5148;
}
.cal-event:hover {
  filter: brightness(0.96);
}
.agenda-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.row:last-child {
  border-bottom: 0;
}
.task-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.check {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
  flex-shrink: 0;
}
.task-title {
  font-size: 0.92rem;
}
.done .task-title {
  text-decoration: line-through;
  color: var(--muted);
}
.pill {
  font-size: 0.75rem;
  border-radius: 6px;
  padding: 4px 8px;
  background: var(--soft);
  color: var(--green);
  white-space: nowrap;
}
.pill.high {
  background: #f8e7e4;
  color: #a0564b;
}
.pill.medium {
  background: #faf0d8;
  color: #937530;
}
.pill.low {
  background: #edf0f8;
  color: #66779c;
}
.exam-card {
  padding: 19px 22px;
  border-bottom: 1px solid var(--line);
}
.exam-card:last-child {
  border: 0;
}
.exam-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.exam-card h3 {
  line-height: 1.5;
  font-size: 0.95rem;
}
.progress {
  height: 5px;
  background: var(--soft);
  border-radius: 5px;
  margin-top: 13px;
}
.progress i {
  height: 100%;
  display: block;
  background: #88ad98;
  border-radius: 5px;
}
.revision-callout {
  background: #31594c;
  color: white;
  padding: 24px;
  border-radius: 15px;
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
}
.revision-callout .little {
  color: #c8ddd2;
}
.revision-callout h2 {
  font-size: 1.25rem;
  margin: 13px 0 10px;
}
.revision-callout button {
  margin-top: 15px;
  background: #fff;
  color: #31594c;
  border: 0;
}
.revision-callout .art {
  position: absolute;
  right: 15px;
  top: 15px;
  color: #678e7d;
  font-size: 50px;
  transform: rotate(-10deg);
  opacity: 0.7;
}
.sync-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 11px 0;
}
.sync-row .pill {
  font-size: 0.7rem;
}
.bottom-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 16px 0;
  text-align: center;
}
.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
}
input:not([type="checkbox"]),
select,
textarea {
  width: 100%;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  margin-top: 7px;
  min-width: 0;
}
textarea {
  resize: vertical;
  min-height: 110px;
}
.full {
  grid-column: 1/-1;
}
.inline-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  margin: 15px 0;
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.empty {
  padding: 35px;
  text-align: center;
  color: var(--muted);
}
.section-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.search {
  max-width: 340px;
  margin: 0 !important;
}
.message {
  padding: 18px 20px;
  background: var(--soft);
  border-radius: 10px;
  margin: 15px 0;
  line-height: 1.6;
}
.connection {
  padding: 22px;
  border-bottom: 1px solid var(--line);
}
.connection-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.connection p {
  font-size: 0.9rem;
  color: var(--muted);
}
.connection button {
  font-size: 0.86rem;
  margin-top: 8px;
}
.parent-link {
  word-break: break-all;
  background: var(--soft);
  padding: 15px;
  border-radius: 8px;
}
dialog {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px;
  width: min(580px, calc(100vw - 24px));
  max-height: 90vh;
}
dialog::backdrop {
  background: #142a236b;
  backdrop-filter: blur(3px);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 23px;
}
.modal-head button {
  padding: 5px 10px;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #253e36;
  color: #fff;
  border-radius: 10px;
  padding: 13px 20px;
  box-shadow: 0 4px 30px #0002;
  z-index: 5;
  max-width: 90vw;
  display: none;
}
.error {
  color: #a83e37;
  font-size: 0.9rem;
  white-space: pre-wrap;
}
.parent-shell {
  max-width: 960px;
  margin: 40px auto;
  padding: 20px;
}
.mobile-name {
  display: none;
}
.dark {
  --paper: #1d2b26;
  --line: #34473d;
  --muted: #a4b8aa;
  --green: #487460;
  --soft: #2d4237;
  --ink: #e3ece6;
  color: var(--ink);
  background: #15221c;
}
.dark .demo-banner {
  background: #3c3625;
  color: #e7d9b0;
  border-color: #5f5336;
}
.dark .demo-banner button {
  color: #e7d9b0;
}
.dark .cal-event {
  filter: brightness(0.83);
}
.dark .primary {
  color: #fff;
}
.dark .pill {
  color: #c7e0d2;
}
.dark .brandmark {
  color: white;
}
.dark .revision-callout {
  background: #2c4e3f;
}
@media (min-width: 1500px) {
  .main {
    padding: 28px 48px;
  }
  .grid {
    grid-template-columns: minmax(0, 1fr) 350px;
  }
  .time-column,
  .day-column {
    height: 576px;
  }
  .day-column {
    background: repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 47px,
      var(--line) 47px,
      var(--line) 48px
    );
  }
}
@media (max-width: 1200px) {
  .shell {
    grid-template-columns: 205px 1fr;
  }
  .sidebar {
    padding: 30px 15px;
  }
  .main {
    padding: 25px;
  }
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .rightcol {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    align-items: start;
  }
  .rightcol .card {
    margin-bottom: 0;
  }
  .stats {
    gap: 12px;
  }
  .stat {
    padding: 16px;
  }
  .brand {
    font-size: 22px;
  }
  .two-cols {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .sidebar {
    height: auto;
    position: static;
    padding: 16px;
    border: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    margin: 0 0 16px;
    font-size: 22px;
  }
  .nav {
    flex-direction: row;
    overflow: auto;
    gap: 5px;
  }
  .nav button {
    padding: 10px;
    white-space: nowrap;
    font-size: 0.85rem;
  }
  .nav button .ico {
    width: 18px;
    height: 18px;
  }
  .sidebar-foot {
    display: none;
  }
  .main {
    padding: 20px 14px;
  }
  .topbar {
    padding-bottom: 15px;
  }
  .breadcrumb {
    font-size: 0.8rem;
  }
  .top-actions .date-label {
    display: none;
  }
  h1 {
    font-size: 1.65rem;
  }
  .intro {
    align-items: flex-start;
    margin: 25px 0 20px;
  }
  .intro p {
    font-size: 0.9rem;
  }
  .intro > .primary {
    padding: 11px;
    font-size: 0.85rem;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat strong {
    font-size: 1.7rem;
  }
  .stat small {
    font-size: 0.75rem;
  }
  .stat-top {
    font-size: 0.8rem;
  }
  .stat-icon {
    display: none;
  }
  .rightcol {
    display: block;
  }
  .rightcol .card {
    margin-bottom: 20px;
  }
  .card-head {
    padding: 16px;
  }
  .card-head h2 {
    font-size: 1rem;
  }
  .card-body {
    padding: 18px;
  }
  .row {
    padding: 15px;
  }
  .row > .pill {
    display: none;
  }
  .demo-banner {
    font-size: 0.78rem;
    align-items: flex-start;
  }
  .demo-banner button {
    flex-shrink: 0;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .full {
    grid-column: auto;
  }
  .section-tools {
    gap: 7px;
  }
  .two-cols {
    gap: 0;
  }
  .week-controls {
    gap: 2px;
  }
  .week-controls button {
    padding: 6px;
  }
  .parent-shell {
    margin: 10px auto;
  }
  .top-actions button {
    padding: 8px;
  }
  .connection-head {
    align-items: flex-start;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition: background 0.15s;
  }
  dialog[open] {
    animation: appear 0.15s ease-out;
  }
  @keyframes appear {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

.brand {
  white-space: nowrap;
}
.brandmark {
  flex-shrink: 0;
}
.brand .little {
  font-size: 0.75rem;
}
@media (max-width: 1200px) and (min-width: 761px) {
  .brand {
    font-size: 20px;
    margin-left: 0;
    margin-right: 0;
    gap: 7px;
  }
  .brandmark {
    width: 30px;
    height: 34px;
  }
}

.cal-event.ics-file {
  --event-bg: #e4eee7;
  --event-border: #8caf9e;
}
.sidebar {
  overflow-y: auto;
}
.sidebar-foot {
  padding-top: 15px;
}

/* Shared weekday and multi-day headers remain aligned while the hours scroll. */
.calendar-scroll {
  max-height: 76vh;
  scrollbar-gutter: stable;
}
.calendar {
  --hour-height: 48px;
  min-width: 760px;
  grid-template-columns: 52px repeat(7, minmax(98px, 1fr));
  padding: 0 12px 28px;
}
.calendar-head {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 52px repeat(7, minmax(98px, 1fr));
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--paper);
  box-shadow: 0 2px 0 var(--line);
}
.calendar-head .day-head {
  position: static;
  padding: 10px 0 12px;
}
.time-head {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}
.calendar-banners {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 52px repeat(7, minmax(98px, 1fr));
  grid-template-rows: repeat(var(--banner-rows), 46px);
  gap: 5px 0;
  padding: 6px 0;
  background: var(--paper);
}
.banner-gutter {
  grid-column: 1;
  grid-row: 1 / -1;
  font-size: 0.65rem;
  color: var(--muted);
  padding-top: 5px;
  line-height: 1.3;
}
.banner-day {
  border-left: 1px solid var(--line);
  pointer-events: none;
}
.calendar-banner {
  z-index: 1;
  min-width: 0;
  margin: 0 3px;
  padding: 5px 7px;
  border: 0;
  border-left: 3px solid var(--event-border);
  border-radius: 5px;
  background: var(--event-bg);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  overflow: hidden;
}
.calendar-banner strong {
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.76rem;
  line-height: 1.25;
}
.calendar-banner > span {
  font-size: 0.68rem;
  font-weight: 400;
  line-height: 1.25;
  white-space: nowrap;
}
.calendar-banner.continues-before {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.calendar-banner.continues-after {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.banner-empty {
  grid-column: 2 / -1;
  grid-row: 1;
  align-self: center;
  padding-left: 8px;
  font-size: 0.75rem;
  color: var(--muted);
}
.calendar .time-column,
.calendar .day-column {
  height: calc(24 * var(--hour-height));
}
.calendar .day-column {
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--hour-height) - 1px),
    var(--line) calc(var(--hour-height) - 1px),
    var(--line) var(--hour-height)
  );
}
.time-label {
  transform: translateY(-50%);
}
.time-label:first-child {
  transform: none;
}
.cal-event {
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 1px;
  padding: 4px;
}
.cal-event > span,
.cal-event b {
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event > span:first-child {
  font-size: 0.65rem;
  white-space: nowrap;
}
.cal-event b {
  font-size: 0.73rem;
}
.cal-event.continues-before {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.cal-event.continues-after {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.cal-event.cancelled,
.calendar-banner.cancelled {
  opacity: 0.55;
  text-decoration: line-through;
}
@media (max-width: 600px) {
  .calendar {
    padding-left: 6px;
    padding-right: 6px;
  }
  .calendar-scroll {
    max-height: 72vh;
  }
  .week-controls {
    gap: 4px;
  }
  .calendar-card .card-head {
    gap: 10px;
    flex-wrap: wrap;
  }
}
.mail-preview {
  white-space: pre-wrap;
  max-height: 200px;
  overflow: auto;
  overflow-wrap: anywhere;
}
.calendar-banner:hover,
.cal-event:hover {
  background: var(--event-bg);
  filter: brightness(0.97);
}
@media (max-width: 600px) {
  .calendar-banners {
    grid-template-rows: repeat(var(--banner-rows), 60px);
  }
  .calendar-banner strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
/* Keep a long stay's label readable when swiping across the week on mobile. */
.calendar-banner strong,
.calendar-banner > span {
  position: sticky;
  left: 6px;
  width: max-content;
  max-width: min(100%, calc(100vw - 78px));
}
.calendar-banner {
  overflow: visible;
}
.calendar-banner > span {
  overflow: hidden;
  text-overflow: ellipsis;
}
