:root {
  --bg: #ee9ca7;
  --bg2: #ffdde1;
  --card: rgba(255, 255, 255, 0.72);
  --solid: rgba(255, 255, 255, 0.96);
  --text: #4d2638;
  --muted: #9d7083;
  --pink: #ff5f9e;
  --pink2: #ff3d88;
  --soft: #ffd5e5;
  --line: rgba(255, 95, 158, 0.16);
  --shadow: 0 14px 38px rgba(142, 43, 86, 0.14);
  --nav: 76px;
}

* {
  box-sizing: border-box;
}

[hidden],
.hidden {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: "Nunito", ui-rounded, "Segoe UI", system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, var(--bg), var(--bg2));
  transition: 0.25s;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.glass {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

body.viewer .owner-only {
  display: none !important;
}

.viewer-only {
  display: none;
}

body.viewer .viewer-only {
  display: block;
}

.shell {
  width: min(100%, 1080px);
  min-height: 100vh;
  margin: auto;
  padding: 79px 15px calc(var(--nav) + 42px);
}

.topbar {
  position: fixed;
  z-index: 30;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 50%;
  width: calc(100% - 30px);
  max-width: 1050px;
  transform: translateX(-50%);
  height: 57px;
  min-height: 57px;
  margin: 0;
  padding: 8px;
  border-radius: 21px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.topbar-normal {
  width: 100%;
  min-width: 0;
  height: 39px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.top-actions {
  margin-left: auto;
  display: flex;
  gap: 5px;
}

.icon-btn {
  height: 39px;
  min-width: 39px;
  padding: 0 11px;
  border: 0;
  border-radius: 13px;
  color: var(--text);
  background: var(--solid);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 5px 14px rgba(143, 42, 87, 0.08);
}

.panel {
  display: none;
  animation: fade 0.2s ease;
}

.panel.active {
  display: block;
}

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

.section-head {
  margin: 23px 2px 11px;
}

.panel > .section-head:first-child {
  margin-top: 8px;
}

.section-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.section-head h2,
.section-head h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--pink);
  font-size: 12px;
  font-weight: 900;
}

.locked {
  display: none;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px dashed rgba(255, 95, 158, 0.28);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 95, 158, 0.07);
  font-size: 10px;
}

body.viewer .locked {
  display: block;
}

.btn {
  min-height: 46px;
  padding: 11px 14px;
  border: 0;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 850;
}

.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--pink2));
  box-shadow: 0 10px 22px rgba(255, 61, 137, 0.24);
}

.secondary {
  color: var(--text);
  background: var(--solid);
  border: 1px solid var(--line);
}

.danger {
  color: #fff;
  background: linear-gradient(135deg, #ff7188, #ff4267);
}

.input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: 0;
  color: var(--text);
  background: var(--solid);
  font-size: 12px;
}

textarea.input {
  min-height: 90px;
  resize: vertical;
}

@media (max-width: 719px) {
  input,
  textarea,
  select,
  .input,
  .pin-input {
    font-size: 16px !important;
  }
}

.empty {
  padding: 20px 12px;
  border: 1px dashed var(--line);
  border-radius: 15px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.btn-block {
  width: 100%;
}

.btn-compact {
  min-height: 38px;
}

.mt-9 { margin-top: 9px; }
.mt-10 { margin-top: 10px; }
.mt-11 { margin-top: 11px; }
.mb-8 { margin-bottom: 8px; }
.text-9 { font-size: 9px; }
.text-13 { font-size: 13px; }
.text-muted { color: var(--muted); }

/* Modal & Toast */
.modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  padding: 16px;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal.open {
  display: flex;
}

.modal-card {
  width: min(100%, 520px);
  max-height: calc(100dvh - 32px);
  padding: 17px;
  overflow: auto;
  border-radius: 27px;
}

.modal-card.wide {
  width: min(100%, 760px);
}

.modal-head {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-head h3 {
  margin: 0;
  font-size: 19px;
}

.modal-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.modal-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.modal-actions {
  margin-top: 11px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.toast {
  display: none !important;
}

@media (min-width: 720px) {
  .modal-sub { font-size: 12px; line-height: 1.4; }
  .modal-head h3 { font-size: 22px; }
  .btn { font-size: 13px; }
  .input { font-size: 14px; }
}
