:root {
  font-family: ui-sans-serif, system-ui, sans-serif;
  color: #25382d;
  background: #f7f7ef;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
aside {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  padding: 40px 28px 32px;
  border-right: 1px solid #dce1d4;
  display: flex;
  flex-direction: column;
}
.brand {
  font-family: Georgia, serif;
  font-weight: bold;
  font-size: 40px;
  text-decoration: none;
  color: inherit;
  letter-spacing: -0.04em;
}
.brand span {
  color: #e17b49;
}
nav {
  display: grid;
  gap: 8px;
  margin-top: 32px;
}
button {
  font: inherit;
  cursor: pointer;
  border: 1px solid #d1d9ca;
  background: transparent;
  color: inherit;
  border-radius: 7px;
  padding: 11px 16px;
}
button:hover {
  background: #e9eddf;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
nav button {
  text-align: left;
  border: 0;
  padding: 13px 16px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
nav button.active {
  background: #dde7ce;
  color: #304c28;
  font-weight: 600;
}
.badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #36553d;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
}
.signout {
  margin-top: auto;
  align-self: flex-start;
  font-size: 14px;
  padding: 9px 14px;
}
main {
  padding: 48px 7% 96px;
  max-width: 1350px;
  width: 100%;
}
h1 {
  font:
    normal clamp(34px, 4vw, 52px)/1.1 Georgia,
    serif;
  letter-spacing: -1.4px;
  margin: 30px 0;
}
h2 {
  font:
    normal 25px Georgia,
    serif;
}
p {
  line-height: 1.6;
}
small {
  display: block;
  color: #74806f;
  font-size: 12px;
  max-width: 560px;
  margin-top: 16px;
}
form {
  display: flex;
  gap: 10px;
  margin: 16px 0;
}
input,
select {
  font: inherit;
  border: 1px solid #d1d9ca;
  border-radius: 7px;
  padding: 12px;
  background: #fffef8;
  min-width: 0;
  color: inherit;
}
input {
  flex: 1;
}
label {
  display: grid;
  gap: 7px;
  font-size: 13px;
}
#connect-form {
  align-items: end;
  max-width: 570px;
}
#connect-form label {
  flex: 1;
}
.primary {
  background: #36553d;
  color: #fff;
  border-color: #36553d;
}
.primary:hover {
  background: #284630;
}
.heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.heading span {
  font-size: 12px;
  color: #758471;
  white-space: nowrap;
}
#capture {
  margin: 0;
}
#search {
  margin: 20px 0 0;
}
#capture {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}
#capture-text {
  grid-column: 1;
}
#save-capture {
  grid-column: 3;
}
#capture-attachment {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid #d9dfd1;
  border-radius: 7px;
  background: #fffef8;
  min-width: 0;
}
#capture-preview {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 4px;
}
#capture-filename {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
#remove-image {
  font-size: 22px;
  min-width: 44px;
  min-height: 44px;
  padding: 5px;
}
.image-pending {
  color: #765d50;
  font-size: 13px;
}
#search input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid #d1d9ca;
  border-radius: 0;
}
#results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}
.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  padding: 22px 24px;
  border: 1px solid #d9dfd1;
  border-radius: 10px;
  background: #fffef8;
}
.card:hover {
  border-color: #809774;
  background: #fff;
}
.meta {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #7b885e;
}
.card .title,
.card .note {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.card .title {
  font:
    normal 22px/1.25 Georgia,
    serif;
  -webkit-line-clamp: 3;
}
.card .note {
  font-size: 13px;
  line-height: 1.45;
  color: #6f7a69;
  -webkit-line-clamp: 2;
}
.empty {
  grid-column: 1/-1;
  padding: 50px 0;
  border-top: 1px solid #d9dfd1;
  color: #718069;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 10;
  width: max-content;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 11px 18px;
  border-radius: 8px;
  background: #25382d;
  color: #fffef8;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 6px 24px #18221c33;
}
.toast.error,
.detail-status.error {
  background: #8b422e;
}
.toast:empty,
.detail-status:empty {
  display: none;
}
dialog {
  border: 1px solid #d1d9ca;
  border-radius: 16px;
  padding: 0;
  max-width: 680px;
  width: calc(100% - 32px);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  overscroll-behavior: contain;
  color: inherit;
  background: #fffef8;
}
dialog::backdrop {
  background: #18221c66;
}
.detail-frame {
  padding: 0 32px 32px;
}
.close {
  position: sticky;
  top: 12px;
  z-index: 1;
  float: right;
  width: 40px;
  height: 40px;
  margin: 12px -16px 0 12px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fffef8;
  font-size: 24px;
  line-height: 1;
}
#detail-body {
  padding-top: 28px;
}
#detail-body > .meta {
  margin: 0 0 10px;
}
#detail-body h2 {
  font:
    normal 28px/1.2 Georgia,
    serif;
  margin: 0 0 14px;
  overflow-wrap: anywhere;
}
.processing-failed {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  font-size: 13px;
  color: #765d50;
}
.processing-failed p {
  margin: 0;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
}
.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 14px;
  background: #e9eddf;
  color: #476943;
  font-size: 13px;
}
dialog .chip button {
  border: 0;
  border-radius: 14px;
  padding: 5px 4px 5px 11px;
  font-size: 13px;
}
dialog .chip .chip-remove {
  padding: 5px 10px 5px 5px;
  color: #7b885e;
}
.chip button:hover {
  background: #dde7ce;
}
.tag-form {
  margin: 0;
}
.tag-form input {
  flex: 0 0 9em;
  min-width: 0;
  padding: 5px 10px;
  border: 1px dashed #c9d2c0;
  border-radius: 14px;
  background: transparent;
  font-size: 13px;
}
.detail-note {
  margin: 0 0 12px;
  font-size: 13px;
  color: #765d50;
}
.summary {
  color: #5f6d5c;
  overflow-wrap: anywhere;
}
.detail-text {
  margin: 0 0 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.source {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 14px;
}
dialog button {
  font-size: 14px;
  padding: 9px 14px;
}
.segmented {
  display: flex;
  gap: 3px;
  width: fit-content;
  max-width: 100%;
  margin: 20px 0 0;
  padding: 3px;
  border: 1px solid #d1d9ca;
  border-radius: 9px;
  background: #f7f7ef;
}
dialog .segmented button {
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
}
.segmented [aria-pressed="true"] {
  background: #dde7ce;
  color: #304c28;
  font-weight: 600;
}
.detail-section,
.detail-footer {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid #e3e7db;
}
.detail-section h3 {
  font:
    normal 19px Georgia,
    serif;
  margin: 0 0 4px;
}
.fact,
.plan {
  padding: 14px 0;
  border-bottom: 1px solid #eef0e7;
}
.fact:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.fact p {
  margin: 0 0 6px;
}
.fact-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}
.tag {
  padding: 2px 8px;
  border-radius: 10px;
  background: #e9eddf;
  color: #476943;
  font-size: 11px;
  font-weight: 500;
}
.tag.warn {
  background: #f6e6d6;
  color: #8b4d22;
}
.evidence {
  font-size: 14px;
  color: #5c6c59;
  overflow-wrap: anywhere;
}
.assumptions {
  font-size: 13px;
  color: #8b4d22;
}
.inline-form {
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}
.inline-form input,
.inline-form select {
  flex: 1 1 200px;
  min-height: 42px;
  padding: 9px 12px;
  font-size: 14px;
}
.inline-form select {
  flex: 0 1 150px;
}
.plan {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.plan-when {
  margin: 0;
  font-size: 15px;
}
.plan-actions,
.detail-actions,
.confirm-delete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.plan .inline-form {
  flex-basis: 100%;
  margin: 0;
}
.reminder-form {
  margin-top: 16px;
}
.detail-actions .danger {
  margin-left: auto;
}
.confirm-delete p {
  margin: 0 auto 0 0;
  font-size: 14px;
  color: #8b422e;
}
.detail-status {
  position: sticky;
  bottom: 0;
  margin: 20px -32px -32px;
  padding: 12px 32px;
  background: #25382d;
  color: #fffef8;
  font-size: 14px;
  line-height: 1.4;
}
.preferences {
  grid-column: 1/-1;
  width: 100%;
  max-width: 820px;
}
.prefs {
  display: grid;
  gap: 20px;
  margin: 0;
}
.preference-section {
  padding: 26px 28px;
  border: 1px solid #d9dfd1;
  border-radius: 12px;
  background: #fffef8;
}
.preference-section h2 {
  margin: 0 0 22px;
  font-size: 24px;
}
.preference-zone {
  display: flex;
  gap: 20px;
  align-items: end;
}
.preference-zone .preference-field {
  flex: 1;
}
.preference-zone button {
  font-size: 13px;
  min-height: 46px;
}
.preference-field {
  gap: 10px;
  min-width: 0;
  color: #5c6c59;
}
.preference-field input,
.preference-field select {
  width: 100%;
  min-height: 46px;
  background: #f7f7ef;
  color: #25382d;
  font-size: 14px;
}
.preference-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}
.digest-fields {
  grid-template-columns: 1.3fr 1fr 1fr;
}
.preference-fields.inactive,
.preference-quiet.inactive {
  opacity: 0.55;
}
.preference-fields input:disabled,
.preference-fields select:disabled {
  cursor: default;
}
.preference-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: 44px;
  font-size: 15px;
  cursor: pointer;
}
.preference-toggle-heading {
  font:
    normal 24px Georgia,
    serif;
}
.toggle-control {
  position: relative;
  flex: 0 0 44px;
  height: 26px;
}
.toggle-control input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.preference-quiet.inactive .preference-toggle,
.toggle-control input:disabled {
  cursor: default;
}
.toggle-track {
  display: block;
  height: 100%;
  border: 1px solid #ccd4c4;
  border-radius: 20px;
  background: #e4e8de;
  pointer-events: none;
}
.toggle-track::after {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  margin: 3px;
  border-radius: 50%;
  background: #fffef8;
  box-shadow: 0 1px 3px #25382d26;
}
.toggle-control input:checked + .toggle-track {
  background: #36553d;
  border-color: #36553d;
}
.toggle-control input:checked + .toggle-track::after {
  transform: translateX(18px);
}
.toggle-control input:focus-visible + .toggle-track {
  outline: 3px solid #d28c42;
  outline-offset: 3px;
}
.preference-quiet {
  border-top: 1px solid #e3e7db;
  margin-top: 18px;
  padding-top: 18px;
}
.preference-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.preference-feedback {
  margin: 0;
  color: #576f48;
  font-size: 13px;
}
.preferences button:disabled {
  cursor: default;
}
.preference-account {
  margin-top: 38px;
  background: transparent;
}
.preference-export button {
  font-size: 14px;
}
.preference-deletion {
  border-top: 1px solid #d9dfd1;
  margin-top: 24px;
  padding-top: 10px;
}
.preference-deletion summary {
  width: fit-content;
  min-height: 44px;
  padding: 12px 0;
  color: #965740;
  font-size: 14px;
  cursor: pointer;
}
.deletion-form {
  display: grid;
  justify-items: start;
  gap: 16px;
  margin: 8px 0 0;
}
.deletion-form p {
  font-size: 13px;
  margin: 0;
  color: #765d50;
}
.deletion-form label {
  width: 100%;
  max-width: 360px;
}
.danger {
  color: #8b422e;
  border-color: #cba997;
}
.danger:hover {
  background: #f1e4dc;
}
.asset {
  display: block;
  max-width: 100%;
  max-height: 350px;
  margin: 8px 0;
  object-fit: contain;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
[hidden] {
  display: none !important;
}
a {
  color: #476943;
}
:focus-visible {
  outline: 3px solid #d28c42;
  outline-offset: 3px;
}
@media (max-width: 760px) {
  body {
    display: block;
  }
  aside {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 16px 20px 0;
    border-right: 0;
    border-bottom: 1px solid #dce1d4;
  }
  .brand {
    font-size: 32px;
  }
  .signout {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
  }
  nav {
    grid-column: 1/-1;
    display: flex;
    overflow-x: auto;
    margin: 12px -20px 0;
    padding: 0 14px 10px;
    gap: 2px;
    scrollbar-width: none;
  }
  nav button {
    white-space: nowrap;
    padding: 9px 10px;
    gap: 6px;
  }
  main {
    padding: 8px 20px 96px;
  }
  h1 {
    margin: 22px 0;
  }
  #results {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 20px;
  }
  .card {
    padding: 18px 20px;
  }
  .card .title {
    font-size: 20px;
  }
  form {
    flex-wrap: wrap;
  }
  #capture {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  #save-capture {
    grid-column: 1/-1;
    grid-row: 3;
    width: 100%;
  }
  dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }
  .detail-frame {
    padding: 0 20px 22px;
  }
  .close {
    margin-right: -10px;
  }
  #detail-body h2 {
    font-size: 24px;
  }
  .reminder-form select {
    flex-basis: 100%;
  }
  .segmented {
    width: 100%;
  }
  dialog .segmented button {
    flex: 1;
    padding: 8px 4px;
    font-size: 13px;
  }
  .detail-status {
    margin: 20px -20px -22px;
    padding: 12px 20px;
  }
  .preference-section {
    padding: 22px 20px;
  }
  .preference-zone {
    display: grid;
    gap: 12px;
  }
  .preference-zone button {
    justify-self: start;
  }
  .digest-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .digest-fields .preference-field:first-child {
    grid-column: 1/-1;
  }
  .preference-footer {
    flex-wrap: wrap;
  }
  .preference-footer .primary {
    margin-left: auto;
  }
  .preference-account {
    margin-top: 28px;
  }
}
