/* Zatelital OS - Custom Styles */

/* Font faces - Local fonts */
@font-face {
    font-family: 'Alliance';
    src: url('../fonts/Alliance-PlattSemiBold.woff2') format('woff2'),
        url('../fonts/Alliance-PlattSemiBold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Sans';
    src: url('../fonts/IBMPlexSans-Regular.woff2') format('woff2'),
        url('../fonts/IBMPlexSans-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inconsolata';
    src: url('../fonts/Inconsolata-SemiExpandedSemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* Root variables */
:root {
    --color-primary: #161616;
    --color-background: #fafafa;
    --color-muted: #b7b7b7;
    --color-border: rgba(22, 22, 22, 0.1);
    --color-hover: rgba(22, 22, 22, 0.05);
    --font-alliance: 'Alliance', 'SF Pro Display', system-ui, sans-serif;
    --font-ibm: 'IBM Plex Sans', system-ui, sans-serif;
    --font-mono: 'Inconsolata', monospace;
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base styles */
body {
    font-family: var(--font-ibm);
    background-color: var(--color-background);
    color: var(--color-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-muted);
}

/* Custom font classes */
.font-alliance {
    font-family: var(--font-alliance);
}

.font-ibm {
    font-family: var(--font-ibm);
}

.font-mono {
    font-family: var(--font-mono);
}

/* Material Icons sizing */
.material-icons-outlined {
    font-size: inherit;
    width: 1em;
    height: 1em;
    vertical-align: middle;
}

/* Transition utilities */
.transition-colors {
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.transition-all {
    transition: all 0.15s ease;
}

.transition-transform {
    transition: transform 0.15s ease;
}

/* Animation for modals */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-overlay {
    animation: fadeIn 0.2s ease;
}

.modal-content {
    animation: slideIn 0.2s ease;
}

/* Hide scrollbar but keep functionality */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Kanban drag styles */
.kanban-card {
    transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.kanban-card.dragging {
    opacity: 0.7;
    transform: rotate(2deg) scale(1.02);
    box-shadow: 0 8px 25px rgba(22, 22, 22, 0.15);
    z-index: 100;
}

.kanban-column {
    transition: background-color 0.2s ease, border 0.2s ease;
    border: 2px solid transparent;
    max-height: 600px;
    overflow-y: auto;
}

.kanban-column.drag-over {
    background-color: rgba(22, 22, 22, 0.06);
    border: 2px dashed rgba(22, 22, 22, 0.3);
    border-radius: 8px;
}

.kanban-drop-indicator {
    height: 3px;
    background: #161616;
    border-radius: 3px;
    margin: 4px 8px;
    opacity: 0.8;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

/* Calendar day hover */
.calendar-day:hover {
    background-color: var(--color-hover);
}

.calendar-day.today {
    background-color: var(--color-primary);
    color: white;
}

.calendar-day.has-events::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background-color: var(--color-primary);
    border-radius: 50%;
}

/* Progress bar animation */
.progress-bar {
    transition: width 0.5s ease;
}

/* Input focus states */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary) !important;
}

/* Button states */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Table row hover */
.table-row:hover {
    background-color: var(--color-hover);
}

/* Card hover effect */
.card-hover:hover {
    border-color: rgba(22, 22, 22, 0.3);
}

/* Person name capitalization — visual fallback for legacy data */
.person-name {
    text-transform: capitalize;
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Status colors */
.status-active {
    background-color: rgba(34, 197, 94, 0.1);
    color: rgb(22, 163, 74);
}

.status-review {
    background-color: rgba(234, 179, 8, 0.1);
    color: rgb(202, 138, 4);
}

.status-completed {
    background-color: rgba(34, 197, 94, 0.1);
    color: rgb(22, 163, 74);
}

.status-pending {
    background-color: rgba(234, 179, 8, 0.1);
    color: rgb(202, 138, 4);
}

.status-overdue {
    background-color: rgba(239, 68, 68, 0.1);
    color: rgb(220, 38, 38);
}

.status-paid {
    background-color: rgba(34, 197, 94, 0.1);
    color: rgb(22, 163, 74);
}

/* Priority colors */
.priority-high {
    color: rgb(220, 38, 38);
}

.priority-medium {
    color: rgb(202, 138, 4);
}

.priority-low {
    color: rgb(22, 163, 74);
}

/* Responsive utilities */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 10px;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    font-family: var(--font-ibm);
    font-size: 14px;
    color: var(--color-primary);
    pointer-events: auto;
    animation: toastSlideIn 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
    max-width: 360px;
}

.toast.toast-exit {
    animation: toastSlideOut 0.3s cubic-bezier(0.06, 0.71, 0.55, 1) forwards;
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

.toast-icon .material-icons-outlined {
    font-size: 16px;
    color: #ffffff;
}

.toast-message {
    flex: 1;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--color-muted);
    transition: color 0.15s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--color-primary);
}

/* Toast variants */
.toast.toast-success .toast-icon {
    background-color: #22c55e;
}

.toast.toast-error .toast-icon {
    background-color: #ef4444;
}

.toast.toast-warning .toast-icon {
    background-color: #f59e0b;
}

.toast.toast-info .toast-icon {
    background-color: #3b82f6;
}

@keyframes toastSlideIn {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    0% {
        opacity: 1;
        transform: translateX(0);
    }

    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Quill Editor Custom Styles */
.ql-container {
    font-family: var(--font-ibm);
    font-size: 14px;
    border: none !important;
    border-top: 1px solid var(--color-border) !important;
}

.ql-toolbar {
    border: none !important;
    border-bottom: 1px solid var(--color-border) !important;
    background-color: rgba(22, 22, 22, 0.02);
    border-radius: 8px 8px 0 0;
}

.ql-editor {
    min-height: 120px;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 0 0 8px 8px;
}

.ql-editor.ql-blank::before {
    font-family: var(--font-ibm);
    font-style: normal;
    color: var(--color-muted);
}

.ql-snow .ql-stroke {
    stroke: var(--color-primary);
}

.ql-snow .ql-fill {
    fill: var(--color-primary);
}

.ql-snow .ql-picker {
    color: var(--color-primary);
}

.ql-snow.ql-toolbar button:hover,
.ql-snow .ql-toolbar button:hover,
.ql-snow.ql-toolbar button:focus,
.ql-snow .ql-toolbar button:focus,
.ql-snow.ql-toolbar .ql-picker-label:hover,
.ql-snow .ql-toolbar .ql-picker-label:hover {
    color: var(--color-primary);
}

.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow .ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button:focus .ql-stroke,
.ql-snow .ql-toolbar button:focus .ql-stroke {
    stroke: var(--color-primary);
}

.ql-snow.ql-toolbar button.ql-active,
.ql-snow .ql-toolbar button.ql-active {
    background-color: var(--color-hover);
}

/* Rich text content display styles */
.prose ul,
.prose ol {
    padding-left: 1.5em;
    margin: 0.5em 0;
}

.prose ul {
    list-style-type: disc;
}

.prose ol {
    list-style-type: decimal;
}

.prose li {
    margin: 0.25em 0;
}

.prose a {
    color: #3b82f6;
    text-decoration: underline;
}

.prose strong,
.prose b {
    font-weight: 600;
}

.prose em,
.prose i {
    font-style: italic;
}

.prose p {
    margin: 0.5em 0;
}

.prose p:first-child {
    margin-top: 0;
}

.prose p:last-child {
    margin-bottom: 0;
}

/* Quill.js nested list indentation - applies to both editor and display */
.prose .ql-indent-1,
.ql-editor .ql-indent-1 {
    margin-left: 1.5em;
}

.prose .ql-indent-2,
.ql-editor .ql-indent-2 {
    margin-left: 3em;
}

.prose .ql-indent-3,
.ql-editor .ql-indent-3 {
    margin-left: 4.5em;
}

.prose .ql-indent-4,
.ql-editor .ql-indent-4 {
    margin-left: 6em;
}

.prose .ql-indent-5,
.ql-editor .ql-indent-5 {
    margin-left: 7.5em;
}

.prose .ql-indent-6,
.ql-editor .ql-indent-6 {
    margin-left: 9em;
}

.prose .ql-indent-7,
.ql-editor .ql-indent-7 {
    margin-left: 10.5em;
}

.prose .ql-indent-8,
.ql-editor .ql-indent-8 {
    margin-left: 12em;
}

/* Ensure nested list items show correct bullet/number style */
.prose li.ql-indent-1 {
    list-style-type: circle;
}

.prose li.ql-indent-2 {
    list-style-type: square;
}

.prose li.ql-indent-3 {
    list-style-type: disc;
}

.prose li.ql-indent-4 {
    list-style-type: circle;
}

.prose li.ql-indent-5 {
    list-style-type: square;
}

/* =====================================================
   PROJECT CONTEXT SWITCHER
   ===================================================== */

.zos-ctx-btn {
    cursor: pointer;
    background: rgba(22, 22, 22, 0.03);
    transition: all 0.2s ease;
    min-height: 40px;
}

.zos-ctx-btn:hover {
    background: rgba(22, 22, 22, 0.02);
}

/* Active state — project is focused */
.zos-ctx-active {
    background: rgba(22, 22, 22, 0.03);
}

/* Dropdown animation */
#project-context-dropdown {
    animation: searchSlideIn 0.15s cubic-bezier(0.21, 1.02, 0.73, 1);
}

/* =====================================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ===================================================== */

/* Mobile and Tablet Breakpoint (max-width: 768px) */
@media (max-width: 768px) {
    /* Sidebar Mobile Override - handled by Tailwind classes in portal.php */

    /* Project Context Switcher - compact on mobile */
    .zos-ctx-btn > div {
        display: none;
    }

    .zos-ctx-btn > span:last-child {
        display: none;
    }

    .zos-ctx-btn {
        padding: 6px 8px;
        max-width: 44px !important;
    }

    #project-context-dropdown {
        left: -8px;
        width: calc(100vw - 24px);
        max-width: 320px;
    }

    /* Prevent scroll when sidebar is open */
    body.overflow-hidden {
        overflow: hidden;
    }

    /* Table Responsive - Horizontal Scroll */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .table-responsive table {
        min-width: 700px;
    }

    /* Content Padding Adjustments */
    #main-content {
        padding: 1.5rem !important;
        overflow-x: hidden;
        max-width: 100%;
    }

    /* CRITICAL: Prevent horizontal overflow on mobile */
    html,
    body {
        overflow-x: hidden !important;
        max-width: 100vw;
    }

    #zatelital-app {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Fix flex containers that cause overflow - EXCLUDE topbar header */
    #main-content .flex.items-start.justify-between,
    #main-content .flex.items-center.justify-between {
        flex-wrap: wrap;
        gap: 1rem;
    }

    /* Page headers - stack on mobile - EXCLUDE topbar header */
    #main-content .flex.items-start.justify-between>div:last-child,
    #main-content .flex.items-center.justify-between>div:last-child {
        width: 100%;
    }

    /* Fix grids that overflow */
    .grid {
        max-width: 100%;
    }

    /* Hide text on small buttons, show only icons */
    .flex.items-center.gap-2>span.font-ibm {
        display: none;
    }

    /* But keep text visible for main action buttons */
    button[class*="bg-"] .font-ibm {
        display: inline !important;
    }

    /* Grid Adjustments for Cards */
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Kanban Horizontal Scroll */
    .kanban-container {
        display: flex !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 1rem;
        padding-bottom: 1rem;
        margin: 0 -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .kanban-container>div {
        flex: 0 0 280px;
        scroll-snap-align: start;
    }

    /* Touch-Friendly Targets (44px minimum) */
    button,
    .clickable,
    nav a {
        min-height: 44px;
    }

    /* Modal Adjustments */
    .modal-content,
    [class*="max-w-2xl"],
    [class*="max-w-xl"] {
        max-width: calc(100vw - 2rem) !important;
        margin: 0.5rem !important;
    }

    /* Form Grid - Stack on Mobile */
    .form-grid-2,
    [class*="grid-cols-2"]:not(.stats-grid) {
        grid-template-columns: 1fr !important;
    }
}

/* Small Mobile Breakpoint (max-width: 480px) */
@media (max-width: 480px) {

    /* Even smaller padding on very small screens */
    #main-content {
        padding: 1.25rem !important;
    }

    /* Stats grid to single column */
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    /* Smaller text for headers on mobile */
    .page-title,
    [class*="text-2xl"] {
        font-size: 1.25rem !important;
    }

    /* Compact buttons on small screens */
    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-group button {
        width: 100%;
    }
}

/* Tablet Breakpoint (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {

    /* Adjust sidebar if needed */
    #sidebar {
        width: 240px;
    }

    main {
        margin-left: 240px !important;
    }

    /* Kanban 2 columns on tablet */
    .kanban-container {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        overflow-x: visible;
    }
}

/* Print Styles */
@media print {

    #sidebar,
    #topbar,
    #hamburger-btn,
    #sidebar-overlay {
        display: none !important;
    }

    main {
        margin-left: 0 !important;
    }
}

/* =====================================================
   GLOBAL SEARCH (Ctrl+K / Cmd+K)
   ===================================================== */

@keyframes searchFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes searchSlideIn {
    from { opacity: 0; transform: translateY(-24px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes searchSpinnerAnim {
    to { transform: rotate(360deg); }
}

.zos-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(22, 22, 22, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: min(20vh, 140px);
    animation: searchFadeIn 0.15s ease;
}

.zos-search-modal {
    width: 100%;
    max-width: 640px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(22, 22, 22, 0.08);
    overflow: hidden;
    animation: searchSlideIn 0.2s cubic-bezier(0.21, 1.02, 0.73, 1);
    display: flex;
    flex-direction: column;
    max-height: 70vh;
}

/* ── Input ── */
.zos-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(22, 22, 22, 0.08);
}

.zos-search-icon {
    font-size: 22px !important;
    width: 22px !important;
    height: 22px !important;
    color: var(--color-muted);
    flex-shrink: 0;
}

.zos-search-input-wrap input {
    flex: 1;
    border: none !important;
    outline: none !important;
    font-family: var(--font-ibm);
    font-size: 16px;
    color: var(--color-primary);
    background: transparent;
    padding: 0;
    min-width: 0;
}

.zos-search-input-wrap input::placeholder {
    color: var(--color-muted);
}

.zos-search-kbd {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--color-muted);
    background: rgba(22, 22, 22, 0.06);
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    text-transform: uppercase;
}

/* ── Results ── */
.zos-search-results {
    overflow-y: auto;
    padding: 8px;
    flex: 1;
    min-height: 0;
}

.zos-search-group-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 12px 6px;
}

.zos-search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.zos-search-result-item:hover,
.zos-search-result-item.zos-search-selected {
    background: rgba(22, 22, 22, 0.05);
}

.zos-search-result-icon {
    font-size: 20px !important;
    width: 20px !important;
    height: 20px !important;
    color: var(--color-muted);
    flex-shrink: 0;
}

.zos-search-result-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.zos-search-result-label {
    font-family: var(--font-ibm);
    font-size: 14px;
    color: var(--color-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zos-search-result-subtitle {
    font-family: var(--font-ibm);
    font-size: 12px;
    color: var(--color-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zos-search-result-status {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 9999px;
    flex-shrink: 0;
    background: rgba(22, 22, 22, 0.06);
    color: rgba(22, 22, 22, 0.5);
}

/* Status colors for search results */
.zos-search-status-in-progress,
.zos-search-status-in_progress,
.zos-search-status-active,
.zos-search-status-en-progreso {
    background: rgba(59, 130, 246, 0.1);
    color: rgb(37, 99, 235);
}

.zos-search-status-completed,
.zos-search-status-completado,
.zos-search-status-done,
.zos-search-status-paid,
.zos-search-status-pagada,
.zos-search-status-accepted {
    background: rgba(34, 197, 94, 0.1);
    color: rgb(22, 163, 74);
}

.zos-search-status-pending,
.zos-search-status-pendiente,
.zos-search-status-review,
.zos-search-status-draft,
.zos-search-status-borrador {
    background: rgba(234, 179, 8, 0.1);
    color: rgb(202, 138, 4);
}

.zos-search-status-cancelled,
.zos-search-status-cancelado,
.zos-search-status-lost,
.zos-search-status-overdue {
    background: rgba(239, 68, 68, 0.1);
    color: rgb(220, 38, 38);
}

/* ── Highlight match ── */
.zos-search-highlight {
    background: rgba(234, 179, 8, 0.25);
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}

/* ── Empty & Loading states ── */
.zos-search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 20px;
    text-align: center;
    color: var(--color-muted);
    font-family: var(--font-ibm);
    font-size: 14px;
}

.zos-search-empty .material-icons-outlined {
    font-size: 36px !important;
    width: 36px !important;
    height: 36px !important;
    opacity: 0.5;
}

.zos-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    color: var(--color-muted);
    font-family: var(--font-ibm);
    font-size: 14px;
}

.zos-search-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(22, 22, 22, 0.1);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: searchSpinnerAnim 0.6s linear infinite;
}

/* ── Footer ── */
.zos-search-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    border-top: 1px solid rgba(22, 22, 22, 0.08);
    background: rgba(22, 22, 22, 0.02);
}

.zos-search-footer-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-ibm);
    font-size: 12px;
    color: var(--color-muted);
}

.zos-search-kbd-sm {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--color-muted);
    background: rgba(22, 22, 22, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.03em;
}

/* ── Topbar Search Button ── */
.zos-search-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid rgba(22, 22, 22, 0.1);
    border-radius: 8px;
    background: rgba(22, 22, 22, 0.02);
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 200px;
}

.zos-search-trigger:hover {
    border-color: rgba(22, 22, 22, 0.2);
    background: rgba(22, 22, 22, 0.04);
}

.zos-search-trigger-text {
    font-family: var(--font-ibm);
    font-size: 13px;
    color: var(--color-muted);
    flex: 1;
}

.zos-search-trigger-kbd {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--color-muted);
    background: rgba(22, 22, 22, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .zos-search-overlay {
        padding-top: 16px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .zos-search-modal {
        max-height: 85vh;
        border-radius: 12px;
    }

    .zos-search-trigger {
        min-width: auto;
        padding: 6px 8px;
    }

    .zos-search-trigger-text {
        display: none;
    }

    .zos-search-trigger-kbd {
        display: none;
    }

    .zos-search-footer {
        display: none;
    }
}

/* =====================================================
   SMART LINK CHIPS (Rich Link Previews)
   ===================================================== */

.zos-link-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px 2px 6px;
    margin: 1px 2px;
    background: rgba(22, 22, 22, 0.04);
    border: 1px solid rgba(22, 22, 22, 0.1);
    border-radius: 6px;
    text-decoration: none !important;
    color: var(--color-primary) !important;
    font-family: var(--font-ibm);
    font-size: 13px;
    line-height: 1.6;
    max-width: 360px;
    vertical-align: baseline;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.zos-link-chip:hover {
    background: rgba(22, 22, 22, 0.08);
    border-color: rgba(22, 22, 22, 0.25);
    box-shadow: 0 1px 3px rgba(22, 22, 22, 0.08);
    transform: translateY(-0.5px);
}

.zos-link-chip:active {
    transform: translateY(0);
    background: rgba(22, 22, 22, 0.1);
}

.zos-link-chip__favicon {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    flex-shrink: 0;
    object-fit: contain;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.zos-link-chip--loaded .zos-link-chip__favicon {
    opacity: 1;
}

.zos-link-chip__title {
    font-weight: 500;
    color: var(--color-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 240px;
}

.zos-link-chip__domain {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--color-muted);
    text-transform: lowercase;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    margin-left: 2px;
}

/* Hide domain when title is the same as domain (pre-hydration) */
.zos-link-chip:not(.zos-link-chip--loaded) .zos-link-chip__domain {
    display: none;
}

/* Animate hydration */
@keyframes chipHydrate {
    from {
        background: rgba(22, 22, 22, 0.04);
    }
    50% {
        background: rgba(22, 22, 22, 0.08);
    }
    to {
        background: rgba(22, 22, 22, 0.04);
    }
}

.zos-link-chip--loaded {
    animation: chipHydrate 0.4s ease;
}

/* Responsive: on small screens, truncate more aggressively */
@media (max-width: 768px) {
    .zos-link-chip {
        max-width: 260px;
    }

    .zos-link-chip__title {
        max-width: 160px;
    }

    .zos-link-chip__domain {
        display: none;
    }
}