:root {
  --bg: #f6f1e8;
  --panel: rgba(255, 252, 246, 0.92);
  --ink: #1d2a24;
  --muted: #57655d;
  --accent: #2d6a4f;
  --accent-strong: #1f4b39;
  --line: rgba(29, 42, 36, 0.12);
  --danger: #9b2226;
  --shadow: 0 18px 50px rgba(32, 31, 27, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(45, 106, 79, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(188, 108, 37, 0.16), transparent 24%),
    linear-gradient(180deg, #fbf8f1 0%, var(--bg) 100%);
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero,
.panel,
.toolbar,
dialog {
  backdrop-filter: blur(12px);
}

.hero,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 28px;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
}

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

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 0.95;
}

.subtitle {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
}

.user-card {
  min-width: 360px;
  max-width: 720px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(45, 106, 79, 0.08);
}

.user-label,
.user-id,
.meta {
  color: var(--muted);
  font-size: 14px;
}

.toolbar {
  display: flex;
  gap: 12px;
  margin: 18px 0;
}

.panel {
  margin-top: 18px;
  padding: 24px;
}

label {
  display: block;
  margin-bottom: 16px;
  font-weight: 600;
}

textarea,
input {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: #fffdf8;
}

textarea {
  resize: vertical;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.form-actions,
.task-actions,
.dialog-heading,
.section-heading {
  display: flex;
  gap: 12px;
  align-items: center;
}

.form-actions {
  margin-top: 8px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font: inherit;
  cursor: pointer;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.ghost-button {
  background: rgba(45, 106, 79, 0.08);
  color: var(--ink);
}

.danger-button {
  background: rgba(155, 34, 38, 0.12);
  color: var(--danger);
}

.count-badge {
  margin-left: auto;
  background: rgba(45, 106, 79, 0.12);
  color: var(--accent-strong);
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
}

.task-list {
  margin: 0;
  padding-left: 22px;
}

.task-item {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
}

.task-item.completed {
  background: rgba(100, 188, 120, 0.12);
  border-color: rgba(45, 106, 79, 0.26);
}

.task-item h3 {
  margin: 0 0 8px;
}

.task-item.completed h3 {
  text-decoration: line-through;
  color: var(--accent-strong);
}

.task-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  cursor: pointer;
}

.task-switch input {
  display: none;
}

.task-switch-ui {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(88, 95, 91, 0.28);
  position: relative;
  transition: background 0.2s ease;
}

.task-switch-ui::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.task-switch input:checked + .task-switch-ui {
  background: var(--accent);
}

.task-switch input:checked + .task-switch-ui::after {
  transform: translateX(20px);
}

.images {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.image-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  position: relative;
}

.image-card strong,
.history-item strong {
  display: block;
  padding: 12px 14px 0;
}

.image-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  padding: 12px;
  border-radius: 24px;
  cursor: zoom-in;
}

.image-card.empty {
  min-height: 304px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
  cursor: pointer;
}

.image-card.empty strong,
.image-card.empty .meta {
  padding: 0;
  margin: 0;
}

.image-card.empty strong {
  margin-bottom: 10px;
}

.image-actions {
  display: flex;
  gap: 10px;
  padding: 0 14px 14px;
}

.image-action {
  background: rgba(45, 106, 79, 0.08);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
}

.delete-photo-action {
  background: rgba(155, 34, 38, 0.12);
  color: var(--danger);
}

.users-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.users-list-top {
  margin-top: 10px;
}

.user-pill {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(88, 95, 91, 0.12);
  color: #3f4844;
}

.user-pill.current {
  background: rgba(100, 188, 120, 0.2);
  color: #1f4b39;
  border-color: rgba(45, 106, 79, 0.3);
}

.user-pill .meta {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.user-pill strong {
  display: block;
  margin-bottom: 4px;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

dialog {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 0;
  width: min(920px, calc(100% - 24px));
  background: rgba(255, 252, 246, 0.98);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(22, 25, 24, 0.42);
}

.progress-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
}

.progress-ring {
  --progress: 0%;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    conic-gradient(var(--accent) var(--progress), rgba(88, 95, 91, 0.16) 0),
    radial-gradient(circle at center, rgba(255, 252, 246, 0.98) 58%, transparent 59%);
  box-shadow: 0 18px 40px rgba(29, 42, 36, 0.18);
  border: 1px solid rgba(29, 42, 36, 0.08);
}

.progress-inner {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 252, 246, 0.98);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(29, 42, 36, 0.06);
}

.progress-inner strong {
  font-size: 1.15rem;
  line-height: 1;
}

.progress-inner span {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dialog-body {
  padding: 24px;
}

.dialog-body.wide {
  min-height: 320px;
}

.image-dialog-body {
  max-width: 1000px;
}

.image-preview {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 18px;
  background: rgba(29, 42, 36, 0.06);
}

.history-group {
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(45, 106, 79, 0.06);
}

.history-item {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.history-item h4 {
  margin: 8px 0 12px;
}

.history-item.task-item {
  margin-bottom: 14px;
  padding: 18px 18px 18px 22px;
}

.history-item p,
.history-item h4 {
  padding-left: 2px;
}

.history-images {
  margin-top: 8px;
}

.history-item .image-card {
  pointer-events: none;
}

.history-item .image-actions {
  display: none;
}

.history-item:first-of-type {
  border-top: 0;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1120px);
  }

  .hero {
    flex-direction: column;
  }

  .toolbar,
  .form-actions,
  .task-actions,
  .dialog-heading,
  .section-heading {
    flex-wrap: wrap;
  }
}
