:root {
  --navy: #263b46;
  --teal: #496f71;
  --bg: #f4f6f3;
  --line: #d9e2de;
  --muted: #6a797b;
  --ink: #26363c;
  --green: #527765;
  --red: #9c5555;
  --safe-top: 0px;
  --safe-right: 0px;
  --safe-bottom: 0px;
  --safe-left: 0px;
}
* {
  box-sizing: border-box;
}
html {
  min-height: 100%;
  background: var(--navy);
  color-scheme: light;
}
html.standalone-app {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 100%;
  overflow-x: clip;
  font-family: Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
#app {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
}
html.standalone-app body::before {
  content: "";
  position: fixed;
  z-index: 15;
  inset: 0 0 auto;
  height: var(--safe-top);
  background: var(--navy);
  pointer-events: none;
}
a { color: var(--teal); }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible { outline: 3px solid #79a9a8; outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: .55; }
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
.loading {
  padding: 50px;
  text-align: center;
}
.auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(20px + var(--safe-top)) max(20px, var(--safe-right)) calc(20px + var(--safe-bottom)) max(20px, var(--safe-left));
  background: linear-gradient(135deg, #e7efeb, #f9faf8);
}
.authCard {
  width: min(680px, 100%);
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 30px;
  box-shadow: 0 20px 60px #263b4618;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.logo b {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
}
.logo strong,
.logo small {
  display: block;
}
.logo small {
  color: var(--muted);
  margin-top: 3px;
}
.auth h1 {
  font:
    30px Georgia,
    serif;
  margin: 8px 0;
}
.auth p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  background: #eef2f0;
  border-radius: 9px;
  padding: 3px;
  margin: 20px 0;
}
.tabs button {
  flex: 1;
  min-width: 135px;
  border: 0;
  background: transparent;
  padding: 9px;
  border-radius: 7px;
  color: var(--muted);
}
.tabs button.on {
  background: #fff;
  color: var(--teal);
  font-weight: bold;
}
.installLink {
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f9f8;
  color: var(--teal);
  font-weight: 700;
}
.form {
  display: grid;
  gap: 12px;
}
.form .two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form label {
  font-size: 11px;
  font-weight: bold;
}
.form input,
.form select,
.form textarea {
  width: 100%;
  margin-top: 5px;
  padding: 11px;
  border: 1px solid #cbd8d3;
  border-radius: 7px;
  background: #fff;
}
.form textarea {
  min-height: 80px;
}
.primary {
  border: 0;
  background: linear-gradient(135deg, #567c77, #3f6871);
  color: #fff;
  padding: 11px 15px;
  border-radius: 7px;
  font-weight: bold;
}
.danger,.miniBtn.danger { color: var(--red); border-color: #d8bbbb; }
.dangerFill { background: var(--red) !important; }
.twoActions { display:grid;grid-template-columns:1fr 1fr;gap:10px; }
.legalLinks { display:flex;flex-wrap:wrap;gap:12px;margin-top:18px;font-size:11px; }
.policyPage { width:min(900px,100%);margin:auto;padding:calc(30px + var(--safe-top)) max(16px, var(--safe-right)) calc(30px + var(--safe-bottom)) max(16px, var(--safe-left));line-height:1.65; }
.policyPage .card { padding:clamp(20px,4vw,42px); }
.policyPage h2 { margin-top:28px; }
.shell {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
}
.side {
  background: linear-gradient(180deg, #304852, #22363e);
  color: #fff;
  padding: calc(20px + var(--safe-top)) max(14px, var(--safe-right)) calc(20px + var(--safe-bottom)) max(14px, var(--safe-left));
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  width: 245px;
  display: flex;
  flex-direction: column;
}
.side .brand {
  padding: 6px 7px 18px;
  border-bottom: 1px solid #ffffff20;
}
.side .brand b,
.side .brand small {
  display: block;
}
.side .brand b {
  font:
    17px Georgia,
    serif;
}
.side .brand small {
  color: #c9d7d3;
  margin-top: 5px;
}
.mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: #ffffff10;
  padding: 4px;
  border-radius: 8px;
  margin: 16px 0;
}
.mode button {
  border: 0;
  background: transparent;
  color: #c9d7d3;
  padding: 8px 4px;
  border-radius: 6px;
  font-size: 9px;
}
.mode button.on {
  background: #fff;
  color: var(--navy);
  font-weight: bold;
}
.nav {
  display: grid;
  gap: 4px;
}
.nav button {
  border: 0;
  background: transparent;
  color: #c6d4d0;
  padding: 11px 12px;
  border-radius: 7px;
  text-align: left;
}
.nav button.on,
.nav button:hover {
  background: #ffffff16;
  color: #fff;
}
.sideFoot {
  margin-top: auto;
  border-top: 1px solid #ffffff20;
  padding: 14px 7px;
  color: #c7d4d1;
  font-size: 10px;
}
.sideFoot b {
  display: block;
  color: #fff;
  margin-bottom: 4px;
}
.sideFoot a { color:#dce8e5; }
.main {
  grid-column: 2;
  min-width: 0;
  max-width: 100%;
}
.top {
  min-height: calc(68px + var(--safe-top));
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: calc(10px + var(--safe-top)) max(26px, var(--safe-right)) 10px max(26px, var(--safe-left));
  position: sticky;
  top: 0;
  z-index: 5;
}
.top .grow {
  flex: 1 1 140px;
  min-width: 0;
}
.top button {
  flex: 0 0 auto;
  max-width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--teal);
}
.content {
  min-width: 0;
  max-width: 1400px;
  margin: auto;
  padding: 30px max(30px, var(--safe-right)) calc(30px + var(--safe-bottom)) max(30px, var(--safe-left));
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 22px;
}
.heading small {
  color: var(--teal);
  font-weight: bold;
  letter-spacing: 1.3px;
}
.heading h1 {
  font:
    32px Georgia,
    serif;
  margin: 7px 0;
}
.heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.card,
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}
.stat b,
.stat span,
.stat small {
  display: block;
}
.stat b {
  font:
    26px Georgia,
    serif;
  color: var(--teal);
}
.stat span {
  font-weight: bold;
  font-size: 11px;
  margin: 4px 0;
}
.stat small {
  color: var(--muted);
  font-size: 9px;
}
.card h2 {
  font:
    19px Georgia,
    serif;
  margin: 0 0 7px;
}
.card p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.card footer {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}
.card footer button,
.miniBtn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--teal);
  border-radius: 6px;
  padding: 7px;
  font-size: 9px;
}
.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
}
.tableWrap { width:100%;overflow:auto;border-radius:12px; }
.table th,
.table td {
  padding: 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 10px;
}
.table th {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}
.badge {
  padding: 4px 7px;
  border-radius: 12px;
  background: #e6efea;
  color: var(--green);
  font-size: 8px;
}
.badge.pending {
  background: #f4eadc;
  color: #946b38;
}
.chat {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
  min-height: 520px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.chatList {
  border-right: 1px solid var(--line);
  padding: 12px;
}
.chatList button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px;
  border-radius: 7px;
}
.chatList button.on {
  background: #eaf1ee;
}
.chatList a { display:block;padding:16px 10px 4px;font-size:10px;color:var(--teal); }
.messages {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.messageTop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
}
.messageTop select {
  width: min(300px, 60%);
}
.history {
  flex: 1;
  padding: 18px;
  overflow: auto;
}
.chatNotice {
  margin: 40px auto;
  max-width: 460px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f9f8;
  color: var(--muted);
  text-align: center;
}
.bubble {
  max-width: 75%;
  background: #edf3f0;
  padding: 10px 12px;
  border-radius: 3px 12px 12px;
  margin: 9px 0;
  font-size: 11px;
}
.bubble.mine {
  margin-left: auto;
  background: #dfeceb;
}
.messageActions { display:flex;gap:8px;margin-top:7px; }
.messageActions button { border:0;background:transparent;color:var(--teal);padding:0;font-size:9px;text-decoration:underline; }
.recipientTools { display:flex;align-items:center;gap:6px;justify-content:flex-end;flex:1;min-width:0; }
.memberControls { display:flex;align-items:center;gap:5px;min-width:340px; }
.memberControls select { max-width:125px;padding:6px;border:1px solid var(--line);border-radius:6px; }
.tripCard { display:flex;flex-direction:column; }
.tripCard footer { margin-top:auto; }
.tripDate { color:var(--teal);font-weight:800;font-size:10px;letter-spacing:.6px;text-transform:uppercase;margin-bottom:8px; }
.tripMeta { display:flex;flex-wrap:wrap;gap:6px; }
.tripMeta span { background:#eef4f1;border-radius:999px;padding:5px 8px;font-size:9px; }
.tripCard details { margin-top:14px;border-top:1px solid var(--line);padding-top:10px;font-size:10px; }
.tripCard summary { cursor:pointer;font-weight:700;color:var(--teal); }
.ideasHead { margin-top:34px; }
.reportQueue { margin-top:18px; }
.reportQueue > div { padding:12px 0;border-top:1px solid var(--line); }
.composer {
  display: flex;
  min-width: 0;
  max-width: 100%;
  gap: 7px;
  border-top: 1px solid var(--line);
  padding: 12px;
}
.composer input {
  flex: 1;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.composer button:disabled,
.composer input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.modalBack {
  position: fixed;
  inset: 0;
  background: #15272fb5;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: calc(15px + var(--safe-top)) max(15px, var(--safe-right)) calc(15px + var(--safe-bottom)) max(15px, var(--safe-left));
}
.modal {
  width: min(560px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  padding: 22px;
}
.modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  margin-bottom: 15px;
}
.modal header h2 {
  font:
    23px Georgia,
    serif;
}
.modal header button {
  border: 0;
  background: none;
  font-size: 24px;
}
.notice {
  padding: 12px;
  background: #edf3f0;
  border: 1px solid #d4e1db;
  border-radius: 8px;
  color: #4a665e;
  font-size: 10px;
  margin: 12px 0;
}
.empty {
  text-align: center;
  padding: 45px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed #c9d6d1;
  border-radius: 10px;
}
#toast {
  position: fixed;
  right: 18px;
  top: 80px;
  z-index: 40;
  background: var(--green);
  color: #fff;
  padding: 11px 15px;
  border-radius: 8px;
  display: none;
}
.privacy {
  background: #eef4f1;
  border: 1px solid #d6e1dc;
  border-radius: 9px;
  padding: 13px;
  font-size: 10px;
  color: #536b65;
  margin-top: 15px;
}
.trialChip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f9f8;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.adminList {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.adminRow {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 140px 100px 70px;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfa;
}
.adminRow small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.adminRow label {
  margin: 0;
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
}
.adminRow select,
.adminRow input {
  width: 100%;
  margin-top: 4px;
}
@media (max-width: 1100px) {
  .shell {
    display: block;
  }
  .side {
    position: fixed;
    inset: auto 0 0;
    width: auto;
    height: calc(72px + var(--safe-bottom));
    padding: 4px max(4px, var(--safe-right)) calc(4px + var(--safe-bottom)) max(4px, var(--safe-left));
    z-index: 10;
  }
  .side .brand,
  .sideFoot,
  .mode {
    display: none;
  }
  .nav {
    display: flex;
    overflow: auto;
  }
  .nav button {
    min-width: 85px;
    text-align: center;
    font-size: 9px;
  }
  .main {
    grid-column: auto;
    padding-bottom: calc(75px + var(--safe-bottom));
  }
  .top {
    gap: 8px;
    padding: calc(9px + var(--safe-top)) max(10px, var(--safe-right)) 9px max(10px, var(--safe-left));
  }
  .top .grow strong { display:none; }
  .top select { max-width:120px; }
  .top button { padding:7px;font-size:9px; }
  .content {
    padding: 20px max(11px, var(--safe-right)) calc(20px + var(--safe-bottom)) max(11px, var(--safe-left));
  }
  .grid,
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .chat {
    grid-template-columns: 1fr;
  }
  .chatList {
    display: flex;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .chatList button {
    min-width: 130px;
  }
  .form .two {
    grid-template-columns: 1fr;
  }
  .trialChip {
    display: none;
  }
  .adminRow {
    grid-template-columns: 1fr 1fr;
  }
  .adminRow > div {
    grid-column: 1 / -1;
  }
  .memberControls { min-width:300px; }
}
@media (max-width: 520px) {
  .grid,
  .stats {
    grid-template-columns: 1fr;
  }
  .heading {
    align-items: flex-start;
  }
  .heading h1 {
    font-size: 26px;
  }
  .heading .primary {
    font-size: 0;
  }
  .heading .primary:after {
    content: "＋";
    font-size: 18px;
  }
  .twoActions { grid-template-columns:1fr; }
  .authCard { padding:22px 16px; }
  .top { overflow-x:visible; }
}
@media print {
  .side,.top,.heading .primary,.composer,.installLink { display:none !important; }
  .shell,.main { display:block !important; }
  .content { padding:0;max-width:none; }
  body { background:#fff; }
}
