/* LuboGo — calm slate base, warm amber accent */
:root {
  --ink: #26323F;
  --ink-2: #4A5D73;
  --muted: #6B7A8C;
  --slate: #4A5D73;
  --slate-2: #5B6B7F;
  --slate-dark: #3C4C5F;
  --surface: #F3F5F8;
  --card: #FFFFFF;
  --line: #DFE4EB;
  --line-2: #EBEEF3;
  --amber: #E8A33D;
  --amber-dark: #D18E2A;
  --amber-ink: #2B2116;
  --amber-soft: #FBF1E1;
  --green: #3F9D6B;
  --green-dark: #2F7E55;
  --green-soft: #E7F4ED;
  --green-mid: #CFE9DA;
  --red: #C8553D;
  --red-soft: #F9ECE8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(38, 50, 63, .06), 0 6px 20px rgba(38, 50, 63, .06);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.45;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; }

/* Header */
.bar {
  gap: 12px;
  background: var(--slate);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px max(18px, env(safe-area-inset-left));
  padding-top: max(14px, env(safe-area-inset-top));
}
.brand {
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -.02em;
  text-decoration: none;
  color: #fff;
}
.brand span { color: var(--amber); }
#barRight { font-size: 13px; color: #D5DCE5; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.wrap { max-width: 560px; margin: 0 auto; padding: 18px 14px 48px; }
.screen { display: none; }
.screen.on { display: block; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 14px;
}

/* Forms */
label { display: block; font-weight: 600; font-size: 14px; color: var(--ink-2); margin: 16px 0 6px; }
label:first-child { margin-top: 0; }
#quickBox > label:first-child { margin-top: 20px; }
label.big-label { font-size: 17px; color: var(--ink); }
.small-label { font-size: 13px; margin-top: 12px; }
.opt { font-weight: 400; color: var(--muted); }
input, textarea, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #CDD5DF;
  border-radius: 10px;
  padding: 12px 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--slate-2); box-shadow: 0 0 0 3px rgba(91, 107, 127, .18); }
textarea { resize: vertical; }
#idea { font-size: 18px; line-height: 1.4; min-height: 128px; padding: 14px; }
#idea::placeholder { color: #98A4B3; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; font-size: 14px; margin: 10px 0 0; }
.check input { width: auto; }

/* Buttons */
.btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 16px;
  cursor: pointer;
  background: #fff;
  color: var(--ink);
  transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--amber); color: var(--amber-ink); }
.btn.primary:hover:not(:disabled) { background: var(--amber-dark); }
.btn.ghost { border-color: #CDD5DF; color: var(--ink-2); background: #fff; }
.btn.ghost:hover:not(:disabled) { background: var(--surface); }
.btn.big { width: 100%; padding: 15px; font-size: 17px; margin-top: 16px; }
.btn.wide { width: 100%; }
.btn.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 14px; border-color: #CDD5DF; color: var(--ink-2); }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px;
  border: 2px solid var(--amber-ink); border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn.ghost.busy::after, .btn.chip.busy::after { border-color: var(--slate-2); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.linkish {
  background: none; border: 0; padding: 6px 0; font: inherit; font-size: 14px; font-weight: 500;
  color: var(--slate-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #B8C2CE;
}
.linkish:hover { color: var(--ink); }
.linkish.danger { color: var(--red); text-decoration-color: rgba(200, 85, 61, .4); }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Home */
body.is-home .bar { flex-direction: column; align-items: center; justify-content: center; padding-top: max(34px, env(safe-area-inset-top)); padding-bottom: 64px; text-align: center; }
body.is-home .brand { font-size: 36px; }
body.is-home #barRight { display: none; }
.brand-wrap { display: flex; flex-direction: column; line-height: 1.1; }
.tagline { color: #B9C4D1; font-size: 9.5px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; margin-top: 3px; white-space: nowrap; }
body.is-home .brand-wrap { align-items: center; }
body.is-home .tagline { font-size: 12px; letter-spacing: .22em; color: #C9D2DD; margin-top: 8px; }
body.is-home .wrap { padding-top: 0; }
body.is-home .home-card { margin-top: -44px; position: relative; }
.home-card { padding: 22px 20px 16px; }
.loc-line { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-height: 20px; margin-top: 8px; }
.loc-line svg.i { width: 15px; height: 15px; }
.status { font-size: 14px; color: var(--ink-2); margin: 10px 0 0; min-height: 0; text-align: center; }
.status:empty, .err:empty { display: none; }
.err { color: var(--red); font-size: 14px; margin: 10px 0 0; }
.manual-link { text-align: center; margin-top: 8px; }
#manual { border-top: 1px solid var(--line-2); margin-top: 10px; padding-top: 14px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; margin: 18px 0 0; }

.search-row { display: flex; gap: 8px; align-items: stretch; }
.search-row input, .search-row select { flex: 1; min-width: 0; }
.hits { margin-top: 8px; display: grid; gap: 6px; }
.hit {
  text-align: left; width: 100%; font: inherit; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; cursor: pointer;
}
.hit:hover { border-color: var(--slate-2); }
.hit strong { display: block; font-weight: 600; }
.hit .sub { font-size: 13px; color: var(--muted); }
.starters { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.starters li { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--surface); border-radius: 10px; padding: 8px 12px; font-size: 14px; }

/* Invite */
.ready {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--slate); color: #fff; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
}
.ready strong { display: block; font-size: 15px; }
.ready span { font-size: 13px; color: #D5DCE5; }
.ready .btn { flex: none; }
.invite { padding: 20px 18px 16px; }
.inv-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.when-big { font-size: 34px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; color: var(--ink); }
.time-big { font-size: 34px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; color: var(--slate); }
.when-block { border-radius: 10px; margin: 0 -6px; padding: 2px 6px; }
.when-block.editable { cursor: pointer; transition: background .15s; }
.when-block.editable:hover { background: var(--surface); }
.when-block .edit-pill { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; margin-left: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--slate-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; background: #fff; }
.when-block .edit-pill svg.i { width: 13px; height: 13px; }
.when-edit { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 10px; }
.when-edit .two { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.when-edit input { min-width: 0; }
.when-edit label { margin-top: 0; font-size: 13px; }
.when-edit input { padding: 10px 11px; }
.we-btns { display: flex; gap: 8px; margin-top: 10px; }
.we-btns .btn { flex: 1; padding: 10px; }
.when-edit .hint { margin: 8px 0 0; }
.host-tip { margin: 10px 0 2px; }
.time-big .tz { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.inv-title { font-size: 18px; font-weight: 600; margin: 12px 0 0; letter-spacing: -.01em; }
.inv-note { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.inv-note:empty { display: none; }

.banner { border-radius: 12px; padding: 12px 14px; margin-top: 14px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.banner svg.i { margin-top: 1px; }
.banner strong { display: block; font-size: 16px; }
.banner .btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.banner .btn { padding: 8px 12px; font-size: 14px; }
.banner.locked { background: var(--green); color: #fff; }
.banner.locked a { color: #fff; font-weight: 600; }
.banner.info { background: var(--amber-soft); color: #5A4320; }
.banner.muted { background: var(--surface); color: var(--ink-2); }

.rsvp { margin-top: 16px; padding: 12px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.rsvp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rsvp-q { font-weight: 600; font-size: 15px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button {
  font: inherit; font-size: 14px; font-weight: 600; border: 0; background: transparent; color: var(--ink-2);
  padding: 7px 14px; border-radius: 8px; cursor: pointer;
}
.seg button.on { background: var(--slate); color: #fff; }
.seg button[data-rsvp="in"].on { background: var(--green); }
.seg button[data-rsvp="out"].on { background: var(--red); }
.seg button:disabled { cursor: default; opacity: .6; }
.name-row { margin-top: 10px; }
.people { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0; margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.people .grp { white-space: normal; }
.people .grp + .grp::before { content: "·"; margin: 0 8px; color: #B8C2CE; }
.people .lbl { font-weight: 600; color: var(--ink-2); margin-right: 4px; }
.people .lbl.in { color: var(--green-dark); }
.people .lbl.out { color: var(--red); }
.people:empty { display: none; }
.avs { display: flex; }
.av {
  width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--slate-2); border: 2px solid #fff; margin-left: -6px;
}
.av:first-child { margin-left: 0; }
.av.maybe { background: #A3AEBB; }
.av.out { background: #D5DBE2; color: #6B7A8C; }

.places-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 16px 0 8px; }
.places-head h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; font-weight: 600; }
.hint { font-size: 12.5px; color: var(--muted); }
.places { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.place {
  min-width: 0;
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 8px 10px 12px; background: #fff; transition: background .2s, border-color .2s;
}
.p-main { flex: 1; min-width: 0; text-decoration: none; display: block; }
.p-name { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.p-name .ext { width: 13px; height: 13px; color: var(--muted); opacity: .7; }
.p-addr { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.p-meta:empty { display: none; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--surface); color: var(--ink-2); margin-right: 4px; }
.p-acts { display: flex; gap: 4px; flex: none; }
.ic {
  width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; cursor: pointer; padding: 0;
  font: inherit;
}
.ic .n { font-size: 10.5px; font-weight: 600; line-height: 1; margin-top: 2px; }
.ic:hover:not(:disabled) { border-color: var(--slate-2); }
.ic:disabled { cursor: default; opacity: .5; }
.ic.up.on { background: var(--green); border-color: var(--green); color: #fff; }
.ic.down.on { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.ic.veto.on { background: var(--red); border-color: var(--red); color: #fff; }

.place.agreed { background: var(--green-soft); border-color: #B9DEC8; }
.place.leader { background: var(--green-mid); border-color: var(--green); box-shadow: inset 4px 0 0 var(--green); }
.place.leader .tag.lead { background: var(--green); color: #fff; }
.place.locked { background: var(--green); border-color: var(--green); color: #fff; padding: 12px 14px; }
.place.locked .p-addr, .place.locked .p-meta, .place.locked .p-name .ext { color: #E3F3EA; }
.place.locked .tag { background: rgba(255,255,255,.2); color: #fff; }
.place.vetoed { background: var(--red-soft); border-color: #EBC7BE; }
.place.vetoed .p-name { text-decoration: line-through; text-decoration-color: var(--red); color: #8F5A4E; }
.place.vetoed .p-addr { color: #A98479; }
.place.vetoed .tag.veto { background: var(--red); color: #fff; }
.place.faded { opacity: .55; }
.under-places { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 8px; }
.under-places .hint:empty { display: none; }

details.host { margin-top: 12px; border-top: 1px solid var(--line-2); padding-top: 8px; }
details.host summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 6px 0; list-style: none; }
details.host summary::-webkit-details-marker { display: none; }
details.host summary::after { content: " ▾"; color: var(--muted); }
details.host[open] summary::after { content: " ▴"; }
.host-grid { display: grid; gap: 4px; padding-bottom: 4px; }
.host-item label { margin-top: 10px; font-size: 13px; }

/* Chat */
.chat { padding: 16px 16px 14px; }
.chat-head { display: flex; justify-content: space-between; align-items: center; }
.chat-head h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; font-weight: 600; }
#suggestTime { margin-top: 8px; }
.msgs { display: grid; gap: 8px; margin: 10px 0 12px; max-height: 340px; overflow-y: auto; }
.msg { font-size: 15px; }
.msg .who { font-weight: 600; margin-right: 6px; }
.msg .at { font-size: 12px; color: var(--muted); }
.msg .txt { margin-top: 1px; overflow-wrap: anywhere; }
.msg.sys { font-size: 13px; color: var(--green-dark); background: var(--green-soft); border-radius: 8px; padding: 6px 10px; display: flex; align-items: center; gap: 6px; }
.msg.sys svg.i { width: 15px; height: 15px; }
.msg.sys.tsug { background: var(--amber-soft); color: #5A4320; flex-wrap: wrap; row-gap: 6px; }
.msg.sys.tsug.done, .msg.sys.tchange { background: var(--surface); color: var(--ink-2); }
.msg.sys b { font-weight: 600; }
.msg.sys .sug-acts { display: inline-flex; gap: 10px; align-items: center; margin-left: auto; }
.msg.sys .sug-acts .btn { padding: 5px 10px; font-size: 13px; }
.msg.sys .sug-acts .linkish { font-size: 13px; padding: 0; }
.msg.sys .state { color: var(--muted); }
.empty-chat { font-size: 14px; color: var(--muted); margin: 0; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; }
.icon-btn { background: var(--slate); color: #fff; width: 48px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover:not(:disabled) { background: var(--slate-dark); }
.icon-btn.busy::after { border-color: #fff; border-right-color: transparent; }

/* Map */
.map-sec { margin-top: 4px; }
#mapToggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
#mapBox { margin-top: 10px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
#map { height: 320px; background: #E5E9EE; }
.leaflet-tooltip.pin-tip { font-family: var(--font); font-weight: 600; font-size: 12px; }

/* Add */
.add-h { font-size: 22px; margin: 6px 0 14px; letter-spacing: -.01em; }

#toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px;
  transition: opacity .2s, transform .2s; pointer-events: none; z-index: 2000; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--red); }

@media (min-width: 720px) {
  .wrap { padding-top: 36px; }
  body.is-home .bar { padding-left: 28px; padding-right: 28px; }
  .bar { padding-left: max(28px, calc(50% - 280px)); padding-right: max(28px, calc(50% - 280px)); }
  .when-big, .time-big { font-size: 40px; }
  #map { height: 380px; }
}
@media (max-width: 420px) {
  .invite { padding: 18px 14px 14px; }
}
@media (max-width: 380px) {
  .ic { width: 40px; height: 40px; }
  .seg button { padding: 7px 10px; }
  .when-big, .time-big { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
