:root {
  --primary: #1A6FE8;
  --primary-dark: #1255BE;
  --primary-light: #E8F0FD;
  --accent: #FF6B35;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #6366F1;
  --bg: #F2F5FA;
  --card: #FFFFFF;
  --text: #1A1D23;
  --text-2: #6B7280;
  --text-3: #9CA3AF;
  --border: #E5E9F0;
  --shadow: 0 2px 12px rgba(26,111,232,0.10);
  --shadow-lg: 0 8px 32px rgba(26,111,232,0.16);
  --radius: 14px;
  --radius-sm: 8px;
  --nav-h: 64px;
  --tab-nav-total-h: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  --mech: #BE123C;
  --mech-bg: #FFF1F2;
  --prog: #4338CA;
  --prog-bg: #EEF2FF;
  --vis: #15803D;
  --vis-bg: #F0FDF4;
  --success-bg: #F0FDF4;
  --warning-bg: #FFFBEB;
  --danger-bg: #FEF2F2;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

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

#app {
  min-height: 100dvh;
  position: relative;
}

.phone-shell {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  position: relative;
  box-shadow: none;
  overflow: visible;
  border-radius: 0;
}

.status-bar {
  display: none;
}

.notch {
  display: none;
}

.status-icons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.auth-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #4a72d4 0%, #2a5098 38%, #152d6e 72%, #0a1b44 100%);
}

.auth-page .status-bar {
  background: transparent;
  color: #fff;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.login-body {
  width: 100%;
  min-height: 0;
  padding: 48px 28px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0;
  flex: 1;
  justify-content: center;
}

.login-logo {
  width: 64px;
  height: 64px;
  background: rgba(255,255,255,0.12);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.18);
}

.login-logo svg {
  width: 32px;
  height: 32px;
}

.login-title {
  color: white;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: .5px;
  text-align: center;
}

.login-subtitle {
  color: rgba(255,255,255,.55);
  font-size: 12px;
  margin-bottom: 28px;
  text-align: center;
  line-height: 1.5;
}

.login-card {
  width: 100%;
  background: rgba(255,255,255,.1);
  border-radius: 22px;
  padding: 28px 22px 24px;
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,.18);
}

.login-welcome {
  color: white;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.login-welcome-sub {
  color: rgba(255,255,255,.55);
  font-size: 12px;
  text-align: center;
  margin-bottom: 26px;
  line-height: 1.6;
}

.btn-wechat,
.btn-login {
  width: 100%;
  border-radius: 999px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-wechat {
  background: #5dbd5b;
  color: white;
}

.btn-wechat:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-login {
  background: white;
  color: var(--primary);
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-top: 8px;
}

.btn-login:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 18px;
  color: rgba(255,255,255,.4);
  font-size: 11px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,.18);
}

.btn-phone-login {
  width: 100%;
  color: white;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
}

.login-form.hidden,
.login-choice.hidden {
  display: none;
}

.login-back {
  color: rgba(255,255,255,.7);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 18px;
}

.input-group {
  margin-bottom: 16px;
}

.input-label {
  color: rgba(255,255,255,.7);
  font-size: 12px;
  margin-bottom: 8px;
  display: block;
  font-weight: 500;
}

.input-wrap {
  background: rgba(255,255,255,.1);
  border-radius: 12px;
  border: 1.5px solid rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.input-wrap:focus-within {
  border-color: rgba(255,255,255,.5);
}

.input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: white;
  font-size: 15px;
  padding: 14px 10px;
}

.input-wrap input::placeholder {
  color: rgba(255,255,255,.35);
}

.login-hint {
  color: rgba(255,255,255,.45);
  font-size: 12px;
  text-align: center;
  margin-top: 16px;
  line-height: 1.6;
}

.alert {
  margin-bottom: 14px;
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(254, 226, 226, 0.16);
  color: #fff4f4;
  border: 1px solid rgba(254, 202, 202, 0.35);
  font-size: 12px;
}

.app-page {
  min-height: 100dvh;
  height: auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  padding-bottom: var(--tab-nav-total-h);
  box-sizing: border-box;
}

.app-page .app-body {
  flex: 1;
  min-height: 0;
}

.app-header {
  background: var(--card);
  padding: 12px 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.app-header-row1,
.app-header-row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.header-subtitle {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 1px;
}

.header-action {
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--primary-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}

.header-action-outline {
  background: #fff;
  border: 1.5px solid var(--primary);
  border-radius: 999px;
  padding: 0 14px;
  height: 32px;
}

.app-body,
.page-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 20px;
}

.app-body::-webkit-scrollbar,
.page-body::-webkit-scrollbar {
  display: none;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat-num-pending { color: #7C3AED; }
.stat-num-processing { color: #16A34A; }
.stat-num-resolved { color: #9CA3AF; }
.stat-num-closed { color: #9CA3AF; }

.stat-label {
  font-size: 10px;
  color: var(--text-2);
  margin-top: 4px;
}

.search-wrap {
  background: var(--card);
  border-radius: 12px;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.search-wrap svg {
  width: 18px;
  height: 18px;
  color: var(--text-3);
  flex-shrink: 0;
}

.search-wrap .search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
  padding: 13px 10px;
  background: none;
}

.search-wrap .search-input::placeholder {
  color: var(--text-3);
}

.section-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.section-tabs::-webkit-scrollbar {
  display: none;
}

.stab {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  white-space: nowrap;
}

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

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

.ticket-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  width: 100%;
  text-align: left;
  transition: transform 0.15s;
}

.ticket-card:active {
  transform: scale(0.99);
}

.ticket-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 2px 0 0 2px;
  background: var(--ticket-accent, var(--primary));
}

.ticket-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.ticket-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.ticket-title-top {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}

.ticket-id {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
}

.ticket-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
}

.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ticket-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-2);
}

.ticket-meta-item svg {
  width: 12px;
  height: 12px;
}

.ticket-type-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.ticket-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tag-order-type {
  background: #EEF2FF;
  color: #4338CA;
}

.ticket-priority-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  background: #FFF1F2;
  color: #BE123C;
}

.ticket-category-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  background: #F0FDF4;
  color: #15803D;
}

.tag-repair { background: var(--mech-bg); color: var(--mech); }
.tag-parts { background: var(--prog-bg); color: var(--prog); }
.tag-mechanical { background: var(--mech-bg); color: var(--mech); }
.tag-programming { background: var(--prog-bg); color: var(--prog); }
.tag-visual { background: var(--vis-bg); color: var(--vis); }
.tag-other { background: #f3f4f6; color: #64748b; }

.knowledge-search {
  background: var(--card);
  border-radius: 12px;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.knowledge-search svg {
  width: 18px;
  height: 18px;
  color: var(--text-3);
  flex-shrink: 0;
}

.knowledge-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
  padding: 13px 10px;
  background: none;
}

.knowledge-search input::placeholder {
  color: var(--text-3);
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  margin-top: 4px;
}

.kb-category-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.kb-cat {
  background: var(--card);
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
  box-shadow: var(--shadow);
  width: 100%;
  border: none;
  cursor: pointer;
}

.kb-cat:active {
  transform: scale(0.98);
}

.kb-cat.is-active {
  box-shadow: 0 0 0 2px var(--primary-light), var(--shadow);
}

.kb-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.kb-cat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
}

.kb-cat-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.kb-cat-count {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 2px;
}

.kb-item {
  background: var(--card);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.kb-item:active {
  transform: scale(0.99);
}

.kb-item + .kb-item {
  margin-top: 0;
}

.kb-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kb-item-body {
  flex: 1;
  min-width: 0;
}

.kb-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kb-item-meta {
  font-size: 11px;
  color: var(--text-2);
}

.kb-item-arr {
  color: var(--text-3);
}

.kb-item-arr svg {
  width: 16px;
  height: 16px;
}

.profile-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg,var(--primary) 0%,#3B82F6 100%);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255,255,255,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 2px solid rgba(255,255,255,.4);
  flex-shrink: 0;
}

.profile-avatar.has-image,
.profile-detail-avatar.has-image {
  overflow: hidden;
  padding: 0;
}

.profile-avatar.has-image img,
.profile-detail-avatar.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.pf-name {
  color: white;
  font-size: 16px;
  font-weight: 700;
}

.pf-phone,
.pf-company {
  color: rgba(255,255,255,.82);
  font-size: 12px;
  margin-top: 2px;
}

.pf-company {
  font-size: 11px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  overflow: hidden;
}

.p-stat {
  padding: 16px 8px;
  text-align: center;
}

.p-stat + .p-stat {
  border-left: 1px solid var(--border);
}

.p-stat-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.p-stat-label {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 4px;
}

.menu-section {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.menu-item.menu-button {
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.menu-item:active {
  background: var(--bg);
}

.menu-arr-danger {
  color: #be123c;
}

.menu-arr-danger svg {
  stroke: #be123c;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.menu-text {
  flex: 1;
}

.menu-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.menu-title.danger {
  color: #be123c;
}

.menu-desc {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 1px;
}

.profile-hero {
  background: linear-gradient(135deg,var(--primary) 0%,#3B82F6 100%);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

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

.profile-info .name {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.profile-info .phone,
.profile-info .wechat {
  color: rgba(255,255,255,.82);
  font-size: 12px;
  margin-top: 2px;
}

.menu-arr svg {
  width: 16px;
  height: 16px;
  color: var(--text-3);
}

.chart-card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.chart-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

.chart-bars {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  height: 80px;
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.chart-stack {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 3px;
}

.bar-light,
.bar-dark {
  flex: 1;
  border-radius: 3px 3px 0 0;
  min-height: 10px;
}

.bar-light { background: #FECACA; }
.bar-dark { background: #BE123C; }
.bar-light-prog { background: #C7D2FE; }
.bar-dark-prog { background: #4338CA; }
.bar-light-vis { background: #BBF7D0; }
.bar-dark-vis { background: #15803D; }

.chart-label {
  font-size: 10px;
  color: var(--text-2);
}

.chart-legend {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-2);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.legend-dot-light { background: #FECACA; }
.legend-dot-dark { background: #BE123C; }

.tab-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  height: var(--tab-nav-total-h);
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
  box-shadow: 0 -4px 16px rgba(26, 111, 232, 0.06);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 500;
  position: relative;
  transition: color 0.2s;
}

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

.tab-item svg {
  width: 22px;
  height: 22px;
}

.tab-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 18px);
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.nav-header {
  min-height: 52px;
  background: var(--card);
  display: flex;
  align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 2px) 16px 6px;
  border-bottom: 1px solid var(--border);
  position: relative;
  flex-shrink: 0;
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 0;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
}

.nav-back svg,
.nav-action svg {
  width: 20px;
  height: 20px;
}

.nav-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.nav-action {
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
}

.nav-spacer {
  width: 88px;
  flex-shrink: 0;
}

.kb-detail-page .nav-back {
  min-width: 88px;
}

.kb-detail-banner {
  margin: 12px 16px 0;
}

.tag-mech { background: var(--mech-bg); color: var(--mech); }
.tag-prog { background: var(--prog-bg); color: var(--prog); }
.tag-vis { background: var(--vis-bg); color: var(--vis); }

.kb-tag-secondary {
  background: #f3f4f6;
  color: var(--text-2);
}

.kb-hero {
  background: var(--card);
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.kb-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.kb-hero-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 12px;
  text-align: center;
}

.kb-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  justify-content: center;
}

.kb-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-2);
}

.kb-meta-item svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.kb-body {
  flex: 1;
  padding: 16px 20px 28px;
  background: var(--card);
}

.kb-h1,
.kb-body .kb-article-html h1 {
  font-size: 14px;
  font-weight: 700;
  color: #1a1d23;
  margin: 20px 0 6px;
}

.kb-h1:first-child,
.kb-body .kb-article-html h1:first-child {
  margin-top: 0;
}

.kb-h2,
.kb-body .kb-article-html h2,
.kb-related-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #1a1d23;
  margin: 18px 0 6px;
}

.kb-h2:first-child,
.kb-body .kb-article-html h2:first-child {
  margin-top: 0;
}

.kb-body .kb-article-html h3 {
  font-size: 13px;
  font-weight: 700;
  color: #1a1d23;
  margin: 14px 0 6px;
}

.kb-p,
.kb-body .kb-article-html p {
  font-size: 12.5px;
  color: #1a1d23;
  line-height: 1.9;
  margin-bottom: 8px;
  text-indent: 2em;
}

.kb-ol,
.kb-ul,
.kb-body .kb-article-html ol,
.kb-body .kb-article-html ul {
  padding-left: 2.5em;
  margin-bottom: 10px;
}

.kb-ol li,
.kb-ul li,
.kb-body .kb-article-html ol li,
.kb-body .kb-article-html ul li {
  font-size: 12.5px;
  color: #1a1d23;
  line-height: 1.9;
  margin-bottom: 2px;
}

.kb-body .kb-article-html strong,
.kb-body .kb-article-html b {
  font-weight: 700;
}

.kb-code,
.kb-body .kb-article-html pre {
  background: #f8f8f8;
  color: #1a1d23;
  border: 1px solid #d1d5db;
  border-radius: 2px;
  padding: 10px 14px;
  font-size: 11px;
  line-height: 1.7;
  font-family: "Courier New", monospace;
  margin-bottom: 10px;
  overflow-x: auto;
  white-space: pre-wrap;
  text-indent: 0;
}

.kb-related-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 4px;
  background: var(--card);
  margin-bottom: 4px;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.kb-related-item svg {
  width: 14px;
  height: 14px;
  color: var(--text-3);
  flex-shrink: 0;
}

.kb-related-text {
  flex: 1;
  font-size: 12.5px;
  color: var(--primary);
  text-decoration: underline;
}

.kb-related-arr {
  color: var(--text-3);
}

.kb-related-arr svg {
  width: 14px;
  height: 14px;
}

.kb-article-nav .nav-back {
  gap: 2px;
  color: var(--primary);
}

.kb-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
}

.detail-nav-action {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.detail-nav-action-edit {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
}

.attachment-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.attach-delete-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #FEE2E2;
  color: #DC2626;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kb-share-btn svg {
  width: 18px;
  height: 18px;
}

.form-body {
  padding: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.required {
  color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
  background: var(--card);
  outline: none;
}

.form-textarea {
  min-height: 96px;
  resize: none;
  line-height: 1.6;
}

.mobile-creation-editor {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
}

.creation-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-wrap: wrap;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.creation-editor-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: #374151;
  font-size: 13px;
  line-height: 1;
  padding: 4px 5px;
  border-radius: 3px;
  cursor: pointer;
  min-width: 26px;
  min-height: 26px;
}

.creation-editor-tool:hover,
.creation-editor-tool:active {
  background: #f3f4f6;
}

.creation-editor-select {
  min-width: 78px;
  height: 30px;
  border: 1px solid #d5dce8;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  font-size: 13px;
  padding: 0 8px;
  outline: none;
}

.creation-editor-sep {
  width: 1px;
  height: 16px;
  background: #e5e7eb;
  margin: 0 3px;
  flex-shrink: 0;
}

.creation-editor-color-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.creation-editor-color-bar {
  width: 14px;
  height: 3px;
  border-radius: 1px;
  background: #e2590a;
}

.creation-editor-hidden-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.creation-editor-table-wrap {
  position: relative;
}

.creation-editor-table-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 140px;
  padding: 6px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
  z-index: 20;
}

.creation-editor-popover-menu {
  min-width: 110px;
}

.creation-editor-table-action {
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: left;
  font-size: 13px;
  color: #1f2937;
}

.creation-editor-table-action:active,
.creation-editor-table-action:hover {
  background: #f8fafc;
}

.creation-editor-table-action.danger {
  color: #dc2626;
}

.creation-editor-body.form-textarea {
  border: 0;
  border-radius: 0;
  min-height: 150px;
  margin: 0;
  padding: 12px 14px;
  background: #fff;
}

.creation-editor-body[contenteditable="true"]:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
}

.creation-editor-body:focus {
  outline: none;
}

.richtext-content p {
  margin: 0 0 10px;
}

.richtext-content p:last-child {
  margin-bottom: 0;
}

.richtext-content ul,
.richtext-content ol {
  margin: 0 0 10px 18px;
  padding: 0;
}

.richtext-content pre {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  overflow: auto;
}

.richtext-content code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.richtext-content hr {
  border: 0;
  border-top: 1px solid #dbe2ea;
  margin: 12px 0;
}

.richtext-content img {
  display: block;
  max-width: 100%;
  border-radius: 8px;
}

.richtext-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 10px;
}

.richtext-content th,
.richtext-content td {
  border: 1px solid #d5dce8;
  padding: 8px 10px;
  text-align: left;
}

.richtext-content th {
  background: #f8fafc;
}

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

.radio-btn {
  flex: 1;
  min-width: 80px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--card);
}

.radio-btn.active-repair {
  border-color: var(--mech);
  background: var(--mech-bg);
  color: var(--mech);
}

.radio-btn.active-parts {
  border-color: var(--prog);
  background: var(--prog-bg);
  color: var(--prog);
}

.nt-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0 16px;
}

.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.attach-zone {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 168px;
  border: 2px dashed var(--border);
  border-radius: 22px;
  padding: 28px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  background: #f7faff;
  line-height: 1.6;
  cursor: pointer;
}

.attach-zone svg {
  width: 38px;
  height: 38px;
  margin: 0 auto 4px;
  display: block;
  color: #a7b0c0;
}

.attach-zone-title {
  font-size: 15px;
  font-weight: 500;
  color: #98a4b8;
  line-height: 1.5;
}

.attach-zone-subtitle {
  font-size: 11px;
  color: #a7b0c0;
  line-height: 1.5;
}

.submit-bar-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.btn-outline {
  border: 1px solid var(--border);
  background: white;
  color: var(--text-2);
}

.btn-outline:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--text);
}

.btn-outline:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

.full-btn {
  width: 100%;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
}

.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.34);
  display: flex;
  align-items: flex-end;
  z-index: 20;
}

.detail-sheet {
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
}

.profile-detail-sheet {
  min-height: 78vh;
}

.profile-detail-body {
  padding: 0 16px 24px;
}

.profile-info-page .profile-detail-body {
  padding-top: 0;
}

.profile-info-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0 24px;
}

.profile-info-hero-avatar {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 8px;
}

.profile-info-hero-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.profile-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.profile-info-card {
  margin-bottom: 16px;
}

.profile-info-banner {
  margin-top: 12px;
}

.profile-password-form {
  padding: 8px 0 0;
}

.password-form-tip {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-2);
  margin-bottom: 18px;
}

.profile-info-row-static {
  cursor: default;
}

.profile-info-row-static:active {
  background: transparent;
}

.profile-readonly-badge {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 6px;
}

.profile-detail-card {
  background: linear-gradient(135deg, var(--primary) 0%, #3B82F6 100%);
  border-radius: 18px;
  padding: 24px 18px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  color: white;
  margin-bottom: 16px;
}

.profile-detail-avatar {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  margin: 0 auto 14px;
  background: rgba(255,255,255,.22);
  border: 2px solid rgba(255,255,255,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
}

.profile-detail-name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.profile-detail-role {
  font-size: 13px;
  color: rgba(255,255,255,.82);
}

.profile-avatar-action {
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.42);
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.profile-avatar-action[disabled] {
  opacity: .72;
}

.hidden-file-input {
  display: none;
}

.profile-info-section {
  margin-bottom: 16px;
}

.profile-info-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.profile-info-list {
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.profile-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
}

.profile-info-row:last-child {
  border-bottom: none;
}

.profile-info-label {
  font-size: 13px;
  color: var(--text-2);
  flex-shrink: 0;
}

.profile-info-value {
  font-size: 14px;
  color: var(--text);
  text-align: right;
  line-height: 1.5;
  word-break: break-word;
}

.ticket-hero {
  background: var(--card);
  padding: 14px 18px 16px;
  border-bottom: 1px solid var(--border);
}

.kb-detail-page {
  background: var(--card);
}

.kb-detail-page .kb-article-page-body {
  padding: 0;
  background: var(--card);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.kb-article-page-body {
  padding: 0;
  background: var(--bg);
}

.kb-article-head {
  background: var(--card);
  padding: 18px 18px 16px;
}

.kb-article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.kb-article-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 18px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 700;
}

.kb-article-tag-primary {
  background: #fff1f2;
  color: #e11d48;
}

.kb-article-tag-secondary {
  background: #f1f5f9;
  color: #64748b;
}

.kb-article-title {
  font-size: 26px;
  line-height: 1.45;
  font-weight: 800;
  color: #111827;
  text-align: center;
  margin-bottom: 18px;
}

.kb-article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  color: #667085;
}

.kb-article-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.kb-article-meta-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.kb-article-divider {
  height: 4px;
  background: #111827;
}

.kb-article-content-wrap {
  padding: 18px 10px 24px;
}

.kb-article-content {
  background: var(--card);
  min-height: calc(100vh - 220px);
  padding: 24px 28px 36px;
  box-shadow: var(--shadow);
}

.kb-article-content h2 {
  font-size: 22px;
  line-height: 1.5;
  font-weight: 800;
  color: #111827;
  margin: 24px 0 18px;
}

.kb-article-content h2:first-child {
  margin-top: 0;
}

.kb-article-content h3 {
  font-size: 18px;
  line-height: 1.6;
  font-weight: 800;
  color: #111827;
  margin: 18px 0 14px;
}

.kb-article-content p {
  font-size: 17px;
  line-height: 2;
  color: #111827;
  text-indent: 2em;
  margin: 0 0 14px;
}

.kb-article-content .kb-article-list-item {
  text-indent: 0;
  padding-left: 1.4em;
}

.th-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.th-id {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  color: #111827;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
  padding-right: 10px;
}

.th-date {
  font-size: 11px;
  color: var(--text-3);
  flex-shrink: 0;
}

.th-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 12px;
}

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

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.tag-status-pending { background: var(--warning-bg); color: var(--warning); }
.tag-status-processing { background: var(--primary-light); color: var(--primary); }
.tag-status-resolved { background: var(--success-bg); color: var(--success); }
.tag-status-closed { background: #F9FAFB; color: var(--text-2); }

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px;
}

.info-cell {
  background: var(--card);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.info-cell.full {
  grid-column: 1 / -1;
}

.info-cell-label {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 5px;
}

.info-cell-val {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.section-block {
  background: var(--card);
  border-radius: 12px;
  margin: 0 16px 12px;
  padding: 14px;
  box-shadow: var(--shadow);
}

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

.detail-top-action-row {
  display: flex;
  gap: 8px;
  padding: 0 16px 2px;
  margin-top: 12px;
  margin-bottom: 8px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
}

.detail-top-action-row::-webkit-scrollbar {
  display: none;
}

.detail-top-order-title {
  flex: 1 1 100%;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #86efac;
  background: #f0fdf4;
  color: #166534;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  word-break: break-word;
}

.workflow-action-btn {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
}

.workflow-action-btn:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

.workflow-action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.workflow-action-btn--accepted {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #94a3b8;
}

.detail-primary-action {
  min-height: 32px;
  min-width: 72px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 500;
  transition: all 0.2s ease;
  box-sizing: border-box;
  cursor: pointer;
}

.detail-primary-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.detail-primary-action--danger {
  color: #ef4444;
  border: 1px solid #fecaca;
  background: #ffffff;
}

.detail-primary-action--danger:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #f87171;
}

.detail-primary-action--apply {
  border: 1px solid #93c5fd;
  background: #dbeafe;
  color: #1d4ed8;
}

.detail-primary-action--apply:hover:not(:disabled) {
  background: #bfdbfe;
  border-color: #60a5fa;
}

.detail-primary-action.btn-primary {
  border: none;
  background: var(--primary);
  color: #fff;
}

.detail-field.is-editable .detail-field-input,
.detail-field-block.is-editable .detail-field-input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  color: #334155;
  background: #fff;
}

.detail-field-input:disabled,
.detail-field-textarea:disabled {
  background: #f8fafc;
  color: #94a3b8;
}

.detail-field-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.detail-toggle-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 13px;
  color: #334155;
}

.sb-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.desc-text,
.tf-text,
.flow-desc,
.solution-table td,
.reply-input-wrap textarea,
.hint-banner span {
  font-size: 12px;
  color: #475569;
  line-height: 1.7;
}

.tech-feedback-item + .tech-feedback-item {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.tf-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--text-3);
}

.solution-table {
  width: 100%;
  border-collapse: collapse;
}

.solution-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  vertical-align: top;
}

.solution-table tr:last-child td {
  border-bottom: none;
}

.st-label {
  width: 74px;
  color: var(--text-3);
}

.flow-wrap {
  display: flex;
  flex-direction: column;
}

.flow-node {
  display: flex;
  gap: 12px;
}

.flow-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 24px;
  flex-shrink: 0;
}

.flow-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: #fff;
  border: 2px solid var(--border);
  color: var(--text-3);
}

.flow-dot.done {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.flow-dot.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.flow-line {
  width: 2px;
  flex: 1;
  background: var(--border);
  min-height: 24px;
}

.flow-line.done {
  background: var(--success);
}

.flow-line.active {
  background: var(--primary);
}

.flow-right {
  flex: 1;
  padding-bottom: 14px;
}

.flow-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.flow-name.pending {
  color: var(--text-3);
}

.flow-meta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.flow-desc {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 0 8px 8px 0;
  border-left: 3px solid;
}

.flow-desc.primary {
  background: #eff6ff;
  border-color: var(--primary);
  color: #1e40af;
}

.flow-desc.success {
  background: #f0fdf4;
  border-color: var(--success);
  color: #166534;
}

.history-panel {
  padding-top: 4px;
}

.flow-progress-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.flow-progress-heading::before {
  content: "";
  width: 3px;
  height: 15px;
  background: var(--primary);
  border-radius: 2px;
  flex-shrink: 0;
}

.history-subtitle {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 14px;
}

.history-alert {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 12px;
  line-height: 1.5;
}

.history-timeline {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.history-step {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
}

.history-step-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.history-marker {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #dbe3ef;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.history-marker.current {
  width: 34px;
  height: 34px;
  background: #eff6ff;
  border: 2px solid #93c5fd;
  color: #2563eb;
}

.history-connector {
  width: 2px;
  flex: 1;
  min-height: 38px;
  background: #e5e7eb;
  margin-top: 6px;
}

.history-step-body {
  padding-top: 1px;
  min-width: 0;
}

.history-step-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.history-step-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.history-step-title.current {
  color: #2563eb;
}

.history-badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 6px;
  background: #dbeafe;
  color: #2563eb;
  font-weight: 700;
}

.history-step-primary {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.45;
}

.history-step-primary svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: #94a3b8;
}

.history-step-time {
  margin-top: 6px;
  font-size: 12px;
  color: #9ca3af;
}

.reply-input-wrap textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  min-height: 84px;
  padding: 12px 14px;
  resize: none;
  outline: none;
}

.reply-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.reply-box {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}

.action-row {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.action-row .btn-sm {
  flex: 1;
}

.btn-sm {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
}

.btn-warn {
  background: #f59e0b;
  color: #fff;
}

.hint-banner {
  margin: 0 16px 16px;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.hint-banner.info {
  background: #eff6ff;
  color: #1d4ed8;
}

.hint-banner.warn {
  background: #fff7ed;
  color: #b45309;
}

.hint-banner.success {
  background: #f0fdf4;
  color: #15803d;
}

.hint-banner svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.detail-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: var(--card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.detail-page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.detail-page-body {
  padding-bottom: 24px;
}

.hidden {
  display: none !important;
}

.attachment-link {
  display: flex;
  margin-bottom: 8px;
}

@media (min-width: 640px) {
  body {
    padding: 0;
    background: #eef3fb;
  }

  #app {
    display: block;
    max-width: 520px;
    margin: 0 auto;
  }

  .tab-nav {
    left: 50%;
    right: auto;
    width: min(100vw, 520px);
    transform: translateX(-50%);
  }

  .phone-shell {
    max-width: 520px;
    height: auto;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .phone-shell.app-page {
    height: auto;
  }

  .detail-sheet {
    border-radius: 28px 28px 0 0;
  }
}

@media (max-width: 380px) {
  .stats-row,
  .profile-stats,
  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .info-cell.full {
    grid-column: auto;
  }
}

/* ─── Detail Page Tab Bar ────────────────────────── */
.detail-tab-bar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  padding: 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.detail-tab-bar::-webkit-scrollbar {
  display: none;
}

.dtab {
  flex-shrink: 0;
  padding: 12px 16px 10px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-2);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.dtab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.dtab:not(.active):active {
  color: var(--text);
}

.po-link-block {
  padding-top: 16px;
}

.po-link-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.po-link-subtitle {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}

.po-switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.po-switch input {
  display: none;
}

.po-switch-track {
  width: 50px;
  height: 30px;
  border-radius: 999px;
  background: #dbe4f0;
  display: inline-flex;
  align-items: center;
  padding: 3px;
  transition: background 0.18s ease;
}

.po-switch-knob {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
  transition: transform 0.18s ease;
}

.po-switch.active .po-switch-track {
  background: #5b9cff;
}

.po-switch.active .po-switch-knob {
  transform: translateX(20px);
}

.po-switch input:disabled + .po-switch-track {
  opacity: 0.6;
}

.po-link-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.po-linked-chip {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  font-size: 12px;
  line-height: 1.5;
}

.po-linked-clear {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 0;
  white-space: nowrap;
}

.po-link-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.6;
}

.po-link-result-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.po-link-result {
  width: 100%;
  text-align: left;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.po-link-result.active {
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.12);
}

.po-link-result:active {
  transform: scale(0.99);
}

.po-link-result-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
}

.po-link-result-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-2);
}

.linked-po-tab-block {
  padding-top: 16px;
}

.linked-po-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.linked-po-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 14px;
}

.linked-po-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.linked-po-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.linked-po-card-status {
  flex-shrink: 0;
}

.linked-po-card-name {
  margin-top: 8px;
  font-size: 13px;
  color: #334155;
  line-height: 1.6;
}

.linked-po-meta-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.linked-po-meta-cell {
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e8eef8;
}

.linked-po-meta-label {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 4px;
}

.linked-po-meta-value {
  font-size: 12px;
  color: var(--text);
  line-height: 1.6;
  word-break: break-word;
}

@media (max-width: 380px) {
  .linked-po-meta-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Communication / Comment Block ─────────────── */
.comm-block {
  padding-bottom: 4px;
}

.comm-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 48px;
  max-height: 340px;
  overflow-y: auto;
  padding: 4px 0 10px;
  scroll-behavior: smooth;
}

.comm-empty {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  padding: 18px 0 8px;
}

.comm-msg {
  display: flex;
  align-items: flex-end;
  gap: 7px;
}

.comm-msg-self {
  flex-direction: row-reverse;
}

.comm-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
}

.comm-avatar-self {
  background: var(--primary);
  color: #fff;
}

.comm-bubble-wrap {
  max-width: 72%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.comm-meta {
  font-size: 10px;
  color: var(--text-3);
  padding: 0 4px;
}

.comm-meta-self {
  text-align: right;
}

.comm-bubble {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px 12px 12px 3px;
  padding: 8px 11px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  word-break: break-word;
}

.comm-msg-self .comm-bubble {
  background: var(--primary);
  border-color: var(--primary);
  border-radius: 12px 12px 3px 12px;
  color: #fff;
}

.comm-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
  opacity: 0.9;
}

.comm-bubble-internal {
  background: #fffbeb !important;
  border-color: #f59e0b !important;
  color: #92400e !important;
  border-radius: 12px 12px 12px 3px !important;
}

.comm-msg-self .comm-bubble-internal {
  border-radius: 12px 12px 3px 12px !important;
}

.comm-internal-badge {
  display: inline-block;
  font-size: 9px;
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #f59e0b;
  border-radius: 4px;
  padding: 1px 4px;
  margin: 0 3px;
  vertical-align: middle;
  font-weight: 600;
}

/* ─── Pending-customer read-only notice ─────────── */
.pending-customer-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.pcn-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #dbeafe;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pcn-body {
  flex: 1;
}

.pcn-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e40af;
  margin-bottom: 4px;
}

.pcn-desc {
  font-size: 12px;
  color: #3b82f6;
  line-height: 1.55;
}

.comm-action-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 2px;
  margin-bottom: 8px;
}

.comm-action-desc {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #166534;
  flex: 1;
  line-height: 1.4;
}

.comm-action-btn {
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 8px;
  background: #16a34a;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, opacity 0.15s;
}

.comm-action-btn:disabled {
  opacity: 0.55;
}

.comm-action-btn:not(:disabled):active {
  background: #15803d;
}

.comm-email-reply {
  margin-top: 10px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid #dbe6f6;
  border-radius: 10px;
  background: #f8fbff;
}

.comm-email-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.comm-email-desc {
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
  line-height: 1.5;
}

.comm-email-empty {
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  border: 1px dashed #d6def0;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.comm-email-table-wrap {
  margin-top: 8px;
  overflow-x: auto;
  border: 1px solid #dbe6f6;
  border-radius: 8px;
  background: #fff;
}

.comm-email-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.comm-email-table th,
.comm-email-table td {
  font-size: 11px;
  border-bottom: 1px solid #edf2f7;
  padding: 8px;
  text-align: left;
  color: #334155;
  white-space: nowrap;
}

.comm-email-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
}

.comm-email-table tbody tr:last-child td {
  border-bottom: none;
}

.comm-email-field {
  margin-top: 8px;
}

.comm-email-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.comm-email-label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  color: #64748b;
}

.comm-email-input,
.comm-email-textarea {
  width: 100%;
  border: 1px solid #d6def0;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.5;
}

.comm-email-textarea {
  min-height: 84px;
  resize: vertical;
}

.comm-email-upload-row {
  display: flex;
  justify-content: flex-end;
}

.comm-email-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d6def0;
  border-radius: 8px;
  background: #fff;
  color: #1d4b8f;
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
}

@media (max-width: 420px) {
  .comm-email-grid {
    grid-template-columns: 1fr;
  }
}

.comm-email-send-btn {
  margin-top: 10px;
  width: 100%;
  border: none;
  border-radius: 8px;
  background: #185fa5;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 12px;
}

.comm-email-send-btn:disabled {
  opacity: 0.5;
}

.comm-internal-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 2px;
  font-size: 12px;
  color: var(--text-3);
}

.comm-email-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.comm-email-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #ea580c;
  margin-bottom: 4px;
}

.comm-email-section-note {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 10px;
  line-height: 1.5;
}

.comm-email-card {
  background: #fff;
  border: 1px solid #dbe6f6;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
}

.comm-email-card.is-failed {
  border-color: #fecaca;
  background: #fffbfb;
}

.comm-email-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.comm-email-card-subject {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  line-height: 1.4;
}

.comm-email-card-date {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  flex-shrink: 0;
}

.comm-email-card-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 8px;
}

.comm-email-warn {
  color: #dc2626;
  font-weight: 600;
}

.comm-email-card-row {
  display: flex;
  gap: 8px;
  font-size: 11px;
  line-height: 1.5;
  margin-top: 4px;
}

.comm-email-card-row .label {
  color: #94a3b8;
  width: 28px;
  flex-shrink: 0;
}

.comm-email-card-row .value {
  color: #334155;
  word-break: break-all;
  flex: 1;
}

.comm-email-card-row .value {
  color: #334155;
  word-break: break-all;
  flex: 1;
}

.detail-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.detail-field,
.detail-field-block,
.internal-notes-block {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}

.detail-field.full,
.detail-field-block,
.internal-notes-block {
  grid-column: 1 / -1;
}

.detail-field-label {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 4px;
  line-height: 1.4;
}

.detail-field-label .req {
  color: #dc2626;
  margin-right: 2px;
}

.detail-field-value {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
}

.detail-field-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.internal-notes-block {
  margin-top: 12px;
}

.internal-notes-desc {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 8px;
}

.internal-notes-empty {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 8px;
}

.internal-note-item {
  border-bottom: 1px dashed var(--border);
  padding: 8px 0;
}

.internal-note-item:last-child {
  border-bottom: 0;
}

.internal-note-meta {
  font-size: 10px;
  color: var(--text-3);
  margin-bottom: 4px;
}

.internal-note-body {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
}

.internal-notes-input {
  width: 100%;
  min-height: 72px;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  resize: vertical;
  background: var(--bg);
}

.internal-notes-add-btn {
  margin-top: 8px;
  width: 100%;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
}

.internal-notes-add-btn:disabled {
  opacity: 0.55;
}

@media (max-width: 380px) {
  .detail-field-grid {
    grid-template-columns: 1fr;
  }

  .detail-field.full {
    grid-column: auto;
  }
}

.comm-compose {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.comm-compose-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comm-compose-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: flex-end;
}

.comm-attach-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.comm-attach-btn:hover,
.comm-attach-btn:active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.comm-file-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.comm-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 3px 6px 3px 7px;
  font-size: 11px;
  color: var(--primary);
  max-width: 180px;
}

.comm-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 110px;
}

.comm-file-remove {
  font-size: 14px;
  line-height: 1;
  color: var(--primary);
  opacity: 0.65;
  padding: 0 1px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.comm-file-remove:hover {
  opacity: 1;
}

.comm-vis-row {
  display: flex;
  gap: 6px;
}

.comm-vis-btn {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--card);
  cursor: pointer;
  transition: all 0.15s;
}

.comm-vis-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.comm-vis-btn.active-internal {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
  font-weight: 600;
}

.comm-textarea {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  resize: none;
  background: var(--bg);
  color: var(--text);
  min-height: 38px;
  max-height: 90px;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.18s;
}

.comm-textarea:focus {
  border-color: var(--primary);
  background: #fff;
}

.comm-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.18s, background 0.18s;
  padding: 0;
  align-self: flex-end;
}

.comm-send-btn.comm-send-internal {
  background: #f59e0b;
}

.comm-send-btn:disabled {
  opacity: 0.45;
}

.comm-send-btn:not(:disabled):active {
  background: var(--primary-dark);
}

.comm-send-internal:not(:disabled):active {
  background: #d97706;
}

/* ── Status Choice Field (mirrors admin StatusChoiceField) ───────────────── */
/* Status trigger inside info-cell: remove box chrome, show as chip+arrow inline */
.info-cell.status-info-cell-interactive .scf-box {
  width: auto;
  min-height: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  justify-content: flex-start;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
}

.info-cell.status-info-cell-interactive .scf-box:hover,
.info-cell.status-info-cell-interactive .scf-box:focus {
  border: none;
  box-shadow: none;
  outline: none;
  opacity: 0.85;
}

/* Status dropdown + draft bar rendered immediately below info-grid */
.info-grid ~ .scf-dropdown {
  margin: -4px 16px 8px;
  border-radius: 12px;
}

.info-grid ~ .scf-draft-bar {
  padding: 4px 16px 8px;
}

/* Status in edit form */
.status-form-group {
  padding-bottom: 4px;
}

.status-form-group .scf-box {
  margin-top: 4px;
}

/* Legacy wrapper (no longer used, kept for safety) */
.status-choice-field-wrap {
  padding: 14px 16px 10px;
  background: var(--card, #fff);
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.scf-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3, #9ca3af);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.scf-box {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: #fff;
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.scf-box:not(.scf-disabled):hover {
  border-color: var(--primary, #1a6fe8);
}

.scf-box:not(.scf-disabled):focus {
  outline: none;
  border-color: var(--primary, #1a6fe8);
  box-shadow: 0 0 0 3px rgba(26, 111, 232, 0.12);
}

.scf-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.scf-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.scf-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.scf-arrow {
  color: var(--text-3, #9ca3af);
  font-size: 11px;
  flex-shrink: 0;
}

/* ── Status choice field inline dropdown ─────────────────────────────────── */
.scf-dropdown {
  margin-top: 6px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10);
}

.scf-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: #fff;
  cursor: pointer;
  text-align: left;
  gap: 8px;
  transition: background 0.12s;
}

.scf-option:last-child { border-bottom: none; }
.scf-option:hover { background: #f8fbff; }
.scf-option-selected { font-weight: 700; }

/* Draft action bar (shown below field when a target is selected) */
.scf-draft-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 4px;
}

.scf-draft-arrow {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary, #1a6fe8);
  flex-shrink: 0;
}

.scf-draft-clear {
  background: none;
  border: none;
  color: var(--text-3, #9ca3af);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  flex-shrink: 0;
}

.scf-draft-submit {
  margin-left: auto;
  padding: 8px 18px !important;
  flex-shrink: 0;
}

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

.sla-summary-block {
  padding: 16px;
}

.sla-summary-note {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-3);
  margin-bottom: 12px;
}

.sla-card-grid {
  display: grid;
  gap: 10px;
}

.sla-metric-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: #f8fbff;
}

.sla-metric-card.warn {
  background: #fff9ee;
  border-color: #fcd34d;
}

.sla-metric-card.overdue {
  background: #fff5f5;
  border-color: #fca5a5;
}

.sla-metric-card.done {
  background: #f0fdf4;
  border-color: #86efac;
}

.sla-metric-head,
.sla-metric-meta,
.sla-rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sla-metric-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
}

.sla-metric-target,
.sla-metric-meta,
.sla-rule-label {
  font-size: 12px;
  color: var(--text-3);
}

.sla-metric-countdown {
  margin: 10px 0 8px;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 800;
  color: #1d4ed8;
}

.sla-metric-card.warn .sla-metric-countdown {
  color: #b45309;
}

.sla-metric-card.overdue .sla-metric-countdown {
  color: #dc2626;
}

.sla-metric-card.done .sla-metric-countdown {
  color: #16a34a;
}

.sla-rule-list {
  display: grid;
  gap: 10px;
}

.sla-rule-row {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.sla-rule-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.sla-rule-value {
  flex: 1;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}
