/* ──────────────────────────────────────────────────────────────────────────
   TM Legal Codes — Frontend CSS  v2.1 (9.3.2)
   Design: legal research platform (CanLII / Cornell LII)
   Fonturi: Georgia (serif, articole), Roboto Condensed (UI)
   Culori: #800020 maroon, monocromie controlată
   ────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@300;400;500;700&family=Roboto+Condensed:wght@400;600;700&family=Roboto:wght@400;500&display=swap');

/* ── Reset & Variabile ────────────────────────────────────────────────────── */
.tmlc-app {
    --c-primary:     #800020;
    --c-primary-dk:  #5c0017;
    --c-primary-bg:  #fdf5f7;
    --c-gold:        #8b6914;
    --c-gold-bg:     #fefaf0;
    --c-text:        #1c1c1c;
    --c-text-2:      #4a4a4a;
    --c-text-3:      #7a7a7a;
    --c-border:      #ddd;
    --c-border-lt:   #eeeeee;
    --c-bg:          #f8f8f6;
    --c-white:       #ffffff;
    --c-mark:        rgba(139, 105, 20, .18);

    --sidebar-w:     325px;
    --header-h:      auto;
    --radius-sm:     3px;
    --radius:        5px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
    --shadow:        0 2px 10px rgba(0,0,0,.1);

    --font-ui:       'Roboto Condensed', 'Roboto', sans-serif;
    --font-body:     'Roboto Slab', Georgia, serif;
    --font-mono:     'Roboto Condensed', monospace;

    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.5;
    color: var(--c-text);
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin: 0 0 32px;
    min-height: 200px;
}

.tmlc-app *, .tmlc-app *::before, .tmlc-app *::after {
    box-sizing: border-box;
}

/* ── Skeleton Loader ──────────────────────────────────────────────────────── */
.tmlc-skeleton {
    padding: 0;
}

.tmlc-sk-header {
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dk) 100%);
    padding: 18px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tmlc-sk-body {
    display: flex;
    gap: 0;
    min-height: 300px;
}

.tmlc-sk-sidebar {
    width: var(--sidebar-w);
    border-right: 1px solid var(--c-border);
    background: var(--c-white);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.tmlc-sk-main {
    flex: 1;
    padding: 28px 32px;
    background: var(--c-bg);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tmlc-sk-line {
    height: 12px;
    background: linear-gradient(90deg, rgba(255,255,255,.12) 0%, rgba(255,255,255,.3) 50%, rgba(255,255,255,.12) 100%);
    background-size: 200% 100%;
    border-radius: 3px;
    animation: tmlc-shimmer 1.5s infinite;
}

.tmlc-sk-sidebar .tmlc-sk-line {
    background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
    background-size: 200% 100%;
    animation: tmlc-shimmer-light 1.5s infinite;
}

.tmlc-sk-main .tmlc-sk-line {
    background: linear-gradient(90deg, #eeeeee 0%, #e0e0e0 50%, #eeeeee 100%);
    background-size: 200% 100%;
    animation: tmlc-shimmer-light 1.5s infinite;
}

.tmlc-sk-title { height: 20px; width: 70%; }
.tmlc-sk-sub   { height: 13px; width: 45%; opacity: .6; }
.tmlc-sk-short { width: 60%; }

@keyframes tmlc-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}
@keyframes tmlc-shimmer-light {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

/* ── Layout Principal ─────────────────────────────────────────────────────── */
.tmlc-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.tmlc-header {
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dk) 100%);
    color: white;
}

.tmlc-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 14px;
    gap: 16px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.tmlc-header-info {
    min-width: 0;
}

.tmlc-header-eyebrow {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,.55);
    margin-bottom: 3px;
    font-family: var(--font-ui);
}

.tmlc-header-title {
    font-family: var(--font-ui);
    font-size: 19px;
    font-weight: 700;
    color: white;
    margin: 0 0 2px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tmlc-header-sub {
    font-size: 11px;
    color: rgba(255,255,255,.6);
}

.tmlc-header-pills {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.tmlc-pill {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 11px;
    font-family: var(--font-ui);
    color: rgba(255,255,255,.8);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tmlc-pill-num {
    font-weight: 700;
    font-size: 13px;
    color: white;
}

/* ── Zona de Search ───────────────────────────────────────────────────────── */
.tmlc-search-zone {
    padding: 10px 20px 12px;
    background: rgba(0,0,0,.15);
    position: relative;
}

.tmlc-search-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.tmlc-search-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,.92);
    border-radius: 4px;
    overflow: visible;
}

.tmlc-search-number-wrap {
    min-width: 176px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 4px;
}

.tmlc-search-number-label {
    color: rgba(255,255,255,.78);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.tmlc-search-number-input {
    width: 100%;
    min-width: 0;
    border: none;
    background: transparent;
    color: white;
    font-family: var(--font-ui);
    font-size: 13px;
    padding: 8px 0;
    outline: none;
}

.tmlc-search-number-input::placeholder {
    color: rgba(255,255,255,.5);
}

.tmlc-search-icon-wrap {
    padding: 0 10px;
    color: var(--c-text-3);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.tmlc-search-icon-wrap svg {
    width: 15px;
    height: 15px;
}

.tmlc-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    font-family: var(--font-ui);
    color: var(--c-text);
    padding: 8px 0;
    outline: none;
    min-width: 0;
}

.tmlc-search-input::placeholder { color: #aaa; }

.tmlc-btn-search {
    background: white;
    color: var(--c-primary);
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
}

.tmlc-btn-search:hover {
    background: var(--c-primary);
    color: white;
}

.tmlc-btn-adv {
    background: transparent;
    color: rgba(255,255,255,.7);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 4px;
    padding: 7px 11px;
    font-family: var(--font-ui);
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tmlc-btn-adv:hover {
    background: rgba(255,255,255,.15);
    color: white;
    border-color: rgba(255,255,255,.4);
}

.tmlc-btn-adv svg { width: 13px; height: 13px; }

.tmlc-btn-copy {
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.82);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 4px;
    padding: 7px 10px;
    font-family: var(--font-ui);
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tmlc-btn-copy:hover {
    background: rgba(255,255,255,.18);
    color: white;
    border-color: rgba(255,255,255,.4);
}

.tmlc-btn-copy.is-copied {
    background: rgba(39, 94, 58, .92);
    color: white;
    border-color: rgba(255,255,255,.28);
}

.tmlc-btn-copy.is-error {
    background: rgba(140, 34, 34, .92);
    color: white;
    border-color: rgba(255,255,255,.28);
}

.tmlc-btn-copy svg { width: 13px; height: 13px; }

@media (max-width: 920px) {
    .tmlc-search-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .tmlc-search-wrap {
        flex: 1 1 100%;
        order: 1;
    }

    .tmlc-search-number-wrap {
        flex: 1 1 160px;
        min-width: 0;
        order: 2;
    }

    .tmlc-btn-search { order: 3; }
    .tmlc-btn-adv    { order: 4; }
    .tmlc-btn-copy   { order: 5; }
}

/* Autocomplete */
.tmlc-ac-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--c-border);
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    list-style: none;
    padding: 4px 0;
    margin: 0;
    z-index: 1000;
    display: none;
}

.tmlc-ac-list.open { display: block; }

.tmlc-ac-list li {
    padding: 7px 14px;
    font-size: 13px;
    color: var(--c-text);
    cursor: pointer;
    font-family: var(--font-ui);
    transition: background .1s;
}

.tmlc-ac-list li:hover,
.tmlc-ac-list li.tmlc-ac-active {
    background: var(--c-primary-bg);
    color: var(--c-primary);
}

/* ── Modal Search Avansat ─────────────────────────────────────────────────── */
.tmlc-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 9998;
    align-items: center;
    justify-content: center;
}

.tmlc-modal-overlay.open { display: flex; }

.tmlc-modal-box {
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 8px 40px rgba(0,0,0,.25);
    width: 540px;
    max-width: 95vw;
    max-height: 90vh;
    overflow: auto;
    z-index: 9999;
    font-family: var(--font-ui);
}

.tmlc-modal-head {
    background: var(--c-primary);
    color: white;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tmlc-modal-head-inner {
    display: flex;
    align-items: center;
    gap: 9px;
}

.tmlc-modal-head-icon {
    display: flex;
    align-items: center;
    opacity: .75;
}

.tmlc-modal-head-icon svg { width: 15px; height: 15px; }

.tmlc-modal-head h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    font-family: var(--font-ui);
    color: #ffffff !important;
}

.tmlc-modal-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.tmlc-modal-close:hover { color: white; }

.tmlc-modal-body {
    padding: 20px;
}

.tmlc-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.tmlc-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tmlc-form-group.full { grid-column: 1 / -1; }

.tmlc-form-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--c-text-3);
}

.tmlc-form-input,
.tmlc-form-select {
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    font-size: 13px;
    font-family: var(--font-ui);
    color: var(--c-text);
    background: white;
    outline: none;
    transition: border-color .15s;
}

.tmlc-form-input:focus,
.tmlc-form-select:focus {
    border-color: var(--c-primary);
}

.tmlc-form-check {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    cursor: pointer;
    margin: 4px 0;
}

.tmlc-form-check input { width: 15px; height: 15px; accent-color: var(--c-primary); }

.tmlc-range-wrap { display: flex; align-items: center; gap: 10px; }
.tmlc-range-wrap input[type=range] { flex: 1; accent-color: var(--c-primary); }
.tmlc-range-val { font-size: 12px; color: var(--c-primary); font-weight: 700; min-width: 32px; }

.tmlc-modal-foot {
    padding: 14px 20px;
    border-top: 1px solid var(--c-border-lt);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.tmlc-btn-cancel {
    background: none;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 13px;
    font-family: var(--font-ui);
    cursor: pointer;
    color: var(--c-text-2);
    transition: all .15s;
}

.tmlc-btn-cancel:hover { border-color: var(--c-text-2); }

.tmlc-btn-apply {
    background: var(--c-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 20px;
    font-size: 13px;
    font-family: var(--font-ui);
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}

.tmlc-btn-apply:hover { background: var(--c-primary-dk); }

/* ── Body (Sidebar + Main) ────────────────────────────────────────────────── */
.tmlc-body {
    display: flex;
    flex: 1;
    min-height: 500px;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.tmlc-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--c-white);
    border-right: 1px solid var(--c-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tmlc-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 9px;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-bg);
}

.tmlc-sidebar-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--c-primary);
    font-family: var(--font-ui);
}

.tmlc-sidebar-ctrls {
    display: flex;
    gap: 4px;
}

.tmlc-ctrl-btn {
    background: none;
    border: 1px solid var(--c-border);
    border-radius: 3px;
    padding: 2px 5px;
    cursor: pointer;
    color: var(--c-text-3);
    display: flex;
    align-items: center;
    transition: all .12s;
}

.tmlc-ctrl-btn:hover {
    border-color: var(--c-primary);
    color: var(--c-primary);
}

.tmlc-ctrl-btn svg { width: 12px; height: 12px; }

/* TOC */
.tmlc-toc {
    overflow-y: auto;
    flex: 1;
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.tmlc-toc::-webkit-scrollbar { width: 4px; }
.tmlc-toc::-webkit-scrollbar-track { background: transparent; }
.tmlc-toc::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }
.tmlc-toc::-webkit-scrollbar-thumb:hover { background: #bbb; }

.tmlc-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Nivel 0 — Parte (GENERALA / SPECIALA) */
.tmlc-toc-l0 > .tmlc-toc-item {
    border-bottom: 1px solid var(--c-border-lt);
}

/* Buton section */
.tmlc-toc-btn {
    display: flex;
    align-items: flex-start;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    padding: 7px 14px;
    text-align: left;
    gap: 6px;
    font-family: var(--font-ui);
    transition: background .12s;
}

.tmlc-toc-btn:hover { background: var(--c-primary-bg); }
.tmlc-toc-btn.active { background: var(--c-primary-bg); }

/* Chevron */
.tmlc-chev {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    color: var(--c-text-3);
    transition: transform .2s;
}

.tmlc-chev svg { width: 11px; height: 11px; }
.tmlc-toc-btn[aria-expanded="true"] .tmlc-chev { transform: rotate(90deg); color: var(--c-primary); }

/* Labels */
.tmlc-toc-text { flex: 1; min-width: 0; }

.tmlc-toc-label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--c-primary);
    line-height: 1.2;
}

/* Nivel 0 */
.tmlc-l0 > .tmlc-toc-btn .tmlc-toc-label { font-size: 14px; letter-spacing: .6px; }

.tmlc-toc-title {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: var(--c-text-2);
    line-height: 1.35;
    margin-top: 1px;
}

.tmlc-toc-count {
    flex-shrink: 0;
    font-size: 10px;
    color: var(--c-text-3);
    background: var(--c-border-lt);
    border-radius: 10px;
    padding: 1px 6px;
    margin-top: 2px;
    font-family: var(--font-ui);
}

/* Children container */
.tmlc-toc-children {
    overflow: hidden;
    max-height: 0;
    transition: max-height .25s ease;
}

.tmlc-toc-children.open { max-height: 9999px; }

/* Indentare */
.tmlc-l1 > .tmlc-toc-btn { padding-left: 22px; background: none; }
.tmlc-l1 > .tmlc-toc-btn .tmlc-toc-label { font-size: 13px; color: var(--c-text-2); font-weight: 600; text-transform: none; letter-spacing: 0; }

.tmlc-l2 > .tmlc-toc-btn { padding-left: 30px; }
.tmlc-l2 > .tmlc-toc-btn .tmlc-toc-label { font-size: 13px; color: var(--c-text-2); font-weight: 600; text-transform: none; letter-spacing: 0; }

/* Articole în TOC */
.tmlc-art-list {
    border-top: 1px solid var(--c-border-lt);
    background: #fdfdfd;
}

.tmlc-art-entry {
    display: flex;
    align-items: baseline;
    gap: 7px;
    padding: 5px 14px 5px 30px;
    cursor: pointer;
    transition: background .1s;
    border-bottom: 1px solid var(--c-border-lt);
}

.tmlc-art-entry:last-child { border-bottom: none; }
.tmlc-art-entry:hover { background: var(--c-primary-bg); }
.tmlc-art-entry.current { background: var(--c-primary); }

.tmlc-art-entry.current .tmlc-art-nr,
.tmlc-art-entry.current .tmlc-art-marg { color: white; }

.tmlc-art-nr {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 700;
    color: var(--c-primary);
    flex-shrink: 0;
    min-width: 36px;
}

.tmlc-art-marg {
    font-size: 12px;
    color: var(--c-text-3);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-style: italic;
}

/* ── Main Content ─────────────────────────────────────────────────────────── */
.tmlc-main {
    flex: 1;
    min-width: 0;
    background: var(--c-bg);
    display: flex;
    flex-direction: column;
}

/* Welcome screen */
.tmlc-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    text-align: center;
}

.tmlc-welcome-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    color: var(--c-primary);
    opacity: .15;
}

.tmlc-welcome-icon svg { width: 64px; height: 64px; }

.tmlc-welcome-title {
    font-family: var(--font-ui);
    font-size: 20px;
    font-weight: 700;
    color: var(--c-primary);
    margin: 0 0 6px;
}

.tmlc-welcome-ref {
    font-size: 13px;
    color: var(--c-text-3);
    margin: 0 0 20px;
}

.tmlc-welcome-hint {
    font-size: 13px;
    color: var(--c-text-2);
    max-width: 320px;
    line-height: 1.6;
    margin: 0 auto 28px;
}

.tmlc-stats {
    display: flex;
    gap: 32px;
    justify-content: center;
}

.tmlc-stat { text-align: center; }

.tmlc-stat-n {
    display: block;
    font-family: var(--font-ui);
    font-size: 30px;
    font-weight: 700;
    color: var(--c-primary);
    line-height: 1;
}

.tmlc-stat-l {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--c-text-3);
    display: block;
    margin-top: 3px;
}

/* Loader */
.tmlc-loader {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 12px;
}

.tmlc-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--c-border);
    border-top-color: var(--c-primary);
    border-radius: 50%;
    animation: tmlc-spin .7s linear infinite;
}

@keyframes tmlc-spin { to { transform: rotate(360deg); } }

.tmlc-loader p {
    font-size: 13px;
    color: var(--c-text-3);
    margin: 0;
}

/* ── Article View ─────────────────────────────────────────────────────────── */
.tmlc-article {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Breadcrumb */
.tmlc-breadcrumb {
    padding: 8px 24px;
    background: white;
    border-bottom: 1px solid var(--c-border-lt);
    font-size: 11px;
    color: var(--c-text-3);
    font-family: var(--font-ui);
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.tmlc-bc-sep { color: var(--c-border); }

.tmlc-bc-item {
    color: var(--c-primary);
    cursor: pointer;
    text-decoration: none;
}

.tmlc-bc-item:hover { text-decoration: underline; }
.tmlc-bc-current { color: var(--c-text-2); }

/* Article header */
.tmlc-art-header {
    padding: 20px 24px 16px;
    background: white;
    border-bottom: 2px solid var(--c-primary);
}

.tmlc-art-num-big {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--c-text-3);
    margin-bottom: 4px;
}

.tmlc-art-title-big {
    font-family: var(--font-body);
    font-size: 20px;
    font-weight: normal;
    color: var(--c-primary);
    margin: 0;
    font-style: italic;
    line-height: 1.3;
}

/* Article body */
.tmlc-art-body {
    padding: 24px 24px 20px;
    flex: 1;
    overflow-y: auto;
}

.tmlc-art-text {
    font-family: 'Roboto Condensed', 'Roboto', sans-serif;
    font-size: 17px;
    line-height: 1.8;
    color: var(--c-text);
    margin-bottom: 16px;
}

/* Alineat */
.tmlc-alineat {
    display: flex;
    gap: 14px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.tmlc-aln-nr {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    color: var(--c-primary);
    flex-shrink: 0;
    min-width: 28px;
    padding-top: 3px;
}

.tmlc-aln-text {
    font-family: 'Roboto Condensed', 'Roboto', sans-serif;
    font-size: 17px;
    line-height: 1.8;
    color: var(--c-text);
    flex: 1;
}

/* Litere */
.tmlc-litere {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 24px;
}

.tmlc-litere li {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    font-family: 'Roboto Condensed', 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--c-text);
}

.tmlc-lit-key {
    font-weight: 700;
    color: var(--c-primary);
    flex-shrink: 0;
    min-width: 18px;
    font-family: var(--font-ui);
}

/* Note */
.tmlc-art-notes {
    margin-top: 20px;
    padding: 12px 16px;
    background: var(--c-gold-bg);
    border-left: 3px solid var(--c-gold);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 13px;
    color: var(--c-text-2);
    line-height: 1.6;
}

.tmlc-notes-label {
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--c-gold);
    margin-bottom: 6px;
}

/* Article nav */
.tmlc-art-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-top: 1px solid var(--c-border-lt);
    background: white;
}

.tmlc-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--c-primary);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}

.tmlc-nav-btn svg { width: 12px; height: 12px; }
.tmlc-nav-btn:hover { background: var(--c-primary); color: white; border-color: var(--c-primary); }
.tmlc-nav-btn:disabled { opacity: .35; cursor: not-allowed; }

.tmlc-print-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--c-text-3);
    font-family: var(--font-ui);
    font-size: 12px;
    cursor: pointer;
    transition: all .15s;
}

.tmlc-print-btn svg { width: 12px; height: 12px; }
.tmlc-print-btn:hover { color: var(--c-primary); border-color: var(--c-primary); }

/* ── Search Results ───────────────────────────────────────────────────────── */
.tmlc-results {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tmlc-results-head {
    padding: 14px 24px 10px;
    border-bottom: 1px solid var(--c-border-lt);
    background: white;
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.tmlc-results-title {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 700;
    color: var(--c-primary);
    margin: 0;
}

.tmlc-results-meta {
    font-size: 12px;
    color: var(--c-text-3);
}

.tmlc-results-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

/* Result card */
.tmlc-result {
    background: white;
    border: 1px solid var(--c-border-lt);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.tmlc-result:hover {
    border-color: var(--c-primary);
    box-shadow: 0 1px 6px rgba(128,0,32,.1);
}

.tmlc-result-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 5px;
}

.tmlc-result-num {
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 12px;
    color: var(--c-primary);
    flex-shrink: 0;
}

.tmlc-result-marg {
    font-size: 13px;
    color: var(--c-text-2);
    font-style: italic;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tmlc-result-see {
    font-size: 11px;
    color: var(--c-primary);
    text-decoration: none;
    border: 1px solid var(--c-primary);
    border-radius: 2px;
    padding: 1px 7px;
    flex-shrink: 0;
    font-family: var(--font-ui);
    cursor: pointer;
    background: none;
    transition: all .12s;
}

.tmlc-result-see:hover { background: var(--c-primary); color: white; }

.tmlc-result-snippet {
    font-size: 13px;
    color: var(--c-text-2);
    line-height: 1.6;
    font-family: var(--font-body);
}

.tmlc-result-snippet mark {
    background: var(--c-mark);
    color: var(--c-text);
    border-radius: 2px;
    padding: 0 1px;
}

/* Paginare */
.tmlc-pager {
    display: flex;
    gap: 4px;
    justify-content: center;
    padding: 12px 0 4px;
    flex-wrap: wrap;
}

.tmlc-pg-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    background: white;
    font-family: var(--font-ui);
    font-size: 12px;
    cursor: pointer;
    color: var(--c-text);
    transition: all .12s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tmlc-pg-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.tmlc-pg-btn.current { background: var(--c-primary); color: white; border-color: var(--c-primary); }
.tmlc-pg-btn:disabled { opacity: .3; cursor: not-allowed; }

/* Zero results */
.tmlc-no-results {
    padding: 40px 24px;
    text-align: center;
    color: var(--c-text-3);
}

.tmlc-no-results h3 {
    font-family: var(--font-ui);
    font-size: 16px;
    color: var(--c-text-2);
    margin: 0 0 8px;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.tmlc-footer {
    background: var(--c-primary-dk);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}

.tmlc-footer-l {
    font-size: 11px;
    color: rgba(255,255,255,.5);
    font-family: var(--font-ui);
}

.tmlc-footer-r {
    font-size: 11px;
    color: rgba(255,255,255,.4);
    font-family: var(--font-ui);
}

.tmlc-footer-r a {
    color: rgba(255,255,255,.6);
    text-decoration: none;
    transition: color .12s;
}

.tmlc-footer-r a:hover { color: rgba(255,255,255,.9); }
.tmlc-footer-sep { margin: 0 6px; color: rgba(255,255,255,.25); }

/* ── Responsive ───────────────────────────────────────────────────────────── */

/* ── Tablet (701px – 900px): sidebar se îngustează, header se simplifică ── */
@media (min-width: 701px) and (max-width: 900px) {
    .tmlc-app {
        --sidebar-w: 220px;
    }

    /* Sidebar mai îngustă */
    .tmlc-sidebar {
        width: 220px;
    }

    /* Skeleton sidebar la aceeași lățime */
    .tmlc-sk-sidebar {
        width: 220px;
    }

    /* Header: ascunde pills, font mai mic */
    .tmlc-header-pills  { display: none; }
    .tmlc-header-title  { font-size: 16px; }
    .tmlc-header-top    { padding: 12px 16px 10px; gap: 10px; }

    /* Search zone: search-number-wrap mai flexibil */
    .tmlc-search-number-wrap {
        min-width: 130px;
    }

    /* Articol: padding ușor redus */
    .tmlc-art-body    { padding: 18px 20px; }
    .tmlc-art-header  { padding: 16px 20px 12px; }
    .tmlc-breadcrumb  { padding: 8px 16px; }
    .tmlc-art-nav     { padding: 10px 16px; }

    /* TOC entries mai compacte */
    .tmlc-art-entry   { padding: 5px 10px 5px 22px; }
    .tmlc-toc-btn     { padding: 6px 10px; }
    .tmlc-l1 > .tmlc-toc-btn { padding-left: 18px; }
    .tmlc-l2 > .tmlc-toc-btn { padding-left: 26px; }

    /* Rezultate search */
    .tmlc-results-head  { padding: 12px 16px 8px; }
    .tmlc-results-body  { padding: 10px 12px; }
}

/* ── Mobile mic (max 480px): ajustări suplimentare pentru ecrane mici ─── */
@media (max-width: 480px) {
    .tmlc-header-title  { font-size: 14px; }
    .tmlc-header-eyebrow { display: none; }
    .tmlc-header-sub    { display: none; }
    .tmlc-header-top    { padding: 10px 12px; }

    .tmlc-search-zone   { padding: 6px 10px 8px; }

    /* Butoane search: icon-only pe ecrane foarte mici */
    .tmlc-btn-search    { padding: 0 10px; font-size: 12px; }

    .tmlc-art-body      { padding: 12px; }
    .tmlc-art-header    { padding: 12px 14px 10px; }
    .tmlc-art-title-big { font-size: 17px; }

    .tmlc-art-text,
    .tmlc-aln-text      { font-size: 15px; }

    .tmlc-litere li     { font-size: 14px; }

    .tmlc-stats         { gap: 20px; }
    .tmlc-stat-n        { font-size: 24px; }

    .tmlc-art-nav       { padding: 8px 12px; gap: 6px; }
    .tmlc-nav-btn       { padding: 5px 10px; font-size: 11px; }
}

@media (max-width: 700px) {
    /* ── Body layout ── */
    .tmlc-body { flex-direction: column; }
    .tmlc-sidebar {
        width: 100%;
        max-height: 240px;
        border-right: none;
        border-bottom: 1px solid var(--c-border);
    }

    /* ── Header ── */
    .tmlc-header-pills { display: none; }
    .tmlc-header-title { font-size: 16px; }
    .tmlc-header-top { padding: 12px 16px 10px; gap: 10px; }

    /* ── Search zone ── */
    .tmlc-search-zone { padding: 8px 12px 10px; }
    .tmlc-search-row { gap: 6px; }

    /* Row 1: full-width search input */
    .tmlc-search-wrap { flex: 1 1 100%; order: 1; }

    /* Row 2: art number fills available space */
    .tmlc-search-number-wrap {
        flex: 1 1 0;
        min-width: 0;
        order: 2;
        min-height: 40px;
    }

    /* Row 2: search button */
    .tmlc-btn-search {
        order: 3;
        min-height: 40px;
        padding: 0 14px;
        font-size: 13px;
        flex-shrink: 0;
    }

    /* Row 2: icon-only action buttons */
    .tmlc-btn-adv {
        order: 4;
        width: 40px;
        min-height: 40px;
        padding: 0;
        justify-content: center;
        flex-shrink: 0;
    }

    .tmlc-btn-copy {
        order: 5;
        width: 40px;
        min-height: 40px;
        padding: 0;
        justify-content: center;
        flex-shrink: 0;
    }

    /* Ensure the SVG icons are properly centered */
    .tmlc-btn-adv svg,
    .tmlc-btn-copy svg { width: 15px; height: 15px; }

    /* Hide text labels on small screens */
    .tmlc-btn-adv span:last-child,
    .tmlc-btn-copy span[data-copy-label] { display: none; }

    /* Search input touch target */
    .tmlc-search-input { padding: 10px 0; }
    .tmlc-search-number-input { padding: 10px 0; }

    /* ── Article ── */
    .tmlc-art-body { padding: 16px; }

    /* ── Footer ── */
    .tmlc-footer { flex-direction: column; text-align: center; }

    /* ── Modal ── */
    .tmlc-form-grid { grid-template-columns: 1fr; }

    /* ── Maximize button — desktop only ── */
    .tmlc-maximize-btn { display: none !important; }

    /* ── Prevent iOS zoom on input focus ── */
    .tmlc-search-input,
    .tmlc-search-number-input,
    .tmlc-form-input,
    .tmlc-form-select { font-size: 16px; }
}

/* Butonul maximize apare DOAR pe desktop */
@media (min-width: 1025px) {
    .tmlc-maximize-btn {
        display: inline-flex !important;
    }
}

/* ── Modal Sections ───────────────────────────────────────────────────────── */
.tmlc-modal-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--c-border-lt);
}

.tmlc-modal-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.tmlc-modal-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--c-primary);
    margin-bottom: 12px;
    font-family: var(--font-ui);
}

/* ── Segmented Control ────────────────────────────────────────────────────── */
.tmlc-seg {
    display: inline-flex;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 2px;
}

.tmlc-seg-btn {
    background: transparent;
    border: none;
    border-radius: 2px;
    padding: 5px 16px;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 500;
    color: var(--c-text-2);
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.tmlc-seg-btn:hover { color: var(--c-primary); }

.tmlc-seg-btn.is-active {
    background: white;
    color: var(--c-primary);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

/* ── Font Size Variants ───────────────────────────────────────────────────── */
.tmlc-app[data-fontsize="sm"] .tmlc-art-text,
.tmlc-app[data-fontsize="sm"] .tmlc-aln-text,
.tmlc-app[data-fontsize="sm"] .tmlc-litere li {
    font-size: 14px;
    line-height: 1.7;
}

.tmlc-app[data-fontsize="lg"] .tmlc-art-text,
.tmlc-app[data-fontsize="lg"] .tmlc-aln-text,
.tmlc-app[data-fontsize="lg"] .tmlc-litere li {
    font-size: 19px;
    line-height: 1.9;
}

/* ── Highlight Toggle ─────────────────────────────────────────────────────── */
.tmlc-app.tmlc-no-highlight .tmlc-result-snippet mark {
    background: none;
    color: inherit;
    font-weight: 600;
    padding: 0;
}

/* ── Print ────────────────────────────────────────────────────────────────── */
@media print {
    .tmlc-header, .tmlc-search-zone, .tmlc-sidebar, .tmlc-art-nav,
    .tmlc-footer, .tmlc-results, .tmlc-loader, .tmlc-welcome { display: none !important; }
    .tmlc-app { border: none; box-shadow: none; }
    .tmlc-body { display: block; }
    .tmlc-main { overflow: visible; }
    .tmlc-art-body { padding: 0; }
    .tmlc-art-header { border-bottom: 2px solid #800020; }
}

/* ── SEO Layer — vizibil crawlere, invizibil useri ──────────────────────── */
/*
   display:none este indexat de Google (confirmat oficial).
   JS șterge complet nodul după init — zero impact la runtime pentru useri.
   Nu se folosesc position:absolute/clip — Google le poate penaliza ca cloaking.
*/
.tmlc-seo-layer {
    display: none;
}

/* Dacă JS nu rulează deloc (Googlebot fără JS, accessibilitate),
   afișăm conținutul ca fallback de bază — nu e frumos vizual,
   dar e funcțional și complet accesibil. */
.tmlc-no-js .tmlc-seo-layer {
    display: block;
    font-family: var(--font-body, Georgia, serif);
    font-size: 15px;
    line-height: 1.8;
    color: #1c1c1c;
    padding: 16px;
}

/* ── Buton Maximize / Restore ─────────────────────────────────────────────── */
.tmlc-maximize-btn {
    display: none !important; /* ascuns implicit — apare doar pe desktop via media query */
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    background: rgba(255,255,255,.13);
    border: 1.5px solid rgba(255,255,255,.3);
    border-radius: 5px;
    color: rgba(255,255,255,.85);
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, border-color .15s, color .15s, transform .1s;
    margin-left: 8px;
}

.tmlc-maximize-btn svg {
    width: 16px;
    height: 16px;
    display: block;
}

.tmlc-maximize-btn:hover {
    background: rgba(255,255,255,.25);
    border-color: rgba(255,255,255,.6);
    color: #fff;
}

.tmlc-maximize-btn:active {
    transform: scale(.92);
}

.tmlc-maximize-btn.is-maximized {
    background: rgba(255,255,255,.2);
    border-color: rgba(255,255,255,.5);
}

/* ── Maximize / Restore ─────────────────────────────────────────────────────── */

body.tmlc-body-maximized {
    overflow: hidden !important;
    position: fixed !important;   /* iOS: oprește bounce scroll pe body */
    width: 100% !important;
}

.tmlc-maximized {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    height: 100vh !important;     /* fallback */
    height: 100dvh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    z-index: 9990 !important;
    overflow: hidden !important;
}

/*
 * TEHNICA iOS: pentru ca scroll-ul să funcționeze în interiorul unui
 * container position:fixed, fiecare nivel intermediar flex trebuie să aibă
 * height:0 + flex:1 (NU flex:1 1 0% singur — iOS îl ignoră fără height).
 */

.tmlc-maximized .tmlc-layout {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;      /* explicit 100% pe primul copil */
    overflow: hidden !important;
}

.tmlc-maximized .tmlc-header {
    flex: 0 0 auto !important;
}

.tmlc-maximized .tmlc-body {
    flex: 1 !important;
    height: 0 !important;         /* iOS trick: height:0 + flex:1 = preia spațiul */
    min-height: 0 !important;
    display: flex !important;
    overflow: hidden !important;
}

/* ── Sidebar ── */
.tmlc-maximized .tmlc-sidebar {
    flex-shrink: 0 !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.tmlc-maximized .tmlc-sidebar-head {
    flex: 0 0 auto !important;
}

.tmlc-maximized .tmlc-toc {
    flex: 1 !important;
    height: 0 !important;         /* iOS trick */
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    touch-action: pan-y !important;
}

/* ── Main ── */
.tmlc-maximized .tmlc-main {
    flex: 1 !important;
    height: 0 !important;         /* iOS trick */
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

/* Article view */
.tmlc-maximized .tmlc-article {
    flex: 1 !important;
    height: 0 !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.tmlc-maximized .tmlc-breadcrumb  { flex: 0 0 auto !important; }
.tmlc-maximized .tmlc-art-header  { flex: 0 0 auto !important; }
.tmlc-maximized .tmlc-art-nav     { flex: 0 0 auto !important; }

.tmlc-maximized .tmlc-art-body {
    flex: 1 !important;
    height: 0 !important;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    touch-action: pan-y !important;
}

/* Search results */
.tmlc-maximized .tmlc-results {
    flex: 1 !important;
    height: 0 !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.tmlc-maximized .tmlc-results-head { flex: 0 0 auto !important; }

.tmlc-maximized .tmlc-results-body {
    flex: 1 !important;
    height: 0 !important;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    touch-action: pan-y !important;
}

/* Welcome & loader */
.tmlc-maximized .tmlc-welcome,
.tmlc-maximized .tmlc-loader {
    flex: 1 !important;
    height: 0 !important;
    overflow-y: auto !important;
}

.tmlc-maximized .tmlc-footer {
    flex: 0 0 auto !important;
}

/* ── Maximized pe tablet (701px – 900px): sidebar mai îngustă în fullscreen ── */
@media (min-width: 701px) and (max-width: 900px) {
    .tmlc-maximized .tmlc-sidebar {
        width: 220px !important;
        flex: 0 0 220px !important;
    }
}

/* ── Maximized pe mobil (column layout) ─────────────────────────────────── */
@media (max-width: 700px) {
    .tmlc-maximized .tmlc-body {
        flex-direction: column !important;
    }

    /* Sidebar compact — înălțime fixă, nu crește */
    .tmlc-maximized .tmlc-sidebar {
        flex: 0 0 180px !important;
        height: 180px !important;
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid var(--c-border) !important;
    }

    /* Main preia restul ecranului */
    .tmlc-maximized .tmlc-main {
        flex: 1 !important;
        height: 0 !important;
    }
}

/* ── Snap to Viewport ─────────────────────────────────────────────────────── */
/* Stilurile sunt aplicate inline din JS — nu mai e nevoie de clase complexe */
/* Păstrăm doar pentru print override */

