/**
 * WordCraft Web - Ribbon Bar Styles (Office 365 Ribbon UI)
 * License: MIT
 */

.word-ribbon {
    background-color: var(--word-ribbon-bg);
    border-bottom: 1px solid var(--word-border);
    flex-shrink: 0;
    z-index: 90;
}

/* Ribbon Tabs Bar */
.word-ribbon-tabs {
    display: flex;
    align-items: center;
    height: 32px;
    padding-left: 8px;
    background-color: var(--word-bg);
    border-bottom: 1px solid var(--word-border);
}

.word-ribbon-tab {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 400;
    color: var(--word-text);
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    transition: background-color 0.1s, color 0.1s;
}

.word-ribbon-tab:hover {
    background-color: var(--word-ribbon-hover);
}

.word-ribbon-tab.active {
    font-weight: 600;
    color: var(--word-blue);
    background-color: var(--word-ribbon-bg);
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.word-ribbon-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--word-blue);
}

/* Special File Tab */
.word-ribbon-tab.tab-file {
    background-color: var(--word-blue);
    color: #ffffff;
    font-weight: 600;
    border-radius: 4px 4px 0 0;
    margin-right: 4px;
}

.word-ribbon-tab.tab-file:hover {
    background-color: var(--word-blue-hover);
}

/* Contextual Tabs */
.word-ribbon-tab.contextual-tab {
    background-color: #f0fdf4;
    color: #166534;
    border-top: 2px solid #22c55e;
}

/* Ribbon Content Body */
.word-ribbon-body {
    display: flex;
    align-items: stretch;
    height: 96px;
    padding: 4px 8px;
    overflow-x: auto;
    overflow-y: hidden;
}

.word-ribbon-tab-content {
    display: none;
    align-items: stretch;
    gap: 2px;
    width: 100%;
}

.word-ribbon-tab-content.active {
    display: flex;
}

/* Ribbon Groups */
.word-ribbon-group {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2px 8px 18px 8px;
    border-right: 1px solid var(--word-border);
    flex-shrink: 0;
    position: relative;
}

.word-ribbon-group-items {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.word-ribbon-group-title {
    position: absolute;
    bottom: 2px;
    left: 6px;
    right: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 400;
    color: var(--word-text-muted);
    text-align: center;
    height: 15px;
    white-space: nowrap;
    pointer-events: none;
    letter-spacing: 0.1px;
}

.word-group-dialog-btn,
.word-dialog-launcher-btn,
.word-ribbon-dialog-launcher {
    position: absolute;
    bottom: 2px;
    right: 3px;
    width: 15px;
    height: 15px;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    color: var(--word-text-muted);
    font-size: 10px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    padding: 0;
    pointer-events: auto;
    transition: all 0.12s;
}

.word-group-dialog-btn:hover,
.word-dialog-launcher-btn:hover,
.word-ribbon-dialog-launcher:hover {
    background-color: var(--word-ribbon-hover);
    border-color: var(--word-border-dark);
    color: var(--word-blue);
}

/* Large Ribbon Button (Stacked Icon + Text) */
.word-ribbon-btn-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-width: 50px;
    height: 66px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--word-text);
    cursor: pointer;
    padding: 5px 5px 3px 5px;
    text-align: center;
    transition: background-color 0.12s, border-color 0.12s, box-shadow 0.12s;
    user-select: none;
}

.word-ribbon-btn-large:hover {
    background-color: var(--word-ribbon-hover);
    border-color: var(--word-border-dark);
}

.word-ribbon-btn-large:active,
.word-ribbon-btn-large.active {
    background-color: #e0f2fe;
    border-color: #0284c7;
    color: #0369a1;
}

.word-ribbon-btn-large svg {
    width: 26px;
    height: 26px;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.word-ribbon-btn-large span {
    font-size: 11px;
    line-height: 1.15;
    font-weight: 400;
    max-width: 68px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Small Ribbon Button (Horizontal Icon + Text or Icon Only) */
.word-ribbon-btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    min-width: 24px;
    padding: 0 5px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    color: var(--word-text);
    cursor: pointer;
    font-size: 12px;
    gap: 5px;
    transition: background-color 0.12s, border-color 0.12s;
    user-select: none;
    white-space: nowrap;
}

.word-ribbon-btn-small:hover {
    background-color: var(--word-ribbon-hover);
    border-color: var(--word-border-dark);
}

.word-ribbon-btn-small:active,
.word-ribbon-btn-small.active {
    background-color: #e0f2fe;
    border-color: #0284c7;
    color: #0369a1;
}

.word-ribbon-btn-small svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Color Indicator Bar inside Ribbon Buttons */
.word-btn-color-icon-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.word-btn-color-bar {
    width: 14px;
    height: 3.5px;
    border-radius: 1px;
    margin-top: 1px;
    border: 0.5px solid rgba(0, 0, 0, 0.2);
}

/* Small Buttons Rows Container */
.word-ribbon-column {
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
}

.word-ribbon-row {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Select Pickers (Font, Size) */
.word-ribbon-select {
    height: 24px;
    font-size: 12px;
    color: var(--word-text);
    background-color: #ffffff;
    border: 1px solid var(--word-border-dark);
    border-radius: 3px;
    padding: 0 4px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.12s;
}

.word-ribbon-select:hover,
.word-ribbon-select:focus {
    border-color: var(--word-blue);
}

/* Split Button (Main Action + Dropdown Arrow) */
.word-split-btn {
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 3px;
    overflow: hidden;
    height: 24px;
    transition: border-color 0.12s, background-color 0.12s;
}

.word-split-btn:hover {
    border-color: var(--word-border-dark);
    background-color: var(--word-ribbon-hover);
}

.word-split-btn > .word-ribbon-btn-small {
    border: none !important;
    border-radius: 2px 0 0 2px;
    height: 22px;
}

.word-split-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 22px;
    background: transparent;
    border: none;
    border-left: 1px solid transparent;
    cursor: pointer;
    color: var(--word-text-muted);
    font-size: 9px;
    padding: 0;
}

.word-split-btn:hover .word-split-arrow {
    border-left-color: var(--word-border-dark);
}

.word-split-arrow:hover {
    background-color: var(--word-ribbon-active);
    color: var(--word-blue);
}

/* Vertical Split Button (Large Paste button with arrow underneath) */
.word-split-btn-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
    height: 66px;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.12s;
}

.word-split-btn-vertical:hover {
    background-color: var(--word-ribbon-hover);
    border-color: var(--word-border-dark);
}

.word-ribbon-btn-large-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex: 1;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--word-text);
    padding: 4px 4px 0 4px;
}

.word-ribbon-btn-large-top svg {
    width: 26px;
    height: 26px;
    margin-bottom: 2px;
}

.word-ribbon-btn-large-top span {
    font-size: 11px;
    line-height: 1.1;
}

.word-ribbon-btn-large-arrow {
    width: 100%;
    height: 15px;
    background: transparent;
    border: none;
    border-top: 1px solid transparent;
    cursor: pointer;
    color: var(--word-text-muted);
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.word-split-btn-vertical:hover .word-ribbon-btn-large-arrow {
    border-top-color: var(--word-border);
}

.word-ribbon-btn-large-arrow:hover {
    background-color: var(--word-ribbon-active);
    color: var(--word-blue);
}

/* Horizontal Split Button (Underline U + Arrow, Bullets + Arrow, Numbering + Arrow) */
.word-split-btn-horizontal {
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 3px;
    height: 24px;
    transition: all 0.12s;
}

.word-split-btn-horizontal:hover {
    border-color: var(--word-border-dark);
    background-color: var(--word-ribbon-hover);
}

.word-split-btn-horizontal .word-ribbon-btn-small {
    border: none;
    border-radius: 2px 0 0 2px;
    height: 22px;
}

.word-btn-arrow {
    width: 13px !important;
    min-width: 13px !important;
    height: 22px !important;
    padding: 0 !important;
    font-size: 9px !important;
    border: none !important;
    border-left: 1px solid transparent !important;
    border-radius: 0 2px 2px 0 !important;
    color: var(--word-text-muted);
}

.word-split-btn-horizontal:hover .word-btn-arrow {
    border-left-color: var(--word-border-dark) !important;
}

.word-btn-arrow:hover {
    background-color: var(--word-ribbon-active) !important;
    color: var(--word-blue) !important;
}

.word-ribbon-dropdown-menu {
    max-height: 420px;
    overflow-y: auto;
}

/* Styles Gallery Container */
.word-styles-gallery {
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--word-border);
    border-radius: 4px;
    padding: 3px;
    background-color: #ffffff;
    height: 64px;
}

.word-style-thumbnail {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 56px;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    padding: 2px;
    transition: all 0.12s;
}

.word-style-thumbnail:hover {
    border-color: #93c5fd;
    background-color: #f0f9ff;
}

.word-style-thumbnail.active {
    border-color: var(--word-blue);
    background-color: rgba(24, 90, 189, 0.08);
}

.word-style-preview {
    font-size: 14px;
    margin-bottom: 2px;
}

.word-style-name {
    font-size: 10px;
    color: var(--word-text-muted);
    white-space: nowrap;
}

/* Ribbon Pin / Collapse Button */
.word-ribbon-pin-btn {
    margin-left: auto;
    margin-right: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--word-text);
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.word-ribbon-pin-btn:hover {
    background-color: var(--word-ribbon-hover);
}

.word-ribbon.collapsed .word-ribbon-body {
    display: none !important;
}

.word-ribbon.collapsed.flyout-open .word-ribbon-body {
    display: flex !important;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--word-ribbon-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Alt Keytips Badge System */
.word-keytip-badge {
    position: fixed;
    z-index: 99999;
    background-color: #ffffff;
    color: #111827;
    border: 1px solid #374151;
    border-radius: 2px;
    padding: 1px 4px;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    text-transform: uppercase;
}

/* QAT Below Ribbon */
.qat-below-ribbon {
    background-color: #f8fafc;
    border-bottom: 1px solid var(--word-border);
    padding: 2px 10px;
    margin-left: 0 !important;
    display: flex;
    align-items: center;
    gap: 4px;
}

.qat-below-ribbon .word-tool-btn {
    color: #1e293b;
}

.qat-below-ribbon .word-tool-btn:hover {
    background-color: #e2e8f0;
}

/* Dropdown Popups System (Always Fixed on Document Body, Never Clipped) */
.word-dropdown-popup {
    position: fixed !important;
    z-index: 100040 !important;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.22), 0 6px 12px -4px rgba(15, 23, 42, 0.12);
    padding: 6px 0;
    color: #1e293b;
    font-size: 12.5px;
    min-width: 220px;
    max-height: 80vh;
    overflow-y: auto;
    user-select: none;
}

.word-popup-header {
    padding: 6px 14px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #64748b;
    background-color: #f8fafc;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

.word-popup-header:first-child {
    border-top: none;
}

.word-popup-divider {
    height: 1px;
    background-color: #e2e8f0;
    margin: 4px 0;
}

.word-popup-item {
    display: flex;
    align-items: center;
    padding: 6px 14px;
    cursor: pointer;
    gap: 10px;
    transition: background-color 0.1s;
}

.word-popup-item:hover {
    background-color: #eff6ff;
    color: #1d4ed8;
}

.word-popup-item.disabled {
    opacity: 0.5;
    cursor: default;
}

.word-popup-item.disabled:hover {
    background-color: transparent;
    color: inherit;
}

.word-popup-check {
    width: 16px;
    font-weight: 700;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.word-popup-label {
    flex: 1;
}

/* Undo History Popup */
.word-undo-popup {
    min-width: 200px;
    max-height: 320px;
}

.word-undo-list-items {
    max-height: 240px;
    overflow-y: auto;
}

.word-undo-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
}

.word-undo-row.hover-highlight {
    background-color: #e0f2fe;
    color: #0369a1;
}

.word-undo-footer {
    padding: 8px 12px;
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    text-align: center;
}

/* Tell Me Search Results */
.word-tellme-popup {
    max-height: 360px;
    overflow-y: auto;
}

.tellme-item {
    padding: 8px 12px;
}

.tellme-icon {
    font-size: 14px;
    color: #2563eb;
}

.tellme-text {
    flex: 1;
}

.tellme-label {
    font-weight: 600;
    font-size: 13px;
    color: #0f172a;
}

.tellme-desc {
    font-size: 11px;
    color: #64748b;
}

.tellme-shortcut {
    font-size: 11px;
    color: #94a3b8;
    background-color: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}

.tellme-item.selected,
.tellme-item:hover {
    background-color: #eff6ff;
}

/* Account Card Popup */
.word-account-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: #f8fafc;
}

.account-avatar-large {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #185abd;
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.account-name {
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
}

.account-email {
    font-size: 12px;
    color: #64748b;
}

.account-plan {
    font-size: 11px;
    color: #16a34a;
    font-weight: 500;
    margin-top: 2px;
}

/* Ribbon Display Options Popup */
.word-ribbon-opt-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
}

.word-ribbon-opt-item:hover {
    background-color: #f1f5f9;
}

.word-ribbon-opt-item.active {
    background-color: #eff6ff;
    border-left: 3px solid #2563eb;
}

.opt-icon {
    font-size: 18px;
    color: #2563eb;
    margin-top: -2px;
}

.opt-title {
    font-weight: 600;
    font-size: 13px;
    color: #0f172a;
    margin-bottom: 2px;
}

.opt-desc {
    font-size: 11px;
    color: #64748b;
    line-height: 1.3;
}

/* Save Status Pill */
.word-save-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #000;
    background-color: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.word-save-status-pill.saving {
    background-color: rgba(234, 179, 8, 0.3);
    color: #000;
}

.word-save-status-pill.saved {
    background-color: rgba(34, 197, 94, 0.25);
    color: #000;
}

/* Inline Doc Title Input */
.word-doc-title-input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    padding: 2px 8px;
    border-radius: 5px;
    outline: none;
    width: 220px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.word-doc-title-input:hover {
    border-color: #94a3b8;
}

.word-doc-title-input:focus {
    background: #ffffff;
    color: #0f172a;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Ribbon Display Options & Window Control Buttons */
.word-tool-btn.word-ribbon-opts-btn {
    width: auto;
    height: 28px;
    padding: 0 8px;
    gap: 4px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #334155;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: all 0.15s ease;
}

.word-tool-btn.word-ribbon-opts-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.word-tool-btn.word-ribbon-opts-btn:active {
    background: #e2e8f0;
}

.word-tool-btn.word-ribbon-opts-btn .word-opts-caret {
    opacity: 0.75;
}

.word-window-controls {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 28px;
    margin-left: 4px;
    padding-left: 8px;
    border-left: 1px solid #cbd5e1;
}

.word-win-btn {
    width: 30px;
    height: 28px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #334155;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.word-win-btn svg {
    display: block;
    flex-shrink: 0;
}

.word-win-btn:hover {
    background-color: #e2e8f0;
    border-color: #cbd5e1;
    color: #0f172a;
}

.word-win-btn:active {
    background-color: #cbd5e1;
}

.word-win-btn.close-btn {
    color: #475569;
}

.word-win-btn.close-btn:hover {
    background-color: #ef4444;
    border-color: #dc2626;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}

/* ================= INSERT TAB DROPDOWNS & GALLERIES ================= */

/* Table Grid Picker */
.word-table-picker-container {
    padding: 10px 14px;
}

.word-table-grid {
    display: grid;
    grid-template-columns: repeat(10, 18px);
    grid-template-rows: repeat(8, 18px);
    gap: 2px;
    margin-bottom: 8px;
}

.word-table-cell-box {
    width: 18px;
    height: 18px;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    cursor: pointer;
    transition: background-color 0.05s, border-color 0.05s;
}

.word-table-cell-box.highlight {
    background-color: #dbeafe;
    border-color: #3b82f6;
}

.word-table-picker-label {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    margin-bottom: 6px;
}

/* Shapes Gallery */
.word-shapes-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 8px 12px;
}

.word-shape-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.1s;
}

.word-shape-cell:hover {
    background-color: #f1f5f9;
    border-color: #93c5fd;
}

.word-shape-cell svg {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
}

/* Icons Gallery */
.word-icons-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
    padding: 8px 12px;
}

.word-icon-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.1s;
}

.word-icon-cell:hover {
    background-color: #e0f2fe;
    border-color: #38bdf8;
    transform: scale(1.15);
}

/* Cover Page Gallery */
.word-cover-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px 14px;
    min-width: 300px;
}

.word-cover-card {
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.15s;
    background: #ffffff;
}

.word-cover-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.word-cover-preview {
    width: 100%;
    height: 120px;
    border: 1px solid #e2e8f0;
    border-radius: 2px;
    margin-bottom: 4px;
    overflow: hidden;
    position: relative;
    background: #ffffff;
}

.word-cover-title {
    font-size: 11px;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
}

/* Equations Gallery */
.word-equations-list {
    min-width: 280px;
    max-height: 320px;
    overflow-y: auto;
}

.word-equation-item {
    padding: 8px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

.word-equation-item:hover {
    background-color: #f8fafc;
}

.word-equation-name {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
}

.word-equation-formula {
    font-family: 'Cambria Math', 'Times New Roman', serif;
    font-size: 14px;
    color: #0f172a;
}

/* ================= LAYOUT TAB CSS GALLERIES & CONTROLS ================= */

/* Position 9-Grid Gallery */
.word-position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 4px;
    margin-bottom: 6px;
}

.word-position-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 54px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.word-position-cell:hover {
    border-color: #0284c7;
    background-color: #f0f9ff;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);
}

.word-position-preview-box {
    width: 28px;
    height: 24px;
    border: 1px dashed #94a3b8;
    position: relative;
    background: #ffffff;
}

.word-position-indicator {
    width: 8px;
    height: 8px;
    background: #0284c7;
    position: absolute;
    border-radius: 1px;
}

/* Selection Pane UI */
.word-selection-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    margin-bottom: 4px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.1s;
}

.word-selection-item:hover {
    background: #f1f5f9;
}

.word-selection-item.selected {
    background: #e0f2fe;
    border-color: #0284c7;
    font-weight: 600;
}

.word-selection-item-eye {
    cursor: pointer;
    font-size: 14px;
    color: #64748b;
    padding: 0 4px;
}

.word-selection-item-eye:hover {
    color: #0f172a;
}

/* Mailings Micro Navigation & Active State Buttons */
.word-ribbon-btn-micro {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 2px;
    padding: 1px 4px;
    font-size: 9px;
    font-weight: 600;
    cursor: pointer;
    color: #475569;
    line-height: 14px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s, color 0.1s;
}

.word-ribbon-btn-micro:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.word-ribbon-btn-large.active,
.word-ribbon-btn-small.active {
    background-color: #e0f2fe !important;
    border: 1px solid #0284c7 !important;
    color: #0369a1 !important;
}




