/* =============================================================
   Circulars Redesign — CSS
   File: /assets/front/my/css/circulars-redesign.css
   
   Step 1: Skeleton + Layout
   ============================================================= */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    --cr-blue:        #0077a8;
    --cr-blue-dark:   #005f88;
    --cr-blue-light:  #e8f4f9;
    --cr-blue-bar:    #1a8ab5;
    --cr-yellow:      #f5a623;
    --cr-yellow-bg:   #fff8eb;
    --cr-teal:        #1a9a8a;
    --cr-teal-bg:     #e6f7f5;
    --cr-warm-gray:   #f5f3f0;
    --cr-warm-border: #e5e0d8;
    --cr-text:        #1a1a1a;
    --cr-text-muted:  #4a5a64;
    --cr-border:      #dce3e8;
    --cr-radius:      6px;
    --cr-bar-h:       50px;
    --cr-header-h:    90px;   /* site fixed header height */
    --cr-sidebar-w:   230px;
    --cr-page-w:      1260px;
    --cr-panel-w:     35%;
    --cr-panel-w-lg:  85%;
}

.cr-circular-text .circ_body p {
    margin: 0 0 14px;
}

/* ── Errors ────────────────────────────────────────────────── */
.cr-errors {
    max-width: var(--cr-page-w);
    margin: 0 auto;
    padding: 12px 24px;
    background: #f8d7da;
    border: 1px solid #f1aeb5;
    color: #842029;
    font-size: 14px;
    line-height: 1.5;
}

/* ── Page frame ────────────────────────────────────────────── */
.cr-page-frame {
    max-width: var(--cr-page-w);
    margin: 0 auto;
    border-left: 1px solid #e8eaed;
    border-right: 1px solid #e8eaed;
    overflow: visible; /* required for sticky children */
}

/* ── Override parent overflow for sticky to work ───────────── */
/* sticky requires overflow:visible on all ancestors up to the scroll root */
.cr-page-frame,
.cr-body-wrap {
    overflow: visible;
}

/* ── Reading progress ──────────────────────────────────────── */
.cr-reading-progress {
    height: 3px;
    background: rgba(0,0,0,.08);
    position: sticky;
    top: var(--cr-header-h);  /* sticks below fixed site header */
    z-index: 501;             /* above content bar (500) */
}
.cr-reading-progress-fill {
    height: 100%;
    background: var(--cr-yellow);
    width: 0%;
    transition: width .15s ease;
    border-radius: 0 2px 2px 0;
}

/* ── Breadcrumb ────────────────────────────────────────────── */
.cr-breadcrumb {
    background: #fff;
    border-bottom: 1px solid var(--cr-border);
    padding: 8px 24px;
    font-size: 13px;
    color: var(--cr-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.cr-breadcrumb a {
    color: var(--cr-text-muted);
    text-decoration: none;
}
.cr-breadcrumb a:hover {
    color: var(--cr-blue);
    text-decoration: underline;
}
.cr-breadcrumb-sep {
    opacity: .4;
    margin: 0 2px;
}
.cr-breadcrumb-current {
    color: var(--cr-text);
    font-weight: 600;
}

/* ── Main title area ───────────────────────────────────────── */
.cr-title-area {
    background: #fff;
    border-bottom: 1px solid var(--cr-border);
    padding: 22px 28px 18px;
}
.cr-title {
    font-size: 22px;
    color: var(--cr-blue-dark);
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 6px;
    font-family: 'Open Sans', sans-serif;
}
.cr-subtitle {
    font-size: 15px;
    color: var(--cr-text-muted);
    line-height: 1.5;
    margin: 0;
    font-family: 'Open Sans', sans-serif;
}

/* ── Content bar (sticky) ──────────────────────────────────── */
.cr-content-bar {
    position: sticky;
    top: calc(var(--cr-header-h) + 3px);  /* below fixed header + progress bar */
    z-index: 500;
    background: var(--cr-blue-bar);
    height: var(--cr-bar-h);
    display: flex;
    align-items: stretch;
    padding: 0 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

/* ── Bar tools ──────────────────────────────────────────────── */
.cr-bar-tool {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 0 14px;
    cursor: pointer;
    border: none;
    background: transparent;
    border-right: 1px solid rgba(255,255,255,.15);
    transition: background .15s;
    white-space: nowrap;
    font-family: 'Open Sans', sans-serif;
    text-decoration: none;
}
.cr-bar-tool:hover {
    background: rgba(0,0,0,.18);
    color: #fff;
    text-decoration: none;
}
.cr-bar-tool .fa {
    font-size: 14px;
    opacity: .85;
}
.cr-bar-tool-last {
    border-right: none;
}
.cr-bar-caret {
    font-size: 11px;
    opacity: .7;
}
.cr-bar-count {
    background: var(--cr-yellow);
    color: #000;
    font-weight: 700;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
}
.cr-bar-spacer {
    flex: 1;
}

/* Bar dropdown */
.cr-bar-dropdown-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}
.cr-bar-dropdown {
    display: none;
    position: absolute;
    top: var(--cr-bar-h);
    left: 0;
    min-width: 240px;
    background: #fff;
    border: 1px solid var(--cr-border);
    border-top: 3px solid var(--cr-blue);
    box-shadow: 0 12px 40px rgba(0,0,0,.18);
    border-radius: 0 0 var(--cr-radius) var(--cr-radius);
    padding: 4px 0;
    animation: crSlideDown .15s ease;
    z-index: 600;
}
.cr-bar-dropdown-right {
    left: auto;
    right: 0;
}
.cr-bar-dropdown-wrap:hover .cr-bar-dropdown {
    display: block;
}
@keyframes crSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.cr-bar-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    font-size: 13.5px;
    color: var(--cr-text);
    transition: background .1s;
    text-decoration: none;
}
.cr-bar-dropdown a:hover {
    background: var(--cr-blue-light);
    color: var(--cr-blue-dark);
    text-decoration: none;
}
.cr-bar-dropdown a .fa {
    width: 18px;
    text-align: center;
    color: var(--cr-blue);
    font-size: 14px;
}

/* ── Body wrap (sidebar + main) ────────────────────────────── */
.cr-body-wrap {
    display: flex;
    align-items: flex-start;
    position: relative;
}

/* ══════════════════════════════════════════════
   LEFT SIDEBAR
   ══════════════════════════════════════════════ */
.cr-left-sidebar {
    width: var(--cr-sidebar-w);
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--cr-header-h) + 3px + var(--cr-bar-h));  /* below header + progress + bar */
    height: calc(100vh - var(--cr-header-h) - 3px - var(--cr-bar-h));
    overflow-y: auto;
    background: #fff;
    border-right: 1px solid var(--cr-border);
    display: flex;
    flex-direction: column;
}
.cr-left-sidebar::-webkit-scrollbar { width: 4px; }
.cr-left-sidebar::-webkit-scrollbar-track { background: transparent; }
.cr-left-sidebar::-webkit-scrollbar-thumb { background: #c8d4da; border-radius: 4px; }

/* Sidebar nav area */
.cr-sidebar-nav {
    flex-shrink: 0;
    padding: 6px 0;
    border-bottom: 1px solid var(--cr-border);
    background: #f8fafb;
}

/* Sidebar metadata area */
.cr-sidebar-meta {
    flex: 1;
    overflow-y: auto;
}

/* Sidebar placeholder (temporary) */
.cr-sidebar-placeholder {
    display: block;
    padding: 14px;
    color: #aab5bd;
    font-size: 12px;
    font-style: italic;
}

/* ── Sidebar nav buttons ───────────────────────────────────── */
.cr-nav-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--cr-text);
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Open Sans', sans-serif;
    transition: all .12s;
    text-align: left;
    border-left: 3px solid transparent;
}
.cr-nav-btn:hover {
    background: var(--cr-blue-light);
    color: var(--cr-blue-dark);
    text-decoration: none;
}
a.cr-nav-btn {
    text-decoration: none;
}
.cr-nav-btn.active {
    background: var(--cr-blue-light);
    color: var(--cr-blue-dark);
    border-left-color: var(--cr-blue);
}
.cr-nav-btn .fa {
    width: 18px;
    text-align: center;
    color: var(--cr-blue);
    font-size: 14px;
    flex-shrink: 0;
}
.cr-nav-count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    background: #e2e9ed;
    color: var(--cr-text-muted);
    padding: 1px 7px;
    border-radius: 10px;
    flex-shrink: 0;
}
.cr-nav-btn:hover .cr-nav-count {
    background: #cdd8de;
}
/* ── Πρωτότυπο έγγραφο (sidebar) ───────────────────────────── */
.cr-original-doc {
    flex-shrink: 0;
    padding: 10px 12px;
    border-bottom: 1px solid var(--cr-border);
    background: #f8fafb;
}
.cr-original-doc-btn {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--cr-blue);
    border-radius: 8px;
    background: #fff;
    color: var(--cr-blue-dark);
    text-decoration: none;
    transition: all .14s;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.cr-original-doc-btn:hover {
    background: var(--cr-blue);
    border-color: var(--cr-blue);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0,119,168,.25);
}
.cr-original-doc-icon {
    font-size: 22px;
    color: #c0392b;
    flex-shrink: 0;
    transition: color .14s;
}
.cr-original-doc-btn:hover .cr-original-doc-icon {
    color: #fff;
}
.cr-original-doc-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
    flex: 1;
}
.cr-original-doc-title {
    font-size: 13.5px;
    font-weight: 700;
}
.cr-original-doc-sub {
    font-size: 11px;
    font-weight: 500;
    color: var(--cr-text-muted);
    transition: color .14s;
}
.cr-original-doc-btn:hover .cr-original-doc-sub {
    color: rgba(255,255,255,.85);
}
.cr-original-doc-dl {
    font-size: 14px;
    flex-shrink: 0;
    opacity: .55;
    transition: opacity .14s;
}
.cr-original-doc-btn:hover .cr-original-doc-dl {
    opacity: 1;
}

.cr-nav-btn.active .cr-nav-count {
    background: var(--cr-blue);
    color: #fff;
}

/* ── Sidebar metadata ──────────────────────────────────────── */
.cr-rs-section {
    padding: 14px;
    border-bottom: 1px solid var(--cr-border);
}
.cr-rs-section:last-child {
    border-bottom: none;
}
.cr-rs-title {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--cr-text-muted);
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Open Sans', sans-serif;
}
.cr-rs-title .fa {
    font-size: 11px;
    color: var(--cr-blue);
}

/* Meta rows */
.cr-meta-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 4px 0;
    font-size: 12.5px;
    line-height: 1.4;
    font-family: 'Open Sans', sans-serif;
}
.cr-meta-row-border {
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid #f0f2f4;
}
.cr-smeta-label {
    color: var(--cr-text-muted);
    font-weight: 500;
    min-width: 75px;
    flex-shrink: 0;
    font-size: 11.5px;
}
.cr-smeta-value {
    color: var(--cr-text);
    font-weight: 600;
    font-size: 12.5px;
}
.cr-smeta-value a {
    font-weight: 600;
}
.cr-smeta-desc {
    font-weight: 400;
    font-size: 12px;
    line-height: 1.5;
    color: var(--cr-text-muted);
}

/* Status badges */
.cr-meta-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 5px 0 2px;
}
.cr-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2px;
    font-family: 'Open Sans', sans-serif;
}
.cr-meta-badge .fa {
    font-size: 10px;
}
.cr-badge-active {
    background: var(--cr-teal-bg);
    border: 1px solid #b0ddd7;
    color: #14756a;
}
.cr-badge-codified {
    background: var(--cr-teal-bg);
    border: 1px solid #b0ddd7;
    color: #14756a;
}
.cr-badge-inactive {
    background: #fce8e8;
    border: 1px solid #f0b8b8;
    color: #c0392b;
}

/* Sidebar tags */
.cr-rs-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.cr-rs-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #f0f4f7;
    border: 1px solid var(--cr-border);
    border-radius: 3px;
    font-size: 11px;
    color: var(--cr-text-muted);
    font-family: 'Open Sans', sans-serif;
    transition: all .15s;
    text-decoration: none;
}
.cr-rs-tag:hover {
    background: var(--cr-blue-light);
    border-color: var(--cr-blue);
    color: var(--cr-blue-dark);
    text-decoration: none;
}

/* ══════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════ */
.cr-main-content {
    flex: 1;
    min-width: 0;
    background: #fff;
}

/* Banner area */
.cr-banner-area {
    padding: 12px 24px;
    background: #fafbfc;
    border-bottom: 1px solid var(--cr-border);
    text-align: center;
}
.cr-banner-area:empty {
    display: none;
}
.cr-banner-area img {
    max-width: 100%;
    height: auto;
}

/* Codified notice */
.cr-codified-notice {
    background: var(--cr-teal-bg);
    border: 1px solid #a0d5cd;
    border-radius: var(--cr-radius);
    padding: 16px 20px;
    margin: 20px 28px 0;
    font-family: 'Open Sans', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #0d5e54;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.cr-codified-notice > .fa {
    font-size: 22px;
    color: var(--cr-teal);
    flex-shrink: 0;
    margin-top: 1px;
}
.cr-codified-notice strong {
    font-weight: 700;
    color: #0a4f46;
}
.cr-codified-notice a {
    color: var(--cr-teal);
    font-weight: 600;
}
.cr-codified-notice a:hover {
    text-decoration: underline;
}

/* Annotation / Comments block */
.cr-annotation-block {
    background: #fcf8e3;
    border: 1px solid #ddd;
    border-left: 3px solid var(--cr-yellow);
    border-radius: 0 var(--cr-radius) var(--cr-radius) 0;
    padding: 14px 18px;
    margin: 20px 28px 0;
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 28px;
    color: #8a6d3b;
}
.cr-annotation-block a {
    color: #66512c;
    font-weight: 600;
    text-decoration: underline;
}
.cr-annotation-block a:hover {
    color: var(--cr-blue);
}
.cr-ann-header {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
    color: #8a6d3b;
}
.cr-ann-header .fa {
    margin-right: 4px;
}

/* Metadata */
.cr-metadata {
    padding: 16px 28px;
    border-bottom: 1px solid var(--cr-border);
    font-family: 'Open Sans', sans-serif;
}
.cr-meta-item {
    padding: 4px 0;
    font-size: 14px;
    line-height: 1.6;
}
.cr-meta-label {
    font-weight: 700;
    color: var(--cr-text);
    margin-right: 6px;
}
.cr-meta-label::after {
    content: ':';
}
.cr-meta-value {
    color: #606060;
}

/* Circular text area */
.cr-circular-text {
    padding: 24px 28px 40px;
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 28px;
    color: #606060;
}

.cr-text-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--cr-text);
    line-height: 1.4;
    margin: 0 0 20px;
    font-family: 'Open Sans', sans-serif;
}
.cr-text-subtitle {
    font-weight: 400;
    font-size: 16px;
}

/* Reg only notice */
.cr-reg-only-notice {
    background: #fcf8e3;
    border: 1px solid #faebcc;
    color: #8a6d3b;
    padding: 12px 16px;
    border-radius: var(--cr-radius);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}

/* circ_body - inherits from existing site CSS */
.cr-circular-text .circ_body {
    text-align: justify;
}

/* circ-preview - fade out */
.cr-circular-text .circ-preview {
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    margin-bottom: 20px;
}

/* ── Step 13b: Hyperlink styling — color-coded by type ────── */
.cr-circular-text a {
    color: var(--cr-blue);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(0,119,168,.35);
    font-weight: 600;
    transition: color .15s, text-decoration-color .15s, background .15s;
}
.cr-circular-text a:hover {
    text-decoration-color: var(--cr-blue);
    background: var(--cr-blue-light);
    border-radius: 2px;
}

/* Laws (νόμοι) — green → new tab */
.cr-circular-text a[rel*="laws"] {
    color: #2E7D32;
    text-decoration-color: rgba(46,125,50,.35);
}
.cr-circular-text a[rel*="laws"]:hover {
    text-decoration-color: #2E7D32;
    background: #E8F5E9;
}

/* Articles / Paragraphs (facebox + auto-links) — purple → slide panel */
.cr-circular-text a[rel*="facebox"],
.cr-circular-text a[data-auto-links] {
    color: #6A1B9A;
    text-decoration-color: rgba(106,27,154,.3);
    cursor: pointer;
}
.cr-circular-text a[rel*="facebox"]:hover,
.cr-circular-text a[data-auto-links]:hover {
    text-decoration-color: #6A1B9A;
    background: #F3E5F5;
}

/* Circulars / Decisions (αποφάσεις) — orange → new tab */
.cr-circular-text a[rel*="circulars"] {
    color: #E65100;
    text-decoration-color: rgba(230,81,0,.3);
}
.cr-circular-text a[rel*="circulars"]:hover {
    text-decoration-color: #E65100;
    background: #FFF3E0;
}

/* ── Step 13b: Law content panel styling ──────────────────── */
.cr-sp-law-content-wrap {
    padding: 4px 0;
}
.cr-sp-law-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.cr-sp-law-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--cr-blue-light);
    color: var(--cr-blue);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.cr-sp-law-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--cr-text);
    line-height: 1.4;
    margin: 0 0 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--cr-border);
}
.cr-sp-law-body {
    font-size: 15px;
    line-height: 26px;
    color: #505050;
}
.cr-sp-law-body p {
    margin-bottom: 10px;
}
/* Hyperlinks inside the sidebar law preview — visible without hovering.
   Nested article/paragraph links (data-auto-links) reload the same panel;
   whole-law links open in a new tab. */
.cr-sp-law-body a {
    color: var(--cr-blue);
    text-decoration: none;
    border-bottom: 1px dotted var(--cr-blue);
    transition: color .15s ease, border-bottom-color .15s ease, background-color .15s ease;
}
.cr-sp-law-body a:hover {
    color: #003d52;
    border-bottom: 1px solid #003d52;
    background-color: rgba(0, 90, 119, 0.06);
}
.cr-sp-law-body a[data-auto-links],
.cr-sp-law-body a[rel*="facebox"] {
    font-weight: 600;
}
.cr-sp-law-footer {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--cr-border);
}
.cr-sp-law-full-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--cr-blue);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.cr-sp-law-full-link:hover {
    text-decoration: underline;
}

/* Attachments */
.cr-attachments {
    padding: 16px 28px;
    border-top: 1px solid var(--cr-border);
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    background: #fafbfc;
}
.cr-attachments .fa {
    margin-right: 4px;
    color: var(--cr-blue);
}
.cr-attachments ul {
    list-style: none;
    padding: 6px 0 0;
    margin: 0;
}
.cr-attachments ul li {
    padding: 3px 0;
}
.cr-attachments ul li a {
    color: var(--cr-blue);
}
.cr-attachments ul li a:hover {
    text-decoration: underline;
}

/* Tags */
.cr-tags {
    padding: 16px 28px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.cr-tag {
    display: inline-block;
    padding: 4px 12px;
    background: #f0f4f7;
    border: 1px solid var(--cr-border);
    border-radius: 3px;
    font-size: 12px;
    color: var(--cr-text-muted);
    font-family: 'Open Sans', sans-serif;
    transition: all .15s;
    text-decoration: none;
}
.cr-tag:hover {
    background: var(--cr-blue-light);
    border-color: var(--cr-blue);
    color: var(--cr-blue-dark);
    text-decoration: none;
}

/* Content placeholder (temporary — will be removed) */
.cr-content-placeholder {
    padding: 60px 28px;
    text-align: center;
    color: #aab5bd;
    font-size: 15px;
    font-style: italic;
}

/* ── Back to top ───────────────────────────────────────────── */
.cr-back-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--cr-blue-dark);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .25s, transform .25s, background .15s;
    z-index: 400;
}
.cr-back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}
.cr-back-to-top:hover {
    background: var(--cr-blue);
}

/* ── Notes section ──────────────────────────────────────────── */
.cr-notes-section {
    padding: 20px 28px 28px;
    border-top: 1px solid var(--cr-border);
    background: #fafbfc;
}
.cr-notes-header {
    font-size: 15px;
    font-weight: 700;
    color: var(--cr-blue-dark);
    margin-bottom: 12px;
    font-family: 'Open Sans', sans-serif;
}
.cr-notes-header .fa {
    margin-right: 6px;
    color: var(--cr-blue);
}
.cr-notes-textarea {
    width: 100%;
    border: 1px solid var(--cr-border);
    border-radius: var(--cr-radius);
    padding: 12px 14px;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--cr-text);
    resize: vertical;
    transition: border-color .2s;
    background: #fff;
}
.cr-notes-textarea:focus {
    outline: none;
    border-color: var(--cr-blue);
    box-shadow: 0 0 0 3px rgba(0,119,168,.1);
}
.cr-notes-save {
    margin-top: 10px;
    padding: 8px 20px;
    background: var(--cr-blue);
    color: #fff;
    border: none;
    border-radius: var(--cr-radius);
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.cr-notes-save:hover {
    background: var(--cr-blue-dark);
}
.cr-notes-save .fa {
    margin-right: 4px;
}

/* ══════════════════════════════════════════════
   SLIDE PANEL
   ══════════════════════════════════════════════ */
.cr-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.22);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}
.cr-panel-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.cr-slide-panel {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: var(--cr-panel-w);
    max-width: 95vw;
    background: #fff;
    z-index: 10001;
    box-shadow: -6px 0 32px rgba(0,0,0,.18);
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1), width .3s ease;
    display: flex;
    flex-direction: column;
}
.cr-slide-panel.open {
    transform: translateX(0);
}
.cr-slide-panel.cr-panel-large {
    width: var(--cr-panel-w-lg);
}

/* Panel header */
.cr-sp-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--cr-blue-dark);
    color: #fff;
    flex-shrink: 0;
}
.cr-sp-header-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: rgba(255,255,255,.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.cr-sp-header-text {
    flex: 1;
    min-width: 0;
}
.cr-sp-header-title {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cr-sp-header-subtitle {
    font-size: 12px;
    opacity: .7;
    margin-top: 1px;
}
.cr-sp-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.cr-sp-size-btn, .cr-sp-close-btn {
    width: 32px; height: 32px;
    border-radius: 6px;
    background: rgba(255,255,255,.12);
    border: none;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.cr-sp-size-btn:hover, .cr-sp-close-btn:hover {
    background: rgba(255,255,255,.25);
}

/* Panel body */
.cr-sp-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--cr-text);
}
.cr-sp-body::-webkit-scrollbar { width: 5px; }
.cr-sp-body::-webkit-scrollbar-track { background: transparent; }
.cr-sp-body::-webkit-scrollbar-thumb { background: #c8d4da; border-radius: 4px; }

/* Style overrides for pre-rendered tab content inside panel */
.cr-sp-body h3, .cr-sp-body h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--cr-blue-dark);
    margin: 16px 0 8px;
}
.cr-sp-body h3:first-child, .cr-sp-body h4:first-child {
    margin-top: 0;
}
.cr-sp-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 16px;
}
.cr-sp-body table th {
    background: #f5f7f9;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--cr-text-muted);
    padding: 8px 10px;
    border-bottom: 2px solid var(--cr-border);
    text-align: left;
}
.cr-sp-body table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f2f4;
    vertical-align: top;
}
.cr-sp-body table tr:hover td {
    background: #f7f9fb;
}
.cr-sp-body blockquote {
    margin: 0 0 10px;
    padding: 8px 12px;
    border-left: 3px solid var(--cr-blue-light);
    background: #fafbfc;
    border-radius: 0 var(--cr-radius) var(--cr-radius) 0;
}
.cr-sp-body ul {
    padding-left: 18px;
}
.cr-sp-body ul li {
    margin-bottom: 8px;
}

/* Panel: no permission message */
.cr-sp-no-permission {
    text-align: center;
    padding: 40px 20px;
    color: var(--cr-text-muted);
    font-size: 14px;
}
/* Members-only panel content */
.cr-sp-membersonly {
    padding: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--cr-text);
}
.cr-sp-membersonly a {
    color: var(--cr-blue);
}
.cr-sp-membersonly img {
    max-width: 100%;
    height: auto;
}
/* Step 13: AJAX panel loading spinner */
.cr-sp-ajax-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--cr-text-muted);
}
.cr-sp-ajax-loading .fa {
    font-size: 28px;
    color: var(--cr-blue);
    display: block;
    margin-bottom: 12px;
}
.cr-sp-ajax-loading p {
    font-size: 14px;
    margin: 0;
}

/* ── Step 7: Library indicator ────────────────────────────── */
.cr-lib-check {
    color: #7ddf7d;
    margin-left: 3px;
    font-size: 12px;
}

/* Library button — already in library (green accent like admin) */
.cr-bar-inlib {
    background: rgba(22,163,74,.15);
}
.cr-bar-inlib:hover {
    background: rgba(22,163,74,.35);
}
.cr-bar-inlib .fa-download {
    color: #86efac;
}

/* ── Step 7: Panel — wide variant ────────────────────────── */
.cr-slide-panel.cr-panel-wide {
    width: 420px;
}
.cr-slide-panel.cr-panel-wide.cr-panel-large {
    width: var(--cr-panel-w-lg);
}
/* (moved to consolidated responsive section at bottom) */

/* ── Step 7: Panel footer ────────────────────────────────── */
.cr-sp-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--cr-border);
    background: #fafbfc;
    flex-shrink: 0;
    display: none;
}
.cr-sp-footer.visible { display: block; }
.cr-sp-footer-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.cr-sp-footer-btn {
    padding: 8px 18px;
    border-radius: 5px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all .15s;
    border: none;
}
.cr-sp-footer-btn.primary {
    background: var(--cr-blue);
    color: #fff;
}
.cr-sp-footer-btn.primary:hover { background: var(--cr-blue-dark); }
.cr-sp-footer-btn.primary.cr-sp-lib-save-dirty {
    background: #16a34a;
    animation: crLibSavePulse 1.5s ease-in-out 1;
}
.cr-sp-footer-btn.primary.cr-sp-lib-save-dirty:hover { background: #15803d; }
@keyframes crLibSavePulse {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 0 4px rgba(22,163,74,.25); }
}
.cr-sp-footer-btn.secondary {
    background: #fff;
    color: var(--cr-text-muted);
    border: 1px solid var(--cr-border);
}
.cr-sp-footer-btn.secondary:hover {
    border-color: var(--cr-blue);
    color: var(--cr-blue);
}
a.cr-sp-footer-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.cr-sp-footer-spacer { flex: 1; }

/* ── Step 7: Library tree ────────────────────────────────── */
.cr-slide-panel.cr-panel-wide .cr-sp-body { padding: 0; }

/* Sort toolbar */
.cr-sp-lib-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px;
    background: var(--cr-blue-light);
    border-bottom: 1px solid var(--cr-border);
    position: sticky;
    top: 0;
    z-index: 2;
}
.cr-sp-lib-toolbar-row {
    display: flex;
    gap: 0;
}
.cr-sp-lib-search-wrap {
    position: relative;
}
.cr-sp-lib-search-icon {
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--cr-text-muted);
    pointer-events: none;
}
.cr-sp-lib-search {
    width: 100%;
    padding: 6px 10px 6px 28px;
    font-size: 13px;
    border: 1px solid var(--cr-border);
    border-radius: 4px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    background: #fff;
}
.cr-sp-lib-search:focus {
    border-color: var(--cr-blue);
    box-shadow: 0 0 0 2px rgba(0,119,168,.12);
}
.cr-sp-lib-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--cr-border);
    background: #fff;
    color: var(--cr-text-muted);
    cursor: pointer;
    transition: all .15s;
    line-height: 1.4;
}
.cr-sp-lib-sort-btn:first-child {
    border-radius: 4px 0 0 4px;
    border-right: none;
}
.cr-sp-lib-sort-btn:last-child {
    border-radius: 0 4px 4px 0;
}
.cr-sp-lib-sort-btn.active {
    background: var(--cr-blue);
    border-color: var(--cr-blue);
    color: #fff;
}
.cr-sp-lib-sort-btn:not(.active):hover {
    background: #eef3f6;
    color: var(--cr-text);
}
.cr-sp-lib-sort-btn i { font-size: 12px; }

.cr-sp-lib-toolbar-spacer { flex: 1; }
.cr-sp-lib-selectall-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--cr-border);
    border-radius: 4px;
    background: #fff;
    color: var(--cr-text-muted);
    cursor: pointer;
    transition: all .15s;
    line-height: 1.4;
}
.cr-sp-lib-selectall-btn:hover {
    background: #eef3f6;
    color: var(--cr-text);
    border-color: var(--cr-blue);
}
.cr-sp-lib-selectall-btn i { font-size: 12px; }

.cr-sp-lib-tree {
    padding: 8px 12px 16px;
}
.cr-sp-lib-node { position: relative; }
.cr-sp-lib-node-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background .1s;
    user-select: none;
}
.cr-sp-lib-node-row:hover { background: var(--cr-blue-light); }
.cr-sp-lib-node-row:focus-visible {
    outline: 2px solid var(--cr-blue);
    outline-offset: -2px;
    background: var(--cr-blue-light);
}

/* Indent levels */
.cr-sp-lib-node[data-level="1"] > .cr-sp-lib-node-row { padding-left: 24px; }
.cr-sp-lib-node[data-level="2"] > .cr-sp-lib-node-row { padding-left: 42px; }
.cr-sp-lib-node[data-level="3"] > .cr-sp-lib-node-row { padding-left: 60px; }
.cr-sp-lib-node[data-level="4"] > .cr-sp-lib-node-row { padding-left: 78px; }

/* Expand/collapse arrow */
.cr-sp-lib-expand {
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; color: var(--cr-text-muted);
    flex-shrink: 0;
    transition: transform .2s;
    border-radius: 3px;
}
.cr-sp-lib-expand:hover { background: rgba(0,0,0,.06); }
.cr-sp-lib-expand.collapsed { transform: rotate(-90deg); }
.cr-sp-lib-expand.leaf { visibility: hidden; }

/* Checkbox */
.cr-sp-lib-check {
    width: 16px; height: 16px;
    border: 2px solid #b0bec5;
    border-radius: 3px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
    cursor: pointer;
}
.cr-sp-lib-check.checked {
    background: var(--cr-blue);
    border-color: var(--cr-blue);
}
.cr-sp-lib-check.checked::after {
    content: '\2713';
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

/* Folder icon */
.cr-sp-lib-folder-icon {
    font-size: 13px;
    color: var(--cr-yellow);
    flex-shrink: 0;
    width: 16px; text-align: center;
}

/* Node label */
.cr-sp-lib-node-label {
    font-size: 13.5px;
    color: var(--cr-text);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cr-sp-lib-node-row:hover .cr-sp-lib-node-label { color: var(--cr-blue-dark); }

/* Children container */
.cr-sp-lib-children {
    overflow: hidden;
    transition: max-height .25s ease;
    max-height: 2000px;
}
.cr-sp-lib-children.collapsed { max-height: 0; }

/* Empty state */
.cr-sp-lib-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--cr-text-muted);
}
.cr-sp-lib-empty .fa {
    font-size: 36px;
    color: var(--cr-border);
    margin-bottom: 12px;
    display: block;
}
.cr-sp-lib-empty p { margin: 6px 0; font-size: 14px; }
.cr-sp-lib-empty-hint { font-size: 13px !important; color: #78909c !important; }

/* Flash messages */
.cr-sp-lib-flash {
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: 'Open Sans', sans-serif;
    border-radius: 0;
    text-align: center;
    opacity: 1;
    transition: opacity .4s ease;
}
.cr-sp-lib-flash.fade-out {
    opacity: 0;
}
.cr-sp-lib-flash.success {
    background: #e8f5e9;
    color: #2e7d32;
    border-bottom: 1px solid #a5d6a7;
}
.cr-sp-lib-flash.error {
    background: #fce8e8;
    color: #c0392b;
    border-bottom: 1px solid #f0b8b8;
}

/* ── Step 7: Library — new category form ─────────────────── */
.cr-sp-lib-new-cat {
    display: none;
    padding: 10px 18px;
    border-top: 1px solid var(--cr-border);
    background: var(--cr-blue-light);
    flex-shrink: 0;
}
.cr-sp-lib-new-cat.visible { display: block; }
.cr-sp-lib-new-cat-label {
    font-size: 12px; font-weight: 600; color: var(--cr-blue-dark);
    margin-bottom: 6px;
}
.cr-sp-lib-new-cat-row {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.cr-sp-lib-new-cat-input {
    flex: 1 1 100%;
    padding: 7px 10px;
    font-size: 13px;
    border: 1px solid var(--cr-border);
    border-radius: 4px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}
.cr-sp-lib-new-cat-parent {
    flex: 1 1 auto;
    padding: 7px 10px;
    font-size: 13px;
    border: 1px solid var(--cr-border);
    border-radius: 4px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}
.cr-sp-lib-new-cat-input:focus,
.cr-sp-lib-new-cat-parent:focus {
    border-color: var(--cr-blue);
    box-shadow: 0 0 0 2px rgba(0,119,168,.12);
}
.cr-sp-lib-new-cat-add {
    padding: 7px 14px;
    background: var(--cr-blue);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}
.cr-sp-lib-new-cat-add:hover { background: var(--cr-blue-dark); }

/* ── Step 8: Revisions panel ─────────────────────────────── */

/* Controls row */
.cr-sp-rev-controls {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 14px 18px;
    background: #f8f9fb;
    border-bottom: 1px solid var(--cr-border);
    flex-shrink: 0;
    flex-wrap: wrap;
}
.cr-sp-rev-group { flex: 1; min-width: 160px; }
.cr-sp-rev-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 4px;
}
.cr-sp-rev-label.label-left { color: #dc2626; }
.cr-sp-rev-label.label-right { color: #16a34a; }
.cr-sp-rev-select {
    width: 100%;
    padding: 7px 10px;
    font-size: 13px;
    border: 2px solid var(--cr-border);
    border-radius: 5px;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
}
.cr-sp-rev-select.select-left { border-color: #fca5a5; }
.cr-sp-rev-select.select-right { border-color: #86efac; }
.cr-sp-rev-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,119,168,.15);
}
.cr-sp-rev-vs {
    font-weight: 700;
    font-size: 12px;
    color: var(--cr-text-muted);
    padding-bottom: 8px;
}
.cr-sp-rev-compare-btn {
    padding: 8px 18px;
    background: var(--cr-blue);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: background .15s;
}
.cr-sp-rev-compare-btn:hover { background: var(--cr-blue-dark); }
.cr-sp-rev-compare-btn:disabled { background: #9ca3af; cursor: wait; }

/* Legend */
.cr-sp-rev-legend {
    display: flex;
    gap: 16px;
    padding: 8px 18px;
    background: #f8f9fb;
    border-bottom: 1px solid var(--cr-border);
    flex-shrink: 0;
    font-size: 12px;
}
.cr-sp-rev-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--cr-text-muted);
}
.cr-sp-rev-swatch {
    display: inline-block;
    width: 14px; height: 14px;
    border-radius: 3px;
}
.cr-sp-rev-swatch.swatch-added {
    background: #dcfce7;
    border: 1px solid #86efac;
}
.cr-sp-rev-swatch.swatch-removed {
    background: #fee2e2;
    border: 1px solid #fca5a5;
}

/* Diff area */
.cr-sp-rev-diff {
    overflow-y: auto;
    padding: 0;
}
.cr-sp-rev-diff-content {
    padding: 18px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--cr-text);
}
/* Diff ins/del styles (matches betterrevisions) */
.cr-sp-rev-diff-content ins,
.cr-sp-rev-diff-content .diffmod ins,
.cr-sp-rev-diff-content .diffins {
    background-color: #dcfce7;
    color: #16a34a;
    padding: 0.1em 0.2em;
    border-radius: 3px;
    border-left: 3px solid #16a34a;
    text-decoration: none;
}
.cr-sp-rev-diff-content del,
.cr-sp-rev-diff-content .diffmod del,
.cr-sp-rev-diff-content .diffdel {
    background-color: #fee2e2;
    color: #dc2626;
    padding: 0.1em 0.2em;
    border-radius: 3px;
    border-left: 3px solid #dc2626;
    text-decoration: line-through;
}

/* Diff empty/loading states */
.cr-sp-rev-empty,
.cr-sp-rev-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--cr-text-muted);
}
.cr-sp-rev-empty .fa,
.cr-sp-rev-loading .fa {
    font-size: 30px;
    color: var(--cr-border);
    margin-bottom: 10px;
    display: block;
}
.cr-sp-rev-loading .fa { color: var(--cr-blue); }

/* Fallback: large document — redirect message */
.cr-sp-rev-fallback-msg p {
    font-size: 16px;
    color: var(--cr-text);
    max-width: 400px;
    margin: 0 auto 18px;
    line-height: 1.5;
}
.cr-sp-rev-fullpage-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--cr-blue);
    color: #fff;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
}
.cr-sp-rev-fullpage-link:hover {
    background: var(--cr-blue-dark);
    color: #fff;
    text-decoration: none;
}

/* Footer stats */
.cr-sp-rev-stats {
    font-size: 12px;
    display: flex;
    gap: 10px;
}
.cr-sp-rev-stat-add {
    color: #16a34a;
    font-weight: 600;
}
.cr-sp-rev-stat-del {
    color: #dc2626;
    font-weight: 600;
}

/* Override: when revisions panel is open, body becomes flex to keep controls sticky */
.cr-sp-body:has(.cr-sp-rev-controls) {
    display: flex;
    flex-direction: column;
    padding: 0;
}
.cr-sp-rev-diff {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* ── Step 9: Disqus ───────────────────────────────────────── */
.cr-disqus-section {
    margin-top: 40px;
    padding: 28px 0 0;
    border-top: 2px solid var(--cr-border);
}

/* ══════════════════════════════════════════════
   STEP 11: Admin features
   ══════════════════════════════════════════════ */

/* ── Admin bar tools (green accent) ───────────────────── */
.cr-bar-admin {
    background: rgba(22,163,74,.15);
    border-right-color: rgba(255,255,255,.08) !important;
}
.cr-bar-admin:hover {
    background: rgba(22,163,74,.35);
}
.cr-bar-admin .fa {
    color: #86efac;
}

/* ── Admin mobile items (green accent) ────────────────── */
.cr-mobile-admin {
    background: rgba(22,163,74,.12);
}
.cr-mobile-admin:hover {
    background: rgba(22,163,74,.28);
}
.cr-mobile-admin .fa {
    color: #86efac !important;
}

/* ── WidgetPages panel ────────────────────────────────── */
.cr-sp-wp-list {
    padding: 4px 0;
}
.cr-sp-wp-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f2f4;
    cursor: pointer;
    transition: background .1s;
    user-select: none;
}
.cr-sp-wp-item:last-child {
    border-bottom: none;
}
.cr-sp-wp-item:hover {
    background: var(--cr-blue-light);
}
.cr-sp-wp-check {
    width: 18px; height: 18px;
    border: 2px solid #b0bec5;
    border-radius: 4px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
}
.cr-sp-wp-check.checked {
    background: #16a34a;
    border-color: #16a34a;
}
.cr-sp-wp-check.checked::after {
    content: '\2713';
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}
.cr-sp-wp-title {
    font-size: 13.5px;
    color: var(--cr-text);
    line-height: 1.35;
}
.cr-sp-wp-item:hover .cr-sp-wp-title {
    color: var(--cr-blue-dark);
}

/* ══════════════════════════════════════════════
   STEP 12b: Panel card styling (JS-transformed)
   ══════════════════════════════════════════════ */

/* ── Category group (Σχετικές ανά θέμα) ───────────────── */
.cr-sp-cat {
    border-bottom: 1px solid var(--cr-border);
}
.cr-sp-cat:last-child { border-bottom: none; }

.cr-sp-cat-header {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 18px;
    font-size: 13px;
    font-weight: 700;
    color: var(--cr-blue-dark);
    background: #f7f9fb;
    cursor: pointer;
    user-select: none;
    transition: background .12s;
    border-bottom: 1px solid var(--cr-border);
}
.cr-sp-cat-header:hover { background: var(--cr-blue-light); }
.cr-sp-cat-icon {
    width: 26px; height: 26px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    background: var(--cr-blue-light);
    color: var(--cr-blue);
}
.cr-sp-cat-title { flex: 1; }
.cr-sp-cat-count {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--cr-blue);
    color: #fff;
    min-width: 22px;
    text-align: center;
}
.cr-sp-cat-arrow {
    font-size: 10px;
    opacity: .4;
    transition: transform .2s;
}
.cr-sp-cat-header.collapsed .cr-sp-cat-arrow {
    transform: rotate(-90deg);
}
.cr-sp-cat-items {
    overflow: hidden;
    transition: max-height .3s ease;
    max-height: 4000px;
}
.cr-sp-cat-header.collapsed + .cr-sp-cat-items {
    max-height: 0;
}

/* ── Document item (shared by all panels) ─────────────── */
.cr-sp-doc-item {
    display: block;
    padding: 11px 18px;
    border-bottom: 1px solid #f0f2f4;
    transition: background .12s;
    cursor: pointer;
    text-decoration: none;
    color: var(--cr-text);
}
.cr-sp-doc-item:last-child { border-bottom: none; }
.cr-sp-doc-item:hover {
    background: #f7f9fb;
    text-decoration: none;
}
.cr-sp-doc-code {
    font-size: 13px;
    font-weight: 700;
    color: var(--cr-blue);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cr-sp-doc-code .fa { font-size: 11px; opacity: .5; }
.cr-sp-doc-title {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--cr-text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cr-sp-doc-item:hover .cr-sp-doc-title { color: var(--cr-blue-dark); }
.cr-sp-doc-desc {
    font-size: 12px;
    line-height: 1.4;
    color: var(--cr-text-muted);
    margin-top: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-style: italic;
}
.cr-sp-doc-year {
    font-size: 11px;
    font-weight: 600;
    color: var(--cr-text-muted);
    background: #f0f3f6;
    padding: 1px 7px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ── Link item (Υπερσυνδέσεις) ────────────────────────── */
.cr-sp-link-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 18px;
    border-bottom: 1px solid #f0f2f4;
    transition: background .12s;
    cursor: pointer;
    text-decoration: none;
    color: var(--cr-text);
}
.cr-sp-link-item:last-child { border-bottom: none; }
.cr-sp-link-item:hover {
    background: #f7f9fb;
    text-decoration: none;
}
.cr-sp-link-icon {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: var(--cr-blue-light);
    color: var(--cr-blue);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    margin-top: 2px;
}
.cr-sp-link-text { flex: 1; min-width: 0; }
.cr-sp-link-title {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--cr-blue);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cr-sp-link-item:hover .cr-sp-link-title { color: var(--cr-blue-dark); }
.cr-sp-link-sub {
    font-size: 12px;
    line-height: 1.4;
    color: var(--cr-text-muted);
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cr-sp-link-ext {
    font-size: 11px;
    opacity: .35;
    flex-shrink: 0;
    align-self: center;
    margin-left: auto;
}
.cr-sp-link-item:hover .cr-sp-link-ext { opacity: .7; }

/* ── News item (Σχετικά θέματα) ───────────────────────── */
.cr-sp-news-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 18px;
    border-bottom: 1px solid #f0f2f4;
    transition: background .12s;
    cursor: pointer;
    text-decoration: none;
    color: var(--cr-text);
}
.cr-sp-news-item:last-child { border-bottom: none; }
.cr-sp-news-item:hover {
    background: #f7f9fb;
    text-decoration: none;
}
.cr-sp-news-icon {
    width: 28px; height: 28px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    margin-top: 2px;
}
.cr-sp-news-icon.icon-news {
    background: var(--cr-yellow-bg);
    color: var(--cr-yellow);
}
.cr-sp-news-icon.icon-circular {
    background: var(--cr-teal-bg);
    color: var(--cr-teal);
}
.cr-sp-news-title {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--cr-text);
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.cr-sp-news-item:hover .cr-sp-news-title { color: var(--cr-blue-dark); }
.cr-sp-news-sub {
    font-size: 12px;
    color: var(--cr-text-muted);
    margin-top: 2px;
    font-style: italic;
}

/* ── Section header (inside panels) ───────────────────── */
.cr-sp-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #f5f7f9;
    border-bottom: 1px solid var(--cr-border);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--cr-text-muted);
}
.cr-sp-section-header .fa {
    font-size: 12px;
    color: var(--cr-blue);
}
.cr-sp-section-count {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    background: #e2e9ed;
    color: var(--cr-text-muted);
    margin-left: auto;
}

/* ══════════════════════════════════════════════
   STEP 12: Polish & QA
   ══════════════════════════════════════════════ */

/* ── A. Accessibility: focus-visible states ───────────── */
.cr-bar-tool:focus-visible,
.cr-bar-hamburger:focus-visible,
.cr-nav-btn:focus-visible,
.cr-back-to-top:focus-visible,
.cr-notes-save:focus-visible,
.cr-sp-close-btn:focus-visible,
.cr-sp-size-btn:focus-visible,
.cr-sp-footer-btn:focus-visible,
.cr-sp-rev-compare-btn:focus-visible,
.cr-sp-lib-new-cat-add:focus-visible,
.cr-sp-wp-item:focus-visible,
.cr-mobile-item:focus-visible {
    outline: 2px solid var(--cr-yellow);
    outline-offset: -2px;
}
.cr-tag:focus-visible,
.cr-rs-tag:focus-visible,
.cr-breadcrumb a:focus-visible {
    outline: 2px solid var(--cr-blue);
    outline-offset: 1px;
    border-radius: 2px;
}
.cr-notes-textarea:focus-visible {
    outline: none; /* already has box-shadow focus style */
}
.cr-sp-rev-select:focus-visible {
    outline: none; /* already has box-shadow focus style */
}

/* ── B. Panel content: enhanced table/list styling ────── */

/* Zebra striping */
.cr-sp-body table tbody tr:nth-child(even) td {
    background: #f8fafb;
}
.cr-sp-body table tbody tr:hover td {
    background: #edf2f7;
}

/* Table links */
.cr-sp-body table a {
    color: var(--cr-blue);
    text-decoration: none;
    transition: color .15s;
}
.cr-sp-body table a:hover {
    color: var(--cr-blue-dark);
    text-decoration: underline;
}

/* Better list links */
.cr-sp-body ul li a,
.cr-sp-body ol li a {
    color: var(--cr-blue);
    text-decoration: none;
    transition: color .15s;
}
.cr-sp-body ul li a:hover,
.cr-sp-body ol li a:hover {
    color: var(--cr-blue-dark);
    text-decoration: underline;
}

/* Section spacing inside panels */
.cr-sp-body > *:first-child { margin-top: 0; }
.cr-sp-body hr {
    border: none;
    border-top: 1px solid var(--cr-border);
    margin: 16px 0;
}

/* Table caption / header row */
.cr-sp-body table th:first-child {
    border-top-left-radius: 4px;
}
.cr-sp-body table th:last-child {
    border-top-right-radius: 4px;
}

/* Compact table on smaller panels */
.cr-sp-body table td:first-child {
    font-weight: 600;
    color: var(--cr-text);
}

/* ── C. Performance ───────────────────────────────────── */
.cr-slide-panel {
    will-change: transform;
}
.cr-panel-backdrop {
    will-change: opacity;
}
.cr-reading-progress-fill {
    will-change: width;
}
.cr-main-content {
    contain: layout style;
}

/* ── D. Polish: ::selection ───────────────────────────── */
.cr-page-frame ::selection {
    background: rgba(0, 119, 168, .18);
    color: inherit;
}
.cr-page-frame ::-moz-selection {
    background: rgba(0, 119, 168, .18);
    color: inherit;
}

/* ── D. Polish: consistent link transitions ───────────── */
.cr-codified-notice a,
.cr-annotation-block a,
.cr-meta-value a,
.cr-smeta-value a {
    transition: color .15s;
}

/* ── D. Polish: smooth scrollbar (sidebar + panels) ──── */
.cr-left-sidebar,
.cr-sp-body,
.cr-sp-rev-diff {
    scrollbar-width: thin;
    scrollbar-color: #c8d4da transparent;
}

/* ── D. Polish: @media print ──────────────────────────── */
@media print {
    /* Hide non-content elements */
    .cr-content-bar,
    .cr-left-sidebar,
    .cr-back-to-top,
    .cr-reading-progress,
    .cr-bar-mobile-menu,
    .cr-panel-backdrop,
    .cr-slide-panel,
    .cr-disqus-section,
    .cr-notes-section {
        display: none !important;
    }

    /* Full width main content */
    .cr-body-wrap {
        display: block !important;
    }
    .cr-main-content {
        width: 100% !important;
    }

    /* Page frame: no borders, no max-width */
    .cr-page-frame {
        max-width: none !important;
        border: none !important;
    }

    /* Remove backgrounds for ink saving */
    .cr-banner-area { display: none !important; }
    .cr-codified-notice {
        border: 1px solid #aaa;
        background: none !important;
        -webkit-print-color-adjust: exact;
    }
    .cr-annotation-block {
        border: 1px solid #aaa;
        border-left-width: 3px;
        background: none !important;
    }

    /* Tags: simple inline */
    .cr-tag, .cr-rs-tag {
        border: 1px solid #ccc;
        background: none !important;
    }

    /* Links: show URL in print */
    .cr-circular-text a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
        word-break: break-all;
    }
    /* Links: reset colors for print */
    .cr-circular-text a,
    .cr-circular-text a[rel*="laws"],
    .cr-circular-text a[rel*="facebox"],
    .cr-circular-text a[data-auto-links],
    .cr-circular-text a[rel*="circulars"] {
        color: #333 !important;
        text-decoration: underline !important;
        background: none !important;
    }

    /* Breadcrumb: simpler */
    .cr-breadcrumb {
        border-bottom: 1px solid #ccc;
        padding: 4px 0;
    }

    /* Avoid page breaks inside important blocks */
    .cr-codified-notice,
    .cr-annotation-block,
    .cr-metadata,
    .cr-attachments {
        page-break-inside: avoid;
    }
}

/* ══════════════════════════════════════════════
   STEP 10: Responsive + Mobile + Edge cases
   ══════════════════════════════════════════════ */

/* ── Hamburger button (hidden on desktop) ─────────────── */
.cr-bar-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    padding: 0 14px;
    cursor: pointer;
    border: none;
    background: transparent;
    border-right: 1px solid rgba(255,255,255,.15);
    transition: background .15s;
    font-family: 'Open Sans', sans-serif;
}
.cr-bar-hamburger:hover,
.cr-bar-hamburger.active {
    background: rgba(0,0,0,.18);
}

/* ── Mobile menu (inside content bar, absolute below it) ─ */
.cr-bar-mobile-menu {
    display: none;
    position: absolute;
    top: var(--cr-bar-h);
    left: 0;
    right: 0;
    background: var(--cr-blue-bar);
    border-top: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 6px 20px rgba(0,0,0,.22);
    z-index: 499;
    animation: crSlideDown .15s ease;
}
.cr-bar-mobile-menu.open {
    display: block;
}
.cr-mobile-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Open Sans', sans-serif;
    text-decoration: none;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: transparent;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background .15s;
}
.cr-mobile-item:last-child {
    border-bottom: none;
}
.cr-mobile-item:hover {
    background: rgba(0,0,0,.18);
    color: #fff;
    text-decoration: none;
}
.cr-mobile-item .fa {
    width: 20px;
    text-align: center;
    font-size: 14px;
    opacity: .85;
    flex-shrink: 0;
}

/* ── Edge case: empty sidebar nav ─────────────────────── */
.cr-sidebar-nav:empty {
    display: none;
}

/* ── Breakpoint: ≤1260px (tablet landscape) ───────────── */
@media (max-width: 1260px) {
    .cr-title-area { padding: 18px 20px 14px; }
    .cr-circular-text { padding: 20px 20px 32px; }
    .cr-metadata { padding: 14px 20px; }
    .cr-codified-notice,
    .cr-annotation-block { margin-left: 20px; margin-right: 20px; }
    .cr-attachments { padding: 14px 20px; }
    .cr-tags { padding: 14px 20px 20px; }
    .cr-notes-section { padding: 16px 20px 24px; }
}

/* ── Breakpoint: ≤900px (tablet portrait) ─────────────── */
@media (max-width: 900px) {
    /* Sidebar hidden */
    .cr-left-sidebar { display: none; }

    /* Panels: wider on tablet */
    .cr-slide-panel { width: 90vw !important; }
    .cr-slide-panel.cr-panel-wide { width: 90vw !important; }
    .cr-slide-panel.cr-panel-large { width: 95vw !important; }

    /* Revisions controls: stack vertically */
    .cr-sp-rev-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .cr-sp-rev-vs {
        text-align: center;
        padding: 4px 0;
    }
    .cr-sp-rev-group { min-width: 0; }
}

/* ── Breakpoint: ≤600px (mobile) ──────────────────────── */
@media (max-width: 600px) {

    /* Hamburger visible */
    .cr-bar-hamburger { display: flex; }

    /* Hide bar items that go to hamburger */
    .cr-bar-hideable { display: none !important; }

    /* Hide labels on remaining bar items (icons only) */
    .cr-bar-label { display: none; }

    /* Bar adjustments */
    .cr-content-bar { padding: 0 8px; }
    .cr-bar-tool { padding: 0 10px; font-size: 12px; }
    .cr-bar-count { font-size: 10px; padding: 1px 5px; }
    .cr-bar-caret { font-size: 10px; }

    /* Title area */
    .cr-title { font-size: 18px; }
    .cr-subtitle { font-size: 13px; }
    .cr-title-area { padding: 14px 16px 12px; }

    /* Breadcrumb */
    .cr-breadcrumb { padding: 6px 16px; font-size: 12px; }

    /* Content paddings */
    .cr-circular-text { padding: 16px 16px 28px; font-size: 15px; line-height: 26px; }
    .cr-metadata { padding: 12px 16px; }
    .cr-codified-notice,
    .cr-annotation-block { margin-left: 16px; margin-right: 16px; }
    .cr-annotation-block { font-size: 14px; line-height: 24px; }
    .cr-attachments { padding: 12px 16px; }
    .cr-tags { padding: 12px 16px 16px; }
    .cr-notes-section { padding: 14px 16px 20px; }

    /* Text title */
    .cr-text-title { font-size: 16px; }

    /* Back to top: smaller */
    .cr-back-to-top {
        width: 38px; height: 38px;
        font-size: 15px;
        bottom: 16px; right: 16px;
    }

    /* Disqus */
    .cr-disqus-section { margin-top: 24px; padding: 20px 0 0; }

    /* Panel adjustments */
    .cr-sp-header { padding: 10px 14px; gap: 8px; }
    .cr-sp-header-icon { width: 28px; height: 28px; font-size: 14px; }
    .cr-sp-header-title { font-size: 14px; }
    .cr-sp-body { padding: 14px; font-size: 13px; }
    .cr-sp-footer { padding: 10px 14px; }
    .cr-sp-footer-btn { padding: 7px 14px; font-size: 12.5px; }

    /* Library tree: tighter on mobile */
    .cr-sp-lib-tree { padding: 6px 8px 12px; }
    .cr-sp-lib-node-row { padding: 4px 6px; }
    .cr-sp-lib-new-cat { padding: 8px 14px; }
    .cr-sp-lib-new-cat-row { flex-direction: column; gap: 6px; }
    .cr-sp-lib-new-cat-parent { flex: 1; }

    /* Revisions: compare button full-width */
    .cr-sp-rev-compare-btn { width: 100%; text-align: center; }

    /* Κοινοποίηση dropdown: align right on mobile */
    .cr-bar-dropdown { min-width: 200px; }
}
