/* /src/training/assets/css/training.css */

body.tr-body,
body.tr-body--login {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Meiryo", sans-serif;
  background: #020617;
  color: #e5e7eb;
}

a {
  color: #38bdf8;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== header ===== */

.tr-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.98);
}

.tr-header-left {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tr-logo {
  font-size: 1.2rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0;
}

.tr-user-name {
  font-size: 0.9rem;
  color: #a5b4fc;
}

.tr-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tr-nav-link {
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.9);
}

.tr-nav-link--active {
  border-color: rgba(52, 211, 153, 0.8);
}

/* ===== main layout ===== */

.tr-main {
  padding: 12px 12px 40px;
  max-width: 900px;
  margin: 0 auto;
}

.tr-main--edit {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ===== panels ===== */

.tr-panel {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 12px;
  border: 1px solid rgba(75, 85, 99, 0.7);
  padding: 12px 12px 14px;
  margin-bottom: 12px;
}

.tr-panel-title {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9ca3af;
  margin: 0 0 8px;
}

/* ===== forms ===== */

.tr-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tr-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tr-field-label {
  font-size: 0.8rem;
  color: #9ca3af;
}

.tr-form input,
.tr-form select,
.tr-form textarea {
  border-radius: 8px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  padding: 6px 8px;
  font-size: 0.9rem;
}

.tr-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.tr-field-grid label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8rem;
}

/* ===== buttons ===== */

.tr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 7px 16px;
  font-size: 0.85rem;
  cursor: pointer;
}

.tr-btn--primary {
  border-color: rgba(52, 211, 153, 0.9);
  background: rgba(22, 163, 74, 0.9);
  color: #ecfdf5;
}

.tr-btn--small {
  padding: 5px 10px;
  font-size: 0.8rem;
}

/* ===== day card ===== */

.tr-day-card {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 12px;
  border: 1px solid rgba(75, 85, 99, 0.7);
  padding: 10px 10px 12px;
  margin-bottom: 10px;
}

.tr-day-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.tr-day-title {
  font-size: 1rem;
  margin: 0;
}

/* ===== log rows ===== */

.tr-log-row {
  border-radius: 8px;
  border: 1px solid rgba(55, 65, 81, 0.7);
  padding: 6px 8px;
  margin-bottom: 6px;
}

.tr-log-menu {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tr-log-category {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(75, 85, 99, 0.7);
}

.tr-log-values {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.8rem;
  margin-top: 4px;
}

.tr-log-memo {
  font-size: 0.8rem;
  margin: 4px 0 0;
}

/* ===== comments ===== */

.tr-day-comments {
  margin-top: 8px;
  border-top: 1px dashed rgba(55, 65, 81, 0.8);
  padding-top: 6px;
}

.tr-subtitle {
  font-size: 0.8rem;
  color: #9ca3af;
  margin: 0 0 4px;
}

.tr-comment-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}

.tr-comment-item {
  font-size: 0.8rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(55, 65, 81, 0.7);
  padding: 4px 6px;
}

.tr-comment-author {
  color: #a5b4fc;
  margin-right: 4px;
}

.tr-comment-body {
  color: #e5e7eb;
}

.tr-comment-form textarea {
  width: 100%;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  padding: 4px 6px;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

/* ===== login page ===== */

.tr-login-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.tr-login-title {
  margin-bottom: 12px;
  font-size: 1.3rem;
  letter-spacing: 0.15em;
}

.tr-login-form {
  width: 100%;
  max-width: 320px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.98);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tr-error {
  color: #fecaca;
  margin-bottom: 8px;
}

/* ===== achievement list ===== */

.tr-achievement-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tr-achievement-item {
  border-radius: 10px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  padding: 6px 8px;
  margin-bottom: 6px;
}

.tr-achievement-item--unlocked {
  border-color: rgba(52, 211, 153, 0.9);
}

.tr-achievement-main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.tr-achievement-title {
  font-size: 0.95rem;
}

.tr-achievement-rank {
  font-size: 0.7rem;
  color: #9ca3af;
}

.tr-achievement-desc {
  font-size: 0.8rem;
  margin: 4px 0 0;
}

.tr-achievement-meta {
  font-size: 0.7rem;
  color: #9ca3af;
  margin: 2px 0 0;
}

/* ===== timeline ===== */

.tr-timeline-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tr-timeline-item {
  border-radius: 10px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  padding: 6px 8px;
  margin-bottom: 6px;
}

.tr-timeline-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 4px;
}

.tr-timeline-menu {
  font-size: 0.9rem;
}

.tr-timeline-values {
  font-size: 0.8rem;
  color: #e5e7eb;
}

.tr-timeline-memo {
  font-size: 0.8rem;
  margin: 4px 0 0;
}

/* ===== misc ===== */

.tr-empty {
  font-size: 0.9rem;
}
/* ===== サマリー ===== */

.tr-summary {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 12px;
  border: 1px solid rgba(55, 65, 81, 0.8);
  padding: 10px 12px 12px;
  margin-bottom: 12px;
}

.tr-summary-title {
  font-size: 0.9rem;
  margin: 0 0 6px;
}

.tr-summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tr-summary-item {
  flex: 1;
  min-width: 110px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.96);
  border: 1px solid rgba(55, 65, 81, 0.8);
}

.tr-summary-label {
  display: block;
  font-size: 0.75rem;
  color: #9ca3af;
}

.tr-summary-value {
  font-size: 0.95rem;
}

/* ===== ソートバー ===== */

.tr-sortbar {
  margin-bottom: 10px;
}

.tr-sortbar-form {
  font-size: 0.8rem;
}

.tr-sortbar select {
  margin-left: 4px;
}

/* ===== 日カードの追加パーツ ===== */

.tr-day-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(22, 163, 74, 0.9);
  color: #ecfdf5;
}

/* ===== メニューグループ ===== */

.tr-menu-group {
  border-radius: 10px;
  border: 1px solid rgba(55, 65, 81, 0.8);
  margin-bottom: 6px;
  overflow: hidden;
}

.tr-menu-header {
  width: 100%;
  border: none;
  background: rgba(15, 23, 42, 0.98);
  color: inherit;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  cursor: pointer;
}

.tr-menu-header-main {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tr-menu-name {
  font-size: 0.9rem;
}

.tr-menu-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.75rem;
  color: #e5e7eb;
}

.tr-menu-summary span {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(55, 65, 81, 0.8);
}

.tr-menu-toggle-indicator {
  align-self: flex-end;
  font-size: 0.7rem;
  color: #9ca3af;
}

/* 詳細部分はデフォルト非表示、開いたときだけ見せる */

.tr-menu-details {
  display: none;
  padding: 4px 6px 6px;
  background: rgba(15, 23, 42, 0.96);
}

.tr-menu-details--open {
  display: block;
}

/* ===== 編集画面：メニューの項目選択 ===== */

.tr-field--metrics .tr-metrics-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.8rem;
}

.tr-field-grid--metrics .tr-metric-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8rem;
}

/* メニュー一覧 */

.tr-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tr-menu-list li {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 4px 0;
  border-bottom: 1px dotted rgba(55, 65, 81, 0.7);
}

.tr-menu-name {
  font-weight: 500;
}


.tr-menu-category {
  font-size: 0.75rem;
  color: #9ca3af;
}


/* ===== 称号一覧 ===== */

.tr-panel-intro {
  font-size: 0.8rem;
  color: #e5e7eb;
  margin: 0 0 8px;
}

.tr-ach-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tr-ach-item {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.96);
}

.tr-ach-item--owned {
  border-color: rgba(52, 211, 153, 0.9);
  box-shadow: 0 0 12px rgba(22, 163, 74, 0.4);
}

.tr-ach-title-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}

@media (min-width: 640px) {
  .tr-ach-title-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
  }
}

.tr-ach-title {
  font-size: 0.92rem;
  font-weight: 600;
}

.tr-ach-rank {
  font-size: 0.75rem;
  color: #a5b4fc;
}

.tr-ach-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.tr-ach-status {
  padding: 2px 6px;
  border-radius: 999px;
}

.tr-ach-status--owned {
  background: rgba(22, 163, 74, 0.9);
  color: #ecfdf5;
}

.tr-ach-status--locked {
  background: rgba(55, 65, 81, 0.9);
  color: #e5e7eb;
}

.tr-ach-date {
  color: #9ca3af;
}

.tr-ach-condition {
  font-size: 0.8rem;
  color: #e5e7eb;
}

.tr-ach-cond-label {
  color: #9ca3af;
  margin-right: 4px;
}

.tr-ach-hint {
  margin-top: 2px;
}

.tr-ach-hint-label {
  color: #a855f7;
  margin-right: 4px;
  font-size: 0.76rem;
}

.tr-ach-hint-text {
  font-size: 0.78rem;
}


/* ===== 新しい称号バナー ===== */

.tr-ach-banner {
  position: relative;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #022c22, #064e3b);
  border: 1px solid rgba(52, 211, 153, 0.9);
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.9);
  color: #ecfdf5;
  font-size: 0.82rem;
}

.tr-ach-banner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.tr-ach-banner-title {
  font-weight: 600;
}

.tr-ach-banner-close {
  border: none;
  background: transparent;
  color: #bbf7d0;
  font-size: 1rem;
  cursor: pointer;
}

.tr-ach-banner-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 4px;
}

.tr-ach-banner-item {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tr-ach-banner-name {
  font-weight: 600;
}

.tr-ach-banner-date {
  font-size: 0.75rem;
  opacity: 0.9;
}

.tr-ach-banner-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: #bbf7d0;
  text-decoration: underline;
}
/* ===== タイムライン ===== */

.tr-tl-filter {
  margin-bottom: 8px;
}

.tr-tl-filter-form {
  font-size: 0.8rem;
}

.tr-tl-filter select {
  margin-left: 4px;
}

.tr-tl-filter-note {
  margin: 4px 0 0;
  font-size: 0.72rem;
  color: #9ca3af;
}

.tr-tl-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tr-tl-item {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.96);
  font-size: 0.82rem;
}

.tr-tl-item--log {
  border-left: 3px solid #22c55e;
}

.tr-tl-item--achievement {
  border-left: 3px solid #facc15;
}

.tr-tl-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.tr-tl-user {
  font-weight: 600;
}

.tr-tl-self-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(34, 197, 94, 0.9);
  color: #ecfdf5;
}

.tr-tl-date {
  font-size: 0.72rem;
  color: #9ca3af;
}

.tr-tl-body {
  margin-top: 2px;
}

.tr-tl-tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 999px;
  margin-bottom: 3px;
}

.tr-tl-tag--log {
  background: rgba(22, 163, 74, 0.9);
  color: #ecfdf5;
}

.tr-tl-tag--achievement {
  background: rgba(250, 204, 21, 0.9);
  color: #1f2937;
}

.tr-tl-mainline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 3px;
}

.tr-tl-menu-name,
.tr-tl-ach-name {
  font-weight: 600;
}

.tr-tl-training-date {
  font-size: 0.75rem;
  color: #9ca3af;
}

.tr-tl-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.76rem;
  color: #e5e7eb;
  margin-bottom: 2px;
}

.tr-tl-metrics span {
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.9);
}

.tr-tl-memo {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: #e5e7eb;
}

.tr-tl-ach-rank {
  font-size: 0.75rem;
  color: #a5b4fc;
}

.tr-tl-ach-text {
  font-size: 0.8rem;
  margin: 2px 0 0;
}

/* ===== 協力チャレンジ ===== */

.tr-ch-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tr-ch-item {
  padding: 10px 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.96);
  font-size: 0.82rem;
}

.tr-ch-header {
  margin-bottom: 4px;
}

.tr-ch-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.tr-ch-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.tr-ch-state {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
}

.tr-ch-state--開催中 {
  background: rgba(34, 197, 94, 0.95);
  color: #ecfdf5;
}

.tr-ch-state--準備中 {
  background: rgba(59, 130, 246, 0.95);
  color: #eff6ff;
}

.tr-ch-state--終了 {
  background: rgba(148, 163, 184, 0.9);
  color: #f9fafb;
}

.tr-ch-period {
  font-size: 0.76rem;
  color: #9ca3af;
  margin-top: 2px;
}

.tr-ch-desc {
  margin: 4px 0 6px;
  font-size: 0.8rem;
  color: #e5e7eb;
}

.tr-ch-progress-block {
  margin-top: 4px;
}

.tr-ch-progress-label {
  font-size: 0.78rem;
  color: #bfdbfe;
  margin-bottom: 2px;
}

.tr-ch-progress-bar {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 1);
  border: 1px solid rgba(55, 65, 81, 0.9);
  overflow: hidden;
}

.tr-ch-progress-inner {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #a3e635);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.9);
  transition: width 0.4s ease-out;
}

.tr-ch-progress-text {
  margin-top: 3px;
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #e5e7eb;
}

.tr-ch-progress-percent {
  font-weight: 600;
}

.tr-ch-note {
  margin: 5px 0 0;
  font-size: 0.75rem;
  color: #9ca3af;
}

/* ===== 協力チャレンジ：複数指標＋自分の貢献 ===== */

.tr-ch-name-link {
  text-decoration: none;
  color: inherit;
}

.tr-ch-name-link:hover .tr-ch-name {
  text-decoration: underline;
}

/* メトリクス1つ分のブロック */
.tr-ch-metric-block {
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px dashed rgba(75, 85, 99, 0.9);
}

/* 自分の貢献テキスト */
.tr-ch-mycontrib {
  margin-top: 3px;
  font-size: 0.76rem;
  color: #d1fae5;
}

/* 詳細ページ用に少し余白多め */
.tr-ch-metric-block--detail {
  margin-top: 10px;
  padding-top: 8px;
}

.tr-ch-progress-bar--large {
  height: 12px;
}

/* ===== チャレンジ達成時の演出 ===== */

.tr-ch-item--cleared {
  border-color: rgba(52, 211, 153, 0.9);
  box-shadow:
    0 0 20px rgba(34, 197, 94, 0.7),
    0 0 0 1px rgba(0, 0, 0, 1);
  position: relative;
}

.tr-ch-item--cleared::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid rgba(190, 242, 100, 0.7);
  opacity: 0.7;
  pointer-events: none;
  animation: tr-ch-glow 1.8s ease-in-out infinite;
}

@keyframes tr-ch-glow {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

/* 詳細ページのバナー */

.tr-ch-banner {
  max-width: 960px;
  margin: 0 auto 12px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: radial-gradient(circle at top left,
        rgba(34, 197, 94, 0.25),
        rgba(15, 23, 42, 0.98));
  color: #ecfdf5;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.9);
  animation: tr-ch-banner-flicker 2.4s linear infinite;
}

.tr-ch-banner--cleared {
  background: radial-gradient(circle at top left,
        rgba(52, 211, 153, 0.45),
        rgba(15, 23, 42, 0.98));
  border-color: rgba(74, 222, 128, 1);
}

.tr-ch-banner--active {
  background: radial-gradient(circle at top left,
        rgba(59, 130, 246, 0.35),
        rgba(15, 23, 42, 0.98));
  border-color: rgba(59, 130, 246, 1);
}

.tr-ch-banner-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.tr-ch-banner-text {
  font-size: 0.8rem;
}

@keyframes tr-ch-banner-flicker {
  0%, 100% {
    filter: brightness(1);
  }
  40% {
    filter: brightness(1.15);
  }
  60% {
    filter: brightness(0.95);
  }
}

/* 詳細ページ内の各種テキスト */

.tr-ch-detail-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 4px 0 4px;
}

.tr-ch-detail-state {
  font-size: 0.8rem;
  color: #e5e7eb;
}

.tr-ch-detail-state-label {
  font-weight: 600;
}

.tr-ch-detail-period {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 2px;
}

.tr-ch-detail-desc {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #e5e7eb;
}

.tr-ch-detail-metrics {
  margin-top: 10px;
}

.tr-ch-mycontrib--detail {
  font-size: 0.8rem;
}

.tr-ch-detail-back {
  margin-top: 12px;
}

/* 汎用セカンダリボタン */
.tr-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid rgba(148, 163, 184, 0.9);
  color: #e5e7eb;
  text-decoration: none;
  background: rgba(15, 23, 42, 0.95);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.tr-btn-secondary:hover {
  background: radial-gradient(circle at top left,
        rgba(148, 163, 184, 0.45),
        rgba(15, 23, 42, 0.98));
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.9);
}

/* ===== ユーザー別貢献ランキング ===== */

.tr-ch-members-note {
  margin-top: 6px;
  font-size: 0.78rem;
  color: #9ca3af;
}

.tr-ch-members-section {
  margin-top: 14px;
  padding-top: 8px;
  border-top: 1px dashed rgba(75, 85, 99, 0.9);
}

.tr-ch-members-title {
  font-size: 0.9rem;
  margin: 0 0 6px;
  font-weight: 600;
}

.tr-ch-members-empty {
  font-size: 0.8rem;
  color: #9ca3af;
}

.tr-ch-members-table-wrap {
  overflow-x: auto;
}

.tr-ch-members-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.tr-ch-members-table th,
.tr-ch-members-table td {
  padding: 4px 6px;
  border-bottom: 1px solid rgba(55, 65, 81, 0.9);
  text-align: left;
}

.tr-ch-members-table th {
  color: #9ca3af;
  font-weight: 500;
}

.tr-ch-members-row--self {
  background: rgba(22, 163, 74, 0.18);
}

.tr-ch-members-self-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(34, 197, 94, 0.95);
  color: #022c22;
}

.tr-ch-members-summary {
  margin-top: 4px;
  font-size: 0.78rem;
  color: #e5e7eb;
}

/* ===== タイムライン：チャレンジ貢献 ===== */

.tr-tl-item--challenge {
  border-left: 3px solid rgba(59, 130, 246, 0.9);
}

.tr-tl-tag--challenge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
}

.tr-tl-ch-link {
  color: #93c5fd;
  text-decoration: none;
}

.tr-tl-ch-link:hover {
  text-decoration: underline;
}

/* チャレンジ達成イベント用 */

.tr-tl-item--challenge_clear {
  border-left: 3px solid rgba(52, 211, 153, 0.95);
  background: radial-gradient(circle at top left,
        rgba(34, 197, 94, 0.25),
        rgba(15, 23, 42, 0.98));
}

.tr-tl-tag--challenge-clear {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(34, 197, 94, 0.25);
  color: #bbf7d0;
}
/* ===== ダッシュボード（サマリー＋グラフ） ===== */

.tr-dashboard-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

@media (min-width: 768px) {
  .tr-dashboard-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.tr-dashboard-summary-item {
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.9);
}

.tr-dashboard-summary-label {
  font-size: 0.72rem;
  color: #9ca3af;
}

.tr-dashboard-summary-value {
  margin-top: 2px;
  font-size: 0.96rem;
  font-weight: 600;
  color: #e5e7eb;
}

/* グラフブロック */

.tr-dashboard-charts {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tr-dashboard-chart-block {
  padding: 8px 8px 8px;
  border-radius: 10px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.95);
  height: 220px;
}

.tr-dashboard-chart-title {
  font-size: 0.8rem;
  margin: 0 0 4px;
  color: #e5e7eb;
}

/* 日カード（簡易） */

.tr-daycard-list {
  list-style: none;
  padding-left: 0;
  margin: 4px 0 0;
}

.tr-daycard-item {
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.tr-daycard-date {
  color: #e5e7eb;
}

.tr-daycard-count {
  color: #9ca3af;
}
/* ===== ユーザープロフィール ===== */

.tr-user-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.tr-user-name-main {
  font-size: 1.1rem;
  font-weight: 600;
  color: #e5e7eb;
}

.tr-user-self-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(34, 197, 94, 0.95);
  color: #022c22;
}

.tr-user-id {
  font-size: 0.78rem;
  color: #9ca3af;
}

.tr-user-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

@media (min-width: 768px) {
  .tr-user-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.tr-user-stat-block {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.95);
}

.tr-user-stat-title {
  font-size: 0.8rem;
  color: #e5e7eb;
  margin-bottom: 4px;
}

.tr-user-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
}

.tr-user-stat-label {
  font-size: 0.72rem;
  color: #9ca3af;
}

.tr-user-stat-value {
  font-size: 0.9rem;
  color: #e5e7eb;
}

/* 称号バッジ */

.tr-user-achievements {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tr-user-ach-badge {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(74, 222, 128, 0.9);
  background: rgba(5, 46, 22, 0.95);
  font-size: 0.74rem;
}

.tr-user-ach-name {
  color: #bbf7d0;
}

.tr-user-ach-rank {
  font-size: 0.7rem;
  color: #bbf7d0;
  opacity: 0.8;
}

/* 最近のログ */

.tr-user-log-list {
  list-style: none;
  padding-left: 0;
  margin: 4px 0 0;
}

.tr-user-log-item {
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.9);
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.tr-user-log-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
}

.tr-user-log-date {
  color: #9ca3af;
}

.tr-user-log-menu {
  color: #e5e7eb;
  font-weight: 500;
}

.tr-user-log-metrics span {
  margin-right: 6px;
}

.tr-user-log-metrics {
  margin-bottom: 2px;
  color: #e5e7eb;
}

.tr-user-log-memo {
  margin: 2px 0 0;
  color: #d1d5db;
}
.tr-tl-user-link {
  color: #e5e7eb;
  text-decoration: none;
}

.tr-tl-user-link:hover {
  text-decoration: underline;
}

.tr-tl-self-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(34, 197, 94, 0.9);
  color: #022c22;
}
.tr-tl-user-link {
  color: #e5e7eb;
  text-decoration: none;
}

.tr-tl-user-link:hover {
  text-decoration: underline;
}

.tr-tl-self-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(34, 197, 94, 0.9);
  color: #022c22;
}

/* チャレンジ達成用タグ（なければ） */
.tr-tl-tag--challenge-clear {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(34, 197, 94, 0.25);
  color: #bbf7d0;
}
.tr-tl-tag--challenge-clear {
  background-color: #f59e0b; /* オレンジ系 */
  color: #fff;
}
.tr-tl-user--all {
  font-weight: 600;
  color: #374151; /* グレー系（好みで） */
}
.tr-daycard-log-main{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}

.tr-daycard-actions{
  display:flex;
  gap:10px;
  flex:0 0 auto;
  align-items:center;
}

.tr-daycard-action-link{
  font-size:.85rem;
  text-decoration:none;
  opacity:.9;
}

.tr-daycard-action-form{ margin:0; }

.tr-daycard-action-btn{
  border:0;
  background:transparent;
  padding:0;
  font-size:.85rem;
  cursor:pointer;
  opacity:.9;
}/* ===== Day card: actions (edit/delete) ===== */
.tr-daycard-actions{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:6px;
  flex-wrap:wrap; /* どうしても収まらない時だけ折り返す */
}

/* formを横並びにする */
.tr-inline-form{
  margin:0;
}

/* 小さめボタン */
.tr-btn--sm{
  padding:6px 10px;
  font-size:0.85rem;
  line-height:1.1;
  border-radius:10px;
}

/* 危険ボタン（既にあれば不要） */
.tr-btn--danger{
  background:#b91c1c;
  color:#fff;
  border:none;
}

/* スマホで “ボタンだけが横に伸びる” を防ぐ */
@media (max-width: 480px){
  .tr-daycard-actions{
    gap:6px;
  }
}
/* menu list compact */
.tr-menu-item{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:10px 0;
  border-bottom:1px solid rgba(148,163,184,.25);
}
.tr-menu-left{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.tr-menu-name{
  font-weight:600;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 220px;
}
@media (max-width: 480px){
  .tr-menu-name{ max-width: 160px; }
}
/* メニュー追加：記録項目フラグ（チェックボックス） */
.tr-flag-grid{
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.tr-flag-field{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(148,163,184,.35);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
}

.tr-flag-field span{
  font-size: 13px;
  opacity: .9;
}

/* スマホ最適化：2列にしてはみ出し防止 */
@media (max-width: 640px){
  .tr-flag-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* ===== actions（編集/削除）を確実にボタン化 ===== */
.tr-daycard-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

.tr-daycard-actions a,
.tr-daycard-actions button{
  appearance:none;
  -webkit-appearance:none;
  border:1px solid rgba(148,163,184,.35);
  background: rgba(255,255,255,.06);
  color: inherit;
  text-decoration:none;
  cursor:pointer;

  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;

  padding:6px 10px;
  font-size:0.85rem;
  line-height:1.1;
  border-radius:10px;

  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}

.tr-daycard-actions a:active,
.tr-daycard-actions button:active{
  transform: translateY(1px);
}

.tr-daycard-actions a:hover,
.tr-daycard-actions button:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(148,163,184,.55);
}

/* 削除は赤く */
.tr-daycard-actions .tr-btn--danger,
.tr-daycard-actions button.tr-btn--danger{
  background:#b91c1c;
  color:#fff;
  border:none;
}
.tr-daycard-actions .tr-btn--danger:hover,
.tr-daycard-actions button.tr-btn--danger:hover{
  background:#991b1b;
}
/* ===== accordion ===== */
.tr-acc{
  border:1px solid rgba(148,163,184,.25);
  border-radius:14px;
  overflow:hidden;
}
.tr-acc-btn{
  width:100%;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  background:rgba(255,255,255,.05);
  color:inherit;
  border:0;
  cursor:pointer;
  font-weight:700;
}
.tr-acc-icon{
  font-weight:900;
  opacity:.85;
}
.tr-acc-body{
  padding:12px 14px;
}
/* ===== daycard accordion ===== */
.tr-daycard-acc{
  border:1px solid rgba(148,163,184,.25);
  border-radius:14px;
  overflow:hidden;
}

.tr-daycard-acc > summary{
  list-style:none;
  cursor:pointer;
}
.tr-daycard-acc > summary::-webkit-details-marker{ display:none; }

.tr-daycard-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 14px;
  background:rgba(255,255,255,.04);
}

.tr-daycard-openbtn{
  flex:0 0 auto;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.35);
  font-size:.85rem;
  white-space:nowrap;
  opacity:.9;
}

/* 開いてる時はラベルを変えたくなるなら（任意） */
.tr-daycard-acc[open] .tr-daycard-openbtn{
  opacity:1;
}

/* ===== log row (inside accordion) ===== */
.tr-logrow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.tr-logrow-left{
  min-width:0;
  display:flex;
  align-items:baseline;
  gap:10px;
}
.tr-logrow-menu{
  font-weight:700;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 240px;
}
.tr-logrow-metrics{
  font-size:.9rem;
  opacity:.9;
  white-space:nowrap;
}
.tr-logrow-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
}
@media (max-width: 480px){
  .tr-logrow-menu{ max-width: 140px; }
  .tr-logrow-metrics{ font-size:.82rem; }
}
/* 蛇腹で開いた時：メニュー名は省略しない（折り返しOK） */
.tr-logrow-menu{
  font-weight:700;
  white-space:normal;      /* nowrap をやめる */
  overflow:visible;        /* hidden をやめる */
  text-overflow:clip;      /* ellipsis をやめる */
  max-width:none;          /* 幅制限を外す */
  font-size:.92rem;        /* 少し小さめ（好みで調整OK） */
  line-height:1.2;
  word-break:break-word;   /* 長い単語も折る */
}

/* スマホはさらに少し小さく */
@media (max-width: 480px){
  .tr-logrow-menu{
    font-size:.85rem;
  }
}
/* ===== ログ1行全体 ===== */
.tr-logrow{
  display:flex;
  gap:10px;
  padding:10px 0;
  border-bottom:1px solid rgba(148,163,184,.25);
}

/* 左：メニュー名（40%） */
.tr-logrow-left{
  flex:0 0 40%;
  min-width:0; /* 省略制御に必須 */
}

/* メニュー名表示 */
.tr-logrow-menu{
  font-weight:600;
  font-size:.9rem;
  line-height:1.2;

  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* 右：ボリューム + ボタン（60%） */
.tr-logrow-right{
  flex:1;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  min-width:0;
}

/* ボリューム等 */
.tr-logrow-metrics{
  font-size:.85rem;
  color:#e5e7eb;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* 編集・削除（右下に小さく） */
.tr-logrow-actions{
  display:flex;
  justify-content:flex-end;
  gap:6px;
  margin-top:4px;
}

/* ボタンをさらに小さく */
.tr-logrow-actions .tr-btn--sm{
  padding:4px 8px;
  font-size:.75rem;
  border-radius:8px;
}
