:root {
  color-scheme: light;
  --page: #e8edf3;
  --app: #f7f9fc;
  --surface: #ffffff;
  --surface-elevated: rgba(255, 255, 255, 0.9);
  --surface-soft: #eef3f8;
  --surface-tint: #f8fafc;
  --text: #111827;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: rgba(17, 24, 39, 0.1);
  --primary: #111827;
  --accent: #2563eb;
  --accent-strong: #174dd5;
  --accent-soft: #eaf1ff;
  --mint: #0f9f77;
  --mint-soft: #e4f8f1;
  --warning: #b45320;
  --warning-soft: #fff2e7;
  --danger: #e45b3d;
  --shadow: 0 28px 92px rgba(17, 24, 39, 0.18);
  --shadow-soft: 0 12px 32px rgba(17, 24, 39, 0.08);
  --radius: 8px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, #fbfcfe 0%, var(--page) 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
  touch-action: manipulation;
}

button:focus-visible {
  outline: 3px solid rgba(23, 107, 255, 0.22);
  outline-offset: 2px;
}

input,
textarea {
  font: inherit;
}

h1,
h2,
p,
dl,
dd {
  margin: 0;
}

textarea {
  font: inherit;
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shell {
  width: 100%;
  max-width: 100%;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-x: hidden;
}

.phone {
  width: min(430px, 100%);
  max-width: 100%;
  min-width: 0;
  height: min(880px, calc(100dvh - 48px));
  min-height: 720px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(180deg, #fbfcfe 0%, #f6f9fc 46%, #eef3f7 100%);
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 32px;
  box-shadow: var(--shadow);
}

.phone::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 22%),
    linear-gradient(90deg, rgba(15, 159, 119, 0.05), rgba(37, 99, 235, 0.05));
}

.floating-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: 64px;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: end;
  gap: 6px;
  padding: 0 14px 8px;
  background: rgba(250, 252, 254, 0.76);
  border-bottom: 1px solid rgba(17, 24, 39, 0.07);
  backdrop-filter: blur(22px);
}

.floating-header h1 {
  justify-self: center;
  color: #101828;
  font-size: 16px;
  line-height: 40px;
  font-weight: 780;
}

.icon-button,
.composer-icon,
.mini-icon {
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  transition: transform 160ms var(--ease), background 160ms var(--ease), color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.icon-button:active,
.composer-icon:active,
.mini-icon:active {
  transform: scale(0.96);
}

.icon-button {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(17, 24, 39, 0.08);
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.06);
}

.menu-trigger {
  justify-self: start;
}

.header-spacer {
  width: 44px;
  height: 44px;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  z-index: 35;
  background: rgba(11, 16, 22, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease);
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-backdrop[hidden] {
  display: block;
}

.drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  width: 78%;
  max-width: 320px;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 54px 18px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 252, 0.94));
  border-right: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: 24px 0 54px rgba(17, 24, 39, 0.18);
  backdrop-filter: blur(24px);
  transform: translateX(-104%);
  transition: transform 240ms var(--ease);
}

.drawer.open {
  transform: translateX(0);
}

.drawer-main {
  display: grid;
  align-content: start;
  gap: 10px;
}

.drawer-brand {
  width: max-content;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 999px;
  padding: 0 12px;
  background: #111827;
  color: white;
  font-size: 13px;
  font-weight: 780;
  margin-bottom: 14px;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.12);
}

.drawer-item {
  position: relative;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  border-radius: var(--radius);
  background: transparent;
  color: #1d2939;
  font-size: 16px;
  font-weight: 720;
  text-align: left;
  transition: transform 160ms var(--ease), background 160ms var(--ease), color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.drawer-item:active {
  transform: scale(0.98);
}

.drawer-item svg {
  color: var(--muted);
}

.drawer-item.active {
  background:
    linear-gradient(180deg, rgba(234, 241, 255, 0.96), rgba(255, 255, 255, 0.86));
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.14), 0 10px 22px rgba(37, 99, 235, 0.08);
}

.drawer-item.active svg {
  color: var(--accent);
}

.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
}

.profile {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    linear-gradient(135deg, #111827, #2563eb);
  color: white;
  font-weight: 800;
}

.profile strong,
.profile span {
  display: block;
}

.profile strong {
  font-size: 14px;
}

.profile span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.drawer-tools {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
}

.mini-icon {
  min-width: 38px;
  min-height: 38px;
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(17, 24, 39, 0.08);
  color: var(--muted);
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.05);
}

.mini-icon svg {
  width: 20px;
  height: 20px;
}

.content-area {
  position: absolute;
  inset: 64px 0 76px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 6px 14px 18px;
  scrollbar-width: none;
}

.content-area::-webkit-scrollbar {
  display: none;
}

.detail-panel {
  position: absolute;
  inset: 0;
  z-index: 18;
  overflow-y: auto;
  padding: 0 0 24px;
  background:
    linear-gradient(180deg, #fbfcfe 0%, #f3f7fb 100%);
}

.detail-panel[hidden] {
  display: none;
}

.detail-panel-header {
  min-height: 62px;
  display: grid;
  grid-template-columns: 54px 1fr 64px;
  align-items: center;
  gap: 8px;
  margin: -6px -14px 16px;
  padding: 8px 14px 0;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(250, 252, 254, 0.86);
  backdrop-filter: blur(18px);
}

.detail-panel-header h2 {
  justify-self: center;
  font-size: 17px;
}

.detail-back,
.detail-save {
  min-height: 44px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
}

.detail-back {
  width: 44px;
  display: grid;
  place-items: center;
}

.detail-save {
  color: var(--accent);
  font-weight: 780;
}

.detail-edit-form {
  display: grid;
  gap: 14px;
  padding: 2px 0 0;
}

.detail-edit-form label {
  display: grid;
  gap: 7px;
}

.detail-edit-form label span,
.detail-meta-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.detail-edit-form input,
.detail-edit-form textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 13px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  outline: none;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.04);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
}

.detail-edit-form input:focus,
.detail-edit-form textarea:focus {
  border-color: rgba(37, 99, 235, 0.44);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.detail-edit-form textarea {
  min-height: 138px;
  resize: vertical;
  line-height: 1.5;
}

.detail-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.detail-meta-row strong {
  font-size: 14px;
}

.source-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
  padding: 12px;
}

.source-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.source-card p {
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-complete,
.detail-delete {
  min-height: 48px;
  border-radius: var(--radius);
  font-weight: 780;
}

.detail-complete {
  background: #111827;
  color: white;
  box-shadow: 0 14px 32px rgba(17, 24, 39, 0.14);
}

.detail-delete {
  border: 1px solid rgba(228, 91, 61, 0.18);
  background: #fff3ef;
  color: var(--danger);
}

.detail-complete[hidden],
.detail-delete[hidden] {
  display: none;
}

.category-panel {
  display: none;
}

.category-panel.active {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.category-panel.active::-webkit-scrollbar {
  display: none;
}

#home-panel.active {
  overflow: hidden;
}

.home-board {
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-task-flow {
  width: 100%;
  max-width: 100%;
  flex: 0 0 36%;
  max-height: 360px;
  min-height: 190px;
  min-width: 0;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-task-header {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}

.home-task-header p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.home-task-header strong {
  display: block;
  margin-top: 2px;
  color: #101828;
  font-size: 24px;
  line-height: 1.1;
}

.home-task-header span {
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 760;
}

.home-task-list {
  width: 100%;
  max-width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 0 2px 10px 0;
  scrollbar-width: none;
}

.home-task-list::-webkit-scrollbar {
  display: none;
}

.home-task-card {
  position: relative;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 16px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.07);
  animation: messageIn 220ms var(--ease) both;
}

.home-task-card.urgent {
  border-color: rgba(180, 83, 32, 0.22);
  background:
    linear-gradient(180deg, #ffffff, #fff8f3);
}

.home-task-card.expired {
  border-color: rgba(228, 91, 61, 0.26);
  background:
    linear-gradient(180deg, #ffffff, #fff5f2);
}

.home-task-main {
  width: 100%;
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 10px;
  align-items: start;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  padding-right: 42px;
  text-align: left;
}

.home-task-line {
  width: 8px;
  min-height: 56px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--mint));
}

.home-task-card.urgent .home-task-line {
  background: linear-gradient(180deg, var(--warning), #f59e0b);
}

.home-task-card.expired .home-task-line {
  background: linear-gradient(180deg, var(--danger), #fb7185);
}

.home-task-main strong {
  display: block;
  color: #101828;
  font-size: 16px;
  line-height: 1.25;
}

.home-task-main em,
.home-task-main small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.35;
}

.home-task-menu {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
}

.home-task-more {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.07);
}

.home-task-more[aria-expanded="true"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.home-task-more svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.task-menu-layer {
  position: absolute;
  inset: 0;
  z-index: 34;
  pointer-events: none;
}

.task-menu-layer[hidden] {
  display: none;
}

.task-menu-popover {
  position: absolute;
  min-width: 116px;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 34px rgba(17, 24, 39, 0.16);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  animation: menuIn 160ms var(--ease) both;
}

.task-menu-popover button {
  min-height: 36px;
  border-radius: 10px;
  padding: 0 12px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 720;
  text-align: left;
}

.task-menu-popover button:first-child {
  color: var(--accent-strong);
}

.task-menu-popover button:last-child {
  color: var(--danger);
}

.task-menu-popover button:active {
  background: var(--surface-soft);
}

.chat-thread {
  width: 100%;
  max-width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  position: relative;
  z-index: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 0 12px;
  scrollbar-width: none;
}

.chat-thread::-webkit-scrollbar {
  display: none;
}

.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  animation: messageIn 260ms var(--ease) both;
}

.chat-message.user {
  justify-content: flex-end;
}

.chat-message.system {
  justify-content: flex-start;
}

.bubble {
  max-width: min(86%, 330px);
  border-radius: 20px;
  padding: 12px 13px;
  box-shadow: var(--shadow-soft);
}

.chat-message.user .bubble {
  background:
    linear-gradient(180deg, #2f73ee, #1857d3);
  color: white;
  border-bottom-right-radius: 6px;
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.2);
}

.chat-message.system .bubble {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border: 1px solid rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(18px);
}

.bubble p {
  font-size: 15px;
  line-height: 1.5;
}

.chat-attachment {
  margin-top: 10px;
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 13px;
  font-weight: 760;
}

.system .chat-attachment {
  background: var(--surface-soft);
  color: #344054;
}

.result-mini-card {
  width: 100%;
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(145deg, #ffffff 0%, #f0f6ff 50%, #e8f0ff 100%);
  color: var(--text);
  padding: 16px;
  text-align: left;
  box-shadow: 
    0 4px 16px rgba(37, 99, 235, 0.08),
    0 8px 32px rgba(37, 99, 235, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease);
}

.result-mini-card:active {
  transform: scale(0.985);
}

.result-mini-card strong {
  font-size: 18px;
  font-weight: 780;
  line-height: 1.3;
  color: #0f172a;
  letter-spacing: 0.2px;
}

.result-mini-card span,
.result-mini-card em {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  font-style: normal;
  display: flex;
  align-items: center;
  gap: 6px;
}

.result-mini-card.conflict {
  border-color: rgba(239, 68, 68, 0.28);
  background:
    linear-gradient(145deg, #fff7ed 0%, #ffedd5 50%, #fed7aa 100%);
  box-shadow: 
    0 4px 16px rgba(239, 68, 68, 0.12),
    0 8px 32px rgba(239, 68, 68, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.result-mini-card.conflict em {
  color: #dc2626;
  font-weight: 780;
}

.result-actions,
.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.result-actions button,
.record-actions button {
  min-height: 34px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 760;
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.summary {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 0 2px;
}

.summary p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 680;
}

.summary strong {
  font-size: 28px;
  line-height: 1.12;
  color: #101828;
}

.task-list {
  display: grid;
  gap: 12px;
}

.view-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: -4px 0 14px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 999px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.68);
}

.view-switch-button {
  min-height: 38px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
}

.view-switch-button.active {
  background: #111827;
  color: white;
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.14);
}

.schedule-view {
  display: none;
}

.schedule-view.active {
  display: block;
}

.task-card,
.event-card {
  min-height: 76px;
  display: grid;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  padding: 14px;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06);
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), border-color 160ms var(--ease);
}

.task-card:active,
.event-card:active,
.record-card:active {
  transform: scale(0.985);
}

.task-card {
  grid-template-columns: 28px 1fr;
  width: 100%;
  text-align: left;
  color: var(--text);
}

.task-card.urgent {
  border-color: rgba(180, 83, 32, 0.26);
  background:
    linear-gradient(180deg, #ffffff, #fff8f3);
}

.check-button {
  width: 26px;
  height: 26px;
  border: 2px solid #c7d0d8;
  border-radius: 50%;
  background: white;
  box-shadow: inset 0 0 0 4px #fff, 0 6px 14px rgba(17, 24, 39, 0.05);
}

.task-card.urgent .check-button {
  border-color: var(--warning);
}

.task-card.expired {
  border-color: rgba(228, 91, 61, 0.26);
  background:
    linear-gradient(180deg, #ffffff, #fff5f2);
}

.event-card.expired {
  border-color: rgba(228, 91, 61, 0.24);
  background:
    linear-gradient(180deg, #ffffff, #fff6f3);
}

.task-card.expired .check-button {
  border-color: var(--danger);
}

.task-card.done {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(244, 247, 250, 0.88));
}

.task-card.done .check-button {
  border-color: var(--mint);
  background: var(--mint);
  box-shadow: inset 0 0 0 5px var(--mint), 0 6px 14px rgba(15, 159, 119, 0.16);
}

.task-card.done h2 {
  color: var(--muted);
}

.task-card h2,
.event-card h2 {
  font-size: 17px;
  line-height: 1.25;
}

.task-card p,
.event-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  margin-top: 5px;
}

.event-card {
  grid-template-columns: 92px 1fr;
  width: 100%;
  text-align: left;
  color: var(--text);
}

.event-card time {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 780;
  line-height: 1.35;
}

.schedule-group {
  display: grid;
  gap: 10px;
}

.schedule-group + .schedule-group {
  margin-top: 18px;
}

.schedule-group > h2 {
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.calendar-shell {
  display: grid;
  gap: 12px;
}

.calendar-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: var(--radius);
  padding: 10px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06);
}

.calendar-header div {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.calendar-header span {
  color: #101828;
  font-size: 17px;
  font-weight: 780;
}

.calendar-header strong {
  color: var(--muted);
  font-size: 13px;
}

.calendar-nav {
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
}

.calendar-nav svg {
  width: 20px;
  height: 20px;
}

.calendar-today {
  min-height: 40px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 780;
}

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

.calendar-weekdays span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  text-align: center;
}

.calendar-grid {
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: var(--radius);
  padding: 10px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06);
}

.calendar-day {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: transparent;
  color: #101828;
  font-size: 14px;
  font-weight: 760;
}

.calendar-day.empty {
  display: block;
}

.calendar-day.today {
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.34);
}

.calendar-day.has-event {
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.14);
}

.calendar-day.expired {
  background: var(--warning-soft);
  color: var(--warning);
  box-shadow: inset 0 0 0 1px rgba(180, 83, 32, 0.18);
}

.calendar-day.selected {
  background: #111827;
  color: white;
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.16);
}

.calendar-day em {
  position: absolute;
  right: 5px;
  bottom: 5px;
  min-width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: currentColor;
  color: white;
  font-size: 10px;
  font-style: normal;
  line-height: 1;
}

.calendar-day.selected em {
  background: white;
  color: #111827;
}

.calendar-selected {
  display: grid;
  gap: 10px;
}

.calendar-selected > h2 {
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.calendar-event-card {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: var(--radius);
  padding: 13px;
  background: rgba(255, 255, 255, 0.9);
  text-align: left;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06);
}

.calendar-event-card.expired {
  background: #fff6f3;
  border-color: rgba(228, 91, 61, 0.24);
}

.calendar-event-card strong {
  color: #101828;
  font-size: 16px;
}

.calendar-event-card span {
  color: var(--muted);
  font-size: 13px;
}

.empty-state.compact {
  min-height: 88px;
}

.empty-state {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(102, 112, 133, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
  font-size: 15px;
}

.record-list {
  display: grid;
  gap: 12px;
}

.record-card {
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  padding: 14px;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06);
  transition: transform 160ms var(--ease);
}

.record-card h2 {
  font-size: 17px;
}

.record-card p {
  margin-top: 7px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.record-card span {
  display: inline-flex;
  margin-top: 10px;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--mint-soft);
  color: #087057;
  font-size: 12px;
  font-weight: 720;
}

.record-actions {
  margin-top: 12px;
}

.voice-composer {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 0;
  z-index: 22;
  height: 60px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 4px;
  margin: 0 0 max(10px, env(safe-area-inset-bottom));
  padding: 6px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 249, 252, 0.96));
  backdrop-filter: blur(20px);
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.14);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.voice-composer.text-mode {
  grid-template-columns: 44px minmax(0, 1fr) 44px 44px;
}

.voice-preview {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: calc(70px + max(10px, env(safe-area-inset-bottom)));
  z-index: 24;
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  padding: 9px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 38px rgba(17, 24, 39, 0.16);
  backdrop-filter: blur(20px);
  animation: messageIn 180ms var(--ease) both;
}

.voice-preview[hidden] {
  display: none;
}

.voice-preview p {
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 680;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  user-select: text;
  -webkit-user-select: text;
}

.voice-preview-action {
  min-width: 58px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 12px;
  padding: 0 9px;
  font-size: 13px;
  font-weight: 780;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.voice-preview-action svg {
  width: 16px;
  height: 16px;
}

.voice-preview-action.primary {
  background: #111827;
  color: white;
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.14);
}

.voice-preview-action.secondary {
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: var(--surface-soft);
  color: var(--muted);
}

.voice-preview-action:disabled {
  opacity: 0.5;
  cursor: default;
}

.share-sim-button {
  position: absolute;
  right: 16px;
  bottom: 82px;
  z-index: 21;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: 50%;
  padding: 0;
  background: rgba(255, 255, 255, 0.84);
  color: var(--accent-strong);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
  backdrop-filter: blur(14px);
  opacity: 0.86;
}

.share-sim-button svg {
  width: 19px;
  height: 19px;
}

.composer-icon {
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--primary);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.composer-icon svg {
  width: 21px;
  height: 21px;
}

.composer-send {
  color: var(--accent);
}

.composer-send:disabled {
  opacity: 0.42;
  cursor: default;
}

.composer-send.active {
  background: var(--accent);
  color: white;
}

.composer-center {
  min-width: 0;
}

.hold-button {
  width: 100%;
  min-height: 44px;
  border-radius: 13px;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 760;
  box-shadow: none;
  transition: transform 160ms var(--ease), background 160ms var(--ease), color 160ms var(--ease);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.hold-button:active {
  transform: scale(0.985);
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
}

.voice-composer.voice-active {
  border-color: rgba(239, 68, 68, 0.32);
  box-shadow: 0 16px 38px rgba(239, 68, 68, 0.18);
}

.voice-composer.voice-busy {
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 16px 38px rgba(37, 99, 235, 0.16);
}

.hold-button.recording {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  animation: voicePulse 900ms ease-in-out infinite alternate;
}

.hold-button.recognizing {
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
}

.composer-input {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--text);
  outline: none;
  padding: 0 12px;
  font-size: 16px;
  box-shadow: none;
  user-select: text;
  -webkit-user-select: text;
}

.composer-input[hidden],
.hold-button[hidden],
.composer-send[hidden] {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(144px + max(10px, env(safe-area-inset-bottom)));
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  pointer-events: none;
  z-index: 90;
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(17, 24, 39, 0.94);
  color: white;
  font-size: 14px;
  box-shadow: 0 16px 36px rgba(17, 24, 39, 0.18);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes voicePulse {
  from {
    transform: scale(0.985);
  }

  to {
    transform: scale(1);
  }
}

.camera-view {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: grid;
  grid-template-rows: 130px 1fr 224px;
  background: #000;
  color: white;
}

.camera-view[hidden] {
  display: none;
}

.camera-topbar {
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  align-items: end;
  gap: 8px;
  padding: 0 18px 20px;
}

.camera-topbar h2 {
  justify-self: center;
  font-size: 22px;
  line-height: 44px;
}

.camera-close,
.camera-flash,
.camera-album,
.camera-switch {
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: transparent;
  color: white;
}

.camera-preview {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 38%),
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.18), transparent 20%),
    linear-gradient(145deg, #3a3029, #5f5346 40%, #2a2e34);
}

.poster-card {
  width: 44%;
  aspect-ratio: 0.68;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  transform: rotate(-8deg) translateY(18px);
  border-radius: 7px;
  background: #1d6d51;
  color: #f6dc73;
  box-shadow: 0 28px 46px rgba(0, 0, 0, 0.36);
  text-align: center;
  padding: 14px;
}

.poster-card strong {
  font-size: 19px;
}

.poster-card span {
  font-size: 12px;
}

.scan-corners {
  position: absolute;
  inset: 21% 9%;
  z-index: 2;
}

.scan-corners span {
  position: absolute;
  width: 58px;
  height: 58px;
  border-color: white;
}

.scan-corners span:nth-child(1) {
  top: 0;
  left: 0;
  border-top: 4px solid;
  border-left: 4px solid;
  border-radius: 20px 0 0 0;
}

.scan-corners span:nth-child(2) {
  top: 0;
  right: 0;
  border-top: 4px solid;
  border-right: 4px solid;
  border-radius: 0 20px 0 0;
}

.scan-corners span:nth-child(3) {
  bottom: 0;
  left: 0;
  border-bottom: 4px solid;
  border-left: 4px solid;
  border-radius: 0 0 0 20px;
}

.scan-corners span:nth-child(4) {
  right: 0;
  bottom: 0;
  border-right: 4px solid;
  border-bottom: 4px solid;
  border-radius: 0 0 20px 0;
}

.camera-controls {
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 24px 28px max(28px, env(safe-area-inset-bottom));
  background: #000;
}

.camera-controls p {
  text-align: center;
  color: #f0d9df;
  font-size: 18px;
}

.camera-actions {
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  gap: 18px;
  margin-top: 4px;
}

.camera-album {
  width: 60px;
  height: 60px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: linear-gradient(135deg, #eef7ff, #cfe2ea);
  color: #18212a;
}

.shutter {
  width: 82px;
  height: 82px;
  justify-self: center;
  border: 7px solid white;
  border-radius: 50%;
  background: white;
  box-shadow: inset 0 0 0 4px #000;
}

.camera-switch {
  width: 62px;
  height: 62px;
  justify-self: end;
  background: rgba(255, 255, 255, 0.1);
}

@keyframes wave {
  from {
    transform: scaleY(0.58);
    opacity: 0.68;
  }

  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

@media (max-width: 520px) {
  .shell {
    padding: 0;
  }

  .phone {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

html.android-app,
body.android-app {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background: var(--app);
}

body.android-app .shell {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  min-height: 100vh;
  display: block;
  padding: 0;
  overflow: hidden;
}

body.android-app .phone {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

@supports (height: 100dvh) {
  html.android-app,
  body.android-app,
  body.android-app .shell,
  body.android-app .phone {
    height: 100dvh;
    min-height: 100dvh;
  }
}

body.android-app .voice-composer {
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
}

body.android-app .voice-preview {
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
}

.conflict-dialog,
.reminder-dialog {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.conflict-dialog[hidden],
.reminder-dialog[hidden] {
  display: none;
}

.conflict-backdrop,
.reminder-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(12px);
}

.conflict-modal,
.reminder-modal {
  position: relative;
  width: 100%;
  max-width: 340px;
  display: grid;
  gap: 16px;
  border-radius: 20px;
  background: white;
  overflow: hidden;
  box-shadow: 0 32px 84px rgba(0, 0, 0, 0.24);
  animation: modalIn 240ms var(--ease) both;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.conflict-header,
.reminder-header {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  background: var(--warning-soft);
}

.conflict-header h2,
.reminder-header h2 {
  color: var(--warning);
  font-size: 17px;
  font-weight: 780;
}

.conflict-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: var(--warning);
}

.conflict-close svg {
  width: 18px;
  height: 18px;
}

.conflict-content {
  display: grid;
  gap: 16px;
  padding: 0 18px;
}

.conflict-content p {
  color: var(--text);
  font-size: 15px;
  font-weight: 720;
  text-align: center;
}

.conflict-item {
  display: grid;
  gap: 8px;
}

.conflict-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.conflict-card {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.conflict-card strong {
  color: #101828;
  font-size: 16px;
}

.conflict-card span {
  color: var(--muted);
  font-size: 13px;
}

.conflict-actions,
.reminder-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(17, 24, 39, 0.06);
}

.conflict-action-cancel,
.conflict-action-edit,
.conflict-action-create {
  min-height: 44px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 760;
}

.conflict-action-cancel {
  background: var(--surface-soft);
  color: var(--muted);
}

.conflict-action-edit {
  border: 1px solid rgba(37, 99, 235, 0.26);
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-strong);
}

.conflict-action-create {
  background: #111827;
  color: white;
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.14);
}

.reminder-header {
  background: var(--accent-soft);
}

.reminder-header h2 {
  color: var(--accent-strong);
}

.reminder-content {
  display: grid;
  gap: 12px;
  padding: 24px 18px;
  text-align: center;
}

.reminder-icon {
  width: 68px;
  height: 68px;
  justify-self: center;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.reminder-icon svg {
  width: 32px;
  height: 32px;
}

.reminder-content strong {
  color: #101828;
  font-size: 19px;
  font-weight: 780;
}

.reminder-content span {
  color: var(--muted);
  font-size: 14px;
}

.reminder-content p {
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.reminder-actions {
  grid-template-columns: 1fr 1fr;
}

.reminder-action-snooze,
.reminder-action-done {
  min-height: 46px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 780;
}

.reminder-action-snooze {
  border: 1px solid rgba(17, 24, 39, 0.1);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.reminder-action-done {
  background: #111827;
  color: white;
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.16);
}

.typing-indicator {
  display: flex;
  gap: 6px;
  padding: 10px 0;
  justify-content: center;
}

.typing-indicator span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  animation: typingBounce 1.4s infinite ease-in-out;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% {
    transform: scale(0.5) translateY(0);
    opacity: 0.4;
  }
  40% {
    transform: scale(1) translateY(-4px);
    opacity: 1;
  }
}

.result-mini-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 
    0 8px 24px rgba(37, 99, 235, 0.14),
    0 16px 48px rgba(37, 99, 235, 0.1);
}

.result-mini-card:active {
  transform: translateY(-2px) scale(0.99);
}

.home-task-card {
  transition: all 200ms var(--ease);
}

.home-task-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 42px rgba(17, 24, 39, 0.12);
}

.task-card,
.event-card {
  transition: all 160ms var(--ease);
}

.task-card:hover,
.event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.1);
}

.bubble p {
  font-size: 15px;
  line-height: 1.6;
}

.chat-message.user .bubble p {
  color: rgba(255, 255, 255, 0.96);
}

.chat-message.system .bubble p {
  color: var(--text);
}

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