/* ── Header ───────────────────────────────────── */
.noc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header-height);
  padding: 0 16px;
  padding-top: var(--safe-top);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.noc-header-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.noc-header-subtitle {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  display: block;
}

.noc-header-actions {
  display: flex;
  gap: 4px;
}

.noc-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-secondary);
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.noc-icon-btn:active {
  background: var(--bg-tertiary);
}

/* ── Avatar ───────────────────────────────────── */
.noc-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #000;
  flex-shrink: 0;
  background: #555;
}

.noc-avatar-sm {
  width: 36px;
  height: 36px;
  font-size: 14px;
}

/* ── Contact List ─────────────────────────────── */
.noc-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.noc-contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
  background: var(--bg-primary);
  transition: background 0.1s;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
}

.noc-contact-item:active {
  background: var(--bg-secondary);
}

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

.noc-contact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}

.noc-contact-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.noc-contact-time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 8px;
}

.noc-contact-preview {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.noc-contact-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.noc-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
}

.noc-label-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #000;
}

.noc-badge {
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--accent);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
}

/* Swipe action */
.noc-swipe-action {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 80px;
  background: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  transform: translateX(100%);
  transition: transform 0.2s;
}

/* ── Chat Bubbles ─────────────────────────────── */
.noc-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.noc-bubble-wrap {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  margin-bottom: 4px;
}

.noc-bubble-wrap.incoming {
  align-self: flex-start;
  align-items: flex-start;
}

.noc-bubble-wrap.outgoing {
  align-self: flex-end;
  align-items: flex-end;
}

.noc-bubble {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
}

.noc-bubble.incoming {
  background: var(--bubble-incoming);
  color: var(--text-primary);
  border-top-left-radius: 4px;
}

.noc-bubble.outgoing {
  background: var(--bubble-outgoing);
  color: var(--text-primary);
  border-top-right-radius: 4px;
}

.noc-bubble-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-muted);
  justify-content: flex-end;
}

.noc-tick {
  font-size: 13px;
  color: var(--text-muted);
}

.noc-tick.delivered { color: var(--text-muted); }
.noc-tick.read      { color: #53BDEB; }

.noc-date-divider {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 0;
  position: sticky;
  top: 0;
  z-index: 1;
}

.noc-date-divider span {
  background: var(--bg-tertiary);
  padding: 3px 10px;
  border-radius: 999px;
}

/* ── Input Area ───────────────────────────────── */
.noc-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px;
  padding-bottom: calc(8px + var(--safe-bottom));
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
}

.noc-input-wrap {
  flex: 1;
  display: flex;
  align-items: flex-end;
  background: var(--bg-tertiary);
  border-radius: 24px;
  padding: 8px 12px;
  gap: 8px;
  min-height: 44px;
}

.noc-input-wrap textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.4;
  resize: none;
  max-height: 96px;
  overflow-y: auto;
  padding: 0;
  display: block;
}

.noc-input-wrap textarea::placeholder {
  color: var(--text-muted);
}

.noc-emoji-btn,
.noc-quick-btn {
  font-size: 20px;
  color: var(--text-secondary);
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.noc-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

.noc-send-btn.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* ── Emoji Picker ─────────────────────────────── */
.noc-emoji-picker {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  height: 260px;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.2s ease;
  z-index: 20;
}

.noc-emoji-search {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.noc-emoji-search input {
  width: 100%;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 20px;
  padding: 7px 14px;
  color: var(--text-primary);
  outline: none;
  font-size: 14px;
}

.noc-emoji-search input::placeholder {
  color: var(--text-muted);
}

.noc-emoji-categories {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  padding: 0 4px;
}

.noc-emoji-cat-btn {
  padding: 6px 10px;
  font-size: 18px;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.noc-emoji-cat-btn.active {
  opacity: 1;
  border-bottom: 2px solid var(--accent);
}

.noc-emoji-grid {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 2px;
  padding: 6px 8px;
}

.noc-emoji-item {
  width: 38px;
  height: 38px;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
}

.noc-emoji-item:active {
  background: var(--bg-tertiary);
}

/* ── Quick Replies Panel ──────────────────────── */
.noc-quick-panel {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  max-height: 240px;
  overflow-y: auto;
  animation: slideUp 0.15s ease;
  z-index: 20;
}

.noc-quick-item {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}

.noc-quick-item:active {
  background: var(--bg-tertiary);
}

.noc-quick-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2px;
}

.noc-quick-preview {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Modal ────────────────────────────────────── */
.noc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.15s ease;
}

.noc-modal {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 600px;
  padding: 24px 20px;
  padding-bottom: calc(24px + var(--safe-bottom));
  animation: slideUp 0.2s ease;
}

.noc-modal-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.noc-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.noc-modal-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.noc-modal-input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.noc-modal-input:focus {
  border-color: var(--accent);
}

.noc-modal-input::placeholder {
  color: var(--text-muted);
}

.noc-modal-textarea {
  min-height: 100px;
  resize: vertical;
}

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

/* ── Buttons ──────────────────────────────────── */
.noc-btn {
  flex: 1;
  padding: 13px 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.noc-btn-primary {
  background: var(--accent);
  color: #000;
}

.noc-btn-primary:active {
  opacity: 0.85;
}

.noc-btn-ghost {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.noc-btn-ghost:active {
  opacity: 0.75;
}

.noc-btn-danger {
  background: var(--danger);
  color: #fff;
}

/* ── Color Picker ─────────────────────────────── */
.noc-color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.noc-color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.1s, border-color 0.1s;
}

.noc-color-swatch.selected {
  border-color: var(--text-primary);
  transform: scale(1.15);
}

/* ── Label List ───────────────────────────────── */
.noc-label-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.noc-color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.noc-label-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
}

.noc-label-count {
  font-size: 12px;
  color: var(--text-secondary);
  margin-right: 8px;
}

.noc-row-actions {
  display: flex;
  gap: 4px;
}

.noc-row-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.1s;
}

.noc-row-btn:active {
  background: var(--bg-tertiary);
}

/* ── Quick Reply Row ──────────────────────────── */
.noc-qr-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

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

.noc-qr-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 3px;
}

.noc-qr-content {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.noc-qr-uses {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── FAB ──────────────────────────────────────── */
.noc-fab {
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(255,234,42,0.35);
  cursor: pointer;
  border: none;
  z-index: 50;
  transition: var(--transition);
}

.noc-fab:active {
  transform: scale(0.93);
}

/* ── Empty State ──────────────────────────────── */
.noc-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 24px;
  color: var(--text-muted);
}

.noc-empty-icon {
  font-size: 48px;
  opacity: 0.4;
}

.noc-empty-text {
  font-size: 15px;
  text-align: center;
}

/* ── Menu Dropdown ────────────────────────────── */
.noc-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 180px;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: fadeIn 0.15s ease;
  overflow: hidden;
}

.noc-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  transition: background 0.1s;
}

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

/* ── Login ────────────────────────────────────── */
.noc-login-screen {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: var(--bg-primary);
}

.noc-login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
}

.noc-login-symbol {
  font-size: 52px;
  color: var(--accent);
  line-height: 1;
}

.noc-login-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.noc-login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.noc-login-form {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.noc-login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.noc-login-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.noc-login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.noc-login-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 48px 14px 16px;
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}

.noc-login-input:focus {
  border-color: var(--accent);
}

.noc-login-input.no-icon {
  padding-right: 16px;
}

.noc-eye-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.noc-login-error {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  padding: 4px 0;
}

.noc-code-input {
  text-align: center;
  letter-spacing: 0.4em;
  font-size: 24px;
  font-weight: 700;
}

/* ── Pull to refresh ──────────────────────────── */
.noc-ptr-indicator {
  text-align: center;
  padding: 12px;
  color: var(--text-muted);
  font-size: 13px;
  flex-shrink: 0;
}

/* ── Tags on chat header ──────────────────────── */
.noc-header-tags {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  overflow: hidden;
}
