:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #232d27;
  background: #f5f5ee;
  color-scheme: light;
  --ink: #26342a;
  --green: #2f5137;
  --line: #dfdfd3;
  --muted: #58645b;
  --paper: #fffef9;
  --accent: #f2e6a5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button, input, textarea, select { border: 1px solid var(--line); border-radius: 8px; }
button { background: var(--paper); color: var(--ink); padding: .62rem .89rem; font-weight: 650; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #365d3e; outline-offset: 2px; }
button:hover:not(:disabled) { border-color: #8c9a8e; }
input, textarea, select { width: 100%; padding: .65rem .7rem; background: var(--paper); color: var(--ink); }
textarea { min-height: 6.5rem; resize: vertical; }
label { display: grid; gap: .38rem; color: var(--muted); font-size: .9rem; font-weight: 600; }
h1 { font-weight: 680; font-size: clamp(1.8rem, 4vw, 3.15rem); letter-spacing: -.066em; margin: .24rem 0 0; }
h2 { font-size: 1.44rem; letter-spacing: -.035em; margin: 0; }
p { line-height: 1.44; }
.layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100dvh; }
aside { background: #e9eadf; border-right: 1px solid var(--line); padding: 1.5rem 1.1rem; display: flex; flex-direction: column; }
.wordmark { display: flex; align-items: center; gap: .64rem; color: #2b412d; font-size: 1.17rem; font-weight: 750; letter-spacing: -.04em; }
.mark { display: inline-grid; place-items: center; width: 2.15rem; height: 2.15rem; border-radius: .65rem; background: var(--green); color: #fff7c0; letter-spacing: -.18em; padding-right: .16em; }
nav { display: grid; gap: .2rem; margin: 2rem 0; }
.nav-group, .eyebrow { color: var(--muted); font-size: .72rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.nav-group { margin: 1rem .55rem .25rem; }
nav button { text-align: left; border: 1px solid transparent; background: transparent; padding: .55rem .63rem; font-size: .92rem; }
nav button[aria-current="page"] { color: #263d2c; background: var(--paper); border-color: var(--line); }
.logout { margin-top: auto; align-self: flex-start; background: transparent; }
.workspace { padding: clamp(1.2rem, 4vw, 3.8rem); max-width: 102rem; width: 100%; }
header { display: flex; gap: 1rem; align-items: end; justify-content: space-between; padding-bottom: 1.65rem; border-bottom: 1px solid var(--line); }
.actions, .controls, .row-actions, .dialog-actions { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.controls:not(:empty) { margin-top: 1rem; }
.controls form { display: flex; gap: .45rem; }
.controls input { width: min(48vw, 20rem); }
.primary { color: white; background: var(--green); border-color: var(--green); }
.message:empty, .error:empty, #edit-note:empty { display: none; }
.message, .muted { color: var(--muted); }
.error { color: #9b342e; }
.card, .table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.card { padding: 1.2rem; margin-top: 1rem; }
.table-wrap { overflow-x: auto; margin-top: 1rem; }
table { border-collapse: collapse; min-width: 39rem; width: 100%; text-align: left; font-size: .9rem; }
thead { background: #eeeee5; color: #58645b; font-size: .8rem; }
td, th { padding: .82rem clamp(.48rem, .85vw, .92rem); vertical-align: top; }
td { border-top: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: break-word; }
.journal-table td:first-child { white-space: nowrap; }
.row-actions { flex-wrap: wrap; }
.row-actions button { font-size: .81rem; padding: .42rem .55rem; }
td .row-actions button { white-space: nowrap; }
.login { display: grid; place-items: center; min-height: 100dvh; padding: 1rem; background: linear-gradient(155deg, #eaede0 0%, #f6f5ed 65%); }
.login-card, dialog { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 2rem; width: min(100%, 30rem); }
.login-card h1 { margin: 1.7rem 0; font-size: 2rem; }
.login-card button { width: 100%; margin-top: 1.1rem; }
dialog { max-height: 92dvh; width: min(calc(100vw - 2rem), 37rem); }
dialog::backdrop { background: #19291dbb; }
.dialog-head { display:flex; justify-content: space-between; align-items:center; gap: 1rem; }
.dialog-head button { padding: .15rem .6rem; font-size: 1.4rem; }
.fields { display: grid; gap: .85rem; margin-top: 1.25rem; }
.dialog-actions { justify-content: flex-end; margin-top: 1.25rem; }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  aside { border: 0; border-bottom: 1px solid var(--line); padding: 1rem; }
  nav { display: flex; overflow-x: auto; margin: .75rem 0; }
  .nav-group { display: none; }
  nav button { white-space: nowrap; }
  header { align-items: start; flex-wrap: wrap; }
}
