/* ================================================================
   Customer workspace — profile, create flow and status management
   ================================================================ */

#detailModal { align-items: center; }
#detailModal .customer-workspace {
  width: min(1440px, calc(100vw - 40px));
  height: min(900px, calc(100dvh - 40px));
  max-height: calc(100dvh - 40px);
}
#detailModal .modal-head { min-height: 70px; padding: 12px 18px 12px 20px; }
#detailModal .modal-body { min-height: 0; padding: 0; overflow: hidden; }
#detailTitle {
  min-width: 0;
  display: flex;
  align-items: center;
  flex: 1;
  gap: 12px;
}
.workspace-heading { min-width: 0; display: inline-flex; align-items: center; gap: 11px; }
.workspace-heading > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.workspace-heading strong { overflow: hidden; color: var(--color-text); font-size: 16px; font-weight: 710; letter-spacing: -0.02em; text-overflow: ellipsis; white-space: nowrap; }
.workspace-heading small { overflow: hidden; margin-top: 3px; color: var(--color-muted); font-size: 10px; font-weight: 520; text-overflow: ellipsis; white-space: nowrap; }
.customer-monogram {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 11px;
  color: #3730a3;
  background: linear-gradient(145deg, #eef2ff, #e0e7ff);
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.08);
  font-size: 15px;
  font-weight: 740;
}
.new-monogram { color: #fff; background: linear-gradient(145deg, #625bf6, #4338ca); box-shadow: 0 5px 12px rgba(79, 70, 229, 0.2); }
.new-monogram svg { width: 21px; height: 21px; }
.workspace-heading-status { margin-left: auto; padding-right: 4px; }
.workspace-heading-loading > .skeleton { width: 38px; height: 38px; flex: 0 0 auto; }

.workspace-loading { display: grid; gap: 12px; padding: 24px; }
.workspace-loading .skeleton {
  width: 100%;
  height: 148px;
  border: 1px solid rgba(228, 231, 236, 0.72);
  border-radius: var(--radius-md);
}
.workspace-loading .skeleton:first-child { height: 88px; }

/* ---------- desktop workspace ---------- */
.customer-workspace-layout {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(390px, 430px) minmax(0, 1fr);
}
.customer-profile-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--color-border);
  background: #f8f9fc;
}
.customer-profile-scroll { min-height: 0; flex: 1; padding: 16px; overflow-y: auto; overscroll-behavior: contain; }
.customer-activity-pane { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; background: var(--color-surface); }
.activity-summary {
  position: sticky;
  z-index: 2;
  top: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.activity-summary > div { min-width: 0; min-height: 56px; display: flex; align-items: flex-start; justify-content: center; flex-direction: column; padding: 9px 11px; border: 1px solid #eaecf0; border-radius: 10px; background: #fafbfc; }
.activity-summary small { color: var(--color-subtle); font-size: 9px; }
.activity-summary strong { margin-top: 3px; color: var(--color-text); font-size: 17px; font-weight: 700; line-height: 1; }
.activity-summary strong span { color: var(--color-muted); font-size: 9px; font-weight: 520; }
.activity-summary .badge { margin-top: 4px; }
.activity-content { padding: 20px 22px 32px; }
.mobile-workspace-tabs { display: none; }

/* ---------- profile form ---------- */
.customer-form, .customer-readonly { display: grid; gap: 12px; }
.profile-section {
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
}
.profile-section-head { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.profile-section-icon { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 9px; color: var(--color-primary); background: var(--color-primary-soft); }
.profile-section-icon svg { width: 17px; height: 17px; }
.profile-section-head > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.profile-section-head strong { color: var(--color-text); font-size: 12px; font-weight: 680; }
.profile-section-head small { margin-top: 1px; color: var(--color-subtle); font-size: 9px; font-weight: 500; }
.profile-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 10px; }
#detailModal .profile-field { min-width: 0; display: flex; flex-direction: column; gap: 5px; margin: 0; color: var(--color-text-secondary); font-size: 10px; font-weight: 620; }
.profile-field > span { min-height: 15px; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.profile-field > span small { color: var(--color-subtle); font-size: 8px; font-weight: 500; }
.profile-field em { color: var(--color-danger); font-size: 8px; font-style: normal; font-weight: 650; }
.profile-field-wide { grid-column: 1 / -1; }
#detailModal .profile-field input,
#detailModal .profile-field select,
#detailModal .profile-field textarea {
  width: 100%;
  margin: 0;
  border-color: var(--color-border);
  border-radius: 9px;
  background: #fff;
  box-shadow: none;
  font-size: 12px;
}
#detailModal .profile-field input,
#detailModal .profile-field select { height: 39px; padding: 0 10px; }
#detailModal .profile-field textarea { min-height: 84px; padding: 9px 10px; line-height: 1.55; resize: vertical; }
#detailModal .profile-note textarea.note-big { min-height: 118px; }
#detailModal .profile-field input:focus,
#detailModal .profile-field select:focus,
#detailModal .profile-field textarea:focus { border-color: rgba(79, 70, 229, 0.6); box-shadow: 0 0 0 3px var(--color-primary-ring); }
#detailModal .profile-field.has-error input,
#detailModal .profile-field.has-error select,
#detailModal .profile-field.has-error textarea,
#detailModal .profile-field [aria-invalid="true"] { border-color: #f04438; box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.12); }
.profile-note { display: flex; }
.status-static { min-height: 39px; display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--color-border); border-radius: 9px; background: #fafbfc; }
.status-static small { color: var(--color-muted); font-size: 9px; }
.dup-warn {
  position: relative;
  margin: 11px 0 0;
  padding: 9px 10px 9px 33px;
  border: 1px solid #fecdca;
  border-radius: 9px;
  color: var(--color-danger);
  background: var(--color-danger-soft);
  font-size: 9px;
  line-height: 1.5;
}
.dup-warn::before { position: absolute; top: 9px; left: 11px; content: "!"; width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; background: #f04438; font-size: 9px; font-weight: 800; }

.profile-actions {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 24px rgba(16, 24, 40, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.profile-actions > span { color: var(--color-subtle); font-size: 9px; }
.profile-actions > div { display: flex; align-items: center; gap: 7px; }
.profile-actions .btn { min-height: 36px; padding: 7px 11px; font-size: 11px; }
.profile-actions .btn svg { width: 15px; height: 15px; }

/* ---------- readonly profile ---------- */
.readonly-banner { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid #d9d6fe; border-radius: 12px; background: #f7f5ff; }
.readonly-banner > span { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 9px; color: #6941c6; background: #ede9fe; }
.readonly-banner svg { width: 17px; height: 17px; }
.readonly-banner p { min-width: 0; display: flex; flex-direction: column; margin: 0; }
.readonly-banner strong { color: var(--color-text); font-size: 11px; font-weight: 680; }
.readonly-banner small { margin-top: 2px; color: var(--color-muted); font-size: 9px; line-height: 1.4; }
.readonly-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.readonly-item { min-width: 0; min-height: 58px; display: flex; justify-content: center; flex-direction: column; padding: 9px 10px; border: 1px solid #eaecf0; border-radius: 9px; background: #fafbfc; }
.readonly-item > span { color: var(--color-subtle); font-size: 8px; }
.readonly-item > strong { overflow: hidden; margin-top: 3px; color: var(--color-text-secondary); font-size: 11px; font-weight: 620; line-height: 1.45; text-overflow: ellipsis; }
.readonly-wide { grid-column: 1 / -1; min-height: 78px; }
.readonly-wide > strong { overflow: visible; white-space: pre-wrap; word-break: break-word; }

/* ---------- status management ---------- */
.status-management { display: flex; flex-direction: column; gap: 11px; margin-top: 12px; padding: 13px; border: 1px solid var(--color-border); border-radius: 13px; background: var(--color-surface); box-shadow: var(--shadow-xs); }
.status-management-head { display: flex; align-items: center; gap: 9px; }
.status-management-head > span { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 9px; }
.status-management-head svg { width: 17px; height: 17px; }
.status-management-head p { min-width: 0; display: flex; flex-direction: column; margin: 0; }
.status-management-head strong { color: var(--color-text); font-size: 11px; font-weight: 680; }
.status-management-head small { margin-top: 1px; color: var(--color-muted); font-size: 8px; line-height: 1.4; }
.archive-customer { border-color: #fecdca; background: #fffbfa; }
.archive-customer .status-management-head > span { color: var(--color-danger); background: var(--color-danger-soft); }
.restore-customer { border-color: #ddd6fe; background: #fafaff; }
.restore-customer .status-management-head > span { color: #6941c6; background: #ede9fe; }
.status-management-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.status-management-actions > small { color: var(--color-subtle); font-size: 8px; }
.status-management .btn { align-self: flex-end; min-height: 34px; font-size: 10px; }
.status-management .btn svg { width: 15px; height: 15px; }
.status-management-reason { margin: 0; padding: 9px 10px; border-radius: 9px; color: var(--color-text-secondary); background: rgba(255, 255, 255, 0.72); font-size: 10px; line-height: 1.55; }

/* ---------- create customer ---------- */
#detailModal.is-new .customer-workspace { width: min(1040px, calc(100vw - 40px)); height: min(840px, calc(100dvh - 40px)); }
#detailModal.is-new .modal-body { overflow: auto; }
.new-customer-layout { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 270px; }
.new-customer-main { min-width: 0; padding: 18px; background: #f8f9fc; }
.new-customer-main .customer-form { max-width: 700px; }
.new-profile-actions { position: sticky; bottom: -18px; margin: 14px -18px -18px; padding-inline: 18px; }
.new-profile-actions > span i { color: var(--color-danger); font-style: normal; }
.new-customer-guide {
  position: sticky;
  top: 0;
  min-height: 100%;
  align-self: start;
  padding: 28px 24px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 90% 10%, rgba(129, 140, 248, 0.38), transparent 13rem),
    linear-gradient(155deg, #1d2052, #312e81);
}
.new-customer-guide::after { position: absolute; right: -90px; bottom: -110px; width: 240px; height: 240px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; content: ""; box-shadow: 0 0 0 50px rgba(255,255,255,.025); }
.guide-kicker { color: #c7d2fe; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.new-customer-guide h3 { margin: 14px 0 0; font-size: 21px; font-weight: 690; letter-spacing: -0.035em; line-height: 1.3; }
.new-customer-guide > p { margin: 11px 0 0; color: rgba(238,242,255,.68); font-size: 10px; line-height: 1.7; }
.new-customer-guide ol { display: grid; gap: 14px; margin: 26px 0 0; padding: 0; list-style: none; }
.new-customer-guide li { display: flex; align-items: center; gap: 10px; }
.new-customer-guide li > span { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; color: #c7d2fe; background: rgba(255,255,255,.07); font-size: 9px; font-weight: 700; }
.new-customer-guide li p { display: flex; flex-direction: column; margin: 0; }
.new-customer-guide li strong { font-size: 10px; font-weight: 650; }
.new-customer-guide li small { margin-top: 2px; color: rgba(238,242,255,.55); font-size: 8px; }
.guide-note { position: relative; z-index: 1; display: flex; gap: 8px; margin-top: 28px; padding: 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; color: rgba(238,242,255,.74); background: rgba(255,255,255,.06); font-size: 8px; line-height: 1.55; }
.guide-note svg { width: 15px; height: 15px; flex: 0 0 auto; color: #a5b4fc; }

/* ---------- confirm action ---------- */
.action-confirm {
  position: fixed;
  z-index: 220;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(16, 24, 40, 0.52);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: overlay-in var(--duration-normal) var(--ease-standard);
}
.action-confirm-box { width: min(420px, 100%); padding: 24px; border: 1px solid rgba(255,255,255,.24); border-radius: var(--radius-xl); background: var(--color-surface); box-shadow: var(--shadow-overlay); animation: modal-in var(--duration-slow) var(--ease-emphasized); }
.action-confirm-icon { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 14px; color: var(--color-primary); background: var(--color-primary-soft); box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.08); }
.action-confirm-icon.is-danger { color: var(--color-danger); background: var(--color-danger-soft); }
.action-confirm-icon svg { width: 22px; height: 22px; stroke-width: 1.9; }
.action-confirm h2 { margin: 16px 0 0; color: var(--color-text); font-size: 18px; font-weight: 740; letter-spacing: 0; }
.action-confirm p { margin: 7px 0 0; color: var(--color-muted); font-size: 13px; line-height: 1.65; }
.action-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.action-confirm-actions .btn { min-width: 86px; }
.action-confirm-actions .btn.danger { color: #fff; border-color: var(--color-danger); background: var(--color-danger); }
.action-confirm-actions .btn.danger:hover { color: #fff; border-color: var(--color-danger-hover); background: var(--color-danger-hover); }

/* ---------- phase 4: follow-up, screenshots and comment timeline ---------- */
.followup-workspace { display: grid; gap: 18px; }
.followup-composer,
.followup-history,
.general-comments {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
}
.followup-composer { overflow: hidden; }
.composer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(180deg, #fbfcff, #fff);
}
.activity-section-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  background: var(--color-primary-soft);
}
.activity-section-icon svg { width: 18px; height: 18px; }
.composer-head h3,
.timeline-head h3 { margin: 0; color: var(--color-text); font-size: 13px; font-weight: 700; letter-spacing: 0; }
.composer-head p { margin: 2px 0 0; color: var(--color-muted); font-size: 10px; line-height: 1.45; }
#detailModal .composer-date {
  min-width: 158px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0 0 0 auto;
  color: var(--color-text-secondary);
  font-size: 10px;
  font-weight: 620;
}
.composer-date span,
.upload-panel-head span,
.timeline-head span,
.cm-nest-head span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.composer-date svg,
.upload-panel-head svg,
.timeline-head svg,
.cm-nest-head svg { width: 15px; height: 15px; }
#detailModal .composer-date input {
  width: 100%;
  height: 36px;
  margin: 0;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.composer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(180px, 0.65fr);
  gap: 12px;
  padding: 14px 16px 0;
}
#detailModal .composer-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 10px;
  font-weight: 620;
}
.composer-field-wide { grid-column: 1; grid-row: 1 / span 2; }
.composer-field:not(.composer-field-wide) { grid-column: 2; }
#detailModal .composer-field input,
#detailModal .composer-field textarea {
  width: 100%;
  margin: 0;
  border-radius: var(--radius-sm);
  font-size: 12px;
}
#detailModal .composer-field input { height: 40px; padding: 0 10px; }
#detailModal .composer-field textarea.fu-big { min-height: 104px; padding: 10px 11px; line-height: 1.6; }
.upload-panel {
  display: grid;
  gap: 10px;
  margin: 12px 16px 0;
  padding: 10px;
  border: 1px solid #eaecf0;
  border-radius: var(--radius-sm);
  background: #fafbfc;
}
.upload-panel-head,
.timeline-head,
.cm-nest-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.upload-panel-head span { color: var(--color-text); font-size: 11px; font-weight: 680; }
.upload-panel-head small { color: var(--color-subtle); font-size: 9px; font-weight: 540; }
.dropzone {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  padding: 18px;
  border: 1.5px dashed #cfd6e3;
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  background: #fff;
  transition: border-color var(--duration-fast), background var(--duration-fast), color var(--duration-fast);
}
.dropzone.dragover,
.dropzone.uploading { border-color: rgba(79, 70, 229, 0.58); color: var(--color-primary); background: #f4f6ff; }
.dropzone-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  background: var(--color-primary-soft);
}
.dropzone-icon svg { width: 21px; height: 21px; }
.dropzone-icon.is-loading svg { animation: ui-spin 0.8s linear infinite; }
.dropzone-copy { min-width: 0; display: flex; flex-direction: column; text-align: left; }
.dropzone-copy strong { color: var(--color-text); font-size: 12px; font-weight: 700; }
.dropzone-copy small { margin-top: 2px; color: var(--color-muted); font-size: 10px; }
.dropzone .link-btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
  font-size: 11px;
  font-weight: 650;
}
.dropzone .link-btn:hover { color: var(--color-primary); border-color: rgba(79, 70, 229, 0.3); background: #fbfcff; }
.dropzone .link-btn svg { width: 14px; height: 14px; }
.upload-progress { width: min(360px, 100%); }
.upbar { height: 8px; background: #dbe3ef; border-radius: var(--radius-pill); overflow: hidden; }
.upbar-fill { height: 100%; width: 0; background: var(--color-primary); border-radius: inherit; transition: width .12s linear; }
.upbar-text { margin-top: 7px; color: var(--color-primary); font-size: 11px; font-weight: 650; text-align: center; }
.followup-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 14px;
}
.followup-composer-actions > span { color: var(--color-subtle); font-size: 9px; line-height: 1.45; }
.followup-composer-actions .btn svg,
.btn-row .btn svg { width: 14px; height: 14px; }

.fu-shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin: 0;
}
.fu-shot-item { position: relative; min-width: 0; display: block; }
.fu-shot-item .fu-thumb-ph { width: 100%; height: 120px; }
.shot-remove {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: var(--radius-sm);
  color: #fff;
  background: rgba(16, 24, 40, 0.66);
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.16);
}
.shot-remove:hover { background: var(--color-danger); }
.shot-remove svg { width: 15px; height: 15px; }

.followup-history,
.general-comments { padding: 16px; }
.timeline-head { margin-bottom: 14px; }
.timeline-head > div { min-width: 0; display: flex; flex-direction: column; }
.timeline-head span { color: var(--color-subtle); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.timeline-head strong {
  min-width: 30px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  background: var(--color-primary-soft);
  font-size: 12px;
  font-weight: 750;
}
.timeline { position: relative; display: grid; gap: 14px; }
.timeline::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 13px;
  width: 2px;
  border-radius: var(--radius-pill);
  background: #e8edf5;
  content: "";
}
.tl-item {
  position: relative;
  min-width: 0;
  padding: 14px 14px 14px 42px;
  border: 1px solid #eaecf0;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-xs);
}
.timeline-marker {
  position: absolute;
  z-index: 1;
  top: 14px;
  left: 0;
  width: 28px;
  display: flex;
  justify-content: center;
}
.timeline-marker span {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.18), 0 5px 12px rgba(79, 70, 229, 0.18);
  font-size: 7px;
  font-weight: 760;
  line-height: 1.15;
  text-align: center;
}
.tl-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  color: var(--color-muted);
  font-size: 11px;
}
.tl-meta-main { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 7px 9px; }
.timeline-date {
  color: var(--color-text);
  font-size: 12px;
  font-weight: 700;
}
.tl-author { min-width: 0; color: var(--color-muted); }
.fu-counts {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  color: var(--color-info);
  background: var(--color-info-soft);
  font-size: 10px;
  font-weight: 680;
  white-space: nowrap;
}
.tl-actions { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.icon-link,
.tl-del,
.tl-edit {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 10px;
  font-weight: 650;
}
.icon-link svg,
.tl-del svg,
.tl-edit svg { width: 13px; height: 13px; }
.tl-edit { color: var(--color-primary); }
.tl-del { color: var(--color-danger); }
.tl-edit:hover { border-color: rgba(79, 70, 229, 0.18); background: var(--color-primary-soft); }
.tl-del:hover { border-color: rgba(180, 35, 24, 0.18); background: var(--color-danger-soft); }
.tl-content {
  margin-top: 12px;
  padding: 10px 11px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  background: #f8f9fc;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.tl-edit-text {
  width: 100%;
  min-height: 92px;
  margin: 0;
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.fu-shot {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.fu-shot-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.fu-thumb-ph {
  position: relative;
  width: 142px;
  height: 108px;
  display: inline-block;
  flex: 0 0 auto;
  overflow: hidden;
  padding: 0;
  border: 1px solid #d8dee9;
  border-radius: var(--radius-sm);
  background: #f8f9fc;
  cursor: pointer;
  vertical-align: middle;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast);
}
.fu-thumb-ph:hover { border-color: rgba(79, 70, 229, 0.45); box-shadow: 0 0 0 3px var(--color-primary-ring); transform: translateY(-1px); }
.fu-thumb-cam {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  background: #f8f9fc;
}
.fu-thumb-cam svg { width: 25px; height: 25px; }
.fu-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top;
  background: #fff;
}
.fu-thumb-label {
  position: absolute;
  left: 7px;
  bottom: 7px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  color: #fff;
  background: rgba(16, 24, 40, 0.72);
  font-size: 9px;
  font-weight: 700;
}
.fu-shot-caption { color: var(--color-subtle); font-size: 9px; }
.fu-replace { margin-left: auto; }
.fu-replace-toggle svg { width: 14px; height: 14px; }
.fu-replace-zone { width: min(520px, 100%); margin-top: 8px; }
.fu-replace-drop { min-height: 96px; padding: 14px; }

.cm-nest {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
.cm-nest-head { margin-bottom: 4px; }
.cm-nest-head span { color: var(--color-muted); font-size: 10px; font-weight: 680; }
.cm-nest-head strong {
  min-width: 24px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  color: var(--color-muted);
  background: #f2f4f7;
  font-size: 10px;
}
.cm-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 7px 10px;
  padding: 10px 0;
  border-top: 1px solid #edf0f5;
}
.cm-nest-head + .cm-item,
.general-comment-list > .cm-item:first-child { border-top: 0; }
.cm-avatar {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-row: 1 / span 4;
  border-radius: var(--radius-sm);
  color: #155eef;
  background: #eff8ff;
  font-size: 11px;
  font-weight: 750;
}
.cm-head {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-muted);
  font-size: 10px;
}
.cm-author {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  color: var(--color-text);
  font-size: 11px;
  font-weight: 700;
}
.cm-head time { color: var(--color-subtle); white-space: nowrap; }
.cm-head .tl-actions { margin-left: auto; }
.cm-item > .tl-content {
  grid-column: 2;
  margin-top: 0;
  padding: 0;
  background: transparent;
  font-size: 12px;
}
.cm-tools,
.cm-reply-box,
.cm-children { grid-column: 2; }
.link-btn.comment-action {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 650;
}
.link-btn.comment-action svg { width: 14px; height: 14px; }
.cm-reply-box {
  margin: 4px 0 0;
  padding: 10px;
  border: 1px solid #eaecf0;
  border-radius: var(--radius-sm);
  background: #fafbfc;
}
.cm-reply-box .cm-text {
  min-height: 70px;
  margin: 0;
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.cm-children {
  margin-top: 5px;
  padding-left: 12px;
  border-left: 2px solid #dbe3ef;
}
.cm-children .cm-item { padding-top: 9px; padding-bottom: 9px; }
.general-comment-list { display: grid; gap: 0; }
.empty-activity {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 210px;
  padding: 28px;
  border: 1px dashed #d8dee9;
  border-radius: var(--radius-md);
  color: var(--color-muted);
  background: linear-gradient(180deg, #fbfcff, #f8fafc);
  text-align: center;
}
.empty-activity > span {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.08);
}
.empty-activity svg { width: 21px; height: 21px; }
.empty-activity strong { color: var(--color-text); font-size: 13px; }
.empty-activity p { margin: 0; font-size: 10px; }

.lightbox {
  position: fixed;
  z-index: var(--z-lightbox);
  inset: 0;
  display: block;
  overflow: auto;
  padding: 0;
  background: rgba(8, 13, 28, 0.92);
}
.lightbox-toolbar {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 16px;
  color: #fff;
  background: rgba(8, 13, 28, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.lightbox-toolbar > span { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 680; }
.lightbox-toolbar svg { width: 17px; height: 17px; }
.lightbox-stage {
  min-height: calc(100dvh - 58px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
}
.lightbox img {
  width: auto;
  max-width: min(1040px, 96vw);
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
}
.lightbox-close {
  position: static;
  width: auto;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius-sm);
  color: #fff;
  background: rgba(255,255,255,.08);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255,255,255,.16); }

@media (max-width: 1100px) {
  .customer-workspace-layout { grid-template-columns: minmax(350px, 380px) minmax(0, 1fr); }
  .activity-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .new-customer-layout { grid-template-columns: minmax(0, 1fr) 240px; }
  .new-customer-guide { padding-inline: 20px; }
}

@media (max-width: 720px) {
  #detailModal { align-items: stretch; padding: 0; background: var(--color-surface); }
  #detailModal .customer-workspace,
  #detailModal.is-new .customer-workspace {
    width: 100%;
    height: 100dvh;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  #detailModal .modal-head { min-height: calc(64px + env(safe-area-inset-top)); padding: max(10px, env(safe-area-inset-top)) 10px 10px 14px; }
  #detailModal .modal-close { width: 44px; height: 44px; }
  #detailModal .modal-body { display: block; overflow-y: auto; background: #f8f9fc; }
  #detailTitle { gap: 6px; }
  .workspace-heading { gap: 9px; }
  .workspace-heading strong { max-width: 190px; font-size: 14px; }
  .workspace-heading small { max-width: 200px; font-size: 9px; }
  .customer-monogram { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }
  .workspace-heading-status { padding-right: 0; }
  .workspace-heading-status .badge { padding-inline: 7px; }

  .mobile-workspace-tabs {
    position: sticky;
    z-index: 6;
    top: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .mobile-workspace-tabs button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 9px; color: var(--color-muted); background: transparent; font-size: 11px; font-weight: 620; }
  .mobile-workspace-tabs button.is-active { color: #3730a3; background: var(--color-primary-soft); }
  .mobile-workspace-tabs button span { min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; color: var(--color-muted); background: #f2f4f7; font-size: 8px; }
  .mobile-workspace-tabs button.is-active span { color: #3730a3; background: #e0e7ff; }

  .customer-workspace-layout { height: auto; display: block; }
  .customer-profile-pane { min-height: calc(100dvh - 120px); border-right: 0; background: #f8f9fc; }
  .customer-profile-scroll { overflow: visible; padding: 12px; }
  .customer-activity-pane { display: none; overflow: visible; }
  .customer-workspace-layout.mobile-show-activity .customer-profile-pane { display: none; }
  .customer-workspace-layout.mobile-show-activity .customer-activity-pane { display: block; }
  .profile-actions { position: sticky; bottom: 0; padding: 11px 12px calc(11px + env(safe-area-inset-bottom)); }
  .profile-actions > span { display: none; }
  .profile-actions > div { width: 100%; }
  .profile-actions .btn { min-height: 44px; flex: 1; font-size: 11px; }

  .profile-section { padding: 14px; border-radius: 13px; }
  .profile-form-grid { grid-template-columns: 1fr; gap: 12px; }
  .profile-field-wide { grid-column: auto; }
  #detailModal .profile-field { font-size: 11px; }
  #detailModal .profile-field input,
  #detailModal .profile-field select { height: 44px; font-size: 16px; }
  #detailModal .profile-field textarea { min-height: 96px; font-size: 16px; }
  #detailModal .profile-note textarea.note-big { min-height: 150px; }
  .readonly-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .readonly-item { min-height: 64px; }
  .readonly-wide { grid-column: 1 / -1; }
  .status-management { margin-top: 0; }
  .status-management .btn { min-height: 42px; }

  .activity-summary { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px 12px; }
  .activity-summary > div { min-height: 58px; padding: 8px 10px; border-radius: 9px; }
  .activity-content { padding: 12px 12px calc(32px + env(safe-area-inset-bottom)); }
  .followup-workspace { gap: 14px; }
  .followup-composer,
  .followup-history,
  .general-comments { border-radius: var(--radius-sm); }
  .composer-head { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(128px, 39%); align-items: center; gap: 10px; padding: 12px; }
  .composer-head > div { min-width: 0; }
  .composer-head p { display: none; }
  .composer-head .activity-section-icon { grid-column: 1; grid-row: 1; }
  #detailModal .composer-date {
    width: 100%;
    min-width: 0;
    grid-column: 3;
    grid-row: 1;
    margin-left: 0;
    font-size: 11px;
  }
  #detailModal .composer-date input { height: 40px; padding-inline: 9px; font-size: 15px; }
  .composer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px 12px 0; }
  .composer-field-wide { grid-column: 1 / -1; grid-row: auto; }
  .composer-field:not(.composer-field-wide) { grid-column: auto; }
  #detailModal .composer-field { font-size: 11px; }
  #detailModal .composer-field input { height: 44px; font-size: 16px; }
  #detailModal .composer-field textarea.fu-big { min-height: 124px; font-size: 16px; }
  .upload-panel { gap: 8px; margin: 11px 12px 0; padding: 10px; }
  .upload-panel-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .dropzone { min-height: 104px; align-items: center; gap: 10px; padding: 12px; }
  .dropzone-icon { width: 38px; height: 38px; }
  .dropzone-icon svg { width: 19px; height: 19px; }
  .dropzone-copy { text-align: left; }
  .dropzone .link-btn { width: auto; min-width: 112px; min-height: 38px; }
  .followup-composer-actions { align-items: stretch; flex-direction: column; padding: 10px 12px 12px; }
  .followup-composer-actions > span { text-align: center; }
  .followup-composer-actions .btn { min-height: 44px; width: 100%; }
  .fu-shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fu-shot-item .fu-thumb-ph { height: 112px; }

  .followup-history,
  .general-comments { padding: 13px; }
  .timeline { gap: 12px; }
  .timeline::before { left: 13px; }
  .tl-item { padding: 13px 12px 13px 40px; border-radius: var(--radius-sm); }
  .timeline-marker { top: 13px; }
  .tl-meta { align-items: flex-start; flex-direction: row; justify-content: space-between; gap: 10px; }
  .tl-meta-main { flex: 1 1 auto; padding-right: 6px; }
  .tl-actions { align-self: flex-start; flex-wrap: nowrap; margin-left: auto; }
  .icon-link,
  .tl-del,
  .tl-edit { min-height: 30px; padding: 5px 8px; }
  .tl-content { font-size: 13px; }
  .fu-shot { align-items: stretch; flex-direction: column; }
  .fu-shot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fu-thumb-ph { width: 100%; height: 112px; }
  .fu-replace { width: 100%; margin-left: 0; }
  .fu-replace-toggle { width: 100%; min-height: 40px; }
  .fu-replace-zone { width: 100%; }
  .fu-replace-drop { min-height: 126px; }

  .cm-nest { margin-top: 13px; }
  .cm-item { grid-template-columns: 28px minmax(0, 1fr); gap: 7px 8px; }
  .cm-avatar { width: 28px; height: 28px; }
  .cm-head { align-items: flex-start; flex-wrap: wrap; gap: 5px 7px; }
  .cm-head .tl-actions { width: 100%; margin-left: 0; }
  .cm-children { padding-left: 8px; }
  .cm-reply-box .cm-text { min-height: 88px; font-size: 16px; }
  .cm-reply-box .btn-row { justify-content: stretch; }
  .cm-reply-box .btn-row .btn { flex: 1; min-height: 40px; }
  .empty-activity { min-height: 180px; padding: 24px 16px; }

  .lightbox-toolbar { min-height: 56px; padding: 9px 12px max(9px, env(safe-area-inset-top)); }
  .lightbox-toolbar > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lightbox-close { height: 38px; padding-inline: 10px; }
  .lightbox-stage { min-height: calc(100dvh - 56px); padding: 14px 8px max(24px, env(safe-area-inset-bottom)); }
  .lightbox img { max-width: calc(100vw - 16px); border-radius: var(--radius-xs); }

  #detailModal.is-new .mobile-workspace-tabs { display: none; }
  .new-customer-layout { display: block; }
  .new-customer-main { padding: 12px; }
  .new-customer-guide { display: none; }
  .new-profile-actions { position: sticky; bottom: -12px; margin: 14px -12px -12px; padding: 11px 12px calc(11px + env(safe-area-inset-bottom)); }
  .new-profile-actions > div { width: 100%; }

  .action-confirm { align-items: flex-end; padding: 12px; }
  .action-confirm-box { padding: 20px; border-radius: 18px; }
  .action-confirm-actions .btn { min-height: 44px; flex: 1; }
}

@media (max-width: 380px) {
  .workspace-heading strong { max-width: 155px; }
  .workspace-heading small { max-width: 165px; }
  .readonly-grid { grid-template-columns: 1fr; }
  .readonly-wide { grid-column: auto; }
  .composer-head { grid-template-columns: 34px minmax(0, 1fr); }
  #detailModal .composer-date { grid-column: 1 / -1; grid-row: auto; }
  .dropzone { align-items: stretch; flex-direction: column; }
  .dropzone-copy { text-align: center; }
  .dropzone-icon { align-self: center; }
  .dropzone .link-btn { width: 100%; }
}
