:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --ink: #152238;
  --muted: #6f7c8f;
  --line: #dfe6ee;
  --blue: #356fe5;
  --blue-dark: #2458bd;
  --blue-soft: #eaf1ff;
  --red: #d84b51;
  --red-soft: #fff0f0;
  --green: #32856a;
  --shadow: 0 16px 50px rgba(38, 58, 85, 0.09);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1422;
  --panel: #121d2e;
  --panel-soft: #172438;
  --ink: #edf4ff;
  --muted: #96a5b9;
  --line: #293a51;
  --blue: #76a5ff;
  --blue-dark: #a8c4ff;
  --blue-soft: #1b3156;
  --red: #ff8c90;
  --red-soft: #3a2329;
  --green: #73c5a9;
  --shadow: 0 16px 50px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
}
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
input {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  color: inherit;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  grid-template-rows: 68px minmax(0, 1fr);
}
.mobile-header {
  grid-column: 1 / -1;
  grid-row: 1;
}
.sidebar {
  grid-column: 1;
  grid-row: 2;
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  display: flex;
  flex-direction: column;
  padding: 28px 18px 18px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.45px;
  text-decoration: none;
}
.brand-mark {
  position: relative;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
  background: var(--blue);
}
.brand-mark span {
  position: absolute;
  width: 13px;
  height: 4px;
  border-radius: 5px;
  background: white;
}
.brand-mark span:first-child {
  transform: translateY(-6px) rotate(-8deg);
}
.brand-mark span:nth-child(2) {
  width: 17px;
}
.brand-mark span:last-child {
  transform: translateY(6px) rotate(8deg);
}
.new-reminder-button {
  width: 100%;
  height: 48px;
  margin: 0 0 24px;
  border: 0;
  border-radius: 13px;
  color: white;
  background: var(--blue);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--blue) 26%, transparent);
}
.new-reminder-button:hover {
  background: var(--blue-dark);
}
.new-reminder-button span {
  margin-right: 8px;
  font-size: 19px;
}
.primary-nav {
  display: grid;
  gap: 5px;
}
.nav-item {
  height: 46px;
  display: grid;
  grid-template-columns: 27px 1fr auto;
  align-items: center;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.nav-item:hover {
  background: var(--panel-soft);
  color: var(--ink);
}
.nav-item.is-active {
  color: var(--blue-dark);
  background: var(--blue-soft);
  font-weight: 700;
}
.nav-item b {
  min-width: 23px;
  padding: 2px 7px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--muted) 10%, transparent);
  font-size: 11px;
  text-align: center;
}
.nav-icon {
  font-size: 20px;
}
.sidebar-spacer {
  flex: 1;
}
.preview-account {
  display: grid;
  grid-template-columns: 36px 1fr 34px;
  align-items: center;
  gap: 10px;
  padding: 15px 7px 0;
  margin-top: 9px;
  border-top: 1px solid var(--line);
}
.preview-account strong {
  display: block;
  font-size: 12px;
}
.preview-account small {
  color: var(--muted);
  font-size: 10px;
}
.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--blue-dark);
  background: var(--blue-soft);
  font-weight: 800;
}
.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  cursor: pointer;
}
.mobile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-account-button {
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 700;
}

main {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
}
.workspace {
  width: min(100% - 64px, 950px);
  margin: 0 auto;
  padding: 66px 0 90px;
}
.topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.date-line {
  margin: 0 0 5px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-size: clamp(35px, 5vw, 48px);
  line-height: 1.05;
  letter-spacing: -1.8px;
}
.account-button {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d8a539;
}
.account-button.is-signed-in .status-dot {
  background: var(--green);
}
.quick-add {
  display: grid;
  grid-template-columns: 26px minmax(150px, 1fr) 205px auto;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  padding: 9px 10px 9px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.quick-add-icon {
  color: var(--blue);
  font-size: 23px;
}
.quick-add input {
  min-width: 0;
  height: 40px;
  padding: 0 8px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}
.quick-add input[type="datetime-local"] {
  padding: 0 12px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.quick-add button {
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: var(--blue);
  font-weight: 700;
  cursor: pointer;
}
.preview-note {
  display: flex;
  gap: 7px;
  align-items: center;
  margin: 11px 4px 0;
  color: var(--muted);
  font-size: 11px;
}
.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 40px 0 12px;
}
.summary-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.layout-control {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.layout-control button {
  width: 30px;
  height: 27px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.layout-control button.is-active {
  color: var(--blue-dark);
  background: var(--blue-soft);
}
.reminder-list {
  display: grid;
  gap: 10px;
}
.reminder {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 32px;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.reminder:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(38, 58, 85, 0.08);
}
.complete-button {
  width: 25px;
  height: 25px;
  border: 1.5px solid color-mix(in srgb, var(--muted) 55%, transparent);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.complete-button:hover {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 10%, transparent);
}
.reminder-copy {
  min-width: 0;
}
.reminder-copy strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reminder-copy small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}
.time-pill {
  padding: 6px 9px;
  border-radius: 8px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 700;
}
.time-pill.is-overdue {
  color: var(--red);
  background: var(--red-soft);
}
.more-button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.more-button:hover {
  background: var(--panel-soft);
}
.reminder.is-completed .reminder-copy strong {
  color: var(--muted);
  text-decoration: line-through;
}
.reminder.is-completed .complete-button {
  border-color: var(--green);
  background: var(--green);
}
.reminder.is-completed .complete-button::after {
  content: "✓";
  color: white;
  font-size: 13px;
}
.empty-state {
  padding: 70px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-state span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: auto;
  border-radius: 50%;
  color: var(--green);
  background: color-mix(in srgb, var(--green) 12%, transparent);
  font-size: 24px;
}
.empty-state h2 {
  margin: 16px 0 4px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
}
.empty-state p {
  margin: 0;
  font-size: 13px;
}
.mobile-header {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.mobile-nav {
  display: none;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  padding: 12px 16px;
  border-radius: 11px;
  color: white;
  background: #182339;
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 0.2s ease;
}
.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .sidebar {
    display: none;
  }
  .mobile-header {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
  }
  .mobile-header .brand {
    padding: 0;
  }
  .workspace {
    width: auto;
    padding: 32px 18px 108px;
  }
  .account-button {
    display: none;
  }
  .quick-add {
    grid-template-columns: 24px 1fr auto;
    margin-top: 28px;
    padding-left: 13px;
  }
  .quick-add input[type="datetime-local"] {
    grid-column: 2 / 4;
    width: 100%;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .quick-add button {
    grid-column: 3;
    grid-row: 1;
    padding: 0 13px;
  }
  .summary-row {
    margin-top: 30px;
  }
  .reminder {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 12px;
  }
  .more-button {
    display: none;
  }
  .time-pill {
    grid-column: 2;
    justify-self: start;
  }
  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 5;
    height: 72px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    padding: 0 7px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    backdrop-filter: blur(18px);
  }
  .mobile-nav button {
    height: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    color: var(--muted);
    background: transparent;
    font-size: 9px;
  }
  .mobile-nav button span {
    font-size: 18px;
  }
  .mobile-nav button.is-active {
    color: var(--blue-dark);
    font-weight: 700;
  }
  .mobile-nav .mobile-add {
    width: 47px;
    height: 47px;
    justify-self: center;
    border-radius: 16px;
    color: white;
    background: var(--blue);
    font-size: 25px;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--blue) 28%, transparent);
  }
  .toast {
    right: 16px;
    bottom: 88px;
    left: 16px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Product-owned placement; menu styling lives in packages/wisp-controls. */
.wisp-controls-host {
  display: inline-block;
  position: relative;
  z-index: 500;
  flex: 0 0 auto;
  vertical-align: middle;
}

.replywisp-responses {
  margin: 20px 0;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.replywisp-responses article {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.replywisp-responses h3,
.replywisp-responses pre {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.replywisp-responses p {
  color: var(--muted);
  margin: 10px 0;
}
.replywisp-responses textarea {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 10px;
  color: var(--ink);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.replywisp-responses button {
  padding: 8px 12px;
  margin: 8px 0;
  color: var(--ink);
  background: var(--blue-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.replywisp-responses a {
  color: var(--blue);
}
