:root {
  color-scheme: light;
  --ink: #17223f;
  --muted: #536078;
  --line: rgba(111, 144, 193, .22);
  --glass: rgba(255, 255, 255, .78);
  --blue: #4179ff;
  --violet: #8068f6;
  --amber: #d89a12;
  --shadow: 0 1px 1px rgba(23, 34, 63, .03), 0 12px 32px rgba(38, 75, 136, .08);
  --sky-top: #f7fbff;
  --sky-bottom: #f4f3ff;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(143, 200, 255, .45), transparent 32%),
    radial-gradient(circle at 96% 8%, rgba(174, 158, 255, .35), transparent 28%),
    linear-gradient(160deg, var(--sky-top), var(--sky-bottom));
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.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;
}
.ambient { position: fixed; border-radius: 50%; filter: blur(18px); pointer-events: none; z-index: 0; }
.ambient-one { width: 280px; height: 280px; left: 18%; top: -120px; background: rgba(143, 200, 255, .45); }
.ambient-two { width: 320px; height: 320px; right: -80px; bottom: -40px; background: rgba(174, 158, 255, .35); }
.glass {
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(255, 255, 255, .95);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .9);
  border-radius: 22px;
}
.boot { position: relative; z-index: 1; padding: 48px 20px; text-align: center; color: var(--muted); }
.login-wrap { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; }
.login-card { width: min(440px, 100%); padding: 28px 26px 22px; display: flex; flex-direction: column; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand strong { display: block; font-size: 18px; letter-spacing: -.02em; }
.brand small, .hint, .kicker { color: var(--muted); }
.brand small { display: block; margin-top: 2px; font-size: 13px; }
.mark, .avatar {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  color: white; font-weight: 800; background: linear-gradient(145deg, #3f93ff, #765df6);
  box-shadow: 0 8px 18px rgba(77, 104, 245, .28);
}
.lead { margin: 4px 0 2px; line-height: 1.6; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .86);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: #8aabef; box-shadow: 0 0 0 4px rgba(65, 121, 255, .12); }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; min-width: 0; }
.row > button, .row > .btn-link { flex: 0 0 auto; white-space: nowrap; }
.row.three { flex-wrap: nowrap; }
.row.three > * { flex: 1 1 0; min-width: 0; }
.row.two { flex-wrap: wrap; }
.row.two > * { flex: 1 1 120px; }
.row.end { justify-content: flex-end; }
.row.end > * { flex: 0 0 auto; }
.row.between { justify-content: space-between; flex-wrap: wrap; }
.row.between > * { flex: 0 0 auto; }
.small-btn { padding: 6px 12px; font-size: 13px; }
.small-link { padding: 2px 6px; font-size: 12px; }
.btn-link { text-decoration: none; display: inline-block; font-size: 14px; }
.danger-button { border-radius: 12px; border: 1px solid rgba(180, 35, 24, .35); background: #fff1f0; color: #b42318; padding: 9px 14px; font-weight: 600; }
.danger-button:hover { background: #ffe4e2; }
.primary, .secondary, .icon-button, .text-button {
  border-radius: 12px;
  border: 0;
  padding: 10px 14px;
  white-space: nowrap;
  flex-shrink: 0;
}
.primary { color: white; background: linear-gradient(145deg, #3f93ff, #6d68f6); font-weight: 700; }
.primary.google { display: block; text-align: center; text-decoration: none; }
.secondary, .icon-button { background: white; border: 1px solid var(--line); }
.text-button { background: transparent; color: #355fca; padding-inline: 8px; }
.icon-button { width: 38px; height: 38px; padding: 0; }
button:disabled { opacity: .6; cursor: default; }
.form-error { color: #b42318; background: #fff1f0; border-radius: 10px; padding: 8px 10px; margin: 0; font-size: 14px; }
.hint { margin: 0; font-size: 13px; line-height: 1.5; }
.dev-box { margin-top: 6px; padding: 12px; border-radius: 16px; border: 1px dashed rgba(216, 154, 18, .7); background: rgba(255, 248, 230, .7); display: flex; flex-direction: column; gap: 8px; }
.dev-box p { margin: 0; color: var(--muted); font-size: 13px; }
.app { position: relative; z-index: 1; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 18px 0; }
.who { display: flex; align-items: center; gap: 8px; flex-shrink: 0; white-space: nowrap; }
.avatar { width: 34px; height: 34px; border-radius: 11px; font-size: 15px; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.workspace {
  display: grid;
  grid-template-columns: minmax(420px, 1.35fr) minmax(270px, .82fr) minmax(300px, .92fr);
  gap: 14px;
  padding: 14px 16px 20px;
  align-items: stretch;
}
.calendar-card, .day-card, .chat-card {
  padding: 16px;
  min-height: calc(100vh - 92px);
  max-height: calc(100vh - 92px);
  overflow: auto;
}
.chat-card { display: flex; flex-direction: column; overflow: hidden; }
.calendar-toolbar, .card-head, .pager, .legend { display: flex; align-items: center; gap: 10px; }
.calendar-toolbar, .card-head { justify-content: space-between; }
.kicker { display: block; font-size: 12px; letter-spacing: .08em; }
h1, h2 { margin: 2px 0 0; font-weight: 750; letter-spacing: -.03em; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
.legend { color: var(--muted); font-size: 13px; margin: 8px 0 10px; }
.dot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; margin-right: 4px; }
.dot.todo, .pill.todo { background: var(--blue); }
.dot.reminder, .pill.reminder { background: var(--amber); }
.dot.schedule, .pill.schedule { background: var(--violet); }
.weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.weekdays { color: var(--muted); font-size: 13px; text-align: center; margin-bottom: 6px; }
.day {
  min-height: 78px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, .62);
  border-radius: 14px;
  text-align: left;
  padding: 6px 6px 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.day:hover { background: white; }
.day.outside { opacity: .45; }
.day.selected { box-shadow: inset 0 0 0 2px rgba(65, 121, 255, .85); background: white; }
.day .num { font-size: 13px; font-weight: 700; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 99px; }
.day.today .num { background: var(--blue); color: white; }
.day-chip { font-size: 11px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #2c3b58; }
.more { font-size: 11px; color: var(--muted); }
.item-form, .item-list { display: flex; flex-direction: column; gap: 8px; }
.item-form { margin: 12px 0; }
.item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--line);
}
.item.done .item-title { color: var(--muted); text-decoration: line-through; }
.item-title { font-weight: 700; }
.item-meta, .empty { color: var(--muted); font-size: 13px; }
.item-actions { display: flex; gap: 4px; }
.pill { color: white; border-radius: 99px; padding: 1px 7px; font-size: 12px; font-style: normal; }
.badge { font-size: 12px; color: #355fca; background: rgba(220, 234, 255, .9); border-radius: 99px; padding: 4px 8px; }
.memory-block { margin: 10px 0; }
.memory-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.memory-title { font-size: 13px; font-weight: 700; }
.memory-list { display: flex; flex-wrap: wrap; gap: 6px; }
.warn-hint { color: #b45309; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: white; border: 1px solid var(--line); border-radius: 99px; padding: 4px 8px; font-size: 13px; }
.chip.proposed { border-style: dashed; border-color: rgba(216, 154, 18, .75); background: rgba(255, 248, 230, .85); }
.chip button { border: 0; background: transparent; color: var(--muted); padding: 0 3px; font-weight: 700; }
.chip button.confirm-btn { color: #15803d; }
.repeat-tag { font-size: 11px; color: #355fca; background: rgba(220, 234, 255, .8); border-radius: 99px; padding: 1px 6px; }
.messages { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 8px; min-height: 160px; padding-right: 2px; }
.msg-group { display: flex; flex-direction: column; gap: 4px; max-width: 94%; }
.msg-group.user { align-self: flex-end; }
.msg-group.assistant { align-self: flex-start; }
.bubble { padding: 10px 12px; border-radius: 16px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.bubble.user { background: linear-gradient(145deg, #3f93ff, #6a74f4); color: white; border-bottom-right-radius: 6px; }
.bubble.assistant { background: white; border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble.pending { color: var(--muted); }
.action-list { display: flex; flex-direction: column; gap: 4px; }
.action-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 12px;
  background: rgba(255, 255, 255, .86);
  border: 1px solid var(--line);
}
.action-card.pending { border-style: dashed; border-color: rgba(216, 154, 18, .75); background: rgba(255, 248, 230, .85); }
.action-card.undone, .action-card.cancelled { opacity: .6; }
.action-card .action-label { flex: 1; line-height: 1.4; }
.action-card .action-btns { display: flex; gap: 4px; flex: 0 0 auto; }
.action-card .action-btns button { padding: 3px 8px; font-size: 12px; border-radius: 8px; }
.settings-dialog {
  width: min(520px, calc(100vw - 24px));
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, .9);
  color: var(--ink);
}
.settings-dialog::backdrop { background: rgba(23, 34, 63, .36); }
.settings-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.digest-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.digest-row select { width: auto; min-width: 110px; }
.checkbox-label { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--ink); font-size: 14px; cursor: pointer; }
.checkbox-label input { width: auto; margin: 0; }
.danger-section { border-top-color: rgba(180, 35, 24, .2); }
.composer { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.composer textarea { min-height: 68px; flex: 1; min-width: 0; }
@media (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr; }
  .calendar-card, .day-card, .chat-card { max-height: none; min-height: 0; }
  .chat-card { min-height: 70vh; }
  .day { min-height: 64px; }
}
