/* Custom Topic Fields 1.3.1 – loaded once per page from overall_header_head_append (was inline in every post). */

/* ---------- topic list (viewforum / search) ---------- */
.custom-topic-viewforum-fields { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; font-size: .9em; }
.custom-topic-viewforum-item, .custom-topic-viewforum-value { white-space: nowrap; }
.custom-topic-viewforum-badge { display: inline-block; padding: 1px 6px; border-radius: 10px; background: #e8f1f8; white-space: nowrap; }
.custom-topic-viewforum-badge-label { font-weight: bold; }
.custom-topic-viewforum-cell { display: inline-flex; border: 1px solid #cbd9e5; border-radius: 3px; overflow: hidden; white-space: nowrap; }
.custom-topic-viewforum-cell-label { padding: 1px 5px; font-weight: bold; background: #e8f1f8; }
.custom-topic-viewforum-cell-value { padding: 1px 5px; background: #fff; }
.custom-topic-viewforum-notice { padding: 2px 6px; border-left: 3px solid #d79b27; background: #fff9e8; }

/* ---------- topic page: group styles ---------- */
.custom-topic-viewtopic-group { clear: both; margin: 10px 0; }
.custom-topic-viewtopic-group-title { margin: 0 0 5px; font-size: 1.05em; }
.custom-topic-viewtopic-detail_table .custom-topic-viewtopic-fields { display: grid; grid-template-columns: minmax(130px, 30%) 1fr; border-top: 1px solid #d7d7d7; }
.custom-topic-viewtopic-detail_table .custom-topic-field { display: contents; }
.custom-topic-viewtopic-detail_table .custom-topic-field dt,
.custom-topic-viewtopic-detail_table .custom-topic-field dd { margin: 0; padding: 6px 8px; border-bottom: 1px solid #d7d7d7; }
.custom-topic-viewtopic-detail_table .custom-topic-field dt { font-weight: bold; background: #f3f5f7; }
.custom-topic-viewtopic-detail_table .custom-topic-field.custom-topic-boolean-checkbox dt { grid-column: 1 / -1; }
.custom-topic-viewtopic-field-checkmark { display: inline-block; margin: 0 4px; line-height: 1; }
.custom-topic-viewtopic-field.custom-topic-boolean-checkbox dd { display: none; }
.custom-topic-viewtopic-cards .custom-topic-viewtopic-fields { display: flex; flex-wrap: wrap; gap: 8px; }
.custom-topic-viewtopic-cards .custom-topic-field { min-width: 150px; flex: 1 1 180px; margin: 0; padding: 8px; border: 1px solid #d7d7d7; border-radius: 4px; background: #f8f9fa; }
.custom-topic-viewtopic-cards .custom-topic-field dt { float: none; width: auto; font-weight: bold; }
.custom-topic-viewtopic-cards .custom-topic-field dd { margin: 4px 0 0; }
.custom-topic-viewtopic-timeline .custom-topic-viewtopic-fields { margin-left: 9px; padding-left: 18px; border-left: 3px solid #73a9cf; }
.custom-topic-viewtopic-timeline .custom-topic-field { position: relative; margin: 0 0 12px; }
.custom-topic-viewtopic-timeline .custom-topic-field::before { content: ''; position: absolute; left: -25px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: #2980b9; }
.custom-topic-viewtopic-timeline .custom-topic-field dt { float: none; width: auto; font-weight: bold; }
.custom-topic-viewtopic-timeline .custom-topic-field dd { margin: 3px 0 0; }
.custom-topic-viewtopic-compact_list .custom-topic-viewtopic-fields { columns: 2 220px; column-gap: 24px; }
.custom-topic-viewtopic-compact_list .custom-topic-field { display: flex; break-inside: avoid; margin: 0 0 5px; }
.custom-topic-viewtopic-compact_list .custom-topic-field dt { float: none; width: auto; margin-right: 6px; font-weight: bold; }
.custom-topic-viewtopic-compact_list .custom-topic-field dd { margin: 0; }
.custom-topic-viewtopic-compact_list_2 .custom-topic-checklist { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0; padding: 0; list-style: none; }
.custom-topic-viewtopic-compact_list_2 .custom-topic-checklist-item { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; white-space: nowrap; }
.custom-topic-viewtopic-compact_list_2 .custom-topic-checklist-name { font-weight: bold; }
.custom-topic-viewtopic-compact_list_2 .custom-topic-checklist-value { display: inline-block; min-width: 2.4em; padding: 3px 9px; border: 1px solid #c9d0d5; border-radius: 5px; background: #fff; color: #283b4e; }
.custom-topic-viewtopic-compact_list_2 .custom-topic-checklist-value.is-empty { color: #8a959e; }
.custom-topic-viewtopic-compact_list_2 .custom-topic-checkmark { display: inline-block; min-width: 1.35em; font-size: 1.55em; line-height: 1; font-weight: bold; color: #8a959e; }
.custom-topic-viewtopic-compact_list_2 .custom-topic-checkmark.is-checked { color: #278443; }
.custom-topic-progress-track { height: 16px; overflow: hidden; border-radius: 8px; background: #dce6ee; }
.custom-topic-progress-bar { height: 100%; background: #2980b9; }
.custom-topic-progress-label { display: inline-block; margin: 3px 0 8px; font-weight: bold; }
.custom-topic-progress-status { display: inline-block; margin: 3px 0 8px 8px; font-weight: bold; }
.custom-topic-viewtopic-progress .custom-topic-field { margin: 0 0 5px; }
.custom-topic-viewtopic-progress .custom-topic-field dt { float: none; width: auto; font-weight: bold; }
.custom-topic-viewtopic-progress .custom-topic-field dd { margin: 2px 0 0; }
.custom-topic-viewtopic-amount_summary .custom-topic-viewtopic-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.custom-topic-viewtopic-amount_summary .custom-topic-field { margin: 0; padding: 9px; border-left: 4px solid #4b9b5f; background: #f1f8f2; }
.custom-topic-viewtopic-amount_summary .custom-topic-field dt { float: none; width: auto; font-size: .9em; }
.custom-topic-viewtopic-amount_summary .custom-topic-field dd { margin: 4px 0 0; font-size: 1.15em; font-weight: bold; }
.custom-topic-viewtopic-notice { padding: 10px; border-left: 4px solid #d79b27; background: #fff9e8; }
.custom-topic-viewtopic-notice .custom-topic-field { margin: 0 0 5px; }
.custom-topic-viewtopic-notice .custom-topic-field dt { float: none; width: auto; font-weight: bold; }
.custom-topic-viewtopic-notice .custom-topic-field dd { margin: 2px 0 0; }
@media (max-width: 500px) { .custom-topic-viewtopic-detail_table .custom-topic-viewtopic-fields { grid-template-columns: 1fr; } }

/* ---------- 1.3.1 two-column case layout ---------- */
.ctf-layout { clear: both; margin: 10px 0; }
.ctf-layout .custom-topic-viewtopic-group { margin: 0 0 12px; padding: 12px 14px; border: 1px solid #dfe4e8; border-radius: 8px; background: #fff; box-sizing: border-box; min-width: 0; }
.ctf-layout .custom-topic-viewtopic-notice { border-left: 4px solid #d79b27; background: #fff9e8; }
.ctf-layout .custom-topic-viewtopic-group .custom-topic-viewtopic-group-title { margin: 0 0 8px; font-size: 17px; line-height: 1.3; }
.ctf-layout.ctf-has-side { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 14px; align-items: start; }
.ctf-main, .ctf-side { min-width: 0; }
.ctf-layout.ctf-has-side .ctf-side { grid-column: 1; grid-row: 1; position: sticky; top: 12px; }
.ctf-layout.ctf-has-side .ctf-main { grid-column: 2; grid-row: 1; }

/* collapsible groups */
.ctf-collapse > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; cursor: pointer; list-style: none; }
.ctf-collapse > summary::-webkit-details-marker { display: none; }
.ctf-collapse > summary::after { content: '▾'; order: 2; margin-left: auto; color: #8a959e; transition: transform .15s; }
.ctf-collapse:not([open]) > summary::after { transform: rotate(-90deg); }
.ctf-layout .ctf-collapse > summary .custom-topic-viewtopic-group-title { margin: 0; font-weight: bold; }
.ctf-summary { order: 3; flex-basis: 100%; overflow: hidden; color: #5b6770; font-size: .9em; text-overflow: ellipsis; white-space: nowrap; }
.ctf-collapse[open] > summary { margin-bottom: 8px; }
.ctf-collapse[open] > summary .ctf-summary { display: none; }

/* timeline: filled / waiting, staff-only step durations */
.ctf-layout .custom-topic-viewtopic-timeline .custom-topic-field.is-empty { opacity: .55; }
.ctf-layout .custom-topic-viewtopic-timeline .custom-topic-field.is-empty::before { background: #fff; border: 2px solid #9fb6c8; width: 5px; height: 5px; }
.ctf-layout .custom-topic-viewtopic-timeline .custom-topic-field.is-done::before { background: #73a9cf; }
.ctf-duration { margin-left: 6px; color: #8a959e; font-size: .85em; }
.ctf-total { margin-left: 6px; color: #c0392b; font-size: .85em; font-weight: bold; white-space: nowrap; }

/* accessories / faults: read-only chips, not form boxes */
.ctf-layout .custom-topic-viewtopic-compact_list_2 .custom-topic-checklist { gap: 6px; }
.ctf-layout .ctf-chip { gap: 5px; min-height: 0; padding: 3px 10px; border: 1px solid #b9d7c2; border-radius: 14px; background: #eef7f0; color: #1f4d2c; }
.ctf-layout .ctf-chip .custom-topic-checkmark { min-width: 0; font-size: 1em; }
.ctf-layout .ctf-chip .custom-topic-checklist-name { font-weight: normal; }
.ctf-layout .ctf-chip .custom-topic-checklist-value { min-width: 0; padding: 0; border: 0; background: none; color: inherit; font-weight: bold; }
.ctf-layout .ctf-chip.is-unchecked { border: 1px dashed #c9d0d5; background: #f6f7f8; color: #8a959e; }
.ctf-layout .ctf-chip.is-unchecked .custom-topic-checkmark { color: #b0b8bf; }
.ctf-chip-note { font-size: .85em; }

/* plain data groups: no outer frame (their cards / rows already have one) */
.ctf-layout .custom-topic-viewtopic-group.custom-topic-viewtopic-cards,
.ctf-layout .custom-topic-viewtopic-group.custom-topic-viewtopic-detail_table,
.ctf-layout .custom-topic-viewtopic-group.custom-topic-viewtopic-compact_list_2 { padding: 0 1px; border: 0; border-radius: 0; background: none; }

/* cards: tighter */
.ctf-layout .custom-topic-viewtopic-cards .custom-topic-field { flex: 1 1 160px; min-width: 0; padding: 7px 9px; box-sizing: border-box; }

@media (max-width: 760px) {
	.ctf-layout.ctf-has-side { display: flex; flex-direction: column; gap: 0; }
	.ctf-layout .ctf-main, .ctf-layout .ctf-side { display: contents; }
	.ctf-layout .custom-topic-viewtopic-group { order: var(--ctf-order, 0); align-self: stretch; width: auto; float: none; margin-bottom: 8px; padding: 10px 11px; }
	.ctf-layout .custom-topic-viewtopic-group.custom-topic-viewtopic-cards,
	.ctf-layout .custom-topic-viewtopic-group.custom-topic-viewtopic-detail_table,
	.ctf-layout .custom-topic-viewtopic-group.custom-topic-viewtopic-compact_list_2 { padding: 0 1px; }
	.ctf-layout.ctf-has-side .ctf-side { position: static; }
	.ctf-layout .custom-topic-viewtopic-cards .custom-topic-field { flex: 1 1 calc(50% - 8px); }
	.ctf-layout .custom-topic-viewtopic-detail_table .custom-topic-viewtopic-fields { grid-template-columns: minmax(90px, 38%) 1fr; }
	.ctf-layout .custom-topic-viewtopic-detail_table .custom-topic-field dt,
	.ctf-layout .custom-topic-viewtopic-detail_table .custom-topic-field dd { padding: 5px 7px; }
	.ctf-layout .custom-topic-viewtopic-timeline .custom-topic-field { margin-bottom: 8px; }
}
