:root {
  --bg: #f6f4ef;
  --ink: #1c1b19;
  --muted: #6b6257;
  --line: #ded6ca;
  --panel: #fffaf2;
  --accent: #2f5d50;
  --accent-soft: #cfe2d6;
  --accent-warm: #9b5f2c;
  --urgent: #c23c2a;
  --shadow: 0 6px 18px rgba(30, 22, 12, 0.08);
  --radius: 20px;
  --font-title: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --font-body: "Avenir Next", "Gill Sans", "Helvetica Neue", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  background: var(--bg);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.35;
}

body.no-scroll {
  overflow: hidden;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  background: #f8f6f1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10;
}

.auth-overlay.hidden {
  display: none;
}

.hidden {
  display: none;
}

.auth-card {
  width: min(380px, 100%);
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow);
}

.auth-screen {
  width: 100%;
  display: flex;
  justify-content: center;
}

.link-btn {
  background: transparent;
  border: none;
  color: var(--accent);
  padding: 0;
  text-align: left;
  font-size: 12px;
  cursor: pointer;
  border-radius: 0;
  box-shadow: none;
}

.link-btn:hover {
  transform: none;
  box-shadow: none;
}

.auth-title {
  font-family: var(--font-title);
  font-size: 28px;
}

.auth-error {
  color: var(--urgent);
  font-size: 13px;
  min-height: 18px;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 110px;
}

.appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  padding: 6px 0 12px;
  background: var(--bg);
  z-index: 2;
}

.list-pill {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 10px 12px;
  border-radius: 18px;
  text-align: left;
  display: grid;
  gap: 6px;
  box-shadow: var(--shadow);
  cursor: pointer;
  color: var(--ink);
}

.list-title {
  font-family: var(--font-title);
  font-size: 20px;
  letter-spacing: 0.4px;
}

.list-sub {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
}

.icon-btn {
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--accent);
  border-radius: 14px;
  padding: 8px 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(47, 93, 80, 0.12);
}

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

select,
input:not([type="checkbox"]),
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  background: #fffdf8;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

select:focus,
input:not([type="checkbox"]):focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 93, 80, 0.12);
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

button {
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(47, 93, 80, 0.18);
}

.tasks-screen {
  display: grid;
  gap: 12px;
}

.main-filters {
  margin-bottom: 4px;
}

.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag-chip input {
  margin: 0;
}

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

.task-card {
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fffdf8;
  display: grid;
  gap: 6px;
}

.task-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
}

.task-title-btn {
  background: transparent;
  border: none;
  text-align: left;
  padding: 0;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.task-title-btn:hover {
  transform: none;
  box-shadow: none;
}

.task-title-btn.completed {
  text-decoration: line-through;
  color: var(--muted);
}

.task-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.task-main input[type="checkbox"] {
  margin-top: 2px;
}

.task-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.task-name {
  font-weight: 600;
  font-size: 14px;
}

.task-meta {
  font-size: 12px;
  color: var(--muted);
}

.task-details {
  font-size: 12px;
  color: var(--muted);
}

.task-details img {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 12px;
  margin-top: 8px;
}

.detail-block {
  display: grid;
  gap: 10px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-notes {
  font-size: 12px;
  color: var(--muted);
}

.detail-image {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  display: none;
}

.badge {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.badge.urgent {
  background: #f6d9d5;
  color: var(--urgent);
}

.badge.secret {
  background: #f0e4d5;
  color: var(--accent-warm);
}

.empty-state {
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

.fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  padding: 12px 18px;
  font-size: 14px;
  box-shadow: var(--shadow);
  z-index: 2;
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(22, 17, 12, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 3;
}

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

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--panel);
  border-radius: 24px 24px 0 0;
  padding: 16px;
  box-shadow: var(--shadow);
  transform: translateY(110%);
  transition: transform 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 4;
}

.sheet.open {
  transform: translateY(0);
}

.settings-sheet {
  top: 0;
  bottom: 0;
  border-radius: 0;
  max-height: none;
  transform: translateX(100%);
}

.settings-sheet.open {
  transform: translateX(0);
}

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

.sheet-header h2 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 20px;
}

.settings-scroll {
  display: grid;
  gap: 22px;
  padding-bottom: 40px;
}

#saveSettings {
  width: 100%;
  margin-top: 10px;
}

.settings-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 0 8px;
}

.tab-btn {
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--accent);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.settings-block h3 {
  margin: 0 0 10px;
  font-family: var(--font-title);
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.user-switch {
  display: grid;
  gap: 10px;
  background: #fffdf8;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.session-name {
  font-weight: 600;
}

.members {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.member-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: #fffdf8;
  border: 1px solid var(--line);
}

.member-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.member-password {
  flex: 1;
  max-width: 220px;
  display: grid;
  gap: 6px;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

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

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

.list-item {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fffdf8;
  cursor: pointer;
  transition: border 0.2s ease, transform 0.2s ease;
}

.list-item:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.list-item.active {
  border-color: var(--accent);
  background: #eef5f1;
}

.list-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.panel-form {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.panel-form h4 {
  margin: 0;
  font-family: var(--font-title);
}

.tags-list {
  display: grid;
  gap: 10px;
}

.tag-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fffdf8;
}

.tag-row-fields {
  display: grid;
  gap: 8px;
}

.tag-row input {
  width: 100%;
}

.tag-row-actions {
  display: flex;
  gap: 8px;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(36px, 1fr));
  gap: 8px;
}

.color-swatch {
  border: 2px solid transparent;
  border-radius: 10px;
  height: 32px;
  cursor: pointer;
}

.color-swatch.active {
  border-color: #000;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.secret-members {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fffaf5;
}

.secret-members label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-btn {
  background: #fffdf8;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  color: #fff;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 720px) {
  .page {
    padding: 28px 28px 130px;
  }

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

  .fab {
    right: 32px;
  }
}
