:root {
  --bg: #eef4ef;
  --bg-deep: radial-gradient(circle at 12% 8%, #dbe8db 0, transparent 35%), radial-gradient(circle at 85% 10%, #bfd5bf 0, transparent 30%), linear-gradient(145deg, #eff6ef 0%, #e5efe6 80%);
  --card: rgba(255, 255, 255, 0.72);
  --ink: #132e1d;
  --green: #1f6d43;
  --green-soft: #3e8f63;
  --accent: #c6a162;
  --danger: #9b2c2c;
  --radius: 20px;
  --shadow: 0 20px 45px rgba(11, 39, 24, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: var(--bg-deep);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { width: 100%; }

h1, h2 {
  font-family: "Fraunces", serif;
  margin: 0;
}

.glass {
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(430px, 100%);
  padding: 28px;
}
.brand-hero {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  margin-bottom: 14px;
  box-shadow: 0 14px 30px rgba(18, 56, 37, 0.18);
}
.brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 10px 26px rgba(24, 67, 43, 0.22);
}
.brand-logo-login {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.login-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

input, select, textarea, button {
  font: inherit;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(26, 78, 52, 0.2);
}

button {
  background: linear-gradient(135deg, var(--green), var(--green-soft));
  color: #fff;
  border: 0;
  cursor: pointer;
  font-weight: 700;
}

.error { color: var(--danger); font-weight: 700; }
.remember { display: flex; align-items: center; gap: 8px; }

.app-shell {
  padding: 12px;
  position: relative;
}
.app-shell.is-loading {
  overflow: hidden;
}
.app-shell.is-loading > :not(.loading-overlay) {
  filter: blur(1.5px);
  pointer-events: none;
  user-select: none;
}
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(13, 33, 22, 0.34);
  backdrop-filter: blur(6px);
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loading-card {
  width: min(420px, calc(100vw - 32px));
  padding: 22px;
  display: grid;
  gap: 14px;
}
.loading-copy strong {
  display: block;
  font-family: "Fraunces", serif;
  font-size: 1.25rem;
  margin-bottom: 6px;
}
.loading-copy p {
  margin: 0;
  color: rgba(19, 46, 29, 0.78);
}
.loading-progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(31, 109, 67, 0.12);
  overflow: hidden;
}
.loading-progress span {
  display: block;
  width: 18%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--green-soft));
  box-shadow: 0 0 16px rgba(31, 109, 67, 0.22);
  transition: width 0.2s ease;
}
.loading-card small {
  color: rgba(19, 46, 29, 0.7);
  font-weight: 600;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 16px;
  margin-bottom: 12px;
}
.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ghost { background: transparent; border: 1px solid rgba(26, 78, 52, 0.3); color: var(--ink); }
.desktop-nav {
  display: none;
  align-items: center;
  gap: 8px;
}
.desktop-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 10px;
}
.desktop-nav a:hover { background: rgba(31, 109, 67, 0.11); }
.menu-toggle {
  background: linear-gradient(135deg, #2a7f53, #1d5c3b);
}
.mobile-menu {
  position: fixed;
  top: 10px;
  right: 10px;
  left: 10px;
  z-index: 30;
  padding: 14px;
  display: none;
}
.mobile-menu.open { display: grid; gap: 8px; }
.mobile-menu-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.menu-link {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  padding: 10px;
  border-radius: 10px;
  background: rgba(31, 109, 67, 0.08);
  border: 0;
}
.menu-link.as-button { width: 100%; text-align: left; cursor: pointer; }
.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(13, 33, 22, 0.45);
  z-index: 20;
}

.layout-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  grid-template-areas:
    "chat"
    "calendar"
    "mail"
    "tasks";
}

.chat-area, .calendar-area, .mail-area, .tasks-area { padding: 14px; }
.chat-area { grid-area: chat; min-height: 48vh; display: flex; flex-direction: column; }
.calendar-area, .mail-area, .tasks-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.calendar-area { grid-area: calendar; min-height: 18vh; }
.mail-area { grid-area: mail; min-height: 18vh; }
.tasks-area { grid-area: tasks; min-height: 24vh; }

.chat-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.mic { background: linear-gradient(135deg, #2a7f53, #1d5c3b); }
.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  border-radius: 12px;
  background: rgba(244, 248, 244, 0.92);
}
.msg {
  position: relative;
  max-width: 90%;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 12px;
  white-space: pre-wrap;
}
.msg-text { display: block; padding-right: 1.8rem; }
.msg.user { margin-left: auto; background: #1f6d43; color: white; }
.msg.assistant { background: #dbeadf; }
.msg.assistant .msg-speak {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(19, 46, 29, 0.14);
  background: rgba(255, 255, 255, 0.8);
  color: var(--green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(19, 46, 29, 0.08);
}
.msg.assistant .msg-speak:hover {
  transform: translateY(-1px);
  background: #fff;
}
.msg.assistant .msg-speak:focus-visible {
  outline: 3px solid rgba(31, 109, 67, 0.24);
  outline-offset: 2px;
}
.msg.assistant .msg-speak span {
  font-size: 0.82rem;
  line-height: 1;
}
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 8px; }
.hint { opacity: 0.8; margin-top: 6px; }

.task-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; max-height: 290px; overflow: auto; }
.task {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 12px;
  background: #f5fbf6;
}
.task.high { border-left: 5px solid var(--danger); }
.task.medium { border-left: 5px solid var(--accent); }
.task.low { border-left: 5px solid #2f855a; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.mini-status {
  font-size: 0.8rem;
  color: rgba(19, 46, 29, 0.72);
  line-height: 1.25;
  padding-top: 2px;
}
.mail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  max-height: 170px;
  overflow: auto;
}
.mail-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 14px;
  background: #f5fbf6;
  border: 1px solid rgba(26, 78, 52, 0.08);
}
.mail-item strong {
  display: block;
}
.mail-item small {
  display: block;
  color: rgba(19, 46, 29, 0.7);
  margin-top: 2px;
}
.mail-item time {
  font-size: 0.82rem;
  color: rgba(19, 46, 29, 0.66);
  white-space: nowrap;
}
.mail-empty {
  justify-content: flex-start;
  color: rgba(19, 46, 29, 0.68);
}

#calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  font-size: 12px;
}
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
}
.calendar-toolbar strong {
  text-align: center;
  min-width: 120px;
}
.calendar-today {
  margin-bottom: 8px;
}
.day {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(26, 78, 52, 0.12);
  background: #f8fcf8;
  border-radius: 10px;
  min-height: 50px;
  padding: 6px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease;
}
.day:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(19, 46, 29, 0.08);
  border-color: rgba(31, 109, 67, 0.35);
}
.day:focus-visible {
  outline: 3px solid rgba(31, 109, 67, 0.28);
  outline-offset: 2px;
}
.day.marked { border-color: var(--green); box-shadow: inset 0 0 0 2px rgba(31, 109, 67, 0.28); }
.day.today {
  background: linear-gradient(145deg, rgba(216, 236, 224, 0.98), rgba(248, 252, 248, 0.98));
}
.day.selected {
  background: linear-gradient(145deg, rgba(31, 109, 67, 0.16), rgba(244, 251, 246, 0.96));
  border-color: rgba(31, 109, 67, 0.55);
  box-shadow: inset 0 0 0 2px rgba(31, 109, 67, 0.18), 0 10px 18px rgba(19, 46, 29, 0.08);
}
.day span {
  display: none;
}
.day .day-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  margin-left: auto;
  margin-top: auto;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(31, 109, 67, 0.11);
}
.day.blank {
  cursor: default;
  background: transparent;
  border: 0;
  box-shadow: none;
  min-height: 0;
}
.day.blank:hover {
  transform: none;
  box-shadow: none;
}
.calendar-details {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(245, 251, 246, 0.96);
  border: 1px solid rgba(26, 78, 52, 0.09);
}
.calendar-details strong {
  display: block;
  margin-bottom: 8px;
}
.calendar-details p {
  margin: 0;
  color: rgba(19, 46, 29, 0.78);
}
.calendar-task-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.calendar-task-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(26, 78, 52, 0.08);
}
.calendar-task-list small {
  color: rgba(19, 46, 29, 0.66);
  white-space: nowrap;
}

.new-task summary { cursor: pointer; margin: 10px 0; font-weight: 700; }
.new-task form p { display: grid; gap: 6px; }
.settings-panel {
  margin-top: 12px;
  padding: 16px;
}
.settings-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.settings-form {
  display: grid;
  gap: 8px;
  max-width: 480px;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.checkbox-row input {
  width: 18px;
  height: 18px;
  padding: 0;
}
.team-list {
  margin: 10px 0 0;
  padding-left: 18px;
}
.team-list li {
  margin-bottom: 6px;
}

@media (min-width: 950px) {
  .app-shell { padding: 18px 22px; }
  .menu-toggle, .mobile-menu, .menu-backdrop { display: none !important; }
  .desktop-nav { display: flex; }
  .layout-grid {
    grid-template-columns: 2fr 1fr;
    grid-template-areas:
      "chat calendar"
      "chat mail"
      "tasks tasks";
  }
  .chat-area { min-height: 72vh; }
  .calendar-area { min-height: 22vh; }
  .mail-area { min-height: 18vh; }
  .tasks-area { min-height: 28vh; }
}

@media (max-width: 949px) {
  .loading-card {
    width: min(360px, calc(100vw - 24px));
  }
}

.mic.active {
  box-shadow: 0 0 0 4px rgba(31, 109, 67, 0.25);
}

.landing-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 18px;
}
.landing-hero {
  padding: 22px;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 14px;
  align-items: stretch;
}
.landing-logo {
  width: 100%;
  max-width: 560px;
  border-radius: 14px;
  display: block;
  margin-bottom: 12px;
}
.landing-hero-main h1 {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  line-height: 1.08;
}
.landing-hero-main p {
  font-size: 1.1rem;
  margin: 10px 0 0;
}
.landing-hero-side {
  display: grid;
  gap: 10px;
}
.hero-pill {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(234, 246, 238, 0.82));
  border: 1px solid rgba(31, 109, 67, 0.15);
  border-radius: 16px;
  padding: 14px;
}
.hero-pill strong {
  display: block;
  margin-bottom: 4px;
}
.landing-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--green-soft));
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(19, 69, 43, 0.2);
}
.cta-secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(26, 78, 52, 0.3);
}
.bento-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.bento-card {
  padding: 18px;
  border-radius: 22px;
}
.bento-card h3, .bento-card h2 {
  margin-bottom: 8px;
}
.bento-card ul {
  margin: 8px 0 0;
  padding-left: 18px;
}
.bento-large {
  grid-column: span 2;
}
.bento-accent {
  background: linear-gradient(135deg, rgba(29, 92, 59, 0.86), rgba(42, 127, 83, 0.85));
  color: #f4fff7;
}
.site-footer {
  margin: auto auto 0;
  max-width: 1200px;
  width: 100%;
  padding: 18px 16px 28px;
  color: #173223;
  display: grid;
  gap: 4px;
}
.site-footer .footer-brand {
  font-family: "Fraunces", serif;
  font-size: 20px;
  font-weight: 700;
}
.site-footer a {
  color: #1f6d43;
  text-decoration: none;
  width: fit-content;
}

@media (max-width: 760px) {
  .landing-hero {
    grid-template-columns: 1fr;
  }
  .bento-grid {
    grid-template-columns: 1fr;
  }
  .bento-large {
    grid-column: span 1;
  }
}
