:root {
  --bg: #11110f;
  --paper: #ece7dc;
  --page: #ded7ca;
  --panel: #f3eee5;
  --ink: #191814;
  --muted: #756f65;
  --line: #cbc1b1;
  --frame: #91887a;
  --danger: #7e3028;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  min-height: 42px;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.app {
  max-width: 900px;
  margin: auto;
  min-height: 100dvh;
  background: var(--page);
}
.top {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  color: var(--paper);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.brand {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
#sync-status {
  font-size: 10px;
  color: #aaa69d;
  display: block;
  margin-top: 5px;
}
.top-actions {
  display: flex;
  gap: 5px;
}
.top button {
  background: transparent;
  color: var(--paper);
  border: 1px solid #4a4841;
  border-radius: 20px;
  padding: 7px 10px;
  font-size: 12px;
  min-height: 36px;
}
main {
  padding: 28px 22px 50px;
}
.kicker,
label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
h1 {
  font-size: 36px;
  font-weight: normal;
  margin: 8px 0;
}
h2 {
  font-size: 19px;
  font-weight: normal;
  margin: 0;
}
h3 {
  font-weight: normal;
  font-size: 18px;
  margin: 22px 0 8px;
}
.heading,
.list-head,
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.button {
  border: 1px solid var(--frame);
  background: linear-gradient(#f3eee5, #e3dccf);
  box-shadow: 0 2px 0 #aea595;
  padding: 9px 12px;
  border-radius: 2px;
  font-size: 12px;
}
.button.dark {
  background: linear-gradient(#302f29, #11110f);
  border-color: var(--bg);
  color: var(--paper);
  box-shadow: 0 2px 0 #615c53;
}
.button.danger {
  color: var(--danger);
}
.date-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 22px;
}
.date-nav button {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 6px 10px;
}
.date-nav #today {
  border: 2px solid var(--ink);
  font-size: 12px;
}
.date-label {
  flex: 1;
  min-width: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
}
.date-label input {
  padding: 4px 0;
  margin-top: 3px;
  border: 0;
  background: transparent;
  max-width: 165px;
  font-size: 12px;
  color: var(--muted);
}
.summary {
  display: flex;
  gap: 18px;
  border-top: 1px solid var(--frame);
  border-bottom: 1px solid var(--frame);
  padding: 14px 0;
  color: var(--muted);
  font-size: 12px;
}
.summary b {
  color: var(--ink);
  font-size: 21px;
  font-weight: normal;
  margin-right: 3px;
}
.list-head {
  margin: 25px 0 12px;
}
.list-head label {
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.06em;
}
.list-head select {
  width: auto;
  font-size: 12px;
  padding: 7px;
}
.action {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 14px 12px;
  margin: 10px 0;
  box-shadow: 0 2px 0 #c4bbac;
}
.action.overdue {
  border-left: 4px solid var(--danger);
  background: #eee0d7;
}
.action.overdue .meta,
.action.overdue .when {
  color: var(--danger);
}
.action.important:not(.overdue) {
  border-left: 4px solid var(--ink);
}
.action-title {
  font-size: 19px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}
.when {
  text-align: right;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}
.edit {
  display: block;
  margin-top: 5px;
  border: 0;
  background: transparent;
  text-decoration: underline;
  font-size: 11px;
  color: var(--muted);
  min-height: 30px;
  margin-left: auto;
}
.complete {
  border: 1px solid var(--frame);
  background: var(--paper);
  width: 38px;
  height: 38px;
  min-height: 38px;
  font-size: 20px;
}
.finished .action-title {
  text-decoration: line-through;
  color: var(--muted);
}
.finished {
  background: var(--paper);
}
details {
  margin-top: 26px;
}
summary {
  cursor: pointer;
  font-size: 17px;
  padding: 10px 0;
  border-top: 1px solid var(--frame);
}
.empty {
  border: 1px solid var(--line);
  padding: 28px 18px;
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  background: var(--paper);
}
.footnote,
.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.footnote {
  margin-top: 26px;
}
#message {
  font-size: 12px;
  color: var(--danger);
}
dialog {
  border: 2px solid var(--frame);
  background: var(--paper);
  color: var(--ink);
  padding: 22px;
  width: min(440px, calc(100% - 24px));
  max-height: 90dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #0009;
}
form {
  display: grid;
  gap: 14px;
}
.dialog-head {
  margin-bottom: 10px;
}
.dialog-head button {
  border: 0;
  background: transparent;
  font-size: 26px;
  width: 36px;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #f5f0e7;
  color: var(--ink);
  padding: 11px 9px;
  border-radius: 2px;
  margin-top: 6px;
  min-width: 0;
  font-size: 16px;
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  color: var(--ink);
}
.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--ink);
  margin: 0;
}
.error {
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
}
.hint {
  margin: 0;
}
.import-label {
  display: block;
  margin-top: 16px;
}
#settings .button {
  margin: 6px 3px 6px 0;
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 500px) {
  main {
    padding: 23px 14px 40px;
  }
  .top {
    padding: 13px 14px;
  }
  .brand {
    font-size: 10px;
  }
  .top button {
    font-size: 10px;
    padding: 6px 8px;
  }
  .action {
    gap: 9px;
    padding: 12px 9px;
  }
  .action-title {
    font-size: 17px;
  }
  .summary {
    gap: 12px;
    font-size: 11px;
  }
  .when {
    font-size: 17px;
  }
  h1 {
    font-size: 32px;
  }
}

/* Keep the narrow dated rail consistent with the other HW Apps journals. */
.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  align-items: start;
}
main {
  min-width: 0;
}
.tabs {
  border-left: 1px solid var(--line);
  position: sticky;
  top: 66px;
  height: calc(100dvh - 66px);
  overflow-y: auto;
  background: #e3dccf;
}
.calendar-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #e3dccf;
  padding: 5px 3px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.calendar-head #today {
  width: 100%;
  min-height: 32px;
  border: 2px solid var(--ink);
  background: var(--paper);
  font-size: 10px;
  padding: 3px 0;
}
#calendar-month {
  color: var(--muted);
  font-size: 9px;
  margin: 7px 0 2px;
}
.month-controls {
  display: flex;
}
.month-controls button {
  flex: 1;
  min-width: 0;
  min-height: 30px;
  border: 0;
  background: transparent;
  font-size: 20px;
  padding: 0;
}
.tab {
  display: block;
  width: 100%;
  min-height: 54px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #e3dccf;
  color: var(--muted);
  font-size: 10px;
  padding: 7px 2px;
}
.tab b {
  display: block;
  font-size: 17px;
  font-weight: normal;
  margin-top: 2px;
}
.tab.recorded {
  background: #d2cabd;
  color: var(--ink);
}
.tab.today:not(.active) {
  box-shadow: inset 0 0 0 2px var(--ink);
  color: var(--ink);
}
.tab.active {
  background: var(--bg);
  color: var(--paper);
}
@media (max-width: 500px) {
  .shell {
    grid-template-columns: minmax(0, 1fr) 52px;
  }
  .heading {
    gap: 6px;
  }
  .heading .button {
    padding: 9px 8px;
  }
}
