:root {
  color-scheme: dark;
  --bg: #17151f;
  --ink: #fff8f1;
  --muted: rgba(255, 248, 241, .68);
  --line: rgba(255, 248, 241, .18);
  --glass: rgba(255, 255, 255, .12);
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  --radius: 26px;
  --radius-small: 18px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 189, 161, .30), transparent 31rem),
    radial-gradient(circle at 84% 20%, rgba(112, 208, 199, .22), transparent 28rem),
    radial-gradient(circle at 50% 105%, rgba(187, 149, 255, .22), transparent 30rem),
    linear-gradient(145deg, #17151f 0%, #252130 42%, #123534 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: .28;
  background-image:
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 74%);
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.shell {
  width: min(100%, 1040px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 76px) clamp(18px, 5vw, 54px);
  display: grid;
  align-content: center;
  gap: clamp(30px, 7vh, 68px);
}

.hero {
  display: grid;
  gap: 14px;
}

h1 {
  margin: 0;
  font-size: clamp(3.25rem, 14vw, 8.2rem);
  line-height: .86;
  font-weight: 760;
  letter-spacing: 0;
}

.lede {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 248, 241, .78);
  font-size: clamp(1.08rem, 3vw, 1.55rem);
  line-height: 1.45;
}

.apps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 2.8vw, 24px);
}

.app {
  min-width: 0;
  min-height: 168px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .07));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  display: grid;
  justify-items: start;
  align-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.app:hover,
.app:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, .46);
  background: linear-gradient(160deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, .10));
  outline: none;
}

.app:disabled {
  cursor: default;
  opacity: .62;
}

.app:disabled:hover {
  transform: none;
  border-color: var(--line);
}

.app-empty {
  cursor: default;
  opacity: .34;
  background: linear-gradient(160deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 18px 48px rgba(0, 0, 0, .18);
}

.app-icon {
  width: 62px;
  height: 62px;
  border-radius: var(--radius-small);
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42), 0 14px 28px rgba(0, 0, 0, .22);
}

.app-icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: rgba(255, 255, 255, .92);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.photos {
  background: linear-gradient(145deg, #ff8a72, #d66cf0 52%, #5db5ff);
}

.admin {
  background: linear-gradient(145deg, #63ddd2, #4776d9 54%, #b18cff);
}

.notes {
  background: linear-gradient(145deg, #f7c85f, #ed7168);
}

.files {
  background: linear-gradient(145deg, #6bd6c8, #3c84db);
}

.calendar {
  background: linear-gradient(145deg, #8d7dff, #ef75ad);
}

.app-name,
.app-status {
  display: block;
}

.app-name {
  width: 100%;
  overflow-wrap: anywhere;
  font-size: 1.08rem;
  font-weight: 760;
}

.app-status {
  width: 100%;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: .86rem;
}

@media (max-width: 760px) {
  .shell {
    align-content: start;
  }

  .apps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app {
    min-height: 152px;
  }
}

@media (max-width: 420px) {
  .brand {
    align-items: flex-start;
  }

  .apps {
    gap: 12px;
  }

  .app {
    min-height: 138px;
    padding: 14px;
  }

  .app-icon {
    width: 54px;
    height: 54px;
  }

  .app-icon svg {
    width: 30px;
    height: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.login-page .shell {
  min-height: auto;
}

.login-shell {
  width: min(100%, 410px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(22px, 5vw, 44px);
  display: grid;
  place-items: center;
}

.login-panel {
  width: 100%;
  padding: clamp(24px, 6vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .07));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  display: grid;
  gap: 20px;
}

.login-panel h1 {
  margin-bottom: 2px;
  font-size: clamp(1.95rem, 8vw, 3.15rem);
  line-height: .95;
}

.login-step {
  display: grid;
  gap: 8px;
}

.login-step[hidden],
[hidden] {
  display: none !important;
}

.login-step label {
  color: rgba(255, 248, 241, .86);
  font-size: .9rem;
  font-weight: 720;
}

.login-step input {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--radius-small);
  padding: 0 14px;
  color: var(--ink);
  background: rgba(16, 15, 23, .45);
  outline: none;
}

.login-step input:focus {
  border-color: rgba(99, 221, 210, .72);
  box-shadow: 0 0 0 4px rgba(99, 221, 210, .14);
}

.login-submit {
  min-height: 50px;
  border: 0;
  border-radius: var(--radius-small);
  color: #15131d;
  font-weight: 780;
  background: linear-gradient(135deg, #ffb48f, #63ddd2);
  cursor: pointer;
}

.login-submit:disabled {
  cursor: wait;
  opacity: .7;
}

.login-copy,
.login-error {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.login-error {
  min-height: 1.4em;
  color: #ffb6a7;
}

.login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.login-actions button {
  border: 0;
  padding: 0;
  color: rgba(255, 248, 241, .78);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.shake {
  animation: shake .35s;
}

@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.calendar-page {
  min-height: 100vh;
}

.calendar-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 44px);
  display: grid;
  gap: 18px;
}

.calendar-top,
.calendar-toolbar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .07));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.calendar-top {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.calendar-top h1,
.calendar-toolbar h2,
.day-view h2,
.event-card h3 {
  margin: 0;
}

.calendar-top h1 {
  font-size: clamp(1.55rem, 6vw, 2.65rem);
  line-height: 1;
}

.calendar-top p {
  margin: 5px 0 0;
  color: var(--muted);
}

.back-link {
  color: rgba(255, 248, 241, .82);
  text-decoration: none;
}

.calendar-toolbar {
  padding: 12px;
  display: grid;
  grid-template-columns: 44px 1fr 44px auto;
  align-items: center;
  gap: 10px;
}

.calendar-toolbar button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  color: var(--ink);
  background: rgba(255, 255, 255, .10);
}

.calendar-toolbar svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.calendar-toolbar h2 {
  text-align: center;
  font-size: clamp(1.15rem, 4vw, 1.8rem);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.weekday {
  padding: 0 8px 4px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 760;
}

.day-cell {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  padding: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, .09);
  text-align: left;
  display: grid;
  align-content: start;
  gap: 5px;
}

.day-cell span {
  font-weight: 780;
}

.day-cell i,
.day-cell em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 248, 241, .86);
  font-size: .78rem;
  font-style: normal;
}

.muted-day {
  opacity: .45;
}

.today {
  border-color: rgba(99, 221, 210, .70);
}

.selected {
  background: rgba(99, 221, 210, .16);
}

.day-dialog {
  width: min(calc(100% - 28px), 520px);
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
}

.day-dialog::backdrop {
  background: rgba(10, 9, 14, .58);
  backdrop-filter: blur(8px);
}

.day-view {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 189, 161, .20), transparent 18rem),
    linear-gradient(160deg, rgba(43, 40, 55, .96), rgba(20, 31, 38, .96));
  box-shadow: var(--shadow);
}

.day-view header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

#close-day {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, .10);
  display: grid;
  place-items: center;
}

#close-day svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
}

#day-events {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.event-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  padding: 14px;
  background: rgba(16, 15, 23, .24);
}

.event-card time {
  color: #63ddd2;
  font-weight: 780;
}

.event-card h3 {
  margin-top: 5px;
}

.event-card p,
.empty-day {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.event-note {
  font-size: .92rem;
}

@media (max-width: 720px) {
  .calendar-top {
    align-items: flex-start;
    flex-direction: column-reverse;
  }

  .calendar-toolbar {
    grid-template-columns: 42px 1fr 42px;
  }

  #today {
    grid-column: 1 / -1;
  }

  .calendar-grid {
    gap: 6px;
  }

  .weekday {
    text-align: center;
  }

  .day-cell {
    min-height: 72px;
    padding: 8px;
  }

  .day-cell i {
    display: none;
  }
}
