html {
  background: #093f39;
}

body .mx_AuthPage {
  box-sizing: border-box;
  background: radial-gradient(ellipse at 100% 0%, #287265, transparent 52%),
    linear-gradient(160deg, #093f39 15%, #082e31 80%) !important;
  min-height: 100%;
  padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
}

body .mx_AuthPage .mx_AuthPage_modal {
  flex-direction: column;
  width: min(100%, 420px);
  margin: auto;
  background: transparent;
  box-shadow: none;
}

body .mx_AuthPage .mx_AuthPage_modal::before {
  content: "Kapti";
  align-self: center;
  font: 750 58px/1.05 system-ui, sans-serif;
  letter-spacing: -.07em;
  margin-block: 10px 28px;
  color: #e6fff3;
}

body .mx_AuthPage .mx_AuthHeaderLogo {
  display: none;
}

body .mx_AuthPage .mx_AuthBody {
  width: 100%;
  margin: 0;
  padding: 26px clamp(18px, 6vw, 32px);
  border-radius: 24px;
  box-shadow: 0 16px 46px #001b1a55;
}

body .mx_AuthPage .mx_AuthBody h1 {
  font-size: 1.65rem;
  letter-spacing: -.04em;
}

body .mx_AuthPage .mx_AuthBody input {
  font-size: 16px;
}

body .mx_AuthPage .mx_AuthBody_button {
  min-height: 48px;
  border-radius: 14px;
}

@media (max-width: 700px) {
  body .mx_MatrixChat_useCompactLayout {
    --EventTileBubble_margin-block: 6px;
  }

  body .mx_MatrixChat_useCompactLayout .mx_RoomHeader {
    min-height: 60px;
    border-bottom: 1px solid var(--cpd-color-border-subtle, #a6b9b329);
  }

  body .mx_MatrixChat_useCompactLayout .mx_RoomHeader_heading {
    font-weight: 700;
    letter-spacing: -.025em;
  }

  body .mx_MatrixChat_useCompactLayout .mx_LeftPanel_roomListContainer,
  body .mx_MatrixChat_useCompactLayout .mx_RoomView_messagePanel {
    background-image: linear-gradient(160deg, #16776312, transparent 55%);
  }

  body .mx_MatrixChat_useCompactLayout .mx_MessageComposer_wrapper {
    border-radius: 18px;
  }
}

@media (display-mode: standalone) {
  body .mx_MatrixChat_useCompactLayout .mx_MessageComposer {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
}

/* The signed-in shell uses Element's own theme surfaces and keeps its controls. */
body .mx_MatrixChat {
  --kapti-surface: var(--cpd-color-bg-canvas-default, #fff);
  --kapti-border: var(--cpd-color-border-subtle, #cdded7);
  --kapti-tint: #148a7117;
}

.mx_MatrixChat .mx_SpacePanel {
  background: linear-gradient(180deg, #17846c28, #17846c09 65%),
    var(--kapti-surface);
  border-inline-end: 1px solid var(--kapti-border);
}

.mx_MatrixChat .mx_LeftPanel,
.mx_MatrixChat .mx_LeftPanel_roomListContainer {
  background: linear-gradient(165deg, var(--kapti-tint), transparent 64%),
    var(--kapti-surface);
}

.mx_MatrixChat .mx_LeftPanel [role="treeitem"],
.mx_MatrixChat .mx_LeftPanel [role="option"] {
  border-radius: 12px;
  min-block-size: 44px;
}

.mx_MatrixChat .mx_LeftPanel [role="treeitem"][aria-selected="true"],
.mx_MatrixChat .mx_LeftPanel [role="option"][aria-selected="true"] {
  background: #148a7129;
}

.mx_MatrixChat .mx_RoomView_messagePanel {
  background-image: radial-gradient(ellipse at 100% 4%, #16846a18, transparent 65%);
}

.mx_MatrixChat .mx_HomePage {
  box-sizing: border-box;
  width: 100%;
  padding: clamp(16px, 4vw, 52px);
  overflow: auto;
  background: radial-gradient(ellipse at 100% 0%, #2a8069 0%, transparent 61%),
    linear-gradient(150deg, #103d36, #081f24);
}

.mx_MatrixChat .mx_HomePage_default .mx_HomePage_default_wrapper {
  box-sizing: border-box;
  width: min(100%, 500px);
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid #9bf0d741;
  border-radius: 28px;
  background: #123b35;
  box-shadow: 0 18px 62px #031a2080;
}

.mx_MatrixChat .mx_HomePage_default_wrapper::before {
  content: "Kapti";
  display: block;
  margin-block-end: 22px;
  color: #adf5d8;
  font: 800 clamp(34px, 6vw, 58px)/1 system-ui, sans-serif;
  letter-spacing: -.075em;
}

.mx_MatrixChat .mx_HomePage_default h1 {
  color: #f1fff9;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.2;
  letter-spacing: -.035em;
}

.mx_MatrixChat .mx_HomePage_default h2 {
  color: #bbd8cb;
  font-size: .95rem;
  font-weight: 500;
}

.mx_MatrixChat .mx_HomePage_default .mx_HomePage_default_buttons {
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  margin-block: 26px 0;
}

.mx_MatrixChat .mx_HomePage_default_buttons .mx_AccessibleButton {
  flex-direction: row;
  justify-content: flex-start;
  box-sizing: border-box;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid #a9eed744;
  border-radius: 13px;
  background: #1d4a41;
  color: #effff8;
  text-align: start;
}

.mx_MatrixChat .mx_HomePage_default_buttons .mx_AccessibleButton:first-child {
  background: #b1f3da;
  color: #103b30;
  border-color: #b1f3da;
}

.mx_MatrixChat .mx_HomePage_default_buttons .mx_AccessibleButton svg {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  color: inherit;
}

.mx_MatrixChat .mx_HomePage_default_buttons .mx_AccessibleButton:focus-visible {
  outline: 2px solid #adf5d8;
  outline-offset: 3px;
}

.mx_MatrixChat .mx_LeftPanel .kapti-people-button {
  min-height: 44px;
  flex: 0 0 auto;
  margin: 10px 12px 8px;
  padding: 8px 12px;
  border: 1px solid #247258;
  border-radius: 14px;
  background: #1a614d;
  color: #f3fff9;
  cursor: pointer;
  font: 650 .875rem/1.25 system-ui, sans-serif;
}

.mx_MatrixChat .kapti-people-button:focus-visible {
  outline: 2px solid #16866a;
  outline-offset: 3px;
}

.mx_MatrixChat .mx_LeftPanel_minimized .kapti-people-button {
  display: none;
}

.mx_MatrixChat .mx_HomePage_button_sendDm {
  font-weight: 700;
}

@media (max-width: 700px) {
  .mx_MatrixChat .mx_HomePage {
    padding: 16px;
  }

  .mx_MatrixChat .mx_HomePage_default .mx_HomePage_default_wrapper {
    border-radius: 22px;
    padding: 22px 18px;
  }

  .mx_MatrixChat .mx_HomePage_default_wrapper::before {
    margin-block-end: 16px;
  }

  .mx_InviteDialog_editor input {
    font-size: 16px;
  }
}
