UX changes: - Settings load/save errors now surface as a dismissible banner on the main popup screen, not only inside the collapsed panel. Settings are fetched eagerly (like lock state/connection status already were) instead of lazily on first expand, so a load failure is visible immediately. - The "Adjust loss thresholds" toggle/panel is renamed to "Settings" (with "Loss thresholds" as a subsection heading, since that's the only setting today), and gains a "Done" affordance to collapse it back rather than only being expandable. - Lock status is now the visual hero (a bordered status card with an icon), rather than one item in a flat list alongside connection status and account actions. Visual changes: - style.css rewritten around CSS custom-property design tokens (spacing/radius/font-size scale, semantic colors) with explicit light and dark palettes, instead of hardcoded hex colors reused as-is across both color schemes. - Popup widened 280px -> 320px for breathing room; card-based grouping (status, settings) replaces the previous flat stack of sections. No wire-protocol or messaging-contract changes. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Tn7uDYjTuZEbLPwpEiSCUw
348 lines
6.2 KiB
CSS
348 lines
6.2 KiB
CSS
:root {
|
|
color-scheme: light dark;
|
|
|
|
--color-bg: #ffffff;
|
|
--color-surface: #f6f7f8;
|
|
--color-border: rgba(15, 23, 42, 0.1);
|
|
--color-text: #0f172a;
|
|
--color-muted: rgba(15, 23, 42, 0.6);
|
|
--color-danger: #dc2626;
|
|
--color-danger-bg: rgba(220, 38, 38, 0.1);
|
|
--color-success: #16a34a;
|
|
--color-success-bg: rgba(22, 163, 74, 0.1);
|
|
--color-warning: #ca8a04;
|
|
--color-accent: #0f172a;
|
|
|
|
--space-1: 4px;
|
|
--space-2: 8px;
|
|
--space-3: 12px;
|
|
--space-4: 16px;
|
|
--space-5: 20px;
|
|
|
|
--radius-sm: 6px;
|
|
--radius-md: 10px;
|
|
--radius-lg: 14px;
|
|
|
|
--font-size-xs: 11px;
|
|
--font-size-sm: 12px;
|
|
--font-size-md: 13px;
|
|
--font-size-lg: 16px;
|
|
}
|
|
|
|
@media (prefers-color-scheme: dark) {
|
|
:root {
|
|
--color-bg: #16181d;
|
|
--color-surface: #1f222a;
|
|
--color-border: rgba(255, 255, 255, 0.1);
|
|
--color-text: #f1f5f9;
|
|
--color-muted: rgba(241, 245, 249, 0.6);
|
|
--color-danger: #f87171;
|
|
--color-danger-bg: rgba(248, 113, 113, 0.14);
|
|
--color-success: #4ade80;
|
|
--color-success-bg: rgba(74, 222, 128, 0.14);
|
|
--color-warning: #facc15;
|
|
--color-accent: #f1f5f9;
|
|
}
|
|
}
|
|
|
|
* {
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
width: 320px;
|
|
margin: 0;
|
|
background: var(--color-bg);
|
|
color: var(--color-text);
|
|
font: var(--font-size-md)/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
}
|
|
|
|
.popup {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-4);
|
|
padding: var(--space-4);
|
|
}
|
|
|
|
header {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
justify-content: space-between;
|
|
gap: var(--space-3);
|
|
}
|
|
|
|
header .brand h1 {
|
|
margin: 0;
|
|
font-size: var(--font-size-lg);
|
|
font-weight: 700;
|
|
letter-spacing: -0.01em;
|
|
}
|
|
|
|
header .subtitle {
|
|
margin: 1px 0 0;
|
|
color: var(--color-muted);
|
|
font-size: var(--font-size-xs);
|
|
}
|
|
|
|
.connection {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
margin-top: 2px;
|
|
color: var(--color-muted);
|
|
font-size: var(--font-size-xs);
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.connection-dot {
|
|
width: 7px;
|
|
height: 7px;
|
|
border-radius: 50%;
|
|
flex-shrink: 0;
|
|
background: currentColor;
|
|
}
|
|
|
|
.connection-connecting {
|
|
color: var(--color-warning);
|
|
}
|
|
|
|
.connection-connected {
|
|
color: var(--color-success);
|
|
}
|
|
|
|
.connection-disconnected,
|
|
.connection-auth-error {
|
|
color: var(--color-danger);
|
|
}
|
|
|
|
.error-banner {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: var(--space-2);
|
|
padding: var(--space-2) var(--space-3);
|
|
border-radius: var(--radius-md);
|
|
background: var(--color-danger-bg);
|
|
color: var(--color-danger);
|
|
font-size: var(--font-size-sm);
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.error-icon {
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.error-text {
|
|
flex: 1;
|
|
}
|
|
|
|
.error-dismiss {
|
|
flex-shrink: 0;
|
|
border: none;
|
|
background: none;
|
|
color: inherit;
|
|
font-size: 15px;
|
|
line-height: 1;
|
|
padding: 0;
|
|
cursor: pointer;
|
|
opacity: 0.65;
|
|
}
|
|
|
|
.error-dismiss:hover {
|
|
opacity: 1;
|
|
}
|
|
|
|
.status-card {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: var(--space-3);
|
|
padding: var(--space-4);
|
|
border-radius: var(--radius-lg);
|
|
border: 1px solid var(--color-border);
|
|
background: var(--color-surface);
|
|
}
|
|
|
|
.status-icon {
|
|
font-size: 22px;
|
|
line-height: 1;
|
|
}
|
|
|
|
.status-card-unlocked .status-icon {
|
|
color: var(--color-success);
|
|
}
|
|
|
|
.status-body {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.badge {
|
|
display: inline-block;
|
|
padding: 2px 9px;
|
|
border-radius: 999px;
|
|
font-weight: 600;
|
|
font-size: var(--font-size-xs);
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.02em;
|
|
}
|
|
|
|
.badge-locked {
|
|
background: var(--color-danger-bg);
|
|
color: var(--color-danger);
|
|
}
|
|
|
|
.badge-unlocked {
|
|
background: var(--color-success-bg);
|
|
color: var(--color-success);
|
|
}
|
|
|
|
.status-body .reason {
|
|
margin: var(--space-2) 0 0;
|
|
font-size: var(--font-size-md);
|
|
}
|
|
|
|
.status-body .reason-muted {
|
|
color: var(--color-muted);
|
|
}
|
|
|
|
.status-body .scope {
|
|
margin: var(--space-1) 0 0;
|
|
color: var(--color-muted);
|
|
font-size: var(--font-size-xs);
|
|
}
|
|
|
|
.account-actions {
|
|
display: flex;
|
|
gap: var(--space-2);
|
|
}
|
|
|
|
.ghost-button,
|
|
.primary-button {
|
|
flex: 1;
|
|
padding: 7px 10px;
|
|
border-radius: var(--radius-sm);
|
|
font: inherit;
|
|
font-weight: 600;
|
|
font-size: var(--font-size-sm);
|
|
cursor: pointer;
|
|
}
|
|
|
|
.ghost-button {
|
|
border: 1px solid var(--color-border);
|
|
background: transparent;
|
|
color: var(--color-text);
|
|
}
|
|
|
|
.ghost-button:hover {
|
|
background: var(--color-surface);
|
|
}
|
|
|
|
.primary-button {
|
|
width: 100%;
|
|
margin-top: var(--space-1);
|
|
border: none;
|
|
background: var(--color-accent);
|
|
color: var(--color-bg);
|
|
}
|
|
|
|
.primary-button:hover:not(:disabled) {
|
|
opacity: 0.9;
|
|
}
|
|
|
|
.primary-button:disabled {
|
|
opacity: 0.5;
|
|
cursor: default;
|
|
}
|
|
|
|
.settings-toggle {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
width: 100%;
|
|
padding: var(--space-2) 0;
|
|
border: none;
|
|
border-top: 1px solid var(--color-border);
|
|
background: none;
|
|
color: var(--color-muted);
|
|
font: inherit;
|
|
font-size: var(--font-size-sm);
|
|
cursor: pointer;
|
|
}
|
|
|
|
.settings-toggle:hover {
|
|
color: var(--color-text);
|
|
}
|
|
|
|
.settings-panel {
|
|
padding-top: var(--space-3);
|
|
border-top: 1px solid var(--color-border);
|
|
}
|
|
|
|
.settings-panel-header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
margin-bottom: var(--space-2);
|
|
}
|
|
|
|
.settings-panel h2 {
|
|
margin: 0;
|
|
font-size: var(--font-size-md);
|
|
}
|
|
|
|
.settings-collapse {
|
|
border: none;
|
|
background: none;
|
|
color: var(--color-muted);
|
|
font: inherit;
|
|
font-size: var(--font-size-xs);
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.settings-collapse:hover {
|
|
color: var(--color-text);
|
|
}
|
|
|
|
.settings-panel h3 {
|
|
margin: 0 0 var(--space-2);
|
|
font-size: var(--font-size-xs);
|
|
font-weight: 600;
|
|
color: var(--color-muted);
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.03em;
|
|
}
|
|
|
|
.settings-panel label {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: var(--space-2);
|
|
margin-bottom: var(--space-2);
|
|
font-size: var(--font-size-sm);
|
|
color: var(--color-muted);
|
|
}
|
|
|
|
.threshold-input {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
flex-shrink: 0;
|
|
color: var(--color-text);
|
|
}
|
|
|
|
.threshold-input input {
|
|
width: 48px;
|
|
padding: 4px 6px;
|
|
border: 1px solid var(--color-border);
|
|
border-radius: var(--radius-sm);
|
|
background: var(--color-surface);
|
|
color: inherit;
|
|
font: inherit;
|
|
text-align: right;
|
|
}
|
|
|
|
.threshold-input input:focus {
|
|
outline: 2px solid var(--color-accent);
|
|
outline-offset: 1px;
|
|
}
|