File size: 8,787 Bytes
aceb1b2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
/* Annotator search-and-claim sidebar.
   Left-edge toggle (memos owns the right edge).

   Consistency: this consumes the memos design system tokens directly
   (loaded first in base_template_v2.html) so the two sidebars can never
   drift. Literal fallbacks keep this file self-contained if load order
   ever changes. Vanilla CSS, no deps, no build step. */

:root {
    --se-space-1: var(--memo-space-1, 4px);
    --se-space-2: var(--memo-space-2, 8px);
    --se-space-3: var(--memo-space-3, 12px);
    --se-space-4: var(--memo-space-4, 16px);
    --se-space-5: var(--memo-space-5, 24px);
    --se-radius: var(--memo-radius, 8px);
    --se-ink: var(--memo-ink, #1f2330);
    --se-ink-soft: var(--memo-ink-soft, #5b6072);
    --se-line: var(--memo-line, #e4e5ec);
    --se-surface: var(--memo-surface, #ffffff);
    --se-surface-2: var(--memo-surface-2, #f7f8fb);
    --se-accent: var(--memo-accent, #4063b8);
    --se-accent-ink: var(--memo-accent-ink, #ffffff);
    --se-focus: var(--memo-focus, #6c8cff);
    /* Tertiary surface, pressed accent, stronger hairline, disabled ink,
       placeholder, badge neutrals and tokenised shadow ink — so hover/
       active/badge states stop hard-coding the same literals the rest of
       the sidebar system already tokenises (parity with codebook.css). */
    --se-surface-3: var(--memo-surface-3, #eef0f6);
    --se-line-strong: var(--memo-line-strong, #cdd2e4);
    --se-accent-press: var(--memo-accent-press, #36559e);
    --se-disabled: var(--memo-disabled, #aab2cc);
    --se-placeholder: var(--memo-placeholder, #9aa0b4);
    --se-shadow-ink: var(--memo-shadow-ink, 31, 35, 48);
    --se-badge-surface: var(--memo-badge-surface, #eceef4);
    --se-badge-ink: var(--memo-badge-ink, #494f63);
    --se-badge-line: var(--memo-badge-line, #dcdfe9);
    /* Match highlight: a calm tinted-amber wash (the same one intentional
       non-neutral the codebook's stale notice uses), never the action
       blue — emphasis, not a call to action. */
    --se-hit-surface: var(--memo-hit-surface, #fbe7c2);
    --se-hit-ink: var(--memo-hit-ink, #5c4300);
}

.search-panel-toggle {
    position: fixed;
    left: 0;
    top: 42%;
    transform: translateY(-50%);
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: var(--se-space-2);
    min-height: 44px;
    border: 1px solid var(--se-line);
    border-left: none;
    background: var(--se-surface);
    color: var(--se-ink);
    padding: 10px 14px;
    border-radius: 0 var(--se-radius) var(--se-radius) 0;
    box-shadow: 1px 1px 6px rgba(var(--se-shadow-ink), 0.08);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background-color 160ms ease-out, transform 160ms ease-out;
}

.search-panel-toggle:hover {
    background: var(--se-surface-2);
    transform: translateY(-50%) translateX(2px);
}

.search-panel-toggle:active { background: var(--se-surface-3); }

.search-panel {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 360px;
    max-width: 92vw;
    background: var(--se-surface);
    border-right: 1px solid var(--se-line);
    box-shadow: 4px 0 24px rgba(var(--se-shadow-ink), 0.10);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    color: var(--se-ink);
}

.search-panel:not([hidden]) { animation: search-panel-in 200ms ease-out; }

@keyframes search-panel-in {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.search-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--se-space-4);
    border-bottom: 1px solid var(--se-line);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.search-panel-header button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: none;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    color: var(--se-ink-soft);
    transition: background-color 140ms ease-out, color 140ms ease-out;
}

.search-panel-header button:hover {
    background: var(--se-surface-2);
    color: var(--se-ink);
}

.search-form {
    display: flex;
    gap: var(--se-space-2);
    padding: var(--se-space-4);
    border-bottom: 1px solid var(--se-line);
}

.search-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--se-line);
    border-radius: 6px;
    padding: var(--se-space-2) var(--se-space-3);
    font: inherit;
    font-size: 0.9rem;
    color: var(--se-ink);
    transition: border-color 140ms ease-out, box-shadow 140ms ease-out;
}

.search-form input::placeholder { color: var(--se-placeholder); }

.search-form input:focus {
    outline: none;
    border-color: var(--se-focus);
    box-shadow: 0 0 0 3px rgba(108, 140, 255, 0.18);
}

.search-primary {
    border: 1px solid var(--se-accent);
    background: var(--se-accent);
    color: var(--se-accent-ink);
    min-height: 36px;
    padding: 7px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background-color 150ms ease-out, transform 120ms ease-out;
}

.search-primary:hover { background: var(--se-accent-press); }
.search-primary:active { transform: translateY(1px); }
.search-primary:disabled {
    background: var(--se-disabled);
    border-color: var(--se-disabled);
    cursor: progress;
    transform: none;
}

.search-results {
    flex: 1;
    overflow-y: auto;
    padding: var(--se-space-4);
    display: flex;
    flex-direction: column;
    gap: var(--se-space-3);
}

.search-empty,
.search-loading {
    color: var(--se-ink-soft);
    font-size: 0.85rem;
    text-align: center;
    margin-top: var(--se-space-5);
    line-height: 1.5;
}

.search-item {
    border: 1px solid var(--se-line);
    border-radius: var(--se-radius);
    padding: var(--se-space-3) var(--se-space-4);
    background: var(--se-surface-2);
    transition: border-color 140ms ease-out;
}

.search-item:hover { border-color: var(--se-line-strong); }

.search-item .search-snippet {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--se-ink);
    word-break: break-word;
}

/* The matched term, wrapped in <mark> by search.js. A calm tinted wash
   with a slight weight bump — emphasis, not the action accent. Reset the
   UA default so it carries the design-system colours. */
.search-item .search-snippet mark.search-hit {
    background: var(--se-hit-surface);
    color: var(--se-hit-ink);
    font-weight: 600;
    border-radius: 3px;
    padding: 0 2px;
}

.search-item .search-row {
    margin-top: var(--se-space-3);
    display: flex;
    align-items: center;
    gap: var(--se-space-2);
    font-size: 0.72rem;
    color: var(--se-ink-soft);
}

/* Echoes .memo-badge.private — the instance id reads as a neutral badge. */
.search-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: var(--se-badge-surface);
    color: var(--se-badge-ink);
    border: 1px solid var(--se-badge-line);
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.search-claim {
    margin-left: auto;
    border: 1px solid var(--se-accent);
    background: none;
    color: var(--se-accent);
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 5px;
    transition: background-color 140ms ease-out, color 140ms ease-out;
}

.search-claim:hover { background: var(--se-accent); color: var(--se-accent-ink); }
.search-claim:active { background: var(--se-accent-press); border-color: var(--se-accent-press); }
.search-claim:disabled { opacity: 0.55; cursor: progress; }

/* Echoes .memo-badge.shared — a positive, in-queue state. */
.search-claimed {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: var(--se-space-1);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #246b3c;
    background: #e2f1e7;
    border: 1px solid #bcdec8;
    border-radius: 999px;
    padding: 2px 10px;
}

.search-claim-error {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 600;
    color: #b23b3b;
    background: #fbeeee;
    border: 1px solid #f0d2d2;
    border-radius: 5px;
    padding: 4px 10px;
}

.search-panel-toggle:focus-visible,
.search-panel button:focus-visible,
.search-panel input:focus-visible {
    outline: 2px solid var(--se-focus);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .search-panel:not([hidden]) { animation: none; }
    .search-panel-toggle,
    .search-primary,
    .search-claim,
    .search-item,
    .search-panel-header button { transition: none; }
}