:root {
  --pink: #ec1187;
  --orange: #ff8d10;
}

html {
  width: 100vw;
  min-height: 100vh;
  height: -webkit-fill-available;
  overflow-x: hidden;
  background: linear-gradient(to right bottom, var(--pink) 0%, var(--orange) 100%) no-repeat var(--pink);
}

body {
  margin: 0;
  padding-top: 66px;
  color: #000;
  font: 14px "Avenir Next", Helvetica, Arial, sans-serif;
}

button,
textarea,
input { font: inherit; }

button { cursor: pointer; }

.container {
  width: 85%;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.form { width: 100%; }

.bubble {
  display: block;
  margin-top: 16px;
  border-radius: 24px;
}

.header {
  display: flex;
  justify-content: left;
  padding: 16px 16px 12px;
  font-size: 16px;
  background-color: #fff;
  border-radius: 32px 32px 0 0;
}

.pfp-container {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 300px;
  background: #f1f1f1 url("https://ngl.link/images/default_avatar.png") center / 40px 40px no-repeat;
}

.pfp {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 20px;
}

.user-container {
  margin-left: 12px;
  font-size: 14px;
}

.username { font-weight: 500; }
.prompt { font-weight: 700; }

.textarea-container {
  position: relative;
  width: 100%;
  height: 144px;
  margin-bottom: 10px;
  border-radius: 0 0 24px 24px;
  background-color: rgba(255, 255, 255, .4);
  backdrop-filter: blur(24px);
}

textarea {
  width: 100%;
  height: 140px;
  box-sizing: border-box;
  padding: 18px 24px;
  border: 0;
  outline: 0;
  color: #000;
  font: 600 20px/23px "Avenir Next", Helvetica, Arial, sans-serif;
  background: transparent;
}

.textarea-placeholder {
  position: absolute;
  top: 16px;
  left: 24px;
  max-width: calc(100% - 96px);
  color: rgba(0, 0, 0, .25);
  pointer-events: none;
  font-size: 20px;
  font-weight: 600;
  opacity: 0;
}

.textarea-placeholder.hidden { display: none; }
.fade-in { animation: fade-in .3s forwards; }
.fade-out { animation: fade-out .3s forwards; }

.dice-button {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 1;
  width: 20px;
  height: 20px;
  padding: 8px;
  box-sizing: content-box;
  border: 0;
  border-radius: 100px;
  font-size: 16px;
  line-height: 1;
  text-align: center;
  touch-action: manipulation;
  background-color: rgba(255, 255, 255, .25);
}

.anonymous-tooltip {
  margin: 12px 0;
  color: #fff;
  font-size: 14px;
  text-align: center;
}

.button,
.submit {
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 0;
  border-radius: 100px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  background-color: #000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, .25);
}

.submit {
  position: relative;
  visibility: hidden;
}

.submit.is-visible { visibility: visible; }

.submit:disabled { text-indent: -9999px; }

.submit:disabled::after {
  position: absolute;
  inset: 0;
  width: 16px;
  height: 16px;
  margin: auto;
  content: "";
  border: 4px solid #fff;
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  animation: loading-spinner 1s ease infinite;
}

.pulse { animation: animate-shake 2s ease-in-out infinite; }

.bottom-container {
  position: absolute;
  right: 0;
  bottom: 100px;
  left: 0;
  z-index: 1;
  width: 85%;
  max-width: 640px;
  padding: 32px 0 35px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
}

.download-prompt {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.space1 { width: 8px; height: 8px; }
.space2 { width: 16px; height: 16px; }
.space3 { width: 24px; height: 24px; }

.tos-privacy {
  position: absolute;
  bottom: 0;
  width: 100%;
}

.tos,
.privacy {
  color: rgba(255, 255, 255, .5);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.tos { margin-right: 10px; }
.tos:hover, .privacy:hover { color: #fff; }

.sent-view { display: none; }

body.is-sent {
  padding-top: 0;
}

body.is-sent .composer-view,
body.is-sent .composer-bottom { display: none; }

body.is-sent .sent-view {
  display: flex;
}

html.is-sent { background-attachment: fixed; }

.navbar {
  width: 100%;
  height: 56px;
  margin-top: 16px;
  display: flex;
  align-items: center;
}

.back-button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
}

.back-button img { display: block; }

.check {
  display: inline-block;
  width: 15vh;
  height: 15vh;
}

.sent-standard-flow {
  width: 100%;
  text-align: center;
}

.web-push-title {
  margin: 0;
  color: #fff;
  font-size: min(8vw, 30px);
  font-weight: 800;
  text-align: center;
}

.web-push-body {
  margin: 0 0 28px;
  color: rgba(255, 255, 255, .82);
  font-size: min(7.2vw, 27px);
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}

.another {
  display: inline-block;
  padding: 0;
  border: 0;
  border-bottom: 2px solid #fff;
  color: #fff;
  font: 700 18px "Avenir Next", Helvetica, Arial, sans-serif;
  text-decoration: none;
  background: transparent;
}

.send-error {
  position: fixed;
  bottom: 18px;
  left: 50%;
  z-index: 10;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  background: rgba(0, 0, 0, .84);
  transform: translateX(-50%);
}

.consent-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
}

.consent-modal[hidden] { display: none; }

.consent-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 9, 15, .52);
  backdrop-filter: blur(4px);
}

.consent-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 24px;
  border-radius: 24px;
  color: #201a21;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .28);
}

.consent-eyebrow {
  margin: 0 0 6px;
  color: #9f3378;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.consent-card h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.consent-card p:not(.consent-eyebrow) { margin: 12px 0 0; color: #5e5460; line-height: 1.5; }
.consent-card .consent-detail { color: #776e77; font-size: 13px; }
.consent-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 10px; }

.consent-actions button {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  font-weight: 750;
}

.consent-cancel { color: #473e48; background: #eeeaf0; }
.consent-accept { color: #fff; background: #161116; }

@keyframes fade-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes fade-out {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes animate-shake {
  0%, 10%, 65%, 100% { transform: rotate(0deg) scale(1); }
  30%, 40% { transform: rotate(-1deg) scale(1.05); }
  35%, 45% { transform: rotate(1deg) scale(1.05); }
}

@keyframes loading-spinner {
  0% { transform: rotate(0turn); }
  100% { transform: rotate(1turn); }
}

@media screen and (max-height: 700px) {
  .textarea-container:focus-within textarea { height: 80px; }
}

@media (max-width: 640px) {
  body { min-height: 100svh; padding-top: max(20px, env(safe-area-inset-top)); }
  .container { width: calc(100% - 32px); }
  .bubble { margin-top: 0; }
  .header { padding: 14px 14px 11px; }
  .textarea-container { height: 136px; }
  textarea { height: 132px; padding: 16px 18px; font-size: 18px; }
  .textarea-placeholder { top: 15px; left: 18px; font-size: 18px; }
  .dice-button { right: 13px; bottom: 13px; }
  .bottom-container {
    position: relative;
    bottom: auto;
    width: calc(100% - 32px);
    padding: 28px 0 calc(26px + env(safe-area-inset-bottom));
  }
  .download-prompt { font-size: 15px; }
  .button, .submit { height: 56px; font-size: 17px; }
  .composer-view .submit { margin-bottom: 4px; }
  .check { width: min(34vw, 124px); height: min(34vw, 124px); }
  .web-push-body { font-size: min(7.2vw, 25px); }
  .navbar { margin-top: 4px; }
}

/* Local admin panel ------------------------------------------------------- */
.admin-page {
  min-height: 100vh;
  padding: 28px;
  color: #1d1721;
  font: 15px Inter, "Avenir Next", Helvetica, Arial, sans-serif;
  background: #f5f3f7;
}

.admin-page * { box-sizing: border-box; }

.admin-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.admin-topbar {
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.03em;
}

.admin-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #fff;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--pink), var(--orange));
}

.admin-actions { display: flex; gap: 10px; }

.admin-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #ddd6e0;
  border-radius: 10px;
  color: #312a34;
  font-weight: 700;
  text-decoration: none;
  background: #fff;
}

.admin-button:hover { border-color: #a95b93; }
.admin-button.primary { border-color: #171317; color: #fff; background: #171317; }
.admin-button.danger { color: #a2223e; }

.admin-notice {
  margin-bottom: 22px;
  padding: 13px 15px;
  border: 1px solid #eadfe5;
  border-radius: 12px;
  color: #6d5563;
  background: #fff;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr);
  gap: 20px;
  align-items: start;
}

.admin-card {
  padding: 22px;
  border: 1px solid #e8e2e9;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(61, 24, 47, .06);
}

.admin-card + .admin-card { margin-top: 20px; }

.admin-card h2 {
  margin: 0 0 18px;
  font-size: 17px;
  letter-spacing: -.02em;
}

.admin-section-heading {
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-section-heading h2 { margin-bottom: 0; }

.admin-kicker {
  margin: 0 0 3px;
  color: #96798b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.admin-select {
  min-height: 40px;
  max-width: 230px;
  padding: 0 30px 0 10px;
  border: 1px solid #dcd5df;
  border-radius: 9px;
  color: #312a34;
  font: inherit;
  font-weight: 650;
  background: #fff;
}

.admin-select.compact { min-height: 34px; font-size: 13px; }

.admin-field {
  margin-bottom: 15px;
  display: grid;
  gap: 7px;
}

.admin-field label {
  color: #574c58;
  font-size: 13px;
  font-weight: 750;
}

.admin-field input,
.admin-field textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid #dcd5df;
  border-radius: 9px;
  color: #211a22;
  font: inherit;
  background: #fff;
}

.admin-field textarea { min-height: 110px; resize: vertical; }
.admin-field input:focus, .admin-field textarea:focus { border-color: #b75c9b; outline: 3px solid rgba(183, 92, 155, .13); }

.admin-form-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-photo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.admin-avatar {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 50%;
  background: #eee;
}

.admin-small { color: #796d79; font-size: 12px; line-height: 1.45; }
.admin-form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.admin-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: #177548;
  font-size: 13px;
  font-weight: 700;
}

.new-profile-form {
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid #ece1e8;
  border-radius: 12px;
  background: #fcf9fc;
}

.new-profile-form .admin-field:last-of-type { margin-bottom: 0; }

.server-access {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #eee4eb;
  border-radius: 11px;
  background: #fcf9fc;
}

.server-access > label {
  display: block;
  margin-bottom: 7px;
  color: #574c58;
  font-size: 12px;
  font-weight: 750;
}

.server-access-row { display: flex; gap: 8px; }

.server-access input {
  min-width: 0;
  flex: 1;
  padding: 9px 10px;
  border: 1px solid #dcd5df;
  border-radius: 8px;
  font: inherit;
}

.server-access .admin-small { margin: 8px 0 0; }

.profile-list { display: grid; gap: 8px; }

.profile-row {
  padding: 10px;
  border: 1px solid #eee8ef;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: #fcfbfc;
}

.profile-row.active { border-color: #d978b8; background: #fff5fb; }

.profile-row img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
}

.profile-row-main {
  min-width: 0;
  padding: 0;
  border: 0;
  text-align: left;
  color: inherit;
  background: transparent;
}
.profile-row-main strong, .profile-row-main span { overflow: hidden; display: block; text-overflow: ellipsis; white-space: nowrap; }
.profile-row-main span { margin-top: 1px; color: #837784; font-size: 12px; }

.profile-row-actions { display: flex; gap: 5px; }

.profile-icon-button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #dfd8e1;
  border-radius: 8px;
  color: #554956;
  background: #fff;
}

.profile-icon-button.danger { color: #a2223e; }

.message-list { display: grid; gap: 10px; }

.message-item {
  padding: 12px;
  border: 1px solid #eee8ef;
  border-radius: 10px;
  background: #fcfbfc;
}

.message-item p { margin: 0 0 7px; white-space: pre-wrap; }
.message-item time { color: #837784; font-size: 12px; }
.message-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; }
.sender-badge, .repeat-badge { padding: 2px 6px; border-radius: 99px; font-size: 11px; font-weight: 750; }
.sender-badge { color: #5d4a5a; background: #f0ebef; }
.repeat-badge { color: #994167; background: #ffdeed; }
.empty-inbox { margin: 0; color: #837784; }

@media (max-width: 840px) {
  .admin-page { padding: 16px; }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .admin-topbar { align-items: flex-start; flex-direction: column; }
  .admin-actions { width: 100%; }
  .admin-actions > * { flex: 1; }
  .admin-card { padding: 17px; }
  .admin-section-heading { align-items: center; }
  .admin-select { max-width: 160px; }
  .admin-form-columns { grid-template-columns: 1fr; gap: 0; }
  .profile-row { grid-template-columns: 34px minmax(0, 1fr); }
  .profile-row-actions { grid-column: 2; }
  .server-access-row { align-items: stretch; flex-direction: column; }
}
