:root {
  --bg: #f4dfb4;
  --paper: #fff7df;
  --paper-deep: #f8e8bf;
  --ink: #2d251d;
  --muted: #76624a;
  --line: #b9894d;
  --teal: #20756d;
  --teal-dark: #16514d;
  --orange: #c65f2f;
  --mustard: #d39b2f;
  --avocado: #6f812f;
  --rose: #b55356;
  --blue: #436b78;
  --shadow: 0 10px 0 rgba(75, 46, 25, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(135deg, rgba(115, 79, 39, 0.08) 0 2px, transparent 2px 22px),
    linear-gradient(180deg, rgba(255, 248, 224, 0.82), rgba(242, 201, 130, 0.58));
  color: var(--ink);
  font-family: "Trebuchet MS", Verdana, ui-sans-serif, system-ui, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 24px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 6px solid var(--orange);
  padding: 6px 0 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  color: var(--orange);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.35rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 3px 3px 0 #f2c66d;
}

h2 {
  margin-bottom: 12px;
  color: var(--teal-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.22rem;
}

.actor-picker,
.quick-entry,
.task-lane,
.side-panel section,
.side-panel details {
  border: 2px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.actor-picker {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(250px, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 370px;
  padding: 9px;
  border-radius: 8px;
}

.actor-picker span,
label span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 2px solid #a67a43;
  border-radius: 8px;
  background: #fffaf0;
  color: var(--ink);
  padding: 9px 10px;
}

.actor-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  min-width: 250px;
  border: 2px solid #a67a43;
  border-radius: 8px;
  background: #fffaf0;
  color: var(--ink);
  padding: 6px 10px;
  text-align: left;
}

.actor-button .avatar {
  width: 40px;
  height: 40px;
}

.actor-button strong,
.actor-option span {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actor-caret {
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 900;
}

.actor-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 6px;
  min-width: 330px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 8px;
}

.actor-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 7px 9px;
  text-align: left;
}

.actor-option:hover,
.actor-option.active {
  background: #f1cc76;
}

input[type="color"] {
  min-height: 42px;
  padding: 4px;
}

textarea {
  min-height: 76px;
  resize: vertical;
}

.quick-entry {
  grid-column: 1 / 2;
  border-radius: 8px;
  padding: 20px;
}

.quick-entry p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.45;
}

.task-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(150px, 0.85fr) minmax(140px, 0.75fr) minmax(160px, 0.85fr);
  gap: 14px;
  align-items: end;
}

.task-form label,
.person-editor label {
  display: grid;
  gap: 6px;
}

.notes-field {
  grid-column: 1 / -1;
}

.task-form .primary-button {
  grid-column: 1 / -1;
  justify-self: end;
  min-width: 150px;
}

.primary-button,
.task-action,
.save-person,
.photo-button,
.ghost-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 900;
}

.primary-button,
.save-person {
  background: var(--teal);
  color: #fffaf0;
}

.primary-button:hover,
.save-person:hover {
  background: var(--teal-dark);
}

.dashboard {
  grid-column: 1 / 2;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.filter-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 12px;
  font-weight: 900;
}

.filter-button span {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--mustard);
  color: #fffaf0;
  font-size: 0.78rem;
}

.filter-button.active {
  border-color: var(--teal);
  background: #e5e3b7;
}

.person-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.person-filter-button {
  display: inline-grid;
  grid-template-columns: auto minmax(0, auto) auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  color: var(--ink);
  padding: 6px 10px;
  font-weight: 900;
}

.person-filter-button.active {
  border-color: var(--teal);
  background: #e5e3b7;
}

.person-filter-button span {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-filter-button strong {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--mustard);
  color: #fffaf0;
  font-size: 0.78rem;
}

.columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.task-lane,
.side-panel section,
.side-panel details {
  border-radius: 8px;
  padding: 16px;
}

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

.task-card {
  display: grid;
  gap: 12px;
  border: 2px solid #c29355;
  border-left: 8px solid var(--teal);
  border-radius: 8px;
  background: #fffaf0;
  padding: 14px;
}

.task-card.done {
  border-left-color: var(--avocado);
  background: #f3f1cf;
}

.task-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.task-title h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.task-card.done h3 {
  color: #59602f;
  text-decoration: line-through;
}

.task-meta,
.task-footer,
.activity-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: #f1cc76;
  color: #4e321b;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 900;
}

.badge.due {
  background: #c8d6d3;
  color: var(--blue);
}

.badge.done {
  background: #d8dfa4;
  color: #4f602b;
}

.badge.recurrence {
  background: #e7d8ee;
  color: #6a3f73;
}

.avatar {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 2px solid #fff3cf;
  border-radius: 50%;
  background: var(--teal);
  color: #fffaf0;
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: 0 0 0 2px rgba(70, 48, 24, 0.2);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-large {
  width: 72px;
  height: 72px;
  font-size: 1.15rem;
}

.task-avatar {
  width: 38px;
  height: 38px;
}

.filter-avatar {
  width: 28px;
  height: 28px;
}

.task-notes {
  margin: 0;
  color: #554633;
  line-height: 1.45;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-action {
  background: #e9c772;
  color: #40301f;
}

.task-action.complete {
  background: var(--avocado);
  color: #fffaf0;
}

.task-action.repeat {
  background: var(--teal);
  color: #fffaf0;
}

.task-action.delete {
  background: #efd0c5;
  color: #8b311d;
}

.side-panel {
  grid-column: 2 / 3;
  grid-row: 2 / span 2;
  display: grid;
  align-content: start;
  gap: 18px;
}

.people-list,
.activity-list {
  display: grid;
  gap: 0;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 16px;
  scrollbar-gutter: stable;
}

.activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.activity-header h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.activity-header h2 strong {
  display: inline-grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--mustard);
  color: #fffaf0;
  font-family: "Trebuchet MS", Verdana, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.82rem;
}

.activity-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--teal-dark);
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.22rem;
  font-weight: 900;
  list-style: none;
}

.activity-section summary::-webkit-details-marker {
  display: none;
}

.activity-section summary::after {
  content: "v";
  color: var(--orange);
  font-family: "Trebuchet MS", Verdana, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.85rem;
}

.activity-section[open] summary {
  margin-bottom: 12px;
}

.activity-section[open] summary::after {
  content: "^";
}

.activity-section summary strong {
  display: inline-grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--mustard);
  color: #fffaf0;
  font-family: "Trebuchet MS", Verdana, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.82rem;
}

.person-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border-bottom: 2px dashed #dfbc7e;
  padding: 0 0 14px;
}

.person-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.person-photo {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 7px;
}

.person-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  align-items: end;
  gap: 8px;
}

.person-editor input[data-field="name"] {
  min-height: 40px;
  height: 40px;
  font-size: 1rem;
  padding: 7px 10px;
}

.save-person {
  width: 100%;
  min-height: 38px;
  height: 40px;
  padding: 8px 12px;
}

.photo-button {
  position: relative;
  display: inline-grid;
  min-height: 34px;
  place-items: center;
  background: var(--orange);
  color: #fffaf0;
  font-size: 0.78rem;
}

.photo-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.ghost-button {
  min-height: 32px;
  background: #f1d6b0;
  color: #6d3b23;
  font-size: 0.76rem;
}

.activity-item {
  align-items: flex-start;
  border-bottom: 2px dashed #dfbc7e;
  padding: 10px 0;
}

.activity-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.activity-text {
  min-width: 0;
  flex: 1;
  line-height: 1.35;
}

.activity-text strong {
  color: var(--ink);
}

.activity-text div {
  overflow-wrap: anywhere;
}

.activity-delete {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #efd0c5;
  color: #8b311d;
  font-weight: 900;
  margin-right: 4px;
}

.empty-state {
  border: 2px dashed #bd8950;
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.hidden {
  display: none !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(45, 37, 29, 0.34);
  padding: 18px;
}

.repeat-modal {
  display: grid;
  gap: 12px;
  width: min(420px, 100%);
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 18px;
}

.repeat-modal h2 {
  margin-bottom: 0;
}

.repeat-modal p {
  margin: 0;
  color: var(--muted);
  font-weight: 900;
  overflow-wrap: anywhere;
}

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

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .quick-entry,
  .dashboard,
  .side-panel {
    grid-column: 1;
  }

  .side-panel {
    grid-row: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notes-field {
    grid-column: 1 / -1;
  }

  .primary-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 920px) {
  .app-shell {
    gap: 18px;
    padding: 20px;
  }

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

  .actor-picker {
    grid-template-columns: auto minmax(0, 1fr);
    min-width: 0;
    width: 100%;
  }

  .actor-button {
    min-width: 0;
    width: 100%;
  }

  .actor-menu {
    left: 0;
    right: 0;
    min-width: 0;
  }

  .columns,
  .side-panel {
    grid-template-columns: 1fr;
  }

  .person-filter-button span {
    max-width: 180px;
  }
}

@media (max-width: 780px) {
  .app-shell {
    padding: 18px;
  }

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

  h1 {
    font-size: 2.45rem;
  }

  .actor-picker {
    width: 100%;
  }

  .person-filter-button {
    flex: 1 1 150px;
    justify-content: center;
  }

  .columns,
  .side-panel,
  .task-form,
  .person-editor {
    grid-template-columns: 1fr;
  }

  .task-form .primary-button {
    justify-self: stretch;
  }

  .person-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .person-photo {
    justify-items: start;
    grid-template-columns: auto auto auto;
    align-items: center;
  }

  .person-editor {
    grid-template-columns: 1fr;
  }

  .save-person {
    grid-column: 1;
  }
}
