:root {
  color-scheme: light;
  --primary: #8f5bd6;
  --primary-soft: #f0e9fb;
  --rose: #f06f9f;
  --rose-soft: #fff0f5;
  --accent: #f29d72;
  --text: #382d44;
  --muted: #776a82;
  --border: #eadfed;
  --surface: rgba(255, 255, 255, 0.86);
  --background: #fff7fb;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  background:
    linear-gradient(135deg, #fff7fb 0%, #f7f0ff 48%, #f0fffb 100%);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.shell {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card,
.composer,
.profile-box,
.card,
.girls-night-card,
.notice {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(118, 87, 139, 0.08);
}

.login-card {
  width: min(430px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 22px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  overflow: hidden;
  background: #f4efe7;
  box-shadow: 0 10px 22px rgba(240, 111, 159, 0.2);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-row.compact .brand-mark {
  width: 38px;
  height: 38px;
}

.modal-brand h1,
.panel-heading h2,
.topbar h2,
.section-header h3,
.card h4 {
  margin: 0;
}

.modal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.modal-brand h1 {
  color: var(--primary);
  font-size: 24px;
  line-height: 1.08;
}

.modal-brand p,
.message,
.empty,
.meta,
.muted-text,
.post-error {
  color: var(--muted);
}

.modal-brand p {
  margin: 3px 0 0;
  font-size: 13px;
}

.panel-heading {
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--rose);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.form,
.composer {
  display: grid;
  gap: 12px;
}

.form {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: white;
  color: var(--text);
  font-size: 14px;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(143, 91, 214, 0.14);
}

button[type="submit"],
.primary-button {
  min-height: 40px;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-weight: 900;
}

.ghost-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: white;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.message {
  min-height: 20px;
  font-size: 13px;
}

.auth-switch {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.inline-link {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  text-decoration: underline;
}

.signup-step {
  display: grid;
  gap: 12px;
}

.info-text {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fffaf3;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.signup-consent {
  align-items: flex-start;
  line-height: 1.45;
}

.password-strength {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 247, 251, 0.9);
  color: var(--muted);
  font-size: 12px;
}

.strength-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.strength-fill {
  height: 100%;
  border-radius: inherit;
}

.strength-rules {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.strength-rules li.met {
  color: #2f8f5b;
  font-weight: 800;
}

.legal-dialog {
  width: min(620px, calc(100% - 32px));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  background: white;
  color: var(--text);
}

.legal-dialog::backdrop {
  background: rgba(56, 45, 68, 0.28);
}

.legal-dialog h3 {
  margin: 0 0 12px;
}

.legal-dialog-content {
  max-height: 52vh;
  overflow: auto;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.message.error,
.post-error {
  color: var(--danger);
}

.app-view {
  width: min(960px, calc(100% - 36px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  margin-bottom: 16px;
}

.topbar h2 {
  color: var(--primary);
  font-size: 21px;
}

.account-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.nickname,
.child-age {
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.child-age {
  max-width: 130px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--rose-soft);
  color: var(--rose);
  font-size: 12px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(520px, 100%);
  margin: 0 auto 18px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.tab {
  min-height: 38px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.tab.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.main-column {
  display: grid;
  gap: 14px;
}

.tab-panel {
  display: grid;
  gap: 12px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-header h3 {
  font-size: 20px;
}

.composer,
.profile-box,
.card,
.girls-night-card,
.notice {
  padding: 14px;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.checkbox-row input {
  width: auto;
}

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

.empty {
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  font-size: 14px;
}

.card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.48;
}

.post-card {
  cursor: pointer;
}

.post-card:hover {
  border-color: rgba(143, 91, 214, 0.28);
}

.post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.post-header h4,
.card h4 {
  font-size: 15px;
}

.post-author {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.post-child-age {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--rose-soft);
  color: var(--rose);
  font-size: 12px;
  font-weight: 900;
}

.text-button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
}

.reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.reaction-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 31px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--rose-soft);
  color: var(--text);
  font-weight: 800;
}

.reaction-button.selected {
  background: var(--primary-soft);
  color: var(--primary);
}

.reaction-button strong {
  font-size: 12px;
}

.post-details {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.comments {
  display: grid;
  gap: 8px;
}

.comment {
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 247, 251, 0.9);
}

.comment strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.comment p {
  margin: 0 0 6px;
  font-size: 13px;
}

.comment span,
.muted-text,
.post-error {
  font-size: 12px;
}

.comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.comment-form button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-weight: 900;
}

.girls-night-card {
  display: grid;
  gap: 8px;
  background: linear-gradient(135deg, #fff3f8, #f1ebff);
}

.girls-night-card h4 {
  margin: 0;
  font-size: 17px;
}

.girls-night-card p,
.notice {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.notice {
  background: #fffaf3;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 34px;
}

.page-button,
.page-ellipsis {
  min-width: 32px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.page-button {
  background: white;
  border: 1px solid var(--border);
  color: var(--muted);
}

.page-button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.profile-summary {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 8px 0 18px;
  text-align: center;
}

.profile-avatar {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--primary));
  color: white;
  font-size: 30px;
  font-weight: 900;
}

.profile-summary h4 {
  margin: 0;
}

.profile-summary h4 {
  font-size: 20px;
}

.profile-city,
.profile-child,
.profile-bio,
.profile-notice {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.profile-bio {
  max-width: 520px;
  margin-top: 6px;
  color: var(--text);
  line-height: 1.45;
}

.profile-child {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--rose-soft);
  color: var(--rose);
  font-weight: 900;
}

.profile-notice {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fffaf3;
}

.profile-notice.error {
  color: var(--danger);
}

.profile-actions {
  display: grid;
  gap: 9px;
}

.profile-action {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  text-align: left;
}

.profile-action::after {
  content: ">";
  color: var(--muted);
  font-weight: 900;
}

.primary-profile-action {
  justify-content: center;
  border-color: transparent;
  background: var(--accent);
  color: white;
}

.primary-profile-action::after {
  content: "";
}

.profile-danger-actions {
  display: grid;
  gap: 5px;
  margin-top: 14px;
}

.danger-action {
  min-height: 36px;
  background: transparent;
  color: var(--danger);
  font-size: 14px;
  font-weight: 900;
}

@media (max-width: 780px) {
  .login-view {
    padding: 16px;
  }

  .app-view {
    width: min(100%, calc(100% - 24px));
    padding: 12px 0 22px;
  }

  .topbar {
    align-items: flex-start;
  }

  .account-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }

  .composer-actions,
  .post-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .comment-form {
    grid-template-columns: 1fr;
  }
}
