:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #202522;
  --muted: #6a746e;
  --line: #dfe4de;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --warn: #b45309;
  --bad: #b91c1c;
  --good: #15803d;
  --soft: #e9f3f1;
  --shadow: 0 18px 42px rgba(24, 35, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

#app {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  min-height: 100vh;
  overflow: auto;
  padding: 24px 18px;
  background: #17211d;
  color: #f8faf8;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #f59e0b;
  color: #111827;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 4px;
  color: #becac4;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: #d8e1dd;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.nav-plus {
  display: none;
}

.account {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.account-name {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #f59e0b;
  color: #17211d;
  font-weight: 800;
}

.avatar-v {
  position: absolute;
  right: -3px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--good);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.avatar.small .avatar-v {
  right: -2px;
  bottom: -1px;
  width: 17px;
  height: 17px;
  font-size: 10px;
}

.main {
  min-width: 0;
  padding: 28px 34px 42px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.main.hide-page-header .topbar {
  display: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.2;
}

h2 {
  font-size: 22px;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.view {
  display: grid;
  gap: 18px;
}

.guest-guide-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 33, 29, 0.28);
  backdrop-filter: blur(2px);
}

.guest-guide-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  width: min(980px, 92vw);
  min-height: 70vh;
  max-height: 84vh;
  overflow: auto;
  padding: 30px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(8, 13, 11, 0.28);
}

.guide-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.guide-title {
  max-width: 760px;
}

.guide-title h2 {
  margin-bottom: 12px;
  padding-right: 36px;
  font-size: 34px;
  line-height: 1.18;
}

.guide-title p {
  color: #39423d;
  font-size: 16px;
  line-height: 1.7;
}

.guide-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.guide-card-grid article {
  min-height: 138px;
  padding: 18px;
  background: var(--soft);
  border: 1px solid #d7e9e5;
  border-radius: 8px;
}

.guide-card-grid strong,
.guide-card-grid span {
  display: block;
}

.guide-card-grid strong {
  font-size: 17px;
}

.guide-card-grid span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.toolbar {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, minmax(140px, 180px));
  gap: 10px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toolbar.compact {
  grid-template-columns: 1fr;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.card,
.panel,
.list-row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.teacher-card {
  gap: 9px;
}

.clickable-card {
  cursor: pointer;
}

.clickable-card:hover {
  border-color: #b9d8d3;
  box-shadow: 0 10px 24px rgba(23, 33, 29, 0.08);
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.card-head > div {
  min-width: 0;
}

.card-head .status {
  flex: 0 0 64px;
  justify-content: center;
  align-self: flex-start;
}

.meta,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.subject-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}

.subject-line span {
  flex: 0 0 auto;
  color: var(--accent-dark);
  font-weight: 700;
}

.clamp {
  display: -webkit-box;
  margin-bottom: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #3f4843;
}

.resume-summary {
  display: -webkit-box;
  margin-bottom: 0;
  min-height: 40px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #3f4843;
  font-size: 14px;
  line-height: 1.45;
}

.discover-top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, auto)) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.discover-top div {
  display: grid;
  gap: 2px;
  min-width: 86px;
}

.discover-top strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
}

.discover-top span,
.discover-top p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.discover-top p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discover-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 8px 0 14px;
}

.discover-search {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) 28px 28px;
  align-items: center;
  justify-self: center;
  width: min(520px, 100%);
  gap: 4px;
  padding: 0 12px 0 18px;
  border-radius: 999px;
  background: #f4f4f4;
}

.discover-search span {
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  text-align: center;
}

.discover-search input {
  min-height: 42px;
  border: 0;
  padding: 0;
  background: transparent;
  font-size: 16px;
}

.discover-search input:focus {
  outline: none;
}

.discover-clear {
  min-height: 28px;
  width: 28px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.discover-tabs {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  overflow-x: auto;
}

.discover-tabs button,
.discover-filter-button {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #5f6661;
  font-size: 16px;
}

.discover-tabs button {
  padding: 0 14px;
  white-space: nowrap;
}

.discover-tabs button.active {
  background: #f3f4f3;
  color: var(--ink);
  font-weight: 800;
}

.discover-filter-button {
  justify-self: end;
  padding: 0 4px;
}

.discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  align-items: start;
}

.discover-card {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 9px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.discover-card:hover {
  border-color: #b9d8d3;
  box-shadow: 0 10px 24px rgba(23, 33, 29, 0.08);
}

.discover-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.discover-card-head h3 {
  display: -webkit-box;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 18px;
  line-height: 1.28;
}

.discover-main,
.discover-sub,
.discover-summary {
  min-width: 0;
  margin: 0;
}

.discover-main {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discover-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discover-highlight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f3faf7;
}

.discover-highlight strong {
  min-width: 0;
  overflow: hidden;
  color: var(--accent-dark);
  font-size: 16px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discover-highlight span {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discover-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: #3f4843;
  font-size: 13px;
  line-height: 1.55;
}

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

.discover-actions button {
  min-width: 0;
  padding: 0 8px;
}

.load-more-row {
  display: grid;
  grid-column: 1 / -1;
  justify-items: center;
  gap: 6px;
  padding: 8px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.load-more-row button {
  min-width: 180px;
}

.tag,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef2ed;
  color: #39423d;
  font-size: 12px;
}

.status.pending {
  background: #fef3c7;
  color: var(--warn);
}

.status.approved {
  background: #dcfce7;
  color: var(--good);
}

.status.handled {
  background: #dcfce7;
  color: var(--good);
}

.status.dismissed {
  background: #eef2ed;
  color: #39423d;
}

.status.rejected,
.status.offline {
  background: #fee2e2;
  color: var(--bad);
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: var(--good);
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.primary,
.secondary,
.danger,
.link-button,
.icon-button {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 12px;
}

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

.primary:hover {
  background: var(--accent-dark);
}

.secondary {
  background: var(--soft);
  color: var(--accent-dark);
  border-color: #bfd9d5;
}

.danger {
  background: #fff1f2;
  color: var(--bad);
  border-color: #fecdd3;
}

.ghost-danger {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: var(--bad);
}

button.loading,
button:disabled {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}

button.loading::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 0.7s linear infinite;
}

.link-button {
  background: transparent;
  color: var(--accent-dark);
  border: 0;
  padding: 0;
}

.icon-button {
  width: 38px;
  padding: 0;
  background: #f3f5f2;
  color: var(--ink);
  border-color: var(--line);
  font-size: 20px;
}

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

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

.teacher-register-fields {
  display: grid;
  gap: 12px;
}

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

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

.captcha-field .inline-field {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.captcha-box {
  min-width: 96px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #f5fbf9;
  color: var(--primary);
  text-align: center;
  letter-spacing: 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.span-2 {
  grid-column: span 2;
}

.panel {
  padding: 18px;
}

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

.chat-page {
  min-height: min(720px, calc(100vh - 150px));
}

.chat-inbox {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  min-height: min(720px, calc(100vh - 150px));
}

.chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-toolbar strong {
  font-size: 22px;
}

.chat-toolbar span {
  color: var(--muted);
}

.fraud-tip {
  padding: 10px 12px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
}

.fraud-tip.in-chat {
  border-width: 0 0 1px;
  border-radius: 0;
}

.chat-context {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.chat-context .fraud-tip {
  margin: 0;
}

.chat-context .fraud-tip.in-chat {
  border: 1px solid #fde68a;
  border-radius: 8px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  overflow-wrap: anywhere;
}

.list-row > span,
.list-row > div {
  min-width: 0;
}

.list-row .meta,
.admin-log-row {
  overflow-wrap: anywhere;
}

.chat-list {
  display: grid;
  align-content: start;
  gap: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.chat-session {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 78px;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 14px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
}

.chat-session.active,
.chat-session:hover {
  background: #edf8f6;
}

.avatar.small {
  width: 46px;
  height: 46px;
  font-size: 17px;
}

.session-main {
  display: block;
  min-width: 0;
  overflow: hidden;
}

.session-main strong,
.session-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.notice-inline {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
}

.notice-inline.verified {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.chat-unread {
  display: grid;
  place-items: center;
  justify-self: end;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.chat-box {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: min(720px, calc(100vh - 150px));
  overflow: hidden;
  padding: 0;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.back-chat {
  display: inline-grid;
  font-size: 26px;
}

.chat-head > div strong,
.chat-head > div span {
  display: block;
}

.chat-peer {
  min-width: 0;
  overflow: hidden;
}

.chat-peer strong,
.chat-peer span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-head > div span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.chat-head .avatar {
  flex: 0 0 auto;
}

.chat-head .chat-peer {
  flex: 1 1 auto;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.55)),
    repeating-linear-gradient(135deg, #edf2ef 0, #edf2ef 12px, #f5f7f4 12px, #f5f7f4 24px);
}

.chat-time {
  align-self: center;
  margin: 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  max-width: 100%;
}

.message-row.mine {
  justify-content: flex-end;
}

.read-state {
  flex: 0 0 auto;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.read-state.read {
  color: #8d9892;
}

.read-state.unread {
  color: #8d9892;
}

.bubble {
  max-width: min(620px, 78%);
  border: 1px solid #e4e9e3;
  border-radius: 8px;
  padding: 11px 13px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(23, 33, 29, 0.06);
  line-height: 1.55;
  word-break: break-word;
}

.bubble.mine {
  align-self: flex-end;
  border-color: #b4ddd7;
  background: #dff7f3;
}

.bubble.recalled {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 13px;
}

.recall-button {
  flex: 0 0 auto;
  margin-bottom: 1px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.recall-button:hover,
.recall-button:focus-visible {
  color: var(--primary);
}

.message-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.message-form input {
  min-height: 44px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
}

.modal.hidden,
.hidden,
.register-only.hidden {
  display: none;
}

.modal-panel {
  position: relative;
  width: min(440px, 100%);
  padding: 24px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 18, 16, 0.58);
}

.image-modal-panel {
  position: relative;
  width: min(720px, 94vw);
  max-height: 90vh;
  overflow: auto;
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.image-modal-panel h2 {
  padding-right: 42px;
}

.image-modal-panel img {
  display: block;
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}

.empty {
  padding: 30px;
  border: 1px dashed #c8d0ca;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 20;
  transform: translateX(-50%);
  padding: 11px 16px;
  border-radius: 8px;
  background: #17211d;
  color: #fff;
  box-shadow: var(--shadow);
  animation: toastIn 0.18s ease-out;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.profile-shell {
  display: grid;
  gap: 18px;
  max-width: 860px;
}

.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.profile-hero h2,
.profile-hero p,
.profile-settings-group h3,
.profile-text-panel h2,
.profile-text-panel p {
  margin: 0;
}

.profile-hero h2 {
  font-size: 24px;
  line-height: 1.25;
}

.profile-hero p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.avatar.profile-avatar {
  width: 64px;
  height: 64px;
  font-size: 24px;
}

.profile-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.profile-quick-item {
  display: grid;
  gap: 5px;
  min-height: 78px;
  padding: 14px 10px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}

.profile-quick-item strong {
  font-size: 18px;
  line-height: 1.2;
}

.profile-quick-item span {
  color: var(--muted);
  font-size: 13px;
}

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

.profile-settings-group h3 {
  padding: 0 4px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.profile-settings-card {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.profile-settings-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 0 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.profile-settings-row:last-child {
  border-bottom: 0;
}

.profile-settings-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.profile-settings-title {
  min-width: 0;
  font-size: 16px;
  font-weight: 800;
}

.profile-settings-note {
  max-width: 240px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-settings-arrow {
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.profile-subpage-top {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  min-height: 44px;
}

.profile-subpage-top h2 {
  margin: 0;
  font-size: 22px;
  text-align: center;
}

.profile-back-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 34px;
  line-height: 1;
}

.profile-text-panel {
  display: grid;
  gap: 10px;
}

.profile-text-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.admin-dashboard {
  display: grid;
  gap: 14px;
}

.admin-summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.admin-summary-strip div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.admin-summary-strip span,
.admin-summary-strip small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-summary-strip strong {
  display: block;
  margin: 3px 0;
  font-size: 20px;
  line-height: 1.15;
}

.system-status-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.system-status-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-nav-panel {
  position: static;
  z-index: auto;
}

.admin-nav-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-nav-card {
  display: grid;
  gap: 6px;
  min-height: 72px;
  padding: 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.admin-nav-card:hover,
.admin-nav-card:focus-visible {
  border-color: var(--primary);
  background: #eefaf6;
}

.admin-nav-card strong {
  min-width: 0;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-nav-card span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-settings-shell {
  display: grid;
  gap: 18px;
  max-width: 980px;
  margin: 0 auto;
}

.admin-settings-top {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  min-height: 48px;
}

.admin-settings-top h2 {
  margin: 0;
  text-align: center;
  font-size: 20px;
  line-height: 1.25;
}

.admin-back {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.admin-settings-group {
  display: grid;
  gap: 10px;
}

.admin-settings-group h3,
.admin-subpage-note {
  margin: 0;
  padding: 0 4px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.admin-settings-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-settings-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) minmax(0, auto) 18px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 0 16px;
  border: 0;
  border-bottom: 1px solid #edf0ec;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.admin-settings-row:last-child {
  border-bottom: 0;
}

.admin-settings-row:hover,
.admin-settings-row:focus-visible {
  background: #f8fbf9;
}

.admin-settings-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 800;
}

.admin-settings-title {
  min-width: 0;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-settings-note {
  max-width: 240px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-settings-chevron {
  color: #8a918c;
  font-size: 24px;
  line-height: 1;
  text-align: right;
}

.admin-subpage {
  max-width: 1180px;
}

.admin-subpage > .panel,
.admin-subpage > section > .admin-dashboard {
  margin-top: 0;
}

.admin-user-tools {
  display: grid;
  grid-template-columns: minmax(240px, 420px) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 10px;
}

.admin-content-row .actions {
  min-width: 172px;
  justify-content: flex-end;
}

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

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

.stat {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 22px;
  line-height: 1.15;
}

.stat small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.chart-overview {
  display: grid;
  gap: 14px;
}

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

.chart-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.chart-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.metric-chart {
  display: block;
  width: 100%;
  height: auto;
}

.metric-chart text {
  fill: #17211d;
  font-size: 11px;
}

.metric-chart .chart-value {
  font-weight: 800;
}

.pie-chart-card {
  align-content: start;
}

.pie-chart-layout {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.pie-chart {
  position: relative;
  display: grid;
  place-items: center;
  width: 138px;
  aspect-ratio: 1;
  border-radius: 50%;
}

.pie-chart svg {
  width: 100%;
  height: 100%;
}

.pie-track,
.pie-segment {
  fill: none;
  stroke-width: 22;
}

.pie-track {
  stroke: #edf2ef;
}

.pie-segment-0 {
  stroke: #0f8a7a;
}

.pie-segment-1 {
  stroke: #f59e0b;
}

.pie-segment-2 {
  stroke: #2563eb;
}

.pie-segment-3 {
  stroke: #ef4444;
}

.pie-segment-4 {
  stroke: #8b5cf6;
}

.pie-segment-5 {
  stroke: #64748b;
}

.pie-chart span {
  position: absolute;
  display: grid;
  place-items: center;
  width: 72px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  font-size: 18px;
  font-weight: 900;
}

.pie-legend {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.pie-legend div {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.pie-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.pie-dot-0 {
  background: #0f8a7a;
}

.pie-dot-1 {
  background: #f59e0b;
}

.pie-dot-2 {
  background: #2563eb;
}

.pie-dot-3 {
  background: #ef4444;
}

.pie-dot-4 {
  background: #8b5cf6;
}

.pie-dot-5 {
  background: #64748b;
}

.pie-legend span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pie-legend strong {
  font-size: 14px;
  line-height: 1.25;
}

.chart-track {
  fill: #edf2ef;
}

.chart-fill-0 {
  fill: #0f766e;
}

.chart-fill-1 {
  fill: #2563eb;
}

.chart-fill-2 {
  fill: #d97706;
}

.chart-fill-3 {
  fill: #dc2626;
}

.chart-fill-4 {
  fill: #7c3aed;
}

.chart-fill-5 {
  fill: #475569;
}

@media (max-width: 900px) {
  #app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    min-height: auto;
  }

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

  .account {
    margin-top: 0;
  }

  .main {
    padding: 22px 16px 34px;
  }

  .topbar,
  .list-row {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .toolbar,
  .form-grid,
  .stats {
    grid-template-columns: 1fr;
  }

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

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

  .admin-nav-panel {
    position: static;
  }

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

  .discover-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  }

  .pie-chart-layout {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .pie-chart {
    width: 118px;
  }

  .admin-summary-strip,
  .admin-user-tools {
    grid-template-columns: 1fr;
  }

  .chat-box {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  .chat-session {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .chat-session .chat-unread {
    grid-column: 3;
    justify-self: end;
  }

  .bubble {
    max-width: 92%;
  }

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

  .span-2 {
    grid-column: span 1;
  }
}

@media (max-width: 700px) {
  body {
    background: #f3f5f4;
    padding-bottom: 76px;
  }

  #app {
    display: block;
  }

  .sidebar {
    position: static;
    z-index: 15;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 62px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(23, 33, 29, 0.08);
  }

  .brand {
    min-height: 42px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
  }

  .brand span {
    color: var(--muted);
  }

  .account {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .account .muted {
    display: none;
  }

  .account-name {
    margin: 0;
  }

  .account-name > div:last-child {
    display: none;
  }

  .account .avatar {
    width: 34px;
    height: 34px;
  }

  .account > .primary,
  .account > .secondary,
  .account [data-logout] {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 13px;
  }

  .nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(var(--mobile-nav-count, 5), minmax(0, 1fr));
    gap: 0;
    min-height: 64px;
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 28px rgba(23, 33, 29, 0.1);
  }

  .nav button {
    display: grid;
    place-items: center;
    min-height: 48px;
    padding: 0 4px;
    border-radius: 10px;
    color: #5e6963;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
  }

  .nav button.active,
  .nav button:hover {
    background: #e5f5f2;
    color: var(--accent-dark);
  }

  .main {
    padding: 14px 12px 22px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 12;
    display: block;
    margin: -14px -12px 12px;
    padding: 9px 12px 8px;
    background: rgba(243, 245, 244, 0.96);
    border-bottom: 1px solid rgba(223, 228, 222, 0.78);
    backdrop-filter: blur(10px);
  }

  .eyebrow {
    margin-bottom: 2px;
    font-size: 12px;
  }

  h1 {
    font-size: 21px;
  }

  .top-actions {
    display: none;
  }

  .toolbar {
    position: relative;
    z-index: 1;
    margin: 0 -2px;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(23, 33, 29, 0.07);
  }

  .toolbar.compact {
    margin-bottom: 0;
  }

  .toolbar input,
  .toolbar select {
    min-height: 38px;
    border-radius: 10px;
    font-size: 13px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .card {
    gap: 8px;
    padding: 12px;
    border-color: #e7ece8;
    border-radius: 12px;
    box-shadow: 0 10px 26px rgba(23, 33, 29, 0.07);
  }

  .card-head {
    align-items: flex-start;
  }

  .card h3 {
    font-size: 17px;
    margin-bottom: 4px;
  }

  .teacher-card .card-head {
    gap: 8px;
  }

  .subject-line {
    font-size: 14px;
  }

  .clamp {
    font-size: 13px;
    -webkit-line-clamp: 1;
  }

  .card .meta {
    margin-bottom: 0;
  }

  .tags {
    gap: 6px;
  }

  .tag,
  .status {
    min-height: 24px;
    padding: 0 8px;
    font-size: 11px;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    width: 100%;
  }

  .actions button {
    width: 100%;
  }

  .card .actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  }

  .card .actions .report-button {
    width: auto;
    min-width: 58px;
    padding: 0 10px;
    background: #fff;
  }

  .discover-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
  }

  .discover-top p {
    grid-column: 1 / -1;
  }

  .discover-top strong {
    font-size: 18px;
  }

  .discover-top span,
  .discover-top p {
    font-size: 12px;
  }

  .discover-search {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) 24px 24px;
    padding: 0 10px 0 14px;
    border-radius: 999px;
  }

  .discover-header {
    gap: 8px;
    padding: 4px 0 10px;
  }

  .discover-search input {
    min-height: 38px;
    font-size: 14px;
  }

  .discover-search span {
    font-size: 19px;
  }

  .discover-clear {
    width: 24px;
    min-height: 24px;
    font-size: 21px;
  }

  .discover-tabs {
    gap: 8px;
  }

  .discover-tabs button,
  .discover-filter-button {
    min-height: 34px;
    font-size: 14px;
  }

  .discover-tabs button {
    padding: 0 12px;
  }

  .discover-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .discover-card {
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
  }

  .discover-card-head h3 {
    font-size: 15px;
  }

  .discover-main {
    font-size: 13px;
  }

  .discover-highlight {
    display: grid;
    gap: 3px;
    padding: 7px 8px;
  }

  .discover-highlight strong {
    font-size: 14px;
  }

  .discover-summary {
    font-size: 12px;
    line-height: 1.5;
  }

  .discover-actions {
    gap: 6px;
  }

  .discover-actions button {
    min-height: 34px;
    border-radius: 8px;
    font-size: 12px;
  }

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

  .primary,
  .secondary,
  .danger {
    min-height: 40px;
    border-radius: 10px;
  }

  .panel {
    padding: 14px;
    border-radius: 12px;
    box-shadow: 0 10px 26px rgba(23, 33, 29, 0.06);
  }

  .chart-card {
    padding: 14px;
  }

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

  .stat {
    border-radius: 12px;
  }

  .profile-shell {
    gap: 16px;
    max-width: none;
    padding-bottom: 78px;
  }

  .profile-hero {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    padding: 18px 14px;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 10px 26px rgba(23, 33, 29, 0.06);
  }

  .profile-edit-button {
    grid-column: 1 / -1;
    justify-self: stretch;
    min-height: 38px;
  }

  .avatar.profile-avatar {
    width: 58px;
    height: 58px;
    font-size: 22px;
  }

  .profile-hero h2 {
    font-size: 22px;
  }

  .profile-quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .profile-quick-item {
    min-height: 66px;
    padding: 10px 6px;
    border-radius: 12px;
  }

  .profile-quick-item strong {
    font-size: 16px;
  }

  .profile-quick-item span {
    font-size: 12px;
  }

  .profile-settings-group {
    gap: 8px;
  }

  .profile-settings-group h3 {
    padding: 0 4px;
    font-size: 14px;
  }

  .profile-settings-card {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 10px 26px rgba(23, 33, 29, 0.06);
  }

  .profile-settings-row {
    grid-template-columns: 34px minmax(0, 1fr) auto 16px;
    min-height: 56px;
    padding: 0 14px;
  }

  .profile-settings-title {
    font-size: 15px;
  }

  .profile-settings-note {
    max-width: 120px;
    font-size: 12px;
  }

  .profile-subpage-top h2 {
    font-size: 20px;
  }

  .split {
    gap: 10px;
  }

  .chat-page,
  .chat-inbox,
  .chat-box {
    height: calc(100vh - 224px);
    min-height: 0;
  }

  body:has(.main.chat-detail-mode) {
    padding-bottom: 0;
  }

  body:has(.main.chat-detail-mode) .nav {
    display: none;
  }

  .main.chat-detail-mode {
    min-height: calc(100dvh - 62px);
    padding: 0;
  }

  .main.chat-detail-mode .topbar {
    display: none;
  }

  .main.chat-detail-mode .view,
  .main.chat-detail-mode .chat-page.detail {
    height: calc(100dvh - 62px - env(safe-area-inset-bottom));
    min-height: 0;
  }

  .chat-list {
    display: grid;
    overflow: auto;
    border-radius: 12px;
  }

  .chat-list::-webkit-scrollbar {
    display: none;
  }

  .chat-session {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 78px;
    border-radius: 0;
    box-shadow: none;
  }

  .chat-box {
    border-radius: 12px;
  }

  .main.chat-detail-mode .chat-box {
    height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
  }

  .chat-head {
    min-height: 58px;
    padding: 10px 12px;
  }

  .main.chat-detail-mode .chat-head {
    min-height: 56px;
    gap: 8px;
    padding: 7px 18px 5px;
    border-bottom: 0;
    background: #fff;
  }

  .main.chat-detail-mode .chat-head .back-chat {
    width: 30px;
    height: 36px;
    border: 0;
    background: transparent;
    font-size: 32px;
  }

  .main.chat-detail-mode .chat-head .avatar {
    width: 42px;
    height: 42px;
  }

  .main.chat-detail-mode .chat-head > div strong {
    font-size: 17px;
    line-height: 1.15;
  }

  .main.chat-detail-mode .chat-head > div span {
    margin-top: 0;
    font-size: 12px;
  }

  .main.chat-detail-mode .chat-context {
    gap: 5px;
    padding: 0 18px 6px;
    border-bottom: 0;
    background: #fff;
  }

  .main.chat-detail-mode .source-card {
    padding: 6px 10px;
    border-radius: 9px;
    font-size: 12px;
    line-height: 1.35;
  }

  .main.chat-detail-mode .chat-context .fraud-tip.in-chat {
    padding: 6px 9px;
    border-radius: 9px;
    font-size: 11px;
    line-height: 1.4;
  }

  .messages {
    padding: 14px 12px;
    background: #eef3f1;
  }

  .main.chat-detail-mode .messages {
    gap: 14px;
    padding: 12px 18px 16px;
    background: #fff;
  }

  .main.chat-detail-mode .message-row {
    gap: 6px;
  }

  .main.chat-detail-mode .read-state {
    margin-bottom: 4px;
    color: #9aa29e;
    font-size: 11px;
  }

  .bubble {
    max-width: 86%;
    padding: 10px 12px;
    border-radius: 14px 14px 14px 4px;
    box-shadow: 0 6px 16px rgba(23, 33, 29, 0.06);
  }

  .main.chat-detail-mode .bubble {
    max-width: 78%;
    border: 0;
    border-radius: 16px 16px 16px 4px;
    padding: 11px 13px;
    background: #f2f3f4;
    color: #252a27;
    font-size: 17px;
    line-height: 1.45;
    box-shadow: none;
  }

  .bubble.mine {
    border-radius: 14px 14px 4px 14px;
  }

  .main.chat-detail-mode .bubble.mine {
    border-radius: 16px 16px 4px 16px;
    background: #1688f0;
    color: #fff;
  }

  .main.chat-detail-mode .bubble.recalled {
    border-color: transparent;
    background: transparent;
    color: #8d9892;
  }

  .main.chat-detail-mode .chat-time {
    margin: 0;
    color: #a0a7a3;
    font-size: 11px;
  }

  .message-form {
    grid-template-columns: minmax(0, 1fr) 72px;
    padding: 10px;
    background: #fff;
  }

  .main.chat-detail-mode .message-form {
    grid-template-columns: minmax(0, 1fr) 58px;
    gap: 7px;
    padding: 7px 16px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid #eef0ee;
    background: #fff;
  }

  .message-form input {
    min-height: 42px;
    border-radius: 999px;
    background: #f5f7f6;
  }

  .main.chat-detail-mode .message-form input {
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    background: #f4f5f5;
    font-size: 15px;
  }

  .message-form button {
    min-height: 42px;
    border-radius: 999px;
  }

  .main.chat-detail-mode .message-form button {
    min-height: 40px;
    padding: 0 10px;
    font-size: 15px;
    font-weight: 700;
  }

  .modal-panel {
    max-height: calc(100vh - 24px);
    overflow: auto;
    align-self: end;
    width: 100%;
    border-radius: 18px 18px 0 0;
    padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
  }

  .list-row {
    border-radius: 12px;
  }

  body:has(.modal:not(.hidden)) .nav {
    display: none;
  }

  .nav button.mobile-hidden {
    display: none;
  }

  .nav .nav-plus {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    justify-self: center;
    align-self: center;
    width: min(78px, calc(100% - 10px));
    min-height: 58px;
    margin: -18px 0 0;
    border: 0;
    border-radius: 14px;
    background: #f43f5e;
    color: #fff;
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 10px 22px rgba(244, 63, 94, 0.28);
  }

  .nav .nav-plus:hover,
  .nav .nav-plus:focus,
  .nav .nav-plus:active {
    background: #f43f5e;
    color: #fff;
  }

  .nav .nav-plus.active {
    background: #f43f5e;
    color: #fff;
  }

  .nav .nav-plus + .nav button.active,
  .nav button.active:has(+ .nav-plus),
  .nav button.active {
    z-index: 1;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes toastIn {
  from {
    transform: translate(-50%, 8px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}
/* Product flow refinements */
.notice-panel {
  padding: 14px 16px;
  border: 1px solid #b9e4dc;
  background: #eefaf7;
  color: #0b6f62;
  border-radius: 8px;
  margin-bottom: 14px;
  font-weight: 700;
}

.action-empty {
  display: grid;
  gap: 12px;
  justify-items: start;
  text-align: left;
}

.action-empty h2 {
  margin: 0;
  font-size: 22px;
}

.form-section {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.form-section h2 {
  margin: 0 0 6px;
}

.form-section p {
  margin: 0;
  color: var(--muted);
}

.form-subtitle {
  font-weight: 800;
  color: var(--primary);
  margin-top: 6px;
}

.detail-panel {
  display: grid;
  gap: 14px;
}

.full-detail {
  max-width: 920px;
}

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

.detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.detail-hero h2 {
  margin: 0;
  font-size: 28px;
}

.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.detail-info-grid div {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.detail-info-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.detail-info-grid strong {
  color: var(--ink);
  line-height: 1.35;
}

.detail-section {
  display: grid;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.detail-panel h2,
.detail-panel h3,
.detail-panel p {
  margin: 0;
}

.detail-panel .long-text {
  white-space: pre-wrap;
  line-height: 1.75;
}

@media (max-width: 700px) {
  .admin-settings-shell {
    gap: 16px;
    max-width: none;
    margin: -4px -2px 0;
    padding: 0 0 12px;
  }

  .admin-settings-top {
    position: sticky;
    top: 0;
    z-index: 5;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    min-height: 48px;
    background: #f3f5f4;
  }

  .admin-settings-top h2 {
    font-size: 20px;
  }

  .admin-back {
    width: 40px;
    height: 40px;
    font-size: 28px;
  }

  .admin-settings-group {
    gap: 10px;
  }

  .admin-settings-group h3,
  .admin-subpage-note {
    padding: 0 16px;
    font-size: 14px;
  }

  .admin-settings-card {
    margin: 0 10px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(26, 35, 31, 0.05);
  }

  .admin-settings-row {
    grid-template-columns: 34px minmax(0, 1fr) minmax(56px, auto) 16px;
    min-height: 56px;
    padding: 0 14px;
  }

  .admin-settings-icon {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }

  .admin-settings-title {
    font-size: 15px;
  }

  .admin-settings-note {
    max-width: 120px;
    font-size: 12px;
  }

  .admin-settings-chevron {
    font-size: 24px;
  }

  .admin-subpage > .panel,
  .admin-subpage > section > .admin-dashboard {
    margin: 0 10px;
  }

  .guest-guide-layer {
    align-items: start;
    padding: 76px 12px 84px;
  }

  .guest-guide-panel {
    width: 100%;
    min-height: 70vh;
    max-height: calc(100vh - 170px);
    padding: 18px;
  }

  .guide-title h2 {
    font-size: 25px;
  }

  .guide-title p {
    font-size: 15px;
  }

  .guide-card-grid {
    grid-template-columns: 1fr;
  }

  .guide-card-grid article {
    min-height: auto;
    padding: 14px;
  }

  .detail-hero h2 {
    font-size: 22px;
  }

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

.source-card {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #d7ebe8;
  background: #f4fbfa;
  color: #126b61;
  border-radius: 8px;
  font-weight: 700;
}

.status-group {
  margin-top: 14px;
}

.status-group h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--primary);
}

.icon-danger {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #f1b8b8;
  color: #b42318;
  background: #fff7f7;
  padding: 0;
}
