/* msslmemo — text-first, notebook-quiet */
@font-face {
  font-family: 'OpenDyslexic';
  src: url('https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/woff/OpenDyslexic-Regular.woff') format('woff'),
       url('https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/otf/OpenDyslexic-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'OpenDyslexic';
  src: url('https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/woff/OpenDyslexic-Bold.woff') format('woff'),
       url('https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/otf/OpenDyslexic-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1c1c1c;
  --paper: #fbfaf7;
  --line: #e3e0d8;
  --dim: #8a867c;
  --accent: #b3492c;
  --done: #9a968c;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--mono);
}
body.dysfont, body.dysfont input, body.dysfont button, body.dysfont code {
  font-family: 'OpenDyslexic', var(--mono);
}
body.dysfont { font-size: 15px; line-height: 1.7; }
main { max-width: 720px; margin: 0 auto; padding: 1rem 1.25rem 4rem; }
a { color: var(--ink); text-decoration-color: var(--line); }
a:hover { text-decoration-color: var(--accent); }
.dim { color: var(--dim); }
code { background: #f1efe8; padding: 0 .3em; border-radius: 3px; }

/* header / footer */
.top {
  display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: baseline;
  max-width: 720px; margin: 0 auto; padding: 1rem 1.25rem 0;
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; text-decoration: none; letter-spacing: .02em; }
.brand span { color: var(--accent); }
.top nav { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .9rem; }
.foot { max-width: 720px; margin: 0 auto; padding: 1rem 1.25rem; font-size: .78rem; }

/* page head */
.page-head { display: flex; align-items: baseline; gap: 1rem; margin: 1.25rem 0 .75rem; }
.page-head h1 { font-size: 1.15rem; margin: 0; flex: 1; text-align: center; }
.nav-arrow { text-decoration: none; font-size: 1.1rem; padding: 0 .4rem; }

h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 1.5rem 0 .5rem; }

/* quick add */
.quick-add { display: flex; gap: .5rem; margin: .75rem 0 1rem; }
.quick-add input[type=text] {
  flex: 1; font: inherit; padding: .5rem .65rem;
  border: 1px solid var(--line); border-radius: 4px; background: #fff;
}
.quick-add input[type=date] { font: inherit; border: 1px solid var(--line); border-radius: 4px; padding: .4rem; }
.quick-add button, .auth-box button {
  font: inherit; padding: .5rem .9rem; border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper); border-radius: 4px; cursor: pointer;
}

/* entry list */
.entries { list-style: none; margin: 0; padding: 0; }
.entry {
  display: flex; align-items: baseline; gap: .5rem;
  padding: .35rem .25rem; border-bottom: 1px dotted var(--line);
}
.entry .bullet { width: 1.1em; text-align: center; flex-shrink: 0; }
.entry .sig { color: var(--accent); font-weight: 700; min-width: .5em; flex-shrink: 0; }
.entry .content { flex: 1; overflow-wrap: anywhere; }
.entry.done .content, .entry.cancelled .content, .entry.migrated .content, .entry.scheduled .content { color: var(--done); }
.entry.cancelled .content { text-decoration: line-through; }
.entry.event .bullet { color: var(--accent); }
.entry .actions { display: flex; gap: .25rem; align-items: center; opacity: .25; }
.entry:hover .actions { opacity: 1; }
.entry .actions form { display: inline; margin: 0; }
.entry .actions button {
  font: inherit; font-size: .85rem; background: none; border: 1px solid var(--line);
  border-radius: 3px; cursor: pointer; padding: 0 .4rem; color: var(--ink);
}
.entry .actions button:hover { border-color: var(--accent); color: var(--accent); }
.entry .actions button.ok { border-color: #7a9a6d; color: #55763f; }
.entry .actions button.ok:hover { background: #55763f; border-color: #55763f; color: #fff; }
.entry .actions button.danger { border: none; color: var(--dim); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.entry .actions button.danger:hover { color: #fff; background: #a03020; }
.migrate summary { cursor: pointer; border: 1px solid var(--line); border-radius: 3px; padding: 0 .4rem; font-size: .85rem; list-style: none; }
.migrate[open] { position: relative; }
.migrate[open] form {
  position: absolute; right: 0; top: 1.6rem; z-index: 10;
  background: #fff; border: 1px solid var(--line); border-radius: 4px;
  padding: .5rem; display: flex; gap: .4rem;
}
.empty { padding: .75rem .25rem; }

/* carryover section */
.carry { background: #f5f2ea; border: 1px solid var(--line); border-radius: 6px; padding: .25rem .75rem .5rem; margin-bottom: 1rem; }
.carry h2 { margin-top: .6rem; }

/* monthly */
.monthly { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 640px) { .monthly { grid-template-columns: 1fr; } }
.cal-days { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.cal-days li { display: flex; gap: .6rem; padding: .12rem 0; border-bottom: 1px dotted var(--line); }
.cal-date { text-decoration: none; white-space: nowrap; }
.cal-date.weekend { color: var(--accent); }
.cal-events { display: flex; flex-direction: column; }
.cal-event { overflow-wrap: anywhere; }

/* index */
.index-list { list-style: none; padding: 0; }
.index-list li { padding: .3rem 0; border-bottom: 1px dotted var(--line); display: flex; justify-content: space-between; gap: 1rem; }

/* auth */
.auth-box { max-width: 360px; margin: 3rem auto; }
.auth-box label { display: block; margin: .75rem 0; }
.auth-box input { display: block; width: 100%; font: inherit; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 4px; margin-top: .25rem; }
.auth-box .error { color: var(--accent); }
.auth-box .notice { background: #eaf3de; border: 1px solid #c0dd97; border-radius: 4px; padding: .5rem .75rem; color: #27500a; }

/* future */
.future-month h2 a { text-decoration: none; color: inherit; }

/* guide */
.guide { margin-bottom: 2.25rem; }
.guide h3 { font-size: .95rem; margin: 0 0 .3rem; }
.guide-demo {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: .4rem 1.25rem; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .9rem 1rem; margin: .75rem 0;
}
.guide-typed, .guide-becomes { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.guide-demo > code { justify-self: start; }
.guide-render { border: none; }
.guide-render .entry { border-bottom: none; padding: 0; }
.guide-states { display: grid; gap: .3rem; margin: .75rem 0; }
.guide-state .bullet { display: inline-block; width: 1.3em; text-align: center; color: var(--accent); }
.guide-svg { width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; margin: .75rem 0; }
.guide-views { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .guide-views { grid-template-columns: 1fr; } }
.guide-view { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .75rem 1rem; }
.guide-view p { margin: .25rem 0 0; font-size: .9rem; }
.guide-rhythm li { margin: .4rem 0; }
.guide-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .guide-plans { grid-template-columns: 1fr; } }
.guide-plan { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .75rem 1rem; }
.guide-plan-pro { border: 2px solid var(--accent); }
.guide-plan ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.guide-plan li { margin: .25rem 0; font-size: .9rem; }

/* search */
.quick-add input[type=search] {
  flex: 1; font: inherit; padding: .5rem .65rem;
  border: 1px solid var(--line); border-radius: 4px; background: #fff;
}
.search-loc { font-size: .8rem; white-space: nowrap; }
.search-loc a { color: var(--dim); }

/* brain dump */
.dump-composer { display: flex; flex-direction: column; gap: .5rem; margin: .75rem 0 1rem; }
.dump-composer textarea {
  font: inherit; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 4px;
  background: #fff; resize: vertical; line-height: 1.6;
}
.dump-composer button {
  align-self: flex-end; font: inherit; padding: .5rem .9rem; border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper); border-radius: 4px; cursor: pointer;
}
.dump-sort { font-size: .85rem; margin: 1.25rem 0 .75rem; }
.dump-sort a.sort-active { color: var(--accent); text-decoration: none; font-weight: 700; }
.dump-cards { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 640px) { .dump-cards { grid-template-columns: 1fr; } }
.dump-card {
  display: flex; flex-direction: column; gap: .6rem; justify-content: space-between;
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  padding: .75rem .9rem; text-decoration: none;
}
.dump-card:hover { border-color: var(--accent); }
.dump-preview { font-size: .9rem; overflow-wrap: anywhere; }
.dump-meta { font-size: .75rem; }
.dump-meta-line { margin-top: -.25rem; font-size: .85rem; }
.dump-delete { margin-top: 1.5rem; }
.dump-delete button.danger {
  font: inherit; font-size: .8rem; border: 1px solid var(--line); background: none;
  border-radius: 3px; cursor: pointer; padding: .2rem .6rem; color: var(--dim);
}
.dump-delete button.danger:hover { background: #a03020; border-color: #a03020; color: #fff; }

/* admin */
.admin-table { border-collapse: collapse; width: 100%; font-size: .85rem; }
.admin-table th { text-align: left; color: var(--dim); font-weight: 400; border-bottom: 1px solid var(--line); padding: .3rem .5rem .3rem 0; }
.admin-table td { border-bottom: 1px dotted var(--line); padding: .35rem .5rem .35rem 0; }
.admin-actions { display: flex; gap: .35rem; }
.admin-actions form { margin: 0; }
.admin-actions button, section > form button {
  font: inherit; font-size: .8rem; background: none; border: 1px solid var(--line);
  border-radius: 3px; cursor: pointer; padding: .1rem .5rem; color: var(--ink);
}
.admin-actions button:hover, section > form button:hover { border-color: var(--accent); color: var(--accent); }
