:root {
  color-scheme: light;
  --bg: #f6f6f6;
  --surface: #ffffff;
  --surface-soft: #f2f2f2;
  --ink: #111111;
  --muted: #666666;
  --line: #dddddd;
  --line-strong: #b7b7b7;
  --blue: #111111;
  --blue-soft: #f2f2f2;
  --green: #111111;
  --green-soft: #f2f2f2;
  --amber: #111111;
  --amber-soft: #f7f7f7;
  --red: #111111;
  --red-soft: #f2f2f2;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.08);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background:
    linear-gradient(180deg, #ffffff 0%, #f7f7f7 48%, #eeeeee 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.brand-logo {
  position: fixed;
  top: 22px;
  left: 24px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 136px;
  min-height: 48px;
  color: var(--ink);
  text-decoration: none;
}

.brand-logo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 54px;
  object-fit: contain;
  filter: grayscale(1) contrast(1.08);
}

.shell {
  width: min(760px, calc(100vw - 32px));
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100svh;
  padding: 88px 0 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

h1,
p {
  margin: 0;
}

h1 {
  color: #111111;
  font-size: clamp(2rem, 3.2vw, 2.55rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: 0;
}

.add-button,
.icon-button,
.summary-line button,
.quick-days button,
.step-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.summary-line button:hover,
.icon-button:hover,
.quick-days button:hover,
.step-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.quick-entry {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.entry-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 10px;
}

#noteText {
  width: 100%;
  height: 52px;
  border: 1px solid transparent;
  outline: 0;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 1.04rem;
  font-weight: 650;
  padding: 0 15px;
}

#noteText::placeholder {
  color: #8a8a8a;
}

#noteText:focus,
.reminder-controls input:focus,
.view-filter select:focus,
.sort-field select:focus {
  border-color: rgba(0, 0, 0, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.add-button {
  width: 52px;
  height: 52px;
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.add-button:hover {
  background: #000000;
  transform: translateY(-1px);
}

.reminder-controls {
  display: grid;
  grid-template-columns: 1fr 0.95fr 0.72fr;
  gap: 10px;
  align-items: end;
  padding-top: 2px;
}

.quick-days {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.reminder-field,
.view-filter,
.day-filter,
.sort-field {
  display: grid;
  gap: 5px;
}

.reminder-field span,
.view-filter span,
.day-filter span,
.sort-field span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.reminder-controls input,
.quick-days button,
.view-filter select,
.sort-field select {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  outline: 0;
  padding: 0 10px;
}

.quick-days button {
  color: var(--blue);
  font-size: 0.92rem;
  font-weight: 800;
}

.summary-line {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.summary-line button {
  min-height: 32px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
}

.list-tools {
  display: grid;
  grid-template-columns: 1fr 1.05fr 1fr;
  gap: 10px;
  align-items: end;
  margin: 0 0 14px;
  padding: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.list-tools .view-filter span,
.list-tools .day-filter span,
.list-tools .sort-field span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.day-stepper {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.step-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--blue);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}

#filterDayLabel {
  display: inline-grid;
  place-items: center;
  min-width: 0;
  border-inline: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 750;
  white-space: nowrap;
}

.day-filter.active .day-stepper {
  border-color: rgba(0, 0, 0, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

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

.note {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 78px;
  padding: 15px 12px 15px 18px;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.note:hover {
  border-color: rgba(0, 0, 0, 0.18);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.07);
  transform: translateY(-1px);
}

.note::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: var(--blue);
}

.due-note {
  border-color: #111111;
  background: #f4f4f4;
}

.due-note::before {
  background: var(--amber);
}

.done-note {
  opacity: 0.58;
}

.done-note::before {
  background: var(--green);
}

.note-text {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 1.01rem;
  font-weight: 800;
  line-height: 1.35;
}

.note-time {
  display: inline-block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

.note-actions {
  display: flex;
  gap: 6px;
  opacity: 0.72;
  transition: opacity 150ms ease;
}

.note:hover .note-actions,
.note-actions:focus-within {
  opacity: 1;
}

.icon-button {
  width: 38px;
  height: 38px;
  background: transparent;
  color: var(--ink);
}

.done {
  background: var(--green-soft);
  border-color: #cfcfcf;
  color: var(--green);
}

.tomorrow {
  background: var(--blue-soft);
  border-color: #cfcfcf;
  color: var(--blue);
}

.delete {
  background: var(--red-soft);
  border-color: #cfcfcf;
  color: var(--red);
}

.empty {
  margin: 0;
  padding: 34px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  text-align: center;
  box-shadow: var(--shadow-soft);
}

@media (max-width: 640px) {
  .brand-logo {
    position: static;
    width: 118px;
    margin: 18px auto 0;
  }

  .shell {
    width: min(100vw - 20px, 640px);
    min-height: auto;
    padding: 20px 0 24px;
    justify-content: flex-start;
  }

  h1 {
    font-size: 1.78rem;
  }

  .topbar {
    align-items: flex-start;
  }

  .reminder-controls,
  .list-tools {
    grid-template-columns: 1fr;
  }

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

  .summary-line button {
    width: 100%;
  }

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

  .note-actions {
    justify-content: flex-end;
  }
}

@media (max-height: 820px) and (min-width: 641px) {
  .shell {
    justify-content: flex-start;
  }
}
