:root{font-family:Inter,system-ui,sans-serif;line-height:1.4;--bg-primary: #f4f6fb;--bg-secondary: #ffffff;--bg-tertiary: #f8fafc;--text-primary: #0f172a;--text-secondary: #475569;--text-muted: #94a3b8;--border-color: #e2e8f0;--border-light: #cbd5f5;--shadow: rgba(15, 23, 42, .08);--shadow-strong: rgba(15, 23, 42, .15);--surface: var(--bg-secondary);--surface-secondary: var(--bg-tertiary);--text: var(--text-primary);--border: var(--border-color);--primary: #6366f1;--primary-bg: #eef2ff;--error-bg: #fef2f2;--error-border: #fecaca;--error-text: #991b1b;color:var(--text-primary);background:var(--bg-primary)}[data-theme=dark]{--bg-primary: #0f172a;--bg-secondary: #1e293b;--bg-tertiary: #334155;--text-primary: #f1f5f9;--text-secondary: #cbd5e1;--text-muted: #94a3b8;--border-color: #334155;--border-light: #475569;--shadow: rgba(0, 0, 0, .3);--shadow-strong: rgba(0, 0, 0, .5);--surface: var(--bg-secondary);--surface-secondary: var(--bg-tertiary);--text: var(--text-primary);--border: var(--border-color);--primary: #818cf8;--primary-bg: #312e81;--error-bg: #450a0a;--error-border: #7f1d1d;--error-text: #fca5a5}body{margin:0;background:var(--bg-primary);color:var(--text-primary);transition:background-color .2s ease,color .2s ease}*{box-sizing:border-box}.layout{max-width:1200px;margin:0 auto;padding:2rem 2.5rem 3rem;display:flex;flex-direction:column;gap:1.5rem}.auth-layout{min-height:100vh;justify-content:center}.auth-form{display:flex;flex-direction:column;gap:1rem}.auth-form input{width:100%}header{display:flex;flex-direction:column;gap:.35rem}header h1{margin:0;font-size:2rem}header p{color:var(--text-secondary);margin:0}.eyebrow{text-transform:uppercase;letter-spacing:.08em;font-size:.75rem;color:var(--text-muted);margin:0 0 .1rem}.tabs{display:inline-flex;background:var(--border-color);border-radius:999px;padding:.3rem;gap:.35rem}.tabs button{border:none;background:transparent;padding:.45rem 1.5rem;border-radius:999px;cursor:pointer;font-weight:600;color:var(--text-primary)}.tabs button.active{background:var(--bg-secondary);box-shadow:0 6px 18px var(--shadow-strong)}.panel{background:var(--bg-secondary);border-radius:20px;padding:1.25rem 1.5rem;box-shadow:0 20px 45px var(--shadow);transition:background-color .2s ease,box-shadow .2s ease}.panel.panel-compact{padding:1rem 1.25rem}.panel-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem}.panel-header h2{margin:0}.builder-panel,.corpus-panel{padding:1.5rem}.toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:.75rem;gap:1rem}.token-toolbar h3{margin:.1rem 0 0;font-size:1.1rem}label{display:flex;flex-direction:column;font-weight:600;gap:.35rem;font-size:.9rem}input,select,textarea{border-radius:10px;border:1px solid var(--border-light);padding:.55rem .6rem;font:inherit;background:var(--bg-secondary);color:var(--text-primary);transition:background-color .2s ease,border-color .2s ease,color .2s ease}button{border-radius:10px;border:none;background:linear-gradient(120deg,#4338ca,#6366f1);color:#fff;padding:.5rem 1.25rem;cursor:pointer;font-weight:600;font-size:.95rem}button.secondary{background:transparent;color:#4338ca;border:1px solid rgba(67,56,202,.4)}button.full-width{width:100%;justify-content:center}button.link-button{background:none;border:none;color:#4338ca;padding:0;font-size:.85rem}button.link-button:hover{text-decoration:underline}.user-pill{margin-left:auto;display:flex;gap:1rem;align-items:center;padding:.75rem 1rem;border-radius:16px;background:var(--bg-tertiary);box-shadow:inset 0 0 0 1px var(--border-light);transition:background-color .2s ease,box-shadow .2s ease}button:disabled{opacity:.6;cursor:not-allowed}.token-sequence-panel{display:flex;flex-direction:column;gap:.35rem}.token-track{display:flex;gap:.75rem;overflow-x:auto;padding-bottom:.35rem;scroll-snap-type:x proximity}.token-insert-slot{flex:0 0 auto;display:flex;align-items:stretch}button.token-insert-button{border:1px dashed var(--border-light);background:var(--bg-secondary);color:#4338ca;width:64px;min-height:200px;padding:.25rem;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.15rem;box-shadow:inset 0 0 0 1px var(--border-light);transition:background .15s ease,border-color .15s ease,color .15s ease;font-size:.75rem}button.token-insert-button:hover,button.token-insert-button:focus-visible{background:var(--bg-tertiary);border-color:#a5b4fc;color:#312e81}.token-insert-button__icon{font-size:1rem;font-weight:700;line-height:1}.token-insert-button__text{font-size:.7rem;font-weight:600;color:#475569}.token-track::-webkit-scrollbar{height:8px}.token-track::-webkit-scrollbar-track{background:var(--border-color);border-radius:999px}.token-track::-webkit-scrollbar-thumb{background:#a5b4fc;border-radius:999px}.token-row{flex:0 0 280px;display:flex;flex-direction:column;gap:.5rem;padding:.75rem;border-radius:14px;background:var(--bg-tertiary);border:1px solid var(--border-light);scroll-snap-align:start;transition:background-color .2s ease,border-color .2s ease}.token-row__header{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem}.token-conditions{display:flex;flex-direction:column;gap:.5rem;min-height:0}.token-condition{background:var(--bg-secondary);border-radius:10px;border:1px solid var(--border-color);padding:.55rem;display:flex;flex-direction:column;gap:.35rem;transition:background-color .2s ease,border-color .2s ease}.token-condition__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.45rem}.token-condition label{font-size:.8rem}.token-condition label.checkbox{flex-direction:row;align-items:center;gap:.35rem;font-weight:500}.token-condition label.checkbox input{width:auto}.token-condition .span-2{grid-column:span 2}.query-panel{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:1.5rem}.builder-preview{display:flex;flex-direction:column;gap:.5rem}.query-settings{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:.5rem;margin-top:.5rem}.query-settings input{padding:.4rem .5rem}.scope-builder .toolbar{margin-bottom:.5rem}.scope-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) auto;gap:.5rem;padding:.75rem;border-radius:12px;background:var(--bg-secondary);border:1px solid var(--border-color);margin-bottom:.5rem;transition:background-color .2s ease,border-color .2s ease}.muted{color:var(--text-muted);font-size:.9rem;margin:0}.tag-dropdown{scrollbar-width:thin;scrollbar-color:#cbd5f5 #f1f5f9}.tag-dropdown::-webkit-scrollbar{width:8px}.tag-dropdown::-webkit-scrollbar-track{background:var(--bg-tertiary);border-radius:4px}.tag-dropdown::-webkit-scrollbar-thumb{background:var(--border-light);border-radius:4px}.tag-dropdown::-webkit-scrollbar-thumb:hover{background:var(--text-muted)}.cql-preview{background:var(--bg-secondary);color:var(--text-primary);border:1px solid var(--border);border-radius:6px;padding:.375rem .625rem;font-size:.8125rem;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,monospace;overflow-x:auto;transition:background-color .2s ease,color .2s ease,border-color .2s ease;white-space:nowrap}.actions{display:flex;gap:.75rem;flex-wrap:wrap;margin-top:.75rem}.warnings{color:#c2410c;margin-top:.5rem}table{width:100%;table-layout:fixed;border-collapse:collapse;font-size:.95rem}th,td{border-bottom:1px solid var(--border-color);padding:.5rem;text-align:left;transition:border-color .2s ease}.left-col{text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:30%;direction:rtl}.kwic-col,.kwic{text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:12%}.right{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:30%}.year-col,.genre-col{width:80px;max-width:80px;white-space:nowrap}.title-col{width:140px;max-width:140px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.kwic{font-weight:600;color:#4338ca}.export-actions{margin-top:1rem;display:flex;gap:.75rem;align-items:center;flex-wrap:wrap}.export-actions span{font-weight:600;color:var(--text-secondary)}.frequency-panel{margin-top:1rem;border:1px solid var(--border-color);border-radius:16px;padding:1rem 1.25rem;background:var(--bg-tertiary);display:flex;flex-direction:column;gap:1rem;transition:background-color .2s ease,border-color .2s ease}.frequency-header{display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap;align-items:flex-end}.frequency-body{display:flex;flex-direction:column;gap:1.25rem}.frequency-chart{min-height:260px}.frequency-table-wrapper{overflow-x:auto;max-width:100%;width:fit-content;margin:0 auto}.frequency-table{width:auto;table-layout:auto;border-collapse:collapse;font-size:.9rem;border-spacing:0;--booktabs-strong: var(--border-color, #e5e7eb);--booktabs-mid: var(--border-light, #cbd5f5)}[data-theme=dark] .frequency-table{--booktabs-strong: #94a3b8;--booktabs-mid: #64748b}.frequency-table thead{border-top:2px solid var(--booktabs-strong);border-bottom:1px solid var(--booktabs-mid)}.frequency-table tbody{border-bottom:2px solid var(--booktabs-strong)}.frequency-table th,.frequency-table td{text-align:left;padding:.5rem .75rem;border-bottom:none;transition:border-color .2s ease;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.frequency-table tbody tr:not(:last-child){border-bottom:none}.frequency-table thead th{padding-top:.85rem;padding-bottom:.5rem}.frequency-table tbody td{padding-top:.45rem;padding-bottom:.45rem}.frequency-table tbody tr:first-child td{padding-top:.75rem}.frequency-table tbody tr:last-child td{padding-bottom:.75rem}.frequency-table th:first-child,.frequency-table td:first-child{width:auto}.frequency-table th:nth-child(2),.frequency-table td:nth-child(2){width:auto;text-align:right}.frequency-table th:nth-child(3),.frequency-table td:nth-child(3){width:auto;min-width:180px;text-align:right}.frequency-table th:nth-child(4),.frequency-table td:nth-child(4){text-align:right}.frequency-table th{font-size:.85rem;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.05em}.sort-header{border:none;background:transparent;font:inherit;font-weight:600;color:inherit;display:flex;width:100%;align-items:center;gap:.25rem;cursor:pointer;transition:color .2s ease}.sort-header[data-align=right]{justify-content:flex-end}.sort-header[data-align=left]{justify-content:flex-start}.sort-header:focus-visible{outline:2px solid #4338ca;outline-offset:2px}.sort-indicator{font-size:.85rem;color:#4338ca}.concordance-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:.75rem;margin-bottom:1rem}@media (max-width: 1100px){.builder-grid{grid-template-columns:1fr}.token-row{flex:0 0 280px}.scope-panel{padding:1.25rem}.frequency-body{grid-template-columns:1fr}}@media (max-width: 640px){.layout{padding:1.25rem}.token-condition__grid{grid-template-columns:1fr}.token-condition .span-2{grid-column:span 1}.scope-row{grid-template-columns:1fr}}
