/**
 * チバリヨ S2 日報タイムライン スタイル (Phase 2-B-2)
 */

.s2-timeline {
  padding-bottom: 8px;
}

/* ============================================================
 * 日付グループ
 * ============================================================ */

.s2-date-header {
  position: sticky;
  top: 0;
  z-index: 5;
  font-size: 13px;
  font-weight: 600;
  color: var(--mobile-text-secondary);
  background: var(--mobile-bg);
  padding: 10px 4px 6px;
}

.s2-date-group-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.s2-date-group + .s2-date-group {
  margin-top: 8px;
}

/* ============================================================
 * カード
 * ============================================================ */

.s2-card {
  background: var(--mobile-surface);
  border-radius: 12px;
  padding: 14px 14px 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.s2-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.s2-avatar {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  user-select: none;
}

.s2-avatar-sm {
  width: 26px;
  height: 26px;
  font-size: 12px;
}

.s2-card-head-main {
  flex: 1 1 auto;
  min-width: 0;
}

.s2-card-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.s2-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--mobile-text);
}

.s2-card-time {
  font-size: 12px;
  color: var(--mobile-text-tertiary);
  font-variant-numeric: tabular-nums;
}

.s2-card-client-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.s2-card-client {
  font-size: 15px;
  font-weight: 600;
  color: var(--mobile-text);
  word-break: break-all;
}

/* 種別バッジ */
.s2-type-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.s2-type-badge.is-visit {
  background: var(--mobile-accent-light);
  color: var(--mobile-accent-dark);
}

.s2-type-badge.is-quote-only {
  background: #FAEEDA;
  color: #854F0B;
}

/* アポ・見積チップ */
.s2-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.s2-chip-appo {
  background: var(--mobile-accent);
  color: #ffffff;
}

.s2-chip-quote {
  background: #EEEDFE;
  color: #3C3489;
}

/* 活動内容 */
.s2-card-act {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--mobile-text);
  white-space: pre-wrap;
  word-break: break-word;
}

.s2-card-act.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}

/* 展開詳細 */
.s2-card-detail {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--mobile-bg);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.s2-detail-row {
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--mobile-text);
}

.s2-detail-label {
  flex: 0 0 44px;
  font-weight: 600;
  color: var(--mobile-text-tertiary);
}

.s2-detail-note {
  white-space: pre-wrap;
  word-break: break-word;
}

.s2-expand-btn {
  display: block;
  background: none;
  border: none;
  padding: 6px 0 2px;
  font-size: 13px;
  font-weight: 500;
  color: var(--mobile-accent);
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================================
 * フッター (いいね / コメント)
 * ============================================================ */

.s2-card-foot {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  border-top: 1px solid var(--mobile-border);
  padding-top: 2px;
}

.s2-like-btn,
.s2-comment-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px 8px 4px;
  color: var(--mobile-text-tertiary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
}

.s2-like-btn svg,
.s2-comment-btn svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.12s ease;
}

.s2-like-btn:active svg {
  transform: scale(1.2);
}

.s2-like-btn.is-liked {
  color: #E0245E;
}

.s2-like-btn.is-liked svg {
  fill: currentColor;
}

.s2-like-count,
.s2-comment-count {
  min-width: 12px;
}

/* ============================================================
 * コメント
 * ============================================================ */

.s2-comments {
  border-top: 1px solid var(--mobile-border);
  padding: 10px 0 8px;
}

.s2-comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.s2-comments-empty {
  font-size: 13px;
  color: var(--mobile-text-tertiary);
  padding: 2px 0 4px;
}

.s2-comment-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.s2-comment-body {
  flex: 1 1 auto;
  min-width: 0;
}

.s2-comment-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.s2-comment-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--mobile-text);
}

.s2-comment-time {
  font-size: 11px;
  color: var(--mobile-text-tertiary);
}

.s2-comment-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--mobile-text);
  white-space: pre-wrap;
  word-break: break-word;
}

.s2-comment-input-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.s2-comment-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--mobile-border);
  border-radius: 18px;
  padding: 8px 14px;
  font-size: 14px;
  font-family: inherit;
  background: var(--mobile-bg);
  color: var(--mobile-text);
}

.s2-comment-input:focus {
  outline: none;
  border-color: var(--mobile-accent);
  background: var(--mobile-surface);
}

.s2-comment-send {
  flex: 0 0 auto;
  border: none;
  border-radius: 18px;
  padding: 8px 16px;
  background: var(--mobile-accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.s2-comment-send:disabled {
  opacity: 0.5;
}

.s2-comment-send:active:not(:disabled) {
  background: var(--mobile-accent-dark);
}

/* ============================================================
 * フッター領域 (もっと見る / 状態表示)
 * ============================================================ */

.s2-footer {
  padding: 14px 0 4px;
}

.s2-more-btn {
  display: block;
  width: 100%;
  background: var(--mobile-surface);
  border: 1px solid var(--mobile-border);
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--mobile-accent);
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.s2-more-btn:active {
  background: var(--mobile-accent-light);
}

.s2-loading {
  text-align: center;
  font-size: 13px;
  color: var(--mobile-text-tertiary);
  padding: 8px 0;
}

.s2-loading-sm {
  text-align: left;
  padding: 2px 0;
}

.s2-feed-end {
  text-align: center;
  font-size: 12px;
  color: var(--mobile-text-tertiary);
  padding: 4px 0;
}

.s2-error {
  text-align: center;
  font-size: 13px;
  color: #A32D2D;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.s2-retry-btn {
  border: 1px solid var(--mobile-border);
  background: var(--mobile-surface);
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mobile-text);
  cursor: pointer;
  font-family: inherit;
}

/* ============================================================
 * 空状態
 * ============================================================ */

.s2-empty {
  background: var(--mobile-surface);
  border-radius: 12px;
  padding: 32px 20px;
  margin-top: 16px;
  text-align: center;
}

.s2-empty p {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--mobile-text);
}

.s2-empty .s2-empty-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--mobile-text-secondary);
}
/* ============================================================
   Phase 2-B-3.3: 編集・削除メニュー + 編集済みラベル
   (このブロックを mobile-s2-timeline.css の末尾に追記)
   ============================================================ */

.s2-card-menu-wrap {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
  align-self: flex-start;
}

.s2-card-menu-btn {
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: #94a3b8;
  padding: 2px 10px 6px;
  border-radius: 8px;
  cursor: pointer;
}

.s2-card-menu-btn:active {
  background: #f1f5f9;
}

.s2-card-menu {
  position: absolute;
  top: 30px;
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.14);
  display: none;
  min-width: 128px;
  z-index: 20;
  overflow: hidden;
}

.s2-card-menu.is-open {
  display: block;
}

.s2-card-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 16px;
  border: none;
  background: none;
  font-size: 14px;
  color: #334155;
  cursor: pointer;
}

.s2-card-menu button + button {
  border-top: 1px solid #f1f5f9;
}

.s2-card-menu button:active {
  background: #f8fafc;
}

.s2-card-menu button.is-danger {
  color: #dc2626;
}

.s2-edited-label {
  font-size: 10px;
  color: #94a3b8;
  margin-left: 6px;
  flex-shrink: 0;
}
