/* ============================================
   Logan Silvia — Shared Calendar
   Same palette and fonts as the main site's style.css
   ============================================ */

:root {
  --bg:        #f0ebe1;
  --bg2:       #e9e3d8;
  --surface:   rgba(255,252,244,.88);
  --surface-solid: #fbf8f1;
  --surface2:  rgba(255,252,244,.50);
  --text:      #1a1d16;
  --muted:     #696c61;
  --green:     #3f6d46;
  --green-dk:  #2c4a2e;
  --sage:      #03422b;
  --accent:    #c0643b;
  --danger:    #a4402a;
  --line:      rgba(30,44,25,.13);
  --line-soft: rgba(30,44,25,.07);
  --line-grad: linear-gradient(to right, transparent, var(--sage) 50%, transparent);
  --shadow:    0 6px 40px rgba(18,32,16,.10);
  --shadow-lg: 0 24px 80px rgba(18,32,16,.22);
  --shadow-sm: 0 2px 14px rgba(18,32,16,.07);
  --radius:    6px;
  --radius-lg: 14px;
  --max:       1320px;
  --pad:       clamp(16px, 3vw, 40px);
  --hour:      52px;
  --gutter:    58px;
  --serif:     'Cormorant Garamond', Georgia, serif;
  --sans:      'DM Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: .01em;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto;
  height: 3px;
  background: var(--green);
  z-index: 200;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.65; }
.small { font-size: 13px; }

/* ── Top bar ── */
.topbar {
  position: sticky;
  top: 3px;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  border-image: var(--line-grad) 1;
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.brand { line-height: 1; }
.brand-name { display: block; font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: .02em; color: var(--green); padding-bottom: 5px; }
.brand-sub { display: block; font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.nav-actions { display: flex; gap: 8px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 13px; font-weight: 500; letter-spacing: .04em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease, color .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn svg { width: 16px; height: 16px; }
.btn-sm { padding: 8px 16px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--green); color: var(--bg); border-color: var(--green); }
.btn-primary:hover { background: var(--green-dk); box-shadow: 0 4px 22px rgba(28,52,30,.28); }
.btn-outline { background: transparent; color: var(--green); border-color: var(--green); }
.btn-outline:hover { background: var(--green); color: var(--bg); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: #fffdf7; box-shadow: var(--shadow-sm); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(164,64,42,.35); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface); color: var(--text); border-color: var(--line); }

:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ── Toolbar ── */
.cal-shell { padding-top: 18px; padding-bottom: 28px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar-nav { display: flex; align-items: center; gap: 10px; min-width: 0; }
.step { display: flex; }
.cal-title {
  font-family: var(--serif);
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 500;
  letter-spacing: -.015em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-title em { font-style: normal; color: var(--muted); font-weight: 400; }

.view-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--line);
}
.view-switch button {
  border: 0;
  background: transparent;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 12.5px; font-weight: 500; letter-spacing: .04em;
  color: var(--muted);
  cursor: pointer;
  transition: background .18s, color .18s, box-shadow .18s;
}
.view-switch button:hover { color: var(--text); }
.view-switch button[aria-selected="true"] { background: var(--surface-solid); color: var(--green); box-shadow: var(--shadow-sm); }

.banner {
  margin-bottom: 12px;
  padding: 11px 16px;
  border-radius: var(--radius);
  background: rgba(192,100,59,.12);
  border: 1px solid rgba(192,100,59,.3);
  color: #6d3317;
  font-size: 13.5px;
}

.cal-view { height: max(560px, calc(100dvh - 176px)); }
.cal-view.loading { opacity: .72; transition: opacity .2s; }

/* Card surface shared by all views */
.panel {
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ── Event chips (colors set inline: --c, --fill, --ink) ── */
.chip {
  display: flex; align-items: center; gap: 5px;
  width: 100%;
  min-width: 0;
  padding: 2px 7px;
  border: 0;
  border-left: 3px solid var(--c);
  border-radius: 5px;
  background: var(--fill);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
  transition: filter .15s, box-shadow .15s;
}
.chip:hover { filter: brightness(.96) saturate(1.1); box-shadow: 0 1px 6px rgba(18,32,16,.12); }
.chip-time { font-size: 11px; opacity: .8; font-variant-numeric: tabular-nums; }
.chip-title { overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.chip.cont-l { border-left-color: transparent; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.chip.cont-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
/* Multi-day bars run edge to edge so consecutive days read as one bar. */
.m-cell .chip, .tg-allday-cell .chip { width: auto; }
.m-cell .chip.cont-l { margin-left: -6px; }
.m-cell .chip.cont-r { margin-right: -6px; }
.tg-allday-cell .chip.cont-l { margin-left: -4px; }
.tg-allday-cell .chip.cont-r { margin-right: -4px; }

/* ── Month view ── */
.month { display: grid; grid-template-rows: auto 1fr; }
.dow-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.dow {
  padding: 10px 10px 8px;
  font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); min-height: 0; }
.m-cell {
  position: relative;
  display: flex; flex-direction: column; gap: 2px;
  min-height: 0; min-width: 0;
  padding: 5px 6px 6px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  overflow: hidden;
  transition: background .15s;
}
.m-cell:nth-child(7n) { border-right: 0; }
.m-cell:hover { background: rgba(63,109,70,.045); }
.m-cell.other { background: rgba(30,44,25,.025); }
.m-cell.other .m-daynum { color: rgba(105,108,97,.6); }
.m-cell.weekend:not(.other) { background: rgba(30,44,25,.012); }
.m-cell-head { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.m-daynum {
  display: inline-grid; place-items: center;
  min-width: 26px; height: 26px;
  padding: 0 6px;
  border: 0; border-radius: 999px;
  background: transparent;
  font-size: 12.5px; font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.m-daynum:hover { background: var(--bg2); }
.m-cell.today .m-daynum { background: var(--green); color: var(--bg); }
.m-add {
  opacity: 0;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--green);
  transition: opacity .15s;
}
.m-add svg { width: 14px; height: 14px; }
.m-cell:hover .m-add { opacity: 1; }
.more-btn {
  flex-shrink: 0;
  border: 0; background: transparent;
  padding: 1px 7px;
  font-size: 11.5px; font-weight: 600;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  border-radius: 5px;
}
.more-btn:hover { color: var(--green); background: var(--bg2); }

/* ── Time grid (week / day) ── */
.tg { display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
.tg-row { display: grid; grid-template-columns: var(--gutter) repeat(var(--days), minmax(0, 1fr)); }
.tg-head { border-bottom: 1px solid var(--line-soft); }
.tg-dayhead {
  display: flex; align-items: baseline; justify-content: center; gap: 7px;
  padding: 10px 4px 8px;
  border: 0; border-left: 1px solid var(--line-soft);
  background: transparent;
  cursor: pointer;
  min-width: 0;
}
.tg-dayhead:hover .tg-date { background: var(--bg2); }
.tg-dow { font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tg-date {
  display: inline-grid; place-items: center;
  min-width: 30px; height: 30px; padding: 0 6px;
  border-radius: 999px;
  font-family: var(--serif); font-size: 21px; font-weight: 600;
  font-variant-numeric: lining-nums;
}
.tg-dayhead.today .tg-date { background: var(--green); color: var(--bg); }
.tg-dayhead.today .tg-dow { color: var(--green); }
.tg-allday { border-bottom: 1px solid var(--line); }
.tg-allday-label {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  padding: 7px 8px 0 0; text-align: right;
}
.tg-allday-cell {
  display: flex; flex-direction: column; gap: 2px;
  min-height: 30px; min-width: 0;
  padding: 3px 4px;
  border-left: 1px solid var(--line-soft);
  max-height: 96px;
  overflow-y: auto;
  cursor: pointer;
}
.tg-allday-cell:hover { background: rgba(63,109,70,.045); }
.tg-scroll { overflow-y: auto; overflow-x: hidden; min-height: 0; scrollbar-width: thin; }
.tg-body { position: relative; height: calc(var(--hour) * 24); }
.tg-hours { position: relative; }
.tg-hour-label {
  position: absolute; right: 8px;
  transform: translateY(-50%);
  font-size: 10.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tg-col {
  position: relative;
  border-left: 1px solid var(--line-soft);
  background-image:
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, transparent calc(50% - .5px), rgba(30,44,25,.035) calc(50% - .5px), rgba(30,44,25,.035) calc(50% + .5px), transparent calc(50% + .5px));
  background-size: 100% var(--hour);
  cursor: cell;
  touch-action: pan-y;
}
.tg-col.today { background-color: rgba(63,109,70,.035); }
.tg-col.weekend { background-color: rgba(30,44,25,.015); }
.tg-event {
  position: absolute;
  display: flex; flex-direction: column;
  padding: 3px 7px;
  border: 0;
  border-left: 3px solid var(--c);
  border-radius: 6px;
  background: var(--fill);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.3;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255,252,244,.9);
  transition: box-shadow .15s, filter .15s;
}
.tg-event:hover { z-index: 5; box-shadow: 0 0 0 1px rgba(255,252,244,.9), 0 4px 16px rgba(18,32,16,.16); filter: saturate(1.1); }
.tg-event > * { flex-shrink: 0; }
.tg-event .ev-title { font-weight: 600; overflow-wrap: anywhere; }
.tg-event .ev-time { font-size: 11px; opacity: .82; font-variant-numeric: tabular-nums; }
.tg-event .ev-loc { font-size: 11px; opacity: .75; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-event.short { flex-direction: row; gap: 6px; align-items: center; padding-top: 1px; padding-bottom: 1px; white-space: nowrap; }
.now-line { position: absolute; left: -1px; right: 0; height: 2px; background: var(--accent); z-index: 6; pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.tg-ghost {
  position: absolute; left: 3px; right: 3px;
  border-radius: 6px;
  background: rgba(63,109,70,.18);
  border: 1.5px dashed var(--green);
  color: var(--green-dk);
  font-size: 11.5px; font-weight: 600;
  padding: 3px 7px;
  pointer-events: none;
  z-index: 7;
}

/* ── Year view ── */
.year { overflow-y: auto; padding: clamp(14px, 2vw, 24px); }
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: clamp(14px, 2vw, 26px) clamp(14px, 2.4vw, 32px); }
.mini-title {
  display: block; width: 100%;
  border: 0; background: transparent; padding: 2px 4px 6px;
  font-family: var(--serif); font-size: 21px; font-weight: 600; text-align: left;
  color: var(--text);
  cursor: pointer;
}
.mini-title:hover { color: var(--green); }
.mini-month.current .mini-title { color: var(--green); }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.mini-dow { font-size: 10px; font-weight: 500; letter-spacing: .06em; color: var(--muted); text-align: center; padding-bottom: 3px; }
.mini-day {
  position: relative;
  aspect-ratio: 1;
  display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: transparent;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background .12s;
}
.mini-day:hover { background: var(--bg2); }
.mini-day.blank { visibility: hidden; }
.mini-day.has-ev { background: var(--fill); color: var(--ink); font-weight: 600; }
.mini-day.today { box-shadow: inset 0 0 0 2px var(--green); font-weight: 700; }
.mini-dots { position: absolute; bottom: 3px; left: 0; right: 0; display: flex; justify-content: center; gap: 2px; }
.mini-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--c); }

/* ── Modal ── */
.modal {
  width: min(540px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal[open] { display: flex; flex-direction: column; animation: pop .2s ease; }
.modal > form { display: flex; flex-direction: column; min-height: 0; max-height: inherit; }
.modal-narrow { width: min(430px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(20,30,16,.32); backdrop-filter: blur(3px); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 4px 24px; }
.modal-head h2 { font-family: var(--serif); font-size: 27px; font-weight: 500; letter-spacing: -.01em; }
.modal-body { padding: 12px 24px 8px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px 18px 24px; border-top: 1px solid var(--line-soft); }
.spacer { flex: 1; }

/* ── Forms ── */
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; min-width: 0; }
fieldset.field { border: 0; padding: 0; }
label, legend {
  font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
  padding: 0;
}
.opt { text-transform: none; letter-spacing: .01em; opacity: .7; font-weight: 400; }
input, textarea, select {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23696c61' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 36px; cursor: pointer; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(63,109,70,.14); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .6; }
input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(164,64,42,.12); }
#fTitle { font-size: 17px; font-weight: 500; }

.when-grid { display: grid; grid-template-columns: 1fr; }
.dt { display: flex; gap: 8px; }
.dt input[type="date"] { flex: 1.5; min-width: 0; }
.dt input[type="time"] { flex: 1; min-width: 0; }
.all-day .time-only { display: none; }

.toggle {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 14px;
  font-size: 13.5px; font-weight: 500; letter-spacing: .01em; text-transform: none;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track { position: relative; width: 36px; height: 21px; border-radius: 999px; background: rgba(30,44,25,.18); transition: background .2s; }
.toggle-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.toggle input:checked + .toggle-track { background: var(--green); }
.toggle input:checked + .toggle-track::after { transform: translateX(15px); }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--green); outline-offset: 2px; }

/* Color picker */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 2px; }
.swatch {
  position: relative;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 0;
  background: var(--c);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
  transition: transform .15s;
}
.swatch:hover { transform: scale(1.1); }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface-solid), 0 0 0 4px var(--c); }
.swatch[aria-checked="true"]::after {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 15px no-repeat;
}
.swatch.custom { background: conic-gradient(#e0514a, #e5b73b, #5fb35a, #3aa6c9, #5a61d6, #b34fb8, #e0514a); overflow: visible; }
.swatch.custom.picked { background: var(--c); }
.swatch.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; border: 0; }
.swatch.custom .plus { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; pointer-events: none; }
.swatch.custom .plus svg { width: 14px; height: 14px; stroke-width: 3; filter: drop-shadow(0 0 2px rgba(0,0,0,.4)); }
.swatch.custom.picked .plus { display: none; }

.opacity-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.opacity-row label { flex-shrink: 0; }
.opacity-row output { width: 40px; text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); }
input[type="range"] {
  flex: 1;
  padding: 0; border: 0; box-shadow: none;
  height: 20px;
  background: transparent;
  appearance: none; -webkit-appearance: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px; border-radius: 999px;
  background: linear-gradient(to right, transparent, var(--c, var(--green))), repeating-conic-gradient(#e2ddd2 0 25%, #fffdf8 0 50%) 0 0 / 8px 8px;
  box-shadow: inset 0 0 0 1px var(--line);
}
input[type="range"]::-moz-range-track {
  height: 8px; border-radius: 999px;
  background: linear-gradient(to right, transparent, var(--c, var(--green))), repeating-conic-gradient(#e2ddd2 0 25%, #fffdf8 0 50%) 0 0 / 8px 8px;
  box-shadow: inset 0 0 0 1px var(--line);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px; margin-top: -5px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--c, var(--green));
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--c, var(--green));
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
input[type="range"]:focus { box-shadow: none; }
.preview-strip {
  display: flex; align-items: center; gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px dashed var(--line);
}
.preview-label { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); flex-shrink: 0; }
.chip-preview {
  flex: 1; min-width: 0;
  padding: 4px 9px;
  border-left: 3px solid var(--c);
  border-radius: 5px;
  background: var(--fill);
  color: var(--ink);
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .15s, color .15s;
}

.form-error { color: var(--danger); font-size: 13.5px; margin: 0 0 10px; }
.form-status { font-size: 13.5px; margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: rgba(63,109,70,.1); color: var(--green-dk); }
.form-status.error { background: rgba(164,64,42,.1); color: var(--danger); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.divider { height: 1px; background: var(--line); margin: 20px 0 16px; }
.feed-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ── Popover (+N more) ── */
.popover {
  position: fixed;
  z-index: 60;
  width: 250px;
  max-height: 340px;
  overflow-y: auto;
  padding: 12px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 3px;
  animation: pop .15s ease;
}
.popover-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.popover-head strong { font-family: var(--serif); font-size: 19px; font-weight: 600; }

/* ── Toast ── */
.toast {
  position: fixed; left: 50%; bottom: 24px;
  transform: translateX(-50%);
  z-index: 300;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  animation: toast-in .25s ease;
  max-width: calc(100vw - 32px);
}
.toast.error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ── Sign-in page ── */
.signout { display: contents; }
.login-body { display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: min(400px, 100%);
  padding: 32px 30px 30px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.login-card .brand { display: inline-block; margin-bottom: 26px; }
.login-title { font-family: var(--serif); font-size: 30px; font-weight: 500; letter-spacing: -.01em; line-height: 1.15; margin-bottom: 8px; }
.login-card .muted { margin-bottom: 20px; }
.login-card .form-status { margin-bottom: 14px; }

/* ── Responsive ── */
@media (max-width: 760px) {
  .nav-actions .btn { font-size: 0; gap: 0; padding: 9px; }
  .nav-actions .btn svg { width: 18px; height: 18px; }
  .toolbar { gap: 10px; }
  .toolbar-nav { width: 100%; }
  .view-switch { width: 100%; }
  .view-switch button { flex: 1; }
  .cal-view { height: max(480px, calc(100dvh - 190px)); }
  .when-grid { grid-template-columns: 1fr; gap: 0; }
  :root { --gutter: 44px; --hour: 46px; }
  .tg-dayhead { flex-direction: column; align-items: center; gap: 0; padding: 6px 2px; }
  .tg-dow { font-size: 9.5px; letter-spacing: .06em; }
  .tg-date { font-size: 17px; min-width: 26px; height: 26px; }
}
@media (max-width: 560px) {
  .dow { padding: 8px 0 6px; text-align: center; letter-spacing: .04em; }
  .m-cell { padding: 3px 2px; gap: 2px; align-items: stretch; }
  .m-cell-head { justify-content: center; }
  .m-add { display: none; }
  .m-daynum { min-width: 24px; height: 24px; font-size: 12px; }
  .month .chip { height: 6px; padding: 0; border-left: 0; border-radius: 3px; background: var(--c); opacity: max(var(--alpha), .55); }
  .month .chip > * { display: none; }
  .more-btn { padding: 0; text-align: center; font-size: 10px; }
  .tg-event { padding: 2px 4px; font-size: 11px; }
  .modal { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto auto 0; border-radius: 18px 18px 0 0; }
  .modal-body { padding-left: 18px; padding-right: 18px; }
  .modal-head { padding-left: 18px; }
  .modal-foot { padding-left: 18px; padding-right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
