:root {
  color-scheme: light;
  font-family: 'Avenir Next', Avenir, system-ui, sans-serif;
  color: #18322d;
  background: #f5f4ed;
  --ink: #18322d;
  --muted: #536661;
  --line: #dce2d8;
  --green: #185645;
  --dark: #173b34;
  --mint: #e4efe5;
  --paper: #fffefa;
  --sand: #f5f4ed;
  --warning: #8b4225;
  --display: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
}
*,*::before,*::after { box-sizing: border-box; }
body { margin: 0; }
button,input,textarea,select { font: inherit; }
button,a,input,select,textarea,summary { touch-action: manipulation; }
button,a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--green); text-underline-offset: .18em; }
:focus-visible { outline: 3px solid #8a5a21; outline-offset: 3px; }
h1,h2,h3,p { margin: 0; }
h1,h2 { font-family: var(--display); font-weight: 500; letter-spacing: -.035em; }
h1 { font-size: clamp(2.4rem, 5vw, 3.5rem); line-height: 1.06; }
h2 { font-size: 1.8rem; line-height: 1.15; }
h3 { font-size: 1rem; }
p { line-height: 1.6; }
small,.small { font-size: .875rem; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 1rem; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.spread { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.skip { position: fixed; left: .5rem; top: -4rem; background: var(--paper); padding: .6rem; z-index: 5; }
.skip:focus { top: .5rem; }
.loading { min-height: 100dvh; display: grid; place-content: center; color: var(--muted); }
.brand { display: inline-flex; align-items: center; gap: .62rem; font-family: var(--display); font-size: 1.9rem; font-weight: 600; letter-spacing: -.06em; }
.emblem { display: inline-grid; width: 2.1rem; aspect-ratio: 1; place-items: center; color: var(--dark); background: #e4deae; border-radius: 50%; font-size: 1rem; letter-spacing: 0; }
.kicker { color: var(--green); font-size: .78rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 42px; padding: .54rem .88rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--paper); color: var(--ink); font-size: .9rem; font-weight: 650; text-decoration: none; }
.btn:hover { background: var(--mint); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.primary { background: var(--green); border-color: var(--green); color: white; }
.btn.primary:hover { background: #113f33; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: #8d2c1f; }
.btn.compact { min-height: 38px; padding: .4rem .66rem; }
label { font-size: .91rem; font-weight: 650; }
.field { display: grid; gap: .35rem; min-width: 0; }
input:not([type=checkbox]),textarea,select {
  width: 100%; padding: .65rem .75rem; background: white; color: var(--ink);
  border: 1px solid #aebdb4; border-radius: .6rem; min-height: 42px;
}
input[type=checkbox] { height: 1.1rem; width: 1.1rem; accent-color: var(--green); flex: 0 0 auto; }
textarea { min-height: 5rem; resize: vertical; }
.check { display: flex; align-items: flex-start; gap: .6rem; padding-block: .4rem; }
.check input { margin: .05rem 0 0; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: .95rem; padding: 1.15rem; min-width: 0; }
.notice { background: var(--mint); border: 1px solid #ccddce; border-radius: .75rem; padding: .8rem .95rem; }
.notice.warn { color: var(--warning); background: #fbf0e8; border-color: #eed8c7; }
.panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .85rem; }
.auth-shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.auth-brand { color: #fffdf2; background: var(--dark); padding: clamp(1.45rem, 5vw, 4.6rem); display: flex; flex-direction: column; gap: 4rem; justify-content: space-between; position: relative; overflow: hidden; }
.auth-brand::before,.auth-brand::after { content: ''; position: absolute; border: 1px solid #ffffff21; border-radius: 50%; width: 390px; aspect-ratio: 1; right: -180px; bottom: -225px; pointer-events: none; }
.auth-brand::after { width: 520px; right: -230px; bottom: -285px; }
.auth-brand h1 { max-width: 11ch; font-size: clamp(2.65rem, 6vw, 5.4rem); }
.auth-brand p { max-width: 32ch; color: #deeadc; }
.auth-brand .kicker { color: #e4deae; }
.auth-main { align-self: center; width: min(100%, 35rem); padding: clamp(1.4rem, 5vw, 4rem); margin-inline: auto; }
.auth-main code { display: block; color: var(--green); overflow-wrap: anywhere; font-size: .89rem; }
.layout { min-height: 100dvh; display: grid; grid-template-columns: 15.6rem minmax(0,1fr); }
.sidebar { background: var(--dark); color: #fdfdf2; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 1.45rem 1rem 1rem; overflow: auto; }
.sidebar .brand { margin: 0 .55rem 1.35rem; }
.sidebar .nav-list { display: grid; gap: .25rem; }
.nav-button { min-height: 43px; display: flex; width: 100%; align-items: center; gap: .68rem; border: 0; border-radius: .6rem; padding: .58rem .65rem; color: inherit; background: transparent; font-size: .9rem; text-align: left; }
.nav-button:hover,.nav-button[aria-current=page] { background: #ffffff17; }
.nav-button[aria-current=page] { font-weight: 700; }
.nav-button .badge { margin-left: auto; }
.nav-icon { width: 1rem; text-align: center; flex: 0 0 auto; }
.nav-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-label { padding: 1.15rem .7rem .4rem; color: #dae7d6; font-size: .75rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.profile { margin-top: auto; padding-top: .9rem; }
.profile .nav-button { border-top: 1px solid #ffffff24; border-radius: 0; }
.badge { border-radius: 99px; font-size: .78rem; color: var(--dark); background: #e4deae; padding: .10rem .45rem; font-weight: 700; }
.page { width: min(100%, 65rem); padding: clamp(1.15rem, 4vw, 3.4rem); margin: 0 auto; }
.page-head { margin-bottom: 1.65rem; }
.page-head p { margin-top: .6rem; }
.welcome { background: #e6eee3; border: 1px solid #d5e4d4; padding: clamp(1.2rem, 4vw, 2.5rem); border-radius: 1.1rem; }
.welcome p { max-width: 53ch; margin: .6rem 0 1.15rem; }
.welcome .kicker { margin: 0 0 .45rem; }
.tile { display: grid; gap: .55rem; text-align: left; cursor: pointer; color: var(--ink); }
.tile:hover { border-color: #7eab95; background: #fffffc; }
.tile-marker { background: var(--mint); border-radius: .6rem; display: grid; place-items: center; width: 2.2rem; height: 2.2rem; color: var(--green); font-size: 1.15rem; }
.thread { min-height: 100dvh; display: grid; grid-template-rows: auto minmax(10rem, 1fr) auto; max-height: 100dvh; }
.thread-head { border-bottom: 1px solid var(--line); background: var(--paper); padding: .85rem clamp(.95rem, 3vw, 2rem); }
.thread-head h1 { font-size: 1.9rem; overflow-wrap: anywhere; }
.thread-scroller { overflow-y: auto; padding: 1rem clamp(.8rem, 3vw, 2rem) 1.4rem; overscroll-behavior: contain; }
.thread-content,.composer-inner { display: grid; gap: .9rem; width: min(100%, 47rem); margin: 0 auto; }
.composer { background: var(--paper); border-top: 1px solid var(--line); padding: .7rem clamp(.8rem, 3vw, 1.5rem); }
.composer-inner { gap: .48rem; }
.composer textarea { min-height: 2.8rem; height: 2.8rem; max-height: 28vh; }
.composer-footer { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.composer-footer .send { margin-left: auto; }
.composer-footer input[type=file] { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: 0; }
.composer-footer input[type=file]:focus-visible + label { outline: 3px solid #8a5a21; outline-offset: 3px; }
.message { display: grid; gap: .43rem; align-items: start; grid-template-columns: 2rem minmax(0,1fr); }
.message.self { justify-self: end; grid-template-columns: minmax(0,1fr); width: fit-content; max-width: min(100%, 38rem); }
.message.self .message-icon { display: none; }
.message.self .bubble { background: #e3eee6; border-color: #d0e2d6; border-top-right-radius: .25rem; }
.message.self .meta { justify-content: flex-end; }
.message-icon { background: #e4deae; color: var(--dark); font-family: var(--display); display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; }
.meta { display: flex; flex-wrap: wrap; gap: .45rem; font-size: .8rem; color: var(--muted); padding: .08rem 0 .35rem; }
.bubble { background: var(--paper); border: 1px solid var(--line); border-radius: .85rem; border-top-left-radius: .25rem; padding: .78rem .95rem; display: grid; gap: .7rem; overflow-wrap: anywhere; }
.bubble p { white-space: pre-wrap; }
.quote { margin: 0; padding-inline-start: .7rem; border-inline-start: 3px solid #a0bca9; color: var(--muted); }
.attachment { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.attachment a:first-child { font-weight: 700; }
.action,.item { display: grid; gap: .55rem; padding: .72rem .85rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--paper); overflow-wrap: anywhere; }
.action code { white-space: pre-wrap; }
.qr { display: block; background: white; height: auto; width: min(220px,100%); border-radius: .5rem; }
.payment-fields { display: grid; gap: .35rem; }
.payment-fields dt { color: var(--muted); font-size: .84rem; font-weight: 600; }
.payment-fields dd { margin: 0; overflow-wrap: anywhere; }
.empty { padding-block: clamp(.75rem, 5vh, 4rem); text-align: center; max-width: 32rem; margin: auto; display: grid; gap: .5rem; }
.list,.list-entry { display: grid; gap: .65rem; }
.list-entry .text-link { font-size: 1rem; border: 0; padding: 0; color: var(--green); background: transparent; font-weight: 700; text-align: left; }
.row { border-bottom: 1px solid var(--line); padding: .7rem 0; }
.row:last-child { border: 0; }
.pill { display: inline-flex; padding: .15rem .45rem; border-radius: .4rem; background: var(--mint); color: var(--green); font-size: .78rem; font-weight: 700; }
details summary { cursor: pointer; font-weight: 700; }
details[open] summary { margin-bottom: .75rem; }
dialog { width: min(34rem, calc(100% - 1.4rem)); border: 1px solid var(--line); border-radius: 1rem; background: var(--paper); color: var(--ink); padding: 1.25rem; max-height: 90dvh; }
dialog::backdrop { background: #112d28a8; }
#toast { position: fixed; bottom: 1rem; right: 1rem; max-width: min(25rem, calc(100% - 2rem)); z-index: 4; }
#toast:not(:empty) { border-radius: .55rem; background: var(--dark); color: white; padding: .75rem 1rem; box-shadow: 0 .25rem 1rem #173b3430; }
@media (max-width: 760px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { padding: 1.25rem; gap: 1.3rem; }
  .auth-brand h1 { font-size: 2.65rem; max-width: 15ch; }
  .auth-brand p { max-width: 43ch; }
  .layout { grid-template-columns: minmax(0,1fr); }
  .sidebar { position: relative; height: auto; padding: .55rem .75rem; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .35rem .65rem; }
  .sidebar .brand { font-size: 1.45rem; margin: 0 auto 0 0; }
  .sidebar .emblem { width: 1.7rem; font-size: .85rem; }
  .sidebar .nav-list { display: flex; flex-wrap: wrap; }
  .sidebar .desktop, .profile { display: none; }
  .nav-button { width: auto; min-height: 41px; padding: .4rem .5rem; gap: .3rem; }
  .nav-icon { display: none; }
  .thread { min-height: calc(100dvh - 54px); max-height: calc(100dvh - 54px); }
  .thread-head h1 { font-size: 1.55rem; }
  .thread-head .btn { min-height: 38px; }
  .message { grid-template-columns: 1.55rem minmax(0,1fr); }
  .message-icon { width: 1.55rem; height: 1.55rem; }
}
@media (max-width: 420px) {
  .panel-grid { grid-template-columns: 1fr; }
  .sidebar { gap: .2rem; padding-inline: .45rem; }
  .nav-button { font-size: .8rem; }
  .composer .hint { font-size: .8rem; }
}

[hidden] { display: none !important; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }

