mailscope 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +68 -0
  3. data/LICENSE.txt +27 -0
  4. data/README.md +210 -0
  5. data/app/assets/mailscope/INTER-LICENSE.txt +92 -0
  6. data/app/assets/mailscope/favicon.svg +6 -0
  7. data/app/assets/mailscope/inter-latin-ext.woff2 +0 -0
  8. data/app/assets/mailscope/inter-latin.woff2 +0 -0
  9. data/app/assets/mailscope/mailscope.css +594 -0
  10. data/app/assets/mailscope/mailscope.js +559 -0
  11. data/app/controllers/mailscope/application_controller.rb +30 -0
  12. data/app/controllers/mailscope/assets_controller.rb +24 -0
  13. data/app/controllers/mailscope/messages_controller.rb +139 -0
  14. data/app/helpers/mailscope/application_helper.rb +124 -0
  15. data/app/views/layouts/mailscope/application.html.erb +30 -0
  16. data/app/views/mailscope/messages/_blank_pane.html.erb +9 -0
  17. data/app/views/mailscope/messages/_list.html.erb +34 -0
  18. data/app/views/mailscope/messages/_list_item.html.erb +39 -0
  19. data/app/views/mailscope/messages/_pane.html.erb +151 -0
  20. data/app/views/mailscope/messages/_rail.html.erb +33 -0
  21. data/app/views/mailscope/messages/_shortcuts.html.erb +21 -0
  22. data/app/views/mailscope/messages/index.html.erb +66 -0
  23. data/app/views/mailscope/shared/_icons.html.erb +58 -0
  24. data/config/locales/mailscope.en.yml +105 -0
  25. data/config/locales/mailscope.pt-BR.yml +105 -0
  26. data/config/routes.rb +24 -0
  27. data/lib/mailscope/body_renderer.rb +142 -0
  28. data/lib/mailscope/configuration.rb +65 -0
  29. data/lib/mailscope/delivery_method.rb +45 -0
  30. data/lib/mailscope/engine.rb +21 -0
  31. data/lib/mailscope/mailbox.rb +39 -0
  32. data/lib/mailscope/message.rb +268 -0
  33. data/lib/mailscope/query.rb +54 -0
  34. data/lib/mailscope/storage/base.rb +35 -0
  35. data/lib/mailscope/storage/filesystem.rb +214 -0
  36. data/lib/mailscope/storage.rb +23 -0
  37. data/lib/mailscope/version.rb +5 -0
  38. data/lib/mailscope.rb +60 -0
  39. metadata +128 -0
@@ -0,0 +1,594 @@
1
+ /* Mailscope — no framework, no reset library, just what the UI needs. */
2
+
3
+ /* Inter, bundled with the gem (SIL OFL 1.1, see INTER-LICENSE.txt). Served
4
+ from the digested asset path next to this file, so it is cached immutably
5
+ and never reaches an external host. */
6
+ @font-face {
7
+ font-family: 'Inter var';
8
+ font-style: normal;
9
+ font-weight: 100 900;
10
+ font-display: swap;
11
+ src: url(inter-latin.woff2) format('woff2');
12
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
13
+ U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
14
+ U+2212, U+2215, U+FEFF, U+FFFD;
15
+ }
16
+ @font-face {
17
+ font-family: 'Inter var';
18
+ font-style: normal;
19
+ font-weight: 100 900;
20
+ font-display: swap;
21
+ src: url(inter-latin-ext.woff2) format('woff2');
22
+ unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
23
+ U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
24
+ U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
25
+ }
26
+
27
+ /* ── tokens ─────────────────────────────────────────────────────────── */
28
+ :root {
29
+ --bg: #f6f7f9;
30
+ --surface: #ffffff;
31
+ --surface-2: #fbfbfd;
32
+ --sunken: #eef0f4;
33
+ --border: #e3e6ec;
34
+ --border-soft: #edeff3;
35
+ --text: #14161c;
36
+ --text-2: #4b5160;
37
+ --muted: #858c9c;
38
+ --accent: #5a5bd6;
39
+ --accent-ink: #ffffff;
40
+ --accent-soft: #eceafd;
41
+ --danger: #d6455a;
42
+ --danger-soft: #fdeced;
43
+ --ok: #129a6a;
44
+ --warn-bg: #fff8e6;
45
+ --warn-border: #f3e2b3;
46
+ --warn-text: #7a5a08;
47
+
48
+ --shadow-sm: 0 1px 2px rgb(16 18 27 / .05);
49
+ --shadow-md: 0 6px 24px -8px rgb(16 18 27 / .18), 0 1px 2px rgb(16 18 27 / .06);
50
+ --radius: 10px;
51
+ --radius-sm: 7px;
52
+
53
+ --rail-w: 250px;
54
+ --list-w: 364px;
55
+ --topbar-h: 56px;
56
+
57
+ --font: 'Inter var', Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
58
+ --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
59
+
60
+ color-scheme: light;
61
+ }
62
+
63
+ @media (prefers-color-scheme: dark) {
64
+ :root:not([data-theme="light"]) { color-scheme: dark; }
65
+ }
66
+ :root[data-theme="dark"] { color-scheme: dark; }
67
+
68
+
69
+ @media (prefers-color-scheme: dark) {
70
+ :root:not([data-theme="light"]) {
71
+ --bg: #0c0e13; --surface: #12151c; --surface-2: #161a22; --sunken: #0f1218;
72
+ --border: #242935; --border-soft: #1c212b;
73
+ --text: #e7e9f0; --text-2: #b3b9c9; --muted: #7b8296;
74
+ --accent: #8b8cf5; --accent-ink: #10121a; --accent-soft: #22233c;
75
+ --danger: #f0687c; --danger-soft: #2c1a1f;
76
+ --ok: #35c48f;
77
+ --warn-bg: #2a2213; --warn-border: #453818; --warn-text: #e8cd8a;
78
+ --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
79
+ --shadow-md: 0 10px 30px -10px rgb(0 0 0 / .6), 0 1px 2px rgb(0 0 0 / .4);
80
+ }
81
+ }
82
+ :root[data-theme="dark"] {
83
+ --bg: #0c0e13; --surface: #12151c; --surface-2: #161a22; --sunken: #0f1218;
84
+ --border: #242935; --border-soft: #1c212b;
85
+ --text: #e7e9f0; --text-2: #b3b9c9; --muted: #7b8296;
86
+ --accent: #8b8cf5; --accent-ink: #10121a; --accent-soft: #22233c;
87
+ --danger: #f0687c; --danger-soft: #2c1a1f;
88
+ --ok: #35c48f;
89
+ --warn-bg: #2a2213; --warn-border: #453818; --warn-text: #e8cd8a;
90
+ --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
91
+ --shadow-md: 0 10px 30px -10px rgb(0 0 0 / .6), 0 1px 2px rgb(0 0 0 / .4);
92
+ }
93
+
94
+ /* ── base ───────────────────────────────────────────────────────────── */
95
+ *, *::before, *::after { box-sizing: border-box; }
96
+
97
+ html, body { height: 100%; }
98
+
99
+ body.ms-body {
100
+ margin: 0;
101
+ background: var(--bg);
102
+ color: var(--text);
103
+ font-family: var(--font);
104
+ font-size: 14px;
105
+ line-height: 1.5;
106
+ font-feature-settings: 'cv05' 1, 'ss03' 1; /* single-storey l, rounded quotes */
107
+ -webkit-font-smoothing: antialiased;
108
+ -moz-osx-font-smoothing: grayscale;
109
+ overflow: hidden;
110
+ }
111
+
112
+ h1, h2, h3, p, dl, dd, figure, ol, ul { margin: 0; padding: 0; }
113
+ ol, ul { list-style: none; }
114
+ a { color: inherit; text-decoration: none; }
115
+ button, input, select { font: inherit; color: inherit; }
116
+ code, pre { font-family: var(--mono); }
117
+
118
+ kbd {
119
+ display: inline-block; min-width: 20px; padding: 1px 5px;
120
+ border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px;
121
+ background: var(--surface-2); color: var(--text-2);
122
+ font-family: var(--mono); font-size: 11px; line-height: 16px; text-align: center;
123
+ }
124
+
125
+ .ms-sr {
126
+ position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
127
+ overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
128
+ }
129
+ .ms-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
130
+ .ms-icon { flex: none; display: block; }
131
+ .ms-muted { color: var(--muted); }
132
+
133
+ :where(a, button, input, [tabindex]):focus-visible {
134
+ outline: 2px solid var(--accent);
135
+ outline-offset: 2px;
136
+ border-radius: var(--radius-sm);
137
+ }
138
+
139
+ /* ── shell ──────────────────────────────────────────────────────────── */
140
+ .ms-app {
141
+ display: grid;
142
+ /* The implicit column would default to `auto`, i.e. the max-content width of
143
+ the topbar, letting a narrow viewport scroll sideways. */
144
+ grid-template-columns: minmax(0, 1fr);
145
+ grid-template-rows: var(--topbar-h) minmax(0, 1fr);
146
+ height: 100dvh;
147
+ overflow: hidden;
148
+ }
149
+
150
+ .ms-main {
151
+ display: grid;
152
+ grid-template-columns: var(--rail-w) minmax(0, var(--list-w)) minmax(0, 1fr);
153
+ min-height: 0;
154
+ min-width: 0;
155
+ }
156
+
157
+ /* ── topbar ─────────────────────────────────────────────────────────── */
158
+ .ms-topbar {
159
+ display: flex; align-items: center; gap: 14px;
160
+ padding: 0 14px;
161
+ background: var(--surface);
162
+ border-bottom: 1px solid var(--border);
163
+ }
164
+
165
+ .ms-brand { display: flex; align-items: center; gap: 9px; flex: none; padding-right: 4px; }
166
+ .ms-brand__mark {
167
+ width: 26px; height: 26px; border-radius: 8px;
168
+ background: var(--accent);
169
+ color: #fff;
170
+ display: grid; place-items: center;
171
+ box-shadow: var(--shadow-sm);
172
+ }
173
+ .ms-brand__name { font-weight: 640; letter-spacing: -.01em; font-size: 14.5px; }
174
+
175
+ .ms-search {
176
+ position: relative; display: flex; align-items: center; gap: 8px;
177
+ flex: 1 1 auto; min-width: 0; max-width: 560px;
178
+ padding: 0 10px;
179
+ height: 34px;
180
+ background: var(--sunken);
181
+ border: 1px solid transparent;
182
+ border-radius: 9px;
183
+ color: var(--muted);
184
+ transition: border-color .12s, background .12s;
185
+ }
186
+ .ms-search:focus-within { background: var(--surface); border-color: var(--accent); }
187
+ .ms-search input {
188
+ flex: 1; min-width: 0; border: 0; background: none; outline: none;
189
+ color: var(--text); font-size: 13.5px;
190
+ }
191
+ .ms-search input::placeholder { color: var(--muted); }
192
+ .ms-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
193
+ .ms-search__kbd { flex: none; }
194
+ .ms-search:focus-within .ms-search__kbd { opacity: 0; }
195
+
196
+ .ms-topbar__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: none; }
197
+
198
+ /* Opens the mailbox rail once it stops fitting beside the list. */
199
+ .ms-topbar .ms-rail-toggle { display: none; }
200
+
201
+ /* ── buttons ────────────────────────────────────────────────────────── */
202
+ .ms-btn {
203
+ display: inline-flex; align-items: center; gap: 6px;
204
+ height: 32px; padding: 0 11px;
205
+ border: 1px solid transparent; border-radius: 8px;
206
+ background: none; color: var(--text-2);
207
+ font-size: 13px; font-weight: 520; cursor: pointer;
208
+ transition: background .12s, color .12s, border-color .12s;
209
+ white-space: nowrap;
210
+ }
211
+ .ms-btn:hover { background: var(--sunken); color: var(--text); }
212
+ .ms-btn:disabled { opacity: .4; cursor: not-allowed; }
213
+ .ms-btn:disabled:hover { background: none; }
214
+ .ms-btn--ghost { padding: 0 8px; }
215
+ .ms-btn--soft { background: var(--sunken); border-color: var(--border); }
216
+ .ms-btn--danger { color: var(--danger); }
217
+ .ms-btn--danger:hover { background: var(--danger-soft); color: var(--danger); }
218
+ .ms-btn--danger-ghost:hover { background: var(--danger-soft); color: var(--danger); }
219
+
220
+ .ms-link {
221
+ border: 0; background: none; padding: 0; cursor: pointer;
222
+ color: inherit; font-size: inherit; font-weight: 600; text-decoration: underline;
223
+ text-underline-offset: 2px;
224
+ }
225
+
226
+ /* live toggle */
227
+ .ms-live {
228
+ display: inline-flex; align-items: center; gap: 6px;
229
+ height: 32px; padding: 0 10px;
230
+ border-radius: 8px; cursor: pointer;
231
+ font-size: 12.5px; color: var(--muted); user-select: none;
232
+ }
233
+ .ms-live:hover { background: var(--sunken); }
234
+ .ms-live input { position: absolute; opacity: 0; pointer-events: none; }
235
+ .ms-live__dot {
236
+ width: 7px; height: 7px; border-radius: 50%;
237
+ background: var(--muted); transition: background .15s, box-shadow .15s;
238
+ }
239
+ .ms-live:has(input:checked) { color: var(--text-2); }
240
+ .ms-live:has(input:checked) .ms-live__dot {
241
+ background: var(--ok);
242
+ box-shadow: 0 0 0 3px color-mix(in oklab, var(--ok) 22%, transparent);
243
+ animation: ms-pulse 2.4s ease-in-out infinite;
244
+ }
245
+ @keyframes ms-pulse {
246
+ 0%, 100% { box-shadow: 0 0 0 3px color-mix(in oklab, var(--ok) 22%, transparent); }
247
+ 50% { box-shadow: 0 0 0 5px color-mix(in oklab, var(--ok) 8%, transparent); }
248
+ }
249
+
250
+ /* The button shows the mode a click would take you to. */
251
+ [data-theme-icon] { display: none; }
252
+ :root[data-theme="dark"] [data-theme-icon="light"] { display: block; }
253
+ :root[data-theme="light"] [data-theme-icon="dark"] { display: block; }
254
+ :root[data-theme="system"] [data-theme-icon="dark"] { display: block; }
255
+ @media (prefers-color-scheme: dark) {
256
+ :root[data-theme="system"] [data-theme-icon="dark"] { display: none; }
257
+ :root[data-theme="system"] [data-theme-icon="light"] { display: block; }
258
+ }
259
+
260
+ /* ── rail (mailboxes) ───────────────────────────────────────────────── */
261
+ .ms-rail {
262
+ display: flex; flex-direction: column; min-height: 0;
263
+ padding: 12px 10px 0;
264
+ background: var(--surface-2);
265
+ border-right: 1px solid var(--border);
266
+ overflow-y: auto;
267
+ }
268
+ .ms-rail__section + .ms-rail__section { margin-top: 20px; }
269
+ .ms-rail__title {
270
+ padding: 0 8px 6px;
271
+ font-size: 10.5px; font-weight: 680; letter-spacing: .07em; text-transform: uppercase;
272
+ color: var(--muted);
273
+ }
274
+ .ms-rail__hint { padding: 6px 8px; font-size: 12.5px; color: var(--muted); }
275
+
276
+ .ms-box {
277
+ display: flex; align-items: center; gap: 9px;
278
+ padding: 7px 8px; margin-bottom: 1px;
279
+ border-radius: 8px; color: var(--text-2);
280
+ transition: background .1s, color .1s;
281
+ }
282
+ .ms-box:hover { background: var(--sunken); color: var(--text); }
283
+ .ms-box.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 560; }
284
+ .ms-box__icon { display: grid; place-items: center; width: 22px; height: 22px; flex: none; opacity: .8; }
285
+ .ms-box__label { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
286
+ .ms-box__name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
287
+ .ms-box__addr { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
288
+ .ms-box.is-active .ms-box__addr { color: color-mix(in oklab, var(--accent) 70%, var(--muted)); }
289
+ .ms-box__count {
290
+ flex: none; min-width: 20px; padding: 1px 6px;
291
+ border-radius: 20px; background: var(--sunken); color: var(--muted);
292
+ font-size: 11px; font-variant-numeric: tabular-nums; text-align: center;
293
+ }
294
+ .ms-box.is-active .ms-box__count { background: color-mix(in oklab, var(--accent) 16%, transparent); color: var(--accent); }
295
+
296
+ .ms-rail__footer {
297
+ margin-top: auto; padding: 12px 8px;
298
+ display: flex; flex-direction: column; gap: 2px;
299
+ font-size: 11px; color: var(--muted);
300
+ border-top: 1px solid var(--border-soft);
301
+ }
302
+ .ms-rail__path { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
303
+
304
+ /* avatars */
305
+ .ms-avatar {
306
+ flex: none; display: grid; place-items: center;
307
+ border-radius: 50%;
308
+ background: hsl(var(--avatar-hue) 58% 47%);
309
+ color: #fff; font-weight: 640; letter-spacing: -.02em;
310
+ }
311
+ .ms-avatar--sm { width: 22px; height: 22px; font-size: 9.5px; }
312
+ .ms-avatar--md { width: 34px; height: 34px; font-size: 12.5px; }
313
+
314
+ /* ── message list ───────────────────────────────────────────────────── */
315
+ .ms-list {
316
+ display: flex; flex-direction: column; min-height: 0; min-width: 0;
317
+ background: var(--surface);
318
+ border-right: 1px solid var(--border);
319
+ }
320
+ .ms-list__head {
321
+ flex: none; display: flex; align-items: center;
322
+ height: 38px; padding: 0 14px;
323
+ border-bottom: 1px solid var(--border-soft);
324
+ font-size: 12px; color: var(--muted);
325
+ }
326
+ .ms-list__count strong { color: var(--text-2); font-variant-numeric: tabular-nums; }
327
+ .ms-chip {
328
+ display: inline-flex; align-items: center; gap: 3px;
329
+ margin-left: 8px; padding: 1px 7px;
330
+ border-radius: 20px; background: var(--sunken); color: var(--text-2); font-size: 11px;
331
+ }
332
+ .ms-chip:hover { background: var(--danger-soft); color: var(--danger); }
333
+
334
+ .ms-list__items { flex: 1; min-height: 0; overflow-y: auto; outline: none; }
335
+ .ms-list__items:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
336
+
337
+ .ms-item { position: relative; border-bottom: 1px solid var(--border-soft); }
338
+ .ms-item__link { display: flex; gap: 10px; padding: 11px 14px 12px; }
339
+ .ms-item:hover { background: var(--surface-2); }
340
+ .ms-item.is-selected { background: var(--accent-soft); }
341
+ .ms-item.is-selected::before {
342
+ content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2.5px; background: var(--accent);
343
+ }
344
+ .ms-item__body { flex: 1; min-width: 0; }
345
+ .ms-item__row { display: flex; align-items: baseline; gap: 8px; }
346
+ .ms-item__from {
347
+ flex: 1; min-width: 0; font-weight: 600; font-size: 13px; color: var(--text);
348
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
349
+ }
350
+ .ms-item time { flex: none; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
351
+ .ms-item__subject {
352
+ margin-top: 1px; font-size: 13px; color: var(--text-2);
353
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
354
+ }
355
+ .ms-item__row--meta { margin-top: 4px; gap: 6px; }
356
+ .ms-item__to {
357
+ flex: 1; min-width: 0; font-size: 11.5px; color: var(--muted);
358
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
359
+ }
360
+ .ms-item__badges { flex: none; display: flex; gap: 4px; }
361
+ .ms-badge {
362
+ display: inline-flex; align-items: center; gap: 3px;
363
+ padding: 0 5px; height: 16px;
364
+ border-radius: 4px; background: var(--sunken); color: var(--muted);
365
+ font-size: 9.5px; font-weight: 640; letter-spacing: .03em;
366
+ }
367
+ .ms-badge--html { background: color-mix(in oklab, var(--accent) 14%, transparent); color: var(--accent); }
368
+ .ms-item__preview {
369
+ margin-top: 5px; font-size: 12px; color: var(--muted); line-height: 1.4; overflow-wrap: anywhere;
370
+ display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
371
+ }
372
+
373
+ .ms-item__delete {
374
+ position: absolute; top: 8px; right: 8px;
375
+ display: grid; place-items: center; width: 24px; height: 24px;
376
+ border: 0; border-radius: 6px; background: var(--surface); color: var(--muted);
377
+ opacity: 0; cursor: pointer; transition: opacity .1s, color .1s, background .1s;
378
+ box-shadow: var(--shadow-sm);
379
+ }
380
+ .ms-item:hover .ms-item__delete, .ms-item__delete:focus-visible { opacity: 1; }
381
+ .ms-item__delete:hover { background: var(--danger-soft); color: var(--danger); }
382
+
383
+ /* ── pane ───────────────────────────────────────────────────────────── */
384
+ .ms-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
385
+ .ms-message { display: flex; flex-direction: column; min-height: 0; flex: 1; }
386
+
387
+ .ms-message__head { flex: none; padding: 16px 20px 12px; background: var(--surface); border-bottom: 1px solid var(--border-soft); }
388
+ .ms-message__title { display: flex; align-items: flex-start; gap: 12px; }
389
+ .ms-message__title h1 {
390
+ flex: 1; min-width: 0;
391
+ font-size: 17px; font-weight: 640; letter-spacing: -.01em; line-height: 1.3;
392
+ }
393
+ .ms-message__tools { flex: none; display: flex; gap: 2px; }
394
+
395
+ /* Sender block — who / to whom / when, the way a mail client shows it. */
396
+ .ms-sender { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; }
397
+ .ms-sender__body { flex: 1; min-width: 0; }
398
+ .ms-sender__line { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
399
+ .ms-sender__line--sub { margin-top: 1px; }
400
+ .ms-sender__name { font-weight: 620; font-size: 13.5px; color: var(--text); white-space: nowrap; }
401
+ .ms-sender__addr {
402
+ flex: 0 1 auto; min-width: 0; font-size: 12.5px; color: var(--muted);
403
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
404
+ }
405
+ .ms-sender__date { margin-left: auto; flex: none; padding-left: 10px; font-size: 12px; color: var(--muted); }
406
+ .ms-sender__to {
407
+ flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-2);
408
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
409
+ }
410
+
411
+ .ms-sender__facts {
412
+ margin-top: 3px; gap: 6px; flex-wrap: wrap;
413
+ font-size: 11.5px; color: var(--muted);
414
+ }
415
+ .ms-sender__facts > * + *::before { content: "·"; margin-right: 6px; color: var(--border); }
416
+ .ms-sender__facts code { font-size: 11px; background: var(--sunken); padding: 1px 5px; border-radius: 4px; }
417
+
418
+ /* tabs */
419
+ .ms-tabs {
420
+ flex: none; display: flex; align-items: center; gap: 2px;
421
+ padding: 0 14px; height: 42px;
422
+ background: var(--surface); border-bottom: 1px solid var(--border);
423
+ }
424
+ .ms-tab {
425
+ position: relative; height: 42px; padding: 0 11px;
426
+ border: 0; background: none; cursor: pointer;
427
+ color: var(--muted); font-size: 13px; font-weight: 540;
428
+ }
429
+ .ms-tab:hover { color: var(--text); }
430
+ .ms-tab.is-active { color: var(--accent); }
431
+ .ms-tab.is-active::after {
432
+ content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px;
433
+ background: var(--accent); border-radius: 2px 2px 0 0;
434
+ }
435
+ .ms-tab__count {
436
+ margin-left: 4px; padding: 0 5px; border-radius: 10px;
437
+ background: var(--sunken); font-size: 10.5px; font-variant-numeric: tabular-nums;
438
+ }
439
+ .ms-tabs__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
440
+
441
+ .ms-segmented { display: flex; padding: 2px; gap: 1px; background: var(--sunken); border-radius: 8px; }
442
+ .ms-segmented__btn {
443
+ display: grid; place-items: center; width: 27px; height: 24px;
444
+ border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer;
445
+ transition: background .1s, color .1s;
446
+ }
447
+ .ms-segmented__btn:hover { color: var(--text); }
448
+ .ms-segmented__btn.is-active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
449
+
450
+ /* switch */
451
+ .ms-switch { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
452
+ .ms-switch input { position: absolute; opacity: 0; pointer-events: none; }
453
+ .ms-switch__track {
454
+ width: 30px; height: 17px; padding: 2px;
455
+ border-radius: 20px; background: var(--sunken); border: 1px solid var(--border);
456
+ transition: background .15s, border-color .15s;
457
+ }
458
+ .ms-switch__thumb {
459
+ display: block; width: 11px; height: 11px; border-radius: 50%;
460
+ background: var(--muted); transition: transform .15s, background .15s;
461
+ }
462
+ .ms-switch:has(input:checked) .ms-switch__track { background: var(--accent); border-color: var(--accent); }
463
+ .ms-switch:has(input:checked) .ms-switch__thumb { transform: translateX(13px); background: #fff; }
464
+ .ms-switch__label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
465
+ .ms-switch:hover .ms-switch__label { color: var(--text-2); }
466
+
467
+ /* notice */
468
+ .ms-notice {
469
+ flex: none; display: flex; align-items: center; gap: 8px;
470
+ padding: 7px 16px;
471
+ background: var(--warn-bg); border-bottom: 1px solid var(--warn-border);
472
+ color: var(--warn-text); font-size: 12.5px;
473
+ }
474
+ .ms-notice .ms-link { margin-left: auto; }
475
+
476
+ /* panels */
477
+ .ms-panels { flex: 1; min-height: 0; position: relative; }
478
+ .ms-panel { position: absolute; inset: 0; display: none; overflow: auto; }
479
+ .ms-panel.is-active { display: block; }
480
+
481
+ .ms-frame { height: 100%; display: flex; justify-content: center; background: var(--bg); padding: 14px; }
482
+ .ms-frame iframe {
483
+ width: 100%; max-width: 100%; height: 100%;
484
+ background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
485
+ box-shadow: var(--shadow-md);
486
+ }
487
+ .ms-frame[data-viewport] iframe { transition: max-width .2s ease; }
488
+
489
+ .ms-source {
490
+ margin: 0; padding: 16px 20px;
491
+ font-size: 12px; line-height: 1.6; color: var(--text-2);
492
+ white-space: pre-wrap; word-break: break-word;
493
+ }
494
+
495
+ .ms-headers { width: 100%; border-collapse: collapse; font-size: 12.5px; }
496
+ .ms-headers th, .ms-headers td { padding: 7px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border-soft); }
497
+ .ms-headers th { width: 190px; color: var(--muted); font-weight: 560; font-family: var(--mono); font-size: 11.5px; }
498
+ .ms-headers td { color: var(--text-2); word-break: break-word; font-family: var(--mono); font-size: 11.5px; }
499
+ .ms-headers tr:hover { background: var(--surface-2); }
500
+
501
+ .ms-attachments { padding: 12px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
502
+ .ms-attachments a {
503
+ display: flex; align-items: center; gap: 11px; padding: 10px 12px;
504
+ background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
505
+ color: var(--text-2); transition: border-color .1s, box-shadow .1s;
506
+ }
507
+ .ms-attachments a:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
508
+ .ms-attachments__ext {
509
+ flex: none; display: grid; place-items: center; width: 34px; height: 34px;
510
+ border-radius: 8px; background: var(--accent-soft); color: var(--accent);
511
+ font-size: 10px; font-weight: 700;
512
+ }
513
+ .ms-attachments__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
514
+ .ms-attachments__name { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
515
+ .ms-attachments__meta { font-size: 11px; color: var(--muted); }
516
+
517
+ /* ── empty states ───────────────────────────────────────────────────── */
518
+ .ms-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 40px 24px; }
519
+ .ms-empty--list { flex: 1; }
520
+ .ms-empty--pane { height: 100%; }
521
+ .ms-empty__icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 6px; border-radius: 14px; background: var(--sunken); color: var(--muted); }
522
+ .ms-empty__icon--lg { width: 66px; height: 66px; border-radius: 18px; }
523
+ .ms-empty__title { font-size: 14.5px; font-weight: 620; color: var(--text); }
524
+ .ms-empty__text { font-size: 13px; color: var(--muted); line-height: 1.6; }
525
+ .ms-empty .ms-btn { margin-top: 10px; }
526
+
527
+ /* ── modal ──────────────────────────────────────────────────────────── */
528
+ .ms-modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; }
529
+ .ms-modal[hidden] { display: none; }
530
+ .ms-modal__backdrop { position: absolute; inset: 0; background: rgb(10 12 18 / .5); backdrop-filter: blur(2px); }
531
+ .ms-modal__card {
532
+ position: relative; width: min(420px, calc(100vw - 32px));
533
+ background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
534
+ box-shadow: var(--shadow-md); overflow: hidden;
535
+ }
536
+ .ms-modal__card header { display: flex; align-items: center; padding: 14px 12px 14px 18px; border-bottom: 1px solid var(--border-soft); }
537
+ .ms-modal__card h2 { flex: 1; font-size: 14.5px; font-weight: 620; }
538
+ .ms-shortcuts { padding: 8px 18px 18px; }
539
+ .ms-shortcuts > div { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
540
+ .ms-shortcuts dt { flex: none; width: 88px; display: flex; gap: 4px; }
541
+ .ms-shortcuts dd { font-size: 13px; color: var(--text-2); }
542
+
543
+ /* ── toast ──────────────────────────────────────────────────────────── */
544
+ .ms-toast {
545
+ position: fixed; left: 50%; bottom: 22px; z-index: 50;
546
+ transform: translate(-50%, 12px);
547
+ display: flex; align-items: center; gap: 10px;
548
+ padding: 9px 14px;
549
+ background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
550
+ box-shadow: var(--shadow-md);
551
+ font-size: 13px; color: var(--text);
552
+ opacity: 0; pointer-events: none;
553
+ transition: opacity .16s, transform .16s;
554
+ }
555
+ .ms-toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
556
+ .ms-toast button { border: 0; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 600; cursor: pointer; }
557
+
558
+ /* ── loading ────────────────────────────────────────────────────────── */
559
+ .ms-app.is-busy .ms-list__items { opacity: .55; transition: opacity .12s; }
560
+
561
+ /* ── responsive ─────────────────────────────────────────────────────── */
562
+ @media (max-width: 1180px) {
563
+ :root { --rail-w: 200px; --list-w: 320px; }
564
+ }
565
+ @media (max-width: 980px) {
566
+ .ms-main { grid-template-columns: minmax(0, var(--list-w)) minmax(0, 1fr); }
567
+ .ms-topbar .ms-rail-toggle { display: inline-flex; }
568
+ .ms-rail { display: none; }
569
+ .ms-rail.is-open {
570
+ display: flex; position: fixed; top: var(--topbar-h); bottom: 0; left: 0; z-index: 30;
571
+ width: 260px; box-shadow: var(--shadow-md);
572
+ }
573
+ }
574
+ @media (max-width: 760px) {
575
+ .ms-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 40dvh) minmax(0, 1fr); }
576
+ .ms-list { border-right: 0; border-bottom: 1px solid var(--border); }
577
+ .ms-search { max-width: none; }
578
+ .ms-brand, .ms-live__label { display: none; }
579
+ .ms-message__head { padding: 12px 14px 10px; }
580
+ .ms-sender__addr { display: none; }
581
+ .ms-tabs { overflow-x: auto; padding: 0 8px; }
582
+ .ms-tabs__right { display: none; }
583
+ .ms-frame { padding: 0; }
584
+ .ms-frame iframe { border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; }
585
+ }
586
+ @media (max-width: 560px) {
587
+ /* Only the actions that still make sense on a phone. */
588
+ [data-action="shortcuts"], [data-action="refresh"] { display: none; }
589
+ .ms-btn--danger span:not(.ms-sr) { display: none; }
590
+ }
591
+
592
+ @media (prefers-reduced-motion: reduce) {
593
+ *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
594
+ }