:root {
  --bg-start: #fff8ef;
  --bg-end: #d8f4ea;
  --ink: #122620;
  --muted: #4f615c;
  --panel: #ffffffee;
  --line: #dce7e2;
  --primary: #0b7a62;
  --primary-strong: #075746;
  --neutral: #8a7f68;
  --danger: #a7392d;
  --positive: #3a9d5b;
  --radius: 18px;
  --shadow: 0 12px 28px rgba(9, 40, 32, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background: linear-gradient(120deg, var(--bg-start), var(--bg-end));
}

.background-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 20%, rgba(250, 178, 94, 0.28), transparent 30%),
    radial-gradient(circle at 84% 12%, rgba(86, 190, 163, 0.24), transparent 28%),
    radial-gradient(circle at 50% 90%, rgba(255, 255, 255, 0.4), transparent 35%);
}

h1,
h2,
h3 {
  font-family: "Fraunces", Georgia, serif;
  margin: 0;
}

p {
  margin: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1100px, 94vw);
  margin: 2rem auto 3rem;
}

.brand-row {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.2rem;
  animation: rise-in 480ms ease-out;
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand-logo {
  display: block;
  width: clamp(180px, 24vw, 300px);
  max-width: 100%;
  height: auto;
}

.brand-tagline {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.kicker {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.demo-role-switch {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hidden {
  display: none !important;
}

.screen {
  display: none;
  animation: fade-up 260ms ease;
}

.screen.active {
  display: block;
}

.panel {
  background: var(--panel);
  border: 1px solid #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
  backdrop-filter: blur(4px);
}

.panel-wide {
  padding: 1.4rem;
}

.panel-subtext {
  color: var(--muted);
  margin-top: 0.45rem;
}

.stacked-form {
  margin-top: 1rem;
  display: grid;
  gap: 0.8rem;
}

label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  padding: 0.72rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

input:focus,
textarea:focus {
  outline: 2px solid #6cd3b7;
  border-color: #6cd3b7;
}

.row-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
}

.primary-btn:hover {
  background: var(--primary-strong);
}

.secondary-btn {
  background: #edf6f3;
  color: var(--ink);
}

.ghost-btn,
.link-btn {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.sso-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.terms-row {
  font-size: 0.9rem;
  color: var(--muted);
}

.terms-checkbox-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.terms-checkbox-wrap input {
  width: auto;
  margin-top: 0.2rem;
}

.panel-header-with-pill {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
}

.privacy-pill {
  background: #e2f4ed;
  color: #145644;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

.emotion-groups {
  margin: 1rem 0;
  display: grid;
  gap: 0.8rem;
}

.emotion-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 0.75rem;
}

.emotion-group-title {
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

.emotion-section.positive .emotion-group-title {
  color: #247546;
}

.emotion-section.neutral .emotion-group-title {
  color: #6b5f48;
}

.emotion-section.negative .emotion-group-title {
  color: #8f2f25;
}

.emotion-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.emotion-btn {
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}

.emotion-icon {
  font-size: 1rem;
}

.emotion-btn[data-tone="positive"] {
  border-left: 4px solid var(--positive);
}

.emotion-btn[data-tone="neutral"] {
  border-left: 4px solid var(--neutral);
}

.emotion-btn[data-tone="negative"] {
  border-left: 4px solid var(--danger);
}

.emotion-btn.selected {
  outline: 2px solid #45bf9a;
  background: #f2fbf8;
}

.selection-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.count {
  font-weight: 700;
}

.privacy-panel {
  margin-top: 1rem;
  border: 1px dashed #b7d7cb;
  background: #f7fcfa;
  border-radius: 14px;
  padding: 0.85rem;
}

.tip-card {
  margin: 1rem 0;
  padding: 0.85rem;
  border-radius: 12px;
  background: linear-gradient(145deg, #fff9ed, #f3fff9);
  border: 1px solid #efe3ca;
}

.tip-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6f6449;
}

.tip-text {
  margin-top: 0.4rem;
}

.manager-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.owner-layout {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.owner-full {
  grid-column: 1 / -1;
}

#owner-tenant-table tbody tr {
  cursor: pointer;
}

#owner-tenant-table tbody tr:hover {
  background: #f6fbf9;
}

select {
  width: 100%;
  padding: 0.72rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
  background: #fff;
}

.compact-card {
  margin-top: 0.8rem;
}

.meter-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.meter {
  flex: 1;
  height: 14px;
  border-radius: 999px;
  background: #e7f3ed;
  overflow: hidden;
  border: 1px solid #d4e7df;
}

.meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #70d6b5, #218467);
}

.pie {
  width: 128px;
  aspect-ratio: 1;
  margin: 0.6rem auto;
  border-radius: 50%;
  background: conic-gradient(var(--positive) 0 48%, #b39c6a 48% 78%, var(--danger) 78% 100%);
}

.legend,
.quotes {
  margin: 0.4rem 0 0;
  padding-left: 1rem;
  color: var(--muted);
}

.legend li,
.quotes li {
  margin-top: 0.35rem;
}

.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 0.35rem;
}

.swatch-positive {
  background: var(--positive);
}

.swatch-neutral {
  background: #b39c6a;
}

.swatch-negative {
  background: var(--danger);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.6rem;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 0.2rem;
}

.trend-bars {
  margin-top: 0.55rem;
  height: 140px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.45rem;
}

.trend-bars div {
  flex: 1;
  text-align: center;
}

.trend-bars i {
  display: block;
  width: 100%;
  height: var(--height);
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, #69d0b2, #188566);
  margin-bottom: 0.35rem;
}

.big-number {
  font-size: 2rem;
  font-weight: 800;
  margin-top: 0.55rem;
}

.micro {
  color: var(--muted);
  font-size: 0.88rem;
}

.progress-track {
  margin-top: 0.7rem;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e8f1ed;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #66d4b2, #2f9f7e);
}

.score-card {
  background: linear-gradient(160deg, #effbf6, #ffffff);
  border-color: #cde8dd;
}

.word-cloud {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  align-items: flex-end;
}

.word-cloud span {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #31534a;
}

.w-xl {
  font-size: 1.42rem;
  font-weight: 800;
}

.w-lg {
  font-size: 1.18rem;
  font-weight: 700;
}

.w-md {
  font-size: 0.98rem;
  font-weight: 700;
}

.w-sm {
  font-size: 0.84rem;
  font-weight: 600;
}

.rankings {
  margin: 0.6rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.rankings li {
  margin-top: 0.3rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 1rem;
}

.mini-stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem;
}

.mini-stat p {
  color: var(--muted);
  font-size: 0.8rem;
}

.mini-stat strong {
  display: inline-block;
  margin-top: 0.2rem;
}

.inline-form {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 24, 19, 0.55);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 9;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(580px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 1rem;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .emotion-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .manager-grid {
    grid-template-columns: 1fr;
  }

  .owner-layout {
    grid-template-columns: 1fr;
  }

  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .brand-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .emotion-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selection-row {
    flex-direction: column;
    align-items: stretch;
  }

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

  .stats-row {
    grid-template-columns: 1fr;
  }
}
