/* SeqYouSum の各画面で共通するレイアウトと操作部品を定義する。 */

body {
  margin: 0;
  background: #f6f7f9;
  color: #1f2937;
  font-family: system-ui, sans-serif;
}

.page {
  margin: 0 auto;
  padding: 24px;
}

.page-narrow {
  max-width: 880px;
}

.page-table {
  box-sizing: border-box;
  max-width: 1180px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page-detail {
  max-width: 1180px;
}

h1 {
  margin: 0 0 18px;
  font-size: 24px;
  line-height: 1.35;
}

h2 {
  margin: 24px 0 10px;
  font-size: 18px;
}

.heading-icon {
  height: 1em;
  vertical-align: -0.12em;
}

a {
  color: #1d4ed8;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

button:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.button-outline {
  border-color: #94a3b8;
  background: #fff;
  color: #475569;
}

.button-outline:hover {
  border-color: #64748b;
  background: #f8fafc;
  color: #334155;
}

.button-outline:disabled {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #94a3b8;
}

.back-link {
  display: inline-block;
  margin: 0 0 16px;
  font-size: 14px;
}

.channel-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

input[type="url"] {
  flex: 1;
  min-width: 360px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 14px;
}

.login-form {
  display: grid;
  gap: 8px;
  max-width: 360px;
}

.login-form label {
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 14px;
}

textarea {
  width: 100%;
  min-height: 3em;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font: inherit;
  font-size: 14px;
}

.message {
  padding: 12px;
  border: 1px solid #f59e0b;
  background: #fffbeb;
  border-radius: 4px;
  margin: 0 0 12px;
}

.notice {
  padding: 12px;
  border: 1px solid #93c5fd;
  background: #eff6ff;
  border-radius: 4px;
  margin: 0 0 12px;
}

.channel-table {
  width: 100%;
  border: 1px solid #dbe3ef;
}

.channel-table th,
.channel-table td {
  padding: 5px 4px;
}

.channel-table a {
  font-weight: 700;
}

.number {
  width: 5em;
  text-align: right;
  white-space: nowrap;
}

.progress-count {
  width: 13em;
  text-align: right;
  white-space: nowrap;
}

.fetched-at {
  width: 10em;
  white-space: nowrap;
}

.summary {
  margin: 0 0 10px;
  font-size: 14px;
  color: #475569;
}

#video-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.video-table-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border: 1px solid #dbe3ef;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 5px 4px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  background: #eef2f7;
  color: #334155;
  font-size: 13px;
}

.video-table-scroll th {
  position: sticky;
  top: 0;
  z-index: 1;
}

tr:last-child td {
  border-bottom: 0;
}

.index {
  width: 2em;
  text-align: right;
  color: #64748b;
}

.duration,
.date,
.article-date {
  width: 4em;
  white-space: nowrap;
  color: #475569;
}

.status {
  width: 3em;
  color: #475569;
}

.spot-match {
  width: 4em;
  text-align: center;
  white-space: nowrap;
}

.actions {
  width: 12em;
  text-align: right;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.row-action-form {
  margin: 0;
}

.row-action-form button,
.actions button {
  padding: 7px 10px;
  font-size: 13px;
}

.video-title-cell {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.video-title-cell .youtube-link {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: #dc2626;
}

.video-title-cell .youtube-link svg {
  width: 22px;
  height: 22px;
  display: block;
}

.sort-link {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.sort-link:hover {
  text-decoration: underline;
}

.detail-youtube-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  font-weight: 700;
}

.detail-youtube-link svg {
  width: 24px;
  height: 24px;
  color: #dc2626;
}

.action-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 16px;
}

.article-form {
  margin: 0 0 16px;
}

.article-provider-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.prompt-field {
  display: block;
  margin: 10px 0 8px;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #dbe3ef;
}

.detail-table th,
.detail-table td {
  padding: 5px 4px;
}

.detail-table th {
  width: 12em;
}

.detail-table tr:last-child th,
.detail-table tr:last-child td {
  border-bottom: 0;
}

.image-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  font-size: 14px;
}

.image-list img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border: 1px solid #dbe3ef;
  background: #fff;
}

.empty {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

.article-body {
  padding: 16px;
  border: 1px solid #dbe3ef;
  background: #fff;
  font-size: 15px;
  line-height: 1.7;
}

.article-body h1 {
  font-size: 22px;
}

.article-body h2 {
  margin: 18px 0 8px;
  font-size: 18px;
}

.article-body img {
  max-width: 100%;
  height: auto;
}

.spot-actions {
  width: 7em;
  text-align: right;
}

.spot-actions form {
  margin: 0 0 6px;
}

.spot-match-reason {
  color: #64748b;
  font-size: 12px;
}

.spot-row-matched td {
  background: #ecfdf5;
}

.spot-row-matched td:first-child {
  box-shadow: inset 4px 0 0 #10b981;
}

.spot-match-badge,
.candidate-current {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  background: #d1fae5;
  color: #047857;
  font-size: 12px;
  font-weight: 700;
}

.spot-list-badge {
  display: inline-block;
  min-width: 2em;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.spot-list-badge-linked {
  background: #d1fae5;
  color: #047857;
}

.spot-list-badge-unlinked {
  background: #fee2e2;
  color: #b91c1c;
}

.spot-candidates {
  padding: 12px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
}

.spot-candidates-heading {
  margin: 0 0 8px;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

.candidate-table {
  margin: 0 0 8px;
  border: 1px solid #bfdbfe;
  background: #f8fbff;
}

.candidate-table th,
.candidate-table td {
  font-size: 13px;
}

.candidate-table th {
  background: #dbeafe;
}

.candidate-table td {
  background: #f8fbff;
}

.candidate-row-matched td {
  background: #dcfce7;
}

.candidate-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.candidate-reject-form {
  margin: 0;
}

.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-block;
}

.spot-check-indicator {
  margin-left: 6px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}
