:root {
  color-scheme: light;
  --bg: #f7fbff;
  --surface: #ffffff;
  --surface-soft: #eef8f4;
  --text: #222b32;
  --muted: #667582;
  --line: #dde8ef;
  --brand: #17a085;
  --brand-strong: #0a6f62;
  --accent: #ff8a5b;
  --sky: #5b8def;
  --mint: #42bf8f;
  --sun: #f3b83f;
  --coral: #ff735c;
  --danger: #d95757;
  --shadow: 0 14px 36px rgba(28, 58, 84, 0.1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(255, 138, 91, 0.16) 0 12%, transparent 12% 100%),
    linear-gradient(215deg, rgba(91, 141, 239, 0.15) 0 18%, transparent 18% 100%),
    linear-gradient(180deg, #fff9ec 0%, #edf9ff 48%, #f7fbff 100%);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  background: transparent;
  padding: 18px 16px calc(92px + env(safe-area-inset-bottom));
}

.topbar,
.page-head,
.primary-page-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar {
  justify-content: flex-start;
  margin-bottom: 14px;
}

.topbar h1,
.page-head h2,
.primary-page-head h2,
.section-head h2,
.section-block h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 26px;
  color: var(--brand-strong);
}

.topbar[hidden] {
  display: none;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 13px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.icon-button:active,
.feature-card:active,
.primary-button:active,
.small-button:active,
.round-action:active,
.bottom-nav button:active {
  transform: scale(0.96);
}

.welcome-panel {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  overflow: hidden;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.58)),
    linear-gradient(135deg, rgba(255, 115, 92, 0.26), rgba(66, 191, 143, 0.18) 48%, rgba(91, 141, 239, 0.22));
  box-shadow: var(--shadow);
}

.welcome-panel::after {
  content: "";
  position: absolute;
  right: -26px;
  bottom: -22px;
  width: 128px;
  height: 72px;
  border-radius: 8px;
  background: repeating-linear-gradient(
    -35deg,
    rgba(255, 255, 255, 0.48) 0 8px,
    rgba(255, 255, 255, 0.12) 8px 16px
  );
  transform: rotate(-8deg);
}

.welcome-copy {
  position: relative;
  z-index: 1;
}

.welcome-copy h2 {
  max-width: 280px;
  margin: 4px 0 14px;
  font-size: 24px;
  line-height: 1.18;
  letter-spacing: 0;
}

.welcome-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.welcome-pills span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
}

.mood-meter {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  align-content: center;
}

.mood-meter i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--coral);
  box-shadow: 0 8px 18px rgba(35, 60, 80, 0.1);
  animation: floatUp 3.6s ease-in-out infinite;
}

.mood-meter i:nth-child(2) {
  color: var(--sky);
  animation-delay: 0.45s;
}

.mood-meter i:nth-child(3) {
  color: var(--mint);
  animation-delay: 0.9s;
}

.privacy-strip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 72%, #ffffff);
  color: var(--brand-strong);
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 8px 20px rgba(28, 58, 84, 0.06);
}

.quick-grid,
.tool-grid,
.stats-grid {
  display: grid;
  gap: 12px;
}

.quick-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 16px 0;
}

.feature-card,
.tool-card,
.section-block,
.panel-form,
.ticket,
.post,
.admin-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.feature-card {
  position: relative;
  overflow: hidden;
  min-height: 124px;
  padding: 16px;
  text-align: left;
  color: var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card::before,
.tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--tone-soft), transparent 68%);
  pointer-events: none;
}

.feature-card > *,
.tool-card > * {
  position: relative;
  z-index: 1;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(28, 58, 84, 0.14);
}

.feature-card i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 8px;
  background: var(--tone-soft);
  color: var(--tone);
  font-size: 18px;
}

.feature-card span {
  display: block;
  font-weight: 700;
}

.feature-card small {
  color: var(--muted);
}

.feature-card b {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--tone);
  color: #fff;
  font-size: 12px;
}

.feature-card b i {
  width: auto;
  height: auto;
  margin: 0;
  display: block;
  background: transparent;
  color: inherit;
  font-size: 12px;
}

.tone-coral {
  --tone: var(--coral);
  --tone-soft: rgba(255, 115, 92, 0.17);
}

.tone-sky {
  --tone: var(--sky);
  --tone-soft: rgba(91, 141, 239, 0.17);
}

.tone-mint {
  --tone: var(--mint);
  --tone-soft: rgba(66, 191, 143, 0.17);
}

.tone-sun {
  --tone: var(--sun);
  --tone-soft: rgba(243, 184, 63, 0.22);
}

.section-block {
  margin-top: 14px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78)),
    var(--surface);
}

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

.section-head h2,
.section-block h2 {
  font-size: 18px;
}

.text-action {
  border: 0;
  background: transparent;
  color: var(--coral);
  font-weight: 700;
}

.post-list,
.ticket-list,
.admin-list {
  display: grid;
  gap: 10px;
}

.post,
.ticket,
.admin-row {
  position: relative;
  overflow: hidden;
  padding: 12px;
  box-shadow: none;
  border-left: 4px solid var(--brand);
}

.post::before,
.ticket::before,
.admin-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--item-soft, rgba(23, 160, 133, 0.07)), transparent 42%);
  pointer-events: none;
}

.post p,
.ticket p,
.admin-row p {
  position: relative;
  margin: 10px 0;
  line-height: 1.55;
}

.mood-stress,
.status-running {
  border-left-color: var(--sun);
  --item-soft: rgba(243, 184, 63, 0.14);
}

.mood-soft,
.status-replied {
  border-left-color: var(--sky);
  --item-soft: rgba(91, 141, 239, 0.12);
}

.mood-sky,
.status-waiting {
  border-left-color: var(--coral);
  --item-soft: rgba(255, 115, 92, 0.12);
}

.mood-happy,
.status-done {
  border-left-color: var(--mint);
  --item-soft: rgba(66, 191, 143, 0.13);
}

.mood-coral {
  border-left-color: var(--danger);
  --item-soft: rgba(217, 87, 87, 0.12);
}

.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft) 82%, #ffffff);
  color: var(--brand-strong);
  font-size: 12px;
  white-space: nowrap;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.primary-page-head {
  justify-content: space-between;
  min-height: 64px;
  margin-bottom: 10px;
}

.primary-page-head h2 {
  font-size: 26px;
}

.primary-page-head .eyebrow {
  margin-bottom: 4px;
}

.round-action {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  box-shadow: 0 10px 24px rgba(255, 115, 92, 0.28);
  transition: transform 0.16s ease;
}

.round-action.tone-sky {
  background: var(--sky);
  box-shadow: 0 10px 24px rgba(91, 141, 239, 0.28);
}

.page-head {
  margin-bottom: 14px;
}

.page-head h2 {
  font-size: 22px;
}

.panel-form {
  display: grid;
  gap: 14px;
  padding: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.8)),
    var(--surface);
}

label,
.field-group {
  display: grid;
  gap: 8px;
}

label span,
.field-group > span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

textarea,
select,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: color-mix(in srgb, var(--surface) 88%, #ffffff);
  color: var(--text);
  outline: none;
}

textarea:focus,
select:focus,
input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(23, 160, 133, 0.12);
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.segmented button,
.small-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
}

.chip.active,
.segmented button.active {
  border-color: var(--brand);
  background: linear-gradient(135deg, rgba(23, 160, 133, 0.16), rgba(243, 184, 63, 0.16));
  color: var(--brand-strong);
  font-weight: 700;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 2px;
}

.switch-row input {
  width: 42px;
  height: 24px;
  padding: 0;
  accent-color: var(--brand);
}

.primary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
}

.primary-button {
  background: linear-gradient(135deg, var(--brand), var(--sky));
  box-shadow: 0 12px 26px rgba(23, 160, 133, 0.22);
}

.danger-button {
  width: 100%;
  margin-top: 14px;
  background: var(--danger);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.segmented button {
  height: 42px;
}

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

.tool-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
}

.tool-card i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--tone-soft);
  color: var(--tone);
  font-size: 24px;
}

.tool-card h3 {
  margin: 10px 0 6px;
}

.tool-card p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.5;
}

.small-button {
  height: 38px;
  padding: 0 16px;
  color: var(--tone, var(--brand-strong));
  font-weight: 700;
}

#playAudio {
  background: transparent;
}

#playAudio i {
  width: auto;
  height: auto;
  display: inline;
  background: transparent;
  color: inherit;
  font-size: 13px;
}

.guide-list {
  display: grid;
  gap: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.guide-list p {
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 66%, transparent);
}

.guide-list i {
  color: var(--brand);
}

.stats-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 14px;
}

.progress-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.progress-summary span {
  display: grid;
  min-height: 72px;
  place-items: center;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  box-shadow: var(--shadow);
}

.progress-summary strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1.2;
}

.stats-grid div {
  min-height: 86px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--surface-soft) 52%, var(--surface)));
  box-shadow: var(--shadow);
}

.stats-grid strong {
  font-size: 22px;
}

.stats-grid span {
  color: var(--muted);
  font-size: 12px;
}

.assessment-intro {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(243, 184, 63, 0.18), rgba(255, 115, 92, 0.1));
  box-shadow: var(--shadow);
}

.assessment-intro > i {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--coral);
  font-size: 21px;
}

.assessment-intro h3,
.assessment-intro p {
  margin: 0;
}

.assessment-intro h3 {
  margin-bottom: 4px;
}

.assessment-intro p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.assessment-form {
  display: grid;
  gap: 12px;
}

.assessment-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.assessment-form legend {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  padding: 0;
  color: var(--text);
  font-weight: 700;
  line-height: 1.55;
}

.assessment-form legend b {
  width: 26px;
  height: 26px;
  display: grid;
  flex: 0 0 26px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--sun) 24%, var(--surface));
  color: var(--accent);
  font-size: 13px;
}

.answer-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 13px;
}

.answer-options label {
  position: relative;
  display: block;
  min-width: 0;
}

.answer-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  opacity: 0;
}

.answer-options span {
  min-height: 40px;
  display: grid;
  place-items: center;
  padding: 7px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 42%, var(--surface));
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.answer-options input:checked + span {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 15%, var(--surface));
  color: var(--brand-strong);
  font-weight: 800;
}

.assessment-result {
  padding: 28px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.assessment-result[hidden] {
  display: none;
}

.result-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto 15px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--mint) 20%, var(--surface));
  color: var(--mint);
  font-size: 34px;
}

.assessment-result.result-medium .result-icon {
  background: color-mix(in srgb, var(--sun) 22%, var(--surface));
  color: var(--sun);
}

.assessment-result.result-care .result-icon {
  background: color-mix(in srgb, var(--coral) 18%, var(--surface));
  color: var(--coral);
}

.assessment-result h3 {
  margin: 4px 0 10px;
  font-size: 25px;
}

.assessment-result > p:not(.eyebrow) {
  margin: 0 auto 20px;
  max-width: 340px;
  color: var(--muted);
  line-height: 1.7;
}

.admin-login {
  max-width: 410px;
  margin: 24px auto 0;
  padding: 26px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.82)),
    var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.admin-login-mark {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--sky));
  color: #fff;
  font-size: 26px;
  box-shadow: 0 12px 28px rgba(23, 160, 133, 0.24);
}

.admin-login h2 {
  margin: 4px 0 8px;
  font-size: 24px;
}

.admin-login > p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.admin-login form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  text-align: left;
}

.input-with-icon {
  position: relative;
}

.input-with-icon > i {
  position: absolute;
  top: 50%;
  left: 13px;
  color: var(--muted);
  transform: translateY(-50%);
}

.input-with-icon input {
  padding-left: 38px;
}

.login-error {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--danger);
  font-size: 13px;
  text-align: center;
}

.admin-dashboard[hidden],
.admin-login[hidden] {
  display: none;
}

.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 10px;
}

.admin-section-head h3 {
  margin: 0;
  font-size: 18px;
}

.admin-section-head > span {
  color: var(--muted);
  font-size: 13px;
}

.admin-section-head select {
  width: auto;
  min-width: 118px;
  padding: 8px 30px 8px 10px;
}

.admin-expectation {
  position: relative;
  display: block;
  color: var(--muted);
  line-height: 1.5;
}

.admin-controls {
  position: relative;
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.admin-controls select {
  padding: 9px 10px;
}

.admin-controls textarea {
  min-height: 72px;
  resize: vertical;
}

.admin-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-actions .small-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--brand-strong);
}

.icon-danger {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  color: var(--danger);
}

.moderation-ok {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 700;
}

.official-reply {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--sky) 10%, var(--surface));
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.official-reply i {
  margin-top: 2px;
  color: var(--sky);
}

.bottom-nav {
  position: fixed;
  z-index: 4;
  left: 50%;
  bottom: 0;
  width: min(100%, 480px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 22px calc(8px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 -12px 30px rgba(28, 58, 84, 0.08);
  backdrop-filter: blur(14px);
}

.bottom-nav button {
  height: 54px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.bottom-nav button i {
  font-size: 18px;
}

.bottom-nav button.active {
  background: linear-gradient(135deg, rgba(23, 160, 133, 0.15), rgba(91, 141, 239, 0.14));
  color: var(--brand-strong);
  font-weight: 800;
}

.home-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-overview button {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: left;
  box-shadow: var(--shadow);
}

.home-overview i {
  color: var(--brand);
  font-size: 18px;
}

.home-overview span {
  display: grid;
  font-size: 12px;
}

.home-overview strong {
  color: var(--text);
  font-size: 18px;
}

.filter-bar {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin: 4px -16px 0;
  padding: 6px 16px 8px;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-bar button {
  min-width: 58px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}

.filter-bar button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px;
  gap: 8px;
  margin-bottom: 12px;
}

.search-row input,
.search-row select {
  height: 44px;
}

.search-row .input-with-icon input {
  padding-left: 38px;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.upload-field {
  position: relative;
}

.upload-field > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-button {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed color-mix(in srgb, var(--brand) 55%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 50%, var(--surface));
  color: var(--brand-strong) !important;
}

.image-preview {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.image-preview[hidden] {
  display: none;
}

.image-preview img {
  width: 100%;
  max-height: 260px;
  display: block;
  object-fit: cover;
}

.image-preview button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(22, 29, 34, 0.75);
  color: #fff;
}

.post-open,
.ticket-open {
  width: 100%;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.post-image {
  width: 100%;
  max-height: 260px;
  display: block;
  margin-top: 10px;
  border-radius: 8px;
  object-fit: cover;
}

.post-actions {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.post-actions button {
  min-width: 48px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
}

.post-actions button.active {
  color: var(--coral);
}

.post-actions button:disabled {
  opacity: 0.45;
  cursor: default;
}

.empty-state {
  min-height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.empty-state i {
  font-size: 26px;
}

.empty-state p {
  margin: 0;
}

.audio-player {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 42px;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.breathing-player {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 12px 0;
  padding: 22px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(91, 141, 239, 0.12), rgba(66, 191, 143, 0.12)),
    var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.breathing-player[hidden] {
  display: none;
}

.breathing-orbit {
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--sky) 44%, var(--line));
}

.breathing-circle {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--sky), var(--mint));
  color: #fff;
  box-shadow: 0 14px 34px rgba(91, 141, 239, 0.25);
  transition: transform 1s ease, background 0.3s ease;
}

.breathing-circle.inhale {
  transform: scale(1.45);
  transition-duration: 4s;
}

.breathing-circle.hold {
  transform: scale(1.45);
}

.breathing-circle.exhale {
  transform: scale(1);
  transition-duration: 5s;
}

.breathing-circle strong,
.breathing-circle span {
  display: block;
}

.breathing-circle strong {
  font-size: 17px;
}

.breathing-circle span {
  font-size: 13px;
  opacity: 0.86;
}

.breathing-player p {
  margin: 0;
  color: var(--muted);
}

.audio-player[hidden] {
  display: none;
}

.audio-player > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.audio-player > div > div {
  display: grid;
}

.audio-player small {
  color: var(--muted);
}

.audio-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--sky) 16%, var(--surface));
  color: var(--sky);
}

.audio-player label {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
}

.audio-player input[type="range"] {
  height: 22px;
  padding: 0;
  accent-color: var(--sky);
}

.assessment-history {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.assessment-history .section-head > span {
  color: var(--muted);
  font-size: 13px;
}

.history-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.history-row > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--brand);
}

.history-row > span.result-medium {
  color: var(--sun);
}

.history-row > span.result-care {
  color: var(--coral);
}

.history-row > div {
  display: grid;
}

.history-row small {
  color: var(--muted);
}

.history-row > b {
  color: var(--muted);
  font-size: 13px;
}

.data-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.data-tools .small-button {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
  text-align: center;
}

.data-tools label {
  position: relative;
}

.data-tools input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.danger-text {
  color: var(--danger) !important;
}

.admin-contact {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--brand-strong);
}

.detail-dialog {
  width: min(calc(100% - 24px), 460px);
  max-height: min(84vh, 760px);
  overflow-y: auto;
  padding: 22px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 26px 80px rgba(20, 36, 48, 0.28);
}

.detail-dialog::backdrop {
  background: rgba(14, 24, 31, 0.48);
  backdrop-filter: blur(3px);
}

.dialog-close {
  position: sticky;
  z-index: 2;
  top: 0;
  float: right;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
}

.dialog-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 38px;
}

.dialog-heading h2,
.dialog-heading p {
  margin: 0;
}

.dialog-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--coral) 16%, var(--surface));
  color: var(--coral);
}

.dialog-avatar.tone-sky {
  background: color-mix(in srgb, var(--sky) 16%, var(--surface));
  color: var(--sky);
}

.dialog-body {
  margin: 18px 0;
  font-size: 16px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.dialog-image {
  width: 100%;
  max-height: 340px;
  border-radius: 8px;
  object-fit: cover;
}

.dialog-stats {
  display: flex;
  gap: 16px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
}

.dialog-stats i {
  margin-right: 5px;
}

.comment-list,
.message-thread,
.timeline {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.comment-list article {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 9px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.comment-list article > i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand);
}

.comment-list p,
.comment-list small {
  margin: 0;
}

.comment-list small {
  color: var(--muted);
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  margin-top: 14px;
}

.inline-form button {
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
}

.inline-form.multiline {
  align-items: stretch;
}

.inline-form.multiline textarea {
  min-height: 68px;
}

.closed-note {
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.closed-note i {
  margin-right: 6px;
}

.large-badge {
  margin: 16px 0 4px;
  font-size: 13px;
}

.detail-group {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.detail-group p {
  margin: 6px 0 0;
  line-height: 1.6;
}

.timeline h3,
.message-thread h3 {
  margin: 0 0 2px;
  font-size: 16px;
}

.timeline > div {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
}

.timeline > div > i {
  margin-top: 4px;
  color: var(--brand);
}

.timeline span {
  display: grid;
}

.timeline small {
  color: var(--muted);
}

.message-thread article {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 8px;
}

.message-thread article p {
  margin: 5px 0;
  line-height: 1.55;
}

.message-thread article small {
  color: var(--muted);
}

.admin-message {
  background: color-mix(in srgb, var(--sky) 12%, var(--surface));
}

.employee-message {
  justify-self: end;
  background: color-mix(in srgb, var(--mint) 14%, var(--surface));
}

.muted-copy {
  color: var(--muted);
  line-height: 1.6;
}

.support-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.support-list > * {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
}

.support-list > * > i {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand);
}

.support-list span {
  display: grid;
}

.support-list small {
  color: var(--muted);
}

.support-list b {
  color: var(--brand-strong);
  font-size: 12px;
}

body.detail-view .bottom-nav {
  display: none;
}

body.detail-view .app-shell {
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(18px);
  max-width: min(88vw, 420px);
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(32, 38, 35, 0.92);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: 0.22s ease;
  z-index: 5;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

body.detail-view .toast {
  bottom: calc(24px + env(safe-area-inset-bottom));
}

body.dark {
  color-scheme: dark;
  --bg: #101820;
  --surface: #17222c;
  --surface-soft: #203342;
  --text: #edf7fb;
  --muted: #a7b9c4;
  --line: #304656;
  --brand: #55d0b0;
  --brand-strong: #9be6d2;
  --accent: #ff9f73;
  --sky: #81a8ff;
  --mint: #62d8a7;
  --sun: #ffd36a;
  --coral: #ff8d7a;
  --danger: #ef6d73;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

body.dark {
  background:
    linear-gradient(135deg, rgba(255, 141, 122, 0.12) 0 12%, transparent 12% 100%),
    linear-gradient(215deg, rgba(129, 168, 255, 0.12) 0 18%, transparent 18% 100%),
    linear-gradient(180deg, #101820 0%, #142531 58%, #101820 100%);
}

body.dark .welcome-panel,
body.dark .section-block,
body.dark .panel-form,
body.dark .admin-login {
  border-color: rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(145deg, rgba(23, 34, 44, 0.92), rgba(23, 34, 44, 0.72)),
    linear-gradient(135deg, rgba(255, 141, 122, 0.22), rgba(85, 208, 176, 0.12), rgba(129, 168, 255, 0.18));
}

@keyframes floatUp {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

@media (min-width: 420px) {
  .two-col {
    grid-template-columns: 1fr 140px;
  }

  .tool-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
