@font-face {
  font-family: Vazirmatn;
  font-weight: 100 900;
  src: url("/static/fonts/Vazirmatn.woff2") format("woff2");
  font-display: swap;
}
:root {
  --green: #6d3e23;
  --dark: #402516;
  --muted: #5f6a63;
  --paper: #f7f5f4;
  --border: #e9e5e2;
  --ink: #3b2b21;
  --accent: #eee2dc;
  --radius: 16px;
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 15px;
  line-height: 1.8;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  border: 0;
  background: none;
  color: inherit;
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 10px 13px;
  color: var(--ink);
  outline: none;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px #6d3e2313;
}
textarea {
  resize: vertical;
  min-height: 90px;
}
label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}
label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 9px;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}
input[type="color"] {
  height: 44px;
  padding: 5px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 29px;
  letter-spacing: -1px;
  font-weight: 750;
}
h2 {
  font-size: 21px;
}
h3 {
  font-size: 16px;
}
small,
.muted {
  color: var(--muted);
}
.subtext {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}
.eyebrow {
  font-size: 12.5px;
  letter-spacing: 1px;
  color: var(--muted);
}
.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background 0.2s,
    transform 0.2s;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn.primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 4px 10px #6d3e2312;
}
.btn.primary:hover {
  background: var(--dark);
}
.btn.outline {
  background: #fff;
  border: 1px solid var(--border);
}
.btn.soft {
  background: var(--accent);
  color: var(--green);
}
.btn.danger {
  color: #b44949;
  background: #fff0ef;
}
.btn:disabled {
  opacity: 0.5;
  cursor: wait;
  transform: none;
}
.btn.sm {
  padding: 6px 12px;
  font-size: 13px;
}
.icon-btn {
  padding: 7px;
  border-radius: 8px;
  line-height: 1;
}
.icon-btn:hover {
  background: #f1eeec;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.between {
  justify-content: space-between;
}
.wrap {
  flex-wrap: wrap;
}
.stack {
  display: grid;
  gap: 17px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
.brand img {
  width: 39px;
  height: 39px;
}
.brand strong {
  font-size: 26px;
  line-height: 1.1;
}
.brand span {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 4px;
}
.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: #fff;
  border-left: 1px solid var(--border);
  padding: 30px 22px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand {
  padding: 3px 10px 38px;
}
.navlabel {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 0 14px;
  margin: 15px 0 9px;
}
.navbtn {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  width: 100%;
  text-align: right;
  margin-bottom: 5px;
  color: var(--muted);
}
.navbtn.active {
  background: #f2ece8;
  color: var(--green);
  font-weight: 600;
}
.navbtn .navcount {
  margin-right: auto;
  min-width: 24px;
  font-size: 12.5px;
  text-align: center;
  border-radius: 6px;
  background: #fff;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 25px;
}
.tip-card {
  background: #f7f2ef;
  border: 1px solid #ece1db;
  border-radius: 13px;
  padding: 17px;
  margin-bottom: 24px;
}
.tip-card p {
  font-size: 12.5px;
  color: var(--muted);
  margin: 8px 0 12px;
}
.tip-card .icon {
  color: #a8785c;
}
.profile {
  border-top: 1px solid var(--border);
  padding: 17px 0 0;
  display: flex;
  gap: 10px;
  align-items: center;
}
.avatar {
  border-radius: 50%;
  height: 34px;
  width: 34px;
  display: grid;
  place-items: center;
  background: #e9dbd3;
  color: var(--dark);
  font-weight: 700;
}
.profile strong {
  font-size: 13px;
  display: block;
}
.profile small {
  font-size: 12px;
}
.profile .icon-btn {
  margin-right: auto;
}
.main {
  min-width: 0;
}
.topbar {
  height: 80px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: #ffffff80;
}
.crumb {
  color: var(--muted);
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.crumb b {
  color: #50443d;
  font-weight: 500;
}
.topmeta {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  gap: 16px;
  align-items: center;
}
.topmeta .dot {
  background: #aa7e65;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.content {
  padding: 35px 40px 60px;
  max-width: 1500px;
  margin: auto;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}
.heading-copy {
  max-width: 640px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 17px;
  margin: 24px 0 31px;
}
.stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 21px 23px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.stat-icon {
  background: #f5efeb;
  color: #90674f;
  border-radius: 11px;
  padding: 12px;
  display: flex;
}
.stat:nth-child(2) .stat-icon {
  background: #f3edea;
  color: #8f5534;
}
.stat:nth-child(3) .stat-icon {
  background: #f9f2e5;
  color: #bf9a55;
}
.stat strong {
  display: block;
  font-size: 29px;
  line-height: 1.3;
  letter-spacing: -1px;
}
.stat span {
  font-size: 13px;
  color: var(--muted);
}
.stat small {
  margin-right: auto;
  font-size: 12px;
}
.sectionbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 20px;
  gap: 15px;
}
.filters {
  display: flex;
  gap: 4px;
  background: #f1ece9;
  padding: 4px;
  border-radius: 9px;
}
.filters button {
  font-size: 13px;
  padding: 5px 14px;
  color: var(--muted);
  border-radius: 6px;
}
.filters button.active {
  background: #fff;
  color: var(--green);
  box-shadow: 0 1px 4px #36282109;
}
.searchbox {
  position: relative;
  max-width: 240px;
}
.searchbox input {
  font-size: 13px;
  padding-right: 38px;
  background: #fff;
}
.searchbox .icon {
  position: absolute;
  right: 12px;
  top: 12px;
  color: #9ca698;
  width: 16px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 19px;
}
.form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 15px;
  overflow: hidden;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}
.form-card:hover {
  box-shadow: 0 8px 28px #3b2a2008;
  transform: translateY(-2px);
}
.card-cover {
  height: 95px;
  padding: 19px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f4efec;
  position: relative;
  overflow: hidden;
}
.card-cover:after {
  content: "";
  position: absolute;
  left: -20px;
  bottom: -80px;
  width: 200px;
  height: 170px;
  border: 1px solid #ffffff9c;
  border-radius: 50%;
  transform: rotate(25deg);
}
.form-card:nth-child(3n + 2) .card-cover {
  background: #f4f0e7;
}
.form-card:nth-child(3n + 3) .card-cover {
  background: #edf0f5;
}
.card-glyph {
  background: #ffffffad;
  border: 1px solid #ffffffa8;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  color: var(--green);
}
.card-cover .badge {
  align-self: flex-start;
  position: relative;
  z-index: 1;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  border-radius: 6px;
  padding: 3px 8px;
  background: #fff9;
  color: var(--muted);
}
.badge.live {
  color: #88573a;
  background: #f3ece8;
}
.badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.card-body {
  padding: 20px 22px;
}
.card-title {
  font-size: 15px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.card-description {
  font-size: 12.5px;
  color: var(--muted);
  height: 22px;
  overflow: hidden;
  margin: 6px 0 18px;
}
.card-metrics {
  display: flex;
  gap: 20px;
  font-size: 12.5px;
  color: var(--muted);
}
.card-metrics b {
  font-weight: 600;
  color: #635147;
}
.card-footer {
  padding: 11px 20px;
  border-top: 1px solid #f1eeec;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-footer .btn {
  font-size: 12.5px;
  padding: 5px 9px;
}
.new-card {
  min-height: 265px;
  border: 1.5px dashed #d8cac2;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #f5efec78;
  padding: 30px;
  gap: 10px;
}
.new-card .plus {
  font-size: 25px;
  line-height: 1;
  width: 43px;
  height: 43px;
  background: #ede3dd;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #9c7056;
  margin-bottom: 7px;
}
.new-card strong {
  font-size: 15px;
  color: #765b4c;
}
.new-card p {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}
.empty {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
  padding: 45px 25px;
}
.empty-mark {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  background: #f3ece8;
  border-radius: 20px;
  color: #936e58;
}
.empty-mark .icon {
  width: 33px;
  height: 33px;
}
.empty p {
  color: var(--muted);
  margin: 7px 0 20px;
  font-size: 14px;
}
.templates {
  margin-top: 36px;
  border-top: 1px solid var(--border);
  padding-top: 25px;
}
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 17px;
  margin-top: 16px;
}
.template {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  background: #ffffff90;
  border-radius: 12px;
  padding: 16px;
  text-align: right;
  transition: border-color 0.2s;
}
.template:hover {
  border-color: #b39787;
}
.template .template-icon {
  color: #947665;
  background: #f3ede9;
  border-radius: 9px;
  padding: 9px;
  display: flex;
}
.template b {
  font-size: 13px;
  display: block;
}
.template small {
  font-size: 12px;
  display: block;
}
.template > .icon {
  margin-right: auto;
  width: 16px;
  color: #aa9a90;
}
.app-footer {
  margin-top: 30px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.builder-head {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.builder-head input {
  font-size: 21px;
  font-weight: 700;
  background: none;
  border: 0;
  padding: 0;
  width: 100%;
  min-width: 180px;
  box-shadow: none;
}
.builder-head .title-field {
  flex: 1;
}
.builder-layout {
  display: grid;
  grid-template-columns: 210px minmax(260px, 1fr) 290px;
  gap: 20px;
  margin-top: 24px;
  align-items: start;
}
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}
.question-list {
  padding: 13px;
}
.question-item {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: right;
  padding: 13px 10px;
  border-radius: 9px;
  margin-bottom: 5px;
  font-size: 13px;
}
.question-item.active {
  background: #f3ece8;
  color: var(--green);
}
.question-item .number {
  border: 1px solid #e6dad4;
  border-radius: 6px;
  padding: 0 7px;
  font-size: 12px;
}
.question-item .question-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.add-types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 15px;
}
.add-types button {
  border: 1px dashed #e2d5ce;
  padding: 10px 3px;
  border-radius: 8px;
  font-size: 12px;
  color: #916d59;
}
.editor {
  min-height: 350px;
}
.editor .field {
  margin-top: 16px;
}
.field-help {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}
.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 13px;
  margin-bottom: 7px;
}
.editor-header span {
  font-size: 13px;
  color: var(--muted);
}
.editor .actions {
  display: flex;
  gap: 4px;
}
.editor input,
.editor select,
.editor textarea {
  font-size: 13px;
}
.tabs {
  display: flex;
  gap: 18px;
  margin-top: 20px;
  border-bottom: 1px solid var(--border);
}
.tabs button {
  padding: 10px 3px;
  color: var(--muted);
  font-size: 13px;
  border-bottom: 2px solid transparent;
}
.tabs button.active {
  border-color: var(--green);
  color: var(--green);
  font-weight: 600;
}
.preview-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 11px;
}
.mini-preview {
  border-radius: 15px;
  min-height: 390px;
  padding: 23px;
  border: 1px solid #e7e1dd;
  background: #f5efec;
  position: sticky;
  top: 25px;
}
.preview-sheet {
  border-radius: 12px;
  background: #fff;
  padding: 20px;
  box-shadow: 0 5px 15px #362a2408;
}
.preview-sheet h3 {
  font-size: 15px;
  margin-bottom: 5px;
}
.preview-sheet p {
  font-size: 12px;
  color: var(--muted);
}
.preview-question {
  margin-top: 22px;
  font-size: 13px;
}
.preview-options {
  margin: 10px 0;
}
.preview-option {
  border: 1px solid var(--border);
  padding: 7px;
  border-radius: 7px;
  margin-top: 6px;
  font-size: 12px;
}
.mini-preview .btn {
  width: 100%;
  margin-top: 16px;
  font-size: 12.5px;
  padding: 8px;
}
.theme-panel,
.settings-panel {
  max-width: 850px;
  margin: 24px auto;
  display: grid;
  gap: 20px;
}
.theme-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 25px;
}
.switch-row {
  padding: 12px 0;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid #f0ece9;
}
.switch-row label {
  margin: 0;
}
.switch-row input[type="checkbox"] {
  flex-shrink: 0;
}
.test-case {
  background: #f7f3f1;
  padding: 12px;
  border-radius: 10px;
  margin-top: 12px;
}
.test-case textarea {
  font-family: Consolas, monospace;
  direction: ltr;
  min-height: 65px;
  font-size: 13px;
}
.code {
  font-family: Consolas, monospace;
  direction: ltr;
  text-align: left;
}
.notice {
  padding: 12px 15px;
  border: 1px solid #f0dcc8;
  border-radius: 9px;
  background: #fdf4ea;
  color: #7a4a26;
  font-size: 12.5px;
  margin: 16px 0;
}
.error {
  padding: 11px 15px;
  background: #fff0ef;
  color: #a84646;
  border-radius: 8px;
  font-size: 13px;
}
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fbf9f8;
}
.auth-art {
  background: #4f3323;
  padding: 65px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.auth-art:before,
.auth-art:after {
  content: "";
  position: absolute;
  border: 1px solid #ffffff16;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  left: -250px;
  bottom: -160px;
}
.auth-art:after {
  width: 360px;
  height: 360px;
  left: -150px;
  bottom: -60px;
}
.auth-art .brand span {
  color: #cdbfb6;
}
.auth-art .brand img {
  width: 46px;
  height: 46px;
}
.auth-art h1 {
  font-size: 44px;
  line-height: 1.65;
  margin: 30px 0 15px;
  max-width: 440px;
  font-weight: 600;
}
.auth-art p {
  color: #d5c6bd;
  max-width: 370px;
  font-size: 15px;
  line-height: 2;
}
.auth-art .auth-badges {
  display: flex;
  gap: 10px;
  margin: 25px 0;
  flex-wrap: wrap;
}
.auth-badges span {
  font-size: 12.5px;
  border: 1px solid #ffffff28;
  padding: 5px 11px;
  border-radius: 20px;
  color: #d9c9c0;
}
.auth-art footer {
  font-size: 12.5px;
  color: #c1afa4;
}
.auth-form-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 50px;
}
.auth-form {
  max-width: 365px;
  width: 100%;
}
.auth-form h2 {
  font-size: 27px;
  margin: 10px 0;
}
.auth-form .field {
  margin-top: 21px;
}
.auth-form .btn {
  width: 100%;
  margin-top: 24px;
}
.auth-toggle {
  font-size: 13px;
  margin-top: 23px;
  text-align: center;
  color: var(--muted);
}
.auth-toggle button {
  color: var(--green);
  font-weight: 600;
}
.auth-form .error {
  margin-top: 16px;
}
.public-page {
  min-height: 100vh;
  background: var(--form-bg, #f7f5f4);
  padding: 30px 20px 65px;
}
.public-top {
  max-width: 850px;
  margin: 0 auto 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.public-top .brand strong {
  font-size: 23px;
}
.public-top .brand img {
  width: 32px;
  height: 32px;
}
.timer {
  font-family: Consolas, monospace;
  direction: ltr;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
}
.respond-card {
  max-width: 650px;
  margin: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 38px 42px;
  box-shadow: 0 12px 45px #49352906;
}
.respond-card .cover-image {
  width: calc(100% + 84px);
  margin: -38px -42px 28px;
  height: 160px;
  object-fit: cover;
  border-radius: 20px 20px 0 0;
}
.form-logo {
  height: 52px;
  max-width: 170px;
  object-fit: contain;
  margin-bottom: 20px;
}
.respond-card h1 {
  font-size: 26px;
  line-height: 1.6;
}
.respond-card .intro {
  color: var(--muted);
  font-size: 15px;
  margin: 13px 0 26px;
  white-space: pre-wrap;
}
.progress-track {
  height: 4px;
  background: #f0ece9;
  border-radius: 4px;
  overflow: hidden;
  margin: 15px 0 30px;
}
.progress-track span {
  height: 100%;
  display: block;
  background: var(--green);
  transition: width 0.25s;
}
.question-title {
  font-size: 21px;
  margin: 10px 0 12px;
  white-space: pre-wrap;
}
.question-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
  white-space: pre-wrap;
}
.answer-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px;
  margin: 9px 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
}
.answer-choice:has(input:checked) {
  border-color: var(--green);
  background: #f6f1ee;
}
.answer-choice input {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}
.rating-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.rating-row button {
  width: 44px;
  height: 45px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--muted);
}
.rating-row button.selected {
  background: var(--green);
  color: #fff;
}
.matrix-wrap {
  overflow-x: auto;
}
.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.matrix th,
.matrix td {
  border-bottom: 1px solid var(--border);
  padding: 12px 10px;
  text-align: center;
}
.matrix th:first-child {
  text-align: right;
}
.matrix input[type="radio"] {
  width: 16px;
  accent-color: var(--green);
}
.respond-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 30px;
}
.powered {
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 28px;
}
.success-mark {
  width: 70px;
  height: 70px;
  background: #f5ede9;
  color: var(--green);
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 15px auto 23px;
}
.success-mark .icon {
  width: 32px;
  height: 32px;
}
.score {
  margin: 22px 0;
  background: #f7f1ed;
  border-radius: 12px;
  padding: 18px;
}
.score strong {
  font-size: 30px;
}
.report-filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 1.2fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 22px;
}
.report-filters label {
  font-size: 12.5px;
}
.report-filters input {
  font-size: 13px;
}
.report-table {
  overflow-x: auto;
}
.report-table table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 13px;
}
.report-table th {
  color: var(--muted);
  font-weight: 500;
  padding: 13px;
  text-align: right;
  background: #f8f4f2;
}
.report-table td {
  border-bottom: 1px solid var(--border);
  padding: 15px 13px;
}
.report-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
  margin-top: 24px;
}
.chart-row {
  display: grid;
  grid-template-columns: 120px 1fr 30px;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  margin-top: 15px;
}
.chart-bar {
  height: 8px;
  background: #f2ece9;
  border-radius: 4px;
  overflow: hidden;
}
.chart-bar span {
  display: block;
  height: 100%;
  background: #a77b61;
  border-radius: 4px;
}
.detail-answer {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.detail-answer b {
  font-size: 14px;
}
.detail-answer p {
  font-size: 13px;
  color: #7b695f;
  white-space: pre-wrap;
  margin-top: 7px;
  word-break: break-word;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: #29191070;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px;
  z-index: 100;
  backdrop-filter: blur(3px);
}
.modal {
  background: #fff;
  border-radius: 18px;
  max-width: 650px;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  padding: 27px;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.modal-header h2 {
  font-size: 19px;
}
.modal .respond-card {
  border: 0;
  box-shadow: none;
  padding: 15px;
}
.modal .cover-image {
  display: none;
}
.share-url {
  direction: ltr;
  font-family: Consolas, monospace;
  font-size: 13px;
}
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 18px;
}
#toast {
  position: fixed;
  left: 30px;
  bottom: 25px;
  background: #4f3323;
  color: #fff;
  border-radius: 11px;
  padding: 12px 20px;
  box-shadow: 0 8px 30px #0002;
  font-size: 13px;
  z-index: 200;
  transform: translateY(120px);
  transition: transform 0.2s;
  max-width: 430px;
}
#toast.show {
  transform: translateY(0);
}
#toast.failure {
  background: #964e45;
}
.loading {
  min-height: 100vh;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--green);
}
.loading span {
  font-size: 14px;
  color: var(--muted);
}
.sr-only {
  position: absolute !important;
  clip: rect(0, 0, 0, 0);
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden;
  white-space: nowrap;
}
.break {
  word-break: break-all;
}
.mobile-brand {
  display: none;
}
.save-indicator {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.unsaved {
  color: #b38a48;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #a87659;
  outline-offset: 3px;
}
.settings-list p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}
.report-select {
  margin-top: 25px;
  max-width: 500px;
}
@media (min-width: 1550px) {
  .content {
    padding-top: 45px;
  }
  .cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1200px) {
  .sidebar {
    padding: 26px 14px;
  }
  .shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .content {
    padding: 28px;
  }
  .topbar {
    padding: 0 28px;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .builder-layout {
    grid-template-columns: 175px minmax(240px, 1fr);
  }
  .mini-preview {
    display: none;
  }
  .theme-layout {
    grid-template-columns: 1fr;
  }
  .report-filters {
    grid-template-columns: 1fr 1fr;
  }
  .template-grid {
    grid-template-columns: 1fr;
  }
  .auth-art {
    padding: 45px;
  }
  .auth-art h1 {
    font-size: 34px;
  }
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 16px 20px;
    border-left: 0;
    border-bottom: 1px solid var(--border);
  }
  .sidebar .brand {
    padding: 0;
  }
  .sidebar .brand span {
    display: none;
  }
  .sidebar .brand img {
    width: 32px;
    height: 32px;
  }
  .sidebar .brand strong {
    font-size: 23px;
  }
  .sidebar nav {
    display: flex;
    gap: 4px;
    margin-top: 15px;
  }
  .navbtn {
    justify-content: center;
    padding: 8px 12px;
    font-size: 12.5px;
    margin: 0;
    width: auto;
    flex: 1;
  }
  .navlabel,
  .sidebar-bottom,
  .navcount {
    display: none !important;
  }
  .topbar {
    height: 56px;
    padding: 0 20px;
  }
  .topmeta span:not(.dot) {
    display: none;
  }
  .content {
    padding: 25px 20px 40px;
  }
  .page-heading {
    align-items: flex-start;
  }
  h1 {
    font-size: 23px;
  }
  .subtext {
    font-size: 12.5px;
  }
  .page-heading > .btn {
    padding: 9px 12px;
    font-size: 12.5px;
  }
  .stats-grid {
    gap: 8px;
    margin: 20px 0;
  }
  .stat {
    padding: 15px 10px;
    display: block;
  }
  .stat-icon {
    display: none;
  }
  .stat strong {
    font-size: 24px;
  }
  .stat span {
    font-size: 12px;
  }
  .stat small {
    display: none;
  }
  .sectionbar {
    flex-wrap: wrap;
  }
  .searchbox {
    max-width: none;
    width: 100%;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .card-cover {
    height: 85px;
  }
  .template-grid {
    grid-template-columns: 1fr;
  }
  .app-footer {
    font-size: 12px;
  }
  .auth-page {
    display: flex;
    flex-direction: column;
  }
  .auth-art {
    padding: 28px 25px;
    min-height: 235px;
  }
  .auth-art h1 {
    font-size: 25px;
    margin: 19px 0 9px;
  }
  .auth-art p {
    font-size: 12.5px;
  }
  .auth-art footer,
  .auth-badges {
    display: none !important;
  }
  .auth-form-wrap {
    padding: 32px 25px;
  }
  .builder-head {
    flex-wrap: wrap;
  }
  .builder-head .title-field {
    flex-basis: 100%;
  }
  .builder-head input {
    font-size: 19px;
  }
  .builder-layout {
    display: flex;
    flex-direction: column;
  }
  .question-list {
    width: 100%;
  }
  .question-list > div:first-child {
    display: flex;
    overflow: auto;
  }
  .question-item {
    min-width: 120px;
    max-width: 180px;
    margin: 0;
    white-space: nowrap;
  }
  .add-types {
    grid-template-columns: repeat(3, 1fr);
  }
  .editor {
    width: 100%;
    padding: 19px;
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .theme-layout {
    display: block;
  }
  .respond-card {
    padding: 28px 24px;
  }
  .respond-card .cover-image {
    width: calc(100% + 48px);
    margin: -28px -24px 22px;
    height: 130px;
  }
  .public-page {
    padding: 20px 15px 45px;
  }
  .public-top {
    margin-bottom: 25px;
  }
  .respond-card h1 {
    font-size: 23px;
  }
  .question-title {
    font-size: 18px;
  }
  .report-charts {
    grid-template-columns: 1fr;
  }
  .report-filters {
    grid-template-columns: 1fr;
  }
  .report-filters .btn {
    width: 100%;
  }
  .modal-overlay {
    padding: 15px;
  }
  .modal {
    padding: 22px 18px;
  }
  .page-heading .row {
    gap: 6px;
  }
  .btn {
    padding: 9px 13px;
  }
  .tabs {
    gap: 22px;
  }
  .switch-row {
    align-items: start;
  }
  .chart-row {
    grid-template-columns: 95px 1fr 25px;
  }
}

/* Image upload, form direction and answering-flow polish */
.image-picker-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.image-thumb {
  width: 120px;
  height: 68px;
  border-radius: 10px;
  border: 1px solid var(--border);
  object-fit: cover;
  background: #f7f4f2;
  flex-shrink: 0;
}
.image-thumb.logo {
  width: 68px;
  object-fit: contain;
  padding: 6px;
  background: #fff;
}
.image-thumb.empty {
  display: grid;
  place-items: center;
  color: #aa988d;
  border-style: dashed;
}
.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.file-btn {
  cursor: pointer;
}
.image-url {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}
.image-url summary {
  cursor: pointer;
  width: fit-content;
}
.image-url .field {
  margin-top: 8px;
}
.mini-preview .cover-image {
  width: 100%;
  height: 70px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
}
.rating-row button {
  flex: 1 1 44px;
  max-width: 64px;
  height: 50px;
  font-size: 15px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.rating-row button:hover {
  border-color: var(--green);
  color: var(--green);
}
.rating-row button.selected:hover {
  color: #fff;
}
.rating-row button:active {
  transform: scale(0.96);
}
.rating-legend {
  margin-top: 8px;
}
.answer-choice {
  transition: border-color 0.15s, background 0.15s;
}
.answer-choice:hover {
  border-color: #cab9af;
}
.matrix th:first-child {
  text-align: start;
}
.respond-actions {
  align-items: center;
  flex-wrap: wrap;
}
.enter-hint {
  font-size: 12.5px;
  color: var(--muted);
  flex-basis: 100%;
}
.respond-card[dir="ltr"] .btn svg {
  transform: scaleX(-1);
}
.respond-card[dir="ltr"] {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif, Vazirmatn;
}
@media (max-width: 760px) {
  .sidebar {
    position: relative;
  }
  .sidebar-bottom {
    display: block !important;
    position: absolute;
    top: 14px;
    left: 20px;
    padding: 0;
    margin: 0;
  }
  .sidebar-bottom .tip-card,
  .sidebar-bottom .profile > div:not(.avatar) {
    display: none;
  }
  .sidebar-bottom .profile {
    border: 0;
    padding: 0;
  }
  .navbtn {
    white-space: nowrap;
    padding: 8px 6px;
    gap: 6px;
  }
  .topbar {
    display: none;
  }
  .rating-row {
    gap: 6px;
  }
  .rating-row button {
    height: 46px;
  }
  .image-thumb {
    width: 96px;
  }
}

/* ==========================================================================
   Sanja design system v2: one set of tokens and components for every page
   ========================================================================== */
:root {
  --green: #6d3a1d;
  --dark: #4b2814;
  --ink: #2e221c;
  --paper: #f6f3f2;
  --border: #e7e2df;
  --accent: #efe8e4;
  --surface: #ffffff;
  --danger: #b03f3f;
  --warning: #9a6a1c;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(44, 30, 22, 0.05);
  --shadow: 0 8px 28px rgba(44, 30, 22, 0.07);
  --focus: 0 0 0 3px rgba(107, 59, 31, 0.25);
}
body {
  font-size: 15px;
  line-height: 1.75;
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1 {
  font-size: 28px;
  letter-spacing: -0.5px;
  line-height: 1.5;
}
h2 {
  font-size: 21px;
  line-height: 1.6;
}
h3 {
  font-size: 16px;
  line-height: 1.7;
}
/* Focus states for keyboard users */
:is(button, a, input, select, textarea, summary):focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
/* Buttons */
.btn {
  min-height: 42px;
  padding: 9px 18px;
  font-size: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.btn.sm {
  min-height: 34px;
  padding: 5px 12px;
  font-size: 13px;
}
.btn.block {
  width: 100%;
}
.btn.primary {
  background: var(--green);
  box-shadow: 0 2px 8px rgba(107, 59, 31, 0.18);
}
.btn.outline {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
}
.btn.outline:hover {
  border-color: #d3cac5;
  background: #fcfbfa;
}
.btn.soft:hover {
  background: #e8ddd7;
}
.btn.danger {
  color: var(--danger);
  background: #fdf0ef;
}
.btn.danger:hover {
  background: #f9e1df;
}
.icon-btn {
  min-width: 36px;
  min-height: 36px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
}
.icon-btn:hover {
  color: var(--ink);
}
/* Form controls */
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
select {
  min-height: 44px;
}
input,
textarea,
select {
  border-radius: var(--radius-sm);
  border-color: var(--border);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:hover,
textarea:hover,
select:hover {
  border-color: #d6cec9;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
  box-shadow: var(--focus);
}
input::placeholder,
textarea::placeholder {
  color: #8a948d;
}
label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.field {
  margin-bottom: 16px;
}
.field-help {
  font-size: 13px;
  line-height: 1.7;
}
.field-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 4px;
}
.field-error:empty {
  display: none;
}
.error {
  font-size: 14px;
}
.notice {
  font-size: 14px;
  line-height: 1.8;
  border-radius: var(--radius-sm);
}
/* Surfaces */
.panel,
.stat,
.form-card,
.empty,
.respond-card {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.panel {
  border-radius: var(--radius);
}
.panel h3 {
  margin-bottom: 6px;
}
.badge {
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}
/* App shell */
.sidebar {
  padding: 26px 18px;
}
.sidebar .brand {
  padding: 3px 10px 30px;
}
.navbtn {
  font-size: 14.5px;
  padding: 11px 14px;
  transition: background 0.15s, color 0.15s;
}
.navbtn:hover:not(.active) {
  background: #f5f2f0;
  color: var(--ink);
}
.navbtn .navcount {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 600;
}
.sidebar-create {
  width: 100%;
  margin-bottom: 18px;
}
.topbar {
  height: 60px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.content {
  padding-top: 30px;
}
.stat strong {
  font-size: 30px;
}
.stat span {
  font-size: 14px;
}
.filters button {
  font-size: 14px;
  padding: 6px 16px;
}
.card-title {
  font-size: 16px;
}
.card-description,
.card-metrics {
  font-size: 13.5px;
}
.card-footer .btn {
  font-size: 13.5px;
}
/* Create-form dialog */
.start-options {
  border: 0;
  padding: 0;
  margin: 6px 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.start-options legend {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  padding: 0;
}
.start-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px;
  margin: 0;
  cursor: pointer;
  font-weight: 400;
  transition: border-color 0.15s, background 0.15s;
}
.start-option:hover {
  border-color: #d2c8c3;
}
.start-option:has(input:checked) {
  border-color: var(--green);
  background: #f7f3f1;
  box-shadow: inset 0 0 0 1px var(--green);
}
.start-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.start-option:has(input:focus-visible) {
  box-shadow: var(--focus);
}
.start-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--green);
  flex-shrink: 0;
}
.start-option b {
  display: block;
  font-size: 14px;
}
.start-option small {
  display: block;
  font-size: 12.5px;
  line-height: 1.6;
}
/* Builder */
.builder-head input {
  font-size: 22px;
  font-weight: 700;
  border: 1px dashed transparent;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  min-height: 0;
  background: transparent;
}
.builder-head input:hover {
  border-color: #d6cec9;
  background: var(--surface);
}
.builder-head input:focus {
  border-style: solid;
  background: var(--surface);
}
.save-indicator {
  font-size: 13px;
}
.save-indicator.unsaved {
  color: var(--warning);
}
.tabs button {
  font-size: 14.5px;
}
.question-item {
  align-items: center;
  font-size: 14px;
}
.q-type-icon {
  display: inline-grid;
  color: var(--muted);
}
.q-type-icon .icon {
  width: 16px;
  height: 16px;
}
.add-types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.add-types-label {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.add-types button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.add-types button:hover {
  border-color: var(--green);
  color: var(--green);
  background: #f9f6f4;
}
.add-types button .icon {
  width: 20px;
  height: 20px;
  color: var(--green);
}
.date-time {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 8px;
}
/* Share dialog */
.share-qr {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.qr-code {
  width: 132px;
  height: 132px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  background: #fff;
}
.qr-code svg {
  width: 100%;
  height: 100%;
  display: block;
}
.share-qr b {
  display: flex;
  align-items: center;
  gap: 6px;
}
.share-qr .btn {
  margin-top: 10px;
}
/* Reports */
.chart-row {
  grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) 44px 34px;
  font-size: 13.5px;
  margin-top: 12px;
}
.chart-row > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chart-row b {
  font-weight: 700;
  text-align: left;
}
.chart-row small {
  color: var(--muted);
  font-size: 12.5px;
}
.chart-bar {
  height: 10px;
  border-radius: 999px;
  background: #f1edea;
}
.chart-bar span {
  background: var(--green);
  border-radius: 999px;
}
.report-table th {
  font-size: 13px;
}
.report-table td {
  font-size: 14px;
}
.report-filters input {
  font-size: 14px;
}
/* Public answering page */
.respond-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.question-title {
  font-size: 22px;
  line-height: 1.7;
}
.question-desc {
  font-size: 14px;
}
.answer-choice {
  font-size: 15px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
}
.respond-card .intro {
  font-size: 15px;
  line-height: 1.9;
}
.respond-card .eyebrow {
  font-size: 13px;
}
.progress-track {
  height: 6px;
  border-radius: 999px;
}
.powered {
  font-size: 13px;
}
.modal h2 {
  font-size: 20px;
}
@media (max-width: 1200px) {
  .add-types {
    grid-template-columns: 1fr;
  }
  .add-types button {
    flex-direction: row;
    justify-content: flex-start;
    padding: 8px 10px;
  }
}
@media (max-width: 760px) {
  .sidebar-create {
    display: none;
  }
  h1 {
    font-size: 24px;
  }
  .start-options {
    grid-template-columns: 1fr;
  }
  .share-qr {
    flex-direction: column;
    text-align: center;
  }
  .share-qr b {
    justify-content: center;
  }
  .chart-row {
    grid-template-columns: minmax(70px, 110px) minmax(0, 1fr) 40px;
  }
  .chart-row small {
    display: none;
  }
  .question-title {
    font-size: 19px;
  }
  .builder-head input {
    font-size: 19px;
  }
  .stat strong {
    font-size: 24px;
  }
  .stat span {
    font-size: 12.5px;
  }
  .navbtn {
    font-size: 13px;
  }
}

.profile-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat > div:not(.stat-icon) {
  min-width: 0;
}
.stat span {
  display: block;
  line-height: 1.5;
}
@media (max-width: 1200px) {
  .stat small {
    display: none;
  }
  .stat {
    padding: 18px;
    gap: 12px;
  }
}

.chart-row {
  grid-template-columns: minmax(56px, 34%) minmax(60px, 1fr) auto auto;
}
@media (max-width: 760px) {
  .chart-row {
    grid-template-columns: minmax(56px, 34%) minmax(60px, 1fr) auto;
  }
}
@media (max-width: 760px) {
  .add-types {
    grid-template-columns: repeat(3, 1fr);
  }
  .add-types button {
    flex-direction: column;
    justify-content: center;
    padding: 8px 2px;
    font-size: 12.5px;
  }
}

.timer.long {
  font-family: inherit;
  letter-spacing: 0;
  direction: inherit;
}

/* Phase 1 components: collapsible editor sections, rules, new question types */
.editor-header span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.editor-header span .icon {
  width: 18px;
  height: 18px;
  color: var(--green);
}
.editor-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 14px;
  background: #fdfcfb;
}
.editor-section summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 15px;
}
.editor-section summary::-webkit-details-marker {
  display: none;
}
.editor-section summary small {
  font-weight: 600;
  font-size: 12px;
  color: var(--green);
  background: var(--accent);
  border-radius: 999px;
  padding: 1px 9px;
}
.editor-section summary .icon {
  margin-right: auto;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform 0.2s;
}
.editor-section[open] summary .icon {
  transform: rotate(180deg);
}
.editor-section-body {
  padding: 4px 16px 16px;
  border-top: 1px solid var(--border);
}
.rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0 10px;
  margin-top: 10px;
}
.jump-rule {
  border: 1px dashed #d8d0cb;
  border-radius: var(--radius-sm);
  padding: 10px 12px 2px;
  margin: 12px 0;
  background: #fff;
}
.pipe-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -6px 0 16px;
}
.pipe-row label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin: 0;
  white-space: nowrap;
}
.pipe-row select {
  min-height: 36px;
  font-size: 13px;
  padding: 4px 10px;
}
.pipe-chip {
  display: inline-block;
  background: var(--accent);
  color: var(--green);
  border-radius: 6px;
  padding: 0 6px;
  font-size: 0.9em;
}
.option-images {
  display: grid;
  gap: 8px;
}
.option-image-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.option-image-row img,
.option-image-row .image-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.option-image-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
/* Respondent widgets */
.answer-select {
  font-size: 15px;
}
.image-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.image-choice {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  margin: 0;
  cursor: pointer;
  font-weight: 500;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.image-choice input {
  position: absolute;
  opacity: 0;
}
.image-choice img,
.image-choice-blank {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 9px;
  background: #f5f2f0;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.image-choice:hover {
  border-color: #cab9af;
}
.image-choice:has(input:checked) {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
  background: #f7f3f1;
}
.image-choice:has(input:focus-visible) {
  box-shadow: var(--focus);
}
.nps-row {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 5px;
}
.nps-row button {
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 15px;
  color: var(--ink);
  transition: background 0.15s, border-color 0.15s;
}
.nps-row button:hover {
  border-color: var(--green);
}
.nps-row button.selected {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.rank-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 8px;
}
.rank-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  background: #fff;
}
.rank-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
}
.rank-label {
  flex: 1;
  font-size: 15px;
}
.rank-list .icon-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.statement-title {
  font-size: 24px;
}
.statement-text {
  font-size: 15px;
  line-height: 2;
  color: var(--ink);
}
.nps-score {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 8px 0 4px;
}
.nps-score strong {
  font-size: 28px;
  color: var(--green);
}
.nps-score span {
  font-size: 13px;
  color: var(--muted);
}
.preview-option img {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: cover;
  vertical-align: middle;
}
@media (max-width: 760px) {
  .nps-row {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .image-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pipe-row {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
}
.option-image-row span.image-thumb.empty {
  width: 48px;
  height: 48px;
  min-height: 0;
}
@media (max-width: 1200px) and (min-width: 761px) {
  .add-types {
    grid-template-columns: 1fr 1fr;
  }
  .add-types button {
    flex-direction: column;
    justify-content: center;
    padding: 8px 2px;
    font-size: 12.5px;
  }
}

/* Phase 2: report tools, comparison tables, recycle bin, print and shared report */
.report-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 16px;
}
.report-actions .btn {
  min-height: 40px;
}
.funnel {
  margin-bottom: 20px;
}
.funnel-numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: center;
}
.funnel-numbers strong {
  display: block;
  font-size: 26px;
  color: var(--green);
  line-height: 1.4;
}
.funnel-numbers span {
  font-size: 13px;
  color: var(--muted);
}
.funnel .subtext {
  margin-top: 12px;
  text-align: center;
}
.table-head {
  margin-bottom: 8px;
}
.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}
.group-table-wrap {
  overflow-x: auto;
  margin-top: 10px;
}
.group-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.group-table th,
.group-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.group-table tbody th {
  text-align: start;
  font-weight: 500;
}
.group-table thead th small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}
.heat {
  display: inline-block;
  min-width: 52px;
  padding: 2px 8px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(107, 59, 31, 0.22) var(--p), transparent var(--p)), #f6f3f2;
  font-weight: 600;
}
.trash-list {
  margin-top: 12px;
}
.sheet-score {
  margin: 10px 0;
  font-size: 15px;
}
.shared-report .respond-card {
  margin-bottom: 20px;
}
.shared-report .report-charts {
  max-width: 760px;
  margin: 0 auto;
}
.shared-report .stats-grid {
  margin: 18px 0 0;
}
#print-root {
  display: none;
}
@media print {
  @page {
    margin: 14mm;
  }
  body {
    background: #fff;
  }
  body.printing > *:not(#print-root) {
    display: none !important;
  }
  body.printing #print-root {
    display: block;
    font-size: 12pt;
  }
  #print-root h1 {
    font-size: 20pt;
    margin-bottom: 6pt;
  }
  #print-root .panel,
  #print-root .detail-answer {
    break-inside: avoid;
    box-shadow: none;
    border-color: #ccc;
  }
  #print-root .report-charts {
    display: block;
  }
  #print-root .report-charts .panel {
    margin-bottom: 10pt;
  }
  #print-root .chart-bar span,
  #print-root .heat {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
@media (max-width: 760px) {
  .funnel-numbers strong {
    font-size: 21px;
  }
  .report-actions {
    width: 100%;
  }
  .report-actions .btn,
  .report-actions select {
    flex: 1 1 auto;
  }
}

.shared-report .stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.shared-report .stat strong {
  font-size: 24px;
}

/* Phase 3: sharing, collaborators, API keys, embed mode */
.slug-row {
  display: flex;
  align-items: center;
  gap: 6px;
  direction: ltr;
}
.slug-row span {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.slug-row input {
  min-height: 38px;
}
#embed-code {
  font-size: 12px;
  margin-bottom: 8px;
}
.members-list {
  margin: 10px 0;
}
.member-add {
  display: flex;
  gap: 8px;
  align-items: center;
}
.member-add input {
  flex: 1;
  min-height: 38px;
}
.member-add select {
  width: auto;
  min-height: 38px;
}
.shared-badge {
  margin-top: 6px;
  background: #eef3fb;
  color: #3b5a8a;
}
.shared-badge .icon {
  width: 13px;
  height: 13px;
}
pre.code {
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: #f6f3f2;
}
body.embed {
  background: transparent;
}
body.embed .public-top,
body.embed .powered {
  display: none;
}
body.embed .public-page {
  padding: 8px;
  min-height: 0;
}
@media (max-width: 760px) {
  .member-add,
  .slug-row {
    flex-wrap: wrap;
  }
}

/* Phase 4: form fonts, theme presets and one-page layout */
@font-face {
  font-family: Shabnam;
  src: url("/static/fonts/Shabnam.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Shabnam;
  src: url("/static/fonts/Shabnam-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: Sahel;
  src: url("/static/fonts/Sahel.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Sahel;
  src: url("/static/fonts/Sahel-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: Samim;
  src: url("/static/fonts/Samim.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Samim;
  src: url("/static/fonts/Samim-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
.respond-card :is(button, input, select, textarea) {
  font-family: inherit;
}
.theme-presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.theme-swatch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 12.5px;
  color: var(--ink);
}
.theme-swatch span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px #fff;
}
.theme-swatch.active {
  border-color: var(--c);
  box-shadow: inset 0 0 0 1px var(--c);
}
.font-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.font-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 0;
  cursor: pointer;
  font-weight: 400;
}
.font-option input {
  position: absolute;
  opacity: 0;
}
.font-option b {
  font-size: 15px;
}
.font-option span {
  font-size: 13px;
  color: var(--muted);
}
.font-option.active,
.font-option:has(input:checked) {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
  background: #f7f3f1;
}
.font-option:has(input:focus-visible) {
  box-shadow: var(--focus);
}
.respond-card.page-mode {
  max-width: 760px;
}
.page-q {
  padding: 22px 0;
  border-top: 1px solid var(--border);
}
.page-q:first-of-type {
  border-top: 0;
}
.page-q .question-title {
  font-size: 18px;
  margin-top: 0;
}
.page-statement .question-title {
  font-size: 21px;
}
.q-error {
  color: var(--danger);
  font-size: 14px;
  margin-top: 8px;
}
.q-error:empty {
  display: none;
}
.page-q:has(.q-error:not(:empty)) {
  border-right: 3px solid var(--danger);
  padding-right: 12px;
}
.start-options {
  max-height: min(56vh, 460px);
  overflow-y: auto;
  padding: 2px;
}
.start-options {
  overflow-x: hidden;
  max-height: min(40vh, 400px);
  min-width: 0; /* a fieldset is as wide as its content unless told otherwise */
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.start-option {
  min-width: 0;
}
.start-option > span:last-child {
  min-width: 0;
}

/* Phase 5: research toolkit and quality flags */
.research-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.research-cta h3,
.research-panel h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.research-panel {
  margin-bottom: 20px;
}
.research-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.research-summary > div {
  background: #f8f5f4;
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.research-summary strong {
  display: block;
  font-size: 24px;
  color: var(--green);
}
.research-summary span {
  font-size: 13px;
  color: var(--muted);
}
.research-note {
  font-size: 14px;
  margin-bottom: 10px;
}
.research-table td,
.research-table th {
  white-space: nowrap;
}
.research-table tbody th {
  white-space: normal;
  min-width: 180px;
}
.weak-item th,
.weak-item td {
  background: #fff6e8;
  font-weight: 700;
}
.flag-badge {
  display: inline-block;
  margin-inline-start: 6px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: #fdecea;
  color: var(--danger);
}
.suspicious-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  align-self: end;
  margin: 0 0 10px;
}
@media (max-width: 760px) {
  .research-cta {
    flex-direction: column;
    align-items: stretch;
  }
}

.import-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--muted);
}
.import-entry .btn {
  margin-inline-start: auto;
}
.import-preview {
  max-height: 46vh;
  overflow-y: auto;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
}

/* Email sign-in and notifications */
.code-input {
  font-size: 22px;
  letter-spacing: 6px;
  text-align: center;
}
.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.sidebar-head .brand {
  flex: 1;
}
.bell {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.bell:hover {
  color: var(--green);
  border-color: #d6ccc6;
}
.bell-count {
  position: absolute;
  top: -6px;
  left: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #c2410c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
}
.note-list {
  display: grid;
  gap: 4px;
  max-height: 60vh;
  overflow-y: auto;
}
.note {
  display: flex;
  gap: 12px;
  text-align: start;
  padding: 12px;
  border-radius: var(--radius-sm);
  width: 100%;
  align-items: flex-start;
}
.note:hover {
  background: #f7f4f3;
}
.note.unread {
  background: #f7f3f0;
}
.note-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--green);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.note-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.note-text b {
  font-size: 14px;
}
.note-text span {
  font-size: 13px;
  color: var(--muted);
}
.note-text small {
  font-size: 12px;
}
.note.unread .note-text b::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c2410c;
  margin-inline-end: 6px;
  vertical-align: middle;
}
.email-box {
  border-top: 1px solid var(--border);
  margin-top: 22px;
  padding-top: 18px;
}
.email-box h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
@media (max-width: 760px) {
  .sidebar-head .bell {
    position: absolute;
    top: 14px;
    left: 64px;
  }
}

.sidebar-head .brand span {
  white-space: nowrap;
}
.sidebar-head .brand {
  padding-inline-end: 4px;
}
.sidebar-head .bell {
  width: 36px;
  height: 36px;
}
.profile-name {
  white-space: nowrap;
  text-align: right;
}
.profile-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12.5px;
}
.bell-count {
  left: auto;
  right: -6px;
}
.sidebar-head {
  gap: 6px;
}

/* ==========================================================================
   Brand v3: «سنجا» = سنجش + سنجاب. Squirrel copper on warm walnut and cream.
   ========================================================================== */
:root {
  --green: #b5541e; /* primary (historic name kept so every component follows) */
  --dark: #8e3f14;
  --walnut: #3a2416;
  --ink: #2b1d14;
  --muted: #6e5f55;
  --paper: #faf6f1;
  --surface: #ffffff;
  --surface-2: #fdfaf6;
  --border: #ebe1d6;
  --accent: #f7e7d7;
  --acorn: #d9a441;
  --danger: #b3261e;
  --warning: #9a6a1c;
  --shadow-sm: 0 1px 2px rgba(58, 36, 22, 0.06);
  --shadow: 0 10px 30px rgba(58, 36, 22, 0.08);
  --focus: 0 0 0 3px rgba(181, 84, 30, 0.28);
  --glass: rgba(255, 255, 255, 0.72);
  color-scheme: light;
}
html[data-theme="dark"] {
  --green: #e0763a;
  --dark: #f08a4f;
  --walnut: #1a120d;
  --ink: #f2e9e1;
  --muted: #b6a79b;
  --paper: #15100c;
  --surface: #1f1813;
  --surface-2: #271e18;
  --border: #3a2e26;
  --accent: #3a2618;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --focus: 0 0 0 3px rgba(224, 118, 58, 0.4);
  --glass: rgba(31, 24, 19, 0.72);
  color-scheme: dark;
}
html[data-theme="dark"] body,
html[data-theme="dark"] :root {
  background: var(--paper);
  color: var(--ink);
}
html[data-theme="dark"] :is(.sidebar, .panel, .stat, .form-card, .empty, .modal, .respond-card, .auth-form-wrap, .stat-chip, .template, .new-card, .note, .menu-item, input, textarea, select, .btn.outline, .filters button.active, .bell, .icon-btn:hover) {
  background-color: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}
html[data-theme="dark"] .topbar {
  background: rgba(21, 16, 12, 0.75);
  border-color: var(--border);
}
html[data-theme="dark"] .card-cover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--card, var(--green)) 30%, #1f1813), #241b15);
}
html[data-theme="dark"] .filters {
  background: var(--surface-2);
}
html[data-theme="dark"] .btn.primary {
  color: #1a120d;
}
html[data-theme="dark"] .btn.soft {
  background: var(--accent);
  color: var(--dark);
}
html[data-theme="dark"] .navbtn.active,
html[data-theme="dark"] .question-item.active {
  background: var(--accent);
  color: var(--dark);
}
html[data-theme="dark"] .notice {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--ink);
}
html[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.6);
}
html[data-theme="dark"] img.form-logo {
  background: #fff;
  border-radius: 8px;
}
body {
  background: var(--paper);
  color: var(--ink);
  transition: background-color 0.2s;
}

/* ---- Sign-in page ---- */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  background: var(--paper);
}
.auth-art {
  position: relative;
  overflow: hidden;
  background: radial-gradient(120% 90% at 85% 10%, #c76a2f 0%, #7a3b17 38%, #3a2416 78%);
  color: #fbeee2;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-art::before {
  content: "";
  position: absolute;
  inset: auto -120px -160px auto;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  border: 1px solid rgba(255, 236, 214, 0.18);
  box-shadow: 0 0 0 60px rgba(255, 236, 214, 0.04), 0 0 0 130px rgba(255, 236, 214, 0.03);
}
.auth-art::after {
  display: none;
}
.auth-art .brand strong {
  color: #fff;
}
.auth-art .brand span {
  color: #f3d3b8;
}
.auth-hero {
  position: relative;
  max-width: 460px;
}
.auth-hero h1 {
  font-size: 46px;
  line-height: 1.35;
  letter-spacing: -1px;
  color: #fff;
  margin-bottom: 18px;
}
.auth-hero h1 em {
  font-style: normal;
  color: #ffc58f;
}
.auth-hero p {
  font-size: 17px;
  line-height: 2;
  color: #f3dccb;
  max-width: 420px;
}
.auth-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 90px;
  margin-top: 36px;
}
.auth-bars span {
  width: 18px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #ffc58f, rgba(255, 197, 143, 0.25));
  animation: grow 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.auth-bars span:nth-child(1) { height: 38%; animation-delay: 0.05s; }
.auth-bars span:nth-child(2) { height: 62%; animation-delay: 0.12s; }
.auth-bars span:nth-child(3) { height: 48%; animation-delay: 0.19s; }
.auth-bars span:nth-child(4) { height: 84%; animation-delay: 0.26s; }
.auth-bars span:nth-child(5) { height: 70%; animation-delay: 0.33s; }
@keyframes grow {
  from { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
  to { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
}
.auth-art footer {
  position: relative;
  font-size: 13px;
  color: #e5c3a7;
}
.auth-form-wrap {
  display: grid;
  place-items: center;
  padding: 40px 24px;
}
.auth-form {
  width: min(400px, 100%);
}
.auth-form h2 {
  font-size: 26px;
  margin: 4px 0 6px;
}
.auth-form .btn.primary {
  width: 100%;
  min-height: 48px;
  font-size: 15px;
  margin-top: 6px;
}
.theme-toggle {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 20;
}

/* ---- Workspace polish: layered glass panels, gentle motion ---- */
.main {
  background:
    radial-gradient(900px 400px at 100% -10%, rgba(181, 84, 30, 0.07), transparent 60%),
    radial-gradient(700px 360px at 0% 0%, rgba(217, 164, 65, 0.07), transparent 60%);
}
.builder-layout .panel,
.theme-panel .panel,
.settings-panel .panel {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  border-color: rgba(235, 225, 214, 0.9);
}
html[data-theme="dark"] :is(.builder-layout .panel, .theme-panel .panel, .settings-panel .panel) {
  border-color: var(--border);
}
.editor-section {
  background: var(--surface-2);
}
.question-item {
  transition: background 0.15s, transform 0.15s;
}
.question-item:hover {
  transform: translateX(-2px);
}
.panel,
.form-card,
.stat-chip,
.respond-card {
  animation: rise 0.35s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---- Forms page ---- */
.page-heading.compact {
  margin-bottom: 18px;
}
.page-heading.compact h1 {
  font-size: 26px;
}
.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.stat-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: start;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.stat-chip:hover {
  border-color: var(--green);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.stat-chip strong {
  font-size: 22px;
  line-height: 1;
}
.stat-chip span:last-child {
  font-size: 13px;
  color: var(--muted);
}
.stat-chip-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--green);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.filters button small {
  font-size: 11px;
  color: var(--muted);
}
.folder-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: -6px 0 16px;
  color: var(--muted);
}
.folder-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--ink);
}
.folder-chip.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.folder-chip .icon {
  width: 15px;
  height: 15px;
}
.folder-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.card-click {
  cursor: pointer;
  display: block;
  outline: none;
}
.card-click:focus-visible {
  box-shadow: var(--focus);
  border-radius: var(--radius);
}
.card-cover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--card, var(--green)) 16%, #fff), color-mix(in srgb, var(--card, var(--green)) 5%, #fff));
  height: 84px;
}
.form-card:nth-child(3n + 2) .card-cover,
.form-card:nth-child(3n + 3) .card-cover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--card, var(--green)) 16%, #fff), color-mix(in srgb, var(--card, var(--green)) 5%, #fff));
}
.card-glyph {
  color: var(--card, var(--green));
}
.form-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.form-card.archived {
  opacity: 0.75;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 12px;
  min-height: 4px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--dark);
}
.tag .icon {
  width: 13px;
  height: 13px;
}
.tag.shared {
  background: #e8eef8;
  color: #36547e;
}
.menu-list {
  display: grid;
  gap: 2px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  text-align: start;
  width: 100%;
}
.menu-item:hover {
  background: var(--accent);
}
.menu-item .icon {
  color: var(--green);
}
.menu-item.danger,
.menu-item.danger .icon {
  color: var(--danger);
}
@media (max-width: 1000px) {
  .auth-page {
    grid-template-columns: 1fr;
  }
  .auth-art {
    padding: 28px 24px;
    min-height: 0;
  }
  .auth-hero h1 {
    font-size: 30px;
  }
  .auth-hero p,
  .auth-bars {
    display: none;
  }
}
@media (max-width: 760px) {
  .stat-strip {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
  }
  .stat-chip {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px;
    gap: 4px;
  }
  .stat-chip-icon {
    display: none;
  }
  .stat-chip strong {
    font-size: 19px;
  }
  .stat-chip span:last-child {
    font-size: 11.5px;
  }
}

/* Account page, reports grid */
.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.account-grid .profile-card,
.account-grid .account-keys {
  grid-column: 1 / -1;
}
.account-grid h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.avatar.xl {
  width: 64px;
  height: 64px;
  font-size: 26px;
  background: linear-gradient(135deg, #e7a26f, var(--green));
  color: #fff;
}
.inline-form {
  display: flex;
  gap: 8px;
}
.kv {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 14px;
}
.kv > span:first-child {
  color: var(--muted);
}
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--accent);
}
.segmented button {
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 14px;
}
.segmented button.active {
  background: var(--surface);
  color: var(--green);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
  color: var(--green);
  margin-bottom: 4px;
}
.back-link .icon {
  width: 16px;
  height: 16px;
  transform: scaleX(-1);
}
.report-count {
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  border-radius: 999px;
  padding: 2px 10px;
}
@media (max-width: 760px) {
  .account-grid {
    grid-template-columns: 1fr;
  }
}

/* Theme gallery with live mock previews */
.theme-presets {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.theme-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.theme-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.theme-card.active {
  border-color: var(--c);
  box-shadow: 0 0 0 2px var(--c);
}
.theme-mock {
  display: grid;
  gap: 5px;
  padding: 8px;
  border-radius: 10px;
  background: var(--bg);
  height: 92px;
  align-content: start;
}
.theme-mock i {
  display: block;
  border-radius: 4px;
}
.mock-bar {
  height: 6px;
  background: var(--c);
  width: 40%;
}
.mock-line {
  height: 5px;
  background: #0002;
  width: 85%;
}
.mock-line.short {
  width: 55%;
}
.mock-option {
  height: 9px;
  background: #fff;
  border: 1px solid #0001;
}
.mock-btn {
  height: 11px;
  width: 38%;
  background: var(--c);
  justify-self: start;
  margin-top: 2px;
}
.theme-name {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

/* Statistics tab */
.report-tabs {
  margin: 4px 0 18px;
}
#report-statistics .panel,
#report-research .panel {
  margin-bottom: 16px;
}
#report-statistics h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin-top: 10px;
}
.stat-table th,
.stat-table td {
  border-bottom: 1px solid var(--border);
  padding: 7px 10px;
  text-align: center;
  white-space: nowrap;
}
.stat-table thead th {
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--muted);
}
.stat-table tbody th {
  text-align: start;
  font-weight: 500;
  white-space: normal;
}
.stat-table td small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.stat-table .muted-row th,
.stat-table .muted-row td {
  color: var(--muted);
}
.desc-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}
.desc-grid div {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 8px;
  text-align: center;
}
.desc-grid span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.desc-grid b {
  font-size: 16px;
}
.corr-table td.corr {
  --pos: calc(max(var(--r), 0) * 65%);
  --neg: calc(max(calc(var(--r) * -1), 0) * 65%);
  background: color-mix(in srgb, #2f6fb0 var(--neg), color-mix(in srgb, #b5541e var(--pos), transparent));
}
.corr-table td.sig {
  font-weight: 700;
}
.corr-table td.diag {
  color: var(--muted);
}
.corr-index {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--accent);
  font-size: 11px;
  margin-inline-end: 4px;
}
.crosstab-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}
.crosstab-pick select {
  flex: 1;
}
.crosstab-test {
  margin-top: 10px;
  font-size: 14px;
}
.scale-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px auto;
  max-width: 360px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: start;
}
.scale-result b {
  font-size: 20px;
  color: var(--green);
}
.scale-result em {
  font-style: normal;
  font-size: 13px;
  background: var(--accent);
  border-radius: 999px;
  padding: 1px 10px;
}
@media (max-width: 760px) {
  .desc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .crosstab-pick {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Scales editor */
.scale-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 12px 0;
  background: var(--surface-2);
}
.scale-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 400;
  margin: 0;
  background: var(--surface);
  cursor: pointer;
}
.check-chip:has(input:checked) {
  border-color: var(--green);
  background: var(--accent);
}
.check-chip input {
  width: 15px;
  height: 15px;
}
.bands {
  display: grid;
  gap: 6px;
}
.band-row {
  display: grid;
  grid-template-columns: 80px auto 80px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}
.band-row input {
  min-height: 38px;
}
.band-row span {
  font-size: 13px;
  color: var(--muted);
}
@media (max-width: 760px) {
  .band-row {
    grid-template-columns: 1fr auto 1fr;
  }
  .band-row input[data-path$="label"] {
    grid-column: 1 / 3;
  }
}

.corr-table tbody th {
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.corr-table td {
  min-width: 52px;
}
.flag-badge.repeat {
  background: #e8eef8;
  color: #36547e;
}

/* ==== Public site, admin dashboard, support and chat ==== */
a.navbtn {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--muted);
  border-radius: 10px;
}
a.navbtn.active {
  background: var(--accent);
  color: var(--green);
  font-weight: 700;
}
.navcount.hot {
  background: var(--green) !important;
  color: #fff;
  border-color: transparent !important;
  margin-inline-start: auto;
  padding: 0 7px;
  font-size: 11px;
}
.center { text-align: center; justify-content: center; }
.btn.ghost { background: transparent; border: 0; }
.danger-text { color: var(--danger) !important; }
.check-row { display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 6px 0 12px; font-size: 14px; }
.check-row input { width: auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 24px; }
.panel.flat { box-shadow: none; }
.panel.narrow { max-width: 640px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.search-box { position: relative; flex: 1 1 220px; max-width: 320px; }
.search-box input { padding-inline-start: 38px; }
.search-box .icon { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--muted); padding: 5px 12px; border-radius: 999px; font-size: 13px; cursor: pointer; }
.chip:hover { color: var(--ink); }
.chip.active { background: var(--green); border-color: var(--green); color: #fff; }

/* ---- Public website ---- */
.site { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }
.site-announcement { background: var(--walnut); color: #fff6ec; text-align: center; padding: 8px 16px; font-size: 13.5px; }
.site-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 12px max(16px, calc((100vw - 1160px) / 2)); background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.site-brand { text-decoration: none; color: inherit; }
.site-nav { display: flex; gap: 4px; flex: 1; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 7px 12px; border-radius: 10px; font-size: 14.5px; transition: background 0.15s, color 0.15s; }
.site-nav a:hover { color: var(--ink); background: var(--accent); }
.site-nav a.active { color: var(--green); font-weight: 700; }
.site-actions { display: flex; align-items: center; gap: 8px; }
.site-actions .btn { text-decoration: none; }
.site-menu-btn { display: none !important; }
.cat-bar { display: block; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.cat-bar i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.cat-edit { display: grid; gap: 8px; margin-bottom: 12px; }
.cat-row { display: grid; grid-template-columns: 140px 1fr auto; gap: 8px; align-items: center; }
.site-main { flex: 1; }
.site-section { max-width: 1160px; margin: 0 auto; padding: 56px 16px; }
.site-section.alt { max-width: none; background: var(--surface-2); border-block: 1px solid var(--border); }
.site-section.alt > * { max-width: 1128px; margin-inline: auto; }
.section-title { text-align: center; font-size: clamp(22px, 3vw, 30px); margin: 0 0 32px; }
.hero { max-width: 1160px; margin: 0 auto; padding: 64px 16px 40px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(36px, 6vw, 62px); line-height: 1.25; margin: 16px 0; letter-spacing: -0.5px; }
.hero h1 em, .page-hero h1 em { font-style: normal; color: var(--green); }
.hero p { font-size: 17px; color: var(--muted); max-width: 540px; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: var(--green); border-radius: 999px; padding: 5px 14px; font-size: 13px; font-weight: 600; }
.pill .icon { width: 15px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 18px; }
.hero-cta .btn { text-decoration: none; padding: 12px 22px; font-size: 15.5px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; margin: 0; color: var(--muted); font-size: 14px; }
.hero-points li { display: flex; align-items: center; gap: 6px; }
.hero-points .icon { width: 16px; color: var(--green); }
.hero-art { position: relative; padding: 24px; }
.hero-art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 70% 30%, color-mix(in srgb, var(--green) 26%, transparent), transparent 60%), radial-gradient(circle at 20% 80%, color-mix(in srgb, var(--acorn, #d9a441) 22%, transparent), transparent 55%); filter: blur(10px); z-index: 0; }
.mock-window { position: relative; z-index: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 30px 60px -20px rgba(58, 36, 22, 0.35); overflow: hidden; transform: rotate(-1.5deg); }
.mock-top { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.mock-top i { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.mock-body { padding: 22px; display: grid; gap: 16px; }
.mock-q { font-weight: 700; }
.mock-scale { display: flex; gap: 8px; }
.mock-scale span { flex: 1; text-align: center; border: 1px solid var(--border); border-radius: 10px; padding: 6px 0; color: var(--muted); font-size: 14px; }
.mock-scale span.on { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.mock-chart { display: flex; align-items: flex-end; gap: 10px; height: 110px; padding: 10px; background: var(--surface-2); border-radius: 12px; }
.mock-chart span { flex: 1; border-radius: 6px 6px 2px 2px; background: linear-gradient(to top, var(--dark), var(--green)); opacity: 0.85; animation: grow 1.2s ease-out both; transform-origin: bottom; }
.mock-chart span:nth-child(2) { animation-delay: 0.1s; } .mock-chart span:nth-child(3) { animation-delay: 0.2s; } .mock-chart span:nth-child(4) { animation-delay: 0.3s; } .mock-chart span:nth-child(5) { animation-delay: 0.4s; }
@keyframes grow { from { transform: scaleY(0.1); } to { transform: scaleY(1); } }
.mock-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.mock-stats b { display: block; font-size: 20px; color: var(--green); }
.mock-stats small { color: var(--muted); font-size: 12px; }
.float-card { position: absolute; z-index: 2; display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 14px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); animation: float 5s ease-in-out infinite; }
.float-card .icon { width: 16px; color: var(--green); }
.float-card.one { top: 4px; inset-inline-start: -6px; }
.float-card.two { bottom: 10px; inset-inline-end: -4px; animation-delay: -2.5s; direction: ltr; }
@keyframes float { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .mock-chart span, .float-card { animation: none; } }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature, .audience, .step { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px; transition: transform 0.2s, box-shadow 0.2s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature h3, .audience h3, .step h3 { margin: 12px 0 6px; font-size: 17px; }
.feature p, .audience p, .step p { margin: 0; color: var(--muted); font-size: 14.5px; }
.feature-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: var(--green); }
.audience-grid, .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.audience-n, .step > span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 800; }
.cta-band { max-width: 1128px; margin: 24px auto 64px; padding: 44px 24px; border-radius: 24px; text-align: center; color: #fff6ec; background: linear-gradient(135deg, var(--walnut), #6b3415 55%, var(--green)); }
html[data-theme="dark"] .cta-band { background: linear-gradient(135deg, #2a1a10, #5a2c12 55%, #a24c1c); }
.cta-band h2 { margin: 0 0 6px; font-size: clamp(22px, 3vw, 30px); }
.cta-band p { opacity: 0.85; margin: 0 0 20px; }
.cta-band .btn { text-decoration: none; background: #fff6ec; color: #6b3415; border-color: #fff6ec; }
.page-hero { text-align: center; padding: 64px 16px 16px; max-width: 760px; margin: 0 auto; }
.page-hero h1 { font-size: clamp(28px, 4.5vw, 42px); margin: 0 0 10px; }
.page-hero p { color: var(--muted); font-size: 16.5px; margin: 0; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 26px; }
.plan.highlight { border: 2px solid var(--green); box-shadow: 0 20px 40px -18px color-mix(in srgb, var(--green) 45%, transparent); }
.plan-badge { position: absolute; top: -13px; inset-inline-start: 22px; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 999px; }
.plan h3 { margin: 0; font-size: 18px; }
.plan-price { margin: 10px 0 16px; display: flex; align-items: baseline; gap: 8px; }
.plan-price b { font-size: 28px; color: var(--green); }
.plan-price small { color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 9px; flex: 1; }
.plan li { display: flex; gap: 8px; font-size: 14.5px; }
.plan li .icon { width: 17px; flex: none; color: var(--green); margin-top: 4px; }
.plan .btn { text-decoration: none; }
.faq { max-width: 780px; margin: 0 auto; display: grid; gap: 10px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0 18px; }
.faq-item summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0; font-weight: 700; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { width: 18px; transition: transform 0.2s; color: var(--muted); flex: none; }
.faq-item[open] summary .icon { transform: rotate(180deg); }
.faq-item p { margin: 0 0 16px; color: var(--muted); }
.prose { max-width: 760px; }
.prose h2 { font-size: 19px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--ink); opacity: 0.9; }
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; max-width: 960px; margin: 0 auto; }
.contact-grid h3 { display: flex; align-items: center; gap: 8px; margin-top: 0; }
#contact-status { margin: 6px 0 10px; color: var(--green); font-weight: 600; }
.site-footer { border-top: 1px solid var(--border); background: var(--surface-2); padding: 40px 16px 20px; }
.site-footer-inner { max-width: 1128px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.site-footer-inner > div { display: flex; flex-direction: column; gap: 6px; }
.site-footer-inner a { color: var(--muted); text-decoration: none; font-size: 14px; }
.site-footer-inner a:hover { color: var(--green); }
.site-copy { text-align: center; color: var(--muted); font-size: 13px; margin: 28px 0 0; }
.auth-art footer a { color: inherit; text-decoration: none; opacity: 0.85; }
.auth-art footer a:hover { opacity: 1; text-decoration: underline; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 36px; gap: 24px; }
  .hero-art { max-width: 460px; width: 100%; margin: 0 auto; }
  .feature-grid, .audience-grid, .steps { grid-template-columns: 1fr 1fr; }
  .site-header { justify-content: space-between; flex-wrap: wrap; }
  .site-menu-btn { display: inline-grid !important; }
  .site-nav { display: none; order: 3; flex-basis: 100%; flex-direction: column; gap: 2px; padding: 8px 0 4px; border-top: 1px solid var(--border); }
  .site-header.open .site-nav { display: flex; }
  .site-nav a { padding: 11px 12px; font-size: 15.5px; }
  .contact-grid, .site-footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .feature-grid, .audience-grid, .steps { grid-template-columns: 1fr; }
  .site-actions .btn.outline { display: none; }
  .site-header { gap: 8px; }
  .site-header .brand span { display: none; }
  .site-actions { gap: 4px; }
  .site-section { padding: 36px 16px; }
}

/* ---- Admin dashboard ---- */
.admin-badge { font-size: 11px; font-weight: 700; color: #fff; background: var(--walnut); border-radius: 999px; padding: 2px 10px; }
html[data-theme="dark"] .admin-badge { background: var(--green); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; text-decoration: none; color: inherit; transition: border-color 0.15s, transform 0.15s; }
a.kpi:hover { border-color: var(--green); transform: translateY(-2px); }
.kpi-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--accent); color: var(--green); }
.kpi small { display: block; color: var(--muted); font-size: 13px; }
.kpi b { display: block; font-size: 24px; line-height: 1.4; }
.kpi span { display: block; color: var(--muted); font-size: 12.5px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.admin-grid h3, .chart-card h3, .panel > h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 16px; }
.metric-rows { display: grid; }
.metric-rows > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.metric-rows > div:last-child { border-bottom: 0; }
.metric-rows span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.mini-chart { width: 100%; height: 120px; margin: 8px 0 2px; display: block; }
.mini-chart rect { fill: var(--green); opacity: 0.85; }
.mini-chart rect:hover { opacity: 1; fill: var(--dark); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 14px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th { text-align: start; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 10px 12px; white-space: nowrap; border-bottom: 1px solid var(--border); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-2); }
.muted-row { opacity: 0.55; }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.user-cell b { display: block; font-size: 14px; }
.user-cell small { display: block; color: var(--muted); font-size: 12px; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; flex: none; }
.dot-online { width: 9px; height: 9px; border-radius: 50%; background: #2f9e44; box-shadow: 0 0 0 3px rgba(47, 158, 68, 0.18); flex: none; }
.tag.danger { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.settings-stack { display: grid; gap: 14px; max-width: 860px; }
.plans-edit { display: grid; gap: 12px; margin-bottom: 12px; }
.plan-edit { border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin: 0; background: var(--surface-2); }

/* ---- Support threads (admin inbox, user page, chat) ---- */
.support-layout { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 14px; align-items: start; }
.support-layout > div:first-child { display: grid; gap: 14px; }
.ticket-list { padding: 6px; display: grid; gap: 2px; max-height: 70vh; overflow-y: auto; }
.ticket-row { display: flex; gap: 10px; align-items: flex-start; text-align: start; width: 100%; padding: 10px; border: 0; border-radius: 12px; background: none; color: inherit; cursor: pointer; text-decoration: none; }
.ticket-row:hover { background: var(--surface-2); }
.ticket-row.active { background: var(--accent); }
.ticket-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.ticket-icon.chat { color: var(--green); }
.ticket-icon .icon { width: 17px; }
.ticket-text { flex: 1; min-width: 0; display: grid; }
.ticket-text b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-text small { color: var(--muted); font-size: 12px; }
.ticket-text span { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { flex: none; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.status-pill.open { background: color-mix(in srgb, var(--acorn, #d9a441) 20%, transparent); color: #8a5a00; border-color: transparent; }
html[data-theme="dark"] .status-pill.open { color: #f2c46b; }
.status-pill.answered { background: color-mix(in srgb, #2f9e44 16%, transparent); color: #2b7a3b; border-color: transparent; }
html[data-theme="dark"] .status-pill.answered { color: #7dd892; }
.ticket-view { min-height: 360px; display: flex; flex-direction: column; }
.thread-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.thread-head h3 { margin: 0; font-size: 17px; }
.thread { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 14px 0; overflow-y: auto; max-height: 56vh; }
.bubble { max-width: 82%; align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px 16px 16px 4px; padding: 9px 14px; }
.bubble.mine { align-self: flex-end; background: var(--green); border-color: var(--green); color: #fff; border-radius: 16px 16px 4px 16px; }
.bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.bubble small { display: block; font-size: 11px; opacity: 0.7; margin-top: 2px; }
.thread-reply { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--border); padding-top: 10px; }
.thread-reply textarea { flex: 1; resize: vertical; min-height: 42px; }
@media (max-width: 860px) {
  .support-layout, .admin-grid, .chart-grid { grid-template-columns: 1fr; }
}

/* ---- Floating chat ---- */
#chat-root { position: fixed; z-index: 60; bottom: 20px; left: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; direction: ltr; }
#chat-root > * { direction: rtl; }
.chat-fab { position: relative; width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--green), var(--dark)); box-shadow: 0 12px 28px -8px color-mix(in srgb, var(--green) 70%, transparent); transition: transform 0.2s; }
.chat-fab:hover { transform: scale(1.06); }
.chat-fab .icon { width: 26px; height: 26px; }
.chat-fab .bell-count { position: absolute; top: -2px; right: -2px; }
.chat-panel { width: min(360px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 120px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 24px 60px -16px rgba(30, 18, 10, 0.45); overflow: hidden; animation: chat-in 0.2s ease-out; }
@keyframes chat-in { from { opacity: 0; transform: translateY(10px); } }
.chat-panel header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; color: #fff6ec; background: linear-gradient(135deg, var(--walnut), #6b3415); }
.chat-panel header .icon-btn { color: #fff6ec; background: transparent; }
.chat-agent { display: flex; align-items: center; gap: 10px; }
.chat-agent img { width: 36px; height: 36px; border-radius: 10px; }
.chat-agent b { display: block; font-size: 14.5px; }
.chat-agent small { display: block; font-size: 11.5px; opacity: 0.8; }
.chat-body { flex: 1; display: flex; flex-direction: column; padding: 12px 14px; overflow: hidden; min-height: 0; }
.chat-body .thread { max-height: none; padding-top: 0; }
.chat-start { display: grid; gap: 8px; }
.chat-start p { margin: 0 0 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; font-size: 14px; }
.chat-wait { font-size: 12px; color: var(--muted); text-align: center; margin: 4px 0 0; }
@media (max-width: 560px) { #chat-root { bottom: 14px; left: 14px; } }
@media print { #chat-root { display: none; } }
body.embed #chat-root { display: none; }

.health { display: flex; gap: 12px; align-items: flex-start; border-radius: 16px; padding: 14px 16px; margin-bottom: 14px; border: 1px solid; }
.health .icon { flex: none; width: 22px; height: 22px; margin-top: 2px; }
.health b { display: block; }
.health span { display: block; font-size: 13.5px; opacity: 0.85; }
.health.good { background: color-mix(in srgb, #2f9e44 10%, var(--surface)); border-color: color-mix(in srgb, #2f9e44 35%, transparent); color: #24733a; }
.health.bad { background: color-mix(in srgb, var(--danger) 9%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); }
html[data-theme="dark"] .health.good { color: #8fdca2; }
html[data-theme="dark"] .health.bad { color: #ff9b94; }
.onboarding { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.onboarding-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.onboarding-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; }
.onboarding-head h2 .icon { color: var(--green); }
.onboarding-head p { margin: 2px 0 0; }
.onboarding-bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 12px 0 14px; }
.onboarding-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green), var(--acorn, #d9a441)); transition: width 0.4s; }
.onboarding-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.onboarding-steps li { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); }
.onboarding-steps li.done { opacity: 0.65; }
.onboarding-steps li.current { border-color: var(--green); background: var(--accent); }
.onboarding-steps b { display: block; font-size: 14px; }
.onboarding-steps small { display: block; color: var(--muted); font-size: 12px; line-height: 1.6; }
.onboarding-steps .btn { align-self: flex-start; text-decoration: none; }
.onboarding-dot { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); font-weight: 700; font-size: 13px; }
.onboarding-dot .icon { width: 16px; }
li.done .onboarding-dot { background: var(--green); border-color: var(--green); color: #fff; }
li.current .onboarding-dot { background: var(--green); border-color: var(--green); color: #fff; }
@media (max-width: 980px) { .onboarding-steps { grid-template-columns: 1fr; } .onboarding-steps li { flex-direction: row; align-items: center; } .onboarding-steps li > div { flex: 1; } }
/* ---- Feedback round: menus, compact spacing, account, preview backdrop, squirrel ---- */
/* The side menu scrolls on short screens instead of hiding its last items. */
.sidebar { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; padding: 18px 14px; }
.sidebar .brand { padding: 2px 8px 18px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.navbtn { padding: 8px 12px !important; font-size: 14px !important; }
.navlabel { margin: 12px 8px 4px !important; }
.sidebar-bottom { margin-top: auto; padding-top: 12px; }
a.navbtn.site-link { color: var(--muted); font-size: 13px !important; border: 1px dashed var(--border); margin-bottom: 6px; }
a.navbtn.site-link:hover { color: var(--green); border-color: var(--green); }
/* Tighter content spacing everywhere. */
.content { padding-top: 20px !important; }
.page-heading { margin-bottom: 16px !important; }
.page-heading h1 { font-size: 24px; }
.panel { padding: 18px; }
.topbar { padding-block: 12px !important; }
@media (min-width: 1200px) { .content { padding-inline: 32px !important; } }

/* Profile picture. */
img.avatar { object-fit: cover; display: block; flex: none; }
.avatar.xl { width: 72px; height: 72px; }
.avatar-edit { position: relative; cursor: pointer; flex: none; }
.avatar-edit:hover .avatar { filter: brightness(0.92); }
.avatar-badge { position: absolute; bottom: -2px; inset-inline-end: -2px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--green); box-shadow: var(--shadow-sm); }
.avatar-badge .icon { width: 14px; height: 14px; }
.avatar-actions { margin-top: 8px; gap: 6px; }
.avatar-actions label.btn { cursor: pointer; }
#profile-form .inline-form { max-width: 360px; }
#profile-form .inline-form input { flex: 1; min-width: 0; }
.setting-list { display: grid; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; }
.setting-row b { display: block; font-size: 14px; }
.setting-row small { display: block; color: var(--muted); font-size: 12.5px; }
.setting-row .btn { flex: none; }
.account-grid h3 .tag { font-size: 11px; font-weight: 600; margin-inline-start: 4px; }
.hide-sm { display: inline; }
@media (max-width: 560px) { .hide-sm { display: none; } }

/* Live preview: the eye is a real button. */
.preview-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.preview-open { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); background: var(--surface); color: var(--green); border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.preview-open:hover { border-color: var(--green); }
.preview-open .icon { width: 14px; height: 14px; }

/* A livelier backdrop behind forms (respondent page and previews), tinted by the form's own colour. */
.public-page, .mini-preview {
  background:
    radial-gradient(circle at 10% 12%, color-mix(in srgb, var(--green) 20%, transparent) 0, transparent 34%),
    radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--green) 12%, transparent) 0, transparent 30%),
    radial-gradient(circle at 85% 88%, color-mix(in srgb, #d9a441 18%, transparent) 0, transparent 36%),
    radial-gradient(circle at 6% 92%, color-mix(in srgb, var(--green) 10%, transparent) 0, transparent 28%),
    radial-gradient(color-mix(in srgb, var(--green) 16%, transparent) 1px, transparent 1.3px) 0 0 / 22px 22px,
    var(--form-bg, #f7f5f4) !important;
  background-attachment: fixed;
}
.mini-preview { background-attachment: scroll; }
body.embed .public-page { background: var(--form-bg, #f7f5f4) !important; }
.respond-card { box-shadow: 0 24px 60px -28px color-mix(in srgb, var(--green) 45%, rgba(0, 0, 0, 0.25)); }

/* About page: the squirrel gathering data into its basket. */
.squirrel-scene { max-width: 600px; margin: 8px auto 0; text-align: center; }
.squirrel-svg { width: 100%; height: auto; overflow: visible; }
.sq-ground { fill: color-mix(in srgb, var(--green) 10%, transparent); }
.sq-seed { font: 800 24px Vazirmatn, Tahoma, sans-serif; fill: var(--green); }
.sq-seed.gold { fill: #d9a441; }
.sq-value { font: 800 15px Vazirmatn, Tahoma, sans-serif; fill: #8e3c14; }
#sq-ring { transition: stroke-dashoffset 0.5s ease; }
#sq-fill { transition: y 0.5s ease; }
.sq-tail { transform-box: view-box; transform-origin: 150px 262px; animation: sq-tail 3.6s ease-in-out infinite; }
@keyframes sq-tail { 50% { transform: rotate(-4deg); } }
.sq-head { transform-box: view-box; transform-origin: 240px 160px; animation: sq-look 5s ease-in-out infinite; }
@keyframes sq-look { 0%, 60%, 100% { transform: rotate(0); } 70%, 85% { transform: rotate(7deg); } }
.sq-eye { transform-box: fill-box; transform-origin: center; animation: sq-blink 4.6s infinite; }
@keyframes sq-blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
.sq-arm { transform-box: view-box; transform-origin: 240px 200px; animation: sq-reach 2.3s ease-in-out infinite; }
@keyframes sq-reach { 50% { transform: rotate(-5deg); } }
.sq-happy .sq-head { animation: sq-hop 0.45s ease-in-out 3; }
@keyframes sq-hop { 50% { transform: translateY(-8px) rotate(-4deg); } }
.squirrel-caption { color: var(--muted); font-size: 14.5px; margin: 6px 0 0; }
@media (prefers-reduced-motion: reduce) { .sq-tail, .sq-head, .sq-eye, .sq-arm { animation: none; } }

/* ---- PDF report (print) ---- */
.pdf { --pdf: #b5541e; color: #2b1d14; font-family: Vazirmatn, Tahoma, sans-serif; direction: rtl; }
.pdf * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pdf-cover { min-height: 255mm; display: flex; flex-direction: column; justify-content: space-between; padding: 14mm 12mm; border-radius: 6mm; color: #fff; background: radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.18), transparent 40%), radial-gradient(circle at 10% 90%, rgba(255, 255, 255, 0.12), transparent 45%), linear-gradient(140deg, color-mix(in srgb, var(--pdf) 70%, #1a0e07), var(--pdf)); break-after: page; page-break-after: always; }
.pdf-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15pt; }
.pdf-brand img { width: 34px; height: 34px; border-radius: 9px; background: #fff; padding: 2px; }
.pdf-eyebrow { font-size: 11pt; letter-spacing: 0.5px; opacity: 0.85; margin-bottom: 6mm; }
.pdf-cover h1 { font-size: 28pt; line-height: 1.35; margin: 0 0 6mm; }
.pdf-lead { font-size: 12pt; opacity: 0.9; max-width: 150mm; line-height: 1.9; }
.pdf-kpis { display: flex; flex-wrap: wrap; gap: 5mm; margin-top: 12mm; }
.pdf-kpis div { background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 4mm; padding: 4mm 6mm; min-width: 34mm; }
.pdf-kpis b { display: block; font-size: 22pt; line-height: 1.2; }
.pdf-kpis span { font-size: 10pt; opacity: 0.9; }
.pdf-cover-foot { font-size: 10pt; opacity: 0.85; }
.pdf-section { margin: 0 0 9mm; }
.pdf-section h2 { font-size: 16pt; margin: 0 0 4mm; padding-bottom: 2mm; border-bottom: 2px solid var(--pdf); color: color-mix(in srgb, var(--pdf) 80%, #000); break-after: avoid; }
.pdf-section h3 { font-size: 12pt; margin: 4mm 0 2mm; break-after: avoid; }
.pdf-highlights { margin: 0; padding-inline-start: 6mm; line-height: 2; font-size: 11pt; }
.pdf-table { width: 100%; border-collapse: collapse; font-size: 10.5pt; }
.pdf-table th { background: color-mix(in srgb, var(--pdf) 12%, #fff); text-align: start; padding: 2mm 3mm; }
.pdf-table td { padding: 2mm 3mm; border-bottom: 1px solid #eadfd5; }
.pdf-big { font-size: 18pt; color: var(--pdf); }
.pdf-muted { color: #7a6a5e; font-size: 10pt; margin: 0 0 2mm; }
.pdf-question { break-inside: avoid; page-break-inside: avoid; border: 1px solid #eee3d9; border-radius: 3mm; padding: 4mm 5mm; margin-bottom: 4mm; }
.pdf-question h3 { display: flex; gap: 3mm; align-items: flex-start; margin: 0 0 1mm; font-size: 11.5pt; line-height: 1.7; }
.pdf-qn { flex: none; display: inline-grid; place-items: center; width: 7mm; height: 7mm; border-radius: 50%; background: var(--pdf); color: #fff; font-size: 9pt; }
.pdf-bars { width: 100%; border-collapse: collapse; font-size: 10pt; margin-top: 2mm; }
.pdf-bars td { padding: 1mm 1.5mm; vertical-align: middle; }
.pdf-bar-label { width: 38%; }
.pdf-bar-cell { width: 44%; }
.pdf-bar { display: block; height: 4mm; border-radius: 2mm; }
.pdf-bar-num { width: 9%; text-align: center; white-space: nowrap; color: #5a4a3e; }
.pdf-desc { margin: 2mm 0 0; font-size: 10pt; color: #5a4a3e; background: #faf6f1; border-radius: 2mm; padding: 2mm 3mm; }
.pdf-end { text-align: center; color: #9b8a7d; font-size: 9pt; margin-top: 8mm; }
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; @bottom-center { content: "سنجا · صفحهٔ " counter(page); font-family: Vazirmatn, Tahoma, sans-serif; font-size: 9pt; color: #9b8a7d; } }
  body.printing #print-root .pdf { font-size: 11pt; }
}


/* ---- Phones: workspace header, question palette, report filters ---- */
.filter-box { margin-bottom: 14px; }
.filter-box > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.filter-box > summary::-webkit-details-marker { display: none; }
.filter-box > summary .icon:last-child { margin-inline-start: auto; transition: transform 0.2s; }
.filter-box[open] > summary { margin-bottom: 10px; }
.filter-box[open] > summary .icon:last-child { transform: rotate(180deg); }
@media (min-width: 761px) { .filter-box > summary { display: none; } }
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: sticky; top: 0; z-index: 40; height: auto; overflow: visible; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px !important; border-left: 0; border-bottom: 1px solid var(--border); background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  .sidebar-head { flex: 1; margin: 0; padding: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
  .sidebar-head .bell { flex: none; width: 34px; height: 34px; margin: 0; position: relative; inset: auto; }
  .sidebar-bottom .profile .icon-btn { width: 34px; height: 34px; margin: 0; }
  .sidebar .brand { padding: 0 !important; }
  .sidebar .brand span { display: none; }
  .sidebar .brand img { width: 30px; height: 30px; }
  .sidebar .brand strong { font-size: 20px; }
  .sidebar nav { order: 2; flex-basis: 100%; flex-direction: row !important; flex-wrap: nowrap; overflow-x: auto; gap: 6px !important; margin: 0; padding-bottom: 2px; scrollbar-width: none; }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .sidebar nav .navbtn { flex: none; width: auto; padding: 6px 12px !important; font-size: 13px !important; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; margin: 0; justify-content: center; }
  .sidebar nav .navbtn .icon { width: 16px; height: 16px; }
  .navlabel { display: none !important; }
  a.navbtn.site-link { border-style: solid; margin: 0 !important; }
  .sidebar-bottom { position: static !important; display: flex !important; order: 1; align-items: center; gap: 4px; margin: 0; padding: 0 !important; border: 0 !important; }
  .sidebar-bottom > .navbtn { padding: 6px 10px !important; font-size: 12px !important; border: 1px solid var(--border); border-radius: 999px; white-space: nowrap; }
  .sidebar-bottom .profile { padding: 0; border: 0; gap: 4px; }
  .sidebar-bottom .profile-name { display: none; }
  .topbar { display: none !important; }
  .main { min-width: 0; padding: 0 !important; margin: 0 !important; }
  .content { padding: 14px 12px 80px !important; margin: 0 !important; width: auto !important; max-width: 100% !important; }
  /* The question palette: four small tiles per row instead of three big ones. */
  .add-types { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 6px !important; }
  .add-types button { padding: 8px 4px !important; font-size: 11.5px !important; min-height: 0 !important; flex-direction: column; gap: 3px; }
  .add-types button .icon { width: 17px; height: 17px; }
  .builder-head .row .btn { flex: 1 1 auto; justify-content: center; }
  .settings-panel, .theme-panel { min-width: 0; grid-template-columns: minmax(0, 1fr); }
  .settings-panel .panel, .theme-panel .panel { min-width: 0; overflow-wrap: anywhere; }
  .settings-panel *, .theme-panel * { max-width: 100%; }
  .data-table { font-size: 12.5px; }
  .report-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .page-heading { flex-direction: column !important; align-items: stretch !important; gap: 10px; }
  .page-heading h1 { font-size: 21px !important; }
  .report-actions { display: grid !important; grid-template-columns: 1fr 1fr; gap: 6px !important; width: 100%; }
  .report-actions > * { width: 100%; justify-content: center; }
}

#toast:not(.show) { visibility: hidden; opacity: 0; transition: transform 0.2s, opacity 0.2s, visibility 0s 0.2s; }
.twofa-qr { display: grid; place-items: center; padding: 12px; background: #fff; border-radius: 14px; border: 1px solid var(--border); width: fit-content; margin: 6px auto 10px; }
.twofa-qr svg { width: 200px; height: 200px; }
.twofa-secret { text-align: center; font-size: 15px; letter-spacing: 1px; user-select: all; }
.backup-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.backup-codes code { text-align: center; font-size: 16px; padding: 8px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); letter-spacing: 1px; }
.setting-row .badge { font-size: 11px; margin-inline-start: 4px; }
/* Icon boxes always centre their icon (a general "span {display:block}" rule used to win). */
.kpi .kpi-icon, .feature-icon, .stat-chip-icon, .ticket-icon, .note-icon, .template-icon, .start-icon, .onboarding-dot, .avatar-badge, .empty-mark { display: grid !important; place-items: center; }
.kpi .kpi-icon .icon, .feature-icon .icon { width: 20px; height: 20px; }
/* Getting-started guide: one slim row instead of five big boxes. */
.onboarding { padding: 12px 16px !important; }
.onboarding-head h2 { font-size: 15px !important; }
.onboarding-head p { font-size: 12.5px; }
.onboarding-bar { margin: 8px 0 10px !important; height: 4px !important; }
.onboarding-steps { align-items: start; }
.onboarding-steps li { padding: 8px 10px !important; gap: 4px !important; flex-direction: row !important; align-items: center; flex-wrap: wrap; }
.onboarding-steps li small { display: none !important; }
.onboarding-steps li.current small { display: block !important; flex-basis: 100%; }
.onboarding-steps b { font-size: 13px !important; }
.onboarding-dot { width: 22px !important; height: 22px !important; font-size: 11px !important; flex: none; }
.onboarding-steps .btn { padding: 4px 10px; font-size: 12px; }
.stat-chip { padding-block: 10px !important; }
.not-found { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; padding: 24px; background: radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--green) 14%, transparent), transparent 40%), var(--paper); }
.not-found h1 { font-size: 72px; margin: 8px 0 0; color: var(--green); line-height: 1; }
.not-found h2 { margin: 6px 0; font-size: 22px; }
.not-found p { color: var(--muted); margin: 0 0 14px; }
.not-found .btn { text-decoration: none; }
.onboarding-next { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: var(--accent); font-size: 13.5px; }
.onboarding-next > span { display: flex; align-items: center; gap: 6px; }
.onboarding-next .icon { width: 16px; color: var(--green); }
.onboarding-next .btn .icon { transform: none; color: inherit; }
.onboarding-steps li.current { background: var(--surface) !important; }
/* ==== generated dark theme ==== */
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: #212121;
}
html[data-theme="dark"] .btn.outline {
  background: #212121;
}
html[data-theme="dark"] .btn.danger {
  background: #2e1816;
}
html[data-theme="dark"] .icon-btn:hover {
  background: #252322;
}
html[data-theme="dark"] .sidebar {
  background: #212121;
}
html[data-theme="dark"] .navbtn.active {
  background: #272320;
}
html[data-theme="dark"] .navbtn .navcount {
  background: #212121;
}
html[data-theme="dark"] .tip-card {
  background: #27221f;
  border: 1px solid #433a36;
}
html[data-theme="dark"] .avatar {
  background: #2b2522;
}
html[data-theme="dark"] .topbar {
  background: #21212180;
}
html[data-theme="dark"] .crumb b {
  color: #c8c1be;
}
html[data-theme="dark"] .stat {
  background: #212121;
}
html[data-theme="dark"] .stat-icon {
  background: #27231f;
  color: #c1b1a7;
}
html[data-theme="dark"] .stat:nth-child(2) .stat-icon {
  background: #272220;
  color: #cdb4a6;
}
html[data-theme="dark"] .stat:nth-child(3) .stat-icon {
  background: #2b261c;
}
html[data-theme="dark"] .filters {
  background: #272321;
}
html[data-theme="dark"] .filters button.active {
  background: #212121;
}
html[data-theme="dark"] .searchbox input {
  background: #212121;
}
html[data-theme="dark"] .form-card {
  background: #212121;
}
html[data-theme="dark"] .card-cover {
  background: #272320;
}
html[data-theme="dark"] .card-cover:after {
  border: 1px solid #3838389c;
}
html[data-theme="dark"] .form-card:nth-child(3n + 2) .card-cover {
  background: #28261f;
}
html[data-theme="dark"] .form-card:nth-child(3n + 3) .card-cover {
  background: #202227;
}
html[data-theme="dark"] .card-glyph {
  background: #212121ad;
  border: 1px solid #383838a8;
}
html[data-theme="dark"] .badge.live {
  color: #cab5a9;
  background: #282320;
}
html[data-theme="dark"] .card-metrics b {
  color: #c4bcb7;
}
html[data-theme="dark"] .card-footer {
  border-top: 1px solid #3e3a37;
}
html[data-theme="dark"] .new-card {
  border: 1.5px dashed #443e3b;
  background: #27221f78;
}
html[data-theme="dark"] .new-card .plus {
  background: #292421;
}
html[data-theme="dark"] .new-card strong {
  color: #c2b7b0;
}
html[data-theme="dark"] .empty {
  background: #212121;
}
html[data-theme="dark"] .empty-mark {
  background: #282320;
}
html[data-theme="dark"] .template {
  background: #21212190;
}
html[data-theme="dark"] .template:hover {
  border-color: #4c4541;
}
html[data-theme="dark"] .template .template-icon {
  background: #272320;
}
html[data-theme="dark"] .panel {
  background: #212121;
}
html[data-theme="dark"] .question-item.active {
  background: #282320;
}
html[data-theme="dark"] .question-item .number {
  border: 1px solid #433b38;
}
html[data-theme="dark"] .add-types button {
  border: 1px dashed #443c38;
}
html[data-theme="dark"] .mini-preview {
  border: 1px solid #403c39;
  background: #27221f;
}
html[data-theme="dark"] .preview-sheet {
  background: #212121;
}
html[data-theme="dark"] .switch-row {
  border-bottom: 1px solid #3f3a37;
}
html[data-theme="dark"] .test-case {
  background: #26221f;
}
html[data-theme="dark"] .notice {
  border: 1px solid #4a3d31;
  background: #2d2319;
  color: #d3bcab;
}
html[data-theme="dark"] .error {
  background: #2e1816;
}
html[data-theme="dark"] .auth-page {
  background: #25211e;
}
html[data-theme="dark"] .auth-art:before,
html[data-theme="dark"] .auth-art:after {
  border: 1px solid #38383816;
}
html[data-theme="dark"] .auth-badges span {
  border: 1px solid #38383828;
}
html[data-theme="dark"] .public-page {
  background: var(--form-bg, #242220);
}
html[data-theme="dark"] .timer {
  background: #212121;
}
html[data-theme="dark"] .respond-card {
  background: #212121;
}
html[data-theme="dark"] .progress-track {
  background: #262422;
}
html[data-theme="dark"] .answer-choice:has(input:checked) {
  background: #27221f;
}
html[data-theme="dark"] .success-mark {
  background: #28221f;
}
html[data-theme="dark"] .score {
  background: #28221e;
}
html[data-theme="dark"] .report-table th {
  background: #26211f;
}
html[data-theme="dark"] .chart-bar {
  background: #272321;
}
html[data-theme="dark"] .detail-answer p {
  color: #bbb4af;
}
html[data-theme="dark"] .modal {
  background: #212121;
}
html[data-theme="dark"] .image-thumb {
  background: #252220;
}
html[data-theme="dark"] .image-thumb.logo {
  background: #212121;
}
html[data-theme="dark"] .answer-choice:hover {
  border-color: #47413d;
}
html[data-theme="dark"] .btn.outline:hover {
  border-color: #433f3d;
  background: #24211e;
}
html[data-theme="dark"] .btn.soft:hover {
  background: #2a2523;
}
html[data-theme="dark"] .btn.danger {
  background: #2c1a19;
}
html[data-theme="dark"] .btn.danger:hover {
  background: #2d1d1b;
}
html[data-theme="dark"] input:hover,
html[data-theme="dark"] textarea:hover,
html[data-theme="dark"] select:hover {
  border-color: #423f3c;
}
html[data-theme="dark"] .navbtn:hover:not(.active) {
  background: #252220;
}
html[data-theme="dark"] .start-option:hover {
  border-color: #433f3d;
}
html[data-theme="dark"] .start-option:has(input:checked) {
  background: #26221f;
}
html[data-theme="dark"] .builder-head input:hover {
  border-color: #423f3c;
}
html[data-theme="dark"] .add-types button:hover {
  background: #26211f;
}
html[data-theme="dark"] .qr-code {
  background: #212121;
}
html[data-theme="dark"] .chart-bar {
  background: #262321;
}
html[data-theme="dark"] .editor-section {
  background: #25211d;
}
html[data-theme="dark"] .jump-rule {
  border: 1px dashed #423e3c;
  background: #212121;
}
html[data-theme="dark"] .image-choice img,
html[data-theme="dark"] .image-choice-blank {
  background: #252220;
}
html[data-theme="dark"] .image-choice:hover {
  border-color: #47413d;
}
html[data-theme="dark"] .image-choice:has(input:checked) {
  background: #26221f;
}
html[data-theme="dark"] .rank-list li {
  background: #212121;
}
html[data-theme="dark"] .heat {
  background: linear-gradient(90deg, rgba(107, 59, 31, 0.22) var(--p), transparent var(--p)), #252220;
}
html[data-theme="dark"] .shared-badge {
  background: #1b212a;
  color: #a8b5ca;
}
html[data-theme="dark"] pre.code {
  background: #252220;
}
html[data-theme="dark"] .font-option.active,
html[data-theme="dark"] .font-option:has(input:checked) {
  background: #26221f;
}
html[data-theme="dark"] .research-summary > div {
  background: #252120;
}
html[data-theme="dark"] .weak-item th,
html[data-theme="dark"] .weak-item td {
  background: #2f2517;
}
html[data-theme="dark"] .flag-badge {
  background: #2d1b19;
}
html[data-theme="dark"] .bell:hover {
  border-color: #433f3c;
}
html[data-theme="dark"] .bell-count {
  border: 2px solid #383838;
}
html[data-theme="dark"] .note:hover {
  background: #252120;
}
html[data-theme="dark"] .note.unread {
  background: #26221f;
}
html[data-theme="dark"][data-theme="dark"] .btn.primary {
  color: #ddd3cc;
}
html[data-theme="dark"][data-theme="dark"] img.form-logo {
  background: #212121;
}
html[data-theme="dark"] .auth-bars span {
  background: linear-gradient(180deg, #3a2a1c, rgba(255, 197, 143, 0.25));
}
html[data-theme="dark"] .card-cover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--card, var(--green)) 16%, #212121), color-mix(in srgb, var(--card, var(--green)) 5%, #212121));
}
html[data-theme="dark"] .form-card:nth-child(3n + 2) .card-cover,
html[data-theme="dark"] .form-card:nth-child(3n + 3) .card-cover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--card, var(--green)) 16%, #212121), color-mix(in srgb, var(--card, var(--green)) 5%, #212121));
}
html[data-theme="dark"] .tag.shared {
  background: #1d222a;
  color: #acb9cc;
}
html[data-theme="dark"] .avatar.xl {
  background: linear-gradient(135deg, #3c2e24, var(--green));
}
html[data-theme="dark"] .mock-option {
  background: #212121;
}
