/* Clear Space — pastel mesh + asymmetric bento houses + glass interior. */

.cs-page {
  --cs-safe-top: calc(env(safe-area-inset-top, 0px) + var(--clearli-top-inset-extra, 0px));
  --cs-safe-right: env(safe-area-inset-right, 0px);
  --cs-safe-bottom: env(safe-area-inset-bottom, 0px);
  --cs-safe-left: env(safe-area-inset-left, 0px);
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  font-family: Outfit, ui-rounded, system-ui, sans-serif;
  color: #1e293b;
  background: #3d82c4;
}

body.cs-page #premium-coach-modal,
body.cs-page #premium-coach-modal input,
body.cs-page #premium-coach-modal textarea,
body.cs-page #premium-coach-modal button {
  font-family: 'Space Mono', ui-monospace, monospace !important;
}

/* Space Ika: sleepy-cat JSON fills the sheet. Day = original lo-fi palette. */
body.cs-page .premium-coach-backdrop,
body.cs-page .premium-coach-sheet,
body.cs-page .premium-coach-bg,
body.cs-page .premium-coach-bg.clearli-gx-sky-bright {
  background: #f9e4d4 !important;
}

body.cs-page .premium-coach-bg-lighten,
body.cs-page .premium-coach-bg .clearli-gx-sky-bright-lighten,
body.cs-page .premium-coach-bg-scrim {
  display: none !important;
}

body.cs-page .premium-coach-lottie--sleepycat,
body.cs-page .premium-coach-bg.clearli-gx-sky-bright .premium-coach-lottie {
  display: block !important;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%);
  opacity: 1 !important;
  filter: none !important;
  pointer-events: none;
}

body.cs-page.night-mode .premium-coach-backdrop,
body.cs-page.night-mode .premium-coach-sheet,
body.cs-page.night-mode .premium-coach-bg,
body.cs-page.night-mode .premium-coach-bg.clearli-gx-sky-bright {
  background: #1e2a3d !important;
}

body.cs-page.night-mode .premium-coach-header h2 {
  color: #e8eef8;
  text-shadow: 0 1px 10px rgba(8, 12, 22, 0.35);
}

body.cs-page.night-mode .premium-coach-subtitle {
  color: rgba(196, 210, 230, 0.72);
}

body.cs-page.night-mode .premium-coach-close {
  background: rgba(18, 24, 38, 0.88);
  color: #d5deea;
  border-color: rgba(201, 212, 228, 0.18);
}

body.cs-page .premium-coach-bubble--assistant .premium-coach-bubble-body {
  opacity: 1;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.5;
  background: #fffef8;
  color: #1a237e;
  border: 2px solid rgb(0, 28, 183);
  box-shadow: 0 8px 24px rgba(46, 50, 54, 0.2);
}

body.cs-page .premium-coach-bubble--assistant .premium-coach-bubble-body p:not(.premium-coach-msg-heading),
body.cs-page .premium-coach-bubble--assistant .premium-coach-bubble-body li {
  font-weight: 700;
  color: #1a237e;
}

body.cs-page.night-mode .premium-coach-bubble--user .premium-coach-bubble-body {
  background: linear-gradient(135deg, #3d5270 0%, #2a3d58 100%);
  box-shadow: 0 4px 18px rgba(8, 12, 22, 0.28);
}

body.cs-page.night-mode .premium-coach-bubble--assistant .premium-coach-bubble-body {
  opacity: 1;
  font-weight: 700;
  background: rgba(18, 24, 38, 0.94);
  color: #e8eef8;
  border: 2px solid rgba(201, 212, 228, 0.42);
  box-shadow: 0 8px 24px rgba(8, 12, 22, 0.36);
}

body.cs-page.night-mode .premium-coach-bubble--assistant .premium-coach-bubble-body p:not(.premium-coach-msg-heading),
body.cs-page.night-mode .premium-coach-bubble--assistant .premium-coach-bubble-body li {
  font-weight: 700;
  color: #e8eef8;
}

body.cs-page.night-mode .premium-coach-bubble--assistant .premium-coach-bubble-body p.premium-coach-msg-heading,
body.cs-page.night-mode .premium-coach-bubble--assistant .premium-coach-bubble-body .premium-coach-msg-heading,
body.cs-page.night-mode .premium-coach-bubble--assistant .premium-coach-bubble-body .premium-coach-msg-label,
body.cs-page.night-mode .premium-coach-bubble--assistant .premium-coach-bubble-body strong {
  color: #e8c9a0;
}

body.cs-page.night-mode .premium-coach-composer-inner {
  background: rgba(18, 24, 38, 0.92);
  border-color: rgba(201, 212, 228, 0.18);
}

body.cs-page.night-mode .premium-coach-composer textarea {
  color: #e8eef8;
}

body.cs-page.night-mode .premium-coach-send {
  background: linear-gradient(145deg, #4a6588, #3e5a7c);
}

body.cs-page.night-mode .premium-coach-suggestion {
  background: rgba(18, 24, 38, 0.94);
  border-color: rgba(201, 212, 228, 0.28);
  color: #e8eef8;
}

body.cs-page.night-mode .premium-coach-suggestion::after {
  background: rgba(18, 24, 38, 0.94);
  border-right-color: rgba(201, 212, 228, 0.28);
  border-bottom-color: rgba(201, 212, 228, 0.28);
}

body.cs-page.night-mode .premium-coach-disclaimer-toast {
  background: rgba(18, 24, 38, 0.78);
  border-color: rgba(201, 212, 228, 0.22);
  color: #d5deea;
}

body.cs-page.night-mode .premium-coach-disclaimer-overlay {
  background: rgba(8, 12, 22, 0.52);
}

body.cs-page.night-mode .premium-coach-disclaimer-dialog {
  background: rgba(18, 24, 38, 0.98);
  border-color: rgba(201, 212, 228, 0.22);
}

body.cs-page.night-mode .premium-coach-disclaimer-dialog h3 {
  color: #e8eef8;
}

body.cs-page.night-mode .premium-coach-disclaimer-dialog p {
  color: rgba(196, 210, 230, 0.88);
}

body.cs-page.night-mode .premium-coach-disclaimer-close {
  background: linear-gradient(145deg, #4a6588, #3e5a7c);
}

body.cs-page.night-mode .premium-coach-jump-latest {
  color: #d5deea;
  background: rgba(18, 24, 38, 0.92);
  box-shadow: 0 4px 18px rgba(8, 12, 22, 0.28);
}

body.cs-page .premium-coach-header {
  padding:
    calc(14px + env(safe-area-inset-top, 0px) + var(--clearli-top-inset-extra, 0px))
    calc(18px + env(safe-area-inset-right, 0px))
    10px
    calc(18px + env(safe-area-inset-left, 0px));
}

body.cs-page .premium-coach-composer-area {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (min-width: 768px) {
  body.cs-page .premium-coach-modal {
    padding:
      calc(24px + env(safe-area-inset-top, 0px) + var(--clearli-top-inset-extra, 0px))
      calc(24px + env(safe-area-inset-right, 0px))
      calc(24px + env(safe-area-inset-bottom, 0px))
      calc(24px + env(safe-area-inset-left, 0px));
    box-sizing: border-box;
  }
}

.cs-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 60% at 18% 0%, #3a7bb8 0%, transparent 62%),
    radial-gradient(ellipse 70% 50% at 92% 0%, #f9c6e0 0%, transparent 55%),
    radial-gradient(ellipse 75% 60% at 8% 92%, #9fd4ff 0%, transparent 52%),
    radial-gradient(ellipse 55% 40% at 78% 78%, #fde68a 0%, transparent 50%),
    linear-gradient(180deg, #2f6fad 0%, #6ea4d8 26%, #f3d9ef 52%, #cfe8ff 100%);
}

.cs-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  padding:
    calc(10px + var(--cs-safe-top))
    calc(18px + var(--cs-safe-right))
    calc(108px + var(--cs-safe-bottom))
    calc(18px + var(--cs-safe-left));
}

.cs-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin-bottom: 8px;
}

.cs-burst {
  color: #fff;
  display: inline-flex;
  filter: drop-shadow(0 8px 16px rgba(255, 255, 255, 0.35));
}

.cs-page.is-interior .cs-burst { display: none; }

.cs-glass-btn,
.cs-mark,
.cs-orb {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.cs-glass-btn[hidden] { display: none; }

.cs-orb-wrap {
  position: relative;
  margin-left: auto;
}

.cs-orb {
  position: relative;
  transition: transform 0.22s ease, background 0.22s ease;
}

.cs-orb-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3.5px;
}

.cs-orb-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.62) 100%);
  box-shadow:
    0 0 6px rgba(255, 255, 255, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.cs-orb-wrap.is-open .cs-orb {
  transform: rotate(90deg);
}

.cs-orb-menu {
  position: absolute;
  top: 52px;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 4;
  pointer-events: none;
}

.cs-orb-wrap.is-open .cs-orb-menu {
  pointer-events: auto;
}

.cs-orb-action {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  color: #1e293b;
  font-family: inherit;
  font-size: 0.62rem;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-10px) scale(0.82);
  transition:
    opacity 0.2s ease,
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.cs-orb-wrap.is-open .cs-orb-action {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.cs-orb-wrap.is-open .cs-orb-action:nth-child(1) { transition-delay: 0.04s; }
.cs-orb-wrap.is-open .cs-orb-action:nth-child(2) { transition-delay: 0.1s; }
.cs-orb-wrap.is-open .cs-orb-action:nth-child(3) { transition-delay: 0.16s; }

.cs-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0 14px;
}

.cs-title-row .cs-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.cs-title-edit {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin-top: 4px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.cs-title {
  margin: 2px 0 14px;
  font-size: clamp(2.7rem, 12vw, 3.55rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.95;
  color: #fff;
  text-shadow: 0 10px 28px rgba(59, 130, 246, 0.18);
}

.cs-page.is-interior .cs-interior > .cs-title {
  text-align: center;
  margin: 8px 12px 16px;
}

.cs-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 16px;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.cs-chips::-webkit-scrollbar { display: none; }

.cs-chip {
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, 0.92);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.cs-chip.is-on {
  background: #f6ef9a;
  border-color: transparent;
  color: #1e293b;
}

.cs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 72px;
  grid-auto-flow: dense;
  gap: 12px;
}

@media (min-width: 720px) {
  .cs-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.cs-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  padding: 16px 14px 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 28px;
  text-align: left;
  cursor: pointer;
  color: #24506e;
  font-family: inherit;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.18s ease;
}

.cs-tile:active { transform: scale(0.98); }

.cs-tile--tall { grid-row: span 3; }
.cs-tile--quote { grid-row: span 2; }
.cs-tile--files { grid-row: span 2; }
.cs-tile--media { grid-row: span 2; }
.cs-tile--snap { grid-row: span 2; }
.cs-tile--serif { grid-row: span 2; }

.cs-tile--0 { background: rgba(176, 232, 210, 0.88); color: #215e4e; }
.cs-tile--1 { background: rgba(186, 219, 255, 0.9); color: #24507a; }
.cs-tile--2 { background: rgba(255, 230, 186, 0.9); color: #7c4a12; }
.cs-tile--3 { background: rgba(232, 214, 255, 0.9); color: #5b3d86; }
.cs-tile--snap { background: rgba(62, 52, 50, 0.78); color: #fff; border-color: rgba(255, 255, 255, 0.18); }
.cs-tile--serif { background: rgba(255, 214, 232, 0.82); color: #9d1752; }

.cs-tile.cs-tile--joined,
.cs-tile.cs-tile--joined.cs-tile--0,
.cs-tile.cs-tile--joined.cs-tile--1,
.cs-tile.cs-tile--joined.cs-tile--2,
.cs-tile.cs-tile--joined.cs-tile--3,
.cs-tile.cs-tile--joined.cs-tile--snap,
.cs-tile.cs-tile--joined.cs-tile--serif {
  background: #7c3aed;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.cs-tile h2 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.cs-tile--serif h2 {
  font-size: 1.7rem;
  letter-spacing: -0.04em;
}

.cs-tile--files .cs-tile-kicker {
  margin: auto 0 6px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.cs-tile-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  width: 100%;
}

.cs-tile-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  font-size: 0.72rem;
  font-weight: 500;
}

.cs-tile-list li::before {
  content: '';
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  opacity: 0.55;
}

.cs-tile-list li:first-child::before {
  background: currentColor;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7);
}

.cs-tile-meta,
.cs-tile-date {
  margin-top: auto;
  padding-top: 10px;
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.72;
}

.cs-tile-count {
  margin-top: auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.28);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
}

.cs-wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
  margin-top: auto;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
}

.cs-wave span {
  display: block;
  width: 3px;
  border-radius: 99px;
  background: currentColor;
  opacity: 0.55;
  animation: csWave 1.1s ease-in-out infinite;
}

.cs-wave span:nth-child(1) { height: 8px; animation-delay: 0s; }
.cs-wave span:nth-child(2) { height: 16px; animation-delay: 0.12s; }
.cs-wave span:nth-child(3) { height: 11px; animation-delay: 0.22s; }
.cs-wave span:nth-child(4) { height: 20px; animation-delay: 0.08s; }
.cs-wave span:nth-child(5) { height: 9px; animation-delay: 0.18s; }

@keyframes csWave {
  0%, 100% { transform: scaleY(0.55); }
  50% { transform: scaleY(1); }
}

.cs-empty {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.5;
  text-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
}

.cs-empty--deck {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  margin: 0;
  padding: 24px;
  text-align: center;
}

.cs-dock {
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--cs-safe-bottom));
  transform: translateX(-50%);
  z-index: 5;
}

.cs-fab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
}

.cs-fab-plus,
.cs-fab-side,
.cs-create-cta {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
}

.cs-fab-plus {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #111827;
  color: #fff;
  font-size: 1.45rem;
  line-height: 1;
}

.cs-fab-side {
  height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.18);
  color: #111827;
  font-size: 0.82rem;
}

.cs-create-cta {
  height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.78);
  color: #fff;
  font-size: 0.92rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
}

.cs-interior {
  display: none;
}

.cs-page.is-interior {
  overflow: hidden;
  height: 100dvh;
}

.cs-page.is-interior .cs-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding-bottom: calc(88px + var(--cs-safe-bottom));
}

.cs-page.is-interior .cs-gallery { display: none; }
.cs-page.is-interior .cs-interior {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  animation: csRise 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.cs-interior-head { flex-shrink: 0; }
.cs-interior-foot { flex-shrink: 0; margin: 6px 0 0; }
.cs-page.is-interior .cs-dock { display: none; }
.cs-dock--note { display: none; }
.cs-page.is-interior .cs-dock--note { display: block; }

@keyframes csRise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.cs-members {
  margin: -4px 0 14px;
  text-align: center;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.78rem;
}

.cs-deck {
  position: relative;
  flex: 1 1 0%;
  min-height: 280px;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 2px 8px;
  overflow: visible;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.cs-log-card,
.cs-note-card,
.cs-feed-card {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  left: 2px;
  right: 2px;
  top: 36px;
  bottom: 8px;
  width: auto;
  height: auto;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 22px 20px 18px;
  border: none;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  overflow: hidden;
  transform-origin: top center;
  opacity: 0;
  transition:
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease,
    background 0.3s ease;
  pointer-events: none;
}

.cs-feed-card.is-front {
  z-index: 5;
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
  background: #ffffff;
}

.cs-feed-card.is-behind-1 {
  z-index: 4;
  transform: translateY(-16px) scale(0.93);
  opacity: 1;
  background: #fff7dd;
}

.cs-feed-card.is-behind-2 {
  z-index: 3;
  transform: translateY(-30px) scale(0.86);
  opacity: 0.95;
  background: #f3efff;
}

.cs-feed-card.is-passed {
  z-index: 0;
  transform: translateY(36px) scale(0.96);
  opacity: 0;
}

.cs-feed-card.is-waiting {
  z-index: 1;
  transform: translateY(-42px) scale(0.8);
  opacity: 0;
}

.cs-deck.is-dragging .cs-feed-card {
  transition: none;
}

.cs-note-card h2,
.cs-log-kicker {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 600;
}

.cs-log-card strong,
.cs-note-card strong {
  display: block;
  margin: 0 0 12px;
  font-size: clamp(1.55rem, 7vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.12;
  color: #1d4ed8;
}

.cs-log-card p,
.cs-note-body,
.cs-feed-body {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.45;
  color: #334155;
}

.cs-feed-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
}

.cs-log-card small,
.cs-note-card small {
  display: block;
  flex-shrink: 0;
  margin-top: 16px;
  font-size: 0.82rem;
  opacity: 0.7;
}

.cs-feed-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.cs-feed-edit {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
}

.cs-feed-author {
  flex: 0 0 auto;
  margin: 0 0 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #64748b;
}

.cs-feed-media {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.cs-feed-media .cs-wave {
  margin-top: 0;
}

.cs-feed-chip,
.cs-feed-score {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 700;
}

.cs-detail-sheet h2 {
  margin: 0 0 6px;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.cs-detail-stamp {
  margin: 0 0 12px;
  font-size: 0.8rem;
  color: #64748b;
}

.cs-code-display {
  margin: 8px 0 16px;
  text-align: center;
}

.cs-code-display code {
  font-size: 1.55rem;
  letter-spacing: 0.14em;
}

.cs-invite code,
.cs-page code {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.cs-note-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cs-note-form button {
  border: none;
  border-radius: 14px;
  padding: 10px 12px;
  background: #2563eb;
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

#cs-leave,
#cs-delete {
  border: none;
  background: transparent;
  color: #9f1239;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 0 0;
}

.cs-dialog {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  box-sizing: border-box;
  padding:
    calc(12px + var(--cs-safe-top))
    calc(16px + var(--cs-safe-right))
    calc(16px + var(--cs-safe-bottom))
    calc(16px + var(--cs-safe-left));
}

.cs-dialog[hidden] { display: none; }

.cs-dialog-sheet {
  width: min(440px, 100%);
  max-height: min(88dvh, calc(100dvh - 32px - var(--cs-safe-top) - var(--cs-safe-bottom)));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  background: #fff;
  border-radius: 22px;
  padding: 18px;
}

.cs-dialog-sheet h2 { margin: 0 0 10px; font-family: Outfit, sans-serif; }
.cs-dialog-sheet input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  font-family: inherit;
  margin-bottom: 10px;
}

.cs-dialog-sheet button[type='submit'] {
  width: 100%;
  min-height: 44px;
  border: none;
  border-radius: 12px;
  padding: 12px;
  background: #2563eb;
  color: #fff;
  font-family: inherit;
  font-weight: 700;
}

.cs-dialog-sheet--join {
  background: #7c3aed;
  color: #fff;
}

.cs-dialog-sheet--join h2 {
  color: #fff;
}

.cs-dialog-sheet--join input {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

.cs-dialog-sheet--join input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.cs-dialog-sheet--join button[type='submit'] {
  background: #fff;
  color: #7c3aed;
}

.cs-opening {
  position: fixed;
  inset: 0;
  z-index: 8;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #1e3a8a;
}

.cs-opening[hidden] { display: none; }

body.cs-page.night-mode {
  background: #152033;
  color: #e2e8f0;
}

body.cs-page.night-mode .cs-bg {
  background:
    radial-gradient(ellipse 80% 55% at 12% 8%, rgb(147, 178, 208) 0%, transparent 58%),
    radial-gradient(ellipse 70% 50% at 92% 0%, #599854 0%, transparent 55%),
    radial-gradient(ellipse 75% 60% at 8% 92%, #1e3a5f 0%, transparent 52%),
    linear-gradient(180deg, #152033 0%, #1e293b 100%);
}

body.cs-page.night-mode .cs-chip.is-on {
  background: #f6ef9a;
  color: #1e293b;
}

@media (max-height: 560px) {
  .cs-title {
    font-size: clamp(1.45rem, 7vh, 2.1rem);
  }

  .cs-title-row {
    margin-bottom: 8px;
  }

  .cs-members {
    margin-bottom: 8px;
  }

  .cs-deck {
    min-height: 140px;
    padding-top: 20px;
  }

  .cs-page.is-interior .cs-shell {
    padding-bottom: calc(72px + var(--cs-safe-bottom));
  }

  .cs-dialog-sheet {
    max-height: min(92dvh, calc(100dvh - 16px - var(--cs-safe-top) - var(--cs-safe-bottom)));
  }
}
