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

:root {
  --night: #1a1f2e;
  --fog:  #e8eaf0;
  --white: #f7f8fc;
  --amber: #e8a838;
  --green: #3a9c6b;
  --green-light: #e6f4ed;
  --muted: #7a8199;
  --border: #d4d8e8;
  --note-bg: #f0f1f5;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--white);
  color: var(--night);
  min-height: 100vh;
}

header {
  background: var(--night);
  color: white;
  padding: 2rem 1.5rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,.25);
}

header .eyebrow {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 600;
  margin-bottom: .4rem;
}

header h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.4rem, 5vw, 2rem);
  line-height: 1.1;
  font-weight: 400;
}

.progress-bar-wrap {
  margin-top: 1rem;
  background: rgba(255,255,255,.12);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--amber);
  border-radius: 99px;
  transition: width .4s ease;
  width: 0%;
}

.progress-label {
  margin-top: .4rem;
  font-size: .75rem;
  color: rgba(255,255,255,.55);
}

main {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

.tab-bar {
  display: flex;
  gap: .4rem;
  margin-bottom: 1.5rem;
  background: var(--fog);
  border-radius: 10px;
  padding: .3rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 1;
  min-width: max-content;
  border: none;
  background: transparent;
  padding: .55rem .7rem;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 500;
  color: var(--muted);
  border-radius: 7px;
  cursor: pointer;
  transition: background .2s, color .2s;
  white-space: nowrap;
}

.tab-btn.active {
  background: white;
  color: var(--night);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

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

.section { margin-bottom: 1.2rem; }

.section-title {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .5rem 0 .5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .4rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.section-title .icon { font-size: 1rem; }

.item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .6rem .5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.item:hover { background: var(--fog); }
.item.done { background: var(--green-light); }
.item.done .item-label { color: var(--muted); text-decoration: line-through; }

.checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s;
  font-size: .9rem;
}

.item.done .checkbox {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.item-label {
  font-size: .88rem;
  line-height: 1.4;
  flex: 1;
  color: var(--night);
}

/* footnote marker inline */
.fn {
  font-size: .65rem;
  color: var(--amber);
  font-weight: 700;
  vertical-align: super;
  margin-left: .15rem;
}

/* footnotes block */
.footnotes {
  margin-top: 2rem;
  padding: 1rem 1.1rem;
  background: var(--note-bg);
  border-radius: 10px;
  border-left: 3px solid var(--amber);
}

.footnotes-title {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .6rem;
}

.footnote-row {
  display: flex;
  gap: .5rem;
  font-size: .78rem;
  color: #555;
  line-height: 1.5;
  padding: .25rem 0;
}

.footnote-num {
  color: var(--amber);
  font-weight: 700;
  flex-shrink: 0;
  width: 1.2rem;
}

.reset-btn {
  display: block;
  margin: 1.5rem auto 0;
  padding: .6rem 1.4rem;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: .82rem;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}

.reset-btn:hover { border-color: var(--night); color: var(--night); }

.all-done {
  text-align: center;
  padding: 1.5rem;
  background: var(--green-light);
  border-radius: 12px;
  margin-top: 1rem;
  display: none;
}

.all-done .emoji { font-size: 2rem; }
.all-done p { margin-top: .5rem; font-size: .9rem; color: var(--green); font-weight: 600; }
