/* LINE customer-workspace styles, split out of styles.css (LINE stability Step 5).
   Loaded AFTER styles.css in index.html so these LINE-exclusive rules keep their
   cascade + any .line-* overrides of shared base rules still win. Only rules whose
   every selector is rooted in a .line-/#line- element were moved; shared/combined
   selectors stayed in styles.css. */
.line-ai-control {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: #eef8f6;
}

.line-ai-control.off {
  border-color: rgba(185, 28, 28, 0.26);
  background: #fff1f2;
}

.line-ai-control.handover {
  border-color: rgba(217, 119, 6, 0.3);
  background: #fff7ed;
}

.line-ai-control div:first-child {
  display: grid;
  gap: 2px;
}

.line-ai-control span,
.line-ai-control small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.line-ai-control code {
  color: var(--text);
  font-size: 11px;
}

.line-ai-control-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

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

.line-reply-schedule {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #cfe0f3;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fbff, #f2f7ff);
}

.line-reply-schedule-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.line-reply-schedule-head > div {
  display: grid;
  gap: 4px;
}

.line-reply-schedule-head strong {
  color: var(--text);
  font-size: 13px;
}

.line-reply-schedule-status {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  color: #475569;
  background: #e8eef7;
  font-size: 11px;
  font-weight: 800;
}

.line-reply-schedule-status.active {
  color: #047857;
  background: #d1fae5;
}

.line-reply-schedule-status.paused {
  color: #b45309;
  background: #ffedd5;
}

.line-reply-schedule-status.pending {
  color: #1d4ed8;
  background: #dbeafe;
}

.line-reply-schedule-toggle {
  display: flex;
  grid-template-columns: none;
  gap: 7px;
  align-items: center;
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.line-reply-schedule-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #1473ff;
}

.line-reply-schedule-controls {
  display: grid;
  gap: 10px;
}

.line-reply-schedule-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.line-reply-schedule-day {
  position: relative;
  display: block;
}

.line-reply-schedule-day input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.line-reply-schedule-day span {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd8e8;
  border-radius: 8px;
  color: #52647a;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}

.line-reply-schedule-day input:checked + span {
  border-color: #7db5ff;
  color: #0b5fce;
  background: #e8f2ff;
}

.line-reply-schedule-day input:focus-visible + span {
  outline: 3px solid rgba(20, 115, 255, 0.2);
  outline-offset: 2px;
}

.line-reply-schedule-day input:disabled + span {
  cursor: not-allowed;
}

.line-reply-schedule-time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.line-reply-schedule-time-grid input {
  width: 100%;
}

.line-reply-schedule-controls.is-disabled .line-reply-schedule-days,
.line-reply-schedule-controls.is-disabled .line-reply-schedule-time-grid {
  opacity: 0.52;
}

.line-reply-schedule-summary {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.line-reply-schedule-save {
  justify-self: end;
}

.integration-state.scheduled-pause,
.line-status-strip div.scheduled-pause {
  border-color: rgba(217, 119, 6, 0.28);
  background: #fff7ed;
}

.line-status-strip div.paused {
  border-color: rgba(185, 28, 28, 0.26);
  background: #fff1f2;
}

@media (max-width: 980px) {
  .line-reply-schedule-days {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .line-reply-schedule-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .line-reply-schedule-days {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .line-reply-schedule-time-grid {
    grid-template-columns: 1fr;
  }

  .line-reply-schedule-save {
    width: 100%;
  }
}

.line-dashboard-card {
  display: grid;
  gap: 12px;
}

.line-dashboard-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.line-dashboard-controls select {
  min-height: 34px;
}

.line-stats-dashboard {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.line-stats-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.line-stat-tile {
  display: grid;
  gap: 4px;
  min-width: 0;
  min-height: 86px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.line-stat-tile span,
.line-stat-tile small,
.line-dashboard-heading span,
.line-dashboard-footnote {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.line-stat-tile strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.line-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 12px;
  min-width: 0;
}

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

.line-dashboard-heading {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}

.line-day-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18px, 1fr));
  gap: 5px;
  min-height: 180px;
  align-items: end;
  padding-top: 8px;
}

.line-day-bar {
  display: grid;
  grid-template-rows: minmax(120px, 1fr) 18px;
  gap: 5px;
  align-items: end;
  min-width: 0;
}

.line-day-bar-fill {
  display: block;
  width: 100%;
  min-height: 3px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #16a34a, #1473ff);
}

.line-day-bar small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-hour-list {
  display: grid;
  gap: 8px;
}

.line-hour-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.line-hour-row div {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.line-hour-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #06c755;
}

.line-hour-row strong {
  text-align: right;
}

.line-dashboard-table {
  max-height: 300px;
}

.line-dashboard-table table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  background: var(--panel);
}

.line-dashboard-table th,
.line-dashboard-table td {
  padding: 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.line-dashboard-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 12px;
}

.line-dashboard-table td strong,
.line-dashboard-table td small {
  display: block;
}

.line-dashboard-table td small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.line-dashboard-footnote {
  padding-top: 2px;
}

.line-learning-note {
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  line-height: 1.45;
}

.line-review-card.reviewed {
  border-color: #bbf7d0;
  background: #f7fee7;
}

.line-followup-case.overdue {
  border-color: #fecaca;
  background: #fff7ed;
}

.line-review-dialog {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.line-review-dialog p {
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.line-review-note {
  padding: 8px;
  border-left: 3px solid #1473ff;
  background: #f8fafc;
  color: var(--text);
  font-size: 13px;
}

.line-review-actions .quality-good {
  border: 1px solid #86efac;
  background: #dcfce7;
  color: #166534;
}

.line-auto-reply-page {
  min-width: 0;
}

.line-auto-reply-page-header {
  align-items: center;
  gap: 20px;
}

.line-auto-reply-heading {
  min-width: 0;
  max-width: 720px;
}

.line-auto-reply-page-actions {
  flex: 0 0 auto;
}

.line-auto-reply-page-actions button,
.line-auto-reply-actions button,
.line-auto-reply-add-card,
.line-auto-reply-image-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.line-auto-reply-page-actions .icon-button {
  flex: 0 0 42px;
  width: 42px;
  padding: 0;
}

.line-auto-reply-body {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(420px, 1fr) minmax(280px, 340px);
  gap: 12px;
  min-height: 0;
  padding: 14px 16px 24px;
}

.line-auto-reply-list-card,
.line-auto-reply-editor-card,
.line-auto-reply-preview-card {
  min-width: 0;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.045);
}

.line-auto-reply-list-card,
.line-auto-reply-preview-card {
  position: sticky;
  top: 88px;
  max-height: calc(100dvh - 108px);
  overflow: hidden;
}

.line-auto-reply-list-card {
  display: grid;
  grid-template-rows: auto minmax(120px, 1fr) auto;
}

.line-auto-reply-list-head,
.line-auto-reply-form-head,
.line-auto-reply-preview-head,
.line-auto-reply-actions {
  padding: 14px 16px;
}

.line-auto-reply-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.line-auto-reply-list-summary,
.line-auto-reply-form-head > div,
.line-auto-reply-section-head > div,
.line-auto-reply-preview-head > div,
.line-auto-reply-card-editor-head > div {
  min-width: 0;
}

.line-auto-reply-list-summary > span,
.line-auto-reply-form-head span,
.line-auto-reply-card-editor-head span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.line-auto-reply-list-head strong,
.line-auto-reply-form-head h3,
.line-auto-reply-card-editor-head strong {
  display: block;
  margin: 0;
  color: var(--text);
}

.line-auto-reply-rule-count {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 6px;
  background: #eef5ff;
  color: #0f5bc5;
  font-size: 11px;
  font-weight: 800;
}

.line-auto-reply-rule-list {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 9px;
  scrollbar-gutter: stable;
}

.line-auto-reply-rule-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  min-height: 62px;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 10px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #f8fafc;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.line-auto-reply-rule-button:hover,
.line-auto-reply-rule-button.active {
  border-color: rgba(20, 115, 255, 0.4);
  background: #eef5ff;
}

.line-auto-reply-rule-button.active {
  box-shadow: inset 3px 0 0 #1473ff;
}

.line-auto-reply-rule-button.inactive {
  opacity: 0.64;
}

.line-auto-reply-rule-button span {
  min-width: 0;
}

.line-auto-reply-rule-button strong,
.line-auto-reply-rule-button small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-auto-reply-rule-button strong {
  color: var(--text);
  font-size: 13px;
}

.line-auto-reply-rule-button small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.line-auto-reply-rule-button em,
.line-auto-reply-active-toggle {
  background: #e8f2ff;
  color: #0f5bc5;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.line-auto-reply-rule-button em {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 6px;
}

.line-auto-reply-help {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.line-auto-reply-help .ui-icon {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: #0f5bc5;
}

.line-auto-reply-help strong {
  color: var(--text);
  font-size: 12px;
}

.line-auto-reply-help p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.line-auto-reply-editor-card {
  overflow: visible;
}

.line-auto-reply-form {
  display: grid;
  gap: 0;
}

.line-auto-reply-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.line-auto-reply-form-head h3 {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-auto-reply-active-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 7px;
  white-space: nowrap;
}

.line-auto-reply-active-toggle input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
}

.line-auto-reply-form-section {
  border-bottom: 1px solid var(--line);
}

.line-auto-reply-section-head {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 12px;
}

.line-auto-reply-section-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: #e8f2ff;
  color: #0f5bc5;
  font-size: 12px;
  font-weight: 900;
}

.line-auto-reply-section-head strong,
.line-auto-reply-preview-head strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.line-auto-reply-section-head small,
.line-auto-reply-preview-head small,
.line-auto-reply-form small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.line-auto-reply-section-body {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
}

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

.line-auto-reply-rule-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(112px, 0.65fr);
}

.line-auto-reply-match-field {
  grid-column: 1 / -1;
}

.line-auto-reply-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #52657d;
  font-size: 11px;
  font-weight: 800;
}

.line-auto-reply-card-editor > .line-auto-reply-field,
.line-auto-reply-card-editor > .line-auto-reply-grid {
  margin-inline: 14px;
}

.line-auto-reply-form input,
.line-auto-reply-form select,
.line-auto-reply-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: inherit;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.line-auto-reply-form input:focus,
.line-auto-reply-form select:focus,
.line-auto-reply-form textarea:focus {
  outline: 0;
  border-color: #4f91ed;
  box-shadow: 0 0 0 3px rgba(20, 115, 255, 0.1);
}

.line-auto-reply-form input,
.line-auto-reply-form select {
  min-height: 40px;
  padding: 0 11px;
}

.line-auto-reply-form textarea {
  min-height: 92px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.55;
}

.line-auto-reply-drive-note {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
}

.line-auto-reply-image-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.line-auto-reply-add-card {
  align-self: center;
  white-space: nowrap;
}

.line-auto-reply-card-editors {
  display: grid;
  gap: 10px;
  padding: 0 18px 18px;
}

.line-auto-reply-card-editor {
  display: grid;
  gap: 11px;
  padding: 0 0 14px;
  overflow: visible;
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  background: #fff;
}

.line-auto-reply-card-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid #e6edf6;
  background: #f8fafc;
  border-radius: 8px 8px 0 0;
}

.line-auto-reply-card-editor-head .tiny-icon {
  color: #b42318;
}

.line-auto-reply-actions {
  position: sticky;
  z-index: 3;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.045);
  backdrop-filter: blur(10px);
}

.line-auto-reply-preview-card {
  display: flex;
  flex-direction: column;
}

.line-auto-reply-preview-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.line-auto-reply-preview-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  color: #18794e;
  font-size: 10px;
  font-weight: 800;
}

.line-auto-reply-preview-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.line-auto-reply-preview-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.line-auto-reply-phone-preview {
  display: grid;
  gap: 10px;
  min-height: 360px;
  align-content: start;
  padding: 14px;
  background: #eef7f8;
}

.line-auto-reply-preview-bubble {
  max-width: 94%;
  padding: 11px 12px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 8px 8px 8px 3px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.06);
  line-height: 1.55;
}

.line-auto-reply-rich-grid {
  display: grid;
  gap: 10px;
}

.line-auto-reply-rich-card {
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.06);
}

.line-auto-reply-rich-card img,
.line-auto-reply-rich-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 1.51 / 1;
  object-fit: cover;
  background: #e2e8f0;
}

.line-auto-reply-rich-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.line-auto-reply-rich-card strong,
.line-auto-reply-rich-card p {
  display: block;
  margin: 0;
  padding: 0 12px;
}

.line-auto-reply-rich-card strong {
  padding-top: 12px;
}

.line-auto-reply-rich-card p {
  padding-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.line-auto-reply-rich-card button {
  width: calc(100% - 24px);
  min-height: 38px;
  margin: 12px;
  border: 0;
  border-radius: 7px;
  background: #1473ff;
  color: #fff;
  font-weight: 800;
}

.line-auto-reply-preview-empty {
  display: grid;
  min-height: 260px;
  margin: 14px;
  padding: 16px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.line-status-strip div.ready {
  border-color: rgba(15, 118, 110, 0.2);
  background: #ecfdf5;
}

.line-status-strip div.live {
  position: relative;
  overflow: hidden;
}

.line-status-strip div.live::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.14);
}

.line-page-status {
  padding: 16px 20px 0;
}

.line-page.line-focus-mode {
  overflow: hidden;
}

.line-page.line-focus-mode .line-page-header {
  flex: 0 0 auto;
  padding: 12px 16px;
}

.line-page.line-focus-mode .line-page-header p,
.line-page.line-focus-mode .line-page-status,
.line-page.line-focus-mode .line-page-grid {
  display: none;
}

.line-page.line-focus-mode .line-page-header h2 {
  font-size: 22px;
}

.line-page.line-focus-mode .line-inbox-workspace {
  flex: 1 1 auto;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1.6fr) minmax(300px, 380px);
  min-height: 0;
  height: 100%;
  padding: 12px 16px 16px;
  overflow: hidden;
}

.line-page.line-focus-mode .line-inbox-list-panel,
.line-page.line-focus-mode .line-inbox-chat-panel,
.line-page.line-focus-mode .line-inbox-detail-panel {
  min-height: 0;
}

.line-page.line-focus-mode .line-inbox-chat-panel {
  min-height: 0;
}

.line-page.line-focus-mode .line-inbox-messages {
  padding: 18px;
}

.line-page.line-focus-mode .line-inbox-bubble {
  max-width: min(760px, 76%);
  padding: 11px 13px;
  font-size: 15px;
}

.line-page.line-focus-mode .line-inbox-composer {
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 12px 14px;
}

.line-page.line-focus-mode .line-inbox-composer textarea {
  min-height: 46px;
  font-size: 15px;
}

.line-inbox-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(420px, 1fr) minmax(260px, 340px);
  gap: 12px;
  min-height: 620px;
  padding: 16px 20px 0;
}

.line-inbox-chat-panel { grid-column: 2; }

.line-inbox-detail-panel { grid-column: 3; }

#line-page .line-inbox-workspace.line-list-collapsed {
  grid-template-columns: 0 minmax(0, 1fr) minmax(260px, 340px);
}

#line-page .line-inbox-workspace.line-list-collapsed .line-inbox-list-panel {
  display: none;
}

#line-page .line-inbox-workspace.line-detail-collapsed {
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr) 0;
}

#line-page .line-inbox-workspace.line-detail-collapsed .line-inbox-detail-panel {
  display: none;
}

#line-page .line-inbox-workspace.line-list-collapsed.line-detail-collapsed {
  grid-template-columns: 0 minmax(0, 1fr) 0;
}

.line-inbox-list-panel,
.line-inbox-chat-panel,
.line-inbox-detail-panel {
  min-width: 0;
  border: 1px solid #dbe6f4;
  border-radius: 8px;
  background: #fff;
}

.line-inbox-list-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.line-inbox-search {
  padding: 10px;
  border-bottom: 1px solid #e5eef8;
}

.line-inbox-search input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #d6e2f1;
  border-radius: 8px;
  font: inherit;
}

.line-inbox-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid #e5eef8;
}

.line-inbox-summary button {
  display: grid;
  gap: 1px;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f8fafc;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.line-inbox-summary button:hover,
.line-inbox-summary button.active {
  border-color: rgba(20, 115, 255, 0.24);
  background: #eaf3ff;
}

.line-inbox-summary button.alert {
  background: #fff7ed;
  color: #9a3412;
}

.line-inbox-summary button.alert.active {
  border-color: rgba(234, 88, 12, 0.32);
  background: #ffedd5;
}

.line-inbox-summary strong {
  font-size: 18px;
  line-height: 1;
}

.line-inbox-summary span {
  color: var(--muted);
  font-size: 11px;
}

.line-inbox-list {
  overflow: auto;
  padding: 6px;
}

.line-inbox-load-more {
  display: grid;
  gap: 7px;
  padding: 10px 6px 6px;
  text-align: center;
}

.line-inbox-load-more small {
  color: var(--muted);
  font-size: 10px;
}

.line-inbox-load-more button {
  width: 100%;
  min-height: 36px;
}

.line-inbox-load-more.complete {
  border-top: 1px solid #e4edf7;
}

.line-inbox-contact {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 9px;
  width: 100%;
  padding: 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.line-inbox-contact:hover,
.line-inbox-contact.active {
  background: #eaf4ff;
}

.line-inbox-contact.unread {
  position: relative;
  background: #f0fdf4;
}

.line-inbox-contact.unread::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 999px;
  background: #16a34a;
}

.line-inbox-contact.unread:hover,
.line-inbox-contact.unread.active {
  background: #dcfce7;
}

.line-inbox-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 50%;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 900;
}

.line-inbox-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.line-inbox-contact-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.line-inbox-contact-copy strong,
.line-inbox-contact-copy small,
.line-inbox-contact-copy em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-inbox-contact-copy small,
.line-inbox-contact-copy em,
.line-inbox-contact-side time {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.line-inbox-contact-side {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.line-inbox-contact-side b {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-size: 11px;
}

.line-inbox-chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
}

/* Visual cue while dragging an image/file over the LINE chat to attach it. */
.line-inbox-chat-panel.line-drag-over {
  outline: 2px dashed #1473ff;
  outline-offset: -8px;
  background: #eef6ff;
}

.line-inbox-chat-header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 10px 14px;
  border-bottom: 1px solid #e5eef8;
}

.line-inbox-chat-header div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.line-inbox-chat-header strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-inbox-chat-header span {
  color: var(--muted);
  font-size: 12px;
}

.line-inbox-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.line-inbox-messages {
  min-height: 0;
  overflow: auto;
  overflow-anchor: none;
  padding: 14px;
  background: #f8fafc;
}

.line-inbox-message {
  display: grid;
  margin: 8px 0;
}

.line-inbox-message.customer {
  justify-items: start;
}

.line-inbox-message.staff {
  justify-items: end;
}

.line-inbox-message.system {
  justify-items: center;
  margin: 10px 0;
}

.line-inbox-bubble {
  max-width: min(640px, 78%);
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid #e5eef8;
  border-radius: 16px 16px 16px 5px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.line-inbox-message.staff .line-inbox-bubble {
  border-color: #0b84ff;
  border-radius: 16px 16px 5px 16px;
  color: #fff;
  background: #0b84ff;
}

.line-inbox-bubble.line-inbox-sticker-bubble {
  max-width: min(230px, 72%);
  padding: 6px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.line-inbox-message.staff .line-inbox-bubble.line-inbox-sticker-bubble {
  color: #0f2744;
  background: transparent;
}

.line-inbox-message.system .line-inbox-bubble {
  max-width: min(520px, 86%);
  padding: 7px 12px;
  border-color: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  color: #64748b;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
  text-align: center;
}

.line-inbox-message-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.2;
}

.line-inbox-message.staff .line-inbox-message-meta {
  color: rgba(255, 255, 255, 0.78);
}

.line-inbox-sticker-bubble .line-inbox-message-meta {
  margin-bottom: 2px;
  padding: 0 4px;
  color: #64748b;
}

.line-inbox-sticker-message {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.line-inbox-sticker-message img {
  display: block;
  width: auto;
  max-width: min(152px, 38vw);
  height: auto;
  max-height: 152px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.16));
}

.line-inbox-sticker-message-fallback {
  display: none;
  min-width: 120px;
  padding: 10px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  color: #475569;
  background: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.line-inbox-sticker-message-fallback small {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.line-inbox-sticker-message.preview-error img {
  display: none;
}

.line-inbox-sticker-message.preview-error .line-inbox-sticker-message-fallback {
  display: block;
}

.line-inbox-message-text,
.line-inbox-system-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.line-inbox-message-text a {
  color: #0f5fd7;
  font-weight: 700;
}

.line-inbox-message.staff .line-inbox-message-text a {
  color: #fff;
  text-decoration: underline;
}

.line-inbox-auto-reply-card {
  display: grid;
  gap: 8px;
}

.line-inbox-auto-reply-head {
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
}

.line-inbox-auto-reply-head span {
  font-weight: 900;
}

.line-inbox-auto-reply-head small {
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  line-height: 1.25;
}

.line-inbox-ai-feedback {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.line-inbox-ai-feedback-status {
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  line-height: 1.2;
}

.line-inbox-ai-feedback div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.line-inbox-ai-feedback button {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 800;
  cursor: pointer;
}

.line-inbox-ai-feedback button:hover {
  background: rgba(255, 255, 255, 0.22);
}

.line-inbox-ai-feedback button.quality-good {
  border-color: rgba(187, 247, 208, 0.86);
  background: rgba(22, 163, 74, 0.34);
}

.line-inbox-ai-feedback button.danger-lite {
  border-color: rgba(254, 202, 202, 0.9);
  background: rgba(220, 38, 38, 0.32);
}

.line-inbox-message-time {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.2;
  opacity: 0.76;
}

.line-inbox-file-card {
  display: grid;
  gap: 7px;
  min-width: min(260px, 58vw);
}

.line-inbox-file-card strong,
.line-inbox-file-card span {
  display: block;
  overflow-wrap: anywhere;
}

.line-inbox-file-card span {
  font-size: 11px;
  opacity: 0.78;
}

.line-inbox-file-card a {
  color: inherit;
  font-weight: 800;
}

.line-inbox-file-preview {
  display: block;
}

.line-inbox-file-preview img {
  display: block;
  width: min(260px, 58vw);
  max-height: 280px;
  border-radius: 10px;
  object-fit: cover;
}

.line-inbox-album {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 120px));
  gap: 5px;
  margin-top: 5px;
}

.line-inbox-album img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
}

.line-inbox-selected-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid #e5eef8;
  background: #f8fafc;
}

.line-inbox-selected-files span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  font-size: 12px;
}

.line-inbox-selected-files span.has-thumb {
  padding: 4px 8px 4px 4px;
  border-radius: 10px;
}

.line-inbox-file-thumb {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  object-fit: cover;
  background: #dbeafe;
}

.line-inbox-selected-files button {
  border: 0;
  background: transparent;
  color: #dc2626;
  cursor: pointer;
  font-weight: 900;
}

.line-inbox-composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px 12px;
  border-top: 1px solid #e5eef8;
  background: #fff;
}

.line-inbox-composer textarea {
  min-height: 40px;
  max-height: 260px;
  resize: none;
  padding: 10px 12px;
  border: 1px solid #d6e2f1;
  border-radius: 8px;
  font: inherit;
}

.line-inbox-detail-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 12px;
}

.line-inbox-profile {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #e5eef8;
  border-radius: 8px;
  background: #f8fafc;
}

.line-inbox-profile span,
.line-inbox-profile small,
.line-inbox-profile p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.line-inbox-ai-status {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.line-inbox-ai-status div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.line-inbox-ai-status span {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.line-inbox-ai-status strong {
  color: #0f172a;
  font-size: 13px;
}

.line-inbox-ai-status small {
  color: #475569;
  font-size: 11px;
  line-height: 1.45;
}

.line-inbox-ai-status.handover {
  border-color: #fed7aa;
  background: #fff7ed;
}

.line-inbox-ai-status.off {
  border-color: #fecaca;
  background: #fef2f2;
}

.line-inbox-tag-form {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
}

.line-inbox-tag-form .crm-tag-editor {
  padding: 0;
  border: 0;
  background: transparent;
}

.line-inbox-tag-form .crm-tag-editor-head {
  display: grid;
  gap: 3px;
}

.line-inbox-tag-form .crm-tag-suggestions div {
  max-height: 92px;
  overflow: auto;
}

.line-inbox-tag-form > small {
  color: #3f5f56;
  font-size: 11px;
  line-height: 1.45;
}

.line-inbox-note-field {
  display: grid;
  gap: 4px;
}

.line-inbox-note-field > span {
  font-size: 12px;
  font-weight: 600;
  color: #14532d;
}

.line-inbox-note-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 60px;
  resize: vertical;
  padding: 7px 9px;
  border: 1px solid #bbf7d0;
  border-radius: 7px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: #0f172a;
}

.line-inbox-note-input:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18);
}

.line-inbox-side-section {
  display: grid;
  gap: 8px;
}

.line-inbox-side-section h3 {
  margin: 0;
  font-size: 13px;
}

.line-inbox-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.line-inbox-photo-grid a {
  display: block;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 8px;
  background: #e2e8f0;
}

.line-inbox-photo-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.line-status-strip {
  grid-template-columns: minmax(260px, 1.35fr) repeat(3, minmax(150px, 0.75fr));
}

.line-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.85fr);
  gap: 14px;
  padding: 16px 20px 20px;
}

.line-page-stats-card,
.line-page-quality-card {
  overflow: hidden;
}

.line-page-stats-card {
  grid-row: span 3;
}

@media (max-width: 1120px) {
  .line-inbox-workspace {
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  }

  .line-page.line-focus-mode .line-inbox-workspace {
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  }

  .line-inbox-detail-panel {
  grid-column: 1 / -1;
  max-height: 320px;
  }

  .line-page.line-focus-mode .line-inbox-detail-panel {
  grid-column: 1 / -1;
  max-height: 260px;
  }
}

@media (max-width: 760px) {
  .app-shell.line-auto-reply-mode .sidebar,
  .app-shell.line-auto-reply-mode .chat-panel,
  .app-shell.line-auto-reply-mode .context-panel {
  display: none;
  }

  .line-inbox-workspace {
  grid-template-columns: 1fr;
  min-height: auto;
  padding: 12px;
  }

  .line-page.line-focus-mode .line-inbox-workspace {
  grid-template-columns: 1fr;
  height: auto;
  min-height: 0;
  overflow: auto;
  padding: 10px;
  }

  .line-inbox-list-panel {
  max-height: 360px;
  }

  .line-page.line-focus-mode .line-inbox-list-panel {
  max-height: 230px;
  }

  .line-inbox-chat-panel {
  height: min(600px, calc(var(--app-height, 100dvh) - 200px));
  min-height: 360px;
  }

  .line-page.line-focus-mode .line-inbox-chat-panel {
  min-height: min(620px, calc(var(--app-height, 100vh) - 260px));
  }

  .line-inbox-detail-panel {
  grid-column: auto;
  max-height: none;
  }

  .line-page.line-focus-mode .line-inbox-detail-panel {
  display: none;
  }

  .line-inbox-chat-header {
  align-items: stretch;
  flex-direction: column;
  }

  .line-inbox-chat-actions {
  justify-content: flex-start;
  }

  .line-inbox-composer {
  grid-template-columns: minmax(0, 1fr);
  }

  .line-inbox-composer .primary {
  grid-column: 1 / -1;
  }

  .line-page-stats-card {
  grid-row: auto;
  }

  .line-page-followup-card,
  .line-page-quality-card {
  max-height: none;
  }

  .line-dashboard-heading,
  .line-review-card header,
  .line-followup-case header {
  display: grid;
  }

  .line-review-actions button,
  .line-followup-actions button {
  flex: 1 1 120px;
  }
}

/* Compact command header for the LINE customer workspace. */
.line-page-header {
  align-items: center;
  flex: 0 0 auto;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 10px 16px;
  min-height: 0;
  margin: 0;
  padding: 8px 14px;
  border: 0;
  border-bottom: 1px solid #dbe6f4;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.line-page-heading {
  position: relative;
  flex: 0 0 172px;
  min-width: 172px;
  max-width: 172px;
  padding-left: 11px;
}

.line-page-heading::before {
  content: "";
  position: absolute;
  inset: 2px auto 2px 0;
  width: 3px;
  border-radius: 2px;
  background: #06c755;
}

.line-page-heading .workspace-page-kicker {
  display: none;
  color: #13795b;
  font-size: 11px;
}

.line-page-header .line-page-heading h2 {
  font-size: 19px;
  line-height: 1.15;
}

.line-page-header .line-page-heading p {
  display: none;
}

.line-page-header .line-page-actions {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  width: auto;
  gap: 6px;
}

.line-page-action-row {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.line-page-action-row-label {
  display: none;
}

.line-page-action-buttons {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.line-page-more-menu {
  position: relative;
  min-width: 0;
}

.line-page-more-menu > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid #d6e2f1;
  border-radius: 6px;
  color: #31506f;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.line-page-more-menu > summary::-webkit-details-marker {
  display: none;
}

.line-page-more-menu[open] > summary {
  border-color: #1473ff;
  background: #eaf3ff;
  color: #0867df;
}

.line-page-more-menu > .line-page-management-actions {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  display: grid;
  width: max-content;
  min-width: 230px;
  gap: 6px;
  padding: 8px;
  border: 1px solid #d6e2f1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
}

.line-page-more-menu > .line-page-management-actions button {
  justify-content: flex-start;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
}

.line-page-management-actions {
  flex: 0 1 auto;
}

.line-page-view-actions {
  flex: 0 1 auto;
}

.line-page-action-buttons button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 0;
  min-height: 32px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.line-page-action-buttons .ui-icon {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}

.line-page-action-buttons button.active {
  border-color: #1473ff;
  background: #eaf3ff;
  color: #0867df;
}

.line-page-action-buttons .line-page-refresh-button {
  width: 32px;
  min-width: 32px;
  padding: 0;
}

.line-page-refresh-button .ui-icon {
  width: 15px;
  height: 15px;
}

@media (min-width: 761px) {
  .line-page-view-actions button:not(#line-page-toggle-focus) {
    flex: 0 0 32px;
    width: 32px;
    min-width: 32px;
    padding: 0;
  }

  .line-page-view-actions button:not(#line-page-toggle-focus) > span {
    display: none;
  }

  .line-page-view-actions #line-page-toggle-focus {
    width: auto;
    min-width: 118px;
    padding: 0 10px;
  }
}

/* The familiar LINE OA mode removes the Office Chat navigation columns so
   staff can focus on the customer queue, the selected chat, and an optional
   customer-detail drawer. The visible mode button always provides the exit. */
@media (min-width: 761px) {
  .app-shell.line-mode.line-focus-mode {
    grid-template-columns: minmax(0, 1fr);
    width: 100vw;
    max-width: none;
    padding: 10px;
  }

  .app-shell.line-mode.line-focus-mode .workspace-rail,
  .app-shell.line-mode.line-focus-mode .sidebar {
    display: none !important;
  }

  .app-shell.line-mode.line-focus-mode .line-page {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    border-left: 0;
    border-radius: 14px;
  }
}

.line-page.line-focus-mode .line-page-header {
  padding: 10px 16px;
}

.line-page.line-focus-mode .line-page-heading {
  max-width: 220px;
}

.line-page.line-focus-mode .line-page-heading .workspace-page-kicker {
  display: none;
}

@media (max-width: 760px) {
  .line-page-header {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
  }

  .line-page-heading {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
  }

  .line-page-header .line-page-actions {
    flex-basis: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .line-page-action-row {
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 5px;
  }

  .line-page-action-buttons {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }

  .line-page-action-buttons button {
    flex: 1 1 120px;
  }

  .line-page-more-menu {
    flex: 1 1 auto;
  }

  .line-page-more-menu > summary {
    width: 100%;
    min-height: 40px;
  }

  .line-page-more-menu > .line-page-management-actions {
    right: auto;
    left: 0;
    width: min(320px, calc(100vw - 32px));
  }

  .line-page-view-actions button,
  .line-page-view-actions .line-page-refresh-button {
    flex: 0 0 40px;
    width: 40px;
    min-width: 40px;
    padding: 0;
  }

  .line-page-view-actions #line-page-toggle-detail {
    display: none;
  }

  .line-page-view-actions button > span {
    display: none;
  }
}

@media (max-width: 520px) {
  .line-page-action-buttons button {
    flex-basis: calc(50% - 3px);
  }

  .line-page-view-actions button,
  .line-page-view-actions .line-page-refresh-button {
    flex: 0 0 40px;
    width: 40px;
    min-width: 40px;
  }
}

/* LINE sticker picker: keep the catalog wide, scannable, and separate pins from sending. */
.line-inbox-sticker-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(372px, 48vh);
  gap: 0;
  overflow: hidden;
  padding: 0;
  border-top: 1px solid #dbe7f5;
  background: #f8fbff;
}

.line-inbox-sticker-panel-header {
  align-items: flex-start;
  margin: 0;
  padding: 10px 12px 4px;
}

.line-inbox-sticker-panel-header > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.line-inbox-sticker-panel-header span {
  line-height: 1.35;
}

.line-inbox-sticker-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 8px;
  padding: 0 12px 10px;
}

.line-inbox-sticker-search {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #cdddef;
  border-radius: 8px;
  background: #fff;
  color: #5d6f85;
}

.line-inbox-sticker-search .ui-icon {
  width: 16px;
  height: 16px;
}

.line-inbox-sticker-search input,
.line-inbox-sticker-toolbar select {
  min-width: 0;
  height: 34px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #0f2744;
  font: inherit;
  font-size: 12px;
}

.line-inbox-sticker-toolbar select {
  padding: 0 9px;
  border: 1px solid #cdddef;
  border-radius: 8px;
  background: #fff;
}

.line-inbox-sticker-scroll {
  display: grid;
  min-height: 0;
  gap: 10px;
  overflow: auto;
  padding: 0 12px 12px;
}

.line-inbox-sticker-pinned-section,
.line-inbox-sticker-catalog-section {
  display: grid;
  gap: 7px;
}

.line-inbox-sticker-pinned-section {
  padding: 8px;
  border: 1px solid #bcd5f5;
  border-radius: 8px;
  background: #edf6ff;
}

.line-inbox-sticker-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #173454;
}

.line-inbox-sticker-section-heading strong {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 900;
}

.line-inbox-sticker-section-heading strong .ui-icon {
  width: 15px;
  height: 15px;
  color: #f59e0b;
}

.line-inbox-sticker-section-heading span {
  color: #607189;
  font-size: 11px;
}

.line-inbox-sticker-pinned-grid {
  display: grid;
  grid-auto-columns: 92px;
  grid-auto-flow: column;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.line-inbox-sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}

.line-inbox-sticker-card {
  position: relative;
  min-width: 0;
}

.line-inbox-sticker-option,
.line-inbox-sticker-card .line-inbox-sticker-option {
  display: grid;
  grid-template-rows: minmax(70px, 1fr) auto auto;
  gap: 4px;
  width: 100%;
  min-height: 118px;
  padding: 6px;
  border: 1px solid #d8e6f6;
  border-radius: 8px;
  background: #fff;
  color: #0f2744;
  text-align: left;
  box-shadow: 0 3px 10px rgba(15, 39, 68, 0.05);
}

.line-inbox-sticker-card .line-inbox-sticker-option:hover,
.line-inbox-sticker-card .line-inbox-sticker-option:focus-visible {
  border-color: #1473ff;
  background: #f4f8ff;
}

.line-inbox-sticker-card.is-featured .line-inbox-sticker-option {
  border-color: #9ec5ff;
}

.line-inbox-sticker-card.is-pinned .line-inbox-sticker-option {
  min-height: 106px;
  border-color: #91bdf2;
}

.line-inbox-sticker-card .line-sticker-preview-wrap {
  min-height: 70px;
  border-radius: 7px;
}

.line-inbox-sticker-card .line-sticker-preview {
  max-width: 76px;
  max-height: 70px;
}

.line-inbox-sticker-card .line-sticker-label {
  display: -webkit-box;
  overflow: hidden;
  color: #173454;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.line-inbox-sticker-card .line-inbox-sticker-option small {
  overflow: hidden;
  color: #6c7e93;
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-inbox-sticker-pin {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 1;
  width: 28px !important;
  min-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 !important;
  border: 1px solid #cdddef !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.94) !important;
  color: #6b7f98 !important;
  box-shadow: 0 2px 7px rgba(15, 39, 68, 0.12);
}

.line-inbox-sticker-pin:hover,
.line-inbox-sticker-pin:focus-visible,
.line-inbox-sticker-pin.is-pinned {
  border-color: #f59e0b !important;
  background: #fff7dd !important;
  color: #c88100 !important;
}

.line-inbox-sticker-pin .ui-icon {
  width: 15px;
  height: 15px;
}

.line-inbox-sticker-card.preview-error .line-sticker-preview {
  display: none;
}

.line-inbox-sticker-card.preview-error .line-sticker-fallback {
  display: grid;
}

.line-inbox-sticker-pinned-empty,
.line-inbox-sticker-empty {
  padding: 10px;
  border: 1px dashed #c7d8ec;
  border-radius: 8px;
  color: #6c7e93;
  font-size: 11px;
  text-align: center;
}

.line-inbox-sticker-empty {
  grid-column: 1 / -1;
  background: #fff;
}

@media (max-width: 760px) {
  .line-inbox-sticker-panel {
    max-height: min(390px, 56vh);
  }

  .line-inbox-sticker-toolbar {
    grid-template-columns: minmax(0, 1fr) 118px;
    padding-inline: 9px;
  }

  .line-inbox-sticker-scroll {
    padding-inline: 9px;
  }

  .line-inbox-sticker-grid {
    grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
    gap: 6px;
  }

  .line-inbox-sticker-pinned-grid {
    grid-auto-columns: 82px;
    gap: 6px;
  }

  .line-inbox-sticker-option,
  .line-inbox-sticker-card .line-inbox-sticker-option {
    min-height: 102px;
    padding: 5px;
  }

  .line-inbox-sticker-card.is-pinned .line-inbox-sticker-option {
    min-height: 96px;
  }

  .line-inbox-sticker-card .line-sticker-preview-wrap {
    min-height: 60px;
  }

  .line-inbox-sticker-card .line-sticker-preview {
    max-width: 66px;
    max-height: 60px;
  }
}

/* LINE OA-style collaboration: room search, internal notes, handoff and
   conflict-safe cross-device drafts. Keep these rules last so they also work
   with the compact/focus workspace overrides above. */
.line-inbox-chat-panel {
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto auto auto auto auto auto;
}

.line-inbox-chat-panel > .line-inbox-chat-header { grid-row: 1; }
.line-inbox-chat-panel > .line-inbox-collaboration-toolbar { grid-row: 2; }
.line-inbox-chat-panel > .line-inbox-history-search-panel { grid-row: 3; }
.line-inbox-chat-panel > .line-inbox-history-context { grid-row: 4; }
.line-inbox-chat-panel > .line-inbox-messages { grid-row: 5; }
.line-inbox-chat-panel > .line-inbox-selected-files { grid-row: 6; }
.line-inbox-chat-panel > .line-inbox-quick-reply-panel { grid-row: 7; }
.line-inbox-chat-panel > .line-inbox-sticker-panel { grid-row: 8; }
.line-inbox-chat-panel > .line-inbox-composer-mode { grid-row: 9; }
.line-inbox-chat-panel > .line-inbox-draft-conflict { grid-row: 10; }
.line-inbox-chat-panel > .line-inbox-composer { grid-row: 11; }

.line-inbox-collaboration-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 7px 10px;
  overflow-x: auto;
  border-bottom: 1px solid #e5eef8;
  background: #fbfdff;
  scrollbar-width: thin;
}

.line-inbox-collaboration-toolbar button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 9px;
  color: #334155;
  font-size: 12px;
  font-weight: 850;
}

.line-inbox-collaboration-toolbar button .ui-icon {
  width: 16px;
  height: 16px;
}

.line-inbox-collaboration-toolbar button > span[aria-hidden="true"] {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 5px;
  color: #0f5fd7;
  background: #dbeafe;
  font-size: 12px;
  font-weight: 950;
}

.line-inbox-collaboration-toolbar button[aria-pressed="true"],
.line-inbox-collaboration-toolbar button.active {
  border-color: #fbbf24;
  color: #92400e;
  background: #fffbeb;
}

.line-inbox-collaboration-toolbar button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.line-inbox-collaboration-toolbar kbd {
  padding: 2px 5px;
  border: 1px solid #cbd5e1;
  border-bottom-width: 2px;
  border-radius: 5px;
  color: #64748b;
  background: #fff;
  font: 700 9px/1.1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.line-inbox-history-search-panel {
  display: grid;
  gap: 7px;
  max-height: min(300px, 42vh);
  padding: 9px 10px 10px;
  overflow: hidden;
  border-bottom: 1px solid #bfdbfe;
  background: #eff6ff;
}

.line-inbox-history-search-panel[hidden],
.line-inbox-history-context[hidden],
.line-inbox-composer-mode[hidden],
.line-inbox-draft-conflict[hidden] {
  display: none !important;
}

.line-inbox-history-search-panel > header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.line-inbox-history-search-field {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #93c5fd;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.07);
}

.line-inbox-history-search-field .ui-icon {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  color: #2563eb;
}

.line-inbox-history-search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
}

.line-inbox-history-search-panel > header > .icon-button {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
}

.line-inbox-history-search-status {
  min-height: 17px;
  color: #475569;
  font-size: 11px;
  line-height: 1.4;
}

.line-inbox-history-search-status.error {
  color: #b91c1c;
}

.line-inbox-history-search-results {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow: auto;
}

.line-inbox-history-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #dbeafe;
  border-radius: 9px;
  color: #1e293b;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.line-inbox-history-result:hover,
.line-inbox-history-result:focus-visible,
.line-inbox-history-result[aria-selected="true"] {
  border-color: #60a5fa;
  background: #f8fbff;
  outline: none;
}

.line-inbox-history-result strong,
.line-inbox-history-result p,
.line-inbox-history-result small,
.line-inbox-history-result time {
  margin: 0;
}

.line-inbox-history-result strong {
  overflow: hidden;
  color: #0f2744;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-inbox-history-result time,
.line-inbox-history-result small {
  color: #64748b;
  font-size: 10px;
}

.line-inbox-history-result p {
  grid-column: 1 / -1;
  display: -webkit-box;
  overflow: hidden;
  color: #334155;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.line-inbox-history-result mark {
  padding: 0 2px;
  border-radius: 3px;
  color: inherit;
  background: #fef08a;
}

.line-inbox-history-empty {
  padding: 14px;
  border: 1px dashed #bfdbfe;
  border-radius: 9px;
  color: #64748b;
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  text-align: center;
}

.line-inbox-history-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px solid #fde68a;
  background: #fffbeb;
}

.line-inbox-history-context > div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.line-inbox-history-context strong {
  color: #92400e;
  font-size: 12px;
}

.line-inbox-history-context span {
  overflow: hidden;
  color: #a16207;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-inbox-history-context button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: #92400e;
  background: #fff;
}

.line-inbox-history-context button b {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  color: #fff;
  background: #dc2626;
  font-size: 10px;
}

.line-inbox-composer-mode,
.line-inbox-draft-conflict {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-top: 1px solid #fde68a;
  background: #fffbeb;
}

.line-inbox-composer-mode > div,
.line-inbox-draft-conflict > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.line-inbox-composer-mode strong,
.line-inbox-draft-conflict strong {
  color: #92400e;
  font-size: 12px;
}

.line-inbox-composer-mode span,
.line-inbox-draft-conflict span {
  color: #a16207;
  font-size: 11px;
  line-height: 1.35;
}

.line-inbox-composer-mode button,
.line-inbox-draft-conflict button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 9px;
  font-size: 11px;
}

.line-inbox-draft-conflict {
  border-top-color: #fecaca;
  border-bottom: 1px solid #fecaca;
  background: #fff7ed;
}

.line-inbox-draft-conflict strong {
  color: #b91c1c;
}

.line-inbox-draft-conflict span {
  color: #9a3412;
}

.line-inbox-draft-conflict-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.line-inbox-composer {
  position: relative;
}

.line-inbox-composer > .line-inbox-tools,
.line-inbox-composer > textarea,
.line-inbox-composer > button[type="submit"] {
  grid-row: 1;
}

.line-inbox-composer > .line-inbox-tools { grid-column: 1; }
.line-inbox-composer > textarea { grid-column: 2; }
.line-inbox-composer > button[type="submit"] { grid-column: 3; }

.line-inbox-draft-status {
  grid-row: 2;
  grid-column: 2 / 4;
  justify-self: end;
  min-height: 0;
  color: #64748b;
  font-size: 10px;
  line-height: 1.1;
}

.line-inbox-draft-status.saving { color: #2563eb; }
.line-inbox-draft-status.saved { color: #15803d; }
.line-inbox-draft-status.conflict { color: #c2410c; }
.line-inbox-draft-status.error { color: #b91c1c; }

.line-inbox-composer.internal-note,
.line-inbox-composer[data-mode="internal"],
.line-inbox-composer[data-mode="internal-note"] {
  border-top-color: #fbbf24;
  background: #fffdf5;
}

.line-inbox-composer.internal-note textarea,
.line-inbox-composer[data-mode="internal"] textarea,
.line-inbox-composer[data-mode="internal-note"] textarea {
  border-color: #fbbf24;
  color: #78350f;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.08);
}

.line-inbox-composer.internal-note button[type="submit"],
.line-inbox-composer[data-mode="internal"] button[type="submit"],
.line-inbox-composer[data-mode="internal-note"] button[type="submit"] {
  border-color: #d97706 !important;
  background: #d97706 !important;
}

/* Rendering hooks used by line-workspace.js for internal-only events. */
.line-inbox-message.internal-note,
.line-inbox-message[data-system-type="line_internal_note"] {
  justify-items: center;
}

.line-inbox-message.internal-note .line-inbox-bubble,
.line-inbox-message[data-system-type="line_internal_note"] .line-inbox-bubble {
  width: min(620px, 88%);
  max-width: min(620px, 88%);
  border: 1px solid #fbbf24;
  border-left-width: 4px;
  border-radius: 12px;
  color: #78350f;
  background: #fffbeb;
  box-shadow: 0 4px 14px rgba(146, 64, 14, 0.07);
}

.line-inbox-message.internal-note .line-inbox-message-meta,
.line-inbox-message[data-system-type="line_internal_note"] .line-inbox-message-meta {
  color: #a16207;
}

.line-inbox-internal-label,
.line-inbox-handoff-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  margin-bottom: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #92400e;
  background: #fef3c7;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.line-inbox-message.handoff,
.line-inbox-message[data-system-type="line_handoff"],
.line-inbox-message[data-system-type="line_handoff_ack"] {
  justify-items: center;
}

.line-inbox-message.handoff .line-inbox-bubble,
.line-inbox-message[data-system-type="line_handoff"] .line-inbox-bubble,
.line-inbox-message[data-system-type="line_handoff_ack"] .line-inbox-bubble,
.line-inbox-handoff-card {
  width: min(620px, 88%);
  max-width: min(620px, 88%);
  border: 1px solid #a5b4fc;
  border-left: 4px solid #6366f1;
  border-radius: 12px;
  color: #312e81;
  background: #eef2ff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.08);
}

.line-inbox-message.handoff .line-inbox-message-meta,
.line-inbox-message[data-system-type="line_handoff"] .line-inbox-message-meta,
.line-inbox-message[data-system-type="line_handoff_ack"] .line-inbox-message-meta {
  color: #6366f1;
}

.line-inbox-handoff-badge {
  color: #3730a3;
  background: #e0e7ff;
}

.line-inbox-handoff-card {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
}

.line-inbox-handoff-card button {
  justify-self: start;
  min-height: 32px;
}

.line-inbox-message.is-history-target .line-inbox-bubble,
.line-inbox-message.line-inbox-message-target .line-inbox-bubble {
  outline: 3px solid rgba(250, 204, 21, 0.78);
  outline-offset: 3px;
  animation: line-history-target-pulse 1.35s ease-out 2;
}

@keyframes line-history-target-pulse {
  0%, 100% { outline-color: rgba(250, 204, 21, 0.35); }
  50% { outline-color: rgba(245, 158, 11, 0.95); }
}

.line-collaboration-kicker {
  color: #2563eb;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.1em;
}

.line-inbox-handoff-dialog,
.line-shortcut-help-dialog {
  width: min(620px, calc(100vw - 28px));
}

.line-inbox-handoff-form,
.line-shortcut-help-body {
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.line-inbox-handoff-form > label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 850;
}

.line-inbox-handoff-form select,
.line-inbox-handoff-form textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  color: #0f172a;
  background: #fff;
  font: inherit;
}

.line-inbox-handoff-form textarea {
  min-height: 112px;
  resize: vertical;
}

.line-inbox-handoff-form select:focus,
.line-inbox-handoff-form textarea:focus {
  border-color: #60a5fa;
  outline: 3px solid rgba(59, 130, 246, 0.12);
}

.line-inbox-handoff-customer,
.line-inbox-handoff-note {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 9px;
  background: #f8fbff;
}

.line-inbox-handoff-customer span,
.line-inbox-handoff-note span {
  color: #64748b;
  font-size: 11px;
  line-height: 1.4;
}

.line-inbox-handoff-note {
  border-color: #c7d2fe;
  color: #3730a3;
  background: #eef2ff;
}

.line-inbox-handoff-note span {
  color: #4f46e5;
}

.line-collaboration-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.line-shortcut-list {
  display: grid;
  gap: 6px;
}

.line-shortcut-list > div {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
}

.line-shortcut-list > div > span:first-child {
  flex: 1 1 auto;
  color: #334155;
  font-weight: 800;
}

.line-shortcut-list kbd,
.line-shortcut-platform-note kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 27px;
  padding: 3px 7px;
  border: 1px solid #cbd5e1;
  border-bottom-width: 3px;
  border-radius: 6px;
  color: #1e293b;
  background: #fff;
  font: 800 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.line-shortcut-list b,
.line-shortcut-or {
  color: #94a3b8;
  font-size: 11px;
}

.line-shortcut-platform-note {
  margin: 0;
  color: #64748b;
  font-size: 11px;
  text-align: center;
}

@media (max-width: 760px) {
  .line-inbox-collaboration-toolbar {
    gap: 5px;
    padding: 6px 8px;
    scroll-snap-type: x proximity;
  }

  .line-inbox-collaboration-toolbar button {
    min-height: 32px;
    padding: 5px 8px;
    scroll-snap-align: start;
  }

  .line-inbox-collaboration-toolbar kbd {
    display: none;
  }

  .line-inbox-history-search-panel {
    max-height: min(310px, 48vh);
    padding-inline: 8px;
  }

  .line-inbox-history-context,
  .line-inbox-composer-mode,
  .line-inbox-draft-conflict {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
    padding: 8px;
  }

  .line-inbox-history-context button,
  .line-inbox-composer-mode button {
    justify-content: center;
    width: 100%;
  }

  .line-inbox-draft-conflict-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .line-inbox-draft-conflict-actions button {
    white-space: normal;
  }

  .line-inbox-message.internal-note .line-inbox-bubble,
  .line-inbox-message[data-system-type="line_internal_note"] .line-inbox-bubble,
  .line-inbox-message.handoff .line-inbox-bubble,
  .line-inbox-message[data-system-type="line_handoff"] .line-inbox-bubble,
  .line-inbox-message[data-system-type="line_handoff_ack"] .line-inbox-bubble,
  .line-inbox-handoff-card {
    width: 94%;
    max-width: 94%;
  }

  .line-inbox-composer > .line-inbox-tools,
  .line-inbox-composer > textarea,
  .line-inbox-composer > button[type="submit"],
  .line-inbox-draft-status {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  .line-inbox-draft-status {
    justify-self: end;
    min-height: 11px;
  }

  .line-inbox-handoff-dialog,
  .line-shortcut-help-dialog {
    width: calc(100vw - 16px);
    margin: auto;
  }

  .line-inbox-handoff-form,
  .line-shortcut-help-body {
    gap: 10px;
    max-height: calc(100dvh - 20px);
    padding: 14px;
  }

  .line-inbox-handoff-form > header,
  .line-shortcut-help-body > header {
    align-items: flex-start;
  }

  .line-shortcut-list > div {
    flex-wrap: wrap;
  }

  .line-shortcut-list > div > span:first-child {
    flex-basis: 100%;
  }

  .line-collaboration-dialog-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .line-shortcut-help-body .line-collaboration-dialog-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .line-inbox-message.is-history-target .line-inbox-bubble,
  .line-inbox-message.line-inbox-message-target .line-inbox-bubble {
    animation: none;
  }
}

.line-inbox-history-control {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.line-inbox-history-control button {
  min-height: 30px;
  padding: 5px 12px;
  font-size: 12px;
}

.line-inbox-history-control span {
  color: var(--muted);
  font-size: 11px;
}

.line-history-import-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 5px;
  color: #4b5563;
  background: #eef2f7;
  border: 1px solid #d6dee9;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.1;
  vertical-align: middle;
}

.line-history-import-dialog {
  width: min(1040px, calc(100vw - 28px));
  max-width: 1040px;
}

.line-history-import-body {
  width: 100%;
  max-height: min(860px, calc(100vh - 40px));
  overflow: auto;
}

.line-history-import-body > header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--panel);
}

.line-history-import-body > header p,
.line-history-import-section-head span,
.line-history-import-note {
  color: var(--muted);
  font-size: 12px;
}

.line-history-import-source {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.line-history-import-source label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.line-history-import-source input[type="file"] {
  width: 100%;
  min-height: 40px;
  padding: 7px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.line-history-import-status,
.line-history-import-mapping,
.line-history-import-unresolved,
.line-history-import-sample,
.line-history-import-batches {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.line-history-import-alert,
.line-history-import-note {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
}

.line-history-import-alert.error {
  color: #9a3412;
  background: #fff7ed;
  border-color: #fdba74;
}

.line-history-import-alert.success {
  color: #166534;
  background: #f0fdf4;
  border-color: #86efac;
}

.line-history-import-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.line-history-import-stats span {
  display: grid;
  gap: 2px;
  min-height: 58px;
  padding: 9px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
}

.line-history-import-stats strong {
  color: var(--text);
  font-size: 19px;
}

.line-history-import-stats .warning {
  background: #fff7ed;
  border-color: #fdba74;
}

.line-history-import-stats .ready {
  background: #f0fdf4;
  border-color: #86efac;
}

.line-history-import-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.line-history-import-section-head > div {
  display: grid;
  gap: 2px;
}

.line-history-import-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.line-history-import-field-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.line-history-import-field-grid select,
.line-history-import-match-row select,
.line-history-import-match-row input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
}

.line-history-import-create-summary {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #a7e1d1;
  border-radius: 7px;
  background: #effbf7;
  color: #176b57;
}

.line-history-import-create-summary span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-history-import-match-list,
.line-history-import-sample-list,
.line-history-import-batch-list {
  display: grid;
  gap: 7px;
  max-height: 280px;
  overflow: auto;
}

.line-history-import-match-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(240px, 1.1fr);
  align-items: center;
  gap: 12px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.line-history-import-match-row > span,
.line-history-import-batch-list > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.line-history-import-match-row small,
.line-history-import-batch-list span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-history-import-sample-list > div {
  display: grid;
  grid-template-columns: auto minmax(120px, 0.5fr) auto minmax(220px, 1.5fr);
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
}

.line-history-import-sample-list span {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
}

.line-history-import-sample-list span.customer {
  color: #166534;
  background: #dcfce7;
}

.line-history-import-sample-list span.staff {
  color: #1e40af;
  background: #dbeafe;
}

.line-history-import-sample-list time {
  color: var(--muted);
  font-size: 11px;
}

.line-history-import-sample-list p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-history-import-batch-list > div {
  grid-template-columns: minmax(180px, 0.8fr) minmax(240px, 1.2fr);
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.line-history-import-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 2px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.line-history-import-actions > div {
  display: flex;
  gap: 8px;
}

@media (max-width: 820px) {
  .line-inbox-history-control span {
    display: none;
  }

  .line-history-import-source,
  .line-history-import-match-row,
  .line-history-import-batch-list > div {
    grid-template-columns: 1fr;
  }

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

  .line-history-import-field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .line-history-import-sample-list > div {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .line-history-import-sample-list p {
    grid-column: 1 / -1;
  }

  .line-history-import-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .line-history-import-actions > div {
    justify-content: flex-end;
  }
}

.line-inbox-contact {
  border-radius: var(--ui-radius);
}

.line-inbox-contact.active,
.line-inbox-contact:hover {
  background: #eaf3ff;
}

.line-inbox-workspace {
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) minmax(280px, 320px);
}

@media (max-width: 1180px) {
  .line-inbox-workspace {
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  }
}

.app-shell.line-standalone-mode {
  width: 100vw;
  max-width: none;
  height: var(--app-height, 100dvh);
  max-height: var(--app-height, 100dvh);
  grid-template-columns: minmax(0, 1fr);
  padding: 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.app-shell.line-standalone-mode .workspace-rail,
.app-shell.line-standalone-mode .sidebar,
.app-shell.line-standalone-mode .chat-panel,
.app-shell.line-standalone-mode .context-panel,
.app-shell.line-standalone-mode .home-page,
.app-shell.line-standalone-mode .agent-page,
.app-shell.line-standalone-mode .broadcast-page,
.app-shell.line-standalone-mode .content-report-page,
.app-shell.line-standalone-mode .hr-page,
.app-shell.line-standalone-mode .admin-page,
.app-shell.line-standalone-mode .crm-page {
  display: none !important;
}

.app-shell.line-standalone-mode .line-page {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
  height: calc(var(--app-height, 100dvh) - 24px);
  max-height: calc(var(--app-height, 100dvh) - 24px);
  border: 1px solid var(--oc-border);
  border-radius: 18px;
}

.app-shell.line-standalone-mode .line-auto-reply-page {
  display: none !important;
}

.line-inbox-tag-form {
  position: relative;
  background: #effcf7;
}

.line-inbox-tag-form[data-dirty="true"] {
  border-color: rgba(217, 119, 6, 0.48);
  background: #fff8ed;
}

.line-inbox-tag-form[data-dirty="true"]::before {
  display: block;
  margin-bottom: 8px;
  color: #92400e;
  font-size: 12px;
  font-weight: 800;
  content: "แก้ไข Tag แล้ว กดบันทึกก่อนออก";
}

@media (max-width: 1280px) {
  .line-inbox-workspace {
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  }

  .line-inbox-detail-panel {
  grid-column: 1 / -1;
  max-height: 320px;
  }

  .line-page-header .workspace-page-actions {
  justify-content: flex-start;
  }

  .line-auto-reply-body {
  grid-template-columns: minmax(220px, 250px) minmax(360px, 1fr);
  }

  .line-auto-reply-preview-card {
  position: static;
  grid-column: 2;
  max-height: none;
  }

  .line-auto-reply-preview-scroll {
  max-height: 620px;
  }
}

@media (max-width: 900px) {
  .line-auto-reply-body {
  grid-template-columns: 1fr;
  grid-auto-rows: max-content;
  padding: 10px 12px 20px;
  }

  .line-auto-reply-list-card,
  .line-auto-reply-preview-card {
  position: static;
  max-height: none;
  }

  .line-auto-reply-preview-card {
  grid-column: 1;
  }

  .line-auto-reply-rule-list {
  max-height: 300px;
  }

  .line-auto-reply-preview-scroll {
  max-height: 560px;
  }
}

@media (max-width: 760px) {
  .line-auto-reply-page-header {
  align-items: stretch;
  }

  .line-auto-reply-page-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
  width: 100%;
  }

  .line-auto-reply-page-actions #line-auto-reply-back-line,
  .line-auto-reply-page-actions #line-auto-reply-new {
  width: 100%;
  min-width: 0;
  }

  .line-auto-reply-grid {
  grid-template-columns: 1fr;
  }

  .line-auto-reply-match-field {
  grid-column: auto;
  }

  .line-auto-reply-form-head {
  align-items: stretch;
  flex-direction: column;
  }

  .line-auto-reply-active-toggle {
  justify-content: center;
  }

  .line-auto-reply-section-head {
  grid-template-columns: 28px minmax(0, 1fr);
  }

  .line-auto-reply-add-card {
  grid-column: 2;
  justify-self: start;
  }

  .line-auto-reply-actions {
  position: static;
  align-items: stretch;
  flex-direction: column-reverse;
  }

  .line-auto-reply-actions button {
  width: 100%;
  }

  .line-auto-reply-image-row {
  grid-template-columns: 1fr;
  }
}

.line-inbox-sticker-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 10px;
  max-height: 236px;
  overflow: auto;
  padding: 12px;
  border-top: 1px solid var(--oc-border, #dbe7f5);
  background: linear-gradient(180deg, #f8fbff, #eef7ff);
}

.line-inbox-sticker-panel[hidden] {
  display: none;
}

.line-inbox-sticker-option {
  display: grid;
  gap: 6px;
  justify-items: center;
  min-height: 128px;
  padding: 8px;
  border: 1px solid #d8e6f6;
  border-radius: 14px;
  background: #ffffff;
  color: #0f2744;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(15, 39, 68, 0.06);
}

.line-inbox-sticker-option:hover,
.line-inbox-sticker-option:focus-visible {
  border-color: #1473ff;
  background: #f3f8ff;
}

.line-inbox-sticker-option img {
  width: 82px;
  height: 82px;
  object-fit: contain;
  border-radius: 12px;
}

.line-inbox-composer {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.line-inbox-composer .icon-button.active {
  border-color: #1473ff;
  background: #eaf3ff;
  color: #1473ff;
}

@media (max-width: 760px) {
  .line-inbox-sticker-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 214px;
    padding: 10px;
  }

  .line-inbox-sticker-option {
    min-height: 106px;
    padding: 6px;
    font-size: 11px;
  }

  .line-inbox-sticker-option img {
    width: 64px;
    height: 64px;
  }

  .line-inbox-composer {
    grid-template-columns: minmax(0, 1fr);
  }
}

.line-inbox-sticker-panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #102a43;
}

.line-inbox-sticker-panel-header strong {
  font-size: 13px;
  font-weight: 900;
}

.line-inbox-sticker-panel-header span {
  color: #607189;
  font-size: 12px;
  font-weight: 700;
}

.line-inbox-sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}

.line-inbox-sticker-option {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  justify-items: stretch;
  min-height: 142px;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #d8e6f6;
  border-radius: 12px;
  background: #ffffff;
  color: #0f2744;
  cursor: pointer;
  font: inherit;
  text-align: left;
  box-shadow: 0 8px 20px rgba(15, 39, 68, 0.05);
}

.line-inbox-sticker-option:hover,
.line-inbox-sticker-option:focus-visible {
  border-color: #1473ff;
  background: #f3f8ff;
}

.line-sticker-preview-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 82px;
  border: 1px solid #e3eefb;
  border-radius: 10px;
  background:
    linear-gradient(45deg, rgba(219, 231, 245, 0.45) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(219, 231, 245, 0.45) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(219, 231, 245, 0.45) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(219, 231, 245, 0.45) 75%);
  background-color: #ffffff;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-size: 12px 12px;
}

.line-sticker-preview {
  display: block;
  width: auto;
  max-width: 92px;
  height: auto;
  max-height: 82px;
  object-fit: contain;
}

.line-sticker-fallback {
  display: none;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: #eaf4ff;
  color: #1473ff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.line-inbox-sticker-option.preview-error .line-sticker-preview {
  display: none;
}

.line-inbox-sticker-option.preview-error .line-sticker-fallback {
  display: grid;
}

.line-sticker-label {
  overflow: hidden;
  color: #0f2744;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-inbox-sticker-option small {
  overflow: hidden;
  color: #61728a;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-inbox-composer,
.line-page.line-focus-mode .line-inbox-composer {
  grid-template-columns: auto minmax(0, 1fr) max-content;
  align-items: end;
  gap: 8px;
}

.line-inbox-composer textarea,
.line-page.line-focus-mode .line-inbox-composer textarea {
  min-width: 0;
  width: 100%;
}

.line-inbox-composer .icon-button {
  width: 42px;
  min-width: 42px;
  height: 42px;
}

.line-inbox-composer .primary {
  min-width: 90px;
  min-height: 42px;
  grid-column: auto;
  white-space: nowrap;
}

.line-inbox-composer .line-sticker-toggle,
.line-page.line-focus-mode .line-inbox-composer .line-sticker-toggle {
  width: auto;
  min-width: 92px;
  padding: 0 10px;
  gap: 6px;
}

.line-inbox-composer .line-sticker-toggle span {
  display: inline;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.line-inbox-sticker-option.line-inbox-sticker-featured {
  border-color: #1473ff;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
  box-shadow: 0 10px 24px rgba(20, 115, 255, 0.14);
}

.line-sticker-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1355c8;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

@media (max-width: 760px) {
  .line-inbox-sticker-panel {
    max-height: 280px;
    padding: 10px;
  }

  .line-inbox-sticker-panel-header {
    display: block;
  }

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

  .line-inbox-sticker-option {
    min-height: 134px;
  }

  .line-sticker-preview {
    max-width: 84px;
    max-height: 76px;
  }

  .line-inbox-composer,
  .line-page.line-focus-mode .line-inbox-composer {
    grid-template-columns: minmax(0, 1fr);
  }

  .line-inbox-composer .line-sticker-toggle,
  .line-page.line-focus-mode .line-inbox-composer .line-sticker-toggle {
    width: 40px;
    min-width: 40px;
    padding: 0;
  }

  .line-inbox-composer .line-sticker-toggle span {
    display: none;
  }

  .line-inbox-composer .primary {
    grid-column: 1 / -1;
    width: 100%;
  }
}

.line-page.line-focus-mode .line-inbox-workspace {
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr) minmax(260px, 310px);
}

@media (max-width: 1280px) {
  .line-page.line-focus-mode .line-inbox-workspace {
    grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  }

  .line-page.line-focus-mode .line-inbox-detail-panel {
    grid-column: 1 / -1;
    max-height: 300px;
  }
}

@media (max-width: 760px) {
  #line-page .line-inbox-workspace,
  #line-page .line-inbox-workspace.line-list-collapsed,
  #line-page .line-inbox-workspace.line-detail-collapsed,
  #line-page .line-inbox-workspace.line-list-collapsed.line-detail-collapsed {
    grid-template-columns: 1fr;
  }

  #line-page .line-inbox-chat-panel,
  #line-page .line-inbox-detail-panel {
    grid-column: 1;
  }

  .line-page.line-focus-mode .line-inbox-detail-panel {
    display: none;
  }
}

.line-inbox-detail-panel {
  gap: 8px;
  padding: 10px;
  background: #f8fbff;
}

.line-inbox-profile {
  gap: 2px;
  padding: 9px 10px;
}

.line-inbox-profile strong {
  overflow: hidden;
  color: #071827;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-inbox-profile span,
.line-inbox-profile small,
.line-inbox-profile p {
  font-size: 11px;
  line-height: 1.35;
}

.line-inbox-profile p {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.line-inbox-ai-status {
  gap: 4px;
  padding: 8px 10px;
}

.line-inbox-ai-status div {
  gap: 6px;
}

.line-inbox-ai-status span {
  font-size: 10px;
}

.line-inbox-ai-status strong {
  font-size: 12px;
  line-height: 1.25;
}

.line-inbox-ai-status small {
  display: -webkit-box;
  overflow: hidden;
  font-size: 10.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.line-inbox-tag-form {
  gap: 7px;
  padding: 9px 10px;
  background: #effcf7;
}

.line-inbox-tag-form[data-dirty="true"]::before {
  margin-bottom: 4px;
  font-size: 11px;
  line-height: 1.25;
}

.line-inbox-tag-form .crm-tag-editor {
  gap: 7px;
}

.line-inbox-tag-form .crm-tag-editor-head {
  display: grid;
  gap: 1px;
}

.line-inbox-tag-form .crm-tag-editor-head span {
  font-size: 10px;
  font-weight: 800;
}

.line-inbox-tag-form .crm-tag-editor-head strong {
  font-size: 12px;
  line-height: 1.25;
}

.line-inbox-tag-form .crm-tag-editor-head small {
  display: none;
}

.line-inbox-tag-form .crm-tag-chip-list,
.line-inbox-tag-form .crm-tag-suggestions div {
  gap: 5px;
  max-height: 78px;
  overflow: auto;
  padding-right: 2px;
}

.line-inbox-tag-form .crm-editable-tag,
.line-inbox-tag-form .crm-tag-suggestions button {
  min-height: 24px;
  padding: 0 7px;
  font-size: 11px;
  gap: 4px;
}

.line-inbox-tag-form .crm-editable-tag b {
  width: 15px;
  height: 15px;
  font-size: 12px;
}

.line-inbox-tag-form .crm-tag-add-row {
  grid-template-columns: minmax(0, 1fr) minmax(74px, auto);
  gap: 6px;
}

.line-inbox-tag-form .crm-tag-add-row input,
.line-inbox-tag-form .crm-tag-add-row button,
.line-inbox-tag-form > button {
  min-height: 34px;
  border-radius: 10px;
  font-size: 12px;
}

.line-inbox-tag-form .crm-tag-add-row input {
  padding: 0 10px;
}

.line-inbox-tag-form .crm-tag-add-row button,
.line-inbox-tag-form > button {
  padding: 0 10px;
  white-space: nowrap;
}

.line-inbox-tag-form > small {
  font-size: 10px;
  line-height: 1.3;
}

.line-inbox-detail-panel .agent-recommendation {
  padding: 8px 9px;
  font-size: 11px;
  line-height: 1.4;
}

.line-inbox-side-section {
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #e5eef8;
  background: #fff;
}

.line-inbox-side-section h3 {
  font-size: 12px;
}

.line-inbox-photo-grid {
  gap: 5px;
}

.line-inbox-photo-grid a {
  border-radius: 8px;
}

@media (max-width: 1280px) {
  .line-inbox-workspace,
  .line-page.line-focus-mode .line-inbox-workspace {
    grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  }
}

.line-inbox-composer .icon-button,
.line-inbox-composer .line-sticker-toggle,
.line-page.line-focus-mode .line-inbox-composer .line-sticker-toggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 40px !important;
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  line-height: 1 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}

.line-inbox-composer .line-sticker-toggle span {
  display: none !important;
}

.line-inbox-composer .line-sticker-toggle .ui-icon,
.line-inbox-composer .icon-button .ui-icon {
  flex: 0 0 18px !important;
  width: 18px !important;
  height: 18px !important;
}

.line-inbox-composer textarea,
.line-page.line-focus-mode .line-inbox-composer textarea {
  align-self: center !important;
  min-width: 0 !important;
  width: 100% !important;
  min-height: 40px !important;
  max-height: 260px !important;
  margin: 0 !important;
}

.line-inbox-composer .primary,
.line-inbox-composer button[type="submit"],
.line-page.line-focus-mode .line-inbox-composer .primary {
  align-self: center !important;
  grid-column: auto !important;
  width: 86px !important;
  min-width: 86px !important;
  max-width: 86px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 10px !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
}

/* Toolbar row (quick-reply / sticker / attach / AI) as one flex cell so the
   button count no longer fights the composer grid. */
.line-inbox-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  align-self: end;
  flex-wrap: wrap;
}

/* "AI ช่วยคิด" — wider than the icon buttons and accent-coloured so it is easy
   to find. Higher specificity + !important to beat the 40px icon-button rule. */
.line-inbox-composer .icon-button.line-ai-suggest {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 104px !important;
  max-width: none !important;
  padding: 0 12px !important;
  gap: 6px !important;
  overflow: visible !important;
  color: #1473ff !important;
  border-color: #bcd8ff !important;
}

.line-inbox-composer .icon-button.line-ai-suggest span {
  display: inline !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.line-inbox-composer .icon-button.line-ai-suggest:hover {
  background: #eaf3ff !important;
  border-color: #1473ff !important;
}

.line-inbox-composer .icon-button.line-ai-suggest[aria-busy="true"] {
  opacity: 0.6 !important;
  pointer-events: none !important;
}

@media (max-width: 760px) {
  .line-inbox-composer,
  .line-page.line-focus-mode .line-inbox-composer {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 6px !important;
    min-height: 54px !important;
    padding: 7px 8px !important;
  }

  .line-inbox-composer .icon-button,
  .line-inbox-composer .line-sticker-toggle,
  .line-page.line-focus-mode .line-inbox-composer .line-sticker-toggle {
    flex-basis: 38px !important;
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
  }

  .line-inbox-composer textarea,
  .line-page.line-focus-mode .line-inbox-composer textarea {
    min-height: 38px !important;
  }

  .line-inbox-composer .primary,
  .line-inbox-composer button[type="submit"],
  .line-page.line-focus-mode .line-inbox-composer .primary {
    width: 78px !important;
    min-width: 78px !important;
    max-width: 78px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 8px !important;
    font-size: 12px !important;
  }
}

/* Keep the sticker picker overrides after the legacy LINE composer styles. */
.line-inbox-sticker-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(372px, 48vh);
  gap: 0;
  overflow: hidden;
  padding: 0;
  background: #f8fbff;
}

.line-inbox-sticker-panel-header {
  align-items: flex-start;
  margin: 0;
  padding: 10px 12px 4px;
}

.line-inbox-sticker-grid {
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}

.line-inbox-sticker-option,
.line-inbox-sticker-card .line-inbox-sticker-option {
  grid-template-rows: minmax(70px, 1fr) auto auto;
  min-height: 118px;
  padding: 6px;
  border-radius: 8px;
}

.line-inbox-sticker-card.is-pinned .line-inbox-sticker-option {
  min-height: 106px;
}

.line-inbox-sticker-card .line-sticker-preview-wrap {
  min-height: 70px;
  border-radius: 7px;
}

.line-inbox-sticker-card .line-sticker-preview {
  max-width: 76px;
  max-height: 70px;
}

.line-inbox-sticker-card .line-sticker-label {
  display: -webkit-box;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.line-inbox-sticker-card .line-inbox-sticker-option small {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .line-inbox-sticker-panel {
    max-height: min(390px, 56vh);
  }

  .line-inbox-sticker-toolbar {
    grid-template-columns: minmax(0, 1fr) 118px;
    padding-inline: 9px;
  }

  .line-inbox-sticker-scroll {
    padding-inline: 9px;
  }

  .line-inbox-sticker-grid {
    grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
    gap: 6px;
  }

  .line-inbox-sticker-pinned-grid {
    grid-auto-columns: 82px;
    gap: 6px;
  }

  .line-inbox-sticker-option,
  .line-inbox-sticker-card .line-inbox-sticker-option {
    min-height: 102px;
    padding: 5px;
  }

  .line-inbox-sticker-card.is-pinned .line-inbox-sticker-option {
    min-height: 96px;
  }

  .line-inbox-sticker-card .line-sticker-preview-wrap {
    min-height: 60px;
  }

  .line-inbox-sticker-card .line-sticker-preview {
    max-width: 66px;
    max-height: 60px;
  }
}
