:root {
  --ink: #1B231D;
  --muted: #5E6A61;
  --bg: #F3EEE3;
  --paper: #FBF8F2;
  --line: #DCD4C4;
  --fir: #1F3B2D;
  --fir-2: #2C5340;
  --sun: #E8B04A;
  --r-s: 6px;
  --r-m: 12px;
  --s: 8px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.45 "Familjen Grotesk", system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
h1, h2 { line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 7vw, 44px); font-weight: 700; }
h2 { font-size: 22px; font-weight: 600; }
.label { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.label em { text-transform: none; letter-spacing: 0; font-weight: 400; font-style: normal; }

/* Top bar */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px max(16px, calc((100vw - 760px) / 2));
}
.logo { font-weight: 700; font-size: 24px; text-decoration: none; letter-spacing: -0.03em; color: var(--fir); }
.top-link { font-weight: 500; text-decoration: none; padding: 6px 12px; border-radius: var(--r-s); border: 1px solid var(--line); }
.top-link:hover { background: var(--paper); }

.page { width: 100%; max-width: 760px; margin: 0 auto; padding: 8px 16px 48px; flex: 1; }

/* Landing */
.landing { width: 100%; max-width: 760px; margin: 0 auto; padding: 40px 16px 48px; flex: 1; }
.logo-big { font-size: clamp(64px, 18vw, 120px); line-height: 0.9; margin: 0; }
.tagline { font-size: 19px; max-width: 30ch; margin: 16px 0 32px; color: var(--muted); }
.choice {
  display: grid; grid-template-columns: auto 1fr; column-gap: 20px; align-items: baseline;
  padding: 28px 24px; text-decoration: none; border-radius: var(--r-m);
  margin-bottom: 12px; transition: background-color .15s;
}
.choice-kicker { font-size: 14px; font-weight: 600; opacity: .6; grid-row: span 2; }
.choice-title { font-size: clamp(28px, 6.5vw, 40px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; }
.choice-sub { grid-column: 2; margin-top: 6px; opacity: .8; }
.choice-create { background: var(--fir); color: var(--paper); }
.choice-create:hover { background: var(--fir-2); }
.choice-cal { background: var(--paper); border: 1px solid var(--line); }
.choice-cal:hover { background: #fff; }

.next { margin-top: 36px; }
.next .label { margin-bottom: 8px; }

/* Rows (event list) */
.row {
  display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 2px; align-items: center;
  padding: 14px 16px; background: var(--paper); border: 1px solid var(--line);
  border-left: 4px solid var(--c); border-radius: var(--r-s);
  text-decoration: none; margin-bottom: 8px; transition: background-color .15s;
}
.row:hover { background: #fff; }
.row-title { font-weight: 600; font-size: 18px; min-width: 0; overflow-wrap: anywhere; }
.row-meta { grid-column: 2; color: var(--muted); font-size: 15px; }
.row-meta:empty { display: none; }
.row-faces { grid-column: 2; display: flex; align-items: center; margin-top: 6px; }
.row-faces .av { margin-right: -6px; border: 2px solid var(--paper); }
.row-count { margin-left: 14px; font-size: 14px; color: var(--muted); }

.tag {
  display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent);
  padding: 3px 8px; border-radius: var(--r-s);
}
.tag-big { font-size: 13px; padding: 4px 10px; margin-bottom: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 17px; cursor: pointer;
  background: var(--fir); color: var(--paper); border: 0; border-radius: var(--r-s);
  padding: 14px 22px; text-decoration: none; transition: background-color .15s;
}
.btn:hover { background: var(--fir-2); }
.btn-ghost { background: transparent; color: var(--fir); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--paper); }
.btn-small { padding: 8px 14px; font-size: 15px; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--fir); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-muted { color: var(--muted); font-weight: 400; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 20px; margin-top: 24px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field input, .field textarea {
  font: inherit; color: inherit; width: 100%;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-s);
  padding: 12px 14px; min-height: 50px;
}
.field input:focus, .field textarea:focus, .btn:focus-visible, .type input:focus-visible + span, .status-pick input:focus-visible + span {
  outline: 2px solid var(--fir); outline-offset: 2px;
}
.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.error { background: #FBE3DC; color: #8A2A12; padding: 12px 14px; border-radius: var(--r-s); margin: 0; }

.types { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.types legend { margin-bottom: 8px; }
.type input, .status-pick input { position: absolute; opacity: 0; pointer-events: none; }
.type span {
  display: flex; align-items: center; justify-content: center; height: 64px;
  font-weight: 700; font-size: 18px; border-radius: var(--r-s); cursor: pointer;
  border: 1px solid var(--line); background: var(--paper); color: var(--c);
  transition: background-color .15s, color .15s;
}
.type input:checked + span { background: var(--c); color: #fff; border-color: var(--c); }
@media (max-width: 480px) { .types { grid-template-columns: repeat(2, 1fr); } }

/* Event page */
.event h1 { overflow-wrap: anywhere; }
.when { font-size: 20px; font-weight: 600; margin: 12px 0 0; }
.past { font-size: 13px; font-weight: 600; background: var(--line); padding: 2px 8px; border-radius: var(--r-s); vertical-align: middle; }
.place { margin: 4px 0 0; color: var(--muted); }
.note { margin: 16px 0 0; padding: 14px 16px; background: var(--paper); border-radius: var(--r-s); border: 1px solid var(--line); }
.share { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; }
.notice { background: var(--fir); color: var(--paper); padding: 14px 16px; border-radius: var(--r-s); margin-bottom: 24px; }
.notice p { margin: 0; }

.people { margin-top: 40px; }
.people .label { margin-bottom: 14px; }
.people .sub { margin: 20px 0 12px; }
.faces { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 16px 14px; }
.faces li { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 64px; font-size: 14px; text-align: center; }
.faces li span:last-child { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.faces .av { width: 56px; height: 56px; font-size: 20px; }
.faces.sure .av { box-shadow: 0 0 0 3px var(--c); }
.faces.interested .av { opacity: .75; }
.empty { color: var(--muted); }

.av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.av-s { width: 28px; height: 28px; font-size: 11px; }
.av-txt { background: hsl(var(--hue) 45% 82%); color: hsl(var(--hue) 50% 25%); font-weight: 700; }

.mine { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 28px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-s); }
.mine-name { font-weight: 600; margin-right: auto; }
.mine-name em { font-weight: 400; font-style: normal; color: var(--muted); }

.join { margin-top: 36px; padding: 24px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m); }
.join-id { display: flex; align-items: flex-end; gap: 16px; }
.grow { flex: 1; }
.photo-pick { position: relative; flex: none; width: 76px; height: 76px; border-radius: 50%; cursor: pointer; overflow: hidden; background: var(--bg); border: 1px dashed var(--muted); }
.photo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-ph { display: flex; height: 100%; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: var(--muted); }
.status-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.status-pick span {
  display: flex; align-items: center; justify-content: center; height: 52px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-s); font-weight: 600; background: var(--bg);
  transition: background-color .15s, color .15s;
}
.status-pick input:checked + span { background: var(--fir); color: var(--paper); border-color: var(--fir); }
.owner { margin-top: 40px; }

/* Calendar */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.cal-head h1 { font-size: clamp(26px, 6vw, 36px); flex: 1; text-align: center; }
.cal-head h1 span { color: var(--muted); font-weight: 500; }
.nav { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; font-size: 26px; text-decoration: none; border: 1px solid var(--line); border-radius: var(--r-s); }
.nav:hover { background: var(--paper); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.dow { text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); padding-bottom: 4px; }
.day {
  min-height: 84px; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-s);
  text-decoration: none; display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
a.day:hover { background: #fff; }
.day.off { background: transparent; border-color: transparent; }
.day.gone { opacity: .5; }
.day.today { border: 2px solid var(--fir); }
.day.today .num { color: var(--fir); }
.num { font-size: 14px; font-weight: 600; }
.chip { display: block; background: var(--c); color: #fff; border-radius: 4px; padding: 1px 5px; font-size: 12px; font-weight: 600; overflow: hidden; }
.chip-t { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more { font-size: 12px; color: var(--muted); }
@media (max-width: 560px) {
  .day { min-height: 56px; padding: 4px; }
  .chip { height: 6px; padding: 0; border-radius: 3px; }
  .chip-t { display: none; }
}

.list { margin-top: 40px; }
.list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters a { font-size: 14px; font-weight: 600; text-decoration: none; padding: 6px 12px; border-radius: var(--r-s); border: 1px solid var(--line); color: var(--c, var(--ink)); }
.filters a.on { background: var(--c, var(--ink)); color: #fff; border-color: transparent; }
.list-day { font-weight: 700; margin: 20px 0 8px; scroll-margin-top: 16px; }

/* Footer */
.foot { display: flex; gap: 20px; justify-content: center; padding: 24px 16px 32px; font-size: 14px; color: var(--muted); }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* Prose pages */
.prose { max-width: 62ch; }
.prose h2 { margin: 28px 0 8px; }
.prose p, .prose li { color: #333C35; }

.row-faces .row-count:first-child { margin-left: 0; }
