:root {
  color-scheme: light;
  --ink: #2c2b29;
  --muted: #6b6a67;
  --paper: #faf8f3;
  --panel: #f6f5f1;
  --panel-strong: #eeede8;
  --stroke: #d9d4c9;
  --accent: #45433f;
  --accent-strong: #2b2a28;
  --active: #ffe27f;
  --shadow: 0 4px 10px rgba(20, 18, 15, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a:hover {
  text-decoration: none;
}

.app-toolbar {
  margin-top: -3px;
  justify-content: flex-start;
  gap: 20px;
  align-items: center;
  display: flex;
  flex-direction: row;
}
.segmented {
  display: inline-flex;
  padding: 0;
  gap: 8px;
  border-radius: 999px;
  background: transparent;
  border: none;
}

.segmented-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  border-radius: 999px;
  color: #7a7a7a;
  background: #eeeeee;
}

.segmented-item.is-active {
  color: #ffffff;
  background: #f69671;
  box-shadow: none;
}

.segmented-item:not(.is-active) {
  color: #7a7a7a;
  background: #eeeeee;
}

.segmented-item:not(.is-active):hover {
  color: #666666;
  background: #e2e2e2;
}

.segmented-item-icon {
  display: inline-flex;
  align-items: center;
}

.segmented-item-icon img {
  width: 18px;
  height: 18px;
  display: block;
}


.app-main {
  padding-top: 16px;
  margin-left: -10px;
  margin-right: -10px;
}

.note-shell {
  display: grid;
  grid-template-columns: minmax(240px, 250px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  min-height: calc(100vh - 150px);
  background: var(--paper);
  border: 1px solid var(--stroke);
  border-radius: calc(var(--radius));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.note-list {
  background: transparent;
  border-right: 1px solid var(--stroke);
  overflow: hidden;
  max-height: calc(100vh - 148px);
  display: flex;
  flex-direction: column;
  margin-top: -1px;
  margin-bottom: -1px;
}

.note-list-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.note-year-tab {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 6px 12px;
  margin-top: -1px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  color: #7a7873;
  background: #f2f2ef;
  border-bottom: 1px solid var(--stroke);
  border-top: 1px solid var(--stroke);
}

.note-item {
  border-bottom: 1px solid var(--stroke);
  background: #fff;
}

.note-item a {
  display: grid;
  grid-template-columns: 22px 1fr;
  column-gap: 8px;
  row-gap: 6px;
  align-items: center;
  padding: 10px 12px;
}

.note-item-icon {
  grid-row: 1 / span 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.note-item-icon img {
  width: 24px;
  height: 24px;
  display: block;
}

.note-item.is-active {
  background: var(--active);
}

.note-item:not(.is-active):hover {
  background: var(--panel);
}

.note-title {
  grid-column: 2;
  font-weight: 400;
  font-size: 13px;
  color: var(--accent-strong);
  line-height: 1.2;
}

.note-meta {
  grid-column: 2;
  font-size: 13px;
  color: var(--muted);
  line-height: 1;
}

.note-excerpt {
  grid-column: 2;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.note-reader {
  background: transparent;
  padding: 24px 24px 24px 8px;
  min-height: calc(100vh - 150px);
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}

.note-date {
  display: block;
  text-align: left;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

.note-back {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.note-back::before {
  content: "←";
  font-size: 14px;
}

.note-heading {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 18px;
  margin: 0 0 16px;
  text-align: start;
  color: var(--accent-strong);
}

.note-body {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
}

.note-body h2,
.note-body h3,
.note-body h4 {
  font-family: Helvetica, Arial, sans-serif;
  color: var(--accent-strong);
}

.note-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 18px auto;
  border-radius: 2px;
}

.note-body a {
  color: #1f5b8f;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.note-empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.note-empty-reader {
  padding-top: 60px;
}

.app-footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 12px 0 24px;
}

@media (max-width: 960px) {
  .note-shell {
    grid-template-columns: 1fr;
    border-radius: var(--radius);
  }
  .note-shell--list .note-reader {
    display: none;
  }

  .note-shell--detail .note-list {
    display: none;
  }

  .note-shell--detail .note-back {
    display: inline-flex;
  }

  /* .note-list,
  .note-reader {
    min-height: auto;
    max-height: none;
  } */

  .note-list {
    border-right: none;
  }

  .note-reader {
    padding: 22px 20px;
  }

}

@media (max-width: 700px) {
  .app-main {
    margin-left: -26px;
    margin-right: -26px;
  }
  
  .note-shell {
    min-height: calc(100vh - 350px);
    grid-template-columns: 1fr;
    border-radius: 0px;
  }

  .note-list,
  .note-reader {
    min-height: auto;
    max-height: none;
  }

  .note-list {
    border-right: none;
  }

  .note-reader {
    padding: 22px 20px;
  }

  .app-toolbar {
    margin-top: 0px;
    justify-content: center;
    gap: 10px;
    display: flex;
    flex-direction: column;
  }

  .note-year-tab {
    font-size: 16px;
    padding: 6px 10px;
  }
}
