:root {
  --bg: #f5efe3;
  --panel: rgba(255, 251, 245, 0.88);
  --panel-strong: #fffdf8;
  --line: rgba(79, 62, 43, 0.12);
  --text: #1f1a17;
  --muted: #7a6f64;
  --accent: #c96342;
  --accent-strong: #b34f30;
  --accent-soft: rgba(201, 99, 66, 0.12);
  --success: #2f7d5f;
  --shadow: 0 24px 60px rgba(74, 52, 29, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    "Avenir Next",
    "Segoe UI",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(201, 99, 66, 0.16), transparent 30%),
    radial-gradient(circle at bottom right, rgba(47, 125, 95, 0.14), transparent 24%),
    linear-gradient(135deg, #f7f1e8 0%, #efe2cf 100%);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1400px, calc(100vw - 32px));
  margin: 24px auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 52px);
  line-height: 0.95;
}

h2 {
  font-size: clamp(24px, 3vw, 34px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(360px, 0.8fr);
  gap: 20px;
}

.calendar-panel,
.details-panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  border-radius: var(--radius-xl);
}

.calendar-panel {
  padding: 20px;
  min-width: 0;
}

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

.weekdays {
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.weekdays span {
  padding: 10px 12px;
}

.calendar-grid {
  gap: 10px;
}

.day-card {
  min-height: 162px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.68);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.day-card:hover {
  transform: translateY(-2px);
  border-color: rgba(201, 99, 66, 0.28);
  box-shadow: 0 14px 26px rgba(82, 53, 31, 0.08);
}

.day-card.is-outside {
  opacity: 0.45;
}

.day-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.day-card.is-today .day-number {
  background: var(--accent);
  color: #fff;
}

.day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.day-number {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  background: rgba(31, 26, 23, 0.06);
}

.todo-preview {
  display: grid;
  gap: 8px;
  margin-top: auto;
  min-height: 76px;
  align-content: start;
}

.todo-pill {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(31, 26, 23, 0.06);
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.todo-placeholder {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(79, 62, 43, 0.12);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.32);
}

.todo-pill.is-done {
  text-decoration: line-through;
  color: var(--muted);
}

.more-count {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.details-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0;
  flex-wrap: nowrap;
  margin-left: auto;
}

.auth-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(201, 99, 66, 0.12), rgba(47, 125, 95, 0.08)),
    rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.55);
  width: 220px;
  flex: 0 0 220px;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(31, 26, 23, 0.08);
}

.user-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.user-copy strong {
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-copy span {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.details-header {
  display: grid;
  gap: 10px;
}

.details-subtitle {
  color: var(--muted);
  line-height: 1.5;
}

.todo-form,
.todo-list-wrap {
  display: grid;
  gap: 14px;
}

.input-label,
.todo-list-header {
  font-size: 14px;
  font-weight: 700;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  outline: none;
}

input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.primary-button,
.ghost-button,
.delete-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.primary-button:hover,
.ghost-button:hover,
.delete-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.ghost-button {
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 700;
}

.todo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.todo-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
}

.todo-checkbox {
  position: relative;
  width: 24px;
  height: 24px;
}

.todo-checkbox input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.todo-checkmark {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(31, 26, 23, 0.2);
  background: #fff;
}

.todo-checkbox input:checked + .todo-checkmark {
  background: var(--success);
  border-color: var(--success);
}

.todo-checkbox input:checked + .todo-checkmark::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.todo-text {
  line-height: 1.4;
}

.todo-item.is-done .todo-text {
  color: var(--muted);
  text-decoration: line-through;
}

.delete-button {
  padding: 8px 12px;
  background: rgba(201, 99, 66, 0.12);
  color: var(--accent);
  font-weight: 700;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
  background: rgba(255, 255, 255, 0.4);
}

.is-disabled {
  opacity: 0.56;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 1240px) {
  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 20px, 100%);
    margin: 10px auto 20px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .nav-actions {
    flex-wrap: wrap;
  }

  .calendar-panel,
  .details-panel {
    padding: 16px;
    border-radius: 22px;
  }

  .weekdays {
    gap: 6px;
    font-size: 11px;
  }

  .weekdays span {
    padding: 6px 4px;
    text-align: center;
  }

  .calendar-grid {
    gap: 6px;
  }

  .day-card {
    min-height: 110px;
    padding: 10px;
    gap: 8px;
  }

  .day-number {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  .todo-pill {
    padding: 6px 8px;
    font-size: 11px;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .primary-button {
    min-height: 46px;
  }

  .auth-bar {
    width: 100%;
    justify-content: space-between;
  }

  .auth-user-card {
    width: calc(100% - 132px);
    flex: 1 1 auto;
  }
}
