:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --ink: #18201c;
  --muted: #5f6f67;
  --panel: #ffffff;
  --line: #d8e0da;
  --green: #236d4b;
  --green-dark: #174c34;
  --gold: #d59b2d;
  --red: #b84a3a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(980px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar,
.composer,
.toolbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  padding: 22px;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

p {
  margin: 8px 0 0;
  color: var(--muted);
}

.secret-box {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fbfcfb;
  color: var(--ink);
}

.composer {
  margin-top: 16px;
  padding: 18px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 8px;
}

.attachment-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.attachment-row input[type="file"] {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.attachment-picker {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
}

.attachment-picker:hover {
  border-color: var(--green);
}

.media-preview,
.chore-media {
  margin-top: 12px;
}

.media-preview:empty {
  display: none;
}

.media-preview img,
.media-preview video,
.chore-media img,
.chore-media video {
  display: block;
  width: min(100%, 360px);
  max-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: #eef3ef;
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
}

button:hover {
  border-color: var(--green);
}

button[type="submit"],
.status-button {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
  font-weight: 700;
}

button[type="submit"]:hover,
.status-button:hover {
  background: var(--green-dark);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding: 12px;
}

.assignees {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.assignees legend {
  width: 100%;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.assignee-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  cursor: pointer;
}

.assignee-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.assignee-option span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
}

.assignee-option input:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.assignee-option input:checked + span {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.tabs {
  display: flex;
  gap: 6px;
}

.tabs button.active {
  border-color: var(--gold);
  background: #fff6e4;
}

.status {
  min-height: 24px;
  margin: 14px 2px;
  color: var(--muted);
}

.status.error {
  color: var(--red);
}

.chores {
  display: grid;
  gap: 10px;
}

.chore {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.chore.done {
  opacity: 0.72;
}

.actions {
  display: flex;
  gap: 8px;
  justify-content: end;
}

.delete-button {
  color: var(--red);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef3ef;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: capitalize;
}

.due {
  background: #fff6e4;
  color: #7a5511;
}

.title {
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 800;
}

.chore-media {
  margin: 12px 0 0;
}

.empty {
  padding: 28px;
  text-align: center;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

@media (max-width: 680px) {
  .shell {
    width: min(100vw - 20px, 980px);
    padding-top: 10px;
  }

  .topbar,
  .toolbar,
  .chore {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

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

  .secret-box {
    min-width: 0;
  }

  .actions {
    justify-content: stretch;
  }

  .actions button {
    flex: 1;
  }
}
