/* Leonardo Terms (Story 3526) -- the Library shelf for the vocabulary Tony and Felix share.
   An Organized List: bands, the group / sort row, fold-all and Arrange come from
   contacts/entity-files.css; chips and sheets from files/file-kit.css. */

body { background: #F2F2F4; margin: 0; font-family: "Segoe UI", system-ui, sans-serif; }

.page-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
#lwIconBand, .ct-header, .tm-controls, .tm-selbar { flex: 0 0 auto; }

.ct-header {
    background: #3C3C3C; color: #fff; padding: 10px 16px;
    display: flex; align-items: center; gap: 12px;
}
.ct-header h1 { margin: 0; font-size: 14pt; font-weight: 600; flex: 1; }
.ct-header button { color: #fff; background: transparent; border: 1px solid #6A6A6A; border-radius: 3px;
    padding: 4px 12px; font: inherit; cursor: pointer; }

.tm-controls { background: #fff; border-bottom: 1px solid #E2E2E5; padding: 8px 12px 0; }
.tm-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }

.tm-btn {
    background: #fff; color: #0A66C2; border: 1px solid #C9D7E8; border-radius: 4px;
    padding: 6px 12px; font: 12px "Segoe UI", system-ui, sans-serif; cursor: pointer;
}
.tm-btn:hover { background: #ECF4FD; }
.tm-btn.primary, .tm-btn.on { background: #0A66C2; color: #fff; border-color: #0A66C2; }
.tm-btn:disabled { opacity: 0.5; cursor: default; }

.tm-body { flex: 1 1 auto; overflow-y: auto; padding: 8px 8px 16px; }
.tm-list { max-width: none; margin: 0; }
.tm-selbar { margin: 0 8px 8px; }

/* ---- a term ---- */
.tm-card {
    background: #fff; border: 1px solid #E2E2E5; border-radius: 6px;
    padding: 10px 12px; margin-bottom: 10px; position: relative;
}
.tm-card.tm-fav { border-color: #F2C94C; background: #FFFDF3; }
.tm-card.ef-sel { border-color: #0A66C2; background: #ECF4FD; box-shadow: 0 0 0 1px #0A66C2 inset; }
.tm-card.tm-flash { animation: tm-flash 1.6s ease-out 2; }
@keyframes tm-flash { 0% { background: #DBEAFE; } 100% { background: #fff; } }
.ef-selecting .tm-card { cursor: pointer; }

.tm-top { display: flex; align-items: center; gap: 8px; }
.tm-alias { color: #6D28D9; font-style: italic; }
.tm-dash { color: #94A3B8; font-weight: 400; }
.tm-term { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 15px; font-weight: 700; color: #111; word-break: break-word; }
.tm-star {
    background: none; border: 1px solid transparent; border-radius: 4px;
    color: #94A3B8; font-size: 17px; line-height: 1; padding: 2px 6px; cursor: pointer; flex: 0 0 auto;
}
.tm-star.on { color: #D97706; }
.tm-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: #475569; }
.tm-aka { color: #475569; }
.tm-def { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: #1F2937; white-space: pre-wrap; word-break: break-word; }
.tm-line { margin-top: 6px; font-size: 12px; color: #334155; word-break: break-word; }
.tm-line b { color: #0F172A; font-weight: 600; }
.tm-example { font-style: italic; }
.tm-actions-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.tm-actions-row .danger { color: #B00020; border-color: #E8B4BE; }
.tm-empty { color: #64748B; font-size: 13px; padding: 20px 4px; }

/* ---- the add / edit sheet ---- */
.tm-form { display: flex; flex-direction: column; gap: 10px; }
.tm-form label { font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: #475569; }
.tm-form input[type="text"], .tm-form textarea {
    display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 8px 10px;
    border: 1px solid #C9D0D8; border-radius: 4px; font: 14px "Segoe UI", system-ui, sans-serif;
}
.tm-form textarea { min-height: 70px; resize: vertical; }
.tm-form .picker-wrap { margin-top: 4px; }
.tm-form .tm-check { display: flex; align-items: center; gap: 8px; text-transform: none; font-size: 13px; font-weight: 400; color: #1F2937; }
.tm-form .voice-mic-wrap { display: block; }

@media (max-width: 640px) {
    .ef-summary { flex-basis: 100%; margin-left: 0; order: 9; }
}

/* ---- the picture (Story 3535): folded until opened, drawn in a sandboxed frame ---- */
.tm-pic { margin-top: 8px; border-top: 1px dashed #E2E8F0; padding-top: 6px; }
.tm-pic-toggle {
    display: inline-flex; align-items: center; gap: 6px; background: none; border: none; padding: 4px 0;
    font: 600 12px "Segoe UI", system-ui, sans-serif; color: #0A66C2; cursor: pointer;
}
.tm-pic-caret { width: 10px; color: #475569; }
.tm-pic-body { margin-top: 6px; }
.tm-pic-frame { display: block; width: 100%; height: 220px; border: 1px solid #E2E2E5; border-radius: 6px; background: #F2F2F4; }
.tm-pic-msg { font-size: 12px; color: #64748B; padding: 6px 2px; }
.tm-form textarea.tm-code { font: 12px Consolas, "Courier New", monospace; min-height: 90px; }
/* Story 6820: Reader and Listen beside the row's buttons */
.tm-actions-row .pr-btns { display: inline-flex; gap: 6px; flex-wrap: wrap; }
